Commit 8315a4c6 by 东州 翁

Merge branch 'develop' of 120.24.24.239:8timerv2/8timerapiv200 into wdz

# Conflicts:
#	src/main/java/cn/timer/api/controller/yggl/YgglController.java
parents a28cc7ad bea51ce9
......@@ -341,7 +341,7 @@
</repositories>
<build>
<finalName>yl8timer</finalName>
<finalName>8timer-api</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
......@@ -130,7 +130,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@ApiModelProperty(value="工作性质 1全职、2实习生、3兼职、4劳务派遣、5劳务、6派遣、7外包、8退休返聘",example="101")
private Integer jobType;
@ApiModelProperty(value="员工状态 1正式、2试用、3离职中、4已离职",example="101")
@ApiModelProperty(value="员工状态 1试用、2正式、3离职中、4已离职",example="101")
private Integer jobStatus;
@ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间")
......
package cn.timer.api.config.quartz;
//@Configuration
public class SchedulerConfig {
// @Bean(name = "SchedulerFactory")
// public SchedulerFactoryBean schedulerFactoryBean() throws IOException {
// SchedulerFactoryBean factory = new SchedulerFactoryBean();
// factory.setQuartzProperties(quartzProperties());
// return factory;
// }
//
// @Bean
// public Properties quartzProperties() throws IOException {
// PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
// propertiesFactoryBean.setLocation(new ClassPathResource("/quartz.properties"));
// // 在quartz.properties中的属性被读取并注入后再初始化对象
// propertiesFactoryBean.afterPropertiesSet();
// return propertiesFactoryBean.getObject();
// }
//
// /*
// * quartz初始化监听器
// */
// @Bean
// public QuartzInitializerListener executorListener() {
// return new QuartzInitializerListener();
// }
//
// /*
// * 通过SchedulerFactoryBean获取Scheduler的实例
// */
// @Bean(name = "Scheduler")
// public Scheduler scheduler() throws IOException {
// return schedulerFactoryBean().getScheduler();
// }
}
package cn.timer.api.controller.quartz;
import java.util.HashMap;
import java.util.Map;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.TriggerBuilder;
import org.quartz.TriggerKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.github.pagehelper.PageInfo;
import cn.timer.api.bean.quartz.JobAndTrigger;
import cn.timer.api.config.quartz.BaseJob;
import cn.timer.api.dao.quartz.JobAndTriggerMapper;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "99.0 Quartz")
@RestController
@RequestMapping(value = "/quartz", produces = { "application/json" })
public class JobController {
@Autowired
private JobAndTriggerMapper jobAndTriggerMapper;
// 加入Qulifier注解,通过名称注入bean
@Autowired
// @Qualifier("Scheduler")
private Scheduler scheduler;
@SuppressWarnings("unused")
private static Logger log = LoggerFactory.getLogger(JobController.class);
@PostMapping(value = "/addjob")
@ApiOperation(value = "新增任务", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> addjob(@RequestParam(value = "jobClassName") String jobClassName,
@RequestParam(value = "jobGroupName") String jobGroupName,
@RequestParam(value = "cronExpression") String cronExpression) throws Exception {
addJob(jobClassName, jobGroupName, cronExpression);
return ResultUtil.success("新增定时任务成功");
}
public void addJob(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
// 启动调度器
scheduler.start();
// 构建job信息
JobDetail jobDetail = JobBuilder.newJob(getClass(jobClassName).getClass())
.withIdentity(jobClassName, jobGroupName).build();
// 表达式调度构建器(即任务执行的时间)
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
// 按新的cronExpression表达式构建一个新的trigger
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(jobClassName, jobGroupName)
.withSchedule(scheduleBuilder).build();
try {
scheduler.scheduleJob(jobDetail, trigger);
} catch (SchedulerException e) {
System.out.println("创建定时任务失败" + e);
throw new Exception("创建定时任务失败");
}
}
@PostMapping(value = "/pausejob")
@ApiOperation(value = "暂停任务", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> pausejob(@RequestParam(value = "jobClassName") String jobClassName,
@RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
jobPause(jobClassName, jobGroupName);
return ResultUtil.success("暂停定时任务成功");
}
public void jobPause(String jobClassName, String jobGroupName) throws Exception {
scheduler.pauseJob(JobKey.jobKey(jobClassName, jobGroupName));
}
@PostMapping(value = "/resumejob")
@ApiOperation(value = "恢复任务", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> resumejob(@RequestParam(value = "jobClassName") String jobClassName,
@RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
jobresume(jobClassName, jobGroupName);
return ResultUtil.success("恢复定时任务成功");
}
public void jobresume(String jobClassName, String jobGroupName) throws Exception {
scheduler.resumeJob(JobKey.jobKey(jobClassName, jobGroupName));
}
@PostMapping(value = "/reschedulejob")
@ApiOperation(value = "重新设置任务", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> rescheduleJob(@RequestParam(value = "jobClassName") String jobClassName,
@RequestParam(value = "jobGroupName") String jobGroupName,
@RequestParam(value = "cronExpression") String cronExpression) throws Exception {
jobreschedule(jobClassName, jobGroupName, cronExpression);
return ResultUtil.success("重设定时任务成功");
}
public void jobreschedule(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
try {
TriggerKey triggerKey = TriggerKey.triggerKey(jobClassName, jobGroupName);
// 表达式调度构建器
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
// 按新的cronExpression表达式重新构建trigger
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
// 按新的trigger重新设置job执行
scheduler.rescheduleJob(triggerKey, trigger);
} catch (SchedulerException e) {
System.out.println("更新定时任务失败" + e);
throw new Exception("更新定时任务失败");
}
}
@PostMapping(value = "/deletejob")
@ApiOperation(value = "删除任务", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> deletejob(@RequestParam(value = "jobClassName") String jobClassName,
@RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
jobdelete(jobClassName, jobGroupName);
return ResultUtil.success("删除成功");
}
public void jobdelete(String jobClassName, String jobGroupName) throws Exception {
scheduler.pauseTrigger(TriggerKey.triggerKey(jobClassName, jobGroupName));
scheduler.unscheduleJob(TriggerKey.triggerKey(jobClassName, jobGroupName));
scheduler.deleteJob(JobKey.jobKey(jobClassName, jobGroupName));
}
@GetMapping(value = "/queryjob")
@ApiOperation(value = "查询任务", httpMethod = "GET", notes = "接口发布说明")
public Result<Map<String, Object>> queryjob(@RequestParam(value = "pageNum") Integer pageNum,
@RequestParam(value = "pageSize") Integer pageSize) {
PageInfo<JobAndTrigger> jobAndTrigger = jobAndTriggerMapper.getJobAndTriggerDetails(pageNum, pageSize);
Map<String, Object> map = new HashMap<String, Object>();
map.put("JobAndTrigger", jobAndTrigger);
map.put("number", jobAndTrigger.getTotal());
return ResultUtil.data(map, "查询成功");
}
public static BaseJob getClass(String classname) throws Exception {
Class<?> class1 = Class.forName(classname);
return (BaseJob) class1.newInstance();
}
}
//package cn.timer.api.controller.quartz;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import org.quartz.CronScheduleBuilder;
//import org.quartz.CronTrigger;
//import org.quartz.JobBuilder;
//import org.quartz.JobDetail;
//import org.quartz.JobKey;
//import org.quartz.Scheduler;
//import org.quartz.SchedulerException;
//import org.quartz.TriggerBuilder;
//import org.quartz.TriggerKey;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.github.pagehelper.PageInfo;
//
//import cn.timer.api.bean.quartz.JobAndTrigger;
//import cn.timer.api.config.quartz.TestJob;
//import cn.timer.api.dao.quartz.JobAndTriggerMapper;
//import cn.timer.api.utils.Result;
//import cn.timer.api.utils.ResultUtil;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//
//@Api(tags = "99.0 Quartz")
//@RestController
//@RequestMapping(value = "/quartz", produces = { "application/json" })
//public class JobController {
//
// @Autowired
// private Scheduler scheduler;
//
// @PostMapping(value = "/addjob")
// @ApiOperation(value = "新增任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> addjob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName,
// @RequestParam(value = "cronExpression") String cronExpression) throws Exception {
// addJob(jobClassName, jobGroupName, cronExpression);
// return ResultUtil.success("新增定时任务成功");
// }
//
// public void addJob(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
//
// // 启动调度器
// scheduler.start();
//
// // 构建job信息
// JobDetail jobDetail = JobBuilder.newJob(TestJob.class)
// .withIdentity(jobClassName, jobGroupName).build();
//
// // 表达式调度构建器(即任务执行的时间)
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
//
// // 按新的cronExpression表达式构建一个新的trigger
// CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(jobClassName, jobGroupName)
// .withSchedule(scheduleBuilder).build();
//
// try {
// scheduler.scheduleJob(jobDetail, trigger);
//
// } catch (SchedulerException e) {
// System.out.println("创建定时任务失败" + e);
// throw new Exception("创建定时任务失败");
// }
// }
//
// @PostMapping(value = "/pausejob")
// @ApiOperation(value = "暂停任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> pausejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobPause(jobClassName, jobGroupName);
// return ResultUtil.success("暂停定时任务成功");
// }
//
// public void jobPause(String jobClassName, String jobGroupName) throws Exception {
// scheduler.pauseJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
// @PostMapping(value = "/resumejob")
// @ApiOperation(value = "恢复任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> resumejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobresume(jobClassName, jobGroupName);
// return ResultUtil.success("恢复定时任务成功");
// }
//
// public void jobresume(String jobClassName, String jobGroupName) throws Exception {
// scheduler.resumeJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
// @PostMapping(value = "/reschedulejob")
// @ApiOperation(value = "重新设置任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> rescheduleJob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName,
// @RequestParam(value = "cronExpression") String cronExpression) throws Exception {
// jobreschedule(jobClassName, jobGroupName, cronExpression);
// return ResultUtil.success("重设定时任务成功");
// }
//
// public void jobreschedule(String jobClassName, String jobGroupName, String cronExpression) throws Exception {
// try {
// TriggerKey triggerKey = TriggerKey.triggerKey(jobClassName, jobGroupName);
// // 表达式调度构建器
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
//
// CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
//
// // 按新的cronExpression表达式重新构建trigger
// trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
//
// // 按新的trigger重新设置job执行
// scheduler.rescheduleJob(triggerKey, trigger);
// } catch (SchedulerException e) {
// System.out.println("更新定时任务失败" + e);
// throw new Exception("更新定时任务失败");
// }
// }
//
// @PostMapping(value = "/deletejob")
// @ApiOperation(value = "删除任务", httpMethod = "POST", notes = "接口发布说明")
// public Result<Void> deletejob(@RequestParam(value = "jobClassName") String jobClassName,
// @RequestParam(value = "jobGroupName") String jobGroupName) throws Exception {
// jobdelete(jobClassName, jobGroupName);
// return ResultUtil.success("删除成功");
// }
//
// public void jobdelete(String jobClassName, String jobGroupName) throws Exception {
// scheduler.pauseTrigger(TriggerKey.triggerKey(jobClassName, jobGroupName));
// scheduler.unscheduleJob(TriggerKey.triggerKey(jobClassName, jobGroupName));
// scheduler.deleteJob(JobKey.jobKey(jobClassName, jobGroupName));
// }
//
//}
......@@ -8,8 +8,7 @@ package cn.timer.api.controller.yggl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
......@@ -77,7 +76,6 @@ import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgAreaDto;
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgCityDto;
import cn.timer.api.dto.yggl.YgDrjqbDto;
import cn.timer.api.dto.yggl.YgDrsDto;
......@@ -118,7 +116,7 @@ public class YgglController {
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
//weng(籍贯)
// weng(籍贯)
@Autowired
private YgAreaDtoMapper ygAreaDtoMapper;
@Autowired
......@@ -126,14 +124,17 @@ public class YgglController {
@Autowired
private YgProDtoMapper ygProDtoMapper;
//weng(民族)
// weng(民族)
@Autowired
private YgMzDtoMapper ygMzDtoMapper;
//weng(人事仪表盘)
@Autowired
private YgtitleDtoMapper ygtitleDtoMapper;
/**
* 获取员工档案
*
* @param
* @return
*/
......@@ -146,7 +147,10 @@ public class YgglController {
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode).eq("emp_num", empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(),Level.DAY));
Date rz = ygglMainEmp.getRzTime();
if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(rz, new Date(), Level.DAY));
}
return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
}
......@@ -159,34 +163,46 @@ public class YgglController {
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode).eq("emp_num", empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
if (ygglMainEmp != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(),Level.DAY));
Date rz = ygglMainEmp.getRzTime();
if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY));
}
return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
}
/**
* 根据岗位id获取员工档案部门岗位名称
*
* @param
* @return
*/
@GetMapping(value = "/ygdabm/{gwid}")
@ApiOperation(value = "获取员工档案部门岗位名称", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
public Result<String> selectbmgw(@CurrentUser UserBean userBean,@PathVariable Integer gwid) {
if (gwid==null||gwid==0) {
return ResultUtil.data("无岗位","获取员工档案部门岗位名称成功");
public Result<String> selectbmgw(@CurrentUser UserBean userBean, @PathVariable Integer gwid) {
if (gwid == null || gwid == 0) {
return ResultUtil.data("无岗位", "获取员工档案部门岗位名称成功");
}
Integer orgCode = userBean.getOrgCode();
QueryWrapper<ZzglBmgwM> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode).eq("id", gwid);
String gw = ZzglBmgwM.builder().build().selectOne(queryWrapper).getName();
Integer bmid = ZzglBmgwM.builder().build().selectOne(queryWrapper).getUpId();
//QueryWrapper<ZzglBmgwM> queryWrapper1 = new QueryWrapper<>();
//queryWrapper1.eq("org_code", orgCode).eq("up_dept_id", gwid);
String bm = ZzglBmgwM.builder().build().selectOne(new QueryWrapper<ZzglBmgwM>().eq("org_code", orgCode).eq("id", bmid)).getName();
String bmgw = bm+"/"+gw;
return ResultUtil.data(bmgw,"获取员工档案部门岗位名称成功");
ZzglBmgwM zzglBmgwM = ZzglBmgwM.builder().build().selectOne(queryWrapper);
String gw = null;
Integer bmid = null;
if (zzglBmgwM != null) {
gw = zzglBmgwM.getName();
bmid = zzglBmgwM.getUpId();
}
// QueryWrapper<ZzglBmgwM> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("org_code", orgCode).eq("up_dept_id", gwid);
ZzglBmgwM z = ZzglBmgwM.builder().build()
.selectOne(new QueryWrapper<ZzglBmgwM>().eq("org_code", orgCode).eq("id", bmid));
String bm = null;
if (z != null) {
bm = z.getName();
}
String bmgw = bm + "/" + gw;
return ResultUtil.data(bmgw, "获取员工档案部门岗位名称成功");
}
/**
......@@ -250,8 +266,10 @@ public class YgglController {
}
}
}
/**
* 修改员工档案
*
* @param
* @return
*/
......@@ -268,8 +286,10 @@ public class YgglController {
}
return ResultUtil.error("请确认该员工是否存在!");
}
/**
* 员工搜索
*
* @param
* @return
*/
......@@ -291,9 +311,8 @@ public class YgglController {
ygQueryDto.getCurrentPage() == null ? 1 : ygQueryDto.getCurrentPage(),
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.
select("name","emp_num","bmgw_id","rz_time","job_type","phone","job_status").ne("job_status", 4)
.eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
queryWrapper.select("name", "emp_num", "bmgw_id", "rz_time", "job_type", "phone", "job_status")
.ne("job_status", 4).eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
.eq(j != null && j > -1, "job_status", j).in(!bList.isEmpty(), "bmgw_id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q));
......@@ -303,36 +322,41 @@ public class YgglController {
return ResultUtil.data(ygglMainEmpPage, "员工搜索成功");
// return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
}
/**
* 导入威力加强版
*
* @param
* @return
*/
@PostMapping(value = "/ygdas")
@ApiOperation(value = "导入威力加强版", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 7)
public Result<List<YgDrjqbDto>> ygdr(@CurrentUser UserBean userBean,@RequestBody YgDrsDto drList) {
public Result<List<YgDrjqbDto>> ygdr(@CurrentUser UserBean userBean, @RequestBody YgDrsDto drList) {
drList.setOrgCode(userBean.getOrgCode());
YgDrsDto tofList = errorFilter(drList);//滤嘴,过滤信息
if (tofList.getDrList().size()==0) return ResultUtil.data(tofList.getErrorList(), "导入发生错误人员名单");
YgDrsDto tof = optFilter(tofList);//彻底规范好数据
List<YgDrjqbDto> trueList = tof.getDrList();//拿出正确的信息
List<YgDrjqbDto> errorList = tof.getErrorList();//拿出错误的信息
if (trueList.size()==0) return ResultUtil.data(errorList, "导入发生错误人员名单");
YgDrsDto tofList = errorFilter(drList);// 滤嘴,过滤信息
if (tofList.getDrList().size() == 0)
return ResultUtil.data(tofList.getErrorList(), "导入发生错误人员名单");
YgDrsDto tof = optFilter(tofList);// 彻底规范好数据
List<YgDrjqbDto> trueList = tof.getDrList();// 拿出正确的信息
List<YgDrjqbDto> errorList = tof.getErrorList();// 拿出错误的信息
if (trueList.size() == 0)
return ResultUtil.data(errorList, "导入发生错误人员名单");
for (YgDrjqbDto e : trueList) {
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper).eq(QyzxEmpLogin::getPhone,e.getPhone()).one();
//证件类型为0
Integer jobType = Integer.valueOf(e.getJobType());//工作类型
Integer syq=Integer.valueOf(e.getSyq());//试用期
Integer sex=Integer.valueOf(e.getSex());//性别,还差一个岗位
Integer gw= e.getHavebmid();
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(QyzxEmpLogin::getPhone, e.getPhone()).one();
// 证件类型为0
Integer jobType = Integer.valueOf(e.getJobType());// 工作类型
Integer syq = Integer.valueOf(e.getSyq());// 试用期
Integer sex = Integer.valueOf(e.getSex());// 性别,还差一个岗位
Integer gw = e.getHavebmid();
String jobNum = e.getYgnbgh();
Integer jg = e.getJg();
Date birthday = e.getBirthday();
//入职日期
// 入职日期
Date rzdate = new Date();
SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");//正杠
if (e.getRzTime().indexOf("-")!=-1) {
SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");// 正杠
if (e.getRzTime().indexOf("-") != -1) {
try {
rzdate = straight.parse(e.getRzTime());
} catch (ParseException PException) {
......@@ -342,8 +366,8 @@ public class YgglController {
continue;
}
}
//判断是否已有员工登录表
if (login==null) {// 添加三张表
// 判断是否已有员工登录表
if (login == null) {// 添加三张表
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(e.getPhone()).pw(Md5.md5("123456"))
.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(e.getName()).build();
if (!qyzxEmpLogin.insert()) {
......@@ -354,42 +378,36 @@ public class YgglController {
}
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode())
.userType(2).status(1).build().insert();// userType2普通员工
YgglMainEmp emp = YgglMainEmp.builder()
.name(e.getName()).phone(e.getPhone()).zjType(0)
.zjNum(e.getZj()).jobType(jobType).rzTime(rzdate)
.updateTime(new Date()).updateMan(userBean.getEmpNum()).syq(syq)
.sex(sex).jobNum(jobNum).bmgwId(gw)
.empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode()).build();
QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode()).userType(2)
.status(1).build().insert();// userType2普通员工
YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone()).zjType(0).zjNum(e.getZj())
.jobType(jobType).rzTime(rzdate).updateTime(new Date()).updateMan(userBean.getEmpNum()).syq(syq)
.sex(sex).jobNum(jobNum).bmgwId(gw).empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode())
.build();
emp.insert();
new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getId, emp.getId())
.set(birthday!=null, YgglMainEmp::getBirthday, birthday)
.set(jg!=null && jg!=0, YgglMainEmp::getJg, jg).update();
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getId, emp.getId())
.set(birthday != null, YgglMainEmp::getBirthday, birthday)
.set(jg != null && jg != 0, YgglMainEmp::getJg, jg).update();
//return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
}else {
// return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
} else {
// 添加两张表
YgglMainEmp ishad = YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>()
YgglMainEmp ishad = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.eq("phone", e.getPhone()).eq("org_code", userBean.getOrgCode()));
if (ishad == null) {
// 员工权限表(未定)
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(userBean.getOrgCode()).userType(2).build().insert();// 2普通员工
YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone())
.zjType(0).zjNum(e.getZj())
.jobType(jobType).rzTime(rzdate)
.updateTime(new Date()).updateMan(userBean.getEmpNum())
.syq(syq).sex(sex)
.jobNum(jobNum).empNum(login.getId()).orgCode(userBean.getOrgCode()).build();
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(userBean.getOrgCode()).userType(2).build()
.insert();// 2普通员工
YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone()).zjType(0)
.zjNum(e.getZj()).jobType(jobType).rzTime(rzdate).updateTime(new Date())
.updateMan(userBean.getEmpNum()).syq(syq).sex(sex).jobNum(jobNum).empNum(login.getId())
.orgCode(userBean.getOrgCode()).build();
emp.insert();
new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getId, emp.getId())
.set(birthday!=null, YgglMainEmp::getBirthday, birthday)
.set(jg!=null && jg!=0, YgglMainEmp::getJg, jg).update();
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getId, emp.getId())
.set(birthday != null, YgglMainEmp::getBirthday, birthday)
.set(jg != null && jg != 0, YgglMainEmp::getJg, jg).update();
} else {
e.setError("该手机号码已被使用");
errorList.add(e);
......@@ -398,13 +416,13 @@ public class YgglController {
}
}
}
if (errorList.size()==0) {
if (errorList.size() == 0) {
return ResultUtil.success("员工全部导入成功!");
}
return ResultUtil.data(errorList, "导入发生错误人员名单");
}
//错误选项过滤器
// 错误选项过滤器
public YgDrsDto errorFilter(YgDrsDto ygDrsDto) {
List<YgDrjqbDto> drList = ygDrsDto.getDrList();
List<YgDrjqbDto> newList = new ArrayList<YgDrjqbDto>(drList);
......@@ -413,62 +431,80 @@ public class YgglController {
Iterator<YgDrjqbDto> itDr = drList.iterator();
@SuppressWarnings("unused")
YgDrjqbDto a = drList.get(0);//一个员工导入
YgDrjqbDto a = drList.get(0);// 一个员工导入
Integer size = drList.size();
for (Integer i=0; i<size;i++) {//
YgDrjqbDto d = newList.get(i);//计数器
for (Integer i = 0; i < size; i++) {//
YgDrjqbDto d = newList.get(i);// 计数器
if (itDr.hasNext()) {
a=itDr.next();
a = itDr.next();
}
//请填写必填项
String name = newList.get(i).getName(); String phone = newList.get(i).getPhone();
String sex = newList.get(i).getSex(); String zj = newList.get(i).getZj();
if (StrUtil.hasBlank(name)
|| StrUtil.hasBlank(phone)
|| StrUtil.hasBlank(sex)
|| StrUtil.hasBlank(zj)) {
// 请填写必填项
String name = newList.get(i).getName();
String phone = newList.get(i).getPhone();
String sex = newList.get(i).getSex();
String zj = newList.get(i).getZj();
if (StrUtil.hasBlank(name) || StrUtil.hasBlank(phone) || StrUtil.hasBlank(sex) || StrUtil.hasBlank(zj)) {
d.setError("请填写必填项");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
//手机号码格式不对
// 手机号码格式不对
String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
if (phone.length()!= 11) {
if (phone.length() != 11) {
d.setError("手机号应为11位数");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if(!isMatch){
if (!isMatch) {
d.setError("手机号格式不对");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
//手机号码已被使用
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper).eq(QyzxEmpLogin::getPhone,phone).eq(QyzxEmpLogin::getOrgId, orgCode).one();
if (login!=null) {
// 手机号码已被使用
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(QyzxEmpLogin::getPhone, phone).eq(QyzxEmpLogin::getOrgId, orgCode).one();
if (login != null) {
d.setError("手机号码已被使用");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
//证件号码信息有误
// 证件号码信息有误
if (zj == null || "".equals(zj)) {
d.setError("证件号码信息有误");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
String regularExpression = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
String regularExpression = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|"
+ "(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
boolean matches = zj.matches(regularExpression);
if (!matches) {
d.setError("证件号码信息有误");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
try {
if (zj.length() == 18) {
char[] charArray = zj.toCharArray();
//前十七位加权因子
int[] idCardWi = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
//这是除以11后,可能产生的11位余数对应的验证码
String[] idCardY = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"};
// 前十七位加权因子
int[] idCardWi = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
// 这是除以11后,可能产生的11位余数对应的验证码
String[] idCardY = { "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2" };
int sum = 0;
for (Integer j = 0; j < idCardWi.length; j++) {
int current = Integer.parseInt(String.valueOf(charArray[j]));
......@@ -478,60 +514,72 @@ public class YgglController {
char idCardLast = charArray[17];
int idCardMod = sum % 11;
if (idCardY[idCardMod].toUpperCase().equals(String.valueOf(idCardLast).toUpperCase())) {
//System.out.println("成功,接着完善员工的个人信息");
// System.out.println("成功,接着完善员工的个人信息");
String birth = zj.substring(6, 14);
String birthday =birth.substring(0, 4)+"-"+birth.substring(4, 6)+"-"+birth.substring(6,8);
String birthday = birth.substring(0, 4) + "-" + birth.substring(4, 6) + "-"
+ birth.substring(6, 8);
SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");
d.setBirthday(straight.parse(birthday));
d.setJg(Integer.parseInt(zj.substring(0, 6)));
} else {
//System.out.println("身份证最后一位:" + String.valueOf(idCardLast).toUpperCase() +
// System.out.println("身份证最后一位:" + String.valueOf(idCardLast).toUpperCase() +
// "错误,正确的应该是:" + idCardY[idCardMod].toUpperCase());
//return false;
// return false;
d.setError("证件号码信息有误");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
}else {
//给15位数的添加生日籍贯
} else {
// 给15位数的添加生日籍贯
String birth = zj.substring(6, 12);
String birthday = "19" + birth.substring(0, 2) + "-" + birth.substring(2, 4) + "-" + birth.substring(4, 6);
String birthday = "19" + birth.substring(0, 2) + "-" + birth.substring(2, 4) + "-"
+ birth.substring(4, 6);
SimpleDateFormat straight = new SimpleDateFormat("yyyy-MM-dd");
d.setBirthday(straight.parse(birthday));
d.setJg(Integer.parseInt(zj.substring(0, 6)));
}
} catch (Exception e) {
e.printStackTrace();
//System.out.println("异常:" + zj);
//return false;
// System.out.println("异常:" + zj);
// return false;
d.setError("证件号码信息有误");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
//部门岗位有误
String oneb = newList.get(i).getOneb();String twob = newList.get(i).getTwob();
String threeb = newList.get(i).getThreeb();String fourb = newList.get(i).getFourb();
// 部门岗位有误
String oneb = newList.get(i).getOneb();
String twob = newList.get(i).getTwob();
String threeb = newList.get(i).getThreeb();
String fourb = newList.get(i).getFourb();
String gw = newList.get(i).getGw();
String[] bms = {oneb,twob,threeb,fourb};
if (StrUtil.hasBlank(gw) && StrUtil.hasBlank(oneb)
&& StrUtil.hasBlank(twob) && StrUtil.hasBlank(threeb)
&& StrUtil.hasBlank(fourb)) { //没填写岗位,通过~ //
}else {
//填写了部门岗位,办他!
Integer isHaveBmgw = isHavebmgw(bms,gw,orgCode);
String[] bms = { oneb, twob, threeb, fourb };
if (StrUtil.hasBlank(gw) && StrUtil.hasBlank(oneb) && StrUtil.hasBlank(twob) && StrUtil.hasBlank(threeb)
&& StrUtil.hasBlank(fourb)) { // 没填写岗位,通过~ //
} else {
// 填写了部门岗位,办他!
Integer isHaveBmgw = isHavebmgw(bms, gw, orgCode);
if (isHaveBmgw == 0) {
d.setError("部门岗位有误");
errorList.add(d);itDr.remove();i++;continue;
}else {
//获取到部门岗位id啦!
errorList.add(d);
itDr.remove();
i++;
continue;
} else {
// 获取到部门岗位id啦!
d.setHavebmid(isHaveBmgw);
}
}
}//for循环完毕!
} // for循环完毕!
YgDrsDto tofList = new YgDrsDto(drList, errorList, orgCode);
return tofList;
}
//选填项过滤器
// 选填项过滤器
public YgDrsDto optFilter(YgDrsDto ygDrsDto) {
List<YgDrjqbDto> drList = ygDrsDto.getDrList();
List<YgDrjqbDto> newList = new ArrayList<YgDrjqbDto>(drList);
......@@ -540,108 +588,120 @@ public class YgglController {
Iterator<YgDrjqbDto> itDr = drList.iterator();
@SuppressWarnings("unused")
YgDrjqbDto a = drList.get(0);//一个员工导入
YgDrjqbDto a = drList.get(0);// 一个员工导入
Integer size = drList.size();
for (Integer i=0; i<size;i++) {//
YgDrjqbDto d = newList.get(i);//计数器
for (Integer i = 0; i < size; i++) {//
YgDrjqbDto d = newList.get(i);// 计数器
if (itDr.hasNext()) {
a=itDr.next();
}
//for (YgDrjqbDto d : drList) {
String ygnbgh = d.getYgnbgh(); String sex = d.getSex();
String jobType = d.getJobType();String jobStatus = d.getJobStatus();
String rzTime = d.getRzTime();String syq = d.getSyq();
String zy = d.getZy();String address = d.getAddress();
String hjAddress = d.getHkAddress();String qq = d.getQq();
String weixin =d.getWeixin(); String email = d.getEmail();
String[] bathroom = {ygnbgh,sex,jobType,jobStatus,rzTime,syq,zy,address,hjAddress,qq,weixin,email};
boolean child=takeshower(bathroom);
a = itDr.next();
}
// for (YgDrjqbDto d : drList) {
String ygnbgh = d.getYgnbgh();
String sex = d.getSex();
String jobType = d.getJobType();
String jobStatus = d.getJobStatus();
String rzTime = d.getRzTime();
String syq = d.getSyq();
String zy = d.getZy();
String address = d.getAddress();
String hjAddress = d.getHkAddress();
String qq = d.getQq();
String weixin = d.getWeixin();
String email = d.getEmail();
String[] bathroom = { ygnbgh, sex, jobType, jobStatus, rzTime, syq, zy, address, hjAddress, qq, weixin,
email };
boolean child = takeshower(bathroom);
if (child == false) {
d.setError("填写内容不要大于50字数");
errorList.add(d);itDr.remove();i++;continue;
errorList.add(d);
itDr.remove();
i++;
continue;
}
//公司内部工号
// 公司内部工号
if (ygnbgh != null && ygnbgh.length() != 0) {
d.setYgnbgh(ygnbgh.trim());
}else {
} else {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String bh = format.format(new Date())+orgCode+i+System.currentTimeMillis();
String bh = format.format(new Date()) + orgCode + i + System.currentTimeMillis();
d.setYgnbgh(bh);
}
//男女(最大优化)
// 男女(最大优化)
d.setSex(YgEnumInterface.sex.isMan(sex));
//工作性质(最大优化)
// 工作性质(最大优化)
d.setJobType(YgEnumInterface.YgJobType.choose(jobType));
//员工状态(最大优化)
// 员工状态(最大优化)
d.setJobStatus(YgEnumInterface.jobStatus.isZhen(jobStatus));
//入职日期(最大优化)
// 入职日期(最大优化)
d.setRzTime(YgEnumInterface.rzTime.tranTime2(YgEnumInterface.rzTime.tranTime(rzTime)));
//试用期(最大优化)
// 试用期(最大优化)
d.setSyq(YgEnumInterface.syq.choose(syq));
}
YgDrsDto clear = new YgDrsDto(drList, errorList, orgCode);
return clear;
}
//浴池,洗去选填项字节大于100的选项
public boolean takeshower(String[] bathroom){
// 浴池,洗去选填项字节大于100的选项
public boolean takeshower(String[] bathroom) {
for (String b : bathroom) {
if (b.length()>100) {
return false;}}
return true;}
if (b.length() > 100) {
return false;
}
}
return true;
}
//判断是否导入组织部门
public Integer isHavebmgw(String[] bms,String gw,Integer orgCode) {
//将姓名转为部门岗位对象
// 判断是否导入组织部门
public Integer isHavebmgw(String[] bms, String gw, Integer orgCode) {
// 将姓名转为部门岗位对象
List<ZzglBmgwM> gwList = new ArrayList<ZzglBmgwM>();
//判断有几个部门,且这几个部门是否属实,里面不包括岗位
// 判断有几个部门,且这几个部门是否属实,里面不包括岗位
for (String bm : bms) {
if(!StrUtil.hasBlank(bm)){
ZzglBmgwM ibm = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getName, bm)
.eq(ZzglBmgwM::getOrgCode,orgCode)
.eq(ZzglBmgwM::getType, 0).one(); //选择部门类型0为部门,1为岗位
if (ibm == null) { return 0;} //找不到有相关名称的部门则报错
if (!StrUtil.hasBlank(bm)) {
ZzglBmgwM ibm = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getName, bm)
.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).one(); // 选择部门类型0为部门,1为岗位
if (ibm == null) {
return 0;
} // 找不到有相关名称的部门则报错
gwList.add(ibm);
}else {
} else {
break;
}
}
Integer qiantao = qiantao(gwList,gw,0,orgCode);
if (qiantao!=0) {
return qiantao;//组织部门成立!
}else {
return 0;//失败
Integer qiantao = qiantao(gwList, gw, 0, orgCode);
if (qiantao != 0) {
return qiantao;// 组织部门成立!
} else {
return 0;// 失败
}
};
//判断是否导入组织部门的嵌套并寻找到正确岗位id
public Integer qiantao(List<ZzglBmgwM>gwList,String gw,Integer upid,Integer orgCode) {
//重写
if (upid!=0 && !gwList.get(0).getUpId().equals(upid)) {
// 判断是否导入组织部门的嵌套并寻找到正确岗位id
public Integer qiantao(List<ZzglBmgwM> gwList, String gw, Integer upid, Integer orgCode) {
// 重写
if (upid != 0 && !gwList.get(0).getUpId().equals(upid)) {
return 0;
}
upid = gwList.get(0).getId();
if (gwList.size() == 1) {
ZzglBmgwM igw = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getName, gw)
.eq(ZzglBmgwM::getUpId, upid)
.eq(ZzglBmgwM::getOrgCode,orgCode)
.eq(ZzglBmgwM::getType, 1).one();
if (igw==null) {
ZzglBmgwM igw = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getName, gw)
.eq(ZzglBmgwM::getUpId, upid).eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 1).one();
if (igw == null) {
return 0;
}
return igw.getId();
}
gwList.remove(0);
Integer q = qiantao(gwList,gw,upid,orgCode);
Integer q = qiantao(gwList, gw, upid, orgCode);
return q;
};
/**
* 导出员工
*
* @param
* @return
*/
......@@ -649,13 +709,15 @@ public class YgglController {
@ApiOperation(value = "导出", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 8)
public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
int[] jList = {1,2,3};
List<YgglMainEmp> list = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getJobStatus, jList).list();
int[] jList = { 1, 2, 3 };
List<YgglMainEmp> list = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getJobStatus, jList).list();
return ResultUtil.data(list, "导出员工成功");
}
/**
* 获取员工教育经历表
*
* @param
* @return
*/
......@@ -663,8 +725,9 @@ public class YgglController {
@ApiOperation(value = "获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 9)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean) {
List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build().selectList(new QueryWrapper<YgglAttaJyjlb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaJyjlb> ygglAttaJyjlbss = YgglAttaJyjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaJyjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaJyjlbss, "获取员工教育经历表成功");
}
......@@ -680,6 +743,7 @@ public class YgglController {
/**
* 添加/修改员工教育经历表
*
* @param
* @return
*/
......@@ -695,6 +759,7 @@ public class YgglController {
/**
* 删除员工教育经历表
*
* @param
* @return
*/
......@@ -709,6 +774,7 @@ public class YgglController {
/**
* 获取员工培训经历信息表
*
* @param
* @return
*/
......@@ -716,10 +782,12 @@ public class YgglController {
@ApiOperation(value = "获取员工培训经历信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 13)
public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean) {
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build().selectList(new QueryWrapper<YgglAttaPxjlxxb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
}
// 获取员工培训经历信息表
@GetMapping(value = "/pxjlxxb/{empNum}")
@ApiOperation(value = "获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -729,8 +797,10 @@ public class YgglController {
new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
}
/**
* 添加/修改员工培训经历信息表
*
* @param
* @return
*/
......@@ -744,8 +814,10 @@ public class YgglController {
ygglAttaPxjlxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaPxjlxxb, "添加/修改员工培训经历信息表成功");
}
/**
* 删除员工培训经历信息表
*
* @param
* @return
*/
......@@ -757,8 +829,10 @@ public class YgglController {
return ResultUtil.data(YgglAttaPxjlxxb.builder().build()
.delete(new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工培训经历信息表成功");
}
/**
* 获取员工工作经历表
*
* @param
* @return
*/
......@@ -766,10 +840,12 @@ public class YgglController {
@ApiOperation(value = "获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 17)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(new QueryWrapper<YgglAttaGzjlb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaGzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
}
// 获取员工工作经历表
@GetMapping(value = "/gzjlb/{empNum}")
@ApiOperation(value = "获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -779,8 +855,10 @@ public class YgglController {
new QueryWrapper<YgglAttaGzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
}
/**
* 添加/修改员工工作经历表
*
* @param
* @return
*/
......@@ -793,8 +871,10 @@ public class YgglController {
ygglAttaGzjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaGzjlb, "添加/修改员工工作经历表成功");
}
/**
* 删除员工工作经历表
*
* @param
* @return
*/
......@@ -806,8 +886,10 @@ public class YgglController {
return ResultUtil.data(YgglAttaGzjlb.builder().build()
.delete(new QueryWrapper<YgglAttaGzjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工工作经历表成功");
}
/**
* 获取员工职称信息表
*
* @param
* @return
*/
......@@ -815,10 +897,12 @@ public class YgglController {
@ApiOperation(value = "获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 21)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(new QueryWrapper<YgglAttaZcxxb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaZcxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
}
// 获取员工职称信息表
@GetMapping(value = "/zcxxb/{empNum}")
@ApiOperation(value = "获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -828,8 +912,10 @@ public class YgglController {
new QueryWrapper<YgglAttaZcxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
}
/**
* 添加/修改员工职称信息表
*
* @param
* @return
*/
......@@ -842,8 +928,10 @@ public class YgglController {
ygglAttaZcxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaZcxxb, "添加/修改员工职称信息表成功");
}
/**
* 删除员工职称信息表
*
* @param
* @return
*/
......@@ -855,8 +943,10 @@ public class YgglController {
return ResultUtil.data(YgglAttaZcxxb.builder().build()
.delete(new QueryWrapper<YgglAttaZcxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工职称信息表成功");
}
/**
* 获取员工证书证件表
*
* @param
* @return
*/
......@@ -864,10 +954,12 @@ public class YgglController {
@ApiOperation(value = "获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 25)
public Result<List<YgglAttaZszjb>> selectzszjb(@CurrentUser UserBean userBean) {
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build().selectList(new QueryWrapper<YgglAttaZszjb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaZszjb> ygglAttaZszjbs = YgglAttaZszjb.builder().build()
.selectList(new QueryWrapper<YgglAttaZszjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
}
// 获取员工证书证件表
@GetMapping(value = "/zszjb/{empNum}")
@ApiOperation(value = "获取员工证书证件表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -877,8 +969,10 @@ public class YgglController {
new QueryWrapper<YgglAttaZszjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
}
/**
* 添加/修改员工证书证件表
*
* @param
* @return
*/
......@@ -891,8 +985,10 @@ public class YgglController {
ygglAttaZszjb.insertOrUpdate();
return ResultUtil.data(ygglAttaZszjb, "添加/修改员工证书证件表成功");
}
/**
* 删除员工证书证件表
*
* @param
* @return
*/
......@@ -904,8 +1000,10 @@ public class YgglController {
return ResultUtil.data(YgglAttaZszjb.builder().build()
.delete(new QueryWrapper<YgglAttaZszjb>().eq("org_code", orgCode).eq("id", id)), "删除员工证书证件表成功");
}
/**
* 获取员工联系信息表
*
* @param
* @return
*/
......@@ -913,10 +1011,12 @@ public class YgglController {
@ApiOperation(value = "获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 29)
public Result<List<YgglAttaLxxxb>> selectlxxxb(@CurrentUser UserBean userBean) {
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build().selectList(new QueryWrapper<YgglAttaLxxxb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaLxxxb> ygglAttaLxxxbs = YgglAttaLxxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaLxxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaLxxxbs, "获取员工联系信息表成功");
}
// 获取员工联系信息表
@GetMapping(value = "/lxxxb/{empNum}")
@ApiOperation(value = "获取员工联系信息表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -926,8 +1026,10 @@ public class YgglController {
new QueryWrapper<YgglAttaLxxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaLxxxbs, "获取员工联系信息表成功");
}
/**
* 添加/修改员工联系信息表
*
* @param
* @return
*/
......@@ -940,8 +1042,10 @@ public class YgglController {
ygglAttaLxxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaLxxxb, "添加/修改员工联系信息表成功");
}
/**
* 删除员工联系信息表
*
* @param
* @return
*/
......@@ -953,8 +1057,10 @@ public class YgglController {
return ResultUtil.data(YgglAttaLxxxb.builder().build()
.delete(new QueryWrapper<YgglAttaLxxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工联系信息表成功");
}
/**
* 获取员工紧急联系人表
*
* @param
* @return
*/
......@@ -962,10 +1068,12 @@ public class YgglController {
@ApiOperation(value = "获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 33)
public Result<List<YgglAttaJjlxr>> selectjjlxr(@CurrentUser UserBean userBean) {
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build().selectList(new QueryWrapper<YgglAttaJjlxr>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaJjlxr> ygglAttaJjlxrs = YgglAttaJjlxr.builder().build()
.selectList(new QueryWrapper<YgglAttaJjlxr>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaJjlxrs, "获取员工紧急联系人表成功");
}
// 获取员工紧急联系人表
@GetMapping(value = "/jjlxr/{empNum}")
@ApiOperation(value = "获取员工紧急联系人表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -975,8 +1083,10 @@ public class YgglController {
new QueryWrapper<YgglAttaJjlxr>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaJjlxrs, "获取员工紧急联系人表成功");
}
/**
* 添加/修改员工紧急联系人表
*
* @param
* @return
*/
......@@ -989,8 +1099,10 @@ public class YgglController {
ygglAttaJjlxr.insertOrUpdate();
return ResultUtil.data(ygglAttaJjlxr, "添加/修改员工紧急联系人表成功");
}
/**
* 删除员工紧急联系人表
*
* @param
* @return
*/
......@@ -1002,9 +1114,11 @@ public class YgglController {
return ResultUtil.data(YgglAttaJjlxr.builder().build()
.delete(new QueryWrapper<YgglAttaJjlxr>().eq("org_code", orgCode).eq("id", id)), "删除员工紧急联系人表成功");
}
// 获取工资卡信息
/**
* 获取员工工资卡信息
*
* @param
* @return
*/
......@@ -1016,6 +1130,7 @@ public class YgglController {
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzks, "获取工资卡信息成功");
}
// 获取工资卡信息
@GetMapping(value = "/gzk/{empNum}")
@ApiOperation(value = "获取员工工资卡信息(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -1025,8 +1140,10 @@ public class YgglController {
new QueryWrapper<YgglAttaGzk>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaGzks, "获取工资卡信息成功");
}
/**
* 添加/修改工资卡信息
*
* @param
* @return
*/
......@@ -1039,8 +1156,10 @@ public class YgglController {
ygglAttaGzk.insertOrUpdate();
return ResultUtil.data(ygglAttaGzk, "添加/修改工资卡信息成功");
}
/**
* 删除工资卡信息
*
* @param
* @return
*/
......@@ -1052,8 +1171,10 @@ public class YgglController {
return ResultUtil.data(YgglAttaGzk.builder().build()
.delete(new QueryWrapper<YgglAttaGzk>().eq("org_code", orgCode).eq("id", id)), "删除工资卡信息成功");
}
/**
* 获取员工合同信息表
*
* @param
* @return
*/
......@@ -1061,10 +1182,12 @@ public class YgglController {
@ApiOperation(value = "获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 41)
public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean) {
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build().selectList(new QueryWrapper<YgglAttaHtxxb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaHtxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaHtxxbs, "获取员工合同信息表成功");
}
// 获取员工合同信息表
@GetMapping(value = "/htxxb/{empNum}")
@ApiOperation(value = "获取员工合同信息表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -1074,8 +1197,10 @@ public class YgglController {
new QueryWrapper<YgglAttaHtxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaHtxxbs, "获取员工合同信息表成功");
}
/**
* 添加/修改员工合同信息表
*
* @param
* @return
*/
......@@ -1088,8 +1213,10 @@ public class YgglController {
ygglAttaHtxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaHtxxb, "添加/修改员工合同信息表成功");
}
/**
* 删除员工合同信息表
*
* @param
* @return
*/
......@@ -1101,6 +1228,7 @@ public class YgglController {
return ResultUtil.data(YgglAttaHtxxb.builder().build()
.delete(new QueryWrapper<YgglAttaHtxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工合同信息表成功");
}
/**
* 获取员工材料附件表
*
......@@ -1111,10 +1239,12 @@ public class YgglController {
@ApiOperation(value = "获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 45)
public Result<List<YgglAttaClfjb>> selectclfjb(@CurrentUser UserBean userBean) {
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build().selectList(new QueryWrapper<YgglAttaClfjb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaClfjb> ygglAttaClfjbs = YgglAttaClfjb.builder().build()
.selectList(new QueryWrapper<YgglAttaClfjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaClfjbs, "获取员工材料附件表成功");
}
// 获取员工材料附件表
@GetMapping(value = "/clfjb/{empNum}")
@ApiOperation(value = "获取员工材料附件表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -1124,8 +1254,10 @@ public class YgglController {
new QueryWrapper<YgglAttaClfjb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaClfjbs, "获取员工材料附件表成功");
}
/**
* 添加/修改员工材料附件表
*
* @param
* @return
*/
......@@ -1138,8 +1270,10 @@ public class YgglController {
ygglAttaClfjb.insertOrUpdate();
return ResultUtil.data(ygglAttaClfjb, "添加/修改员工材料附件表成功");
}
/**
* 删除员工材料附件表
*
* @param
* @return
*/
......@@ -1154,6 +1288,7 @@ public class YgglController {
/**
* 获取成长记录表
*
* @param
* @return
*/
......@@ -1161,10 +1296,12 @@ public class YgglController {
@ApiOperation(value = "获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 49)
public Result<List<YgglAttaCzjlb>> selectczjlb(@CurrentUser UserBean userBean) {
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build().selectList(new QueryWrapper<YgglAttaCzjlb>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
List<YgglAttaCzjlb> ygglAttaCzjlbs = YgglAttaCzjlb.builder().build()
.selectList(new QueryWrapper<YgglAttaCzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num",
userBean.getEmpNum()));
return ResultUtil.data(ygglAttaCzjlbs, "获取成长记录表成功");
}
// 获取成长记录表
@GetMapping(value = "/czjlb/{empNum}")
@ApiOperation(value = "获取成长记录表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -1174,8 +1311,10 @@ public class YgglController {
new QueryWrapper<YgglAttaCzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaCzjlbs, "获取员工成长记录表成功");
}
/**
* 添加/修改成长记录表
*
* @param
* @return
*/
......@@ -1188,8 +1327,10 @@ public class YgglController {
ygglAttaCzjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaCzjlb, "添加/修改成长记录表成功");
}
/**
* 获取单个离职员工信息(管)
*
* @param
* @return
*/
......@@ -1201,8 +1342,10 @@ public class YgglController {
.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode()).eq(YgglMainLzb::getEmpNum, empNum).one();
return ResultUtil.data(lzyg, "获取单个离职员工信息(管)成功");
}
/**
* 员工转正
*
* @param
* @return
*/
......@@ -1216,8 +1359,10 @@ public class YgglController {
.zzRemark(ygzzDto.getZzRemark()).build().update(updateWrapper);
return ResultUtil.success("转正成功!");
}
/**
* 计划离职 type2-3
*
* @param
* @return
*/
......@@ -1247,8 +1392,10 @@ public class YgglController {
// qyzxEmpLogin.deleteById();
return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
}
/**
* 确认离职 type3-4
*
* @param
* @return
*/
......@@ -1273,8 +1420,10 @@ public class YgglController {
qyzxEmpEntAsso.delete(queryWrapper1);
return ResultUtil.success("确认离职员工成功");
}
/**
* 放弃离职 type3-2
*
* @param
* @return
*/
......@@ -1310,6 +1459,7 @@ public class YgglController {
/**
* 查询离职员工列表
*
* @param
* @return
*/
......@@ -1325,8 +1475,10 @@ public class YgglController {
List<YgglMainLzb> lzb = ygglMainLzbMapper.queryLzb(page, lzygQueryDto);
return ResultUtil.data(page, lzb, "离职员工搜索成功");
}
/**
* 展示民族/展示所有民族
*
* @param
* @return
*/
......@@ -1334,15 +1486,17 @@ public class YgglController {
@ApiOperation(value = "展示民族/展示所有民族", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 59)
public Result<List<YgmzDto>> selectmzs(@CurrentUser UserBean userBean, @PathVariable Integer id) {
if (id==null||id==0) {
List<YgmzDto> allmz =new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).list();
return ResultUtil.data(allmz,"展示所有民族");
if (id == null || id == 0) {
List<YgmzDto> allmz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).list();
return ResultUtil.data(allmz, "展示所有民族");
}
List<YgmzDto> mz =new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).eq(YgmzDto::getNumber, id).list();
return ResultUtil.data(mz,"展示该民族");
List<YgmzDto> mz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).eq(YgmzDto::getNumber, id).list();
return ResultUtil.data(mz, "展示该民族");
}
/**
* 展示籍贯/展示所有籍贯
*
* @param
* @return
*/
......@@ -1354,29 +1508,41 @@ public class YgglController {
Integer upId = ygjgDto.getJgid();
List<YgjgDto> maps = new ArrayList<YgjgDto>();
if (type == 1) { //省份
List<YgProDto> list = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getProvince,YgProDto::getName).orderByAsc(YgProDto::getProvince).list();
if (type == 1) { // 省份
List<YgProDto> list = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getProvince, YgProDto::getName).orderByAsc(YgProDto::getProvince)
.list();
for (YgProDto pro : list) {
maps.add(new YgjgDto(pro.getId(), pro.getProvince(), pro.getName(),null));
}}
if (type == 2) { //城市
List<YgCityDto> list = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getCity,YgCityDto::getName).eq(YgCityDto::getProvince, upId).orderByAsc(YgCityDto::getProvince).orderByAsc(YgCityDto::getCity).list();
maps.add(new YgjgDto(pro.getId(), pro.getProvince(), pro.getName(), null));
}
}
if (type == 2) { // 城市
List<YgCityDto> list = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper)
.select(YgCityDto::getId, YgCityDto::getCity, YgCityDto::getName).eq(YgCityDto::getProvince, upId)
.orderByAsc(YgCityDto::getProvince).orderByAsc(YgCityDto::getCity).list();
for (YgCityDto city : list) {
maps.add(new YgjgDto(city.getId(), city.getCity(), city.getName(),null));
}}
if (type == 3) { //地区
List<YgAreaDto> list = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).select(YgAreaDto::getId,YgAreaDto::getName).eq(YgAreaDto::getCity, upId).orderByAsc(YgAreaDto::getProvince).orderByAsc(YgAreaDto::getCity).list();
maps.add(new YgjgDto(city.getId(), city.getCity(), city.getName(), null));
}
}
if (type == 3) { // 地区
List<YgAreaDto> list = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper)
.select(YgAreaDto::getId, YgAreaDto::getName).eq(YgAreaDto::getCity, upId)
.orderByAsc(YgAreaDto::getProvince).orderByAsc(YgAreaDto::getCity).list();
for (YgAreaDto area : list) {
maps.add(new YgjgDto(area.getId(), area.getId(), area.getName(),null));
}}
//IYgjgDto iYgjgDto = PunishFactory.getPunish(type);
//List<String> strings = iYgjgDto.exePunish();
//System.out.println(strings);
if (!maps.isEmpty()) return ResultUtil.data(maps, "展示籍贯成功");
maps.add(new YgjgDto(area.getId(), area.getId(), area.getName(), null));
}
}
// IYgjgDto iYgjgDto = PunishFactory.getPunish(type);
// List<String> strings = iYgjgDto.exePunish();
// System.out.println(strings);
if (!maps.isEmpty())
return ResultUtil.data(maps, "展示籍贯成功");
return ResultUtil.success(null);
}
/**
* 根据籍贯id显示籍贯名
*
* @param
* @return
*/
......@@ -1386,44 +1552,66 @@ public class YgglController {
public Result<YgjgDto> selectjg(@CurrentUser UserBean userBean, @RequestBody YgjgDto jgcity) {
Integer jgid = jgcity.getJgid();
Integer cid = jgcity.getType();
if (jgid!=null) {
String top = jgid.toString().substring(0,2);
String isPro =jgid.toString().substring(2,4);
String isCity =jgid.toString().substring(4,6);
if (jgid != null) {
String top = jgid.toString().substring(0, 2);
String isPro = jgid.toString().substring(2, 4);
String isCity = jgid.toString().substring(4, 6);
if ("00".equals(isPro)) {
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).eq(YgProDto::getId, jgid).one();
if (pro!=null) jgcity.setJgname(pro.getName());
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getName).eq(YgProDto::getId, jgid).one();
if (pro != null)
jgcity.setJgname(pro.getName());
} else if ("00".equals(isCity)) {
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getName).eq(YgCityDto::getCity, jgid).one();
if (city!=null ) jgcity.setJgname(pro.getName()+city.getName());
}
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getName).eq(YgCityDto::getCity, Integer.parseInt(top+isPro)).one();
YgAreaDto area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).select(YgAreaDto::getId,YgAreaDto::getName).eq(YgAreaDto::getId, jgid).one();
if (area!=null ) jgcity.setJgname(pro.getName()+city.getName()+area.getName());
}
if (cid!=null) {
String top = cid.toString().substring(0,2);
String isPro =cid.toString().substring(2,4);
String isCity =cid.toString().substring(4,6);
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper)
.select(YgCityDto::getId, YgCityDto::getName).eq(YgCityDto::getCity, jgid).one();
if (city != null)
jgcity.setJgname(pro.getName() + city.getName());
}
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper)
.select(YgCityDto::getId, YgCityDto::getName).eq(YgCityDto::getCity, Integer.parseInt(top + isPro))
.one();
YgAreaDto area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper)
.select(YgAreaDto::getId, YgAreaDto::getName).eq(YgAreaDto::getId, jgid).one();
if (area != null)
jgcity.setJgname(pro.getName() + city.getName() + area.getName());
}
if (cid != null) {
String top = cid.toString().substring(0, 2);
String isPro = cid.toString().substring(2, 4);
String isCity = cid.toString().substring(4, 6);
if ("00".equals(isPro)) {
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).eq(YgProDto::getId, cid).one();
if (pro!=null) jgcity.setCityname(pro.getName());
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getName).eq(YgProDto::getId, cid).one();
if (pro != null)
jgcity.setCityname(pro.getName());
} else if ("00".equals(isCity)) {
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getName).eq(YgCityDto::getCity, cid).one();
if (city!=null ) jgcity.setCityname(pro.getName()+city.getName());
}
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getName).eq(YgCityDto::getCity, Integer.parseInt(top+isPro)).one();
YgAreaDto area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).select(YgAreaDto::getId,YgAreaDto::getName).eq(YgAreaDto::getId, cid).one();
if (area!=null ) jgcity.setCityname(pro.getName()+city.getName()+area.getName());
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper)
.select(YgCityDto::getId, YgCityDto::getName).eq(YgCityDto::getCity, cid).one();
if (city != null)
jgcity.setCityname(pro.getName() + city.getName());
}
YgProDto pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getName).eq(YgProDto::getProvince, top).one();
YgCityDto city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper)
.select(YgCityDto::getId, YgCityDto::getName).eq(YgCityDto::getCity, Integer.parseInt(top + isPro))
.one();
YgAreaDto area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper)
.select(YgAreaDto::getId, YgAreaDto::getName).eq(YgAreaDto::getId, cid).one();
if (area != null)
jgcity.setCityname(pro.getName() + city.getName() + area.getName());
}
return ResultUtil.data(jgcity);
}
/**
* 查询员工列表
*
* @param
* @return
*/
......@@ -1434,9 +1622,11 @@ public class YgglController {
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean);
return ResultUtil.data(ygQueryDto, "查询成功");
}
/*************** 统计图 ***************/
/**
* 查询统计图
*
* @return 成功信息
*/
@GetMapping("/yggl")
......@@ -1474,7 +1664,9 @@ public class YgglController {
return ResultUtil.data(map, "查询成功");
}
/**
<<<<<<< HEAD
* 员工信息统计图
* @return 成功信息(weng)
*/
......@@ -1522,6 +1714,10 @@ public class YgglController {
}
/**
* 获取员工社保公积金
=======
* 获取成长记录表
*
>>>>>>> bea51ce9ef8860bb31a1d14ffce121313636951a
* @param
* @return
*/
......@@ -1533,37 +1729,43 @@ public class YgglController {
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
return ResultUtil.data(ygglAttaSbgjj, "获取员工社保公积金成功");
}
/**
* 获取员工社保公积金
*
* @param
* @return
*/
@GetMapping(value = "/ygsbgjj/{empNum}")
@ApiOperation(value = "获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 65)
public Result<YgglAttaSbgjj> selectygsbgjj(@CurrentUser UserBean userBean,@PathVariable Integer empNum) {
public Result<YgglAttaSbgjj> selectygsbgjj(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
YgglAttaSbgjj ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectOne(new QueryWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
YgglAttaSbgjj ygglAttaSbgjj = YgglAttaSbgjj.builder().build()
.selectOne(new QueryWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
return ResultUtil.data(ygglAttaSbgjj, "获取员工社保公积金成功");
}
/**
* 添加/修改员工社保公积金
*
* @param
* @return
*/
@PostMapping(value = "/ygsbgjj")
@ApiOperation(value = "添加/修改员工社保公积金", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 66)
public Result<YgglAttaSbgjj> addygsbgjj(@CurrentUser UserBean userBean,@RequestBody YgglAttaSbgjj ygglAttaSbgjj) {
public Result<YgglAttaSbgjj> addygsbgjj(@CurrentUser UserBean userBean, @RequestBody YgglAttaSbgjj ygglAttaSbgjj) {
Integer empNum = ygglAttaSbgjj.getEmpNum();
if (empNum == null) {
return ResultUtil.error();
}
YgglAttaSbgjj AttaSbgjj = YgglAttaSbgjj.builder().build().selectOne(new QueryWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
YgglAttaSbgjj AttaSbgjj = YgglAttaSbgjj.builder().build()
.selectOne(new QueryWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
if (AttaSbgjj != null) {
ygglAttaSbgjj.update(new UpdateWrapper<YgglAttaSbgjj>().eq("emp_num", empNum));
}else {
} else {
ygglAttaSbgjj.insert();
}
......@@ -1572,6 +1774,7 @@ public class YgglController {
/**
* 删除员工社保公积金
*
* @param
* @return
*/
......
......@@ -63,15 +63,6 @@ public class ZzglController {
return ResultUtil.data(zzglBmgwMs);
}
@GetMapping(value = "/deptlist2")
@ApiOperation(value = "获取部门岗位2", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglBmgwM>> selectlistdept2(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.select(ZzglBmgwM::getName,ZzglBmgwM::getId,ZzglBmgwM::getUpId).eq(ZzglBmgwM::getOrgCode, orgCode).list();
return ResultUtil.data(zzglBmgwMs);
}
/**
* 岗位成员
*
......
......@@ -2,7 +2,7 @@ package cn.timer.api.dao.htzz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAdminZzda;
......@@ -12,6 +12,6 @@ import cn.timer.api.bean.htzz.HtzzAdminZzda;
* @author Tang 2019-12-04
*/
@Repository
public interface HtzzAdminZzdaMapper extends IService<HtzzAdminZzda> {
public interface HtzzAdminZzdaMapper extends BaseMapper<HtzzAdminZzda> {
}
......@@ -2,7 +2,7 @@ package cn.timer.api.dao.htzz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAssoHtgx;
......@@ -12,6 +12,6 @@ import cn.timer.api.bean.htzz.HtzzAssoHtgx;
* @author Tang 2019-12-18
*/
@Repository
public interface HtzzAssoHtgxMapper extends IService<HtzzAssoHtgx> {
public interface HtzzAssoHtgxMapper extends BaseMapper<HtzzAssoHtgx> {
}
package cn.timer.api.dao.htzz;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.htzz.HtzzAssoZztx;
......@@ -12,6 +16,11 @@ import cn.timer.api.bean.htzz.HtzzAssoZztx;
* @author Tang 2019-12-04
*/
@Repository
public interface HtzzAssoZztxMapper extends IService<HtzzAssoZztx> {
public interface HtzzAssoZztxMapper extends BaseMapper<HtzzAssoZztx> {
public static void main(String[] args) {
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
String a = format1.format(new Date());
System.err.println(a);
}
}
package cn.timer.api.dao.quartz;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.PageInfo;
import cn.timer.api.bean.quartz.JobAndTrigger;
@Repository
public interface JobAndTriggerMapper extends BaseMapper<JobAndTrigger> {
public PageInfo<JobAndTrigger> getJobAndTriggerDetails(@RequestParam(value = "pageNum") Integer pageNum,
@RequestParam(value = "pageSize") Integer pageSize);
}
\ No newline at end of file
......@@ -40,8 +40,8 @@ public class RemindUtil {
/**
* 每天固定时间提醒
*/
// @Scheduled(cron = "0 0 8 * * ?") // 每天8点扫一下看有没要提醒的,有就发一个
@Scheduled(cron = "0 8 15 * * ?") // 测试合同提醒
@Scheduled(cron = "0 0 8 * * ?") // 每天8点扫一下看有没要提醒的,有就发一个
// @Scheduled(cron = "0 8 15 * * ?") // 测试合同提醒
public static void reportCurrentTime() {
List<HtzzAssoHtgx> htgxs = HtzzAssoHtgx.builder().build().selectAll();
......
......@@ -12,9 +12,9 @@ spring:
max-request-size: 20MB
jpa:
# 配置生成表 存储引擎InnoDB
# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database:
# open-in-view: false
open-in-view: false
# naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
......@@ -116,7 +116,7 @@ pagehelper:
#showSql
logging:
level:
root: DEBUG
root: info
cn.timer.api.dao: error
pattern:
console: '--%p--%m%n'
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.quartz.JobAndTriggerMapper">
<select id="getJobAndTriggerDetails"
resultType="cn.timer.api.bean.quartz.JobAndTrigger">
SELECT
qrtz_job_details.JOB_NAME,
qrtz_job_details.JOB_GROUP,
qrtz_job_details.JOB_CLASS_NAME,
qrtz_triggers.TRIGGER_NAME,
qrtz_triggers.TRIGGER_GROUP,
qrtz_cron_triggers.CRON_EXPRESSION,
qrtz_cron_triggers.TIME_ZONE_ID
FROM
qrtz_job_details
JOIN qrtz_triggers
JOIN qrtz_cron_triggers ON
qrtz_job_details.JOB_NAME =
qrtz_triggers.JOB_NAME
AND
qrtz_triggers.TRIGGER_NAME = qrtz_cron_triggers.TRIGGER_NAME
AND
qrtz_triggers.TRIGGER_GROUP = qrtz_cron_triggers.TRIGGER_GROUP
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment