|
|
|
@ -1,6 +1,9 @@ |
|
|
|
|
package com.daqing.financial.guarantee.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.daqing.financial.guarantee.DgApplyAmountInfoControllerApi; |
|
|
|
|
import com.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
@ -16,6 +19,8 @@ import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgApplyAmountListService; |
|
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; |
|
|
|
|
import com.daqing.framework.domain.hrms.UserEntity; |
|
|
|
|
import com.daqing.framework.domain.hrms.ext.EmployeeTO; |
|
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.util.JwtUtils; |
|
|
|
@ -169,7 +174,8 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA |
|
|
|
|
public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page,@RequestParam(value="size",required=false) Integer size, |
|
|
|
|
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){ |
|
|
|
|
//获取当前登录用户id
|
|
|
|
|
String userId = getUserId(); |
|
|
|
|
//String userId = getUserId();
|
|
|
|
|
String userId ="9"; |
|
|
|
|
|
|
|
|
|
//根据角色查询资产部调查列表
|
|
|
|
|
String roleIds = RedisUtil.get("dq:userRole:" + userId); |
|
|
|
@ -182,19 +188,47 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//遍历data里面的数据提单人id,找出匹配id,将用户名以及部门名称赋值进去
|
|
|
|
|
List<BusinessApplicationListResponse> list = (List<BusinessApplicationListResponse>) data.getList(); |
|
|
|
|
if(list.size()>0){ |
|
|
|
|
Integer presenterId = list.get(0).getPresenterId(); |
|
|
|
|
//根据提单人id查询其部门名称
|
|
|
|
|
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(presenterId.longValue()); |
|
|
|
|
|
|
|
|
|
for (BusinessApplicationListResponse response:list) { |
|
|
|
|
if(employeeMessage.getData() != null){ |
|
|
|
|
if(response.getPresenterId().equals(employeeMessage.getData().getId())){//如果提单人id相同情况下,就往对象里面赋值
|
|
|
|
|
response.setAccount(employeeMessage.getData().getAccount()); |
|
|
|
|
response.setDeptName(employeeMessage.getData().getDeptName()); |
|
|
|
|
} |
|
|
|
|
if(data != null){ |
|
|
|
|
List<BusinessApplicationListResponse> list = (List<BusinessApplicationListResponse>) data.getList(); |
|
|
|
|
if(list.size()>0){ |
|
|
|
|
List<Integer> arr = new ArrayList<>(); |
|
|
|
|
for (BusinessApplicationListResponse res : list) { |
|
|
|
|
arr.add(res.getPresenterId()); |
|
|
|
|
} |
|
|
|
|
//根据提单人id查询其部门名称
|
|
|
|
|
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); |
|
|
|
|
List<EmployeeMessageResponse> employeeMessage = null; |
|
|
|
|
if(responseResult.getData() != null){ |
|
|
|
|
employeeMessage = (List<EmployeeMessageResponse>) responseResult.getData(); |
|
|
|
|
} |
|
|
|
|
System.out.println("employeeMessage============"+employeeMessage); |
|
|
|
|
List<String> empList = new ArrayList<>(); |
|
|
|
|
for (EmployeeMessageResponse resq : employeeMessage) { |
|
|
|
|
empList.add(resq.getId().toString()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* List<String> strList = new ArrayList<>(); |
|
|
|
|
String temp = null; |
|
|
|
|
for (int n=0; n<list.size(); n++){ |
|
|
|
|
temp = list.get(n).getPresenterId().toString(); |
|
|
|
|
} |
|
|
|
|
if(empList.contains(temp)){ |
|
|
|
|
strList.add(temp); |
|
|
|
|
} |
|
|
|
|
System.out.println("strList=============="+strList);*/ |
|
|
|
|
//int i=0;
|
|
|
|
|
|
|
|
|
|
//List<EmployeeMessageResponse> employeelist = JSONObject.parseArray(employeeMessage,EmployeeMessageResponse.class);
|
|
|
|
|
|
|
|
|
|
/* for (BusinessApplicationListResponse response:list) { |
|
|
|
|
for(EmployeeMessageResponse res : employeelist){ |
|
|
|
|
if(response.getPresenterId().equals(res.getId())){//如果提单人id相同情况下,就往对象里面赋值
|
|
|
|
|
response.setAccount(res.getAccount()); |
|
|
|
|
response.setDeptName(res.getDeptName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// i++;
|
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return new ResponseResult<PageUtils>().SUCCESS(data); |
|
|
|
|