Commit 8f199280 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.21' into MVP1.7.21

parents dab30bf7 7b589b8a
...@@ -652,6 +652,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -652,6 +652,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
} }
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1)); preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1));
List<String> errorMessages = new ArrayList<>();
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){ if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
//校验劳务派遣的派遣年限必须为两年 //校验劳务派遣的派遣年限必须为两年
final int REQUIRED_SERVICE_YEARS = 2; final int REQUIRED_SERVICE_YEARS = 2;
...@@ -659,7 +661,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -659,7 +661,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
try { try {
year = Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0" : preVo.getDispatchPeriodYear().trim()); year = Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0" : preVo.getDispatchPeriodYear().trim());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return "劳务派遣的派遣年限格式不正确"; errorMessages.add("劳务派遣的派遣年限格式不正确");
} }
String dispatchMonth = preVo.getDispatchPeriodMonth(); String dispatchMonth = preVo.getDispatchPeriodMonth();
if ("12".equals(dispatchMonth)) { if ("12".equals(dispatchMonth)) {
...@@ -667,7 +669,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -667,7 +669,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
if (year < REQUIRED_SERVICE_YEARS) { if (year < REQUIRED_SERVICE_YEARS) {
return "劳务派遣合同的合同年限不能小于2年,请检查"; errorMessages.add("劳务派遣合同的合同年限不能小于 2 年,请检查");
} }
vo = new TEmployeeContractDateVo(); vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth())); vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth()));
...@@ -675,19 +677,27 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -675,19 +677,27 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
vo.setRegistDate(preVo.getDispatchPeriodStart()); vo.setRegistDate(preVo.getDispatchPeriodStart());
preVo.setDispatchPeriodEnd(this.addYearsMonths(vo)); preVo.setDispatchPeriodEnd(this.addYearsMonths(vo));
} }
if (Common.isNotNull(preVo.getDispatchPeriodStart()) && Common.isNotNull(preVo.getDispatchPeriodEnd())){ if (Common.isNotNull(preVo.getDispatchPeriodStart())
&& Common.isNotNull(preVo.getDispatchPeriodEnd())){
if (preVo.getDispatchPeriodEnd().before(preVo.getDispatchPeriodStart())){ if (preVo.getDispatchPeriodEnd().before(preVo.getDispatchPeriodStart())){
return "派遣结束日期需大于等于派遣开始日期"; errorMessages.add("派遣结束日期需大于等于派遣开始日期");
} }
} }
//合同开始时间、合同截止时间 与派遣的合同开始时间、合同截止时间一致 //合同开始时间、合同截止时间 与派遣的合同开始时间、合同截止时间一致
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getDispatchPeriodStart()) if (Common.isNotNull(preVo.getContractStart())
&& Common.isNotNull(preVo.getDispatchPeriodStart())
&& !preVo.getContractStart().equals(preVo.getDispatchPeriodStart())){ && !preVo.getContractStart().equals(preVo.getDispatchPeriodStart())){
return "合同开始日期与派遣开始日期不一致"; errorMessages.add("合同开始日期与派遣开始日期不一致");
} }
if (Common.isNotNull(preVo.getContractEnd()) && Common.isNotNull(preVo.getDispatchPeriodEnd()) if (Common.isNotNull(preVo.getContractEnd())
&& Common.isNotNull(preVo.getDispatchPeriodEnd())
&& !preVo.getContractEnd().equals(preVo.getDispatchPeriodEnd())){ && !preVo.getContractEnd().equals(preVo.getDispatchPeriodEnd())){
return "合同截止日期与派遣截止日期不一致"; errorMessages.add("合同截止日期与派遣截止日期不一致");
}
// 如果有错误信息,一起返回
if (!errorMessages.isEmpty()) {
return String.join(";", errorMessages);
} }
} }
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉 //同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
......
...@@ -1152,6 +1152,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1152,6 +1152,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
} }
//劳务派遣合同相关校验 //劳务派遣合同相关校验
List<String> allErrorMessages = new ArrayList<>();
if (CommonConstants.TWENTY_STRING.equals(employeeContractPreVo.getContractType()) if (CommonConstants.TWENTY_STRING.equals(employeeContractPreVo.getContractType())
|| "劳务派遣合同".equals(employeeContractPreVo.getContractType())) { || "劳务派遣合同".equals(employeeContractPreVo.getContractType())) {
...@@ -1163,7 +1164,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1163,7 +1164,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
try { try {
dispatchYears = Integer.parseInt(employeeContractPreVo.getDispatchPeriodYear().trim()); dispatchYears = Integer.parseInt(employeeContractPreVo.getDispatchPeriodYear().trim());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return "劳务派遣的派遣年限格式不正确"; allErrorMessages.add("劳务派遣的派遣年限格式不正确");
} }
// 将派遣月份转换为年的小数部分(例如:6 个月=0.5 年) // 将派遣月份转换为年的小数部分(例如:6 个月=0.5 年)
...@@ -1171,40 +1172,32 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1171,40 +1172,32 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
try { try {
dispatchMonths = Integer.parseInt(employeeContractPreVo.getDispatchPeriodMonth().trim()); dispatchMonths = Integer.parseInt(employeeContractPreVo.getDispatchPeriodMonth().trim());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return "劳务派遣的派遣月份格式不正确"; allErrorMessages.add("劳务派遣的派遣月份格式不正确");
} }
// 计算总派遣年限(年 + 月/12) // 计算总派遣年限(年 + 月/12)
double totalDispatchYears = dispatchYears + (dispatchMonths / 12.0); double totalDispatchYears = dispatchYears + (dispatchMonths / 12.0);
if (totalDispatchYears < REQUIRED_SERVICE_YEARS) { if (totalDispatchYears < REQUIRED_SERVICE_YEARS) {
return "劳务派遣合同的合同年限不能小于 2 年,请检查"; allErrorMessages.add("劳务派遣合同的合同年限不能小于 2 年,请检查");
} }
} }
if (Common.isNotNull(employeeContractPreVo.getDispatchPeriodStart()) if (Common.isNotNull(employeeContractPreVo.getDispatchPeriodStart())
&& Common.isNotNull(employeeContractPreVo.getDispatchPeriodEnd())) { && Common.isNotNull(employeeContractPreVo.getDispatchPeriodEnd())) {
if (employeeContractPreVo.getDispatchPeriodEnd().before(employeeContractPreVo.getDispatchPeriodStart())) { if (employeeContractPreVo.getDispatchPeriodEnd().before(employeeContractPreVo.getDispatchPeriodStart())) {
return "派遣结束日期需大于等于派遣开始日期"; allErrorMessages.add("派遣结束日期需大于等于派遣开始日期");
} }
} }
// 合同开始时间、合同截止时间应与派遣的合同开始时间、合同截止时间一致 // 合同开始时间、合同截止时间应与派遣的合同开始时间、合同截止时间一致
if (Common.isNotNull(employeeContractPreVo.getContractStart()) if (Common.isNotNull(employeeContractPreVo.getContractStart())
&& Common.isNotNull(employeeContractPreVo.getDispatchPeriodStart()) && Common.isNotNull(employeeContractPreVo.getDispatchPeriodStart())
&& !employeeContractPreVo.getContractStart().equals(employeeContractPreVo.getDispatchPeriodStart())) { && !employeeContractPreVo.getContractStart().equals(employeeContractPreVo.getDispatchPeriodStart())) {
return "合同开始日期与派遣开始日期不一致"; allErrorMessages.add("合同开始日期与派遣开始日期不一致");
} }
if (Common.isNotNull(employeeContractPreVo.getContractEnd()) if (Common.isNotNull(employeeContractPreVo.getContractEnd())
&& Common.isNotNull(employeeContractPreVo.getDispatchPeriodEnd()) && Common.isNotNull(employeeContractPreVo.getDispatchPeriodEnd())
&& !employeeContractPreVo.getContractEnd().equals(employeeContractPreVo.getDispatchPeriodEnd())) { && !employeeContractPreVo.getContractEnd().equals(employeeContractPreVo.getDispatchPeriodEnd())) {
return "合同截止日期与派遣截止日期不一致"; allErrorMessages.add("合同截止日期与派遣截止日期不一致");
}
}
// 校验合同有效期:合同截止日期不得早于合同开始日期
if (Common.isNotNull(employeeContractPreVo.getContractStart())
&& Common.isNotNull(employeeContractPreVo.getContractEnd())) {
if (employeeContractPreVo.getContractEnd().before(employeeContractPreVo.getContractStart())) {
return "合同截止日期需大于等于合同开始日期";
} }
} }
...@@ -1219,17 +1212,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1219,17 +1212,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (!Common.isEmpty(employeeContractPreVo.getContractTerm()) if (!Common.isEmpty(employeeContractPreVo.getContractTerm())
&& !Common.isEmpty(employeeContractPreVo.getTryPeriodNum())) { && !Common.isEmpty(employeeContractPreVo.getTryPeriodNum())) {
// 安全解析试用期月数 // 安全解析试用期月数
int tryPeriodMonths; int tryPeriodMonths = 0;
try { try {
tryPeriodMonths = Integer.parseInt(employeeContractPreVo.getTryPeriodNum().trim()); tryPeriodMonths = Integer.parseInt(employeeContractPreVo.getTryPeriodNum().trim());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return "试用期月份格式不正确"; allErrorMessages.add("试用期月份格式不正确");
} }
// 无固定期限合同校验(contractTerm = "2") // 无固定期限合同校验(contractTerm = "2")
if (CommonConstants.TWO_STRING.equals(employeeContractPreVo.getContractTerm())) { if (CommonConstants.TWO_STRING.equals(employeeContractPreVo.getContractTerm())) {
if (tryPeriodMonths > 6) { if (tryPeriodMonths > 6) {
return "无固定期限时试用期不得超过 6 个月"; allErrorMessages.add("无固定期限时试用期不得超过 6 个月");
} }
} }
// 固定期限合同校验(contractTerm = "1") // 固定期限合同校验(contractTerm = "1")
...@@ -1266,24 +1259,35 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1266,24 +1259,35 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (totalContractMonths < 12) { if (totalContractMonths < 12) {
// 合同期限不满 1 年,试用期不得超过 1 个月 // 合同期限不满 1 年,试用期不得超过 1 个月
if (tryPeriodMonths > 1) { if (tryPeriodMonths > 1) {
return "固定期限时合同年限不满一年的,试用期不得超过 1 个月"; allErrorMessages.add("固定期限时合同年限不满一年的,试用期不得超过 1 个月");
} }
} else if (totalContractMonths >= 12 && totalContractMonths < 36) { } else if (totalContractMonths >= 12 && totalContractMonths < 36) {
// 合同期限 1 年以上不满 3 年,试用期不得超过 2 个月 // 合同期限 1 年以上不满 3 年,试用期不得超过 2 个月
if (tryPeriodMonths > 2) { if (tryPeriodMonths > 2) {
return "固定期限时合同年限 1 年以上不满 3 年的,试用期不得超过 2 个月"; allErrorMessages.add("固定期限时合同年限 1 年以上不满 3 年的,试用期不得超过 2 个月");
} }
} else { } else {
// 合同期限 3 年以上,试用期不得超过 6 个月 // 合同期限 3 年以上,试用期不得超过 6 个月
if (tryPeriodMonths > 6) { if (tryPeriodMonths > 6) {
return "固定期限时合同年限 3 年以上的,试用期不得超过 6 个月"; allErrorMessages.add("固定期限时合同年限 3 年以上的,试用期不得超过 6 个月");
} }
} }
} }
} }
} }
} }
// 校验合同有效期:合同截止日期不得早于合同开始日期
if (Common.isNotNull(employeeContractPreVo.getContractStart())
&& Common.isNotNull(employeeContractPreVo.getContractEnd())) {
if (employeeContractPreVo.getContractEnd().before(employeeContractPreVo.getContractStart())) {
allErrorMessages.add("合同截止日期需大于等于合同开始日期");
}
}
// 如果有错误信息,一起返回
if (!allErrorMessages.isEmpty()) {
return String.join(";", allErrorMessages);
}
return null; return null;
} }
......
...@@ -453,6 +453,13 @@ public class TInsuranceDetail extends BaseEntity { ...@@ -453,6 +453,13 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "可替换说明") @Schema(description = "可替换说明")
private String replaceRemark; private String replaceRemark;
/**
* 可替换说明备份 (用于退保时恢复)
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@Schema(description = "可替换说明备份")
private String replaceRemarkBak;
/** /**
* 差额 settleId * 差额 settleId
*/ */
......
...@@ -858,6 +858,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -858,6 +858,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
BeanCopyUtils.copyProperties(detail,newDetail); BeanCopyUtils.copyProperties(detail,newDetail);
detail.setIsEffect(CommonConstants.ONE_INT); detail.setIsEffect(CommonConstants.ONE_INT);
detail.setIsOverdue(null); detail.setIsOverdue(null);
// 【调整】保存被替换人 A 的替换说明到备份字段 (不清空,用于后续退保时恢复)
if (StringUtils.isNotBlank(detail.getReplaceRemark())) {
detail.setReplaceRemarkBak(detail.getReplaceRemark());
}
// 清空被替换数据的替换标签和说明 // 清空被替换数据的替换标签和说明
detail.setReplaceTag(null); detail.setReplaceTag(null);
detail.setReplaceRemark(null); detail.setReplaceRemark(null);
...@@ -1976,7 +1982,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1976,7 +1982,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(null); detail.setIsEffect(null);
one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId()) .eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
//huyc-代码优化,取替换状态为成功的那一条数据 //huyc-代码优化取替换状态为成功的那一条数据
.eq(TInsuranceReplace::getReplaceStatus, CommonConstants.ONE_INT) .eq(TInsuranceReplace::getReplaceStatus, CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){ if (Optional.ofNullable(one).isPresent()){
...@@ -1988,6 +1994,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1988,6 +1994,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//被替换者激活 //被替换者激活
byId.setIsEffect(CommonConstants.ZERO_INT); byId.setIsEffect(CommonConstants.ZERO_INT);
byId.setIsOverdue(CommonConstants.ZERO_INT); byId.setIsOverdue(CommonConstants.ZERO_INT);
// 【调整】从被替换人 A 自己的备份字段恢复标签信息
// 优先使用 A 自己的 replaceRemarkBak 值
if (StringUtils.isNotBlank(byId.getReplaceRemarkBak())) {
byId.setReplaceRemark(byId.getReplaceRemarkBak());
} else {
// 如果备份字段为空,使用默认值
byId.setReplaceRemark("可替换");
}
byId.setReplaceTag("可替换");
updList.add(byId); updList.add(byId);
} }
} }
......
...@@ -130,6 +130,9 @@ public class TSalaryAccountPhoneController { ...@@ -130,6 +130,9 @@ public class TSalaryAccountPhoneController {
@Operation(description = "获取工资明细信息") @Operation(description = "获取工资明细信息")
@GetMapping("/getSalaryAccountForm") @GetMapping("/getSalaryAccountForm")
public R<TSalarySetVo> getSalaryAccountForm(@RequestParam String id, Integer type,String openId) { public R<TSalarySetVo> getSalaryAccountForm(@RequestParam String id, Integer type,String openId) {
if (Common.isEmpty(id) || Common.isEmpty(openId)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
//校验openId,openId 不对直接返回 //校验openId,openId 不对直接返回
if (!checkOpenId(openId)){ if (!checkOpenId(openId)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
......
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