|
@@ -88,7 +88,7 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
var resPath = "";
|
|
var resPath = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
- var contractnumber = generateAssetNumber();
|
|
|
|
|
|
|
+ var contractNumber = generateAssetNumber();
|
|
|
if (baseContract instanceof ContractA) {
|
|
if (baseContract instanceof ContractA) {
|
|
|
processContractA((ContractA) baseContract, aSimplifiedHouseInfo, houseInfoDetail, bo);
|
|
processContractA((ContractA) baseContract, aSimplifiedHouseInfo, houseInfoDetail, bo);
|
|
|
resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
|
|
resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
|
|
@@ -96,11 +96,11 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
processContractB((ContractB) baseContract, aSimplifiedHouseInfo, houseInfoDetail, bo);
|
|
processContractB((ContractB) baseContract, aSimplifiedHouseInfo, houseInfoDetail, bo);
|
|
|
resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
|
|
resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
|
|
|
} else if (baseContract instanceof ContractC) {
|
|
} else if (baseContract instanceof ContractC) {
|
|
|
- processContractC((ContractC) baseContract, bo);
|
|
|
|
|
|
|
+ processContractC((ContractC) baseContract, bo,contractNumber);
|
|
|
resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
|
|
resPath = fillContractData(bo, aSimplifiedHouseInfo.getAssetType());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- aSimplifiedHouseInfo.setStatus("已租");
|
|
|
|
|
|
|
+ /*aSimplifiedHouseInfo.setStatus("已租");
|
|
|
aSimplifiedHouseInfoService.updateById(aSimplifiedHouseInfo);
|
|
aSimplifiedHouseInfoService.updateById(aSimplifiedHouseInfo);
|
|
|
|
|
|
|
|
ATenantInfo aTenantInfo = new ATenantInfo();
|
|
ATenantInfo aTenantInfo = new ATenantInfo();
|
|
@@ -113,41 +113,41 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
aTenantInfo.setSimplifiedHouseId(dto.getHouseId());
|
|
aTenantInfo.setSimplifiedHouseId(dto.getHouseId());
|
|
|
aTenantInfo.setCreateTime(LocalDateTime.now());
|
|
aTenantInfo.setCreateTime(LocalDateTime.now());
|
|
|
aTenantInfo.setUpdateTime(LocalDateTime.now());
|
|
aTenantInfo.setUpdateTime(LocalDateTime.now());
|
|
|
- aTenantInfoService.save(aTenantInfo);
|
|
|
|
|
|
|
+ aTenantInfoService.save(aTenantInfo);*/
|
|
|
|
|
|
|
|
return resPath;
|
|
return resPath;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static void processContractC(ContractC baseContract, RentalTempBo bo) {
|
|
|
|
|
|
|
+ private static void processContractC(ContractC baseContract, RentalTempBo bo,String contractNumber) {
|
|
|
ContractC contractC = baseContract;
|
|
ContractC contractC = baseContract;
|
|
|
//todo 处理bo
|
|
//todo 处理bo
|
|
|
- bo.setC1("");
|
|
|
|
|
- bo.setC2("");
|
|
|
|
|
- bo.setC3("");
|
|
|
|
|
- bo.setC4("");
|
|
|
|
|
- bo.setC5("");
|
|
|
|
|
- bo.setC6("");
|
|
|
|
|
- bo.setC7("");
|
|
|
|
|
- bo.setC8("");
|
|
|
|
|
- bo.setC9("");
|
|
|
|
|
- bo.setC10("");
|
|
|
|
|
- bo.setC11("");
|
|
|
|
|
- bo.setC12("");
|
|
|
|
|
- bo.setC13("");
|
|
|
|
|
- bo.setC14("");
|
|
|
|
|
- bo.setC15("");
|
|
|
|
|
- bo.setC16("");
|
|
|
|
|
- bo.setC17("");
|
|
|
|
|
- bo.setC18("");
|
|
|
|
|
- bo.setC19("");
|
|
|
|
|
- bo.setC20("");
|
|
|
|
|
- bo.setC21("");
|
|
|
|
|
- bo.setC22("");
|
|
|
|
|
- bo.setC23("");
|
|
|
|
|
- bo.setC24("");
|
|
|
|
|
- bo.setC25("");
|
|
|
|
|
- bo.setC26("");
|
|
|
|
|
- bo.setC27("");
|
|
|
|
|
|
|
+ bo.setC1(contractNumber);
|
|
|
|
|
+ bo.setC2(contractC.getLessorName());
|
|
|
|
|
+ bo.setC3(contractC.getLessorLegalRep());
|
|
|
|
|
+ bo.setC4(contractC.getLessorUniCode());
|
|
|
|
|
+ bo.setC5(contractC.getLesseeName());
|
|
|
|
|
+ bo.setC6(contractC.getLesseeLegalRep());
|
|
|
|
|
+ bo.setC7(contractC.getLesseeIdCode());
|
|
|
|
|
+ bo.setC8(contractC.getPropertyLocation());
|
|
|
|
|
+ bo.setC9(contractC.getRentableArea());
|
|
|
|
|
+ bo.setC10(contractC.getUsableArea());
|
|
|
|
|
+ bo.setC11(contractC.getSharedArea());
|
|
|
|
|
+ bo.setC12(contractC.getPropertyUseNature());
|
|
|
|
|
+ bo.setC13(contractC.getStoreName());
|
|
|
|
|
+ bo.setC14(contractC.getBrand());
|
|
|
|
|
+ bo.setC15(contractC.getBusinessScope());
|
|
|
|
|
+ bo.setC16(contractC.getLeaseTermMonths());
|
|
|
|
|
+ bo.setC17(contractC.getLeaseStartDate());
|
|
|
|
|
+ bo.setC18(contractC.getLeaseEndDate());
|
|
|
|
|
+ bo.setC19(contractC.getRenovationStartDate());
|
|
|
|
|
+ bo.setC20(contractC.getRenovationEndDate());
|
|
|
|
|
+ bo.setC21(contractC.getOfficialLeaseStartDate());
|
|
|
|
|
+ bo.setC22(convertToUppercase(contractC.getAnnualRentLower()));
|
|
|
|
|
+ bo.setC23(contractC.getAnnualRentLower());
|
|
|
|
|
+ bo.setC24(convertToUppercase(contractC.getAnnualPropertyFeeLower()));
|
|
|
|
|
+ bo.setC25(contractC.getAnnualPropertyFeeLower());
|
|
|
|
|
+ bo.setC26(contractC.getDepositAmount());
|
|
|
|
|
+ bo.setC27(convertToUppercase(contractC.getDepositAmount()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static void processContractB(ContractB baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, AHouseInfoDetail houseDetailInfo, RentalTempBo bo) {
|
|
private static void processContractB(ContractB baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, AHouseInfoDetail houseDetailInfo, RentalTempBo bo) {
|
|
@@ -181,34 +181,34 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
bo.setB26(contractB.getLeaseStartDate());
|
|
bo.setB26(contractB.getLeaseStartDate());
|
|
|
bo.setB27(contractB.getLeaseEndDate());
|
|
bo.setB27(contractB.getLeaseEndDate());
|
|
|
bo.setB28(contractB.getRenewNoticeMonths());
|
|
bo.setB28(contractB.getRenewNoticeMonths());
|
|
|
- bo.setB29("");
|
|
|
|
|
- bo.setB30("");
|
|
|
|
|
- bo.setB31("");
|
|
|
|
|
- bo.setB32("");
|
|
|
|
|
- bo.setB33("");
|
|
|
|
|
- bo.setB34("");
|
|
|
|
|
- bo.setB35("");
|
|
|
|
|
- bo.setB36("");
|
|
|
|
|
- bo.setB37("");
|
|
|
|
|
- bo.setB38("");
|
|
|
|
|
- bo.setB39("");
|
|
|
|
|
- bo.setB40("");
|
|
|
|
|
- bo.setB41("");
|
|
|
|
|
- bo.setB42("");
|
|
|
|
|
- bo.setB43("");
|
|
|
|
|
- bo.setB44("");
|
|
|
|
|
- bo.setB45("");
|
|
|
|
|
- bo.setB46("");
|
|
|
|
|
- bo.setB47("");
|
|
|
|
|
- bo.setB48("");
|
|
|
|
|
- bo.setB49("");
|
|
|
|
|
- bo.setB50("");
|
|
|
|
|
- bo.setB51("");
|
|
|
|
|
- bo.setB52("");
|
|
|
|
|
- bo.setB53("");
|
|
|
|
|
- bo.setB54("");
|
|
|
|
|
- bo.setB55("");
|
|
|
|
|
- bo.setB56("");
|
|
|
|
|
|
|
+ bo.setB29(contractB.getFactorySpecificFloor1());
|
|
|
|
|
+ bo.setB30(contractB.getRentPerSqmFloor1());
|
|
|
|
|
+ bo.setB31(contractB.getFactorySpecificFloor2());
|
|
|
|
|
+ bo.setB32(contractB.getRentPerSqmFloor2());
|
|
|
|
|
+ bo.setB33(contractB.getFactoryAnnualRent());
|
|
|
|
|
+ bo.setB34(convertToUppercase(contractB.getFactoryAnnualRent()));
|
|
|
|
|
+ bo.setB35(contractB.getSupportingRoomRentPerSqm());
|
|
|
|
|
+ bo.setB36(contractB.getSupportingRoomAnnualRent());
|
|
|
|
|
+ bo.setB37(convertToUppercase(contractB.getSupportingRoomAnnualRent()));
|
|
|
|
|
+ bo.setB38(contractB.getDormSmallRoomRent());
|
|
|
|
|
+ bo.setB39(contractB.getDormLargeRoomRent());
|
|
|
|
|
+ bo.setB40(contractB.getDormAnnualRent());
|
|
|
|
|
+ bo.setB41(convertToUppercase(contractB.getDormAnnualRent()));
|
|
|
|
|
+ bo.setB42(contractB.getTotalAnnualRent());
|
|
|
|
|
+ bo.setB43(convertToUppercase(contractB.getTotalAnnualRent()));
|
|
|
|
|
+ bo.setB44(contractB.getPropertyFeePerSqm());
|
|
|
|
|
+ bo.setB45(contractB.getFactorySupportingPropertyFee());
|
|
|
|
|
+ bo.setB46(convertToUppercase(contractB.getFactorySupportingPropertyFee()));
|
|
|
|
|
+ bo.setB47(contractB.getDormSmallRoomPropertyFee());
|
|
|
|
|
+ bo.setB48(contractB.getDormLargeRoomPropertyFee());
|
|
|
|
|
+ bo.setB49(contractB.getDormAnnualPropertyFee());
|
|
|
|
|
+ bo.setB50(convertToUppercase(contractB.getDormAnnualPropertyFee()));
|
|
|
|
|
+ bo.setB51(contractB.getTotalAnnualPropertyFee());
|
|
|
|
|
+ bo.setB52(convertToUppercase(contractB.getTotalAnnualPropertyFee()));
|
|
|
|
|
+ bo.setB53(contractB.getAnnualTotalRentAndPropertyFee());
|
|
|
|
|
+ bo.setB54(convertToUppercase(contractB.getAnnualTotalRentAndPropertyFee()));
|
|
|
|
|
+ bo.setB55(contractB.getDepositAmount());
|
|
|
|
|
+ bo.setB56(convertToUppercase(contractB.getDepositAmount()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static void processContractA(ContractA baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, AHouseInfoDetail houseDetailInfo, RentalTempBo bo) {
|
|
private static void processContractA(ContractA baseContract, ASimplifiedHouseInfo aSimplifiedHouseInfo, AHouseInfoDetail houseDetailInfo, RentalTempBo bo) {
|
|
@@ -245,6 +245,90 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
}
|
|
}
|
|
|
return aRentalContractService.generatorRental(String.valueOf(f), bo);
|
|
return aRentalContractService.generatorRental(String.valueOf(f), bo);
|
|
|
}
|
|
}
|
|
|
|
|
+ public static String convertToUppercase(String numberStr) {
|
|
|
|
|
+ // 输入验证
|
|
|
|
|
+ if (numberStr == null || numberStr.trim().isEmpty()) {
|
|
|
|
|
+ throw new IllegalArgumentException("输入不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ numberStr = numberStr.trim();
|
|
|
|
|
+ // 处理负号
|
|
|
|
|
+ boolean isNegative = false;
|
|
|
|
|
+ if (numberStr.startsWith("-")) {
|
|
|
|
|
+ isNegative = true;
|
|
|
|
|
+ numberStr = numberStr.substring(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证数字格式
|
|
|
|
|
+ if (!numberStr.matches("\\d+(\\.\\d{1,2})?")) {
|
|
|
|
|
+ throw new IllegalArgumentException("输入格式错误,需为合法数字");
|
|
|
|
|
+ }
|
|
|
|
|
+ // 转换为double类型(注意:使用BigDecimal可避免精度问题,但此处保持与原方法一致)
|
|
|
|
|
+ double number = Double.parseDouble(numberStr);
|
|
|
|
|
+ // 调用原有的转换方法
|
|
|
|
|
+ String result = convertToUppercase(number);
|
|
|
|
|
+
|
|
|
|
|
+ // 添加负号前缀
|
|
|
|
|
+ return isNegative ? "负" + result : result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 数字转中文大写的主方法
|
|
|
|
|
+ public static String convertToUppercase(double number) {
|
|
|
|
|
+ if (number < 0) {
|
|
|
|
|
+ return "负" + convertToUppercase(-number);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String[] units = {"", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆"};
|
|
|
|
|
+ String[] digits = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
|
|
|
|
|
+
|
|
|
|
|
+ long integerPart = (long) number;
|
|
|
|
|
+ long decimalPart = Math.round((number - integerPart) * 100);
|
|
|
|
|
+
|
|
|
|
|
+ StringBuilder result = new StringBuilder();
|
|
|
|
|
+ String integerStr = String.valueOf(integerPart);
|
|
|
|
|
+
|
|
|
|
|
+ // 处理整数部分
|
|
|
|
|
+ boolean zeroFlag = false;
|
|
|
|
|
+ for (int i = 0; i < integerStr.length(); i++) {
|
|
|
|
|
+ int digit = integerStr.charAt(i) - '0';
|
|
|
|
|
+ int unitIndex = integerStr.length() - i - 1;
|
|
|
|
|
+
|
|
|
|
|
+ if (digit == 0) {
|
|
|
|
|
+ zeroFlag = true;
|
|
|
|
|
+ // 处理单位:万、亿、兆
|
|
|
|
|
+ if (unitIndex % 4 == 0) {
|
|
|
|
|
+ result.append(units[unitIndex]);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (zeroFlag) {
|
|
|
|
|
+ result.append("零");
|
|
|
|
|
+ zeroFlag = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ result.append(digits[digit]).append(units[unitIndex]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (result.length() == 0) {
|
|
|
|
|
+ result.append("零");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ result.append("元");
|
|
|
|
|
+
|
|
|
|
|
+ // 处理小数部分
|
|
|
|
|
+ long jiao = decimalPart / 10;
|
|
|
|
|
+ long fen = decimalPart % 10;
|
|
|
|
|
+
|
|
|
|
|
+ if (jiao == 0 && fen == 0) {
|
|
|
|
|
+ result.append("整");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (jiao != 0) {
|
|
|
|
|
+ result.append(digits[(int) jiao]).append("角");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (fen != 0) {
|
|
|
|
|
+ result.append(digits[(int) fen]).append("分");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return result.toString();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|