|
|
|
@ -1,24 +1,24 @@ |
|
|
|
|
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; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgBusinessProcessStatusMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgLoanNoticeMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper; |
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.*; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.LoanNoticeQueryRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.LoanNoticeUpdateRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.LoanNoticeListResponse; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgLoanNoticeService; |
|
|
|
|
import com.daqing.financial.guarantee.util.AuditProcessUtil; |
|
|
|
|
import com.daqing.financial.guarantee.util.OrdinaryUtil; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgBusinessProcessStatus; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgLoanNotice; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; |
|
|
|
|
import com.daqing.framework.domain.guarantee.*; |
|
|
|
|
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.RedisUtil; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import com.daqing.framework.utils.excel.EasyExcelUtil; |
|
|
|
@ -28,11 +28,12 @@ import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -51,6 +52,18 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl<DgLoanNoticeMapper, DgL |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DgBusinessProcessStatusMapper businessProcessStatusMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DgApplyAmountInfoMapper applyAmountInfoMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DgBusinessCompanyMapper businessCompanyMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DgLoanCommitteeConsiderMapper loanCommitteeConsiderMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
/** |
|
|
|
|
* 获取当前登录用户信息 |
|
|
|
|
*/ |
|
|
|
@ -123,6 +136,46 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl<DgLoanNoticeMapper, DgL |
|
|
|
|
DgBusinessProcessStatus dgBusinessProcessStatus = businessProcessStatusMapper.selectOne(businessProcessStatusQueryWrapper); |
|
|
|
|
dgBusinessProcessStatus.setBusinessStatus(StatusCode.YW_COMPLETED); |
|
|
|
|
int updateById = businessProcessStatusMapper.updateById(dgBusinessProcessStatus); |
|
|
|
|
DgApplyAmountInfo applyAmountInfo = applyAmountInfoMapper.selectById(businessId); |
|
|
|
|
String bank = applyAmountInfo.getBank(); |
|
|
|
|
String businessCode = applyAmountInfo.getBusinessCode(); |
|
|
|
|
String businessType = applyAmountInfo.getBusinessType(); |
|
|
|
|
Date createTime = applyAmountInfo.getCreateTime(); |
|
|
|
|
Integer companyId = applyAmountInfo.getCompanyId(); |
|
|
|
|
String amountWide = applyAmountInfo.getAmountWide(); |
|
|
|
|
Integer presenterId = applyAmountInfo.getPresenterId(); |
|
|
|
|
DgBusinessCompany businessCompany = businessCompanyMapper.selectOne(new QueryWrapper<DgBusinessCompany>().eq("business_id", businessId)); |
|
|
|
|
String phone = businessCompany.getPhone(); |
|
|
|
|
String name = businessCompany.getName(); |
|
|
|
|
DgLoanCommitteeConsider loanCommitteeConsider = loanCommitteeConsiderMapper.selectOne(new QueryWrapper<DgLoanCommitteeConsider>().eq("business_id", businessId)); |
|
|
|
|
Integer loanMoney = loanCommitteeConsider.getLoanMoney(); |
|
|
|
|
String loanTern = loanCommitteeConsider.getLoanTern(); |
|
|
|
|
//添加数据到保后管理
|
|
|
|
|
AlInsuranceList alInsuranceList = new AlInsuranceList(); |
|
|
|
|
alInsuranceList.setBank(bank); |
|
|
|
|
alInsuranceList.setBusinessCode(businessCode); |
|
|
|
|
alInsuranceList.setBusinessType(businessType); |
|
|
|
|
alInsuranceList.setApplyTime(createTime); |
|
|
|
|
alInsuranceList.setPhone(phone); |
|
|
|
|
alInsuranceList.setCustomerName(name); |
|
|
|
|
alInsuranceList.setGuaranteeAmount(BigDecimal.valueOf(loanMoney*10000)); |
|
|
|
|
alInsuranceList.setGuaranteeTime(loanTern); |
|
|
|
|
alInsuranceList.setAmountWide(amountWide); |
|
|
|
|
ArrayList<Integer> arr = new ArrayList<>(); |
|
|
|
|
arr.add(presenterId); |
|
|
|
|
//根据提单人id查询其部门名称
|
|
|
|
|
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); |
|
|
|
|
List<LinkedHashMap> employeeMessage = null; |
|
|
|
|
if(responseResult.getData() != null){ |
|
|
|
|
employeeMessage = (List<LinkedHashMap>) responseResult.getData(); |
|
|
|
|
} |
|
|
|
|
if(employeeMessage!= null){ |
|
|
|
|
for(LinkedHashMap res : employeeMessage){ |
|
|
|
|
if(presenterId.equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值
|
|
|
|
|
alInsuranceList.setDepartment(JSONObject.toJSONString(res.get("deptName")).replace("\"","")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//更新成功,返回操作结果
|
|
|
|
|
log.info(updateById > 0 ? "业务流程已完成" : "业务流程已完成更新失败"); |
|
|
|
|
return updateById > 0; |
|
|
|
|