bug:因主管部门变多个,造成人员推送失败
parent
18c07c68ea
commit
3f3e2dff66
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.service.xgf.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.zcloud.entity.Page;
|
||||
|
@ -102,17 +103,25 @@ public class XgfUserServiceImpl implements XgfUserService {
|
|||
/* 主管部门 */
|
||||
// 2024-03-20 liu jun :为了兼容新老数据这里做特殊处理
|
||||
if (x.get("MAIN_DEPARTMENT_ID") != null && StringUtils.isNotBlank(x.get("MAIN_DEPARTMENT_ID").toString())) {
|
||||
if (x.getString("MAIN_DEPARTMENT_ID").contains(",")) {
|
||||
String[] mainDepartmentIds = x.getString("MAIN_DEPARTMENT_ID").split(",");
|
||||
if (x.getString("MAIN_DEPARTMENT_ID").contains("]")) {
|
||||
List<String> mainDepartmentIds = JSONObject.parseArray(x.getString("MAIN_DEPARTMENT_ID"),String.class);
|
||||
List<String> mainDepartmentNames = new ArrayList<>();
|
||||
for (String mainDepartmentId : mainDepartmentIds) {
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", mainDepartmentId);
|
||||
regDepartmentEntity = departmentService.getCorpDepartment(condition);
|
||||
if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) {
|
||||
x.put("MAIN_DEPARTMENT_NAME", x.getString("MAIN_DEPARTMENT_NAME") + "," + regDepartmentEntity.get("NAME"));
|
||||
break;
|
||||
mainDepartmentNames.add(regDepartmentEntity.getString("NAME"));
|
||||
}
|
||||
}
|
||||
x.put("MAIN_DEPARTMENT_NAME", StringUtils.join(mainDepartmentNames, ","));
|
||||
}else {
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.get("MAIN_DEPARTMENT_ID"));
|
||||
regDepartmentEntity = departmentService.getCorpDepartment(condition);
|
||||
if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) {
|
||||
x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("主管部门ID不能为空");
|
||||
|
@ -136,12 +145,30 @@ public class XgfUserServiceImpl implements XgfUserService {
|
|||
x.put("MANAGER_DEPARTMENT_NAME", regDepartmentEntity.get("NAME"));
|
||||
}
|
||||
/* 主管部门 */
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.get("MAIN_DEPARTMENT_ID"));
|
||||
regDepartmentEntity = departmentService.getCorpDepartment(condition);
|
||||
x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME"));
|
||||
if (regDepartmentEntity.size() > 0) {
|
||||
x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME"));
|
||||
// 2024-03-20 liu jun :为了兼容新老数据这里做特殊处理
|
||||
if (x.get("MAIN_DEPARTMENT_ID") != null && StringUtils.isNotBlank(x.get("MAIN_DEPARTMENT_ID").toString())) {
|
||||
if (x.getString("MAIN_DEPARTMENT_ID").contains("]")) {
|
||||
List<String> mainDepartmentIds = JSONObject.parseArray(x.getString("MAIN_DEPARTMENT_ID"), String.class);
|
||||
List<String> mainDepartmentNames = new ArrayList<>();
|
||||
for (String mainDepartmentId : mainDepartmentIds) {
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", mainDepartmentId);
|
||||
regDepartmentEntity = departmentService.getCorpDepartment(condition);
|
||||
if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) {
|
||||
mainDepartmentNames.add(regDepartmentEntity.getString("NAME"));
|
||||
}
|
||||
}
|
||||
x.put("MAIN_DEPARTMENT_NAME", StringUtils.join(mainDepartmentNames, ","));
|
||||
} else {
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.get("MAIN_DEPARTMENT_ID"));
|
||||
regDepartmentEntity = departmentService.getCorpDepartment(condition);
|
||||
if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) {
|
||||
x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("主管部门ID不能为空");
|
||||
}
|
||||
x.put("IS_DELETE", "0");
|
||||
x.put("VALID_FLAG", "1");
|
||||
|
|
|
@ -380,6 +380,7 @@
|
|||
or (c.APPOINT_SIX_USER_ID = #{USER_ID} and c.FLOWS_STEP = '6')
|
||||
or (c.APPOINT_SEVEN_USER_ID = #{USER_ID} and c.FLOWS_STEP = '7')
|
||||
)
|
||||
and a.VALID_FLAG = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue