抄送列表连库筛选

master
chen 4 years ago
parent 3d1757b5fc
commit ff8d8ad154
  1. 47
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyUserServiceImpl.java
  2. 15
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgCopyUserMapper.xml

@ -87,32 +87,31 @@ public class DgCopyUserServiceImpl extends ServiceImpl<DgCopyUserMapper, DgCopyU
List<CopyForMeResponse> copyForMeResponseList = baseMapper.selectCopyForMe(copyForMeRequest);
if (copyForMeResponseList.size() > 0) {
List<Integer> arr = new ArrayList<>();
for (CopyForMeResponse res : copyForMeResponseList) {
Integer approveId = res.getApproveId();
if (approveId!=null){
arr.add(res.getApproveId());
}
arr.add(res.getApplicantId());
}
// List<Integer> arr = new ArrayList<>();
// for (CopyForMeResponse res : copyForMeResponseList) {
// Integer approveId = res.getApproveId();
// if (approveId!=null){
// arr.add(res.getApproveId());
// }
// arr.add(res.getApplicantId());
// }
//去重
List<Integer> collect = arr.stream().distinct().collect(Collectors.toList());
// List<Integer> collect = arr.stream().distinct().collect(Collectors.toList());
//根据提单人id查询其部门名称
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(collect);
List<LinkedHashMap> employeeMessage = null;
if (responseResult.getData() != null) {
employeeMessage = (List<LinkedHashMap>) responseResult.getData();
}
if(employeeMessage != null){
for (CopyForMeResponse response : copyForMeResponseList) {
for (LinkedHashMap res : employeeMessage) {
if (response.getApplicantId()!=null && response.getApplicantId().equals(res.get("id"))) {//如果提单人id相同情况下,就往对象里面赋值
response.setApplicant(JSONObject.toJSONString(res.get("account")).replace("\"", ""));
}
}
}
}
// ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(collect);
// List<LinkedHashMap> employeeMessage = null;
// if (responseResult.getData() != null) {
// employeeMessage = (List<LinkedHashMap>) responseResult.getData();
// }
// if(employeeMessage != null){
// for (CopyForMeResponse response : copyForMeResponseList) {
// for (LinkedHashMap res : employeeMessage) {
// if (response.getApplicantId()!=null && response.getApplicantId().equals(res.get("id"))) {//如果提单人id相同情况下,就往对象里面赋值
// response.setApplicant(JSONObject.toJSONString(res.get("account")).replace("\"", ""));
// }
// }
// }
// }
//转换任务节点
copyForMeResponseList.forEach(copyForMeResponse -> {

@ -11,6 +11,7 @@
<resultMap id="CopyForMeMap" type="com.daqing.financial.guarantee.model.response.CopyForMeResponse">
<result column="presenter_id" property="applicantId"/>
<result column="applicant" property="applicant"/>
<result column="name" property="clientName"/>
<result column="create_time" property="applicationDate"/>
<result column="process_id" property="taskNode"/>
@ -34,15 +35,14 @@
resultMap="CopyForMeMap">
SELECT
aai.presenter_id,aai.business_code,aai.create_time,aai.approval_id,aai.status,
aai.business_type,aai.bank,aai.business_type,
cc.name,cc.phone,cf.process_id,
cf.update_time as approve_date,cf.detail_id,cf.business_id,
bps.business_status,
lcc.loan_money,lcc.loan_tern,lcc.passing_time,lcc.file
aai.business_type,aai.bank,cc.name,cc.phone,cf.process_id,cf.update_time as approve_date,
cf.detail_id,cf.business_id,bps.business_status,lcc.loan_money,lcc.loan_tern,
lcc.passing_time,lcc.file,dq_financial_hrms.hrms_employee.name as applicant
FROM
dg_copy_user cu
JOIN dg_copy_for cf ON cu.copy_id = cf.id
LEFT JOIN dg_apply_amount_info aai ON cf.business_id = aai.id
LEFT JOIN dq_financial_hrms.hrms_employee on aai.presenter_id = dq_financial_hrms.hrms_employee.user_id
LEFT JOIN crms_company_customer ccc ON aai.company_id = ccc.id
left join dg_loan_committee_consider lcc on cf.business_id = lcc.business_id
LEFT JOIN crms_customer cc ON ccc.customer_id = cc.id
@ -52,7 +52,7 @@
AND cf.update_time BETWEEN #{startTime} and #{endTime}
</if>
<if test="clientName != null and clientName != ''">
AND cc.name LIKE '%' #{clientName} '%'
AND concat(cc.name LIKE '%' #{clientName} '%' or dq_financial_hrms.hrms_employee.name LIKE '%' #{clientName} '%')
</if>
order by aai.create_time desc
limit #{page},#{size}
@ -65,6 +65,7 @@
dg_copy_user cu
JOIN dg_copy_for cf ON cu.copy_id = cf.id
LEFT JOIN dg_apply_amount_info aai ON cf.business_id = aai.id
LEFT JOIN dq_financial_hrms.hrms_employee on aai.presenter_id = dq_financial_hrms.hrms_employee.user_id
LEFT JOIN crms_company_customer ccc ON aai.company_id = ccc.id
left join dg_loan_committee_consider lcc on cf.business_id = lcc.business_id
LEFT JOIN crms_customer cc ON ccc.customer_id = cc.id
@ -74,7 +75,7 @@
AND cf.update_time BETWEEN #{startTime} and #{endTime}
</if>
<if test="clientName != null and clientName != ''">
AND cc.name LIKE '%' #{clientName} '%'
AND concat(cc.name LIKE '%' #{clientName} '%' or dq_financial_hrms.hrms_employee.name LIKE '%' #{clientName} '%')
</if>
</select>

Loading…
Cancel
Save