LAPTOP-FO2T5SIU\35838 7 kuukautta sitten
vanhempi
commit
e78c3bd6b5

+ 14 - 4
pro-base/src/main/java/com/idea/buildManage/excel/ParkRoomListener.java

@@ -151,6 +151,19 @@ public class ParkRoomListener extends AnalysisEventListener<ParkRoomExcel> {
                     }
                     data.setFloor(excel.getFloor());
 
+                    if (StringUtils.isEmpty(excel.getPredictionShareArea())) {
+                        data.setPredictionShareArea(Double.valueOf(excel.getPredictionShareArea()));
+                    }
+                    if (StringUtils.isEmpty(excel.getPredictionInternalArea())) {
+                        data.setPredictionInternalArea(Double.valueOf(excel.getPredictionInternalArea()));
+                    }
+                    if (StringUtils.isEmpty(excel.getPredictionLandArea())) {
+                        data.setPredictionLandArea(Double.valueOf(excel.getPredictionLandArea()));
+                    }
+                    if (StringUtils.isEmpty(excel.getPredictionBuildArea())) {
+                        data.setPredictionBuildArea(Double.valueOf(excel.getPredictionBuildArea()));
+                    }
+
 
                     // 实测套内面积
                     if (StringUtils.isEmpty(excel.getActualInternalArea())) {
@@ -249,10 +262,7 @@ public class ParkRoomListener extends AnalysisEventListener<ParkRoomExcel> {
                         data.setCreatedId(ShiroUtils.getUserId());
                         data.setCreatedAt(new Date());
                         data.setRoomNumber(excel.getRoomNumber());
-                        data.setPredictionShareArea(Double.valueOf(excel.getPredictionShareArea()));
-                        data.setPredictionInternalArea(Double.valueOf(excel.getPredictionInternalArea()));
-                        data.setPredictionLandArea(Double.valueOf(excel.getPredictionLandArea()));
-                        data.setPredictionBuildArea(Double.valueOf(excel.getPredictionBuildArea()));
+
                         data.setTwoPointTwo(excel.getTwoPointTwo());
                         data.setRoomNumber(excel.getRoomNumber());
                         data.setRemark(excel.getRemark());

+ 14 - 0
pro-base/src/main/java/com/idea/customerManagement/controller/CustomerManagementController.java

@@ -2,6 +2,7 @@ package com.idea.customerManagement.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.idea.customerManagement.dto.CustomerManagementDto;
+import com.idea.customerManagement.dto.RoomSelectionInfoDto;
 import com.idea.customerManagement.service.CustomerManagementService;
 import com.rockstar.common.base.BaseController;
 import com.rockstar.common.domain.AjaxResult;
@@ -11,10 +12,13 @@ import com.rockstar.frame.model.extend.Tablepar;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 
 @Controller
@@ -95,4 +99,14 @@ public class CustomerManagementController extends BaseController {
         return result(result);
     }
 
+    /**
+     * 选房通知单 下载
+     * @param id
+     * @param response
+     */
+    @GetMapping(value = "download",produces = {"application/json;charset=UTF-8"})
+    public void download(String id, HttpServletResponse response) {
+        modelService.downLoad(id,response);
+    }
+
 }

+ 60 - 3
pro-base/src/main/java/com/idea/customerManagement/service/CustomerManagementService.java

@@ -6,13 +6,19 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.idea.buildManage.mapper.ParkInfoMapper;
 import com.idea.buildManage.mapper.ParkRoomMapper;
+import com.idea.buildManage.model.ParkInfo;
 import com.idea.buildManage.model.ParkRoom;
+import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.customerManagement.dto.CustomerManagementDto;
+import com.idea.customerManagement.dto.RoomSelectionInfoDto;
 import com.idea.customerManagement.mapper.CustomerManagementExtendMapper;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
 import com.idea.customerManagement.mapper.RoomSelectionInfoMapper;
 import com.idea.customerManagement.model.*;
+import com.idea.util.DateUtils;
+import com.idea.util.ReplaceWord;
 import com.rockstar.common.base.BaseService;
 import com.rockstar.frame.model.FrameUser;
 import com.rockstar.frame.model.extend.DateTrans;
@@ -25,9 +31,9 @@ import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
 
 @Service
 public class CustomerManagementService implements BaseService<CustomerManagement, CustomerManagementExample> {
@@ -47,6 +53,8 @@ public class CustomerManagementService implements BaseService<CustomerManagement
     private RoomSelectionInfoMapper roomSelectionInfoMapper;
     @Autowired
     private ParkRoomMapper parkRoomMapper;
+    @Autowired
+    private ParkInfoMapper parkInfoMapper;
 
     @Override
     public int deleteByPrimaryKey(String s) {
@@ -295,5 +303,54 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         return result;
     }
 
+    /**
+     * 选房通知单下载
+     * @param id
+     * @param response
+     */
+    public void downLoad(String id, HttpServletResponse response) {
+
+        String filePath = "/home/project/settleDown/tem/houseSelectionNotice.docx";
+        String fileName = "选房通知单.docx";
+        CustomerManagement customerManagement = selectByPrimaryKey(id);
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num asc");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(id);
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        if(CollectionUtils.isNotEmpty(buyers)){
+            Buyer buyer = buyers.get(0);
+            String name = buyer.getName();
+            String identityCard = buyer.getIdentityCard();
+            String roomSelectionNumber = customerManagement.getRoomSelectionNumber();
+            Date roomSelectionDate = customerManagement.getRoomSelectionDate();
+            String year = DateUtils.parseDateToStr(DateUtils.YYYY, roomSelectionDate);
+            String month = DateUtils.parseDateToStr(DateUtils.MM, roomSelectionDate);
+            String date = DateUtils.parseDateToStr(DateUtils.DD, roomSelectionDate);
+            ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(customerManagement.getGroupId());
+            String region = "";
+            String dictLabel = sysDictService.getDictLabel("REGIONALISM_CODE", parkInfo.getRegionalismCode());
+            if(StringUtils.isNotEmpty(dictLabel)){
+                region = dictLabel;
+            }
+            Map<String, Object> data = new HashMap<>();
+            Map<String, Object> picData = new HashMap<>();
+            Map<String, Object> sealData = new HashMap<>();
+            data.put("${name}", name);
+            data.put("${identityCard}", identityCard);
+            data.put("${roomSelectionNumber}", roomSelectionNumber);
+            data.put("${year}", year);
+            data.put("${month}", month);
+            data.put("${date}", date);
+            data.put("${region}", region);
+            ReplaceWord.operateWord(response,filePath,fileName,data, picData,sealData);
+        }
+
+
+
+
+    }
+
+
+
 
 }

+ 4 - 0
pro-base/src/main/java/com/idea/util/DateUtils.java

@@ -17,6 +17,10 @@ import java.util.Date;
 public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     public static String YYYY = "yyyy";
 
+    public static String MM = "MM";
+
+    public static String DD = "dd";
+
     public static String YYYY_MM = "yyyy-MM";
 
     public static String YYYY_MM_DD = "yyyy-MM-dd";