From bbae34e1e45462fb79e6e4dd2a08563b1265a48a Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Thu, 7 Jan 2021 10:39:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgAuditProcessController.java | 15 ++++++++++----- .../service/impl/DgEfficiencyServiceImpl.java | 1 - .../domain/guarantee/DgAuditProcess.java | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java index ca12ec50..e8b2877b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java @@ -1,6 +1,7 @@ package com.daqing.financial.guarantee.controller; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.daqing.financial.guarantee.feign.HrmsFeignService; import com.daqing.financial.guarantee.service.IDgAuditProcessService; @@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.LinkedHashMap; import java.util.List; /** @@ -48,12 +50,15 @@ public class DgAuditProcessController { @RequestParam(required = false) String processId){ List processList = auditProcessService.queryProcessList(businessId,processId); ResponseResult responseResult = hrmsFeignService.roleList(); - //获取角色名称信息 - List list = (List) responseResult.getData(); + + List message = null; + if(responseResult.getData() != null){ + message = (List) responseResult.getData(); + } for (DgAuditProcess process:processList){ - for (RoleEntity roleEntity:list){ - if (process.getRoleId().equals(roleEntity.getId())){ - process.setDeptName(roleEntity.getName()); + for(LinkedHashMap res : message){ + if(process.getRoleId().equals(res.get("id"))){//如果id相同情况下,就往对象里面赋值 + process.setDeptName(JSONObject.toJSONString(res.get("name")).replace("\"","")); } } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java index a66d8faa..000ca9f5 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java @@ -495,7 +495,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq("user_id", currentUser).eq("business_id",key); diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAuditProcess.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAuditProcess.java index bba7a2ad..999707ee 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAuditProcess.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAuditProcess.java @@ -38,6 +38,7 @@ public class DgAuditProcess implements Serializable { @ApiModelProperty(value = "用户id") private Integer userId; + @TableField(exist = false) @ApiModelProperty(value = "部门名称(实为角色名称)") private String deptName;