|
|
|
@ -1,18 +1,26 @@ |
|
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
|
|
|
|
|
|
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.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgApplyAmountInfoMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgEnclosureInfoMapper; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
import com.daqing.framework.domain.crms.response.CompanyCustomerResponse; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgEnclosureInfo; |
|
|
|
|
import com.daqing.framework.domain.hrms.ext.PositionVO; |
|
|
|
|
import com.daqing.framework.domain.hrms.DeptEntity; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -22,6 +30,8 @@ import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -44,6 +54,9 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
@Resource |
|
|
|
|
private RedisTemplate<String,String> redisTemplate; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private CrmsFeignService crmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
@ -63,7 +76,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
//申请贷款相关信息
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
|
dgApplyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); |
|
|
|
|
dgApplyAmountInfo.setPresenterId(Integer.parseInt(userId)); |
|
|
|
|
dgApplyAmountInfo.setPresenterId(5);//Integer.parseInt(userId)
|
|
|
|
|
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
|
|
|
|
|
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
|
|
|
|
|
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
|
|
|
|
@ -71,6 +84,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
dgApplyAmountInfo.setEnGuaranteeMeasures(businessApplication.getEnGuaranteeMeasures());//反担保措施
|
|
|
|
|
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
|
|
|
|
|
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
|
|
|
|
|
dgApplyAmountInfo.setCreateTime(new Date()); |
|
|
|
|
dgApplyAmountInfo.setUpdateTime(new Date()); |
|
|
|
|
if(businessApplication.isSaveOrCommit()==true){ |
|
|
|
|
dgApplyAmountInfo.setStatus(1);//状态设置为审核中
|
|
|
|
|
}else{ |
|
|
|
@ -81,6 +96,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
|
|
|
|
|
//上传附件信息
|
|
|
|
|
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); |
|
|
|
|
dgEnclosureInfo.setBusinessId(dgApplyAmountInfo.getId());//业务id
|
|
|
|
|
dgEnclosureInfo.setCompanyId(businessApplication.getCompanyId());//企业Id
|
|
|
|
|
dgEnclosureInfo.setBusinessLicense(businessApplication.getBusinessLicense());//营业执照复印件
|
|
|
|
|
dgEnclosureInfo.setLegalCardCopy(businessApplication.getLegalCardCopy());//上传法定代表人夫妻及企业实际经营者身份证复印件
|
|
|
|
@ -113,9 +129,82 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<DgApplyAmountInfo> selectList() { |
|
|
|
|
List<DgApplyAmountInfo>list = dgApplyAmountInfoMapper.selectAmountList(); |
|
|
|
|
return list; |
|
|
|
|
public BusinessApplicationDetailResponse businessApplicationDetail(Integer id) { |
|
|
|
|
//根据主键id查询业务申请详细信息
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = this.baseMapper.selectById(id); |
|
|
|
|
System.out.println("业务申请详细========="+dgApplyAmountInfo); |
|
|
|
|
|
|
|
|
|
DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest(); |
|
|
|
|
applyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); |
|
|
|
|
//根据企业id查询企业详情
|
|
|
|
|
ResponseResult result = crmsFeignService.queryCustomerInfoById(applyAmountInfo); |
|
|
|
|
|
|
|
|
|
LinkedHashMap linkedList = (LinkedHashMap)result.getData(); |
|
|
|
|
/* ObjectMapper mapper = new ObjectMapper(); |
|
|
|
|
List<LinkedHashMap> pojos = mapper.convertValue(linkedList, new TypeReference<List<LinkedHashMap>>() {});*/ |
|
|
|
|
|
|
|
|
|
System.out.println("企业详细============"+linkedList); |
|
|
|
|
|
|
|
|
|
//查询附件详细,附件关联业务主键id
|
|
|
|
|
DgEnclosureInfo dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(id); |
|
|
|
|
System.out.println("附件详细=============="+dgEnclosureInfo); |
|
|
|
|
|
|
|
|
|
BusinessApplicationDetailResponse businessApplicationDetail= new BusinessApplicationDetailResponse(); |
|
|
|
|
businessApplicationDetail.setDgApplyAmountInfo(dgApplyAmountInfo); |
|
|
|
|
businessApplicationDetail.setDgEnclosureInfo(dgEnclosureInfo); |
|
|
|
|
businessApplicationDetail.setLinkedHashMap(linkedList); |
|
|
|
|
|
|
|
|
|
return businessApplicationDetail; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int updateBusinessApplication(BusinessApplicationRequest businessApplication) { |
|
|
|
|
//申请贷款相关信息
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
|
dgApplyAmountInfo.setId(businessApplication.getId()); |
|
|
|
|
dgApplyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); |
|
|
|
|
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
|
|
|
|
|
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
|
|
|
|
|
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
|
|
|
|
|
dgApplyAmountInfo.setAmountWide(businessApplication.getAmountWide());//贷款用途
|
|
|
|
|
dgApplyAmountInfo.setEnGuaranteeMeasures(businessApplication.getEnGuaranteeMeasures());//反担保措施
|
|
|
|
|
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
|
|
|
|
|
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
|
|
|
|
|
dgApplyAmountInfo.setUpdateTime(new Date()); |
|
|
|
|
//根据业务id修改申请贷款信息
|
|
|
|
|
this.baseMapper.updateById(dgApplyAmountInfo); |
|
|
|
|
|
|
|
|
|
//上传附件信息
|
|
|
|
|
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); |
|
|
|
|
dgEnclosureInfo.setBusinessId(businessApplication.getId());//业务id
|
|
|
|
|
dgEnclosureInfo.setCompanyId(businessApplication.getCompanyId());//企业Id
|
|
|
|
|
dgEnclosureInfo.setBusinessLicense(businessApplication.getBusinessLicense());//营业执照复印件
|
|
|
|
|
dgEnclosureInfo.setLegalCardCopy(businessApplication.getLegalCardCopy());//上传法定代表人夫妻及企业实际经营者身份证复印件
|
|
|
|
|
dgEnclosureInfo.setMarriageCopy(businessApplication.getMarriageCopy());//法定代表人夫妻户口本,结婚证(离婚证)复印件
|
|
|
|
|
dgEnclosureInfo.setLegalCopy(businessApplication.getLegalCopy());//法定代表人身份证明
|
|
|
|
|
dgEnclosureInfo.setCompanyConstitution(businessApplication.getCompanyConstitution());//公司章程
|
|
|
|
|
dgEnclosureInfo.setAccountingFirm(businessApplication.getAccountingFirm());//会计师事务所审计的上一年度及本年度审计报告
|
|
|
|
|
dgEnclosureInfo.setCompanyCredit(businessApplication.getCompanyCredit());//企业信用报告
|
|
|
|
|
dgEnclosureInfo.setCreditReport(businessApplication.getCreditReport());//企业法人夫妇信用报告,实际经营者信用报告
|
|
|
|
|
dgEnclosureInfo.setCertificateAuthorization(businessApplication.getCertificateAuthorization());//征信业务授权书,承诺书
|
|
|
|
|
dgEnclosureInfo.setTaxCertificate(businessApplication.getTaxCertificate());//增值税纳税申报表首表复印件/完税证明
|
|
|
|
|
dgEnclosureInfo.setMeetingMinutes(businessApplication.getMeetingMinutes());//股东会会议纪要
|
|
|
|
|
dgEnclosureInfo.setAssessmentReport(businessApplication.getAssessmentReport());//反担保资料和评估报告
|
|
|
|
|
|
|
|
|
|
//根据业务id删除对应的附件信息
|
|
|
|
|
dgEnclosureInfoMapper.delete(new QueryWrapper<DgEnclosureInfo>().eq("business_id",businessApplication.getId())); |
|
|
|
|
System.out.println("来了附件删除操作================================="); |
|
|
|
|
//附件新增
|
|
|
|
|
return dgEnclosureInfoMapper.insert(dgEnclosureInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int revokeBusinessApplication(Integer id) { |
|
|
|
|
//根据id修改当前业务状态
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
|
dgApplyAmountInfo.setStatus(5);//状态为已撤销
|
|
|
|
|
dgApplyAmountInfo.setUpdateTime(new Date()); |
|
|
|
|
return this.baseMapper.update(dgApplyAmountInfo, new QueryWrapper<DgApplyAmountInfo>().eq("id", id)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|