Commit 5fa0696a authored by zhenbin wang's avatar zhenbin wang

feature-wzb:bug修复

parent 0bd6e881
......@@ -246,8 +246,23 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
if(!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())){
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())){
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_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())
......@@ -259,8 +274,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("不能重复添加");
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
}
}
return null;
......@@ -290,6 +307,38 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) {
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
}
if(!EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())){
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())){
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_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)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
}
return this.saveContractAndAtta(tEmployeeContractInfo, user);
} catch (Exception e) {
log.error("员工合同保存异常:" + e.getMessage());
......@@ -1083,7 +1132,42 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY);
}
}
if(!EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation()) &&!EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())){
if (CommonConstants.TWO_STRING.equals(insert.getContractType())){
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
errorInfo.append("该员工已存在相同起始日期的合同,禁止重复添加!");
}
}
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, insert.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
errorInfo.append("该员工已存在相同起始和截止日期的合同,禁止重复添加");
}
}
}
if (Common.isEmpty(errorInfo.toString())) {
TEmployeeProject project = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, insert.getEmpIdcard())
......@@ -1357,6 +1441,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isEmpty(contractInfos)){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
List<ErrorMessage> errorMessages = new ArrayList<>();
TEmployeeContractInfo tEmployeeContractInfo;
TEmployeeContractInfo contractInfoInUse;
......@@ -1377,6 +1462,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setContractNo(contract.getContractNo());
tEmployeeContractInfo.setAuditUserName(user.getNickname());
tEmployeeContractInfo.setId(contract.getId());
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
// 非作废、终止,本条变为在用
if (Common.isEmpty(contract.getSituation())
......
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