bug:因主管部门变多个,造成人员推送失败

limingyu-20240401-app登录曹实业判断修改
liujun 2024-03-20 16:08:59 +08:00
parent 18c07c68ea
commit 3f3e2dff66
2 changed files with 38 additions and 10 deletions

View File

@ -1,5 +1,6 @@
package com.zcloud.service.xgf.impl; package com.zcloud.service.xgf.impl;
import com.alibaba.fastjson.JSONObject;
import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse; import com.yomahub.liteflow.flow.LiteflowResponse;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
@ -102,17 +103,25 @@ public class XgfUserServiceImpl implements XgfUserService {
/* 主管部门 */ /* 主管部门 */
// 2024-03-20 liu jun :为了兼容新老数据这里做特殊处理 // 2024-03-20 liu jun :为了兼容新老数据这里做特殊处理
if (x.get("MAIN_DEPARTMENT_ID") != null && StringUtils.isNotBlank(x.get("MAIN_DEPARTMENT_ID").toString())) { if (x.get("MAIN_DEPARTMENT_ID") != null && StringUtils.isNotBlank(x.get("MAIN_DEPARTMENT_ID").toString())) {
if (x.getString("MAIN_DEPARTMENT_ID").contains(",")) { if (x.getString("MAIN_DEPARTMENT_ID").contains("]")) {
String[] mainDepartmentIds = x.getString("MAIN_DEPARTMENT_ID").split(","); List<String> mainDepartmentIds = JSONObject.parseArray(x.getString("MAIN_DEPARTMENT_ID"),String.class);
List<String> mainDepartmentNames = new ArrayList<>();
for (String mainDepartmentId : mainDepartmentIds) { for (String mainDepartmentId : mainDepartmentIds) {
condition.clear(); condition.clear();
condition.put("DEPARTMENT_ID", mainDepartmentId); condition.put("DEPARTMENT_ID", mainDepartmentId);
regDepartmentEntity = departmentService.getCorpDepartment(condition); regDepartmentEntity = departmentService.getCorpDepartment(condition);
if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) { if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) {
x.put("MAIN_DEPARTMENT_NAME", x.getString("MAIN_DEPARTMENT_NAME") + "," + regDepartmentEntity.get("NAME")); mainDepartmentNames.add(regDepartmentEntity.getString("NAME"));
break;
} }
} }
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 { } else {
throw new RuntimeException("主管部门ID不能为空"); throw new RuntimeException("主管部门ID不能为空");
@ -136,12 +145,30 @@ public class XgfUserServiceImpl implements XgfUserService {
x.put("MANAGER_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); x.put("MANAGER_DEPARTMENT_NAME", regDepartmentEntity.get("NAME"));
} }
/* 主管部门 */ /* 主管部门 */
condition.clear(); // 2024-03-20 liu jun :为了兼容新老数据这里做特殊处理
condition.put("DEPARTMENT_ID", x.get("MAIN_DEPARTMENT_ID")); if (x.get("MAIN_DEPARTMENT_ID") != null && StringUtils.isNotBlank(x.get("MAIN_DEPARTMENT_ID").toString())) {
regDepartmentEntity = departmentService.getCorpDepartment(condition); if (x.getString("MAIN_DEPARTMENT_ID").contains("]")) {
x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); List<String> mainDepartmentIds = JSONObject.parseArray(x.getString("MAIN_DEPARTMENT_ID"), String.class);
if (regDepartmentEntity.size() > 0) { List<String> mainDepartmentNames = new ArrayList<>();
x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); 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("IS_DELETE", "0");
x.put("VALID_FLAG", "1"); x.put("VALID_FLAG", "1");

View File

@ -380,6 +380,7 @@
or (c.APPOINT_SIX_USER_ID = #{USER_ID} and c.FLOWS_STEP = '6') 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') or (c.APPOINT_SEVEN_USER_ID = #{USER_ID} and c.FLOWS_STEP = '7')
) )
and a.VALID_FLAG = '1'
</select> </select>
</mapper> </mapper>