|
|
|
@ -5,11 +5,13 @@ import com.engine.hrm.service.impl.HrmJobServiceImpl;
|
|
|
|
|
import com.engine.hrm.service.impl.OrganizationServiceImpl;
|
|
|
|
|
import com.engine.organization.entity.commom.RecordInfo;
|
|
|
|
|
import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
import com.engine.organization.enums.OperateTypeEnum;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtMapper;
|
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
@ -315,17 +317,33 @@ public class OrganizationRunable implements Runnable {
|
|
|
|
|
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
String[] split = departmentIds.split(",");
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
|
|
|
|
if (StringUtils.isBlank(forbiddenTag)) {
|
|
|
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(Long.parseLong(s));
|
|
|
|
|
params.put("dept_name_short", departmentPO.getDeptNameShort() + currentTimeMillis);
|
|
|
|
|
params.put("dept_name", departmentPO.getDeptName() + currentTimeMillis);
|
|
|
|
|
params.put("parent_comp", departmentPO.getParentComp());
|
|
|
|
|
params.put("parent_dept", departmentPO.getParentDept());
|
|
|
|
|
params.put("show_order", departmentPO.getShowOrder());
|
|
|
|
|
params.put("dept_no", departmentPO.getDeptNo());
|
|
|
|
|
params.put("dept_principal", departmentPO.getDeptPrincipal());
|
|
|
|
|
updateDepartment();
|
|
|
|
|
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("id", StringUtils.join(idList, ","));
|
|
|
|
|
if (StringUtils.isBlank(forbiddenTag) || "1".equals(forbiddenTag)) {
|
|
|
|
|
// 封存
|
|
|
|
|
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
|
|
|
|
|
} else {
|
|
|
|
|
if ("0".equals(forbiddenTag)) {
|
|
|
|
|
// 解封
|
|
|
|
|
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentISCanceled(map, user);
|
|
|
|
|
} else {
|
|
|
|
|
// 封存
|
|
|
|
|
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|