|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
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.metadata.IPage; |
|
|
|
|
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.framework.domain.crms.CrmsCustomerRelated; |
|
|
|
|
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.response.EmployeeMessageResponse; |
|
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.util.RandomUtil; |
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -107,7 +112,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
//申请贷款相关信息
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
|
dgApplyAmountInfo.setCompanyId(businessApplication.getCompanyId()); |
|
|
|
|
dgApplyAmountInfo.setPresenterId(Integer.parseInt(userId)); |
|
|
|
|
dgApplyAmountInfo.setPresenterId(5);//Integer.parseInt(userId)
|
|
|
|
|
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
|
|
|
|
|
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
|
|
|
|
|
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
|
|
|
|
@ -123,8 +128,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
//新增到业务列表
|
|
|
|
|
DgApplyAmountList dgApplyAmountList = new DgApplyAmountList(); |
|
|
|
|
dgApplyAmountList.setBusinessId(dgApplyAmountInfo.getId()); |
|
|
|
|
dgApplyAmountList.setPresenterId(Integer.parseInt(userId)); |
|
|
|
|
dgApplyAmountList.setEmpId(Integer.parseInt(userId)); |
|
|
|
|
dgApplyAmountList.setPresenterId(5);//Integer.parseInt(userId)
|
|
|
|
|
dgApplyAmountList.setEmpId(5);//Integer.parseInt(userId)
|
|
|
|
|
dgApplyAmountList.setRoleId(PromptSuccess.DB_YWY_ID); |
|
|
|
|
dgApplyAmountList.setType(1);//类型为担保业务员
|
|
|
|
|
|
|
|
|
@ -142,10 +147,19 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
crmsFeignService.updateIsExistRelated(dgApplyAmountInfo.getCompanyId(),businessApplication.getIsExistRelated()); |
|
|
|
|
|
|
|
|
|
//绑定关联关系
|
|
|
|
|
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); |
|
|
|
|
crmsCustomerRelated.setCustomerId(dgApplyAmountInfo.getCompanyId());//企业id
|
|
|
|
|
crmsCustomerRelated.setRelatedId(businessApplication.getRelatedId());//关联人/企业id
|
|
|
|
|
crmsFeignService.insertCustomerRelated(crmsCustomerRelated); |
|
|
|
|
/* List<CrmsCustomerRelated> relatedList = new ArrayList<>(); |
|
|
|
|
List<Integer> intList = businessApplication.getRelatedId(); |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
@ -335,13 +349,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
//修改是否存在关联人
|
|
|
|
|
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.setBusinessId(businessApplication.getBusinessId());//业务id
|
|
|
|
@ -403,29 +410,32 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public Boolean excelExport(List<String> ids, HttpServletResponse response) { |
|
|
|
|
/* //根据ids查询业务申请列表信息
|
|
|
|
|
//根据ids查询业务申请列表信息
|
|
|
|
|
List<BusinessApplicationListResponse>applyList = this.baseMapper.selectListByIds(ids); |
|
|
|
|
System.out.println("applyList==========================="+applyList); |
|
|
|
|
List<Integer>list2= new ArrayList<>(); |
|
|
|
|
List<BusinessApplicationListResponse> list = this.getBaseMapper().excelList(); |
|
|
|
|
for (BusinessApplicationListResponse res:applyList) { |
|
|
|
|
//list2.add(res.getPresenterId());
|
|
|
|
|
|
|
|
|
|
//根据userId获取用户名以及部门名称
|
|
|
|
|
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(res.getPresenterId().longValue()); |
|
|
|
|
|
|
|
|
|
//for (BusinessApplicationListResponse businessList:list) {
|
|
|
|
|
if(employeeMessage.getData()!= null){ |
|
|
|
|
if(res.getPresenterId().equals(employeeMessage.getData().getId())){//如果userId相同情况下,就往对象里面赋值
|
|
|
|
|
res.setAccount(employeeMessage.getData().getAccount()); |
|
|
|
|
res.setDeptName(employeeMessage.getData().getDeptName()); |
|
|
|
|
if(applyList != null){ |
|
|
|
|
if(applyList.size()>0){ |
|
|
|
|
List<Integer> arr = new ArrayList<>(); |
|
|
|
|
for (BusinessApplicationListResponse res : applyList) { |
|
|
|
|
arr.add(res.getPresenterId()); |
|
|
|
|
} |
|
|
|
|
//根据提单人id查询其部门名称
|
|
|
|
|
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); |
|
|
|
|
List<LinkedHashMap> employeeMessage = null; |
|
|
|
|
if(responseResult.getData() != null){ |
|
|
|
|
employeeMessage = (List<LinkedHashMap>) responseResult.getData(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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 { |
|
|
|
|
|
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, applyList, "业务贷款一览表", "businessApplication", new BusinessApplicationListResponse()) |
|
|
|
@ -434,8 +444,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
|
return false; |
|
|
|
|
}*/ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
@ -522,7 +531,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
AuditProcessUtil.save(dgApplyAmountList1.getBusinessId(),account,"担保部经理",remark,1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|