Browse Source

[bug-3249]软件验证记录表:审批历史中看不到下一个节点的审核人

szjbdgzl 1 year ago
parent
commit
7b24e53c9e

+ 23 - 0
ibps-bpmn-root/modules/bpmn-biz/src/main/java/com/lc/ibps/bpmn/service/impl/BpmApproveServiceImpl.java

@@ -10,6 +10,8 @@ import java.util.Set;
 
 import javax.annotation.Resource;
 
+import org.activiti.engine.impl.util.json.JSONArray;
+import org.activiti.engine.impl.util.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -293,6 +295,27 @@ public class BpmApproveServiceImpl extends BpmApprovalServiceImpl {
 				po.setQualfieds(JacksonUtil.toJsonString(result));
 				po.setQualifiedExecutor(result);
 			}
+
+			if (StringUtil.isEmpty(auditor) && StringUtil.isNotEmpty(po.getQualfieds())) {
+				JSONArray jsonArray = new JSONArray(po.getQualfieds());
+				StringBuilder userId = new StringBuilder();
+				StringBuilder userName = new StringBuilder();
+				for (int i = 0; i < jsonArray.length(); i++) {
+					JSONObject jsonObject = jsonArray.getJSONObject(i);
+					String id = jsonObject.getString("id");
+					userId.append(id).append(",");
+					APIResult<PartyEntityPo> entityResult = partyEntityService.getByIdPartyType(id, null);
+					if(entityResult.isSuccess()) {
+						if(BeanUtils.isNotEmpty(entityResult.getData())) {
+							userName.append(entityResult.getData().getName()).append(",");
+						}
+					}
+				}
+				userId.deleteCharAt(userId.length() - 1);
+				userName.deleteCharAt(userName.length() - 1);
+				po.setAuditor(userId.toString());
+				po.setAuditorName(userName.toString());
+			}
 			
 			// 设置节点颜色
 			po.setNodeColor(colorMap.get(po.getStatus()));