Bladeren bron

refactor(contract): 重构合同相关代码并优化数据结构

-引入 AHouseInfoDetail 服务和实体,用于获取更详细的房屋信息
- 重构 signContract 方法,支持 ContractA 和 ContractB 的处理
- 优化 ContractB 和 ContractC 的属性,使其更符合实际需求
- 修改 processContractA 和 processContractB 方法,实现数据填充
nahida 10 maanden geleden
bovenliggende
commit
bb84fcf417

+ 47 - 13
src/main/java/com/zksy/property/domain/bo/ContractB.java

@@ -7,27 +7,61 @@ import lombok.NoArgsConstructor;
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
-public class ContractB extends Contract{
+public class ContractB extends Contract {
     private String purpose;//用途
-
     private String landlordName;//房东
     private String landlordUniCode;//法人统一社会信用代码
-    private String landlordlegalRepresentative;//法定代表人
+    private String landlordLegalRepresentative;//法定代表人
     private String landlordDuty;//房东职务
-
     private String tenantName;//租方
     private String tenantUniCode;//租方统一社会信用代码
     private String tenantLegalRepresentative;//法定代表人
     private String tenantDuty;//租方职务
-
     private String who;//谁
     private String whatTime;//何时
     private String title;//标题
-
-
-    private String tenantTimeStart;//租期开始时间
-    private String tenantTimeEnd;//租期结束时间
-    private String tenantRent;//每套租金
-    private String tenantDeposit;//每套物业费
-    private String tenantDepositAmount;//押金
-}
+//    private String factoryBuildingNo;//标准化厂房编号
+//    private String factoryBuildingFloor;//厂房楼层
+//    private String factoryBuildingArea;//厂房面积(㎡)
+    private String supportingRoomArea;//配套用房面积(㎡)
+    private String officeArea;//办公室面积(㎡)
+    private String canteenArea;//食堂面积(㎡)
+    private String totalLeasedArea;//总面积(㎡)
+    private String dormTotalRooms;//宿舍楼总间数
+    private String dormSmallRooms;//宿舍小间数
+    private String dormLargeRooms;//宿舍大间数
+    private String deliveryDate;//标的交付日期
+    private String productionProject;//生产项目名称
+    private String leaseTermYears;//租赁期限(年)
+    private String leaseStartDate;//租赁起始日
+    private String leaseEndDate;//租赁终止日
+    private String renewNoticeMonths;//续租提前通知月数
+    private String factorySpecificFloor1;//标准化厂房某楼层
+    private String rentPerSqmFloor1;//该楼层租金(元/㎡/月)
+    private String factorySpecificFloor2;//标准化厂房另一楼层
+    private String rentPerSqmFloor2;//该楼层租金(元/㎡/月)
+    private String factoryAnnualRent;//厂房年租金(元)
+    private String factoryAnnualRentUpper;//厂房年租金(大写)
+    private String supportingRoomRentPerSqm;//配套用房租金(元/㎡/月)
+    private String supportingRoomAnnualRent;//配套用房年租金(元)
+    private String supportingRoomAnnualRentUpper;//配套用房年租金(大写)
+    private String dormSmallRoomRent;//宿舍楼普通单间月租金(元)
+    private String dormLargeRoomRent;//宿舍楼大单间月租金(元)
+    private String dormAnnualRent;//宿舍楼年租金(元)
+    private String dormAnnualRentUpper;//宿舍楼年租金(大写)
+    private String totalAnnualRent;//总租金(元)
+    private String totalAnnualRentUpper;//总租金(大写)
+    private String propertyFeePerSqm;//标准化厂房和配套用房物业费(元/㎡/月)
+    private String factorySupportingPropertyFee;//标准化厂房和配套用房年物业费(元)
+    private String factorySupportingPropertyFeeUpper;//标准化厂房和配套用房年物业费(大写)
+    private String dormSmallRoomPropertyFee;//宿舍楼普通单间月物业费(元)
+    private String dormLargeRoomPropertyFee;//宿舍楼大单间月物业费(元)
+    private String dormAnnualPropertyFee;//宿舍楼年物业费(元)
+    private String dormAnnualPropertyFeeUpper;//宿舍楼年物业费(大写)
+    private String totalAnnualPropertyFee;//年物业管理费(元)
+    private String totalAnnualPropertyFeeUpper;//年物业管理费(大写)
+    private String annualTotalRentAndPropertyFee;//年租金和物业费用总计(元)
+    private String annualTotalRentAndPropertyFeeUpper;//年租金和物业费用总计(大写)
+    private String depositAmount;//租赁押金金额(元)
+    private String depositAmountUpper;//租赁押金(大写)
+}

