Commit 03030ab8 authored by wangzb's avatar wangzb

feature-wzb:bug修复

parent 79a6ae70
...@@ -312,12 +312,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -312,12 +312,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) { if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) {
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL); return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
} }
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)
...@@ -327,8 +332,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -327,8 +332,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo != null) { if (contractInfo != null) {
return R.failed("该员工已存在相同起始日期的合同,禁止重复添加"); return R.failed("该员工已存在相同起始日期的合同,禁止重复添加");
} }
} } else {
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::getContractEnd, tEmployeeContractInfo.getContractEnd()) .eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
...@@ -342,7 +347,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -342,7 +347,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo != null) { if (contractInfo != null) {
return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加"); return R.failed("该员工已存在相同起始和截止日期的合同,禁止重复添加");
} }
}
} }
return this.saveContractAndAtta(tEmployeeContractInfo, user); return this.saveContractAndAtta(tEmployeeContractInfo, user);
...@@ -1146,17 +1151,21 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1146,17 +1151,21 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY); errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY);
} }
} }
TEmployeeContractInfo contractInfo;
if (!EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())) { if (!EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation()) && !EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())) {
if (CommonConstants.CONTRACT_TYPE_TWO.equals(insert.getContractType()) || CommonConstants.CONTRACT_TYPE_ZERO.equals(insert.getContractType())) { if (CommonConstants.TWO_STRING.equals(insert.getContractType()) || CommonConstants.ZERO_STRING.equals(insert.getContractType())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, insert.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::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
...@@ -1164,27 +1173,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1164,27 +1173,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return; return;
} }
} } else {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, insert.getContractStart()) .eq(TEmployeeContractInfo::getContractStart, insert.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, insert.getContractEnd()) .eq(TEmployeeContractInfo::getContractEnd, insert.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT) .and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or() .or()
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT) .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
) )
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) { if (contractInfo != null) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该员工已存在相同起始和截止日期的合同,禁止重复添加")); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该员工已存在相同起始和截止日期的合同,禁止重复添加"));
return; return;
} }
} }
} }
}
if (Common.isEmpty(errorInfo.toString())) { if (Common.isEmpty(errorInfo.toString())) {
TEmployeeProject project = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject project = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, insert.getEmpIdcard()) .eq(TEmployeeProject::getEmpIdcard, insert.getEmpIdcard())
......
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