|
|
|
@ -11,7 +11,6 @@ import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.hrm.service.impl.OrganizationServiceImpl;
|
|
|
|
|
import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.DeleteParam;
|
|
|
|
|
import com.engine.organization.entity.TopTab;
|
|
|
|
|
import com.engine.organization.entity.company.bo.CompBO;
|
|
|
|
|
import com.engine.organization.entity.company.dto.CompListDTO;
|
|
|
|
@ -135,9 +134,18 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
@Override
|
|
|
|
|
public Long updateComp(Map<String, Object> params) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
String ecCompanyId = Util.null2String(params.get("id"));
|
|
|
|
|
Integer ecCompanyId = Integer.parseInt(Util.null2String(params.get("id")));
|
|
|
|
|
Integer supSubComId = Integer.parseInt(Util.null2String(params.get("supsubcomid")));
|
|
|
|
|
Set<Integer> disableIds = new HashSet<>();
|
|
|
|
|
disableIds.add(ecCompanyId);
|
|
|
|
|
List<CompPO> compPOS = getCompMapper().listChild(Collections.singletonList(ecCompanyId));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(compPOS)) {
|
|
|
|
|
addDisableIds(disableIds, compPOS);
|
|
|
|
|
}
|
|
|
|
|
OrganizationAssert.isFalse(disableIds.contains(supSubComId), "上级分部不能选择分部本身及其下级分部");
|
|
|
|
|
|
|
|
|
|
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
|
|
|
|
|
return Long.parseLong(ecCompanyId);
|
|
|
|
|
return (long) ecCompanyId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -180,7 +188,6 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
Map<String, Object> retMap = new HashMap<>();
|
|
|
|
|
List<SearchConditionGroup> groupList = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> itemList;
|
|
|
|
|
List<SearchConditionItem> extendItemList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
|
|
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
|
|
|
|
@ -273,11 +280,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchConditionItem.setViewAttr(viewAttr);
|
|
|
|
|
if ("1".equals(isSystem)) {
|
|
|
|
|
itemList.add(searchConditionItem);
|
|
|
|
|
} else {
|
|
|
|
|
extendItemList.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
itemList.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int operateLevel;
|
|
|
|
@ -319,11 +322,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
searchConditionItem.setViewAttr(viewAttr);
|
|
|
|
|
itemList.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(extendItemList)) {
|
|
|
|
|
groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
HashMap<String, Object> buttonsMap = new HashMap<>();
|
|
|
|
@ -371,7 +370,8 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
// 判断目标分部是否为它本身以及子元素
|
|
|
|
|
Set<Integer> disableIds = new HashSet<>();
|
|
|
|
|
disableIds.add(companyId);
|
|
|
|
|
List<CompPO> compPOS = getCompMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds());
|
|
|
|
|
|
|
|
|
|
List<CompPO> compPOS = getCompMapper().listChild(Collections.singletonList(companyId));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(compPOS)) {
|
|
|
|
|
addDisableIds(disableIds, compPOS);
|
|
|
|
|
}
|
|
|
|
@ -405,7 +405,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
private void addDisableIds(Set<Integer> disableIds, List<CompPO> compPOS) {
|
|
|
|
|
for (CompPO compPO : compPOS) {
|
|
|
|
|
disableIds.add(compPO.getId());
|
|
|
|
|
List<CompPO> childCompPOS = getCompMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds());
|
|
|
|
|
List<CompPO> childCompPOS = getCompMapper().listChild(Collections.singletonList(compPO.getId()));
|
|
|
|
|
addDisableIds(disableIds, childCompPOS);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -448,7 +448,6 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
boolean groupHide = lsField.size() == 0 || hfm.getGroupCount(lsField) == 0 || !"1".equals(Util.null2String(HrmFieldGroupComInfo.getIsShow(groupId)));
|
|
|
|
|
String groupLabel = HrmFieldGroupComInfo.getLabel(groupId);
|
|
|
|
|
List<SearchConditionItem> itemList = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> extendItemList = new ArrayList<>();
|
|
|
|
|
for (Object o : lsField) {
|
|
|
|
|
String fieldId = (String) o;
|
|
|
|
|
String fieldName = HrmFieldComInfo.getFieldname(fieldId);
|
|
|
|
@ -536,17 +535,12 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
otherParams1.put("showOrder", false);
|
|
|
|
|
searchConditionItem.setOtherParams(otherParams1);
|
|
|
|
|
}
|
|
|
|
|
if ("1".equals(isSystem)) {
|
|
|
|
|
itemList.add(searchConditionItem);
|
|
|
|
|
} else {
|
|
|
|
|
extendItemList.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
itemList.add(searchConditionItem);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(extendItemList)) {
|
|
|
|
|
groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return groupList;
|
|
|
|
|
}
|
|
|
|
|