+ 29 - 8
src/main/java/com/zksy/property/domain/bo/ContractC.java

@@ -7,11 +7,32 @@ import lombok.NoArgsConstructor;
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
-public class ContractC extends Contract{
-    private String tenantName;//租方
-    private String tenantTimeStart;//租期开始时间
-    private String tenantTimeEnd;//租期结束时间
-    private String tenantRent;//每套租金
-    private String tenantDeposit;//每套物业费
-    private String tenantDepositAmount;//押金
-}
+public class ContractC extends Contract {
+    private String contractNumber;//合同编号
+    private String lessorName;//出租方(甲方)名称
+    private String lessorLegalRep;//出租方法定代表人
+    private String lessorUniCode;//出租方统一社会信用代码
+    private String lesseeName;//承租方(乙方)名称
+    private String lesseeLegalRep;//承租方法定代表人
+    private String lesseeIdCode;//承租方统一社会信用代码/身份证号
+    private String propertyLocation;//标的物坐落
+    private String rentableArea;//计租面积(平方米)
+    private String usableArea;//使用面积(平方米)
+    private String sharedArea;//公摊面积(平方米)
+    private String propertyUseNature;//标的物使用性质
+    private String storeName;//店铺名称
+    private String brand;//商品/服务品牌
+    private String businessScope;//经营范围
+    private String leaseTermMonths;//租赁期限(个月)
+    private String leaseStartDate;//租赁起始日
+    private String leaseEndDate;//租赁终止日
+    private String renovationStartDate;//装修期起始日
+    private String renovationEndDate;//装修期终止日
+    private String officialLeaseStartDate;//正式起租时间
+    private String annualRentUpper;//年租金(大写)
+    private String annualRentLower;//年租金(小写)
+    private String annualPropertyFeeUpper;//年物业服务费(大写)
+    private String annualPropertyFeeLower;//年物业服务费(小写)
+    private String depositAmount;//租赁保证金金额
+    private String depositAmountUpper;//租赁保证金(大写)
+}

+ 38 - 35
src/main/java/com/zksy/property/service/impl/AContractInfoServiceImpl.java

@@ -5,13 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zksy.property.domain.AContractInfo;
+import com.zksy.property.domain.AHouseInfoDetail;
 import com.zksy.property.domain.ASimplifiedHouseInfo;
 import com.zksy.property.domain.bo.*;
 import com.zksy.property.domain.dto.ContractFormDTO;
-import com.zksy.property.domain.vo.HouseInfoVo;
 import com.zksy.property.factory.ContractFactory;
 import com.zksy.property.mapper.AContractInfoMapper;
 import com.zksy.property.service.AContractInfoService;
+import com.zksy.property.service.AHouseInfoDetailService;
 import com.zksy.property.service.ARentalContractService;
 import com.zksy.property.service.ASimplifiedHouseInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -62,19 +63,22 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
         return this.getOne(queryWrapper);
     }
 
