Commit 79a6ae70 authored by wangzb's avatar wangzb

feature-wzb:bug修复

parent 90b9ea08
...@@ -246,37 +246,42 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -246,37 +246,42 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
} }
TEmployeeContractInfo contractInfo;
if (!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())) { if (!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())) {
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType()) || CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) { if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType()) || CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.and(obj -> obj.eq(TEmployeeContractInfo::getContractType, CommonConstants.TWO_STRING)
.or()
.eq(TEmployeeContractInfo::getContractType, CommonConstants.ZERO_STRING)
)
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
return R.failed("该员工已存在相同起始日期的合同,禁止重复添加"); return R.failed("该员工已存在相同起始日期的合同,禁止重复添加");
} }
} else {
contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
} }
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
} }
} }
......
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