Commit 7bca886f authored by 刘斌's avatar 刘斌

fix: 编制计划记录,修改增加校验记录日期

parent b70f019d
......@@ -89,6 +89,9 @@ public class StaffingPlanRecordsCtrl {
@PinSysLog(value = "编制规划记录", businessType = BusinessType.UPDATE)
@PutMapping()
public Response edit(@Validated(EditGroup.class) @RequestBody StaffingPlanRecordsParam param) {
if (!staffingPlanRecordsServ.checkRecordDateUnique(param)) {
return Response.buildFailure(ResultCode.FAIL.getCode(), "新增编制规划'" + param.getRecordDate() + "'失败,记录时间已存在");
}
return ResponseUtils.ofResult(staffingPlanRecordsServ.updateByParam(param));
}
......
......@@ -94,9 +94,9 @@ public class StaffingPlanRecordsServImpl extends ServiceImpl<StaffingPlanRecords
StaffingPlanRecords staffingPlanRecords = MapstructUtils.convert(param, StaffingPlanRecords.class);
String recordDate = staffingPlanRecords.getRecordDate();
Integer recordYear = Convert.toInt(recordDate);
staffingPlanRecords.setLastYearTitle(StrUtil.subPre((recordYear - 1) + "年编制", 2));
staffingPlanRecords.setCurrentYearTitle(StrUtil.subPre(recordDate + "年编制", 2));
staffingPlanRecords.setNextYearTitle(StrUtil.subPre((recordYear + 1) + "年编制", 2));
staffingPlanRecords.setLastYearTitle(StrUtil.subSuf((recordYear - 1) + "年编制", 2));
staffingPlanRecords.setCurrentYearTitle(StrUtil.subSuf(recordDate + "年编制", 2));
staffingPlanRecords.setNextYearTitle(StrUtil.subSuf((recordYear + 1) + "年编制", 2));
return this.save(staffingPlanRecords);
}
......
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