diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 869f0562f..3fe8fe2f5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -2056,7 +2056,24 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("bankAccount", " "); result.put("invoiceAddressPhone", " "); } + //租赁合同信息 + if(StringUtils.isNotBlank(wxRentContract.getContractualRules())){ + //{total:,partyA:,partyB:} + JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getContractualRules()); + result.put("rentTotal",jsonObject.getString("total")); + result.put("rentPartyA",jsonObject.getString("partyA")); + result.put("rentPartyB",jsonObject.getString("partyB")); + } + if(StringUtils.isNotBlank(wxRentContract.getBusinessHours())){ + //{"beginEnd": "00", "finishEnd": "00", "beginStart": "00", "finishStart": "18"} + JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getBusinessHours()); + if(!("-1").equals(jsonObject.getString("beginStarts")) && !("-1").equals(jsonObject.getString("beginEnd")) + && !("-1").equals(jsonObject.getString("finishStart")) && !("-1").equals(jsonObject.getString("finishEnd"))){ + result.put("businessStart",jsonObject.getString("beginStarts")+":"+jsonObject.getString("beginEnd")); + result.put("businessEnd",jsonObject.getString("finishStart")+":"+jsonObject.getString("finishEnd")); + } + } //甲方信息 if(StringUtils.isNotBlank(wxRentContract.getFirstPartyBankInfo())){ //{"bankNameA": "", "accountNumA": "", "accountNameA": "", "socialCreditCodeA": ""} @@ -2108,6 +2125,36 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("taxpayerNumberB",""); } + //物业 + result.put("propertyName",wxRentContract.getPropertyName()); + if(wxRentContract.getPropertyFee() != null){ + double propertyFee = new BigDecimal(wxRentContract.getPropertyFee()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("propertyFee",propertyFee); + } + if(wxRentContract.getFeeCycle() != null){ + if(wxRentContract.getFeeCycle().intValue() == 1){ + result.put("feeCycle","月"); + }else if(wxRentContract.getFeeCycle().intValue() == 2){ + result.put("feeCycle","季"); + }else if(wxRentContract.getFeeCycle().intValue() == 3){ + result.put("feeCycle","年"); + } + } + if(wxRentContract.getWaterFee() != null){ + double waterFee = new BigDecimal(wxRentContract.getWaterFee()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("waterFee",waterFee); + } + if(wxRentContract.getElectricityFees() != null){ + double electricityFees = new BigDecimal(wxRentContract.getElectricityFees()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("electricityFees",electricityFees); + } + //交付 @@ -2172,6 +2219,26 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("reductionEndDateMonth", "/"); result.put("reductionEndDateDay", "/"); } + String shopType1 = "□",shopType2 = "□",shopType3 = "□",shopType4 = "□"; + String shopType4Str = ""; + if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 1){ + shopType1 = "\\u00FE"; + }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 2){ + shopType2 = "\\u00FE"; + }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 3){ + shopType3 = "\\u00FE"; + }else{ + shopType4 = "\\u00FE"; + shopType4Str = wxRentContract.getShopTypeStr(); + } + result.put("shopType1",shopType1); + result.put("shopType2",shopType2); + result.put("shopType3",shopType3); + result.put("shopType4",shopType4); + result.put("shopType4Str",shopType4Str); + + + result.put("price", wxRentContract.getPrice()); result.put("contractNumber", wxRentContract.getContractNumber()); @@ -2216,8 +2283,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getCashtypeContentLsit()); result.put("fitmentPledge",jsonObject.getString("fitmentPledge")); result.put("honourPledge",jsonObject.getString("honourPledge")); + result.put("honourPledgeUpper",PriceUtil.digitUppercase(Double.valueOf(jsonObject.getString("honourPledge")))); result.put("honourDuration",jsonObject.getString("honourDuration")); result.put("qualityPledge",jsonObject.getString("qualityPledge")); + result.put("honourPledgeUpper",PriceUtil.digitUppercase(Double.valueOf(jsonObject.getString("qualityPledge")))); result.put("qualityDuration",jsonObject.getString("qualityDuration")); } @@ -2237,15 +2306,23 @@ public class WxRentContractServiceImpl implements WxRentContractService { } } if(EnumRentContractType.RENT_BY_AREA.getCode().equals(type)){ + + double priceRent = new BigDecimal(wxRentContract.getPrice()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("oneRentalPrice1", priceRent); + result.put("oneRentalPriceUpper1", PriceUtil.digitUppercase(priceRent)); + + result.put("oneRentPrice",wxRentContract.getRentPrice()); + //稍后详细计算 + result.put("oneRentalQuarterPrice1", priceRent*3); + result.put("oneRentalQuarterPriceUpper1", PriceUtil.digitUppercase(priceRent*3)); + if(StringUtils.isNotBlank(incrementStartDate)){ result.put("oneRentalEndDateYear1",incrementStartDate.substring(0,4)); result.put("oneRentalEndDateMonth1",incrementStartDate.substring(5,7)); result.put("oneRentalEndDateDay1",incrementStartDate.substring(8,10)); - double priceRent = new BigDecimal(wxRentContract.getPrice()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("oneRentalPrice1", priceRent); - result.put("oneRentalPriceUpper1", PriceUtil.digitUppercase(priceRent)); + result.put("oneRentalStartDateYear2",incrementStartDate.substring(0,4)); result.put("oneRentalStartDateMonth2",incrementStartDate.substring(5,7)); @@ -2257,26 +2334,67 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("oneRentalPrice2", priceRent2); result.put("oneRentalPriceUpper2", PriceUtil.digitUppercase(priceRent2)); - - - // TODO }else{ - result.put("oneRentalStartDateYear1",incrementStartDate.substring(0,4)); - result.put("oneRentalStartDateMonth1",incrementStartDate.substring(5,7)); - result.put("oneRentalStartDateDay1",incrementStartDate.substring(8,10)); - double priceRent = new BigDecimal(wxRentContract.getPrice()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("oneRentalPrice1", priceRent); - result.put("oneRentalPriceUpper1", PriceUtil.digitUppercase(priceRent)); + String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd"); + result.put("oneRentalStartDateYear1", rentalEndDate.substring(0, 4)); + result.put("oneRentalStartDateMonth1", rentalEndDate.substring(5, 7)); + result.put("oneRentalStartDateDay1", rentalEndDate.substring(8)); } }else if(EnumRentContractType.RENT_BY_JOINT.getCode().equals(type)){ + result.put("twoPayRatio1",wxRentContract.getPayRatio()); + result.put("twoPayDate",wxRentContract.getPayDate()); + if(StringUtils.isNotBlank(incrementStartDate)){ + result.put("twoRentalEndDateYear1",incrementStartDate.substring(0,4)); + result.put("twoRentalEndDateMonth1",incrementStartDate.substring(5,7)); + result.put("twoRentalEndDateDay1",incrementStartDate.substring(8,10)); + + result.put("twoRentalStartDateYear2",incrementStartDate.substring(0,4)); + result.put("twoRentalStartDateMonth2",incrementStartDate.substring(5,7)); + result.put("twoRentalStartDateDay2",incrementStartDate.substring(8,10)); + result.put("twoRentIncreasing2",increasingProportion); + result.put("twoPayRatio2",wxRentContract.getPayRatio()+Integer.parseInt(increasingProportion)); + + }else{ + String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd"); + result.put("twoRentalStartDateYear1", rentalEndDate.substring(0, 4)); + result.put("twoRentalStartDateMonth1", rentalEndDate.substring(5, 7)); + result.put("twoRentalStartDateDay1", rentalEndDate.substring(8)); + } }else if(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode().equals(type)){ + double priceRent = new BigDecimal(wxRentContract.getPrice()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("threeRentalPrice1", priceRent); + result.put("threeRentalPriceUpper1", PriceUtil.digitUppercase(priceRent)); + + result.put("threeRentPrice",wxRentContract.getRentPrice()); + + result.put("threePayRatio1",wxRentContract.getPayRatio()); + result.put("threePayDate",wxRentContract.getPayDate()); + if(StringUtils.isNotBlank(incrementStartDate)){ + result.put("threeRentalEndDateYear1",incrementStartDate.substring(0,4)); + result.put("threeRentalEndDateMonth1",incrementStartDate.substring(5,7)); + result.put("threeRentalEndDateDay1",incrementStartDate.substring(8,10)); + + + result.put("threeRentalStartDateYear2",incrementStartDate.substring(0,4)); + result.put("threeRentalStartDateMonth2",incrementStartDate.substring(5,7)); + result.put("threeRentalStartDateDay2",incrementStartDate.substring(8,10)); + result.put("threeProgressivePay2",progressivePay); + result.put("threeProgressivePayUpper2",PriceUtil.digitUppercase(Double.parseDouble(progressivePay))); + result.put("threeRentPrice2",progressivePay); + result.put("threeRentIncreasing2",increasingProportion); + }else{ + String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd"); + result.put("threeRentalStartDateYear1", rentalEndDate.substring(0, 4)); + result.put("threeRentalStartDateMonth1", rentalEndDate.substring(5, 7)); + result.put("threeRentalStartDateDay1", rentalEndDate.substring(8)); + } } }else{ diff --git a/mallinkService/src/main/resources/contract-word-template/jinmao_contract_rent_property.docx b/mallinkService/src/main/resources/contract-word-template/jinmao_contract_rent_property.docx index 883a4173f..b44346a63 100644 Binary files a/mallinkService/src/main/resources/contract-word-template/jinmao_contract_rent_property.docx and b/mallinkService/src/main/resources/contract-word-template/jinmao_contract_rent_property.docx differ