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..b2383e4e 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,26 @@ 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/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 路径 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..6bd9309c 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 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 @@