LAPTOP-FO2T5SIU\35838 il y a 7 mois
Parent
commit
38ab948e6e

+ 28 - 12
pro-base/src/main/java/com/idea/customerManagement/service/IntentionalDepositService.java

@@ -417,36 +417,52 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
      */
     public void downLoadReceipt(IntentionalDeposit model, HttpServletResponse response) {
 
-        // TODO: 2024/10/24 意向金收据暂无word文档
-        String filePath = "/home/project/settleDown/tem/.docx";
+        IntentionalDeposit newRecord = selectByPrimaryKey(model.getId());
+        String filePath = "/home/project/settleDown/tem/receipt.docx";
         String fileName = "意向金收据.docx";
-        String customerManagementId = model.getCustomerManagementId();
+        String customerManagementId = newRecord.getCustomerManagementId();
         BuyerExample buyerExample = new BuyerExample();
         buyerExample.setOrderByClause("order_num asc");
         buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
         List<Buyer> buyers = buyerService.selectByExample(buyerExample);
-        String name = "";
+        StringBuilder builder = new StringBuilder();
         if (CollectionUtils.isNotEmpty(buyers)) {
-            Buyer buyer = buyers.get(0);
-            name = buyer.getName();
+            for(Buyer buyer: buyers){
+                builder.append(buyer.getName()).append(",");
+            }
+            if(builder.length() > 0){
+                builder.deleteCharAt(builder.length()-1);
+            }
+        }
+        String fullName = "";
+        // 意向金只有选房后 才有houseId
+        if(StringUtils.isNotEmpty(newRecord.getHouseId())){
+            ParkRoomResponse roomResponse = roomExtendMapper.getFullName(newRecord.getHouseId());
+            fullName = roomResponse.getGroupName() + "-"
+                    + roomResponse.getDiscName() + "-"
+                    + roomResponse.getBuildName() + "-"
+                    + roomResponse.getRoomNo();
         }
-        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, model.getCollectionTime());
-        String content = "定金";
+        String serialNumber = newRecord.getSerialNumber();
+        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, newRecord.getCollectionTime());
+        String content = "意向金";
         String paymentMethod = "";
-        String dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", model.getPaymentMethod().toString());
-        if(StringUtils.isNotEmpty(dictLabel)){
+        String dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", newRecord.getPaymentMethod().toString());
+        if (StringUtils.isNotEmpty(dictLabel)) {
             paymentMethod = dictLabel;
         }
-        String receivedAmount = model.getReceivedAmount().toString();
+        String receivedAmount = newRecord.getReceivedAmount().toString();
         String capital = MoneyUtils.amountConversion(receivedAmount);
 
         Map<String, Object> data = new HashMap<>();
         Map<String, Object> picData = new HashMap<>();
         Map<String, Object> sealData = new HashMap<>();
-        data.put("${name}", name);
+        data.put("${serialNumber}", serialNumber);
+        data.put("${name}", builder.toString());
         data.put("${collectionTime}", collectionTime);
         data.put("${content}", content);
         data.put("${paymentMethod}", paymentMethod);
+        data.put("${fullName}", fullName);
         data.put("${capital}", capital);
         data.put("${receivedAmount}", receivedAmount);
 

+ 23 - 16
pro-base/src/main/java/com/idea/customerManagement/service/RoomSelectionInfoService.java

@@ -350,45 +350,52 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
 
     /**
      * 定金收据
+     *
      * @param model
      * @param response
      */
     public void downLoadReceipt(RoomSelectionInfoDto model, HttpServletResponse response) {
 
-        // TODO: 2024/10/24 定金收据暂无word文档
-        String filePath = "/home/project/settleDown/tem/.docx";
+        RoomSelectionInfo newRecord = selectByPrimaryKey(model.getId());
+        String filePath = "/home/project/settleDown/tem/receipt.docx";
         String fileName = "定金收据.docx";
-        String customerManagementId = model.getCustomerManagementId();
+        String customerManagementId = newRecord.getCustomerManagementId();
         BuyerExample buyerExample = new BuyerExample();
         buyerExample.setOrderByClause("order_num asc");
         buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
         List<Buyer> buyers = buyerService.selectByExample(buyerExample);
-        String name = "";
+        StringBuilder builder = new StringBuilder();
         if (CollectionUtils.isNotEmpty(buyers)) {
-            Buyer buyer = buyers.get(0);
-            name = buyer.getName();
+            for(Buyer buyer: buyers){
+                builder.append(buyer.getName()).append(",");
+            }
+            if(builder.length() > 0){
+                builder.deleteCharAt(builder.length()-1);
+            }
         }
-        ParkRoomResponse roomResponse = roomExtendMapper.getFullName(model.getHouseId());
-        String fullName = roomResponse.getGroupName()
-                + "-"
-                + roomResponse.getDiscName()
-                + roomResponse.getBuildName()
+
+        ParkRoomResponse roomResponse = roomExtendMapper.getFullName(newRecord.getHouseId());
+        String fullName = roomResponse.getGroupName() + "-"
+                + roomResponse.getDiscName() + "-"
+                + roomResponse.getBuildName() + "-"
                 + roomResponse.getRoomNo();
 
-        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, model.getCollectionTime());
+        String serialNumber = newRecord.getSerialNumber();
+        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, newRecord.getCollectionTime());
         String content = "定金";
         String paymentMethod = "";
-        String dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", model.getPaymentMethod().toString());
-        if(StringUtils.isNotEmpty(dictLabel)){
+        String dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", newRecord.getPaymentMethod().toString());
+        if (StringUtils.isNotEmpty(dictLabel)) {
             paymentMethod = dictLabel;
         }
-        String receivedAmount = model.getReceivedAmount().toString();
+        String receivedAmount = newRecord.getReceivedAmount().toString();
         String capital = MoneyUtils.amountConversion(receivedAmount);
 
         Map<String, Object> data = new HashMap<>();
         Map<String, Object> picData = new HashMap<>();
         Map<String, Object> sealData = new HashMap<>();
-        data.put("${name}", name);
+        data.put("${serialNumber}", serialNumber);
+        data.put("${name}", builder.toString());
         data.put("${collectionTime}", collectionTime);
         data.put("${content}", content);
         data.put("${paymentMethod}", paymentMethod);

+ 3 - 3
pro-base/src/main/java/com/idea/paymentManagement/service/PayLogService.java

@@ -320,15 +320,15 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         String fileName = "";
         switch (contentType){
             case 1: // 定金
-                filePath = "/home/project/settleDown/tem/.docx";
+                filePath = "/home/project/settleDown/tem/receipt.docx";
                 fileName = "定金收据.docx";
                 break;
             case 2: // 首付
-                filePath = "/home/project/settleDown/tem/.docx";
+                filePath = "/home/project/settleDown/tem/receipt.docx";
                 fileName = "首付收据.docx";
                 break;
             case 3: // 银行按揭
-                filePath = "/home/project/settleDown/tem/.docx";
+                filePath = "/home/project/settleDown/tem/receipt.docx";
                 fileName = "银行按揭收据.docx";
                 break;
         }