|
|
|
@ -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;
|
|
|
|
|