LAPTOP-FO2T5SIU\35838 5 mesi fa
parent
commit
f9651c0741

+ 1 - 1
pro-base/src/main/java/com/idea/buildManage/controller/ParkRoomController.java

@@ -75,7 +75,7 @@ public class ParkRoomController extends BaseController {
     @ApiOperation(value = "房间列表")
     @PostMapping(value = "listAll", produces = {"application/json;charset=UTF-8"})
     @ResponseBody
-    public Object listAll(ParkRoom model, DateTrans dt) {
+    public Object listAll(ParkRoomResponse model, DateTrans dt) {
         return modelService.listAll(model, dt);
     }
 

+ 2 - 0
pro-base/src/main/java/com/idea/buildManage/response/ParkRoomResponse.java

@@ -104,4 +104,6 @@ public class ParkRoomResponse extends ParkRoom {
 
     private String chooseStatusStr;
 
+    private String houseTypeStr;
+
 }

+ 24 - 2
pro-base/src/main/java/com/idea/buildManage/service/ParkRoomService.java

@@ -16,6 +16,7 @@ import com.idea.buildManage.constant.ConstantNodeType;
 import com.idea.buildManage.excel.MnpBuildingExcel;
 import com.idea.buildManage.excel.ParkRoomExcel;
 import com.idea.buildManage.excel.WriteHandlerStrategy;
+import com.idea.buildManage.mapper.HouseTypeMapper;
 import com.idea.buildManage.mapper.ParkRoomExtendMapper;
 import com.idea.buildManage.mapper.ParkRoomMapper;
 import com.idea.buildManage.model.*;
@@ -72,6 +73,7 @@ import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Slf4j
 @Service
@@ -110,6 +112,8 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
     private RefundManageMapper refundManageMapper;
     @Autowired
     private PayLogMapper payLogMapper;
+    @Autowired
+    private HouseTypeMapper houseTypeMapper;
 
 
     /**
@@ -129,8 +133,26 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
      *
      * @return
      */
-    public List<ParkRoom> listAll(ParkRoom model, DateTrans dt) {
-        return modelMapper.selectByExample(getCondition(model, dt));
+    public List<ParkRoomResponse> listAll(ParkRoomResponse model, DateTrans dt) {
+
+
+        List<ParkRoomResponse> parkRoomResponses = extendMapper.selectByModel(model);
+        List<HouseType> houseTypes = houseTypeMapper.selectByExample(new HouseTypeExample());
+        Map<String, HouseType> houseTypesMap = houseTypes.stream()
+                .collect(Collectors.toMap(
+                        HouseType::getId,
+                        HouseType->HouseType,
+                        (existing, replacement) -> existing // 保留现有值
+                ));
+
+        for(ParkRoomResponse room:parkRoomResponses){
+            if(StringUtils.isNotEmpty(room.getHouseTypeId()) && houseTypesMap.containsKey(room.getHouseTypeId())){
+                HouseType houseType = houseTypesMap.get(room.getHouseTypeId());
+                String str = houseType.getName() + "," + houseType.getBuildArea() + ",使用面积" + houseType.getUseArea();
+                room.setHouseTypeStr(str);
+            }
+        }
+        return parkRoomResponses;
     }
 
     private ParkRoomExample getCondition(ParkRoom model, DateTrans dt) {

+ 21 - 1
pro-base/src/main/java/com/idea/customerManagement/controller/CustomerManagementController.java

@@ -137,11 +137,31 @@ public class CustomerManagementController extends BaseController {
         modelService.errorListExport(list,response);
     }
 
-
+    /**
+     * 下载导入模板
+     * @param response
+     * @throws IOException
+     */
     @PostMapping(value = "downLoadTemplate")
     @ResponseBody
     public void downLoadTemplate(HttpServletResponse response) throws IOException {
         modelService.downLoadTemplate(response);
     }
 
+    /**
+     * 统计报表
+     * @param tablepar
+     * @param model
+     * @param dt
+     * @return
+     */
+    @PostMapping(value = "reportList",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object reportList(Tablepar tablepar, CustomerManagementDto model, DateTrans dt){
+        PageInfo<CustomerManagementDto> page= modelService.reportList(tablepar,model,dt);
+        TableSplitResult<CustomerManagementDto> result = new TableSplitResult<CustomerManagementDto>(page.getPageNum(), page.getTotal(), page.getList());
+        return  result;
+    }
+
+
 }

+ 44 - 0
pro-base/src/main/java/com/idea/customerManagement/dto/CustomerManagementDto.java

@@ -49,4 +49,48 @@ public class CustomerManagementDto extends CustomerManagement {
 
     private String roomSelectionDateTo;
 
+
+    private String groupName;
+
+    private String discName;
+
+    private String groupId;
+
+    private String discId;
+
+    /**
+     * 房号
+     */
+    private String roomNo;
+
+    /**
+     * 楼栋数量
+     */
+    private Integer buildCount;
+
+    /**
+     * 房屋总数
+     */
+    private Integer roomCount;
+
+    /**
+     * 待签约
+     */
+    private Integer waitSigningCount;
+
+    /**
+     * 已签约
+     */
+    private Integer signingCount;
+
+    /**
+     * 已结清数
+     */
+    private Integer settledCount;
+
+    /**
+     * 已入户数
+     */
+    private Integer enteredCount;
+
 }

+ 2 - 0
pro-base/src/main/java/com/idea/customerManagement/mapper/CustomerManagementExtendMapper.java

@@ -18,4 +18,6 @@ public interface CustomerManagementExtendMapper {
 
     ParkRoom getByBuildHouseName(String buildName, String roomNo);
 
+    List<CustomerManagementDto> reportList(CustomerManagementDto record);
+
 }

+ 15 - 0
pro-base/src/main/java/com/idea/customerManagement/service/CustomerManagementService.java

@@ -1042,6 +1042,21 @@ public class CustomerManagementService implements BaseService<CustomerManagement
     }
 
 
+    /**
+     * 统计报表
+     * @param tablepar
+     * @param model
+     * @param dt
+     * @return
+     */
+    public PageInfo<CustomerManagementDto> reportList(Tablepar tablepar, CustomerManagementDto model, DateTrans dt) {
+        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+        List<CustomerManagementDto> list = extendMapper.reportList(model);
+        PageInfo<CustomerManagementDto> pageInfo = new PageInfo<>(list);
+        return pageInfo;
+    }
+
+
     /**
      * 更新客户基础信息
      * @param file

+ 31 - 2
pro-base/src/main/java/com/idea/invoice/service/ReceiptManageService.java

@@ -171,6 +171,7 @@ public class ReceiptManageService implements BaseService<ReceiptManage, ReceiptM
         String content = "";
         String dictLabel = "";
         String paymentMethod = "";
+        PayLog payLog = payLogService.selectByPrimaryKey(receiptManage.getBusinessId());
         switch (receiptManage.getReceiptType()) {
             case "1":
                 fileName = "意向金收据.docx";
@@ -197,19 +198,47 @@ public class ReceiptManageService implements BaseService<ReceiptManage, ReceiptM
             case "3":
                 fileName = "首期收据.docx";
                 content = "首期";
+                serialNumber = payLog.getSerialNumber();
+                collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
+                dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", payLog.getPaymentMethod().toString());
+                if (StringUtils.isNotEmpty(dictLabel)) {
+                    paymentMethod = dictLabel;
+                }
                 break;
             case "4":
                 fileName = "银行按揭收据.docx";
                 content = "银行按揭";
+                serialNumber = payLog.getSerialNumber();
+                collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
+                dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", payLog.getPaymentMethod().toString());
+                if (StringUtils.isNotEmpty(dictLabel)) {
+                    paymentMethod = dictLabel;
+                }
                 break;
-            default:
-                PayLog payLog = payLogService.selectByPrimaryKey(receiptManage.getBusinessId());
+            case "7":
+                fileName = "楼款收据.docx";
+                content = "楼款";
+                serialNumber = payLog.getSerialNumber();
                 collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
                 dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", payLog.getPaymentMethod().toString());
                 if (StringUtils.isNotEmpty(dictLabel)) {
                     paymentMethod = dictLabel;
                 }
+                break;
+            case "8":
+                fileName = "补差款.docx";
+                content = "补差款";
+                serialNumber = payLog.getSerialNumber();
+                collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
+                dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", payLog.getPaymentMethod().toString());
+                if (StringUtils.isNotEmpty(dictLabel)) {
+                    paymentMethod = dictLabel;
+                }
+                break;
+            default:
+
         }
+
         String customerManagementId = receiptManage.getCustomerManagementId();
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(customerManagementId);
         BuyerExample buyerExample = new BuyerExample();

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

@@ -170,7 +170,6 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
     }
 
 
-
     /**
      * 新增
      *
@@ -178,9 +177,9 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
      * @return
      */
     @Transactional
-    public int add(PayLog model,String userId) {
+    public int add(PayLog model, String userId) {
 
-        if(StringUtils.isEmpty(userId)){
+        if (StringUtils.isEmpty(userId)) {
             userId = ShiroUtils.getUserId();
         }
         String serialNumber = getSerialNumber(model);
@@ -195,7 +194,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         // 更新合同 预收款 收款状态
         ContractManage contractManage = contractManageMapper.selectByPrimaryKey(model.getContractId());
         if (model.getPayType() == 1) {
-            String receivedMoneyStr = extendMapper.getMoneyByContractId(model.getContractId(), model.getPayType(),null);
+            String receivedMoneyStr = extendMapper.getMoneyByContractId(model.getContractId(), model.getPayType(), null);
             BigDecimal buyerMoney = contractManage.getBuyerMoney();
             BigDecimal receivedMoney = new BigDecimal(receivedMoneyStr);
             if (receivedMoney.doubleValue() < buyerMoney.doubleValue()) {
@@ -212,7 +211,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
                         .andSendStatusEqualTo("1");
                 List<InvoiceManage> invoiceManages = invoiceManageService.selectByExample(invoiceManageExample);
                 // 不存在推送成功的 则新增 正式发票
-                if(CollectionUtils.isEmpty(invoiceManages)){
+                if (CollectionUtils.isEmpty(invoiceManages)) {
                     // 查询该合同是否已生成 正式发票
                     invoiceManageExample = new InvoiceManageExample();
                     invoiceManageExample.createCriteria().andTypeEqualTo("2")
@@ -276,7 +275,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         receiptManage.setReceiptType(receiptType);
         receiptManage.setReceiptMoney(model.getPayMoney());
         receiptManage.setReceiptNumber(serialNumber);
-        receiptManageService.add(receiptManage,userId);
+        receiptManageService.add(receiptManage, userId);
 
         return result;
     }
@@ -362,7 +361,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         payLogDto.setPaymentMethod(contractManage.getPaymentMethod());
 //        payLogDto.setDeadLine(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, contractManage.getDeadline()));
         // 查询已收房款
-        String receivedMoneyStr = extendMapper.getMoneyByContractId(contractId, 1,null);
+        String receivedMoneyStr = extendMapper.getMoneyByContractId(contractId, 1, null);
         BigDecimal receivedMoney = new BigDecimal(receivedMoneyStr);
         // 欠款
         BigDecimal arrears = BigDecimal.ZERO;
@@ -441,13 +440,21 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
                 filePath = "/home/project/settleDown/tem/receipt.docx";
                 fileName = "银行按揭收据.docx";
                 break;
+            case 5: // 楼款
+                filePath = "/home/project/settleDown/tem/receipt.docx";
+                fileName = "楼款收据.docx";
+                break;
+            case 6: // 补差款
+                filePath = "/home/project/settleDown/tem/receipt.docx";
+                fileName = "补差款收据.docx";
+                break;
             case 8: // 首款-定金转
                 filePath = "/home/project/settleDown/tem/receipt.docx";
-                fileName = "首款-定金转.docx";
+                fileName = "首款-定金转收据.docx";
                 break;
             case 9: // 房款-定金转
                 filePath = "/home/project/settleDown/tem/receipt.docx";
-                fileName = "房款-定金转.docx";
+                fileName = "房款-定金转收据.docx";
                 break;
         }
 
@@ -472,8 +479,8 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         String collectionTime = "";
         try {
             collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
-        }catch (Exception e){
-            log.error("日期转换异常:{}",e.getMessage());
+        } catch (Exception e) {
+            log.error("日期转换异常:{}", e.getMessage());
         }
         String content = "";
         String paymentMethod = "";
@@ -507,7 +514,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         settingInfoData = new HashMap<>();
         settingInfoData.put("leftOffset", "50");
         settingInfoData.put("topOffset", "0");
-        settingData.put("${seal}",settingInfoData);
+        settingData.put("${seal}", settingInfoData);
 
 
         try {
@@ -521,7 +528,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
             out.close();
             tempWord.deleteOnExit();
             tempPDF.deleteOnExit();
-        }catch (Exception e){
+        } catch (Exception e) {
             log.error("文档生成报错:", e);
         }
 
@@ -617,23 +624,24 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
 
     /**
      * 转首款 转房款
+     *
      * @param id
      * @param type
      * @return
      */
     @Transactional
-    public int convertType(String id,Integer type){
+    public int convertType(String id, Integer type) {
         PayLog payLog = selectByPrimaryKey(id);
         // 1-意向金转定金,2-定金转首款,3-定金转房款
         Integer convertType = null;
         // 转首款
-        if(type == 1){
+        if (type == 1) {
             payLog.setContentType(8);
             payLog.setPaymentStatus(3);
             convertType = 2;
         }
         // 转房款
-        if(type == 2){
+        if (type == 2) {
             payLog.setContentType(9);
             payLog.setPaymentStatus(4);
             convertType = 3;
@@ -659,7 +667,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
     }
 
 
-    public int delete(String id){
+    public int delete(String id) {
 
         PayLog payLog = modelMapper.selectByPrimaryKey(id);
         payLog.setStatus(1);
@@ -668,7 +676,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         ReceiptManageExample receiptManageExample = new ReceiptManageExample();
         receiptManageExample.createCriteria().andBusinessIdEqualTo(id);
         List<ReceiptManage> receiptManages = receiptManageService.selectByExample(receiptManageExample);
-        if(CollectionUtils.isNotEmpty(receiptManages)){
+        if (CollectionUtils.isNotEmpty(receiptManages)) {
             receiptManageService.deleteByPrimaryKey(receiptManages.get(0).getId());
         }
         return result;
@@ -676,6 +684,4 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
     }
 
 
-
-
 }

+ 27 - 0
pro-base/src/main/resources/mybatis/customerManagement/CustomerManagementExtendMapper.xml

@@ -80,4 +80,31 @@
         AND build_num = #{buildName}
         AND room_no = #{roomNo}
     </select>
+
+    <select id="reportList" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
+      select p.group_name,p.group_id,f.id discId, f.name disc_name,
+             (select count(1) from mnp_building where disc_id = f.id) buildCount,
+             (select count(1) from park_room where disc_id = f.id) roomCount,
+             (select count(1) from customer_management where disc_id = f.id and status = 2 ) waitSigningCount,
+             (select count(1) from customer_management where disc_id = f.id and status = 3 ) signingCount,
+             (select count(1) from customer_management where disc_id = f.id and status = 4 ) enteredCount,
+             (select count(1) from contract_manage where collection_status = 2 and house_id in (
+                 select id from park_room where disc_id = f.id
+               ) ) settledCount
+      from park_floor_disc f
+      left join park_info p on p.id = f.group_id
+      left join park_room r on r.disc_id = f.id
+      <where>
+        <if test="groupId !=null and groupId != ''">
+          and p.id = #{groupId}
+        </if>
+        <if test="discId !=null and discId != ''">
+          and f.id = #{discId}
+        </if>
+        <if test="roomNo !=null and roomNo != ''">
+          and r.room_no like concat('%',#{roomNo},'%')
+        </if>
+      </where>
+      group by f.id
+    </select>
 </mapper>

+ 1 - 1
pro-wx/src/main/java/com/idea/pro/wx/controller/buildManage/WxParkRoomController.java

@@ -78,7 +78,7 @@ public class WxParkRoomController extends BaseController {
     @ApiOperation(value = "房间列表")
     @PostMapping(value = "listAll", produces = {"application/json;charset=UTF-8"})
     @ResponseBody
-    public Object listAll(ParkRoom model, DateTrans dt) {
+    public Object listAll(ParkRoomResponse model, DateTrans dt) {
         return modelService.listAll(model, dt);
     }