Merge remote-tracking branch 'origin/develop' into feature/ml

This commit is contained in:
Mlin 2023-08-02 11:30:09 +08:00
commit 8b894bbaa3
2 changed files with 33 additions and 22 deletions

View File

@ -523,15 +523,16 @@ public class ChartServiceImpl extends Service implements ChartService {
* @param expandedKeys 完整的上级ID集合 * @param expandedKeys 完整的上级ID集合
* @param expandedKeyStr 需要展开的树ID * @param expandedKeyStr 需要展开的树ID
*/ */
private void addParentTreeId(List<String> expandedKeys,String expandedKeyStr){ private void addParentTreeId(List<String> expandedKeys,String expandedKeyStr) {
if(StringUtils.isNotBlank(expandedKeyStr)) { if (StringUtils.isNotBlank(expandedKeyStr)) {
String[] split = expandedKeyStr.split(","); expandedKeyStr = expandedKeyStr.replace("d", "");
for (String s : split) { try {
try { String[] array;
// 上级分部ID // 上级分部ID
String subcompanyid1 = new DepartmentComInfo().getSubcompanyid1(s); String subcompanyid1 = new DepartmentComInfo().getSubcompanyid1(expandedKeyStr);
if (StringUtils.isNotBlank(subcompanyid1)) {
String allSupCompany = new SubCompanyComInfo().getAllSupCompany(subcompanyid1); String allSupCompany = new SubCompanyComInfo().getAllSupCompany(subcompanyid1);
String[] array = allSupCompany.split(","); array = allSupCompany.split(",");
for (String supCompany : array) { for (String supCompany : array) {
if (StringUtils.isBlank(supCompany)) { if (StringUtils.isBlank(supCompany)) {
continue; continue;
@ -539,22 +540,23 @@ public class ChartServiceImpl extends Service implements ChartService {
expandedKeys.add("s" + supCompany); expandedKeys.add("s" + supCompany);
} }
expandedKeys.add("s" + subcompanyid1); expandedKeys.add("s" + subcompanyid1);
// 上级部门ID
String allSupDepartment = new DepartmentComInfo().getAllSupDepartment(s);
array = allSupDepartment.split(",");
for (String supDepartment : array) {
if (StringUtils.isBlank(supDepartment)) {
continue;
}
expandedKeys.add("d" + supDepartment);
}
expandedKeys.add("d" + s);
} catch (Exception e) {
throw new RuntimeException(e);
} }
// 上级部门ID
String allSupDepartment = new DepartmentComInfo().getAllSupDepartment(expandedKeyStr);
array = allSupDepartment.split(",");
for (String supDepartment : array) {
if (StringUtils.isBlank(supDepartment)) {
continue;
}
expandedKeys.add("d" + supDepartment);
}
expandedKeys.add("d" + expandedKeyStr);
} catch (Exception e) {
throw new RuntimeException(e);
} }
} }
} }

View File

@ -153,6 +153,15 @@ public class CompServiceImpl extends Service implements CompService {
@Override @Override
public Map<String, Object> deleteByIds(Map<String, Object> params) { public Map<String, Object> deleteByIds(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
RecordSet rs = new RecordSet();
HashMap<String, Object> returnMap = new HashMap<>(2);
rs.executeQuery("select id from HrmDepartment where subcompanyid1 =" + Util.null2String(params.get("id")));
if (rs.next()) {
returnMap.put("status", "-1");
returnMap.put("message", SystemEnv.getHtmlLabelName(81683, user.getLanguage()));
return returnMap;
}
return ServiceUtil.getService(OrganizationServiceImpl.class, user).delSubCompany(params, user); return ServiceUtil.getService(OrganizationServiceImpl.class, user).delSubCompany(params, user);
} }