Commit 5241accb by 太阳与水

排序50%

parent b3964b6e
......@@ -18,6 +18,7 @@ import java.util.regex.Pattern;
import javax.transaction.Transactional;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -34,6 +36,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.additional.update.impl.LambdaUpdateChainWrapper;
import com.github.pagehelper.util.StringUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
......@@ -53,6 +56,7 @@ import cn.timer.api.bean.yggl.YgglAttaZcxxb;
import cn.timer.api.bean.yggl.YgglAttaZszjb;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
......@@ -67,17 +71,18 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.IYgjgDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.PunishFactory;
import cn.timer.api.dto.yggl.YgAreaDto;
import cn.timer.api.dto.yggl.YgCityDto;
import cn.timer.api.dto.yggl.YgDrjqbDto;
import cn.timer.api.dto.yggl.YgDrsDto;
import cn.timer.api.dto.yggl.YgProDto;
import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.yggl.YgjgDto;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.dto.yggl.YgProDto;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
......@@ -122,7 +127,6 @@ public class YgglController {
private YgMzDtoMapper ygMzDtoMapper;
/**
* 获取员工档案
*
* @param
* @return
*/
......@@ -137,6 +141,21 @@ public class YgglController {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
}
/**
* 展示员工所有单表(管理员)
*/
// 获取员工档案
@GetMapping(value = "/ygda/{empNum}")
@ApiOperation(value = "获取员工档案(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 14)
public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
Integer orgCode = userBean.getOrgCode();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode).eq("emp_num", empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
Integer bmgwId = ygglMainEmp.getBmgwId();
return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
}
/**
* 根据岗位id获取员工档案部门岗位名称
......@@ -144,7 +163,7 @@ public class YgglController {
* @param
* @return
*/
@GetMapping(value = "/ygdabm")
@GetMapping(value = "/ygdabm/{gwid}")
@ApiOperation(value = "获取员工档案部门岗位名称", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 2)
public Result<String> selectbmgw(@CurrentUser UserBean userBean,@PathVariable Integer gwid) {
......@@ -163,201 +182,821 @@ public class YgglController {
return ResultUtil.data(bmgw,"获取员工档案部门岗位名称成功");
}
/**
* 获取员工教育经历表
*
* @param
* @return
*/
@GetMapping(value = "/jyjlb")
@ApiOperation(value = "获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
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()));
return ResultUtil.data(ygglAttaJyjlbss, "获取员工教育经历表成功");
}
/**
* 获取员工工作经历表
*
* @param
* @return
*/
@GetMapping(value = "/gzjlb")
@ApiOperation(value = "获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 4)
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()));
return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
}
/**
* 获取员工职称信息表
*
* @param
* @return
*/
@GetMapping(value = "/zcxxb")
@ApiOperation(value = "获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 5)
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()));
return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
}
// 获取员工证书证件表
/**
* 获取员工证书证件表
*
* @param
* @return
*/
@GetMapping(value = "/zszjb")
@ApiOperation(value = "获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 6)
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()));
return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
}
/**
* 获取员工培训经历信息表
* 添加/修改员工档案(weng)
*
* @param
* @return
*/
@GetMapping(value = "/pxjlxxb")
@ApiOperation(value = "获取员工培训经历信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 7)
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()));
return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
}
@PostMapping(value = "/addygda")
@ApiOperation(value = "添加员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 26)
public Result<Object> addygda(@CurrentUser UserBean userBean, @RequestBody AddygdaDto addygdaDto) {
Integer orgCode = userBean.getOrgCode();
String name = addygdaDto.getName();
String phone = addygdaDto.getPhone();
Integer zjType = addygdaDto.getZjType();
String zjNum = addygdaDto.getZjNum();
Integer jobType = addygdaDto.getJobType();
Date rzTime = addygdaDto.getRzTime();
Integer syq = addygdaDto.getSyq();
Integer sex = addygdaDto.getSex();
if (StrUtil.hasBlank(phone) || StrUtil.hasBlank(name) || StrUtil.hasBlank(zjNum)) {
return ResultUtil.error("请输入员工姓名,手机号和身份证号");
}
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
if (login == null) {
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5("123456"))
.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(name).build();
if (!qyzxEmpLogin.insert()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("添加员工登录表失败,请检查输入信息");
}
// 添加三张表
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(orgCode).userType(2).build().insert();// 2普通员工
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum)
.jobType(jobType).rzTime(rzTime).syq(syq).sex(sex).empNum(qyzxEmpLogin.getId()).orgCode(orgCode)
.build();
ygglMainEmp.insert();
return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
} else {
YgglMainEmp ishad = YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>().eq("phone", phone).eq("org_code", orgCode));
/**
* 获取员工联系信息表
*
* @param
* @return
*/
@GetMapping(value = "/lxxxb")
@ApiOperation(value = "获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 8)
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()));
return ResultUtil.data(ygglAttaLxxxbs, "获取员工联系信息表成功");
if (ishad == null) {
// 添加三张表
// 员工权限表(未定)
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(2).build().insert();// 2普通员工
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum)
.jobType(jobType).rzTime(rzTime).syq(syq).sex(sex).empNum(login.getId()).orgCode(orgCode)
.build();
ygglMainEmp.insert();
return ResultUtil.data(ygglMainEmp, "添加员工档案成功!");
} else {
return ResultUtil.error("该手机号已被使用,请输入正确手机号");
}
}
}
/**
* 获取员工紧急联系人表
* 修改员工档案
*
* @param
* @return
*/
@GetMapping(value = "/jjlxr")
@ApiOperation(value = "获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 9)
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()));
return ResultUtil.data(ygglAttaJjlxrs, "获取员工紧急联系人表成功");
}
@PostMapping(value = "/updateygda")
@ApiOperation(value = "修改员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 27)
public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp) {
// 获取工资卡信息
/**
* 获取员工工资卡信息
*
* @param
* @return
*/
@GetMapping(value = "/gzk")
@ApiOperation(value = "获取员工工资卡信息", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 10)
public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) {
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(new QueryWrapper<YgglAttaGzk>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzks, "获取工资卡信息成功");
}
if (ygglMainEmp.getEmpNum() != null) {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("org_code", userBean.getOrgCode()).eq("emp_num", ygglMainEmp.getEmpNum());
ygglMainEmp.update(updateWrapper);
/**
* 获取员工合同信息表
*
* @param
* @return
*/
@GetMapping(value = "/htxxb")
@ApiOperation(value = "获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 11)
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()));
return ResultUtil.data(ygglAttaHtxxbs, "获取员工合同信息表成功");
return ResultUtil.data(ygglMainEmp, "修改成功");
}
return ResultUtil.error("请确认该员工是否存在!");
}
/**
* 获取员工材料附件表
*
* 员工搜索
* @param
* @return
*/
@GetMapping(value = "/clfjb")
@ApiOperation(value = "获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 12)
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()));
return ResultUtil.data(ygglAttaClfjbs, "获取员工材料附件表成功");
}
@PostMapping(value = "/ygquery")
@ApiOperation(value = "员工搜索/分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 52)
public Result<Object> ygquery(@CurrentUser UserBean userBean, @RequestBody YgQueryDto ygQueryDto) {
Integer b = ygQueryDto.getBmgwid();
Integer j = ygQueryDto.getJobStatus();
Integer t = ygQueryDto.getJobType();
String q = ygQueryDto.getQuery();
Page<YgglMainEmp> page = new Page<YgglMainEmp>(
ygQueryDto.getCurrentPage() == null ? 1 : ygQueryDto.getCurrentPage(),
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
// 获取成长记录表
/**
* 获取成长记录表
*
* @param
* @return
*/
@GetMapping(value = "/czjlb")
@ApiOperation(value = "获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 13)
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()));
return ResultUtil.data(ygglAttaCzjlbs, "获取成长记录表成功");
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", userBean.getOrgCode()).eq(t != null && t > -1, "job_type", t)
.eq(b != null && b > -1, "bmgw_id", b).eq(j != null && j > -1, "job_status", j)
.and(!StrUtil.hasBlank(q), wq -> wq.likeRight("name", q).or().likeRight("phone", q));
IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
ygglMainEmpPage.getCurrent();
ygglMainEmpPage.getPages();
ygglMainEmpPage.getTotal();
ygglMainEmpPage.getSize();
return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
}
/**
* 展示员工所有单表(管理员)
*/
// 获取员工档案
@GetMapping(value = "/ygda/{empNum}")
@ApiOperation(value = "获取员工档案(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 14)
public Result<YgglMainEmp> selectygda(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
Integer orgCode = userBean.getOrgCode();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode).eq("emp_num", empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
Integer bmgwId = ygglMainEmp.getBmgwId();
return ResultUtil.data(ygglMainEmp, "获取员工档案成功");
//威力加强版
@PostMapping(value = "/ygdas")
@ApiOperation(value = "导入威力加强版", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
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, "导入发生错误人员名单");
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();
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) {
try {
rzdate = straight.parse(e.getRzTime());
} catch (ParseException PException) {
PException.printStackTrace();
e.setError("请填写正确的时间格式");
errorList.add(e);
continue;
}
}
//判断是否已有员工登录表
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()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
e.setError("员工无法添加!");
errorList.add(e);
continue;
}
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
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();
boolean wanshan = 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();
//return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
}else {
// 添加两张表
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();
emp.insert();
boolean wanshan = 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();
//return ResultUtil.data(emp, "添加员工档案成功!");
} else {
e.setError("该手机号码已被使用");
errorList.add(e);
continue;
}
}
}
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);
List<YgDrjqbDto> errorList = ygDrsDto.getErrorList();
Integer orgCode = ygDrsDto.getOrgCode();
Iterator<YgDrjqbDto> itDr = drList.iterator();
YgDrjqbDto a = drList.get(0);//一个员工导入
Integer size = drList.size();
for (Integer i=0; i<size;) {//
YgDrjqbDto d = newList.get(i);//计数器
if (itDr.hasNext()) {
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)) {
d.setError("请填写必填项");
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) {
d.setError("手机号应为11位数");
errorList.add(d);itDr.remove();i++;continue;
}
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if(!isMatch){
d.setError("手机号格式不对");
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) {
d.setError("手机号码已被使用");
errorList.add(d);itDr.remove();i++;continue;
}
//证件号码信息有误
if (zj == null || "".equals(zj)) {
d.setError("证件号码信息有误");
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}$)";
boolean matches = zj.matches(regularExpression);
if (!matches) {
d.setError("证件号码信息有误");
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 sum = 0;
for (Integer j = 0; j < idCardWi.length; j++) {
int current = Integer.parseInt(String.valueOf(charArray[j]));
int count = current * idCardWi[j];
sum += count;
}
char idCardLast = charArray[17];
int idCardMod = sum % 11;
if (idCardY[idCardMod].toUpperCase().equals(String.valueOf(idCardLast).toUpperCase())) {
//System.out.println("成功,接着完善员工的个人信息");
String birth = zj.substring(6, 14);
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() +
// "错误,正确的应该是:" + idCardY[idCardMod].toUpperCase());
//return false;
d.setError("证件号码信息有误");
errorList.add(d);itDr.remove();i++;continue;
}
}else {
//给15位数的添加生日籍贯
String birth = zj.substring(6, 12);
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;
d.setError("证件号码信息有误");
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 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);
if (isHaveBmgw == 0) {
d.setError("部门岗位有误");
errorList.add(d);itDr.remove();i++;continue;
}else {
//获取到部门岗位id啦!
d.setHavebmid(isHaveBmgw);
}
}
i++;
}//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);
List<YgDrjqbDto> errorList = ygDrsDto.getErrorList();
Integer orgCode = ygDrsDto.getOrgCode();
Iterator<YgDrjqbDto> itDr = drList.iterator();
YgDrjqbDto a = drList.get(0);//一个员工导入
Integer size = drList.size();
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,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;
}
//公司内部工号
if (ygnbgh != null && ygnbgh.length() != 0) {
d.setYgnbgh(ygnbgh.trim());
}else {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
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){
for (String b : bathroom) {
if (b.length()>100) {
return false;}}
return true;}
//判断是否导入组织部门
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;} //找不到有相关名称的部门则报错
gwList.add(ibm);
}else {
break;
}
}
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)) {
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) {
return 0;
}
return igw.getId();
}
gwList.remove(0);
Integer q = qiantao(gwList,gw,upid,orgCode);
return q;
};
/**
* 导出员工
* @param
* @return
*/
@GetMapping(value = "/ygdas")
@ApiOperation(value = "导出/批量添加/修改员工", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 55)
public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode);
List<YgglMainEmp> ygglMainEmpList = YgglMainEmp.builder().build().selectList(queryWrapper);
return ResultUtil.data(ygglMainEmpList, "导出员工成功");
}
/**
* 获取员工教育经历表
* @param
* @return
*/
@GetMapping(value = "/jyjlb")
@ApiOperation(value = "获取员工教育经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
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()));
return ResultUtil.data(ygglAttaJyjlbss, "获取员工教育经历表成功");
}
// 获取员工教育经历表
@GetMapping(value = "/jyjlb/{empNum}")
@ApiOperation(value = "获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 16)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build().selectList(
new QueryWrapper<YgglAttaJyjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaJyjlbs, "获取员工教育经历表成功");
}
/**
* 添加/修改员工教育经历表
* @param
* @return
*/
@PostMapping(value = "/jyjlb")
@ApiOperation(value = "添加/修改员工教育经历表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 32)
public Result<YgglAttaJyjlb> addjyjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaJyjlb ygglAttaJyjlb) {
ygglAttaJyjlb.setEmpNum(ygglAttaJyjlb.getEmpNum());
ygglAttaJyjlb.setOrgCode(userBean.getOrgCode());
ygglAttaJyjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaJyjlb, "添加/修改员工教育经历表成功");
}
/**
* 删除员工教育经历表
* @param
* @return
*/
@DeleteMapping(value = "/jyjlb/{id}")
@ApiOperation(value = "删除员工教育经历表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 43)
public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJyjlb.builder().build()
.delete(new QueryWrapper<YgglAttaJyjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工教育经历表成功");
}
/**
* 获取员工培训经历信息表
*
* @param
* @return
*/
@GetMapping(value = "/pxjlxxb")
@ApiOperation(value = "获取员工培训经历信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 7)
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()));
return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
}
// 获取员工培训经历信息表
@GetMapping(value = "/pxjlxxb/{empNum}")
@ApiOperation(value = "获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 20)
public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build().selectList(
new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
}
/**
* 添加/修改员工培训经历信息表
*
* @param
* @return
*/
@PostMapping(value = "/pxjlxxb")
@ApiOperation(value = "添加/修改员工培训经历信息表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 36)
public Result<YgglAttaPxjlxxb> addpxjlxxb(@CurrentUser UserBean userBean,
@RequestBody YgglAttaPxjlxxb ygglAttaPxjlxxb) {
ygglAttaPxjlxxb.setEmpNum(ygglAttaPxjlxxb.getEmpNum());
ygglAttaPxjlxxb.setOrgCode(userBean.getOrgCode());
ygglAttaPxjlxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaPxjlxxb, "添加/修改员工培训经历信息表成功");
}
/**
* 删除员工培训经历信息表
*
* @param
* @return
*/
@DeleteMapping(value = "/pxjlxxb/{id}")
@ApiOperation(value = "删除员工培训经历信息表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 47)
public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaPxjlxxb.builder().build()
.delete(new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工培训经历信息表成功");
}
/**
* 获取员工工作经历表
*
* @param
* @return
*/
@GetMapping(value = "/gzjlb")
@ApiOperation(value = "获取员工工作经历表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 4)
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()));
return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
}
// 获取员工工作经历表
@GetMapping(value = "/gzjlb/{empNum}")
@ApiOperation(value = "获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 17)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
new QueryWrapper<YgglAttaGzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
}
/**
* 添加/修改员工工作经历表
*
* @param
* @return
*/
@PostMapping(value = "/gzjlb")
@ApiOperation(value = "添加/修改员工工作经历表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 33)
public Result<YgglAttaGzjlb> addgzjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzjlb ygglAttaGzjlb) {
ygglAttaGzjlb.setEmpNum(ygglAttaGzjlb.getEmpNum());
ygglAttaGzjlb.setOrgCode(userBean.getOrgCode());
ygglAttaGzjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaGzjlb, "添加/修改员工工作经历表成功");
}
/**
* 获取员工职称信息表
*
* @param
* @return
*/
@GetMapping(value = "/zcxxb")
@ApiOperation(value = "获取员工职称信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 5)
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()));
return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
}
// 获取员工职称信息表
@GetMapping(value = "/zcxxb/{empNum}")
@ApiOperation(value = "获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 18)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
new QueryWrapper<YgglAttaZcxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
}
/**
* 添加/修改员工职称信息表
*
* @param
* @return
*/
@PostMapping(value = "/zcxxb")
@ApiOperation(value = "添加/修改员工职称信息表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 34)
public Result<YgglAttaZcxxb> addzcxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaZcxxb ygglAttaZcxxb) {
ygglAttaZcxxb.setEmpNum(ygglAttaZcxxb.getEmpNum());
ygglAttaZcxxb.setOrgCode(userBean.getOrgCode());
ygglAttaZcxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaZcxxb, "添加/修改员工职称信息表成功");
}
/**
* 删除员工职称信息表
*
* @param
* @return
*/
@DeleteMapping(value = "/zcxxb/{id}")
@ApiOperation(value = "删除员工职称信息表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 45)
public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZcxxb.builder().build()
.delete(new QueryWrapper<YgglAttaZcxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工职称信息表成功");
}
/**
* 删除员工工作经历表
*
* @param
* @return
*/
@DeleteMapping(value = "/gzjlb/{id}")
@ApiOperation(value = "删除员工工作经历表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 44)
public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzjlb.builder().build()
.delete(new QueryWrapper<YgglAttaGzjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工工作经历表成功");
}
// 获取员工证书证件表
/**
* 获取员工证书证件表
*
* @param
* @return
*/
@GetMapping(value = "/zszjb")
@ApiOperation(value = "获取员工证书证件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 6)
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()));
return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
}
/**
* 获取员工联系信息表
*
* @param
* @return
*/
@GetMapping(value = "/lxxxb")
@ApiOperation(value = "获取员工联系信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 8)
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()));
return ResultUtil.data(ygglAttaLxxxbs, "获取员工联系信息表成功");
}
/**
* 获取员工紧急联系人表
*
* @param
* @return
*/
@GetMapping(value = "/jjlxr")
@ApiOperation(value = "获取员工紧急联系人表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 9)
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()));
return ResultUtil.data(ygglAttaJjlxrs, "获取员工紧急联系人表成功");
}
// 获取工资卡信息
/**
* 获取员工工资卡信息
*
* @param
* @return
*/
@GetMapping(value = "/gzk")
@ApiOperation(value = "获取员工工资卡信息", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 10)
public Result<List<YgglAttaGzk>> selectgzk(@CurrentUser UserBean userBean) {
List<YgglAttaGzk> ygglAttaGzks = YgglAttaGzk.builder().build().selectList(new QueryWrapper<YgglAttaGzk>()
.eq("org_code", userBean.getOrgCode()).eq("emp_num", userBean.getEmpNum()));
return ResultUtil.data(ygglAttaGzks, "获取工资卡信息成功");
}
/**
* 获取员工合同信息表
*
* @param
* @return
*/
@GetMapping(value = "/htxxb")
@ApiOperation(value = "获取员工合同信息表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 11)
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()));
return ResultUtil.data(ygglAttaHtxxbs, "获取员工合同信息表成功");
}
/**
* 获取员工材料附件表
*
* @param
* @return
*/
@GetMapping(value = "/clfjb")
@ApiOperation(value = "获取员工材料附件表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 12)
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()));
return ResultUtil.data(ygglAttaClfjbs, "获取员工材料附件表成功");
}
// 获取成长记录表
/**
* 获取成长记录表
*
* @param
* @return
*/
@GetMapping(value = "/czjlb")
@ApiOperation(value = "获取成长记录表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 13)
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()));
return ResultUtil.data(ygglAttaCzjlbs, "获取成长记录表成功");
}
// 获取员工离职表
@GetMapping(value = "/lzb/{empNum}")
@ApiOperation(value = "获取员工离职表(管)", httpMethod = "GET", notes = "接口发布说明")
......@@ -370,35 +1009,11 @@ public class YgglController {
return ResultUtil.data(ygglMainLzbs, "获取员工离职表成功");
}
// 获取员工教育经历表
@GetMapping(value = "/jyjlb/{empNum}")
@ApiOperation(value = "获取员工教育经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 16)
public Result<List<YgglAttaJyjlb>> selectjyjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaJyjlb> ygglAttaJyjlbs = YgglAttaJyjlb.builder().build().selectList(
new QueryWrapper<YgglAttaJyjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaJyjlbs, "获取员工教育经历表成功");
}
// 获取员工工作经历表
@GetMapping(value = "/gzjlb/{empNum}")
@ApiOperation(value = "获取员工工作经历表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 17)
public Result<List<YgglAttaGzjlb>> selectgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaGzjlb> ygglAttaGzjlbs = YgglAttaGzjlb.builder().build().selectList(
new QueryWrapper<YgglAttaGzjlb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaGzjlbs, "获取员工工作经历表成功");
}
// 获取员工职称信息表
@GetMapping(value = "/zcxxb/{empNum}")
@ApiOperation(value = "获取员工职称信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 18)
public Result<List<YgglAttaZcxxb>> selectzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaZcxxb> ygglAttaZcxxbs = YgglAttaZcxxb.builder().build().selectList(
new QueryWrapper<YgglAttaZcxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaZcxxbs, "获取员工职称信息表成功");
}
// 获取员工证书证件表
@GetMapping(value = "/zszjb/{empNum}")
......@@ -410,15 +1025,7 @@ public class YgglController {
return ResultUtil.data(ygglAttaZszjbs, "获取员工证书证件表成功");
}
// 获取员工培训经历信息表
@GetMapping(value = "/pxjlxxb/{empNum}")
@ApiOperation(value = "获取员工培训经历信息表(管)", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 20)
public Result<List<YgglAttaPxjlxxb>> selectpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaPxjlxxb> ygglAttaPxjlxxbs = YgglAttaPxjlxxb.builder().build().selectList(
new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
return ResultUtil.data(ygglAttaPxjlxxbs, "获取员工培训经历信息表成功");
}
// 获取员工联系信息表
@GetMapping(value = "/lxxxb/{empNum}")
......@@ -479,89 +1086,9 @@ public class YgglController {
return ResultUtil.data(ygglAttaCzjlbs, "获取员工合同信息表成功");
}
/**
* 添加/修改员工档案(weng)
*
* @param
* @return
*/
@PostMapping(value = "/addygda")
@ApiOperation(value = "添加员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 26)
public Result<Object> addygda(@CurrentUser UserBean userBean, @RequestBody AddygdaDto addygdaDto) {
Integer orgCode = userBean.getOrgCode();
String name = addygdaDto.getName();
String phone = addygdaDto.getPhone();
Integer zjType = addygdaDto.getZjType();
String zjNum = addygdaDto.getZjNum();
Integer jobType = addygdaDto.getJobType();
Date rzTime = addygdaDto.getRzTime();
Integer syq = addygdaDto.getSyq();
Integer sex = addygdaDto.getSex();
if (StrUtil.hasBlank(phone) || StrUtil.hasBlank(name) || StrUtil.hasBlank(zjNum)) {
return ResultUtil.error("请输入员工姓名,手机号和身份证号");
}
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
if (login == null) {
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5("123456"))
.sts(CommonEnum.U_STS_ON.getType()).orgId(userBean.getOrgCode()).username(name).build();
if (!qyzxEmpLogin.insert()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("添加员工登录表失败,请检查输入信息");
}
// 添加三张表
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(orgCode).userType(2).build().insert();// 2普通员工
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum)
.jobType(jobType).rzTime(rzTime).syq(syq).sex(sex).empNum(qyzxEmpLogin.getId()).orgCode(orgCode)
.build();
ygglMainEmp.insert();
return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
} else {
// YgglMainEmp ishad = new
// LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
// .eq(!StrUtil.hasBlank(phone), YgglMainEmp::getPhone,
// phone).eq(YgglMainEmp::getOrgCode,orgCode).one();
YgglMainEmp ishad = YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>().eq("phone", phone).eq("org_code", orgCode));
if (ishad == null) {
// 添加三张表
// 员工权限表(未定)
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(2).build().insert();// 2普通员工
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum)
.jobType(jobType).rzTime(rzTime).syq(syq).sex(sex).empNum(login.getId()).orgCode(orgCode)
.build();
ygglMainEmp.insert();
return ResultUtil.data(ygglMainEmp, "添加员工档案成功!");
} else {
return ResultUtil.error("该手机号已被使用,请输入正确手机号");
}
}
}
/**
* 修改员工档案
*
* @param
* @return
*/
@PostMapping(value = "/updateygda")
@ApiOperation(value = "修改员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 27)
public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp) {
if (ygglMainEmp.getEmpNum() != null) {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("org_code", userBean.getOrgCode()).eq("emp_num", ygglMainEmp.getEmpNum());
ygglMainEmp.update(updateWrapper);
return ResultUtil.data(ygglMainEmp, "修改成功");
}
return ResultUtil.error("请确认该员工是否存在!");
}
/**
* 员工转正
......@@ -644,92 +1171,50 @@ public class YgglController {
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(4).build().update(updateWrapper);
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(4).sjlzTime(new Date()).build()
.update(updateWrapper1);
// 查询该员工的关联表
QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
queryWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
// 确认离职 删除员工关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(lzygQueryDto.getEmpNum()).build();
qyzxEmpEntAsso.delete(queryWrapper1);
return ResultUtil.success("确认离职员工成功");
}
/**
* 放弃离职 type3-2
*
* @param
* @return
*/
@PostMapping(value = "/fqlz")
@ApiOperation(value = "放弃离职", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 31)
public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().jobStatus(2).build().update(updateWrapper);
QueryWrapper<YgglMainLzb> queryWrapper = new QueryWrapper<YgglMainLzb>();
queryWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
// 删除离职表
YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build().delete(queryWrapper);
return ResultUtil.success("放弃成功");
}
/**
* 添加/修改员工教育经历表
*
* @param
* @return
*/
@PostMapping(value = "/jyjlb")
@ApiOperation(value = "添加/修改员工教育经历表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 32)
public Result<YgglAttaJyjlb> addjyjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaJyjlb ygglAttaJyjlb) {
ygglAttaJyjlb.setEmpNum(ygglAttaJyjlb.getEmpNum());
ygglAttaJyjlb.setOrgCode(userBean.getOrgCode());
ygglAttaJyjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaJyjlb, "添加/修改员工教育经历表成功");
}
/**
* 添加/修改员工工作经历表
*
* @param
* @return
*/
@PostMapping(value = "/gzjlb")
@ApiOperation(value = "添加/修改员工工作经历表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 33)
public Result<YgglAttaGzjlb> addgzjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzjlb ygglAttaGzjlb) {
ygglAttaGzjlb.setEmpNum(ygglAttaGzjlb.getEmpNum());
ygglAttaGzjlb.setOrgCode(userBean.getOrgCode());
ygglAttaGzjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaGzjlb, "添加/修改员工工作经历表成功");
.update(updateWrapper1);
// 查询该员工的关联表
QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
queryWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
// 确认离职 删除员工关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(lzygQueryDto.getEmpNum()).build();
qyzxEmpEntAsso.delete(queryWrapper1);
return ResultUtil.success("确认离职员工成功");
}
/**
* 添加/修改员工职称信息表
* 放弃离职 type3-2
*
* @param
* @return
*/
@PostMapping(value = "/zcxxb")
@ApiOperation(value = "添加/修改员工职称信息表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 34)
public Result<YgglAttaZcxxb> addzcxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaZcxxb ygglAttaZcxxb) {
ygglAttaZcxxb.setEmpNum(ygglAttaZcxxb.getEmpNum());
ygglAttaZcxxb.setOrgCode(userBean.getOrgCode());
ygglAttaZcxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaZcxxb, "添加/修改员工职称信息表成功");
@PostMapping(value = "/fqlz")
@ApiOperation(value = "放弃离职", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 31)
public Result<Void> fqlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().jobStatus(2).build().update(updateWrapper);
QueryWrapper<YgglMainLzb> queryWrapper = new QueryWrapper<YgglMainLzb>();
queryWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
// 删除离职表
YgglMainLzb.builder().id(lzygQueryDto.getEmpNum()).build().delete(queryWrapper);
return ResultUtil.success("放弃成功");
}
/**
* 添加/修改员工证书证件表
*
......@@ -746,22 +1231,7 @@ public class YgglController {
return ResultUtil.data(ygglAttaZszjb, "添加/修改员工证书证件表成功");
}
/**
* 添加/修改员工培训经历信息表
*
* @param
* @return
*/
@PostMapping(value = "/pxjlxxb")
@ApiOperation(value = "添加/修改员工培训经历信息表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 36)
public Result<YgglAttaPxjlxxb> addpxjlxxb(@CurrentUser UserBean userBean,
@RequestBody YgglAttaPxjlxxb ygglAttaPxjlxxb) {
ygglAttaPxjlxxb.setEmpNum(ygglAttaPxjlxxb.getEmpNum());
ygglAttaPxjlxxb.setOrgCode(userBean.getOrgCode());
ygglAttaPxjlxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaPxjlxxb, "添加/修改员工培训经历信息表成功");
}
/**
* 添加/修改员工联系信息表
......@@ -799,599 +1269,170 @@ public class YgglController {
* 添加/修改工资卡信息
*
* @param
* @return
*/
@PostMapping(value = "/gzk")
@ApiOperation(value = "添加/修改工资卡信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 39)
public Result<YgglAttaGzk> addgzk(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzk ygglAttaGzk) {
ygglAttaGzk.setEmpNum(ygglAttaGzk.getEmpNum());
ygglAttaGzk.setOrgCode(userBean.getOrgCode());
ygglAttaGzk.insertOrUpdate();
return ResultUtil.data(ygglAttaGzk, "添加/修改工资卡信息成功");
}
/**
* 添加/修改员工合同信息表
*
* @param
* @return
*/
@PostMapping(value = "/htxxb")
@ApiOperation(value = "添加/修改员工合同信息表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 40)
public Result<YgglAttaHtxxb> addhtxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaHtxxb ygglAttaHtxxb) {
ygglAttaHtxxb.setEmpNum(ygglAttaHtxxb.getEmpNum());
ygglAttaHtxxb.setOrgCode(userBean.getOrgCode());
ygglAttaHtxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaHtxxb, "添加/修改员工合同信息表成功");
}
/**
* 添加/修改员工材料附件表
*
* @param
* @return
*/
@PostMapping(value = "/clfjb")
@ApiOperation(value = "添加/修改员工材料附件表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 41)
public Result<YgglAttaClfjb> addclfjb(@CurrentUser UserBean userBean, @RequestBody YgglAttaClfjb ygglAttaClfjb) {
ygglAttaClfjb.setOrgCode(userBean.getOrgCode());
ygglAttaClfjb.setEmpNum(ygglAttaClfjb.getEmpNum());
ygglAttaClfjb.insertOrUpdate();
return ResultUtil.data(ygglAttaClfjb, "添加/修改员工材料附件表成功");
}
/**
* 添加/修改成长记录表
*
* @param
* @return
*/
@PostMapping(value = "/czjlb")
@ApiOperation(value = "添加/修改成长记录表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 42)
public Result<YgglAttaCzjlb> addczjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaCzjlb ygglAttaCzjlb) {
ygglAttaCzjlb.setEmpNum(ygglAttaCzjlb.getEmpNum());
ygglAttaCzjlb.setOrgCode(userBean.getOrgCode());
ygglAttaCzjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaCzjlb, "添加/修改成长记录表成功");
}
/**
* 删除员工教育经历表
*
* @param
* @return
*/
@DeleteMapping(value = "/jyjlb/{id}")
@ApiOperation(value = "删除员工教育经历表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 43)
public Result<Boolean> deljyjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJyjlb.builder().build()
.delete(new QueryWrapper<YgglAttaJyjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工教育经历表成功");
}
/**
* 删除员工工作经历表
*
* @param
* @return
*/
@DeleteMapping(value = "/gzjlb/{id}")
@ApiOperation(value = "删除员工工作经历表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 44)
public Result<Boolean> delgzjlb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzjlb.builder().build()
.delete(new QueryWrapper<YgglAttaGzjlb>().eq("org_code", orgCode).eq("id", id)), "删除员工工作经历表成功");
}
/**
* 删除员工职称信息表
*
* @param
* @return
*/
@DeleteMapping(value = "/zcxxb/{id}")
@ApiOperation(value = "删除员工职称信息表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 45)
public Result<Boolean> delzcxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZcxxb.builder().build()
.delete(new QueryWrapper<YgglAttaZcxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工职称信息表成功");
}
/**
* 删除员工证书证件表
*
* @param
* @return
*/
@DeleteMapping(value = "/zszjb/{id}")
@ApiOperation(value = "删除员工证书证件表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 46)
public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZszjb.builder().build()
.delete(new QueryWrapper<YgglAttaZszjb>().eq("org_code", orgCode).eq("id", id)), "删除员工证书证件表成功");
}
/**
* 删除员工培训经历信息表
*
* @param
* @return
*/
@DeleteMapping(value = "/pxjlxxb/{id}")
@ApiOperation(value = "删除员工培训经历信息表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 47)
public Result<Boolean> delpxjlxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaPxjlxxb.builder().build()
.delete(new QueryWrapper<YgglAttaPxjlxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工培训经历信息表成功");
}
/**
* 删除员工紧急联系人表
*
* @param
* @return
*/
@DeleteMapping(value = "/jjlxr/{id}")
@ApiOperation(value = "删除员工紧急联系人表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 48)
public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJjlxr.builder().build()
.delete(new QueryWrapper<YgglAttaJjlxr>().eq("org_code", orgCode).eq("id", id)), "删除员工紧急联系人表成功");
}
/**
* 删除工资卡信息
*
* @param
* @return
*/
@DeleteMapping(value = "/gzk/{id}")
@ApiOperation(value = "删除工资卡信息", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 49)
public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzk.builder().build()
.delete(new QueryWrapper<YgglAttaGzk>().eq("org_code", orgCode).eq("id", id)), "删除工资卡信息成功");
}
/**
* 删除员工合同信息表
*
* @param
* @return
*/
@DeleteMapping(value = "/htxxb/{id}")
@ApiOperation(value = "删除员工合同信息表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 50)
public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaHtxxb.builder().build()
.delete(new QueryWrapper<YgglAttaHtxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工合同信息表成功");
}
/**
* 删除员工材料附件表
*
* @param
* @return
*/
@DeleteMapping(value = "/clfjb/{id}")
@ApiOperation(value = "删除员工材料附件表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 51)
public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaClfjb.builder().build()
.delete(new QueryWrapper<YgglAttaClfjb>().eq("org_code", orgCode).eq("id", id)), "删除员工材料附件表成功");
}
/**
* 员工搜索
*
* @param
* @return
*/
@PostMapping(value = "/ygquery")
@ApiOperation(value = "员工搜索/分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 52)
public Result<Object> ygquery(@CurrentUser UserBean userBean, @RequestBody YgQueryDto ygQueryDto) {
Integer orgCode = userBean.getOrgCode();
Integer b = ygQueryDto.getBmgwid();
ArrayList<Integer> bList = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
ZzglBmgwM.getDepts(bList, b, zzglBmgwMs);
Integer j = ygQueryDto.getJobStatus();
Integer t = ygQueryDto.getJobType();
String q = ygQueryDto.getQuery();
Page<YgglMainEmp> page = new Page<YgglMainEmp>(
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")
.eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
.eq(j != null && j > -1, "job_status", j).in(!bList.isEmpty(), "id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q));
// List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper);
IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
// List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
ygglMainEmpPage.getCurrent();
ygglMainEmpPage.getPages();
ygglMainEmpPage.getTotal();
ygglMainEmpPage.getSize();
return ResultUtil.data(ygglMainEmpPage, "员工搜索成功");
// return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
* @return
*/
@PostMapping(value = "/gzk")
@ApiOperation(value = "添加/修改工资卡信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 39)
public Result<YgglAttaGzk> addgzk(@CurrentUser UserBean userBean, @RequestBody YgglAttaGzk ygglAttaGzk) {
ygglAttaGzk.setEmpNum(ygglAttaGzk.getEmpNum());
ygglAttaGzk.setOrgCode(userBean.getOrgCode());
ygglAttaGzk.insertOrUpdate();
return ResultUtil.data(ygglAttaGzk, "添加/修改工资卡信息成功");
}
/**
* 查询离职员工列
* 添加/修改员工合同信息
*
* @param
* @return
*/
@PostMapping(value = "/querylzyg")
@ApiOperation(value = "查询离职员工列表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 53)
public Result<Object> querylzyg(@CurrentUser UserBean userBean, @RequestBody LzbQueryDto lzygQueryDto) {
lzygQueryDto.setOrgCode(userBean.getOrgCode());
IPage<YgglMainLzb> page = new Page<YgglMainLzb>(
lzygQueryDto.getCurrentPage() == null ? 1 : lzygQueryDto.getCurrentPage(),
lzygQueryDto.getTotalPage() == null ? 10 : lzygQueryDto.getTotalPage());
List<YgglMainLzb> lzb = ygglMainLzbMapper.queryLzb(page, lzygQueryDto);
return ResultUtil.data(page, lzb, "离职员工搜索成功");
}
//威力加强版
@PostMapping(value = "/ygdas")
@ApiOperation(value = "导入威力加强版", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
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, "导入发生错误人员名单");
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();
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) {
try {
rzdate = straight.parse(e.getRzTime());
} catch (ParseException PException) {
PException.printStackTrace();
e.setError("请填写正确的时间格式");
errorList.add(e);
continue;
}
}
//判断是否已有员工登录表
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()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
e.setError("员工无法添加!");
errorList.add(e);
continue;
}
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
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();
boolean wanshan = 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();
//return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
}else {
// 添加两张表
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();
emp.insert();
boolean wanshan = 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();
//return ResultUtil.data(emp, "添加员工档案成功!");
} else {
e.setError("该手机号码已被使用");
errorList.add(e);
continue;
}
}
}
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);
List<YgDrjqbDto> errorList = ygDrsDto.getErrorList();
Integer orgCode = ygDrsDto.getOrgCode();
Iterator<YgDrjqbDto> itDr = drList.iterator();
YgDrjqbDto a = drList.get(0);//一个员工导入
Integer size = drList.size();
for (Integer i=0; i<size;) {//
YgDrjqbDto d = newList.get(i);//计数器
if (itDr.hasNext()) {
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)) {
d.setError("请填写必填项");
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) {
d.setError("手机号应为11位数");
errorList.add(d);itDr.remove();i++;continue;
}
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if(!isMatch){
d.setError("手机号格式不对");
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) {
d.setError("手机号码已被使用");
errorList.add(d);itDr.remove();i++;continue;
}
//证件号码信息有误
if (zj == null || "".equals(zj)) {
d.setError("证件号码信息有误");
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}$)";
boolean matches = zj.matches(regularExpression);
if (!matches) {
d.setError("证件号码信息有误");
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 sum = 0;
for (Integer j = 0; j < idCardWi.length; j++) {
int current = Integer.parseInt(String.valueOf(charArray[j]));
int count = current * idCardWi[j];
sum += count;
}
char idCardLast = charArray[17];
int idCardMod = sum % 11;
if (idCardY[idCardMod].toUpperCase().equals(String.valueOf(idCardLast).toUpperCase())) {
//System.out.println("成功,接着完善员工的个人信息");
String birth = zj.substring(6, 14);
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() +
// "错误,正确的应该是:" + idCardY[idCardMod].toUpperCase());
//return false;
d.setError("证件号码信息有误");
errorList.add(d);itDr.remove();i++;continue;
}
}else {
//给15位数的添加生日籍贯
String birth = zj.substring(6, 12);
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;
d.setError("证件号码信息有误");
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 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);
if (isHaveBmgw == 0) {
d.setError("部门岗位有误");
errorList.add(d);itDr.remove();i++;continue;
}else {
//获取到部门岗位id啦!
d.setHavebmid(isHaveBmgw);
}
}
i++;
}//for循环完毕!
YgDrsDto tofList = new YgDrsDto(drList, errorList, orgCode);
return tofList;
@PostMapping(value = "/htxxb")
@ApiOperation(value = "添加/修改员工合同信息表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 40)
public Result<YgglAttaHtxxb> addhtxxb(@CurrentUser UserBean userBean, @RequestBody YgglAttaHtxxb ygglAttaHtxxb) {
ygglAttaHtxxb.setEmpNum(ygglAttaHtxxb.getEmpNum());
ygglAttaHtxxb.setOrgCode(userBean.getOrgCode());
ygglAttaHtxxb.insertOrUpdate();
return ResultUtil.data(ygglAttaHtxxb, "添加/修改员工合同信息表成功");
}
//选填项过滤器
public YgDrsDto optFilter(YgDrsDto ygDrsDto) {
List<YgDrjqbDto> drList = ygDrsDto.getDrList();
List<YgDrjqbDto> newList = new ArrayList<YgDrjqbDto>(drList);
List<YgDrjqbDto> errorList = ygDrsDto.getErrorList();
Integer orgCode = ygDrsDto.getOrgCode();
Iterator<YgDrjqbDto> itDr = drList.iterator();
YgDrjqbDto a = drList.get(0);//一个员工导入
Integer size = drList.size();
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,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;
}
//公司内部工号
if (ygnbgh != null && ygnbgh.length() != 0) {
d.setYgnbgh(ygnbgh.trim());
}else {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
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;
/**
* 添加/修改员工材料附件表
*
* @param
* @return
*/
@PostMapping(value = "/clfjb")
@ApiOperation(value = "添加/修改员工材料附件表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 41)
public Result<YgglAttaClfjb> addclfjb(@CurrentUser UserBean userBean, @RequestBody YgglAttaClfjb ygglAttaClfjb) {
ygglAttaClfjb.setOrgCode(userBean.getOrgCode());
ygglAttaClfjb.setEmpNum(ygglAttaClfjb.getEmpNum());
ygglAttaClfjb.insertOrUpdate();
return ResultUtil.data(ygglAttaClfjb, "添加/修改员工材料附件表成功");
}
/**
* 添加/修改成长记录表
*
* @param
* @return
*/
@PostMapping(value = "/czjlb")
@ApiOperation(value = "添加/修改成长记录表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 42)
public Result<YgglAttaCzjlb> addczjlb(@CurrentUser UserBean userBean, @RequestBody YgglAttaCzjlb ygglAttaCzjlb) {
ygglAttaCzjlb.setEmpNum(ygglAttaCzjlb.getEmpNum());
ygglAttaCzjlb.setOrgCode(userBean.getOrgCode());
ygglAttaCzjlb.insertOrUpdate();
return ResultUtil.data(ygglAttaCzjlb, "添加/修改成长记录表成功");
}
//浴池,洗去选填项字节大于100的选项
public boolean takeshower(String[] bathroom){
for (String b : bathroom) {
if (b.length()>100) {
return false;}}
return true;}
//判断是否导入组织部门
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;} //找不到有相关名称的部门则报错
gwList.add(ibm);
}else {
break;
}
}
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)) {
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) {
return 0;
}
return igw.getId();
}
gwList.remove(0);
Integer q = qiantao(gwList,gw,upid,orgCode);
return q;
};
/**
* 删除员工证书证件表
*
* @param
* @return
*/
@DeleteMapping(value = "/zszjb/{id}")
@ApiOperation(value = "删除员工证书证件表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 46)
public Result<Boolean> delzszjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaZszjb.builder().build()
.delete(new QueryWrapper<YgglAttaZszjb>().eq("org_code", orgCode).eq("id", id)), "删除员工证书证件表成功");
}
/**
* 删除员工紧急联系人表
*
* @param
* @return
*/
@DeleteMapping(value = "/jjlxr/{id}")
@ApiOperation(value = "删除员工紧急联系人表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 48)
public Result<Boolean> deljjlxr(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaJjlxr.builder().build()
.delete(new QueryWrapper<YgglAttaJjlxr>().eq("org_code", orgCode).eq("id", id)), "删除员工紧急联系人表成功");
}
/**
* 删除工资卡信息
*
* @param
* @return
*/
@DeleteMapping(value = "/gzk/{id}")
@ApiOperation(value = "删除工资卡信息", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 49)
public Result<Boolean> delgzk(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaGzk.builder().build()
.delete(new QueryWrapper<YgglAttaGzk>().eq("org_code", orgCode).eq("id", id)), "删除工资卡信息成功");
}
/**
* 删除员工合同信息表
*
* @param
* @return
*/
@DeleteMapping(value = "/htxxb/{id}")
@ApiOperation(value = "删除员工合同信息表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 50)
public Result<Boolean> delhtxxb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaHtxxb.builder().build()
.delete(new QueryWrapper<YgglAttaHtxxb>().eq("org_code", orgCode).eq("id", id)), "删除员工合同信息表成功");
}
/**
* 删除员工材料附件表
*
* @param
* @return
*/
@DeleteMapping(value = "/clfjb/{id}")
@ApiOperation(value = "删除员工材料附件表", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 51)
public Result<Boolean> delclfjb(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode();
return ResultUtil.data(YgglAttaClfjb.builder().build()
.delete(new QueryWrapper<YgglAttaClfjb>().eq("org_code", orgCode).eq("id", id)), "删除员工材料附件表成功");
}
/**
* 查询离职员工列表
*
* @param
* @return
*/
@PostMapping(value = "/querylzyg")
@ApiOperation(value = "查询离职员工列表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 53)
public Result<Object> querylzyg(@CurrentUser UserBean userBean, @RequestBody LzbQueryDto lzygQueryDto) {
lzygQueryDto.setOrgCode(userBean.getOrgCode());
IPage<YgglMainLzb> page = new Page<YgglMainLzb>(
lzygQueryDto.getCurrentPage() == null ? 1 : lzygQueryDto.getCurrentPage(),
lzygQueryDto.getTotalPage() == null ? 10 : lzygQueryDto.getTotalPage());
List<YgglMainLzb> lzb = ygglMainLzbMapper.queryLzb(page, lzygQueryDto);
return ResultUtil.data(page, lzb, "离职员工搜索成功");
}
/**
* 部门导入(未完成)
* @param
* @return
......@@ -1430,13 +1471,12 @@ public class YgglController {
Integer type = ygjgDto.getType();
Integer upId = ygjgDto.getJgid();
List<YgjgDto> maps = new ArrayList<YgjgDto>();
YgjgDto map = YgjgDto.builder().build();
Map<Integer, String> map = new HashMap<Integer, String>();
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) {
map.setType(pro.getId());map.setJgid(pro.getProvince());map.setJgname(pro.getName());
maps.add(map);
maps.add(new YgjgDto(pro.getId(), pro.getProvince(), pro.getName()));
}}
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();
......@@ -1452,7 +1492,7 @@ public class YgglController {
//List<String> strings = iYgjgDto.exePunish();
//System.out.println(strings);
if (!maps.isEmpty()) return ResultUtil.data(maps, "展示籍贯成功");
return ResultUtil.error("输入参数有误!");
return ResultUtil.success(null);
}
@PostMapping(value = "/jgp/{id}")
......@@ -1473,21 +1513,7 @@ public class YgglController {
}
/**
* 导出员工
* @param
* @return
*/
@GetMapping(value = "/ygdas")
@ApiOperation(value = "导出/批量添加/修改员工", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 55)
public Result<List<YgglMainEmp>> selectygdas(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode);
List<YgglMainEmp> ygglMainEmpList = YgglMainEmp.builder().build().selectList(queryWrapper);
return ResultUtil.data(ygglMainEmpList, "导出员工成功");
}
/**
* 查询员工列表
......
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