汉桑部门需求二开,添加部门启用时间、封存时间校验
This commit is contained in:
parent
a588d718f9
commit
01d0bbdcfd
|
|
@ -184,10 +184,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
String currentDate = DateUtil.getCurrentDate();
|
||||
|
||||
OrganizationAssert.notBlank(enableDate, "启用日期必填");
|
||||
OrganizationAssert.isTrue(DateUtil.compDate(currentDate, enableDate) >= 0, "启用日期大于等于当前日期");
|
||||
OrganizationAssert.isTrue(DateUtil.compDate(currentDate, enableDate) >= 0, "启用日期需大于等于当前日期");
|
||||
|
||||
if (StringUtils.isNotBlank(disableDate)) {
|
||||
OrganizationAssert.isTrue(DateUtil.compDate(enableDate, disableDate) > 0, "启用日期小于封存日期");
|
||||
OrganizationAssert.isTrue(DateUtil.compDate(enableDate, disableDate) > 0, "启用日期需小于封存日期");
|
||||
}
|
||||
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, params).sync();
|
||||
|
|
@ -223,6 +223,27 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(Integer.parseInt(supDepId)), "上级部门不能选择部门本身及其下级部门");
|
||||
}
|
||||
// 汉桑需求二开,启用日期、封存日期校验
|
||||
|
||||
String enableDate = Util.null2String(params.get("qyrq"));
|
||||
String disableDate = Util.null2String(params.get("fcrq"));
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
OrganizationAssert.notBlank(enableDate, "启用日期必填");
|
||||
String oldEnableDate = "";
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select qyrq,fcrq from hrmdepartmentdefined where deptid = ?", ecDepartmentId);
|
||||
if (rs.next()) {
|
||||
oldEnableDate = rs.getString("qyrq");
|
||||
}
|
||||
|
||||
if (!oldEnableDate.equals(enableDate)) {
|
||||
OrganizationAssert.isTrue(DateUtil.compDate(currentDate, enableDate) >= 0, "启用日期需大于等于当前日期");
|
||||
}
|
||||
if (StringUtils.isNotBlank(disableDate)) {
|
||||
OrganizationAssert.isTrue(DateUtil.compDate(enableDate, disableDate) > 0, "启用日期需小于封存日期");
|
||||
}
|
||||
|
||||
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
||||
return (long) ecDepartmentId;
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ public class DepartmentImport {
|
|||
if (StringUtils.isNotBlank(enableDate)) {
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
if (DateUtil.compDate(currentDate, enableDate) < 0) {
|
||||
historyDetailPO.setOperateDetail("启用日期大于等于当前日期");
|
||||
historyDetailPO.setOperateDetail("启用日期需大于等于当前日期");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue;
|
||||
|
|
@ -314,7 +314,7 @@ public class DepartmentImport {
|
|||
|
||||
if (StringUtils.isNotBlank(disableDate)) {
|
||||
if (DateUtil.compDate(enableDate, disableDate) <= 0) {
|
||||
historyDetailPO.setOperateDetail("启用日期小于封存日期");
|
||||
historyDetailPO.setOperateDetail("启用日期需小于封存日期");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue