|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@ -18,13 +19,17 @@ import com.daqing.financial.guarantee.util.ArraysUtil; |
|
|
|
import com.daqing.financial.guarantee.util.AuditProcessUtil; |
|
|
|
import com.daqing.financial.guarantee.util.AuditProcessUtil; |
|
|
|
import com.daqing.framework.domain.crms.CrmsCustomerRelated; |
|
|
|
import com.daqing.framework.domain.crms.CrmsCustomerRelated; |
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
import com.daqing.framework.domain.guarantee.*; |
|
|
|
import com.daqing.framework.domain.guarantee.*; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; |
|
|
|
|
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
import com.daqing.framework.util.RandomUtil; |
|
|
|
import com.daqing.framework.util.RandomUtil; |
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -99,7 +104,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
//申请贷款相关信息
|
|
|
|
//申请贷款相关信息
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
dgApplyAmountInfo.setCompanyId(businessApplication.getCompanyId()); |
|
|
|
dgApplyAmountInfo.setCompanyId(businessApplication.getCompanyId()); |
|
|
|
dgApplyAmountInfo.setPresenterId(Integer.parseInt(userId)); |
|
|
|
dgApplyAmountInfo.setPresenterId(5);//Integer.parseInt(userId)
|
|
|
|
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
|
|
|
|
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
|
|
|
|
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
|
|
|
|
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
|
|
|
|
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
|
|
|
|
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
|
|
|
@ -115,8 +120,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
//新增到业务列表
|
|
|
|
//新增到业务列表
|
|
|
|
DgApplyAmountList dgApplyAmountList = new DgApplyAmountList(); |
|
|
|
DgApplyAmountList dgApplyAmountList = new DgApplyAmountList(); |
|
|
|
dgApplyAmountList.setBusinessId(dgApplyAmountInfo.getId()); |
|
|
|
dgApplyAmountList.setBusinessId(dgApplyAmountInfo.getId()); |
|
|
|
dgApplyAmountList.setPresenterId(Integer.parseInt(userId)); |
|
|
|
dgApplyAmountList.setPresenterId(5);//Integer.parseInt(userId)
|
|
|
|
dgApplyAmountList.setEmpId(Integer.parseInt(userId)); |
|
|
|
dgApplyAmountList.setEmpId(5);//Integer.parseInt(userId)
|
|
|
|
dgApplyAmountList.setRoleId(PromptSuccess.DB_YWY_ID); |
|
|
|
dgApplyAmountList.setRoleId(PromptSuccess.DB_YWY_ID); |
|
|
|
dgApplyAmountList.setType(1);//类型为担保业务员
|
|
|
|
dgApplyAmountList.setType(1);//类型为担保业务员
|
|
|
|
|
|
|
|
|
|
|
@ -134,10 +139,19 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
crmsFeignService.updateIsExistRelated(dgApplyAmountInfo.getCompanyId(),businessApplication.getIsExistRelated()); |
|
|
|
crmsFeignService.updateIsExistRelated(dgApplyAmountInfo.getCompanyId(),businessApplication.getIsExistRelated()); |
|
|
|
|
|
|
|
|
|
|
|
//绑定关联关系
|
|
|
|
//绑定关联关系
|
|
|
|
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); |
|
|
|
/* List<CrmsCustomerRelated> relatedList = new ArrayList<>(); |
|
|
|
crmsCustomerRelated.setCustomerId(dgApplyAmountInfo.getCompanyId());//企业id
|
|
|
|
List<Integer> intList = businessApplication.getRelatedId(); |
|
|
|
crmsCustomerRelated.setRelatedId(businessApplication.getRelatedId());//关联人/企业id
|
|
|
|
|
|
|
|
crmsFeignService.insertCustomerRelated(crmsCustomerRelated); |
|
|
|
for(int i=0;i<intList.size();i++){ |
|
|
|
|
|
|
|
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); |
|
|
|
|
|
|
|
Integer integer = intList.get(i); |
|
|
|
|
|
|
|
crmsCustomerRelated.setCustomerId(dgApplyAmountInfo.getCompanyId());//企业id
|
|
|
|
|
|
|
|
crmsCustomerRelated.setRelatedId(integer);//关联人/企业id
|
|
|
|
|
|
|
|
relatedList.add(crmsCustomerRelated); |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//此处在新增关联企业/个人的时候就做了绑定,不需要重复绑定
|
|
|
|
|
|
|
|
//crmsFeignService.insertCustomerRelated(relatedList);
|
|
|
|
|
|
|
|
|
|
|
|
//上传附件信息
|
|
|
|
//上传附件信息
|
|
|
|
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); |
|
|
|
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); |
|
|
@ -327,13 +341,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
//修改是否存在关联人
|
|
|
|
//修改是否存在关联人
|
|
|
|
crmsFeignService.updateIsExistRelated(businessApplication.getCompanyId(),businessApplication.getIsExistRelated()); |
|
|
|
crmsFeignService.updateIsExistRelated(businessApplication.getCompanyId(),businessApplication.getIsExistRelated()); |
|
|
|
|
|
|
|
|
|
|
|
//绑定关联关系
|
|
|
|
|
|
|
|
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); |
|
|
|
|
|
|
|
crmsCustomerRelated.setCustomerId(dgApplyAmountInfo.getCompanyId());//企业id
|
|
|
|
|
|
|
|
crmsCustomerRelated.setRelatedId(businessApplication.getRelatedId());//关联人/企业id
|
|
|
|
|
|
|
|
crmsFeignService.insertCustomerRelated(crmsCustomerRelated); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上传附件信息
|
|
|
|
//上传附件信息
|
|
|
|
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); |
|
|
|
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); |
|
|
|
dgEnclosureInfo.setBusinessId(businessApplication.getBusinessId());//业务id
|
|
|
|
dgEnclosureInfo.setBusinessId(businessApplication.getBusinessId());//业务id
|
|
|
@ -395,29 +402,32 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean excelExport(List<String> ids, HttpServletResponse response) { |
|
|
|
public Boolean excelExport(List<String> ids, HttpServletResponse response) { |
|
|
|
/* //根据ids查询业务申请列表信息
|
|
|
|
//根据ids查询业务申请列表信息
|
|
|
|
List<BusinessApplicationListResponse>applyList = this.baseMapper.selectListByIds(ids); |
|
|
|
List<BusinessApplicationListResponse>applyList = this.baseMapper.selectListByIds(ids); |
|
|
|
System.out.println("applyList==========================="+applyList); |
|
|
|
System.out.println("applyList==========================="+applyList); |
|
|
|
List<Integer>list2= new ArrayList<>(); |
|
|
|
if(applyList != null){ |
|
|
|
List<BusinessApplicationListResponse> list = this.getBaseMapper().excelList(); |
|
|
|
if(applyList.size()>0){ |
|
|
|
for (BusinessApplicationListResponse res:applyList) { |
|
|
|
List<Integer> arr = new ArrayList<>(); |
|
|
|
//list2.add(res.getPresenterId());
|
|
|
|
for (BusinessApplicationListResponse res : applyList) { |
|
|
|
|
|
|
|
arr.add(res.getPresenterId()); |
|
|
|
//根据userId获取用户名以及部门名称
|
|
|
|
} |
|
|
|
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(res.getPresenterId().longValue()); |
|
|
|
//根据提单人id查询其部门名称
|
|
|
|
|
|
|
|
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); |
|
|
|
//for (BusinessApplicationListResponse businessList:list) {
|
|
|
|
List<LinkedHashMap> employeeMessage = null; |
|
|
|
if(employeeMessage.getData()!= null){ |
|
|
|
if(responseResult.getData() != null){ |
|
|
|
if(res.getPresenterId().equals(employeeMessage.getData().getId())){//如果userId相同情况下,就往对象里面赋值
|
|
|
|
employeeMessage = (List<LinkedHashMap>) responseResult.getData(); |
|
|
|
res.setAccount(employeeMessage.getData().getAccount()); |
|
|
|
} |
|
|
|
res.setDeptName(employeeMessage.getData().getDeptName()); |
|
|
|
|
|
|
|
|
|
|
|
for (BusinessApplicationListResponse response2:applyList) { |
|
|
|
|
|
|
|
for(LinkedHashMap res : employeeMessage){ |
|
|
|
|
|
|
|
if(response2.getPresenterId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值
|
|
|
|
|
|
|
|
response2.setAccount(JSONObject.toJSONString(res.get("account")).replace("\"","")); |
|
|
|
|
|
|
|
response2.setDeptName(JSONObject.toJSONString(res.get("deptName")).replace("\"","")); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//}
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//根据userId获取用户名以及部门名称
|
|
|
|
|
|
|
|
//ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(5l);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, applyList, "业务贷款一览表", "businessApplication", new BusinessApplicationListResponse()) |
|
|
|
ExcelUtil.writeExcelWithSheets(response, applyList, "业务贷款一览表", "businessApplication", new BusinessApplicationListResponse()) |
|
|
@ -426,8 +436,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
}*/ |
|
|
|
} |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
@ -514,7 +523,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
AuditProcessUtil.save(dgApplyAmountList1.getBusinessId(),account,"担保部经理",remark,1); |
|
|
|
AuditProcessUtil.save(dgApplyAmountList1.getBusinessId(),account,"担保部经理",remark,1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|