+    @Autowired
+    private AHouseInfoDetailService aHouseInfoDetailService;
+
     @Override
     public String signContract(ContractFormDTO dto) {
-        HouseInfoVo houseDetailInfo = aSimplifiedHouseInfoService.getHouseDetailInfo(dto.getHouseId());
+        AHouseInfoDetail houseInfoDetail = aHouseInfoDetailService.getBySimplifiedHouseId(dto.getHouseId());
         ASimplifiedHouseInfo aSimplifiedHouseInfo = aSimplifiedHouseInfoService.getById(dto.getHouseId());
         Contract baseContract = ContractFactory.createContract(aSimplifiedHouseInfo.getAssetType());
         BeanUtil.copyProperties(dto.getContractData(), baseContract);
         RentalTempBo bo = new RentalTempBo();
         var resPath = "";
         if (baseContract instanceof ContractA) {
-            processContractA((ContractA) baseContract,aSimplifiedHouseInfo,houseDetailInfo, bo);
+            processContractA((ContractA) baseContract,aSimplifiedHouseInfo,houseInfoDetail, bo);
             resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
         } else if (baseContract instanceof ContractB) {
-            processContractB((ContractB) baseContract, bo);
+            processContractB((ContractB) baseContract,aSimplifiedHouseInfo,houseInfoDetail, bo);
             resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
         } else if (baseContract instanceof ContractC) {
             processContractC((ContractC) baseContract, bo);
@@ -115,37 +119,37 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
         bo.setC27("");
     }
 
-    private static void processContractB(ContractB baseContract, RentalTempBo bo) {
+    private static void processContractB(ContractB baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, AHouseInfoDetail houseDetailInfo,RentalTempBo bo) {
         ContractB contractB = baseContract;
         //todo 处理bo
-        bo.setB1("");
-        bo.setB2("");
-        bo.setB3("");
-        bo.setB4("");
-        bo.setB5("");
-        bo.setB6("");
-        bo.setB7("");
-        bo.setB8("");
-        bo.setB9("");
-        bo.setB10("");
-        bo.setB11("");
-        bo.setB12("");
-        bo.setB13("");
-        bo.setB14("");
-        bo.setB15("");
-        bo.setB16("");
-        bo.setB17("");
-        bo.setB18("");
-        bo.setB19("");
-        bo.setB20("");
-        bo.setB21("");
-        bo.setB22("");
-        bo.setB23("");
-        bo.setB24("");
-        bo.setB25("");
-        bo.setB26("");
-        bo.setB27("");
-        bo.setB28("");
+        bo.setB1(contractB.getPurpose());
+        bo.setB2(contractB.getLandlordName());
+        bo.setB3(contractB.getLandlordUniCode());
+        bo.setB4(contractB.getLandlordLegalRepresentative());
+        bo.setB5(contractB.getLandlordDuty());
+        bo.setB6(contractB.getTenantName());
+        bo.setB7(contractB.getTenantUniCode());
+        bo.setB8(contractB.getTenantLegalRepresentative());
+        bo.setB9(contractB.getTenantDuty());
+        bo.setB10(contractB.getWho());
+        bo.setB11(contractB.getWhatTime());
+        bo.setB12(contractB.getTitle());
+        bo.setB13(aSimplifiedHouseInfo.getHouseName());
+        bo.setB14(aSimplifiedHouseInfo.getFloor());
+        bo.setB15(houseDetailInfo.getArea());
+        bo.setB16(contractB.getSupportingRoomArea());
+        bo.setB17(contractB.getOfficeArea());
+        bo.setB18(contractB.getCanteenArea());
+        bo.setB19(contractB.getTotalLeasedArea());
+        bo.setB20(contractB.getDormTotalRooms());
+        bo.setB21(contractB.getDormSmallRooms());
+        bo.setB22(contractB.getDormLargeRooms());
+        bo.setB23(contractB.getDeliveryDate());
+        bo.setB24(contractB.getProductionProject());
+        bo.setB25(contractB.getLeaseTermYears());
+        bo.setB26(contractB.getLeaseStartDate());
+        bo.setB27(contractB.getLeaseEndDate());
+        bo.setB28(contractB.getRenewNoticeMonths());
         bo.setB29("");
         bo.setB30("");
         bo.setB31("");
@@ -176,9 +180,8 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
         bo.setB56("");
     }
 
-    private static void processContractA(ContractA baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, HouseInfoVo houseDetailInfo, RentalTempBo bo) {
+    private static void processContractA(ContractA baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, AHouseInfoDetail houseDetailInfo, RentalTempBo bo) {
         ContractA contractA = baseContract;
-        //todo 处理bo
         bo.setA1(contractA.getLandlordName());
         bo.setA2(contractA.getTenantName());
         bo.setA3(aSimplifiedHouseInfo.getAddress());