Commit 0a9d9298 authored by huyuchen's avatar huyuchen

huych-合同自动化代码提交

parent ac38a8af
...@@ -207,8 +207,8 @@ public class EmployeeRegistrationPreController { ...@@ -207,8 +207,8 @@ public class EmployeeRegistrationPreController {
**/ **/
@Operation(summary = "查询瓜子身份信息") @Operation(summary = "查询瓜子身份信息")
@SysLog("查询身份信息") @SysLog("查询身份信息")
@GetMapping("/getGzEmployeeInfo") @PostMapping("/getGzEmployeeInfo")
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(@RequestParam String id) { public R<EmployeeInfoMsgVo> getGzEmployeeInfo(@RequestBody EmployeeInfoMsgVo vo) {
return employeeRegistrationPreService.getGzEmployeeInfo(id); return employeeRegistrationPreService.getGzEmployeeInfo(vo);
} }
} }
...@@ -93,7 +93,7 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr ...@@ -93,7 +93,7 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
R<EmployeeInfoMsgVo> getEmployeeInfo(String cardOrId); R<EmployeeInfoMsgVo> getEmployeeInfo(String cardOrId);
R<EmployeeInfoMsgVo> getGzEmployeeInfo(String cardOrId); R<EmployeeInfoMsgVo> getGzEmployeeInfo(EmployeeInfoMsgVo vo);
/** /**
* @param empIdCard 身份证 * @param empIdCard 身份证
......
...@@ -310,6 +310,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -310,6 +310,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.eq(TEmployeeContractPre::getRegisterId,pre.getId()) .eq(TEmployeeContractPre::getRegisterId,pre.getId())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractOld)) { if (Common.isNotNull(contractOld)) {
// 创建更新条件构造器
LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapperContract.eq(TAttaInfo::getDomainId, contractOld.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
contractPreMapper.deleteById(contractOld); contractPreMapper.deleteById(contractOld);
} }
} }
...@@ -1228,22 +1235,45 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1228,22 +1235,45 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
@Override @Override
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(String id) { public R<EmployeeInfoMsgVo> getGzEmployeeInfo(EmployeeInfoMsgVo vo) {
//获取人员档案id if (Common.isEmpty(vo)) {
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id, Stream.of("4").collect(Collectors.toList()));
if (Common.isEmpty(msgInfoVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
} }
//获取预入职信息,如果有的话提示 //短信入口
if (Common.isNotNull(msgInfoVo) && Common.isNotNull(msgInfoVo.getDetailId())) { if (Common.isNotNull(vo.getDetailId())) {
//获取人员档案id
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(vo.getDetailId(), Stream.of("4").collect(Collectors.toList()));
if (Common.isEmpty(msgInfoVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
//获取预入职信息,如果有的话提示
if (Common.isNotNull(msgInfoVo) && Common.isNotNull(msgInfoVo.getDetailId())) {
TGzOfferInfo empMain = gzOfferInfoMapper.selectOne(Wrappers.<TGzOfferInfo>query().lambda()
.eq(TGzOfferInfo::getId, Integer.valueOf(msgInfoVo.getDetailId()))
.ne(TGzOfferInfo::getOfferStatus, CommonConstants.NINE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(empMain)) {
msgInfoVo.setMessage("当前Offer不符合档案采集状态,禁止操作");
}
return R.ok(msgInfoVo);
}
}
//二维码入口
if (Common.isNotNull(vo.getCard()) && Common.isNotNull(vo.getName())) {
//获取预入职信息,如果有的话提示
TGzOfferInfo empMain = gzOfferInfoMapper.selectOne(Wrappers.<TGzOfferInfo>query().lambda() TGzOfferInfo empMain = gzOfferInfoMapper.selectOne(Wrappers.<TGzOfferInfo>query().lambda()
.eq(TGzOfferInfo::getId, Integer.valueOf(msgInfoVo.getDetailId())) .eq(TGzOfferInfo::getNationalId, vo.getCard())
.ne(TGzOfferInfo::getOfferStatus, CommonConstants.NINE_STRING) .eq(TGzOfferInfo::getName, vo.getName())
.eq(TGzOfferInfo::getOfferStatus, CommonConstants.NINE_STRING)
.orderByDesc(TGzOfferInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(empMain)) { if (Common.isEmpty(empMain)) {
msgInfoVo.setMessage("当前Offer不符合档案采集状态,禁止操作"); vo.setMessage("当前Offer不符合档案采集状态,禁止操作");
} else {
vo.setPhone(empMain.getPhone());
vo.setDetailId(empMain.getId().toString());
} }
return R.ok(msgInfoVo); return R.ok(vo);
} }
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
......
...@@ -10,14 +10,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,14 +10,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAuditService; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -30,6 +28,7 @@ import lombok.RequiredArgsConstructor; ...@@ -30,6 +28,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -65,6 +64,9 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -65,6 +64,9 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
@Autowired @Autowired
private UpmsDaprUtils upmsDaprUtils; private UpmsDaprUtils upmsDaprUtils;
@Lazy
private final TAttaInfoService attaInfoService;
/** /**
* 合同待签订任务记录表简单分页查询 * 合同待签订任务记录表简单分页查询
* @param tEmployeeContractPre 合同待签订任务记录表 * @param tEmployeeContractPre 合同待签订任务记录表
...@@ -195,8 +197,15 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -195,8 +197,15 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
} }
// 如果已存在合同预信息,则删除旧的信息并插入新的信息 // 如果已存在合同预信息,则删除旧的信息并插入新的信息
if (Common.isNotNull(preExit)) { if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.deleteById(preExit); baseMapper.deleteById(preExit);
//附件信息清空
LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapperContract.eq(TAttaInfo::getDomainId, preExit.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
pre.setId(preExit.getId());
baseMapper.insert(pre); baseMapper.insert(pre);
} else { } else {
// 如果不存在,则直接插入新的合同预信息 // 如果不存在,则直接插入新的合同预信息
......
...@@ -20,15 +20,14 @@ import cn.hutool.core.util.ArrayUtil; ...@@ -20,15 +20,14 @@ import cn.hutool.core.util.ArrayUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService;
...@@ -71,6 +70,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -71,6 +70,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
private final TEmployeePreLogDetailService tEmployeePreLogDetailService; private final TEmployeePreLogDetailService tEmployeePreLogDetailService;
@Lazy @Lazy
private final TEmployeeContractPreService contractPreService; private final TEmployeeContractPreService contractPreService;
@Lazy
private final TAttaInfoService attaInfoService;
/** /**
* 入职确认信息变更日志表简单分页查询 * 入职确认信息变更日志表简单分页查询
...@@ -187,6 +188,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -187,6 +188,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
IGNORE_FIELD.add("customerUserLoginname"); IGNORE_FIELD.add("customerUserLoginname");
IGNORE_FIELD.add("dataSource"); IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("position"); IGNORE_FIELD.add("position");
IGNORE_FIELD.add("contractId");
IGNORE_FIELD.add("registerId");
IGNORE_FIELD.add("createBy"); IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName"); IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy"); IGNORE_FIELD.add("updateBy");
...@@ -303,29 +306,49 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -303,29 +306,49 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
} }
} }
boolean isModifyContract =false;
String differenceContractKey = ""; String differenceContractKey = null;
TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre(); TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre();
if (contractOld != null && employeeContractPre != null) { if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
//1.9.11 huych 附件类型不比较差异 //记录操作记录
contractOld.setAttaList(null); contractOld.setAttaList(null);
employeeContractPre.setAttaList(null); detailEmpLog = new TEmployeePreLogDetail();
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, employeeContractPre, CONTRACT_IGNORE_FIELD); detailEmpLog.setModelType(CommonConstants.THREE_STRING);
if (differenceContractKey.length() > 0) { detailEmpLog.setType(CommonConstants.THREE_STRING);
isModifyContract = true; this.setLogBaseInfo(empPreId, contractOld, null, user, differenceContractKey, logId, detailEmpLog);
} detailList.add(detailEmpLog);
}
if (isModifyContract) {
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息"; diffTitle += "、合同信息";
} else { } else {
diffTitle = "合同信息"; diffTitle = "合同信息";
} }
detailEmpLog = new TEmployeePreLogDetail(); // 创建更新条件构造器
detailEmpLog.setModelType(CommonConstants.TWO_STRING); LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
detailEmpLog.setType(CommonConstants.THREE_STRING); // 设置更新条件和新值
this.setLogBaseInfo(empPreId, contractOld, employeeContractPre, user, differenceContractKey, logId, detailEmpLog); updateWrapperContract.eq(TAttaInfo::getDomainId, contractOld.getId())
detailList.add(detailEmpLog); .set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
//删除历史的合同待签订数据
contractPreService.removeById(contractOld.getId());
}
if (newInfo.getServerItem().contains("合同") && contractOld != null && employeeContractPre != null) {
//1.9.11 huych 附件类型不比较差异
contractOld.setAttaList(null);
employeeContractPre.setAttaList(null);
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, employeeContractPre, CONTRACT_IGNORE_FIELD);
if (differenceContractKey.length() > 0) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
diffTitle = "合同信息";
}
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
detailEmpLog.setType(CommonConstants.THREE_STRING);
this.setLogBaseInfo(empPreId, contractOld, employeeContractPre, user, differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
} }
// 有修改,则加日志 // 有修改,则加日志
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
...@@ -344,7 +367,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -344,7 +367,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
} }
//保存合同待签订数据 //保存合同待签订数据
if (employeeContractPre != null) { if (newInfo.getServerItem().contains("合同") && employeeContractPre != null) {
TEmployeeContractPreVo preVo = new TEmployeeContractPreVo(); TEmployeeContractPreVo preVo = new TEmployeeContractPreVo();
BeanUtils.copyProperties(employeeContractPre,preVo); BeanUtils.copyProperties(employeeContractPre,preVo);
if (Common.isNotNull(employeeContractPre.getExpectedCollectionTime()) ) { if (Common.isNotNull(employeeContractPre.getExpectedCollectionTime()) ) {
...@@ -435,30 +458,50 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -435,30 +458,50 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
} }
} }
boolean isModifyContract =false; String differenceContractKey = null;
String differenceContractKey = "";
TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre(); TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre();
if (contractOld != null && employeeContractPre != null) { if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
//1.9.11 huych 附件类型不比较差异 //记录操作记录
contractOld.setAttaList(null); contractOld.setAttaList(null);
employeeContractPre.setAttaList(null); detailEmpLog = new TEmployeePreLogDetail();
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, employeeContractPre, CONTRACT_IGNORE_FIELD); detailEmpLog.setModelType(CommonConstants.THREE_STRING);
if (differenceContractKey.length() > 0) { detailEmpLog.setType(CommonConstants.THREE_STRING);
isModifyContract = true; this.setPreLogBaseInfo(empPreId, contractOld, null, userId, nickName,
} differenceContractKey, logId, detailEmpLog);
} detailList.add(detailEmpLog);
if (isModifyContract) {
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息"; diffTitle += "、合同信息";
} else { } else {
diffTitle = "合同信息"; diffTitle = "合同信息";
} }
detailEmpLog = new TEmployeePreLogDetail(); // 创建更新条件构造器
detailEmpLog.setModelType(CommonConstants.TWO_STRING); LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
detailEmpLog.setType(CommonConstants.THREE_STRING); // 设置更新条件和新值
this.setPreLogBaseInfo(empPreId, contractOld, employeeContractPre, userId, nickName, updateWrapperContract.eq(TAttaInfo::getDomainId, contractOld.getId())
differenceContractKey, logId, detailEmpLog); .set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
detailList.add(detailEmpLog); // 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
//删除历史的合同待签订数据
contractPreService.removeById(contractOld.getId());
}
if (newInfo.getServerItem().contains("合同") && contractOld != null && employeeContractPre != null) {
//1.9.11 huych 附件类型不比较差异
contractOld.setAttaList(null);
employeeContractPre.setAttaList(null);
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, employeeContractPre, CONTRACT_IGNORE_FIELD);
if (differenceContractKey.length() > 0) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
diffTitle = "合同信息";
}
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
detailEmpLog.setType(CommonConstants.THREE_STRING);
this.setPreLogBaseInfo(empPreId, contractOld, employeeContractPre, userId, nickName,
differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
} }
// 有修改,则加日志 // 有修改,则加日志
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
......
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