Commit f4034726 authored by huyuchen's avatar huyuchen

huych-档案更新优化

parent 10585d14
...@@ -227,7 +227,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -227,7 +227,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//查询项目档案 //查询项目档案
TEmployeeProject tEmployeeProject = employeeProjectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject tEmployeeProject = employeeProjectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo, settleDomain.getDepartNo()) .eq(TEmployeeProject::getDeptNo, settleDomain.getDepartNo())
.eq(TEmployeeProject::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TEmployeeProject::getEmpIdcard, fddContractAttachInfo.getEmpIdcard())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
//查询人员档案 //查询人员档案
TEmployeeInfo tEmployeeInfo = employeeInfoService.getOne(Wrappers.<TEmployeeInfo>query().lambda().eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING) TEmployeeInfo tEmployeeInfo = employeeInfoService.getOne(Wrappers.<TEmployeeInfo>query().lambda().eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
...@@ -275,7 +277,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -275,7 +277,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId()) .eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
//无可用合同 //无可用合同
if (null == employeeContractInfo) { if (null == employeeContractInfo) {
//新增合同 //新增合同
...@@ -410,7 +414,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -410,7 +414,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//查询员工合同 //查询员工合同
TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId()) .eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (employeeContractInfo != null) { if (employeeContractInfo != null) {
long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId())); long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId()));
if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().before(employeeContractInfo.getContractEnd())) { if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().before(employeeContractInfo.getContractEnd())) {
...@@ -513,7 +519,8 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -513,7 +519,8 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
TEmployeeContractInfo employeeContractInfoValid = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractInfoValid = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpName, attachInfo.getEmpName()).eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpName, attachInfo.getEmpName()).eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getIsObsolete, CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getIsObsolete, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart())); .eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart())
.last(CommonConstants.LAST_ONE_SQL));
if (employeeContractInfoValid == null) { if (employeeContractInfoValid == null) {
errorList.add(new ErrorMessage(i, NO_VALID_CONTRACT_FOUND, CommonConstants.RED)); errorList.add(new ErrorMessage(i, NO_VALID_CONTRACT_FOUND, CommonConstants.RED));
continue; continue;
...@@ -531,7 +538,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -531,7 +538,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
.and(wrapper -> wrapper.and(wrapper2 -> wrapper2.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart()) .and(wrapper -> wrapper.and(wrapper2 -> wrapper2.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, attachInfo.getContractEnd()).eq(TEmployeeContractInfo::getContractType, CommonConstants.ONE_STRING))//有合同截止日期 .eq(TEmployeeContractInfo::getContractEnd, attachInfo.getContractEnd()).eq(TEmployeeContractInfo::getContractType, CommonConstants.ONE_STRING))//有合同截止日期
.or(wrapper1 -> wrapper1.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart()).in(TEmployeeContractInfo::getContractType, CommonConstants.ZERO_STRING, CommonConstants.TWO_STRING))//无合同截止时间 .or(wrapper1 -> wrapper1.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart()).in(TEmployeeContractInfo::getContractType, CommonConstants.ZERO_STRING, CommonConstants.TWO_STRING))//无合同截止时间
)); ).last(CommonConstants.LAST_ONE_SQL));
if (employeeContractInfo == null) { if (employeeContractInfo == null) {
errorList.add(new ErrorMessage(i, NO_VALID_CONTRACT_FOUND, CommonConstants.RED)); errorList.add(new ErrorMessage(i, NO_VALID_CONTRACT_FOUND, CommonConstants.RED));
continue; continue;
...@@ -591,7 +598,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -591,7 +598,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
TEmployeeInfo tEmployeeInfo, TCustomerInfo tCustomerInfo, TEmployeeProject tEmployeeProject) { TEmployeeInfo tEmployeeInfo, TCustomerInfo tCustomerInfo, TEmployeeProject tEmployeeProject) {
TEmployeeContractInfo employeeContractCount = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractCount = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId()) .eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
//合同表里没有在用的合同 //合同表里没有在用的合同
if (null == employeeContractCount) { if (null == employeeContractCount) {
newEmployeeContractInfo.setEmpName(fddContractAttachInfo.getEmpName()); newEmployeeContractInfo.setEmpName(fddContractAttachInfo.getEmpName());
......
...@@ -287,7 +287,8 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe ...@@ -287,7 +287,8 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
} }
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda() FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda()
.eq(FddContractAttachInfo::getContractId,entity.getContractId())); .eq(FddContractAttachInfo::getContractId,entity.getContractId())
.last(CommonConstants.LAST_ONE_SQL));
if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) { if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) {
return R.failed("当前用户不是电子合同导入用户,不能操作"); return R.failed("当前用户不是电子合同导入用户,不能操作");
} }
...@@ -893,7 +894,9 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe ...@@ -893,7 +894,9 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
if (reviseTaskDetailR.getCode() != CommonConstants.SUCCESS) { if (reviseTaskDetailR.getCode() != CommonConstants.SUCCESS) {
return R.failed(reviseTaskDetailR.getMsg()); return R.failed(reviseTaskDetailR.getMsg());
} }
FddContractAttachInfo attachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, entity.getContractId())); FddContractAttachInfo attachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda()
.eq(FddContractAttachInfo::getContractId, entity.getContractId())
.last(CommonConstants.LAST_ONE_SQL));
int status = reviseTaskDetailR.getData(); int status = reviseTaskDetailR.getData();
CancelReviseTaskReq req = new CancelReviseTaskReq(); CancelReviseTaskReq req = new CancelReviseTaskReq();
if (status == CommonConstants.ZERO_INT || status == CommonConstants.ONE_INT) { if (status == CommonConstants.ZERO_INT || status == CommonConstants.ONE_INT) {
......
...@@ -116,7 +116,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -116,7 +116,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda() TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle()) .eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(tSettleDomain)) { if (Common.isEmpty(tSettleDomain)) {
return R.failed("对应项目编码的项目已停止合作"); return R.failed("对应项目编码的项目已停止合作");
} }
...@@ -257,7 +259,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -257,7 +259,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda() tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getNewSettleCode()) .eq(TSettleDomain::getDepartNo, excel.getNewSettleCode())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING) .eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(tSettleDomain)) { if (Common.isEmpty(tSettleDomain)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST, excel.getNewSettleCode())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST, excel.getNewSettleCode()));
} }
...@@ -565,7 +568,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -565,7 +568,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda() TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, vo.getNewDeptNo()) .eq(TSettleDomain::getDepartNo, vo.getNewDeptNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING) .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(tSettleDomain)) { if (Common.isEmpty(tSettleDomain)) {
return R.failed("对应项目编码的项目已停止合作"); return R.failed("对应项目编码的项目已停止合作");
} }
......
...@@ -349,7 +349,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -349,7 +349,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda() socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard) .eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId()) .eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getSocialHousehold, library.getSocialHousehold())); .eq(TSocialFundInfo::getSocialHousehold, library.getSocialHousehold())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(socialFundInfo) && (Common.isNotNull(socialFundInfo.getSocialId()) if (Common.isNotNull(socialFundInfo) && (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus()))) { || CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus()))) {
...@@ -363,7 +364,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -363,7 +364,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda() socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard) .eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId()) .eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getProvidentHousehold, library.getProvidentHousehold())); .eq(TSocialFundInfo::getProvidentHousehold, library.getProvidentHousehold())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(socialFundInfoF) && (Common.isNotNull(socialFundInfoF.getFundId()) if (Common.isNotNull(socialFundInfoF) && (Common.isNotNull(socialFundInfoF.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus()))) { && CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus()))) {
//办理成功生成收入 //办理成功生成收入
......
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