LAPTOP-FO2T5SIU\35838 6 hónapja%!(EXTRA string=óta)
szülő
commit
75982b2d00

+ 1 - 1
pro-base/src/main/java/com/idea/buildManage/excel/ParkRoomExcel.java

@@ -52,7 +52,7 @@ public class ParkRoomExcel implements Serializable {
     @ExcelProperty(value = "*用途")
     private String roomUse;
 
-    @ExcelProperty(value = "户编号")
+    @ExcelProperty(value = "房屋代码")
     private String roomNumber;
 
     @ExcelProperty(value = "装修情况")

+ 10 - 10
pro-base/src/main/java/com/idea/customerManagement/controller/IntentionalDepositController.java

@@ -41,16 +41,16 @@ public class IntentionalDepositController extends BaseController {
     }
 
 
-    /**
-     * 获取定金金流水号
-     * @param id
-     * @return
-     */
-    @PostMapping(value = "getDepositSerialNumber",produces = {"application/json;charset=UTF-8"})
-    @ResponseBody
-    public String getDepositSerialNumber(String id) {
-        return modelService.getDepositSerialNumber(id);
-    }
+//    /**
+//     * 获取定金金流水号
+//     * @param id
+//     * @return
+//     */
+//    @PostMapping(value = "getDepositSerialNumber",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public String getDepositSerialNumber(String id) {
+//        return modelService.getDepositSerialNumber(id);
+//    }
 
 
     /**

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

@@ -423,11 +423,11 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         long count = roomSelectionInfoMapper.countByExample(roomSelectionInfoExample);
         result.setRoomSelectionCount((int) count);
 
-        ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(customerManagement.getGroupId());
-        ParkFloorDisc parkFloorDisc = parkFloorDiscMapper.selectByPrimaryKey(customerManagement.getDiscId());
-        result.setGroupDiscName(parkInfo.getGroupName() + parkFloorDisc.getName());
-
-
+        if(StringUtils.isNotEmpty(customerManagement.getGroupId()) && StringUtils.isNotEmpty(customerManagement.getDiscId())){
+            ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(customerManagement.getGroupId());
+            ParkFloorDisc parkFloorDisc = parkFloorDiscMapper.selectByPrimaryKey(customerManagement.getDiscId());
+            result.setGroupDiscName(parkInfo.getGroupName() + parkFloorDisc.getName());
+        }
         return result;
     }
 
@@ -893,7 +893,6 @@ public class CustomerManagementService implements BaseService<CustomerManagement
                         data.setCreatedAt(createdAt);
                         modelMapper.insertSelective(data);
                         buyer = new Buyer();
-                        buyer.setId(IdUtil.simpleUUID());
                         buyer.setCustomerManagementId(customerManagementId);
                         buyer.setName(excel.getBuyerName());
                         buyer.setIdentityCard(excel.getIdentityCard());
@@ -901,6 +900,7 @@ public class CustomerManagementService implements BaseService<CustomerManagement
                         buyer.setOrderNum(1);
                         buyer.setCreatedId(userId);
                         buyer.setCreatedAt(createdAt);
+                        buyerService.insertSelective(buyer);
 
                     } else {
                         throw new RuntimeException(builder.toString());

+ 23 - 10
pro-base/src/main/java/com/idea/customerManagement/service/IntentionalDepositService.java

@@ -164,9 +164,9 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(customerManagementId);
         String groupId = customerManagement.getGroupId();
         String discId = customerManagement.getDiscId();
-        // 查找这个小区已收取意向金的 数据量
+        // 查找已收取意向金的 数据量
         IntentionalDepositExample example = new IntentionalDepositExample();
-        example.createCriteria().andGroupIdEqualTo(groupId);
+//        example.createCriteria().andGroupIdEqualTo(groupId);
         Long count = countByExample(example);
         String number = "";
         if (count.doubleValue() == 0) {
@@ -175,9 +175,10 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
             count++;
             number = String.format("%05d", count);
         }
-        ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(groupId);
-        ParkFloorDisc parkFloorDisc = parkFloorDiscMapper.selectByPrimaryKey(discId);
-        String serialNumber = parkInfo.getGroupName() + parkFloorDisc.getName() + "-YXJ" + number;
+//        ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(groupId);
+//        ParkFloorDisc parkFloorDisc = parkFloorDiscMapper.selectByPrimaryKey(discId);
+//        String serialNumber = parkInfo.getGroupName() + parkFloorDisc.getName() + "-YXJ" + number;
+        String serialNumber = "YXJ" + number;
         return serialNumber;
     }
 
@@ -187,9 +188,9 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
      * @param id
      * @return
      */
-    public String getDepositSerialNumber(String id) {
+    public String getDepositSerialNumber(IntentionalDeposit deposit) {
 
-        IntentionalDeposit deposit = selectByPrimaryKey(id);
+//        IntentionalDeposit deposit = selectByPrimaryKey(id);
         String groupId = deposit.getGroupId();
         String discId = deposit.getDiscId();
         ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(groupId);
@@ -224,6 +225,8 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         }
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(model.getCustomerManagementId());
         String id = IdUtil.simpleUUID();
+        // 重新获取流水号
+        String serialNumber = getSerialNumber(model.getCustomerManagementId());
         // 已收取
         model.setStatus(1);
         model.setGroupId(customerManagement.getGroupId());
@@ -231,6 +234,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         model.setCreatedAt(new Date());
         model.setCreatedId(userId);
         model.setId(id);
+        model.setSerialNumber(serialNumber);
         int result = insertWithoutId(model);
 
         // 票据管理 新增一条记录
@@ -373,19 +377,27 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         if (StringUtils.isEmpty(uerId)){
             uerId = ShiroUtils.getUserId();
         }
+        String houseId = model.getHouseId();
+        ParkRoomResponse response = roomExtendMapper.getFullName(houseId);
+        //重新获取定金编号
+        model.setDiscId(response.getDiscId());
+        model.setGroupId(response.getGroupId());
+        String depositSerialNumber = getDepositSerialNumber(model);
+        model.setDepositSerialNumber(depositSerialNumber);
+
         String roomSelectionInfoId;
         RoomSelectionInfo roomSelectionInfo;
-        String houseId = model.getHouseId();
         String customerManagementId = model.getCustomerManagementId();
 
+        // 更新客户信息
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(customerManagementId);
         // 购房状态 已订房
         customerManagement.setStatus(7);
         customerManagement.setHouseId(houseId);
+        customerManagement.setDiscId(response.getDiscId());
+        customerManagement.setGroupId(response.getGroupId());
         StringBuilder builder = new StringBuilder();
-
         // 拼接房屋名称
-        ParkRoomResponse response = roomExtendMapper.getFullName(houseId);
         builder.append(response.getBuildName()).append("-").append(response.getRoomNo()).append(",");
         if (builder.length() > 0) {
             builder.deleteCharAt(builder.length() - 1);
@@ -393,6 +405,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         customerManagement.setHouseName(builder.toString());
         customerManagementMapper.updateByPrimaryKeySelective(customerManagement);
 
+        // 更新定金信息
         RoomSelectionInfoExample roomSelectionInfoExample = new RoomSelectionInfoExample();
         roomSelectionInfoExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
         List<RoomSelectionInfo> list = roomSelectionInfoMapper.selectByExample(roomSelectionInfoExample);

+ 6 - 1
pro-base/src/main/java/com/idea/customerManagement/service/RoomSelectionInfoService.java

@@ -138,6 +138,8 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
      */
     public int submit(String houseIds, String customerManagementId, String userId) {
 
+        String groupId = "";
+        String discId = "";
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(customerManagementId);
         customerManagement.setStatus(2);
         customerManagement.setHouseId(houseIds);
@@ -179,12 +181,15 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
             parkRoom.setId(response.getId());
             parkRoom.setIsChoose(1);
             parkRoomMapper.updateByPrimaryKeySelective(parkRoom);
-
+            groupId = response.getGroupId();
+            discId = response.getDiscId();
         }
         if (builder.length() > 0) {
             builder.deleteCharAt(builder.length() - 1);
         }
         customerManagement.setHouseName(builder.toString());
+        customerManagement.setGroupId(groupId);
+        customerManagement.setDiscId(discId);
         customerManagementMapper.updateByPrimaryKeySelective(customerManagement);
         return 1;
     }

+ 6 - 6
pro-base/src/main/java/com/idea/invoice/service/InvoiceManageService.java

@@ -295,11 +295,11 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
         if (ObjectUtil.isNotNull(payType)) {
             criteria.andPayTypeEqualTo(payType);
         }
-        List<PayLog> payLogs = payLogService.selectByExample(payLogExample);
-        BigDecimal money = BigDecimal.ZERO;
-        for (PayLog payLog : payLogs) {
-            money = money.add(payLog.getPayMoney());
-        }
+//        List<PayLog> payLogs = payLogService.selectByExample(payLogExample);
+//        BigDecimal money = BigDecimal.ZERO;
+//        for (PayLog payLog : payLogs) {
+//            money = money.add(payLog.getPayMoney());
+//        }
 
         invoiceManage.setContractId(contractId);
         invoiceManage.setCustomerManagementId(contract.getCustomerManagementId());
@@ -312,7 +312,7 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
         invoiceManage.setInvoiceGoodsName(invoiceGoodsName + room.getGroupName());
         invoiceManage.setSpecifications(room.getBuildName() + "-" + room.getRoomNo());
         invoiceManage.setInvoiceCount(new BigDecimal(contract.getActualBuildArea().toString()));
-        invoiceManage.setInvoiceAmount(money);
+        invoiceManage.setInvoiceAmount(contract.getBuyerMoney());
         invoiceManage.setInvoiceTax("0");
         invoiceManage.setRemark(builder.toString());
         return invoiceManage;

+ 11 - 11
pro-wx/src/main/java/com/idea/pro/wx/controller/customerManagement/WxIntentionalDepositController.java

@@ -41,17 +41,17 @@ public class WxIntentionalDepositController extends BaseController {
     }
 
 
-    /**
-     * 获取定金金流水号
-     *
-     * @param id
-     * @return
-     */
-    @PostMapping(value = "getDepositSerialNumber", produces = {"application/json;charset=UTF-8"})
-    @ResponseBody
-    public String getDepositSerialNumber(String id) {
-        return modelService.getDepositSerialNumber(id);
-    }
+//    /**
+//     * 获取定金金流水号
+//     *
+//     * @param id
+//     * @return
+//     */
+//    @PostMapping(value = "getDepositSerialNumber", produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public String getDepositSerialNumber(String id) {
+//        return modelService.getDepositSerialNumber(id);
+//    }
 
 
     /**