From 14003b8bd600d3f188a855a22022b0efb520f884 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 11 Nov 2020 15:01:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=94=B3=E8=AF=B7=EF=BC=8C?= =?UTF-8?q?=E8=AF=A6=E6=83=85=EF=BC=8C=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=92=A4?= =?UTF-8?q?=E9=94=80=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/crms/CompanyCustomerDao.xml | 3 + .../DgApplyAmountInfoController.java | 38 +++++-- .../guarantee/feign/CrmsFeignService.java | 8 +- .../mapper/DgApplyAmountInfoMapper.java | 1 - .../mapper/DgEnclosureInfoMapper.java | 1 + .../BusinessApplicationDetailResponse.java | 45 +++++++++ .../service/IDgApplyAmountInfoService.java | 7 +- .../impl/DgApplyAmountInfoServiceImpl.java | 99 ++++++++++++++++++- .../guarantee/DgApplyAmountInfoMapper.xml | 6 +- .../guarantee/DgEnclosureInfoMapper.xml | 5 + .../request/DgApplyAmountInfoRequest.java | 3 + .../domain/guarantee/DgEnclosureInfo.java | 5 + 12 files changed, 199 insertions(+), 22 deletions(-) create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationDetailResponse.java diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml index a7c56b6a..ce39aef3 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml @@ -53,6 +53,9 @@ AND cc.name LIKE CONCAT('%',#{applyAmountInfo.name},'%') + + AND cu.id = #{applyAmountInfo.companyId} + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index a0242fb8..f1ec8dbd 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -5,6 +5,7 @@ import com.daqing.financial.guarantee.DgApplyAmountInfoControllerApi; import com.daqing.financial.guarantee.feign.CrmsFeignService; import com.daqing.financial.guarantee.feign.HrmsFeignService; 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.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; @@ -179,14 +180,39 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA } /** - * 业务申请列表测试 - * @param + * 根据业务id查询业务申请详情 + * @param id + * @return + */ + @GetMapping("/businessApplicationDetail") + @ApiOperation(value = "根据业务id查询业务申请详情") + public ResponseResult businessApplicationDetail(Integer id){ + BusinessApplicationDetailResponse response = applyAmountInfoService.businessApplicationDetail(id); + return ResponseResult.SUCCESS(response); + } + + /** + * 根据业务id修改业务申请内容 + * @param businessApplication + * @return + */ + @PostMapping("/updateBusinessApplication") + @ApiOperation(value = "根据业务id修改业务申请内容") + public ResponseResult updateBusinessApplication(@RequestBody BusinessApplicationRequest businessApplication){ + int result = applyAmountInfoService.updateBusinessApplication(businessApplication); + return result>0 ? ResponseResult.SUCCESS("修改成功!"):ResponseResult.FAIL(40005,"修改失败!"); + } + + /** + * 根据业务id撤销业务申请内容 + * @param id * @return */ - @PostMapping("/businessApplicationList2") - public ResponseResult businessApplicationList2(){ - List data = applyAmountInfoService.selectList(); - return new ResponseResult().SUCCESS(data); + @PostMapping("/revokeBusinessApplication") + @ApiOperation(value = "根据业务id撤销业务申请内容") + public ResponseResult revokeBusinessApplication(@RequestParam("id") Integer id){ + int result = applyAmountInfoService.revokeBusinessApplication(id); + return result>0 ? ResponseResult.SUCCESS("撤销成功!"):ResponseResult.FAIL(40006,"撤销失败!"); } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/CrmsFeignService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/CrmsFeignService.java index 8aa61d41..e8d4f79a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/CrmsFeignService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/CrmsFeignService.java @@ -3,8 +3,8 @@ package com.daqing.financial.guarantee.feign; import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; import com.daqing.framework.model.response.ResponseResult; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; /** @@ -16,7 +16,7 @@ public interface CrmsFeignService { /** * 根据客户编号/客户名称获取企业信息 */ - @GetMapping("/crms/customer/queryCustomerInfoById") - ResponseResult queryCustomerInfoById(@RequestParam DgApplyAmountInfoRequest applyAmountInfo); + @PostMapping("/crms/customer/queryCustomerInfoById") + ResponseResult queryCustomerInfoById(@RequestBody DgApplyAmountInfoRequest applyAmountInfo); } \ No newline at end of file diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java index 2360c329..b115330a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java @@ -23,5 +23,4 @@ public interface DgApplyAmountInfoMapper extends BaseMapper { IPage pageByCondition(Page page, @Param("CustomerNumberOrName")String CustomerNumberOrName); - List selectAmountList(); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEnclosureInfoMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEnclosureInfoMapper.java index 5f3953b0..df20c7e4 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEnclosureInfoMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEnclosureInfoMapper.java @@ -15,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DgEnclosureInfoMapper extends BaseMapper { + DgEnclosureInfo selectByCompanyId(Integer id); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationDetailResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationDetailResponse.java new file mode 100644 index 00000000..3f948c92 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationDetailResponse.java @@ -0,0 +1,45 @@ +package com.daqing.financial.guarantee.model.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; +import com.daqing.framework.domain.guarantee.DgEnclosureInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import java.io.Serializable; +import java.util.LinkedHashMap; + +@Data +@ToString +public class BusinessApplicationDetailResponse implements Serializable { + + /** + * 主键id + */ + @ApiModelProperty(value = "id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 业务申请详细 + */ + @ApiModelProperty(value = "业务申请详细") + private DgApplyAmountInfo dgApplyAmountInfo; + + /** + * 企业详细 + */ + @ApiModelProperty(value = "企业详细") + private LinkedHashMap linkedHashMap; + + /** + * 附件详细 + */ + @ApiModelProperty(value = "附件详细") + private DgEnclosureInfo dgEnclosureInfo; + + + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java index 2d67ae1e..3e9a4d8a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java @@ -2,6 +2,7 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest; +import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse; import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; import com.daqing.framework.utils.PageUtils; @@ -21,5 +22,9 @@ public interface IDgApplyAmountInfoService extends IService { PageUtils queryPage(Integer page, Integer size, String CustomerNumberOrName); - List selectList(); + BusinessApplicationDetailResponse businessApplicationDetail(Integer id); + + int updateBusinessApplication(BusinessApplicationRequest id); + + int revokeBusinessApplication(Integer id); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index 70ac1c1d..1980b4a5 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -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 redisTemplate; + @Resource + private CrmsFeignService crmsFeignService; + @Override @Transactional @@ -63,7 +76,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl selectList() { - Listlist = 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 pojos = mapper.convertValue(linkedList, new TypeReference>() {});*/ + + 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().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().eq("id", id)); } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml index d499bde2..1c78989b 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml @@ -18,7 +18,7 @@ - diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEnclosureInfoMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEnclosureInfoMapper.xml index 533dca71..90b6a279 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEnclosureInfoMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEnclosureInfoMapper.xml @@ -5,6 +5,7 @@ + @@ -20,4 +21,8 @@ + + diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/request/DgApplyAmountInfoRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/request/DgApplyAmountInfoRequest.java index aada3da3..8d1a4278 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/request/DgApplyAmountInfoRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/request/DgApplyAmountInfoRequest.java @@ -16,5 +16,8 @@ public class DgApplyAmountInfoRequest implements Serializable { @ApiModelProperty(value = "客户名称") private String name; + @ApiModelProperty(value = "企业Id") + private Integer companyId; + } diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgEnclosureInfo.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgEnclosureInfo.java index 053db181..ee74e120 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgEnclosureInfo.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgEnclosureInfo.java @@ -27,6 +27,11 @@ public class DgEnclosureInfo implements Serializable { @TableId(value = "id", type = IdType.AUTO) private Integer id; + /** + * 业务id + */ + private Integer businessId; + /** * 企业id */