|
|
|
@ -3,6 +3,8 @@ package com.engine.organization.service.impl;
|
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.api.browser.bean.SearchConditionOption;
|
|
|
|
|
import com.api.hrm.bean.HrmFieldBean;
|
|
|
|
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
@ -28,6 +30,7 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
import com.engine.organization.enums.ModuleTypeEnum;
|
|
|
|
|
import com.engine.organization.enums.OperateTypeEnum;
|
|
|
|
|
import com.engine.organization.exception.OrganizationRunTimeException;
|
|
|
|
|
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompanyMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
@ -56,6 +59,11 @@ import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
import weaver.hrm.company.DepartmentComInfo;
|
|
|
|
|
import weaver.hrm.definedfield.HrmDeptFieldManagerE9;
|
|
|
|
|
import weaver.hrm.definedfield.HrmFieldComInfo;
|
|
|
|
|
import weaver.hrm.definedfield.HrmFieldGroupComInfo;
|
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -207,45 +215,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
@Override
|
|
|
|
|
public Long saveBaseForm(Map<String, Object> params) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
//String deptNo = (String) params.get("dept_no");
|
|
|
|
|
//// 判断是否开启自动编号
|
|
|
|
|
//deptNo = repeatDetermine(deptNo);
|
|
|
|
|
//params.put("dept_no", deptNo);
|
|
|
|
|
//if (StringUtils.isBlank(Util.null2String(params.get("show_order")))) {
|
|
|
|
|
// Integer maxShowOrder = getDepartmentMapper().getMaxShowOrder();
|
|
|
|
|
// if (null == maxShowOrder) {
|
|
|
|
|
// maxShowOrder = 0;
|
|
|
|
|
// }
|
|
|
|
|
// params.put("show_order", maxShowOrder + 1);
|
|
|
|
|
//}
|
|
|
|
|
//// 上级分部
|
|
|
|
|
//String ecCompany = Util.null2String(params.get("ec_company"));
|
|
|
|
|
//if (StringUtils.isNotBlank(ecCompany)) {
|
|
|
|
|
// CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(ecCompany);
|
|
|
|
|
// if (null != jclCompanyId) {
|
|
|
|
|
// params.put("parent_comp", jclCompanyId.getId());
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//// 上级部门
|
|
|
|
|
//String ecDepartment = Util.null2String(params.get("ec_department"));
|
|
|
|
|
//if (StringUtils.isNotBlank(ecDepartment)) {
|
|
|
|
|
// DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(ecDepartment);
|
|
|
|
|
// if (null != jclDepartmentId) {
|
|
|
|
|
// params.put("parent_dept", jclDepartmentId.getId());
|
|
|
|
|
// // 部门不为空,自动指定所属分部
|
|
|
|
|
// params.put("parent_comp", jclDepartmentId.getParentComp());
|
|
|
|
|
// params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(jclDepartmentId.getParentComp())));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//}
|
|
|
|
|
//Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, params).sync();
|
|
|
|
|
//String ecCompanyID = Util.null2String(syncMap.get("id"));
|
|
|
|
|
//OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString());
|
|
|
|
|
//// 查询UUID
|
|
|
|
|
//RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_DEPARTMENT, ecCompanyID);
|
|
|
|
|
//params.put("uuid", recordInfo.getUuid());
|
|
|
|
|
//return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", null);
|
|
|
|
|
return 1L;
|
|
|
|
|
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, params).sync();
|
|
|
|
|
String ecCompanyID = Util.null2String(syncMap.get("id"));
|
|
|
|
|
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString());
|
|
|
|
|
return Long.parseLong(ecCompanyID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -261,61 +234,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Long updateForm(Map<String, Object> params) {
|
|
|
|
|
//HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
//DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
|
|
|
|
|
//String groupId = (String) params.get("viewCondition");
|
|
|
|
|
//if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
|
|
|
|
|
// DepartmentPO oldDept = getDepartmentMapper().getDeptById(searchParam.getId());
|
|
|
|
|
// String deptNo = searchParam.getDeptNo();
|
|
|
|
|
// if (!deptNo.equals(oldDept.getDeptNo())) {
|
|
|
|
|
// deptNo = repeatDetermine(deptNo);
|
|
|
|
|
// params.put("dept_no", deptNo);
|
|
|
|
|
// }
|
|
|
|
|
// // 上级分部
|
|
|
|
|
// String ecCompany = Util.null2String(params.get("ec_company"));
|
|
|
|
|
// if (StringUtils.isNotBlank(ecCompany)) {
|
|
|
|
|
// CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(ecCompany);
|
|
|
|
|
// if (null != jclCompanyId) {
|
|
|
|
|
// params.put("parent_comp", jclCompanyId.getId());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // 上级部门
|
|
|
|
|
// String ecDepartment = Util.null2String(params.get("ec_department"));
|
|
|
|
|
// if (StringUtils.isNotBlank(ecDepartment)) {
|
|
|
|
|
// DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(ecDepartment);
|
|
|
|
|
// if (null != jclDepartmentId) {
|
|
|
|
|
// // 上级部门不能选择本身
|
|
|
|
|
// OrganizationAssert.isFalse(jclDepartmentId.getId().equals(searchParam.getId()), "上级部门不能选择本身");
|
|
|
|
|
// params.put("parent_dept", jclDepartmentId.getId());
|
|
|
|
|
// // 部门不为空,自动指定所属分部
|
|
|
|
|
// params.put("parent_comp", jclDepartmentId.getParentComp());
|
|
|
|
|
// params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(jclDepartmentId.getParentComp())));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// } else {
|
|
|
|
|
// params.put("parent_dept", "");
|
|
|
|
|
// }
|
|
|
|
|
// new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
|
|
|
|
// // 更新主表数据
|
|
|
|
|
// getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
|
|
|
|
|
//
|
|
|
|
|
// DepartmentPO newDeptById = getDepartmentMapper().getDeptById(searchParam.getId());
|
|
|
|
|
// new DepartmentTriggerRunnable(oldDept, newDeptById).run();
|
|
|
|
|
//
|
|
|
|
|
// Long parentComp = StringUtils.isNotEmpty(Util.null2String(params.get("parent_comp"))) ? Long.parseLong(Util.null2String(params.get("parent_comp"))) : null;
|
|
|
|
|
// // 刷新岗位所属分部
|
|
|
|
|
// refreshJobComp(searchParam.getId(), parentComp);
|
|
|
|
|
// List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(searchParam.getId());
|
|
|
|
|
// String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentComp));
|
|
|
|
|
// forbiddenChildTag(parentComp, ecCompanyId, childList);
|
|
|
|
|
//}
|
|
|
|
|
//// 更新主表拓展表
|
|
|
|
|
//getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, "", searchParam.getId());
|
|
|
|
|
////更新明细表
|
|
|
|
|
//getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
|
|
|
|
|
//
|
|
|
|
|
//return searchParam.getId();
|
|
|
|
|
return 1L;
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
String ecCompanyId = Util.null2String(params.get("id"));
|
|
|
|
|
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
|
|
|
|
return Long.parseLong(ecCompanyId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -330,35 +252,18 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
// 编号
|
|
|
|
|
SearchConditionItem deptNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "deptNo");
|
|
|
|
|
SearchConditionItem departmentCodeItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "departmentCode");
|
|
|
|
|
// 名称
|
|
|
|
|
SearchConditionItem deptNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "departmentName");
|
|
|
|
|
// 简称
|
|
|
|
|
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "deptNameShort");
|
|
|
|
|
SearchConditionItem departmentNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "departmentName");
|
|
|
|
|
// 所属分部
|
|
|
|
|
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "164", "ecCompany", "");
|
|
|
|
|
SearchConditionItem subCompanyId1Item = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "164", "subCompanyId1", "");
|
|
|
|
|
// 上级部门
|
|
|
|
|
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "4", "ecDepartment", "");
|
|
|
|
|
// 部门负责人
|
|
|
|
|
SearchConditionItem deptPrincipalBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", "");
|
|
|
|
|
// 显示顺序
|
|
|
|
|
SearchConditionItem showOrderItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "显示顺序", "showOrder");
|
|
|
|
|
// 禁用标记
|
|
|
|
|
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
|
|
|
|
SearchConditionOption enableOption = new SearchConditionOption("true", "启用");
|
|
|
|
|
SearchConditionOption disableOption = new SearchConditionOption("false", "禁用");
|
|
|
|
|
selectOptions.add(enableOption);
|
|
|
|
|
selectOptions.add(disableOption);
|
|
|
|
|
SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "禁用标记", "forbiddenTag");
|
|
|
|
|
|
|
|
|
|
conditionItems.add(deptNoItem);
|
|
|
|
|
conditionItems.add(deptNameItem);
|
|
|
|
|
conditionItems.add(deptNameShortItem);
|
|
|
|
|
conditionItems.add(parentCompBrowserItem);
|
|
|
|
|
conditionItems.add(parentDeptBrowserItem);
|
|
|
|
|
conditionItems.add(deptPrincipalBrowserItem);
|
|
|
|
|
conditionItems.add(showOrderItem);
|
|
|
|
|
conditionItems.add(forbiddenTagItem);
|
|
|
|
|
SearchConditionItem supDepIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "4", "supDepId", "");
|
|
|
|
|
|
|
|
|
|
conditionItems.add(departmentCodeItem);
|
|
|
|
|
conditionItems.add(departmentNameItem);
|
|
|
|
|
conditionItems.add(subCompanyId1Item);
|
|
|
|
|
conditionItems.add(supDepIdItem);
|
|
|
|
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
|
|
|
|
apiDatas.put("conditions", addGroups);
|
|
|
|
@ -415,39 +320,152 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSaveForm(DeptSearchParam param) {
|
|
|
|
|
public Map<String, Object> getSaveForm(Map<String, Object> params) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
//List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
//List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
|
|
|
|
//if (CollectionUtils.isNotEmpty(extendTitles)) {
|
|
|
|
|
// Map<String, Object> params = new HashMap<>();
|
|
|
|
|
// // 分部
|
|
|
|
|
// if (StringUtils.isNotBlank(Util.null2String(param.getSubcompanyid1()))) {
|
|
|
|
|
// CompanyPO companyPO = getCompanyMapper().listById(param.getSubcompanyid1());
|
|
|
|
|
// if (null != companyPO) {
|
|
|
|
|
// params.put("parent_comp", companyPO.getId());
|
|
|
|
|
// params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(companyPO.getId().toString()));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // 部门
|
|
|
|
|
// if (StringUtils.isNotBlank(Util.null2String(param.getDepartmentid()))) {
|
|
|
|
|
// DepartmentPO deptById = getDepartmentMapper().getDeptById(param.getDepartmentid());
|
|
|
|
|
// if (null != deptById) {
|
|
|
|
|
// params.put("parent_dept", deptById.getId());
|
|
|
|
|
// params.put("ec_department", EcHrmRelationUtil.getEcDepartmentId(deptById.getId().toString()));
|
|
|
|
|
// params.put("parent_comp", deptById.getParentComp());
|
|
|
|
|
// params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(deptById.getParentComp().toString()));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (ExtendTitlePO extendTitle : extendTitles) {
|
|
|
|
|
// List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue(), params);
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(items)) {
|
|
|
|
|
// addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//apiDatas.put("condition", addGroups);
|
|
|
|
|
List<Map<String, Object>> groupList = new ArrayList<>();
|
|
|
|
|
Map<String, Object> groupItem;
|
|
|
|
|
List<Object> itemList;
|
|
|
|
|
|
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
|
|
int viewAttr = Util.getIntValue(Util.null2String(params.get("viewattr")), 1);
|
|
|
|
|
String nodeType = Util.null2String(params.get("type"));
|
|
|
|
|
String addType = Util.null2String(params.get("addType"));
|
|
|
|
|
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
|
|
|
|
String subcompanyid1 = "";
|
|
|
|
|
String supDepId = "";
|
|
|
|
|
|
|
|
|
|
switch (addType) {
|
|
|
|
|
case "normal":
|
|
|
|
|
if (nodeType.equals("subcompany")) {
|
|
|
|
|
subcompanyid1 = id;
|
|
|
|
|
} else {
|
|
|
|
|
subcompanyid1 = departmentComInfo.getSubcompanyid1(id);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "sibling":
|
|
|
|
|
subcompanyid1 = departmentComInfo.getSubcompanyid1(id);
|
|
|
|
|
supDepId = departmentComInfo.getDepartmentsupdepid(id);
|
|
|
|
|
break;
|
|
|
|
|
case "child":
|
|
|
|
|
subcompanyid1 = departmentComInfo.getSubcompanyid1(id);
|
|
|
|
|
supDepId = id;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HrmFieldGroupComInfo HrmFieldGroupComInfo = new HrmFieldGroupComInfo();
|
|
|
|
|
HrmFieldComInfo HrmFieldComInfo = new HrmFieldComInfo();
|
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
|
SearchConditionItem searchConditionItem;
|
|
|
|
|
HrmFieldBean hrmFieldBean;
|
|
|
|
|
HrmDeptFieldManagerE9 hfm;
|
|
|
|
|
try {
|
|
|
|
|
hfm = new HrmDeptFieldManagerE9(5);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new OrganizationRunTimeException("");
|
|
|
|
|
}
|
|
|
|
|
hfm.isReturnDecryptData(true);
|
|
|
|
|
hfm.getCustomData(Util.getIntValue(id));
|
|
|
|
|
List lsGroup = hfm.getLsGroup();
|
|
|
|
|
for (int tmp = 0; lsGroup != null && tmp < lsGroup.size(); tmp++) {
|
|
|
|
|
String groupid = (String) lsGroup.get(tmp);
|
|
|
|
|
List lsField = hfm.getLsField(groupid);
|
|
|
|
|
|
|
|
|
|
boolean groupHide = lsField.size() == 0 || hfm.getGroupCount(lsField) == 0 || !Util.null2String(HrmFieldGroupComInfo.getIsShow(groupid)).equals("1");
|
|
|
|
|
String grouplabel = HrmFieldGroupComInfo.getLabel(groupid);
|
|
|
|
|
itemList = new ArrayList<>();
|
|
|
|
|
groupItem = new HashMap<>();
|
|
|
|
|
groupItem.put("title", SystemEnv.getHtmlLabelNames(grouplabel, user.getLanguage()));
|
|
|
|
|
groupItem.put("hide", groupHide);
|
|
|
|
|
groupItem.put("defaultshow", true);
|
|
|
|
|
for (Object o : lsField) {
|
|
|
|
|
String fieldId = (String) o;
|
|
|
|
|
String fieldName = HrmFieldComInfo.getFieldname(fieldId);
|
|
|
|
|
String isUse = HrmFieldComInfo.getIsused(fieldId);
|
|
|
|
|
if (!isUse.equals("1")) continue;
|
|
|
|
|
int tmpViewAttr = viewAttr;
|
|
|
|
|
String rules = "";
|
|
|
|
|
String fieldLabel = HrmFieldComInfo.getLabel(fieldId);
|
|
|
|
|
String fieldHtmlType = HrmFieldComInfo.getFieldhtmltype(fieldId);
|
|
|
|
|
String type = HrmFieldComInfo.getFieldType(fieldId);
|
|
|
|
|
String dmlUrl = Util.null2String(HrmFieldComInfo.getFieldDmlurl(fieldId));
|
|
|
|
|
String fieldValue = "";
|
|
|
|
|
if (StringUtils.isBlank(addType)) {
|
|
|
|
|
if (HrmFieldComInfo.getIssystem(fieldId).equals("1")) {
|
|
|
|
|
fieldValue = hfm.getData(fieldName);
|
|
|
|
|
} else {
|
|
|
|
|
fieldValue = hfm.getData("hrmdepartmentdefined", fieldName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!groupHide && tmpViewAttr == 2 && HrmFieldComInfo.getIsmand(fieldId).equals("1")) {
|
|
|
|
|
tmpViewAttr = 3;
|
|
|
|
|
if ("1".equals(fieldHtmlType) && "2".equals(type)) {
|
|
|
|
|
rules = "required|integer";
|
|
|
|
|
} else {
|
|
|
|
|
rules = "required|string";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (subcompanyid1.length() > 0 && fieldName.equals("subcompanyid1")) {
|
|
|
|
|
fieldValue = subcompanyid1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (supDepId.length() > 0 && fieldName.equals("supdepid")) {
|
|
|
|
|
fieldValue = supDepId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fieldName.equals("showid")) {
|
|
|
|
|
if (addType.length() > 0) {
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
fieldValue = id;
|
|
|
|
|
tmpViewAttr = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hrmFieldBean = new HrmFieldBean();
|
|
|
|
|
hrmFieldBean.setFieldid(fieldId);
|
|
|
|
|
hrmFieldBean.setFieldname(fieldName);
|
|
|
|
|
hrmFieldBean.setFieldlabel(fieldLabel);
|
|
|
|
|
hrmFieldBean.setFieldhtmltype(fieldHtmlType);
|
|
|
|
|
hrmFieldBean.setType(type);
|
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
|
hrmFieldBean.setIssystem("1");
|
|
|
|
|
hrmFieldBean.setFieldvalue(fieldValue);
|
|
|
|
|
hrmFieldBean.setDmlurl(dmlUrl);
|
|
|
|
|
hrmFieldBean.setViewAttr(tmpViewAttr);
|
|
|
|
|
hrmFieldBean.setRules(rules);
|
|
|
|
|
if (hrmFieldBean.getFieldname().equals("subcompanyid1") || hrmFieldBean.getFieldname().equals("supdepid")) {
|
|
|
|
|
hrmFieldBean.setHideVirtualOrg(true);
|
|
|
|
|
}
|
|
|
|
|
if (hrmFieldBean.getFieldname().equals("departmentcode")) {
|
|
|
|
|
hrmFieldBean.setMultilang(false);
|
|
|
|
|
}
|
|
|
|
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
if (searchConditionItem != null) {
|
|
|
|
|
searchConditionItem.setLabelcol(8);
|
|
|
|
|
searchConditionItem.setFieldcol(16);
|
|
|
|
|
if (fieldName.equals("showorder")) {
|
|
|
|
|
searchConditionItem.setPrecision(2);
|
|
|
|
|
}
|
|
|
|
|
if (fieldName.equals("showid")) {
|
|
|
|
|
Map<String, Object> otherParams = new HashMap<>();
|
|
|
|
|
otherParams.put("hasBorder", true);
|
|
|
|
|
searchConditionItem.setOtherParams(otherParams);
|
|
|
|
|
}
|
|
|
|
|
if ("6".equals(fieldHtmlType)) {//附件
|
|
|
|
|
Map<String, Object> otherParams1 = new HashMap<>();
|
|
|
|
|
otherParams1.put("showOrder", false);
|
|
|
|
|
searchConditionItem.setOtherParams(otherParams1);
|
|
|
|
|
}
|
|
|
|
|
itemList.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
groupItem.put("items", itemList);
|
|
|
|
|
groupList.add(groupItem);
|
|
|
|
|
}
|
|
|
|
|
apiDatas.put("condition", groupList);
|
|
|
|
|
return apiDatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -541,7 +559,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SearchConditionGroup> getMergeForm(Long id) {
|
|
|
|
|
public List<SearchConditionGroup> getMergeForm() {
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> condition = new ArrayList<>();
|
|
|
|
|
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到部门", "4", "department", "");
|
|
|
|
@ -775,9 +793,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
// 查询部门信息
|
|
|
|
|
Integer parentCompId = StringUtil.isEmpty(id) ? null : Integer.parseInt(id);
|
|
|
|
|
CompanyPO compBuild = CompanyPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
|
|
|
|
|
List<CompanyPO> allCompanys = getCompanyMapper().listAll("show_order");
|
|
|
|
|
List<CompanyPO> allCompanys = getCompanyMapper().listAll("showOrder");
|
|
|
|
|
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
|
|
|
|
|
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "show_order");
|
|
|
|
|
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "showOrder");
|
|
|
|
|
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
|
|
|
|
|
|
|
|
|
|
Map<Integer, CompanyPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompanyPO::getId, item -> item, (k1, k2) -> k1));
|
|
|
|
@ -799,7 +817,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
private void buildParentComps(CompanyPO compPO, Set<CompanyPO> builderComps, Map<Integer, CompanyPO> allMaps) {
|
|
|
|
|
builderComps.add(compPO);
|
|
|
|
|
CompanyPO parentComp = allMaps.get(compPO.getSupSubComId());
|
|
|
|
|
if (null != parentComp && 0 == parentComp.getCanceled()) {
|
|
|
|
|
if (null != parentComp && (null == parentComp.getCanceled() || 0 == parentComp.getCanceled())) {
|
|
|
|
|
buildParentComps(parentComp, builderComps, allMaps);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|