From 5b1c22f95efed809051f4d6cbe0d53333c159d7e Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 31 Mar 2021 15:45:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DgApplyAmountInfoController.java | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) 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 52f81621..af4f6d20 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 @@ -37,8 +37,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; +import java.io.*; import java.util.*; /** @@ -144,6 +143,38 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA return ResponseResult.SUCCESS(list); } + /** + * 下载单个文件 + * + * @param response + * @param fileName + * @return + */ + @RequestMapping("/download") + public String download(HttpServletResponse response, @RequestParam("fileName") String fileName) { + File file = new File(PromptSuccess.FILE_URL_PATH + fileName); + if (file.exists()) { + response.setContentType("application/force-download;charset=UTF-8"); + response.setCharacterEncoding("UTF-8"); + response.setHeader("Content-Disposition", "attachment;fileName =" + fileName); + byte[] buffer = new byte[1024]; + + try (FileInputStream inputStream = new FileInputStream(file); + OutputStream outStream = response.getOutputStream(); + BufferedInputStream buffStream = new BufferedInputStream(inputStream);) { + int i = 0; + while ((i = buffStream.read(buffer)) != -1) { + outStream.write(buffer); + outStream.write(buffer, 0, i); + } + return "download success"; + } catch (Exception e) { + log.error("download error {}", e.getMessage()); + } + } + return null; + } + /** * 删除服务上的文件 * @param filePath 路径 From e350e8132cdd5a63fd04e3f477b9237544d92455 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Wed, 31 Mar 2021 15:53:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=9F=A5=E7=9C=8B=E7=94=B3=E8=AF=B7=E8=B4=B7?= =?UTF-8?q?=E6=AC=BE=E8=AF=A6=E6=83=85=E3=80=81PC=E7=AB=AF=E5=82=AC?= =?UTF-8?q?=E6=94=B6=E6=97=B6=E5=B1=95=E7=A4=BA=E7=9A=84=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CustomerAppletServiceImpl.java | 12 ++++--- .../service/impl/CustomerServiceImpl.java | 35 ++++++++++--------- .../guarantee/mapper/AlCollectionMapper.java | 2 ++ .../service/impl/AlCollectionServiceImpl.java | 12 +++++-- .../mapper/guarantee/AlCollectionMapper.xml | 13 ++++++- .../DgComplianceInvestigationMapper.xml | 2 +- 6 files changed, 52 insertions(+), 24 deletions(-) diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java index 1963e266..b16700d4 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java @@ -426,20 +426,24 @@ public class CustomerAppletServiceImpl extends ServiceImpl relatedList = new ArrayList<>(); List intList = companyCustomerReq.getRelatedId(); - for (int i = 0; i < intList.size(); i++) { - CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); - Integer integer = intList.get(i); - crmsCustomerRelated.setCustomerId(companyCustomerEntity.getId().intValue());//企业id - crmsCustomerRelated.setRelatedId(integer);//关联人/企业id - relatedList.add(crmsCustomerRelated); + if (null != intList && intList.size() != 0) { + for (int i = 0; i < intList.size(); i++) { + CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); + Integer integer = intList.get(i); + crmsCustomerRelated.setCustomerId(companyCustomerEntity.getId().intValue());//企业id + crmsCustomerRelated.setRelatedId(integer);//关联人/企业id + relatedList.add(crmsCustomerRelated); + } + crmsCustomerRelatedService.insertCustomerRelated(relatedList); } - crmsCustomerRelatedService.insertCustomerRelated(relatedList); } - if (customer == true && company > 0) { + if (customer && company > 0) { return true; } return false; @@ -696,17 +698,18 @@ public class CustomerServiceImpl extends ServiceImpl relatedList = new ArrayList<>(); List intList = companyCustomerReq.getRelatedId(); - for (int i = 0; i < intList.size(); i++) { - CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); - Integer integer = intList.get(i); - crmsCustomerRelated.setCustomerId(companyCustomerEntity.getCustomerId().intValue());//企业id companyCustomerEntity.getId().intValue() - crmsCustomerRelated.setRelatedId(integer);//关联人/企业id - relatedList.add(crmsCustomerRelated); + if (null != intList && intList.size() != 0) { + for (int i = 0; i < intList.size(); i++) { + CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); + Integer integer = intList.get(i); + crmsCustomerRelated.setCustomerId(companyCustomerEntity.getCustomerId().intValue());//企业id companyCustomerEntity.getId().intValue() + crmsCustomerRelated.setRelatedId(integer);//关联人/企业id + relatedList.add(crmsCustomerRelated); + } } if (relatedList.size() > 0) { crmsCustomerRelatedService.insertCustomerRelated(relatedList); } - return true; - + return true; } } \ No newline at end of file diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java index 14436944..6fad01c4 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java @@ -34,6 +34,8 @@ public interface AlCollectionMapper extends BaseMapper { OverdueDetailResponse getOverdueDetailByInsuranceId(Integer insuranceId); + Integer getCollectionCountByInsuranceId(Integer insuranceId); + MoreOverdueDetailResponse moreOverdueDetail(Integer id); Integer getInsuranceIdById(Integer id); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java index c645edab..060061e1 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java @@ -143,6 +143,11 @@ public class AlCollectionServiceImpl extends ServiceImpl map = this.getOverdueConditionByInsuranceId(insuranceId); if (null != map) { @@ -346,6 +351,8 @@ public class AlCollectionServiceImpl extends ServiceImpl map = new HashMap<>(); List alRepaymentList = alRepaymentEntryMapper.listAlRepaymentByInsuranceId(insuranceId); if (alRepaymentList != null && alRepaymentList.size() != 0) { for (AlRepaymentEntry alRepayment : alRepaymentList) { @@ -353,9 +360,10 @@ public class AlCollectionServiceImpl extends ServiceImpl map = new HashMap<>(); - map.put("overduePeriods", alRepaymentList.size()); map.put("overdueAmount", overdueAmount); map.put("overdueInterest", overdueInterest); map.put("otherExpenses", otherExpenses); diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml index a9a58a4a..29925712 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml @@ -40,12 +40,23 @@ #{ac.collectionUser},#{ac.overduePeriods}) - + SELECT customer_name AS name,business_type AS type,business_code AS code + FROM al_insurance_list WHERE i.id = #{insuranceId} + + + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgComplianceInvestigationMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgComplianceInvestigationMapper.xml index 055d77e7..1a40f3a3 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgComplianceInvestigationMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgComplianceInvestigationMapper.xml @@ -195,7 +195,7 @@ SELECT customer_name AS name,business_type AS type,business_code AS code - FROM al_insurance_list WHERE i.id = #{insuranceId} + FROM al_insurance_list WHERE id = #{insuranceId} diff --git a/dq-govern-gateway/src/main/resources/jwt.properties b/dq-govern-gateway/src/main/resources/jwt.properties index 681d9431..82c34445 100644 --- a/dq-govern-gateway/src/main/resources/jwt.properties +++ b/dq-govern-gateway/src/main/resources/jwt.properties @@ -34,7 +34,8 @@ jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,\ /api-guarantee/al-insurance-list/excelExport,\ /api-guarantee/al-repayment-entry/excelExport,\ /api-guarantee/al-collection/list/export/excel,\ - /api-guarantee/al-collection/collection/list/export/excel + /api-guarantee/al-collection/collection/list/export/excel,\ + /api-guarantee/dg-apply-amount-info/download