diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index 14f0498e7..59ae952cf 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -804,19 +804,19 @@ public class WxRentContractController extends WxContractBaseController { return wxRentContractService.update(rentContract, user.getId(),user.getName(), EnumFromType.SWITCH.getCode(),oldDate,false); } - @GetMapping("exportContract") - @ApiImplicitParams({ - @ApiImplicitParam(name = "rentId", value = "rentId", dataType = "Long", paramType = "query", required = false), - @ApiImplicitParam(name = "propertyId", value = "propertyId", dataType = "String", paramType = "query", required = false)}) - @SystemControllerLog(description = "租赁合同-导出合同") - public void exportContract(Long rentId,String propertyId,HttpServletRequest request, HttpServletResponse response){ - Long pid = null; - try { - pid = Long.parseLong(propertyId); - }catch(Exception e) { - } - wxRentContractService.exportContract(request,response,rentId,pid); - } +// @GetMapping("exportContract") +// @ApiImplicitParams({ +// @ApiImplicitParam(name = "rentId", value = "rentId", dataType = "Long", paramType = "query", required = false), +// @ApiImplicitParam(name = "propertyId", value = "propertyId", dataType = "String", paramType = "query", required = false)}) +// @SystemControllerLog(description = "租赁合同-导出合同") +// public void exportContract(Long rentId,String propertyId,HttpServletRequest request, HttpServletResponse response){ +// Long pid = null; +// try { +// pid = Long.parseLong(propertyId); +// }catch(Exception e) { +// } +// wxRentContractService.exportContract(request,response,rentId,pid); +// } // @GetMapping("/getRentContractStatusInfo") diff --git a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java index 90cd171f3..6b233b507 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java @@ -68,7 +68,7 @@ public interface WxRentContractService { PageInfo getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); - void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId); + //void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId); ResultData updateFile(WxRentContract wxRentContract, Long userId,String userName,Date oldRentStartDate,boolean writeComplate); 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 647418c69..3e7c500c5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1875,37 +1875,37 @@ public class WxRentContractServiceImpl implements WxRentContractService { // return resultData; // } - @Override - public void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId) { - String contracType = "0"; - String templatePath = null; - Map result = null; - if (EnumContractType.ALL.getCode().toString().equals(contracType)) { - logger.info("获取租赁及物业合同数据"); - result = getRentAndPropertyInfo(rentId,propertyId); - result.put("contractType", EnumContractType.ALL.getMessage()); - if(EnumContractOperationType.JINMAO.getCode().equals(result.get("operationType"))){ - templatePath = "contract-word-template/jinmao_contract_rent_property.docx"; - }else{ - if (EnumRentContractType.RENT_BY_AREA.getCode().equals(result.get("type"))) { - templatePath = "contract-word-template/contract_rent_property.docx"; - } else { - templatePath = "contract-word-template/contract_rent_property_by_ratio.docx"; - } - } - - logger.info("租赁及物业合同数据结果:" + result); - } - - if (templatePath == null) { - logger.info("没有租赁及物业合同模板"); - return; - } - String filepath = fmUploadDir; - String filename = UUID.randomUUID() + ".docx"; - String exportFileName = result.get("merchantName").toString() + "合同.docx"; - WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null); - } +// @Override +// public void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId) { +// String contracType = "0"; +// String templatePath = null; +// Map result = null; +// if (EnumContractType.ALL.getCode().toString().equals(contracType)) { +// logger.info("获取租赁及物业合同数据"); +// result = getRentAndPropertyInfo(rentId,propertyId); +// result.put("contractType", EnumContractType.ALL.getMessage()); +// if(EnumContractOperationType.JINMAO.getCode().equals(result.get("operationType"))){ +// templatePath = "contract-word-template/jinmao_contract_rent_property.docx"; +// }else{ +// if (EnumRentContractType.RENT_BY_AREA.getCode().equals(result.get("type"))) { +// templatePath = "contract-word-template/contract_rent_property.docx"; +// } else { +// templatePath = "contract-word-template/contract_rent_property_by_ratio.docx"; +// } +// } +// +// logger.info("租赁及物业合同数据结果:" + result); +// } +// +// if (templatePath == null) { +// logger.info("没有租赁及物业合同模板"); +// return; +// } +// String filepath = fmUploadDir; +// String filename = UUID.randomUUID() + ".docx"; +// String exportFileName = result.get("merchantName").toString() + "合同.docx"; +// WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null); +// } @Override @Transactional(rollbackFor = {Exception.class}) @@ -2001,692 +2001,693 @@ public class WxRentContractServiceImpl implements WxRentContractService { } } - public Map getRentAndPropertyInfo(Long rentId,Long propertyId) { - logger.info("获取租赁物业合同数据>>>>>>rentId:" + rentId +" >>>>propertyId:"+propertyId); - Map result = new HashMap<>(); - WxRentContract wxRentContract = wxRentContractMapper.selectById(rentId); - - result.put("operationType", wxRentContract.getOperationType()); - if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { - JSONArray jsonArray = JSONArray.parseArray(wxRentContract.getRentInfo()); - StringBuffer shopNumberStr = new StringBuffer(); - StringBuffer floorNameStr = new StringBuffer(); - StringBuffer buildingNameStr = new StringBuffer(); - StringBuffer buildAreaStr = new StringBuffer(); - StringBuffer operationAreaStr = new StringBuffer(); - for (int i = 0, size = jsonArray.size(); i < size; i++) { - JSONObject jsonObject = jsonArray.getJSONObject(i); - shopNumberStr.append("[").append(jsonObject.getString("shopNumber")).append("]"); - floorNameStr.append("[").append(jsonObject.getString("floorName")).append("]"); - buildingNameStr.append("[").append(jsonObject.getString("buildingName")).append("]"); - buildAreaStr.append("[").append(jsonObject.getString("buildArea")).append("]"); - operationAreaStr.append("[").append(jsonObject.getString("operationArea")).append("]"); - } - result.put("shopNumber", shopNumberStr); - result.put("floorName", floorNameStr); - result.put("buildingName", buildingNameStr); - result.put("buildArea", buildAreaStr); - result.put("operationArea", operationAreaStr); - } else { - //record.setId(wxRentContract.getShopId()); - if (wxRentContract.shopIdsByRentInfo().size() == 0) { - result.put("shopNumber", " "); - result.put("floorName", " "); - result.put("buildingName", " "); - result.put("buildArea", " "); - result.put("operationArea", " "); - }else { - WxShop record = new WxShop(); - record.setIds(wxRentContract.shopIdsByRentInfo()); - record.updateTenantInfo(wxRentContract); - PageInfo> shopPageInfo = wxShopService.findListMap(record,1,10000); - List> wxShops = shopPageInfo.getList(); - if (!wxShops.isEmpty()) { - //店铺信息 - Map wxShop = wxShops.get(0); - result.put("shopNumber", wxShop.get("shopNumber")); - result.put("floorName", wxShop.get("floor")); - result.put("buildingName", wxShop.get("building")); - result.put("buildArea", wxShop.get("buildArea")); - result.put("operationArea", wxShop.get("operationArea")); - } - } - } - //MALL信息 - WxMall wxMall = new WxMall(); - wxMall.setTenantInfo(wxRentContract); - wxMall = wxMallService.findList(wxMall).get(0); - result.put("mallName", wxMall.getName()); - result.put("province", wxMall.getProvince()); - result.put("city", wxMall.getCity()); - result.put("mallAddr", wxMall.getAddr()); - result.put("mallServicePhone", wxMall.getServicePhone()); - - //商户信息 - WxMerchant merchant = wxMerchantService.getById(wxRentContract.getMerchantId()); - //经营业态 - wxRentContract.getMerchantId(); - WxBusiness wxBusiness = wxBusinessMapper.selectById(merchant.getFinalTenantId(),merchant.getBusinessId()); - result.put("business", wxBusiness.getTitle()); - - if (merchant != null) { - result.put("merchantName", merchant.getName()); - //法人信息 - WxMerchantCorp wxMerchantCorp = merchant.getWxMerchantCorp(); - result.put("corpPapersNumber", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersNumber()) ? wxMerchantCorp.getCorpPapersNumber() : " "); - result.put("corpPapersType", wxMerchantCorp.getCorpPapersType() != null ? EnumPapersType.getEnum(wxMerchantCorp.getCorpPapersType()).getMessage() : " "); - result.put("corpPapersPerson", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersPerson()) ? wxMerchantCorp.getCorpPapersPerson() : " "); - //税务信息 - WxMerchantTax wxMerchantTax = merchant.getWxMerchantTax(); - result.put("taxPapersType", wxMerchantTax.getTaxPapersType() != null ? EnumTaxpayerType.getEnum(wxMerchantTax.getTaxPapersType()).getMessage() : " "); - result.put("bankName", StringUtils.isNotEmpty(wxMerchantTax.getBankName()) ? wxMerchantTax.getBankName() : " "); - result.put("bankAccount", StringUtils.isNotEmpty(wxMerchantTax.getBankAccount()) ? wxMerchantTax.getBankAccount() : " "); - result.put("invoiceAddressPhone", StringUtils.isNotEmpty(wxMerchantTax.getInvoiceAddressPhone()) ? wxMerchantTax.getInvoiceAddressPhone() : " "); - } else { - result.put("merchantName", ""); - //法人信息 - result.put("corpPapersNumber", " "); - result.put("corpPapersType", " "); - result.put("corpPapersPerson", " "); - //税务信息 - result.put("taxPapersType", " "); - result.put("bankName", " "); - 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("beginStart")) && !("-1").equals(jsonObject.getString("beginEnd")) - && !("-1").equals(jsonObject.getString("finishStart")) && !("-1").equals(jsonObject.getString("finishEnd"))){ - result.put("businessStart",jsonObject.getString("beginStart")+":"+jsonObject.getString("beginEnd")); - result.put("businessEnd",jsonObject.getString("finishStart")+":"+jsonObject.getString("finishEnd")); - } - } - //甲方信息 - if(StringUtils.isNotBlank(wxRentContract.getFirstPartyBankInfo())){ - //{"bankNameA": "", "accountNumA": "", "accountNameA": "", "socialCreditCodeA": ""} - JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getFirstPartyBankInfo()); - result.put("bankNameA",jsonObject.getString("bankNameA")); - result.put("accountNumA",jsonObject.getString("accountNumA")); - result.put("accountNameA",jsonObject.getString("accountNameA")); - result.put("socialCreditCodeA",jsonObject.getString("socialCreditCodeA")); - }else{ - result.put("bankNameA",""); - result.put("accountNumA",""); - result.put("accountNameA",""); - result.put("socialCreditCodeA",""); - } - //乙方信息 - result.put("scopeMetre",wxRentContract.getScopeMetre()); - result.put("shopTypeSub",wxRentContract.getShopTypeSub()); - result.put("leasePurpose",wxRentContract.getLeasePurpose()); - result.put("linkPhoneB",wxRentContract.getLinkPhone()); - result.put("linkAddressB",wxRentContract.getLinkAddress()); - if(StringUtils.isNotBlank(wxRentContract.getSecondPartyBankInfo())){ - //{"bankName": "", "payAccount": "", "accountName": "", "socialCreditCode": ""} - JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getSecondPartyBankInfo()); - result.put("bankNameB",jsonObject.getString("bankName")); - result.put("accountNumB",jsonObject.getString("payAccount")); - result.put("accountNameB",jsonObject.getString("accountName")); - result.put("socialCreditCodeB",jsonObject.getString("socialCreditCode")); - }else{ - result.put("bankNameB",""); - result.put("accountNumB",""); - result.put("accountNameB",""); - result.put("socialCreditCodeB",""); - } - //乙方税务信息 - if(StringUtils.isNotBlank(wxRentContract.getSecondPartyTaxInfo())){ - //{"bankName": "", "linkPhone": "", "payAccount": "", "accountName": "", "taxpayerAdress": "", "taxpayerNumber": ""} - JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getSecondPartyTaxInfo()); - result.put("bankNameBTax",jsonObject.getString("bankName")); - result.put("accountNumBTax",jsonObject.getString("payAccount")); - result.put("accountNameBTax",jsonObject.getString("accountName")); - result.put("linkPhoneBTax",jsonObject.getString("linkPhone")); - result.put("taxpayerAdressB",jsonObject.getString("taxpayerAdress")); - result.put("taxpayerNumberB",jsonObject.getString("taxpayerNumber")); - }else{ - result.put("bankNameBTax",""); - result.put("accountNumBTax",""); - result.put("accountNameBTax",""); - result.put("linkPhoneBTax",""); - result.put("taxpayerAdressB",""); - 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); - } - - - - //交付 - if(wxRentContract.getDeliveryDate() != null){ - String deliveryDate = DateUtils.date2String(wxRentContract.getDeliveryDate(), "yyyy-MM-dd"); - result.put("deliveryDateYear", deliveryDate.substring(0, 4)); - result.put("deliveryDateMonth", deliveryDate.substring(5, 7)); - result.put("deliveryDateDay", deliveryDate.substring(8)); - result.put("deliveryGracePeriod", wxRentContract.getDeliveryGracePeriod()); - } - - - //装修 - if(wxRentContract.getFixStartDate() != null && wxRentContract.getFixEndDate() != null){ - String fixStartDate = DateUtils.date2String(wxRentContract.getFixStartDate(), "yyyy-MM-dd"); - result.put("fixStartDateYear", fixStartDate.substring(0, 4)); - result.put("fixStartDateMonth", fixStartDate.substring(5, 7)); - result.put("fixStartDateDay", fixStartDate.substring(8)); - String fixEndDate = DateUtils.date2String(wxRentContract.getFixEndDate(), "yyyy-MM-dd"); - result.put("fixEndDateYear", fixEndDate.substring(0, 4)); - result.put("fixEndDateMonth", fixEndDate.substring(5, 7)); - result.put("fixEndDateDay", fixEndDate.substring(8)); - } - - //开业 - if(wxRentContract.getOpeningDate() != null){ - String openingDate = DateUtils.date2String(wxRentContract.getOpeningDate(), "yyyy-MM-dd"); - result.put("openingDateYear", openingDate.substring(0, 4)); - result.put("openingDateMonth", openingDate.substring(5, 7)); - result.put("openingDateDay", openingDate.substring(8)); - } - - //计租 - if(wxRentContract.getStartDate() != null && wxRentContract.getRentalEndDate() != null){ - String rentalStartDate = DateUtils.date2String(wxRentContract.getStartDate(), "yyyy-MM-dd"); - result.put("rentalStartDate", rentalStartDate); - result.put("rentalStartDateYear", rentalStartDate.substring(0, 4)); - result.put("rentalStartDateMonth", rentalStartDate.substring(5, 7)); - result.put("rentalStartDateDay", rentalStartDate.substring(8)); - String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd"); - result.put("rentalEndDate", rentalEndDate); - result.put("rentalEndDateYear", rentalEndDate.substring(0, 4)); - result.put("rentalEndDateMonth", rentalEndDate.substring(5, 7)); - result.put("rentalEndDateDay", rentalEndDate.substring(8)); - } - //免租 - if(wxRentContract.getStartDate() != null && wxRentContract.getRentalStartDate()!=null - && !DateUtils.isSameDate(wxRentContract.getStartDate(),wxRentContract.getRentalStartDate())){ - String reductionStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); - result.put("reductionStartDateYear", reductionStartDate.substring(0, 4)); - result.put("reductionStartDateMonth", reductionStartDate.substring(5, 7)); - result.put("reductionStartDateDay", reductionStartDate.substring(8)); -// String reductionEndDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); - String reductionEndDate = DateUtils.getTimeBefore(1,wxRentContract.getStartDate()); - result.put("reductionEndDateYear", reductionEndDate.substring(0, 4)); - result.put("reductionEndDateMonth", reductionEndDate.substring(5, 7)); - result.put("reductionEndDateDay", reductionEndDate.substring(8)); - }else{ - result.put("reductionStartDateYear", "/"); - result.put("reductionStartDateMonth", "/"); - result.put("reductionStartDateDay", "/"); - result.put("reductionEndDateYear", "/"); - result.put("reductionEndDateMonth", "/"); - result.put("reductionEndDateDay", "/"); - } - - String shopType4Str = ""; - if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 1){ - shopType4Str = "直营"; - }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 6){ - shopType4Str = "代理"; - }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 2){ - shopType4Str = "加盟"; - }else{ - shopType4Str = "其他("+wxRentContract.getShopTypeStr()+")"; - } - result.put("shopType4Str",shopType4Str); - - - - - result.put("price", wxRentContract.getPrice()); - result.put("contractNumber", wxRentContract.getContractNumber()); - Integer lease = wxRentContract.getLease(); - Integer receivePeriod = wxRentContract.getReceivePeriod(); - result.put("lease", lease); - result.put("receivePeriod", receivePeriod); - String payAccountStr = " "; - if(wxRentContract.getPayAccount() != null && !wxRentContract.getPayAccount().equals("")) { - payAccountStr = wxRentContract.getPayAccount(); - } - result.put("payAccount", payAccountStr); - result.put("signDate", DateUtils.date2String(wxRentContract.getSignDate(), "yyyy-MM-dd")); - //主体名称-乙方 - if (StringUtils.isNotEmpty(wxRentContract.getSubjectName())) { - result.put("subjectName", wxRentContract.getSubjectName()); - } else { - result.put("subjectName", " "); - } - - //品牌 - Long brandId = wxRentContract.getBrand(); - String brand = " "; - if (brandId != null) { - WxBrand wxBrand = WxBrandMapper.selectById(brandId); - if (wxBrand != null) { - brand = wxBrand.getName(); - } - } - result.put("brand", brand); - Integer type = wxRentContract.getType(); - result.put("type", type); - - if(EnumContractOperationType.JINMAO.getCode().equals(wxRentContract.getOperationType())){ - if(StringUtils.isNotBlank(wxRentContract.getCashtypeContentLsit())){ - //{"honourPledge": "", "fitmentPledge": "", "qualityPledge": "", "honourDuration": "", "qualityDuration": ""} - //fitmentPledge:"",//装修押金 - //honourPledge:"",//履约保证金 - //honourDuration:"",//履约保证金时限 - //qualityPledge:"",//品质保证金 - //qualityDuration:"",//品质保证金时限 - JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getCashtypeContentLsit()); - result.put("fitmentPledge",jsonObject.getString("fitmentPledge")); - result.put("honourPledge",jsonObject.getString("honourPledge")); - if(StringUtils.isNotBlank(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")); - if(StringUtils.isNotBlank(jsonObject.getString("qualityPledge"))){ - result.put("honourPledgeUpper",PriceUtil.digitUppercase(Double.valueOf(jsonObject.getString("qualityPledge")))); - } - result.put("qualityDuration",jsonObject.getString("qualityDuration")); - - } - //[{"progressivePay": "", "tempAdjustRatio": "2021-11-30 00:00:00", "incrementStartDate": "2021-11-29T16:00:00.000Z", "increasingProportion": "1.78"}] - //increasingProportion//租金递增比例 - //progressivePay//递增租赁单价 - List> ratioList = new ArrayList<>(); - if(StringUtils.isNotBlank(wxRentContract.getAdjustRatio())){ - JSONArray array = JSONArray.parseArray(wxRentContract.getAdjustRatio()); - if(array != null && array.size() > 0){ - for(int i=0;i ratioMap = new HashMap<>(); - String afterYear = DateUtils.getAfterYear(wxRentContract.getStartDate(), i + 1); - String beforeAfterYear = DateUtils.getTimeBefore(1, afterYear); - ratioMap.put("incrementStartDate",afterYear); - ratioMap.put("beforeOneIncrementStartDate",beforeAfterYear); - ratioMap.put("increasingProportion",jsonObject.getString("increasingProportion")); - ratioMap.put("progressivePay",jsonObject.getString("progressivePay")); - ratioList.add(ratioMap); - } - } - } - } - result.put("countRatioList",ratioList.size()); - - 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)); - - double oneRentPrice = new BigDecimal(wxRentContract.getRentPrice()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("oneRentPrice",oneRentPrice); - - WxBillRent wxBillRent = new WxBillRent(); - wxBillRent.setRentContractId(wxRentContract.getId()); - wxBillRent.setSortColumns(BaseEntity.SortField.Period_ASC); - List resultList = wxBillRentMapper.findList(wxBillRent); - //稍后详细计算(查询首期账单用于显示) - if(resultList != null && resultList.size() > 0){ - double oneRentalQuarterPrice1 = new BigDecimal(resultList.get(0).getReceivePay()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("oneRentalQuarterPrice1", oneRentalQuarterPrice1); - result.put("oneRentalQuarterPriceUpper1", PriceUtil.digitUppercase(oneRentalQuarterPrice1)); - } - - if(ratioList.size() > 0){ - String beforeOneIncrementStartDate = ratioList.get(0).get("beforeOneIncrementStartDate"); - result.put("oneRentalEndDateYear1",beforeOneIncrementStartDate.substring(0,4)); - result.put("oneRentalEndDateMonth1",beforeOneIncrementStartDate.substring(5,7)); - result.put("oneRentalEndDateDay1",beforeOneIncrementStartDate.substring(8,10)); - - String incrementStartDate = ratioList.get(0).get("incrementStartDate"); - result.put("oneRentalStartDateYear2",incrementStartDate.substring(0,4)); - result.put("oneRentalStartDateMonth2",incrementStartDate.substring(5,7)); - result.put("oneRentalStartDateDay2",incrementStartDate.substring(8,10)); - String increasingProportion = ratioList.get(0).get("increasingProportion"); - result.put("oneRentIncreasing2",increasingProportion); - double priceRent2 = new BigDecimal(priceRent) - .multiply(new BigDecimal(1).add(new BigDecimal(increasingProportion).divide(new BigDecimal(100)))) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("oneRentalPrice2", priceRent2); - result.put("oneRentalPriceUpper2", PriceUtil.digitUppercase(priceRent2)); - - if(ratioList.size() > 1){ - for (int i = 1;i < ratioList.size();i++){ - int n = i+2; - String incrementStartDaten = ratioList.get(i).get("incrementStartDate"); - result.put("oneRentalStartDateYear"+n,incrementStartDaten.substring(0,4)); - result.put("oneRentalStartDateMonth"+n,incrementStartDaten.substring(5,7)); - result.put("oneRentalStartDateDay"+n,incrementStartDaten.substring(8,10)); - String increasingProportionn = ratioList.get(i).get("increasingProportion"); - result.put("oneRentIncreasing"+n,increasingProportionn); - priceRent2 = new BigDecimal(priceRent2) - .multiply(new BigDecimal(1).add(new BigDecimal(increasingProportionn).divide(new BigDecimal(100)))) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("oneRentalPrice"+n, priceRent2); - result.put("oneRentalPriceUpper"+n, PriceUtil.digitUppercase(priceRent2)); - } - } - - }else{ - 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)){ - Double twoPayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("twoPayRatio1",twoPayRatio1); - result.put("twoPayDate",wxRentContract.getPayDate()); - if(ratioList.size() > 0){ - String beforeOneIncrementStartDate = ratioList.get(0).get("beforeOneIncrementStartDate"); - result.put("twoRentalEndDateYear1",beforeOneIncrementStartDate.substring(0,4)); - result.put("twoRentalEndDateMonth1",beforeOneIncrementStartDate.substring(5,7)); - result.put("twoRentalEndDateDay1",beforeOneIncrementStartDate.substring(8,10)); - String incrementStartDate = ratioList.get(0).get("incrementStartDate"); - result.put("twoRentalStartDateYear2",incrementStartDate.substring(0,4)); - result.put("twoRentalStartDateMonth2",incrementStartDate.substring(5,7)); - result.put("twoRentalStartDateDay2",incrementStartDate.substring(8,10)); - String increasingProportion = ratioList.get(0).get("increasingProportion"); - result.put("twoRentIncreasing2",increasingProportion); -// Double twoPayRatio2 = new BigDecimal(twoPayRatio1) -// .add(new BigDecimal(increasingProportion)) +// public Map getRentAndPropertyInfo(Long rentId,Long propertyId) { +// logger.info("获取租赁物业合同数据>>>>>>rentId:" + rentId +" >>>>propertyId:"+propertyId); +// Map result = new HashMap<>(); +// WxRentContract wxRentContract = wxRentContractMapper.selectById(rentId); +// +// result.put("operationType", wxRentContract.getOperationType()); +// if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { +// JSONArray jsonArray = JSONArray.parseArray(wxRentContract.getRentInfo()); +// StringBuffer shopNumberStr = new StringBuffer(); +// StringBuffer floorNameStr = new StringBuffer(); +// StringBuffer buildingNameStr = new StringBuffer(); +// StringBuffer buildAreaStr = new StringBuffer(); +// StringBuffer operationAreaStr = new StringBuffer(); +// for (int i = 0, size = jsonArray.size(); i < size; i++) { +// JSONObject jsonObject = jsonArray.getJSONObject(i); +// shopNumberStr.append("[").append(jsonObject.getString("shopNumber")).append("]"); +// floorNameStr.append("[").append(jsonObject.getString("floorName")).append("]"); +// buildingNameStr.append("[").append(jsonObject.getString("buildingName")).append("]"); +// buildAreaStr.append("[").append(jsonObject.getString("buildArea")).append("]"); +// operationAreaStr.append("[").append(jsonObject.getString("operationArea")).append("]"); +// } +// result.put("shopNumber", shopNumberStr); +// result.put("floorName", floorNameStr); +// result.put("buildingName", buildingNameStr); +// result.put("buildArea", buildAreaStr); +// result.put("operationArea", operationAreaStr); +// } else { +// //record.setId(wxRentContract.getShopId()); +// if (wxRentContract.shopIdsByRentInfo().size() == 0) { +// result.put("shopNumber", " "); +// result.put("floorName", " "); +// result.put("buildingName", " "); +// result.put("buildArea", " "); +// result.put("operationArea", " "); +// }else { +// WxShop record = new WxShop(); +// record.setIds(wxRentContract.shopIdsByRentInfo()); +// record.updateTenantInfo(wxRentContract); +// PageInfo> shopPageInfo = wxShopService.findListMap(record,1,10000); +// List> wxShops = shopPageInfo.getList(); +// if (!wxShops.isEmpty()) { +// //店铺信息 +// Map wxShop = wxShops.get(0); +// result.put("shopNumber", wxShop.get("shopNumber")); +// result.put("floorName", wxShop.get("floor")); +// result.put("buildingName", wxShop.get("building")); +// result.put("buildArea", wxShop.get("buildArea")); +// result.put("operationArea", wxShop.get("operationArea")); +// } +// } +// } +// //MALL信息 +// WxMall wxMall = new WxMall(); +// wxMall.setTenantInfo(wxRentContract); +// wxMall = wxMallService.findList(wxMall).get(0); +// result.put("mallName", wxMall.getName()); +// result.put("province", wxMall.getProvince()); +// result.put("city", wxMall.getCity()); +// result.put("mallAddr", wxMall.getAddr()); +// result.put("mallServicePhone", wxMall.getServicePhone()); +// +// //商户信息 +// WxMerchant merchant = wxMerchantService.getById(wxRentContract.getMerchantId()); +// //经营业态 +// wxRentContract.getMerchantId(); +// WxBusiness wxBusiness = wxBusinessMapper.selectById(merchant.getFinalTenantId(),merchant.getBusinessId()); +// result.put("business", wxBusiness.getTitle()); +// +// if (merchant != null) { +// result.put("merchantName", merchant.getName()); +// //法人信息 +// WxMerchantCorp wxMerchantCorp = merchant.getWxMerchantCorp(); +// result.put("corpPapersNumber", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersNumber()) ? wxMerchantCorp.getCorpPapersNumber() : " "); +// result.put("corpPapersType", wxMerchantCorp.getCorpPapersType() != null ? EnumPapersType.getEnum(wxMerchantCorp.getCorpPapersType()).getMessage() : " "); +// result.put("corpPapersPerson", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersPerson()) ? wxMerchantCorp.getCorpPapersPerson() : " "); +// //税务信息 +// WxMerchantTax wxMerchantTax = merchant.getWxMerchantTax(); +// result.put("taxPapersType", wxMerchantTax.getTaxPapersType() != null ? EnumTaxpayerType.getEnum(wxMerchantTax.getTaxPapersType()).getMessage() : " "); +// result.put("bankName", StringUtils.isNotEmpty(wxMerchantTax.getBankName()) ? wxMerchantTax.getBankName() : " "); +// result.put("bankAccount", StringUtils.isNotEmpty(wxMerchantTax.getBankAccount()) ? wxMerchantTax.getBankAccount() : " "); +// result.put("invoiceAddressPhone", StringUtils.isNotEmpty(wxMerchantTax.getInvoiceAddressPhone()) ? wxMerchantTax.getInvoiceAddressPhone() : " "); +// } else { +// result.put("merchantName", ""); +// //法人信息 +// result.put("corpPapersNumber", " "); +// result.put("corpPapersType", " "); +// result.put("corpPapersPerson", " "); +// //税务信息 +// result.put("taxPapersType", " "); +// result.put("bankName", " "); +// 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("beginStart")) && !("-1").equals(jsonObject.getString("beginEnd")) +// && !("-1").equals(jsonObject.getString("finishStart")) && !("-1").equals(jsonObject.getString("finishEnd"))){ +// result.put("businessStart",jsonObject.getString("beginStart")+":"+jsonObject.getString("beginEnd")); +// result.put("businessEnd",jsonObject.getString("finishStart")+":"+jsonObject.getString("finishEnd")); +// } +// } +// //甲方信息 +// if(StringUtils.isNotBlank(wxRentContract.getFirstPartyBankInfo())){ +// //{"bankNameA": "", "accountNumA": "", "accountNameA": "", "socialCreditCodeA": ""} +// JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getFirstPartyBankInfo()); +// result.put("bankNameA",jsonObject.getString("bankNameA")); +// result.put("accountNumA",jsonObject.getString("accountNumA")); +// result.put("accountNameA",jsonObject.getString("accountNameA")); +// result.put("socialCreditCodeA",jsonObject.getString("socialCreditCodeA")); +// }else{ +// result.put("bankNameA",""); +// result.put("accountNumA",""); +// result.put("accountNameA",""); +// result.put("socialCreditCodeA",""); +// } +// //乙方信息 +// result.put("scopeMetre",wxRentContract.getScopeMetre()); +// result.put("shopTypeSub",wxRentContract.getShopTypeSub()); +// result.put("leasePurpose",wxRentContract.getLeasePurpose()); +// result.put("linkPhoneB",wxRentContract.getLinkPhone()); +// result.put("linkAddressB",wxRentContract.getLinkAddress()); +// if(StringUtils.isNotBlank(wxRentContract.getSecondPartyBankInfo())){ +// //{"bankName": "", "payAccount": "", "accountName": "", "socialCreditCode": ""} +// JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getSecondPartyBankInfo()); +// result.put("bankNameB",jsonObject.getString("bankName")); +// result.put("accountNumB",jsonObject.getString("payAccount")); +// result.put("accountNameB",jsonObject.getString("accountName")); +// result.put("socialCreditCodeB",jsonObject.getString("socialCreditCode")); +// }else{ +// result.put("bankNameB",""); +// result.put("accountNumB",""); +// result.put("accountNameB",""); +// result.put("socialCreditCodeB",""); +// } +// //乙方税务信息 +// if(StringUtils.isNotBlank(wxRentContract.getSecondPartyTaxInfo())){ +// //{"bankName": "", "linkPhone": "", "payAccount": "", "accountName": "", "taxpayerAdress": "", "taxpayerNumber": ""} +// JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getSecondPartyTaxInfo()); +// result.put("bankNameBTax",jsonObject.getString("bankName")); +// result.put("accountNumBTax",jsonObject.getString("payAccount")); +// result.put("accountNameBTax",jsonObject.getString("accountName")); +// result.put("linkPhoneBTax",jsonObject.getString("linkPhone")); +// result.put("taxpayerAdressB",jsonObject.getString("taxpayerAdress")); +// result.put("taxpayerNumberB",jsonObject.getString("taxpayerNumber")); +// }else{ +// result.put("bankNameBTax",""); +// result.put("accountNumBTax",""); +// result.put("accountNameBTax",""); +// result.put("linkPhoneBTax",""); +// result.put("taxpayerAdressB",""); +// 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); +// } +// +// +// +// //交付 +// if(wxRentContract.getDeliveryDate() != null){ +// String deliveryDate = DateUtils.date2String(wxRentContract.getDeliveryDate(), "yyyy-MM-dd"); +// result.put("deliveryDateYear", deliveryDate.substring(0, 4)); +// result.put("deliveryDateMonth", deliveryDate.substring(5, 7)); +// result.put("deliveryDateDay", deliveryDate.substring(8)); +// result.put("deliveryGracePeriod", wxRentContract.getDeliveryGracePeriod()); +// } +// +// +// //装修 +// if(wxRentContract.getFixStartDate() != null && wxRentContract.getFixEndDate() != null){ +// String fixStartDate = DateUtils.date2String(wxRentContract.getFixStartDate(), "yyyy-MM-dd"); +// result.put("fixStartDateYear", fixStartDate.substring(0, 4)); +// result.put("fixStartDateMonth", fixStartDate.substring(5, 7)); +// result.put("fixStartDateDay", fixStartDate.substring(8)); +// String fixEndDate = DateUtils.date2String(wxRentContract.getFixEndDate(), "yyyy-MM-dd"); +// result.put("fixEndDateYear", fixEndDate.substring(0, 4)); +// result.put("fixEndDateMonth", fixEndDate.substring(5, 7)); +// result.put("fixEndDateDay", fixEndDate.substring(8)); +// } +// +// //开业 +// if(wxRentContract.getOpeningDate() != null){ +// String openingDate = DateUtils.date2String(wxRentContract.getOpeningDate(), "yyyy-MM-dd"); +// result.put("openingDateYear", openingDate.substring(0, 4)); +// result.put("openingDateMonth", openingDate.substring(5, 7)); +// result.put("openingDateDay", openingDate.substring(8)); +// } +// +// //计租 +// if(wxRentContract.getStartDate() != null && wxRentContract.getRentalEndDate() != null){ +// String rentalStartDate = DateUtils.date2String(wxRentContract.getStartDate(), "yyyy-MM-dd"); +// result.put("rentalStartDate", rentalStartDate); +// result.put("rentalStartDateYear", rentalStartDate.substring(0, 4)); +// result.put("rentalStartDateMonth", rentalStartDate.substring(5, 7)); +// result.put("rentalStartDateDay", rentalStartDate.substring(8)); +// String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd"); +// result.put("rentalEndDate", rentalEndDate); +// result.put("rentalEndDateYear", rentalEndDate.substring(0, 4)); +// result.put("rentalEndDateMonth", rentalEndDate.substring(5, 7)); +// result.put("rentalEndDateDay", rentalEndDate.substring(8)); +// } +// //免租 +// if(wxRentContract.getStartDate() != null && wxRentContract.getRentalStartDate()!=null +// && !DateUtils.isSameDate(wxRentContract.getStartDate(),wxRentContract.getRentalStartDate())){ +// String reductionStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); +// result.put("reductionStartDateYear", reductionStartDate.substring(0, 4)); +// result.put("reductionStartDateMonth", reductionStartDate.substring(5, 7)); +// result.put("reductionStartDateDay", reductionStartDate.substring(8)); +//// String reductionEndDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); +// String reductionEndDate = DateUtils.getTimeBefore(1,wxRentContract.getStartDate()); +// result.put("reductionEndDateYear", reductionEndDate.substring(0, 4)); +// result.put("reductionEndDateMonth", reductionEndDate.substring(5, 7)); +// result.put("reductionEndDateDay", reductionEndDate.substring(8)); +// }else{ +// result.put("reductionStartDateYear", "/"); +// result.put("reductionStartDateMonth", "/"); +// result.put("reductionStartDateDay", "/"); +// result.put("reductionEndDateYear", "/"); +// result.put("reductionEndDateMonth", "/"); +// result.put("reductionEndDateDay", "/"); +// } +// +// String shopType4Str = ""; +// if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 1){ +// shopType4Str = "直营"; +// }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 6){ +// shopType4Str = "代理"; +// }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 2){ +// shopType4Str = "加盟"; +// }else{ +// shopType4Str = "其他("+wxRentContract.getShopTypeStr()+")"; +// } +// result.put("shopType4Str",shopType4Str); +// +// +// +// +// result.put("price", wxRentContract.getPrice()); +// result.put("contractNumber", wxRentContract.getContractNumber()); +// Integer lease = wxRentContract.getLease(); +// Integer receivePeriod = wxRentContract.getReceivePeriod(); +// result.put("lease", lease); +// result.put("receivePeriod", receivePeriod); +// String payAccountStr = " "; +// if(wxRentContract.getPayAccount() != null && !wxRentContract.getPayAccount().equals("")) { +// payAccountStr = wxRentContract.getPayAccount(); +// } +// result.put("payAccount", payAccountStr); +// result.put("signDate", DateUtils.date2String(wxRentContract.getSignDate(), "yyyy-MM-dd")); +// //主体名称-乙方 +// if (StringUtils.isNotEmpty(wxRentContract.getSubjectName())) { +// result.put("subjectName", wxRentContract.getSubjectName()); +// } else { +// result.put("subjectName", " "); +// } +// +// //品牌 +// Long brandId = wxRentContract.getBrand(); +// String brand = " "; +// if (brandId != null) { +// WxBrand wxBrand = WxBrandMapper.selectById(brandId); +// if (wxBrand != null) { +// brand = wxBrand.getName(); +// } +// } +// result.put("brand", brand); +// Integer type = wxRentContract.getType(); +// result.put("type", type); +// +// if(EnumContractOperationType.JINMAO.getCode().equals(wxRentContract.getOperationType())){ +// if(StringUtils.isNotBlank(wxRentContract.getCashtypeContentLsit())){ +// //{"honourPledge": "", "fitmentPledge": "", "qualityPledge": "", "honourDuration": "", "qualityDuration": ""} +// //fitmentPledge:"",//装修押金 +// //honourPledge:"",//履约保证金 +// //honourDuration:"",//履约保证金时限 +// //qualityPledge:"",//品质保证金 +// //qualityDuration:"",//品质保证金时限 +// JSONObject jsonObject = JSONObject.parseObject(wxRentContract.getCashtypeContentLsit()); +// result.put("fitmentPledge",jsonObject.getString("fitmentPledge")); +// result.put("honourPledge",jsonObject.getString("honourPledge")); +// if(StringUtils.isNotBlank(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")); +// if(StringUtils.isNotBlank(jsonObject.getString("qualityPledge"))){ +// result.put("honourPledgeUpper",PriceUtil.digitUppercase(Double.valueOf(jsonObject.getString("qualityPledge")))); +// } +// result.put("qualityDuration",jsonObject.getString("qualityDuration")); +// +// } +// //[{"progressivePay": "", "tempAdjustRatio": "2021-11-30 00:00:00", "incrementStartDate": "2021-11-29T16:00:00.000Z", "increasingProportion": "1.78"}] +// //increasingProportion//租金递增比例 +// //progressivePay//递增租赁单价 +// List> ratioList = new ArrayList<>(); +// if(StringUtils.isNotBlank(wxRentContract.getAdjustRatio())){ +// JSONArray array = JSONArray.parseArray(wxRentContract.getAdjustRatio()); +// if(array != null && array.size() > 0){ +// for(int i=0;i ratioMap = new HashMap<>(); +// String afterYear = DateUtils.getAfterYear(wxRentContract.getStartDate(), i + 1); +// String beforeAfterYear = DateUtils.getTimeBefore(1, afterYear); +// ratioMap.put("incrementStartDate",afterYear); +// ratioMap.put("beforeOneIncrementStartDate",beforeAfterYear); +// ratioMap.put("increasingProportion",jsonObject.getString("increasingProportion")); +// ratioMap.put("progressivePay",jsonObject.getString("progressivePay")); +// ratioList.add(ratioMap); +// } +// } +// } +// } +// result.put("countRatioList",ratioList.size()); +// +// 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)); +// +// double oneRentPrice = new BigDecimal(wxRentContract.getRentPrice()) +// .divide(new BigDecimal(100)) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("oneRentPrice",oneRentPrice); +// +// WxBillRent wxBillRent = new WxBillRent(); +// wxBillRent.setRentContractId(wxRentContract.getId()); +// wxBillRent.setSortColumns(BaseEntity.SortField.Period_ASC); +// List resultList = wxBillRentMapper.findList(wxBillRent); +// //稍后详细计算(查询首期账单用于显示) +// if(resultList != null && resultList.size() > 0){ +// double oneRentalQuarterPrice1 = new BigDecimal(resultList.get(0).getReceivePay()) +// .divide(new BigDecimal(100)) // .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("twoPayRatio2",twoPayRatio1); - - if(ratioList.size() > 1){ - for (int i = 1;i < ratioList.size();i++){ - int n = i+2; - String incrementStartDaten = ratioList.get(i).get("incrementStartDate"); - result.put("twoRentalStartDateYear"+n,incrementStartDaten.substring(0,4)); - result.put("twoRentalStartDateMonth"+n,incrementStartDaten.substring(5,7)); - result.put("twoRentalStartDateDay"+n,incrementStartDaten.substring(8,10)); - String increasingProportionn = ratioList.get(i).get("increasingProportion"); - result.put("twoRentIncreasing"+n,increasingProportionn); -// Double twoPayRatio2 = new BigDecimal(twoPayRatio1) -// .add(new BigDecimal(increasingProportion)) +// result.put("oneRentalQuarterPrice1", oneRentalQuarterPrice1); +// result.put("oneRentalQuarterPriceUpper1", PriceUtil.digitUppercase(oneRentalQuarterPrice1)); +// } +// +// if(ratioList.size() > 0){ +// String beforeOneIncrementStartDate = ratioList.get(0).get("beforeOneIncrementStartDate"); +// result.put("oneRentalEndDateYear1",beforeOneIncrementStartDate.substring(0,4)); +// result.put("oneRentalEndDateMonth1",beforeOneIncrementStartDate.substring(5,7)); +// result.put("oneRentalEndDateDay1",beforeOneIncrementStartDate.substring(8,10)); +// +// String incrementStartDate = ratioList.get(0).get("incrementStartDate"); +// result.put("oneRentalStartDateYear2",incrementStartDate.substring(0,4)); +// result.put("oneRentalStartDateMonth2",incrementStartDate.substring(5,7)); +// result.put("oneRentalStartDateDay2",incrementStartDate.substring(8,10)); +// String increasingProportion = ratioList.get(0).get("increasingProportion"); +// result.put("oneRentIncreasing2",increasingProportion); +// double priceRent2 = new BigDecimal(priceRent) +// .multiply(new BigDecimal(1).add(new BigDecimal(increasingProportion).divide(new BigDecimal(100)))) // .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("twoPayRatio"+n,twoPayRatio1); - } - } - - }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)); - - double threeRentPrice = new BigDecimal(wxRentContract.getRentPrice()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("threeRentPrice",threeRentPrice); - double threePayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("threePayRatio1",threePayRatio1); - - result.put("threePayDate",wxRentContract.getPayDate()); - if(ratioList.size() > 0){ - String beforeOneIncrementStartDate = ratioList.get(0).get("beforeOneIncrementStartDate"); - result.put("threeRentalEndDateYear1",beforeOneIncrementStartDate.substring(0,4)); - result.put("threeRentalEndDateMonth1",beforeOneIncrementStartDate.substring(5,7)); - result.put("threeRentalEndDateDay1",beforeOneIncrementStartDate.substring(8,10)); - String incrementStartDate = ratioList.get(0).get("incrementStartDate"); - result.put("threeRentalStartDateYear2",incrementStartDate.substring(0,4)); - result.put("threeRentalStartDateMonth2",incrementStartDate.substring(5,7)); - result.put("threeRentalStartDateDay2",incrementStartDate.substring(8,10)); - String progressivePay = ratioList.get(0).get("progressivePay"); - double threeProgressivePay2 = new BigDecimal(progressivePay) - .multiply(new BigDecimal(wxRentContract.getRentArea())) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("threeProgressivePay2",threeProgressivePay2); - result.put("threeProgressivePayUpper2",PriceUtil.digitUppercase(threeProgressivePay2)); - result.put("threeRentPrice2",progressivePay); - String increasingProportion = ratioList.get(0).get("increasingProportion"); - result.put("threeRentIncreasing2",increasingProportion); - if(ratioList.size() > 1){ - for (int i = 1;i < ratioList.size();i++){ - int n = i+2; - String incrementStartDaten = ratioList.get(i).get("incrementStartDate"); - result.put("threeRentalStartDateYear"+n,incrementStartDaten.substring(0,4)); - result.put("threeRentalStartDateMonth"+n,incrementStartDaten.substring(5,7)); - result.put("threeRentalStartDateDay"+n,incrementStartDaten.substring(8,10)); - String progressivePayn = ratioList.get(i).get("progressivePay"); - double threeProgressivePayn = new BigDecimal(progressivePayn) - .multiply(new BigDecimal(wxRentContract.getRentArea())) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("threeProgressivePay"+n,threeProgressivePayn); - result.put("threeProgressivePayUpper"+n,PriceUtil.digitUppercase(threeProgressivePayn)); - result.put("threeRentPrice"+n,progressivePayn); - String increasingProportionn = ratioList.get(i).get("increasingProportion"); - result.put("threeRentIncreasing"+n,increasingProportionn); - } - } - }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{ - //double adjustRatio = wxRentContract.getAdjustRatio() != null ? wxRentContract.getAdjustRatio() / 100.0 : 0; - result.put("adjustRatio", 0); - double priceRent = new BigDecimal(wxRentContract.getPrice()) - .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("priceRent", priceRent); - if (!wxRentContract.getRentArea().equals("0")) { - double unitPrice = new BigDecimal(wxRentContract.getPrice()) - .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) - .divide(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("unitPriceRent", unitPrice); - result.put("priceRentUpper", PriceUtil.digitUppercase(priceRent)); - result.put("unitPriceRentUpper", PriceUtil.digitUppercase(unitPrice)); - } else { - result.put("unitPriceRent", 0); - result.put("priceRentUpper", PriceUtil.digitUppercase(0)); - result.put("unitPriceRentUpper", PriceUtil.digitUppercase(0)); - } - - //租赁保证金 - int cashDepositMonthRent = 3; - double cashDepositRent = new BigDecimal(wxRentContract.getPrice()).multiply(new BigDecimal(cashDepositMonthRent)) - .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("cashDepositMonthRent", cashDepositMonthRent); - result.put("cashDepositRent", cashDepositRent); - result.put("cashDepositRentUpper", PriceUtil.digitUppercase(cashDepositRent)); - - int extralease = lease % 12; - int extracount = extralease > 0 ? 1 : 0; - int paycount = lease / 12 + extracount; - int index = 10 - paycount; - int count = paycount - 1; - BigDecimal rentPrice = new BigDecimal(priceRent); - //保底 - if (wxRentContract.getRevenue() != null) { -// double revenue = new BigDecimal(wxRentContract.getRevenue()) +// result.put("oneRentalPrice2", priceRent2); +// result.put("oneRentalPriceUpper2", PriceUtil.digitUppercase(priceRent2)); +// +// if(ratioList.size() > 1){ +// for (int i = 1;i < ratioList.size();i++){ +// int n = i+2; +// String incrementStartDaten = ratioList.get(i).get("incrementStartDate"); +// result.put("oneRentalStartDateYear"+n,incrementStartDaten.substring(0,4)); +// result.put("oneRentalStartDateMonth"+n,incrementStartDaten.substring(5,7)); +// result.put("oneRentalStartDateDay"+n,incrementStartDaten.substring(8,10)); +// String increasingProportionn = ratioList.get(i).get("increasingProportion"); +// result.put("oneRentIncreasing"+n,increasingProportionn); +// priceRent2 = new BigDecimal(priceRent2) +// .multiply(new BigDecimal(1).add(new BigDecimal(increasingProportionn).divide(new BigDecimal(100)))) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("oneRentalPrice"+n, priceRent2); +// result.put("oneRentalPriceUpper"+n, PriceUtil.digitUppercase(priceRent2)); +// } +// } +// +// }else{ +// 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)){ +// Double twoPayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) +// .divide(new BigDecimal(100)) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("twoPayRatio1",twoPayRatio1); +// result.put("twoPayDate",wxRentContract.getPayDate()); +// if(ratioList.size() > 0){ +// String beforeOneIncrementStartDate = ratioList.get(0).get("beforeOneIncrementStartDate"); +// result.put("twoRentalEndDateYear1",beforeOneIncrementStartDate.substring(0,4)); +// result.put("twoRentalEndDateMonth1",beforeOneIncrementStartDate.substring(5,7)); +// result.put("twoRentalEndDateDay1",beforeOneIncrementStartDate.substring(8,10)); +// String incrementStartDate = ratioList.get(0).get("incrementStartDate"); +// result.put("twoRentalStartDateYear2",incrementStartDate.substring(0,4)); +// result.put("twoRentalStartDateMonth2",incrementStartDate.substring(5,7)); +// result.put("twoRentalStartDateDay2",incrementStartDate.substring(8,10)); +// String increasingProportion = ratioList.get(0).get("increasingProportion"); +// result.put("twoRentIncreasing2",increasingProportion); +//// Double twoPayRatio2 = new BigDecimal(twoPayRatio1) +//// .add(new BigDecimal(increasingProportion)) +//// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("twoPayRatio2",twoPayRatio1); +// +// if(ratioList.size() > 1){ +// for (int i = 1;i < ratioList.size();i++){ +// int n = i+2; +// String incrementStartDaten = ratioList.get(i).get("incrementStartDate"); +// result.put("twoRentalStartDateYear"+n,incrementStartDaten.substring(0,4)); +// result.put("twoRentalStartDateMonth"+n,incrementStartDaten.substring(5,7)); +// result.put("twoRentalStartDateDay"+n,incrementStartDaten.substring(8,10)); +// String increasingProportionn = ratioList.get(i).get("increasingProportion"); +// result.put("twoRentIncreasing"+n,increasingProportionn); +//// Double twoPayRatio2 = new BigDecimal(twoPayRatio1) +//// .add(new BigDecimal(increasingProportion)) +//// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("twoPayRatio"+n,twoPayRatio1); +// } +// } +// +// }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)); +// +// double threeRentPrice = new BigDecimal(wxRentContract.getRentPrice()) +// .divide(new BigDecimal(100)) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("threeRentPrice",threeRentPrice); +// double threePayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) +// .divide(new BigDecimal(100)) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("threePayRatio1",threePayRatio1); +// +// result.put("threePayDate",wxRentContract.getPayDate()); +// if(ratioList.size() > 0){ +// String beforeOneIncrementStartDate = ratioList.get(0).get("beforeOneIncrementStartDate"); +// result.put("threeRentalEndDateYear1",beforeOneIncrementStartDate.substring(0,4)); +// result.put("threeRentalEndDateMonth1",beforeOneIncrementStartDate.substring(5,7)); +// result.put("threeRentalEndDateDay1",beforeOneIncrementStartDate.substring(8,10)); +// String incrementStartDate = ratioList.get(0).get("incrementStartDate"); +// result.put("threeRentalStartDateYear2",incrementStartDate.substring(0,4)); +// result.put("threeRentalStartDateMonth2",incrementStartDate.substring(5,7)); +// result.put("threeRentalStartDateDay2",incrementStartDate.substring(8,10)); +// String progressivePay = ratioList.get(0).get("progressivePay"); +// double threeProgressivePay2 = new BigDecimal(progressivePay) +// .multiply(new BigDecimal(wxRentContract.getRentArea())) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("threeProgressivePay2",threeProgressivePay2); +// result.put("threeProgressivePayUpper2",PriceUtil.digitUppercase(threeProgressivePay2)); +// result.put("threeRentPrice2",progressivePay); +// String increasingProportion = ratioList.get(0).get("increasingProportion"); +// result.put("threeRentIncreasing2",increasingProportion); +// if(ratioList.size() > 1){ +// for (int i = 1;i < ratioList.size();i++){ +// int n = i+2; +// String incrementStartDaten = ratioList.get(i).get("incrementStartDate"); +// result.put("threeRentalStartDateYear"+n,incrementStartDaten.substring(0,4)); +// result.put("threeRentalStartDateMonth"+n,incrementStartDaten.substring(5,7)); +// result.put("threeRentalStartDateDay"+n,incrementStartDaten.substring(8,10)); +// String progressivePayn = ratioList.get(i).get("progressivePay"); +// double threeProgressivePayn = new BigDecimal(progressivePayn) +// .multiply(new BigDecimal(wxRentContract.getRentArea())) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("threeProgressivePay"+n,threeProgressivePayn); +// result.put("threeProgressivePayUpper"+n,PriceUtil.digitUppercase(threeProgressivePayn)); +// result.put("threeRentPrice"+n,progressivePayn); +// String increasingProportionn = ratioList.get(i).get("increasingProportion"); +// result.put("threeRentIncreasing"+n,increasingProportionn); +// } +// } +// }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{ +// //double adjustRatio = wxRentContract.getAdjustRatio() != null ? wxRentContract.getAdjustRatio() / 100.0 : 0; +// result.put("adjustRatio", 0); +// double priceRent = new BigDecimal(wxRentContract.getPrice()) +// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("priceRent", priceRent); +// if (!wxRentContract.getRentArea().equals("0")) { +// double unitPrice = new BigDecimal(wxRentContract.getPrice()) +// .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) +// .divide(new BigDecimal(100)) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("unitPriceRent", unitPrice); +// result.put("priceRentUpper", PriceUtil.digitUppercase(priceRent)); +// result.put("unitPriceRentUpper", PriceUtil.digitUppercase(unitPrice)); +// } else { +// result.put("unitPriceRent", "0"); +// result.put("priceRentUpper", PriceUtil.digitUppercase(0)); +// result.put("unitPriceRentUpper", PriceUtil.digitUppercase(0)); +// } +// +// //租赁保证金 +// int cashDepositMonthRent = 3; +// BigDecimal cashDepositRent = new BigDecimal(wxRentContract.getPrice()).multiply(new BigDecimal(cashDepositMonthRent)) +// .setScale(wxRentContract.getDecimalSize(), RoundingMode.HALF_EVEN); +// result.put("cashDepositMonthRent", cashDepositMonthRent); +// result.put("cashDepositRent", cashDepositRent.toPlainString()); +// result.put("cashDepositRentUpper", PriceUtil.digitUppercase(cashDepositRent.setScale(2,RoundingMode.HALF_EVEN).longValue())); +// +// int extralease = lease % 12; +// int extracount = extralease > 0 ? 1 : 0; +// int paycount = lease / 12 + extracount; +// int index = 10 - paycount; +// int count = paycount - 1; +// BigDecimal rentPrice = new BigDecimal(priceRent); +// //保底 +// if (wxRentContract.getRevenue() != null) { +//// double revenue = new BigDecimal(wxRentContract.getRevenue()) +//// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("revenue", wxRentContract.getRevenue()); +// result.put("revenueUpper", PriceUtil.digitUppercase(new BigDecimal(wxRentContract.getRevenue()) +// .setScale(2,RoundingMode.HALF_EVEN).longValue())); +// } else { +// result.put("revenue", "0"); +// result.put("revenueUpper", PriceUtil.digitUppercase(0)); +// } +// if (!wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { +// areaWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice); +// } else { +// ratioWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice); +// } +// } +// +// +// +// +// //物业合同信息 +// //WxPropertyContract propertyContract = new WxPropertyContract(); +// //propertyContract.updateTenantInfo(wxRentContract); +// //propertyContract.setRentContractId(wxRentContract.getId()); +//// Optional> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract) +//// .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) +//// && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode()) +//// && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) +//// && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode()) +//// && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst(); +// //Optional> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract) +// //.stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.TERMINATE.getCode()) +// // && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) +// // && !rc.get("status").equals(EnumRentContractStatus.OUT_DATE.getCode())).findFirst(); +// // Map wxPropertyContract = null; +// // if (first.isPresent()) { +// // wxPropertyContract = first.get(); +// // } +// WxPropertyContract propertyContract = null; +// if (null != propertyId) { +// propertyContract = wxPropertyContractMapper.selectById(propertyId); +// } +// if (propertyContract != null) { +// Integer receivePeriodProperty = propertyContract.getReceivePeriod(); +// result.put("receivePeriodProperty", receivePeriodProperty); +// double priceProperty = new BigDecimal(propertyContract.getPrice().toString()) +// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("priceProperty", priceProperty); +// if (!wxRentContract.getRentArea().equals("0")) { +// double unitPriceProperty = new BigDecimal(propertyContract.getPrice().toString()) +// .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) // .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("revenue", wxRentContract.getRevenue()); - result.put("revenueUpper", PriceUtil.digitUppercase(revenue)); - } else { - result.put("revenue", "0"); - result.put("revenueUpper", PriceUtil.digitUppercase(0)); - } - if (!wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { - areaWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice); - } else { - ratioWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice); - } - } - - - - - //物业合同信息 - //WxPropertyContract propertyContract = new WxPropertyContract(); - //propertyContract.updateTenantInfo(wxRentContract); - //propertyContract.setRentContractId(wxRentContract.getId()); -// Optional> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract) -// .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) -// && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode()) -// && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) -// && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode()) -// && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst(); - //Optional> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract) - //.stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.TERMINATE.getCode()) - // && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) - // && !rc.get("status").equals(EnumRentContractStatus.OUT_DATE.getCode())).findFirst(); - // Map wxPropertyContract = null; - // if (first.isPresent()) { - // wxPropertyContract = first.get(); - // } - WxPropertyContract propertyContract = null; - if (null != propertyId) { - propertyContract = wxPropertyContractMapper.selectById(propertyId); - } - if (propertyContract != null) { - Integer receivePeriodProperty = propertyContract.getReceivePeriod(); - result.put("receivePeriodProperty", receivePeriodProperty); - double priceProperty = new BigDecimal(propertyContract.getPrice().toString()) - .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("priceProperty", priceProperty); - if (!wxRentContract.getRentArea().equals("0")) { - double unitPriceProperty = new BigDecimal(propertyContract.getPrice().toString()) - .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) - .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("unitPriceProperty", unitPriceProperty); - result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty)); - result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty)); - } else { - result.put("unitPriceProperty", 0); - result.put("pricePropertyUpper", PriceUtil.digitUppercase(0)); - result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(0)); - } - - //首期物业费 - Calendar instance = Calendar.getInstance(); - instance.setTime(wxRentContract.getRentalStartDate()); - instance.add(Calendar.MONTH, 0); - Date starttime = instance.getTime(); - String startdate = DateUtils.date2String(starttime, "yyyy-MM-dd"); - result.put("rentalStartDateProperty", startdate); - result.put("rentalStartDateYearProperty", startdate.substring(0, 4)); - result.put("rentalStartDateMonthProperty", startdate.substring(5, 7)); - result.put("rentalStartDateDayProperty", startdate.substring(8)); - //结束时间 - instance.clear(); - instance.setTime(starttime); - instance.add(Calendar.MONTH, receivePeriodProperty); - instance.add(Calendar.DAY_OF_MONTH, -1); - Date endtime = instance.getTime(); - String enddate = DateUtils.date2String(endtime, "yyyy-MM-dd"); - result.put("rentalEndDateProperty", enddate); - result.put("rentalEndDateYearProperty", enddate.substring(0, 4)); - result.put("rentalEndDateMonthProperty", enddate.substring(5, 7)); - result.put("rentalEndDateDayProperty", enddate.substring(8)); - double pricePropertyFirst = new BigDecimal(priceProperty) - .multiply(new BigDecimal(receivePeriodProperty)) - .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("pricePropertyFirst", pricePropertyFirst); - result.put("pricePropertyFirstUpper", PriceUtil.digitUppercase(pricePropertyFirst)); - - - //物业保证金 - int cashDepositMonthProperty = 3; - double cashDepositProperty = new BigDecimal(propertyContract.getPrice().toString()).multiply(new BigDecimal(cashDepositMonthProperty)) - .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("cashDepositMonthProperty", cashDepositMonthProperty); - result.put("cashDepositProperty", cashDepositProperty); - result.put("cashDepositPropertyUpper", PriceUtil.digitUppercase(cashDepositProperty)); - - - } else { - result.put("receivePeriodProperty", " "); - result.put("priceProperty", " "); - result.put("unitPriceProperty", " "); - result.put("pricePropertyUpper", " "); - result.put("unitPricePropertyUpper", " "); - //首期物业费 - result.put("rentalStartDateProperty", " "); - result.put("rentalStartDateYearProperty", " "); - result.put("rentalStartDateMonthProperty", " "); - result.put("rentalStartDateDayProperty", " "); - //结束时间 - result.put("rentalEndDateProperty", " "); - result.put("rentalEndDateYearProperty", " "); - result.put("rentalEndDateMonthProperty", " "); - result.put("rentalEndDateDayProperty", " "); - result.put("pricePropertyFirst", " "); - result.put("pricePropertyFirstUpper", " "); - //物业保证金 - result.put("cashDepositMonthProperty", " "); - result.put("cashDepositProperty", " "); - result.put("cashDepositPropertyUpper", " "); - } - - - return result; - } +// result.put("unitPriceProperty", unitPriceProperty); +// result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty)); +// result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty)); +// } else { +// result.put("unitPriceProperty", 0); +// result.put("pricePropertyUpper", PriceUtil.digitUppercase(0)); +// result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(0)); +// } +// +// //首期物业费 +// Calendar instance = Calendar.getInstance(); +// instance.setTime(wxRentContract.getRentalStartDate()); +// instance.add(Calendar.MONTH, 0); +// Date starttime = instance.getTime(); +// String startdate = DateUtils.date2String(starttime, "yyyy-MM-dd"); +// result.put("rentalStartDateProperty", startdate); +// result.put("rentalStartDateYearProperty", startdate.substring(0, 4)); +// result.put("rentalStartDateMonthProperty", startdate.substring(5, 7)); +// result.put("rentalStartDateDayProperty", startdate.substring(8)); +// //结束时间 +// instance.clear(); +// instance.setTime(starttime); +// instance.add(Calendar.MONTH, receivePeriodProperty); +// instance.add(Calendar.DAY_OF_MONTH, -1); +// Date endtime = instance.getTime(); +// String enddate = DateUtils.date2String(endtime, "yyyy-MM-dd"); +// result.put("rentalEndDateProperty", enddate); +// result.put("rentalEndDateYearProperty", enddate.substring(0, 4)); +// result.put("rentalEndDateMonthProperty", enddate.substring(5, 7)); +// result.put("rentalEndDateDayProperty", enddate.substring(8)); +// double pricePropertyFirst = new BigDecimal(priceProperty) +// .multiply(new BigDecimal(receivePeriodProperty)) +// .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("pricePropertyFirst", pricePropertyFirst); +// result.put("pricePropertyFirstUpper", PriceUtil.digitUppercase(pricePropertyFirst)); +// +// +// //物业保证金 +// int cashDepositMonthProperty = 3; +// double cashDepositProperty = new BigDecimal(propertyContract.getPrice().toString()).multiply(new BigDecimal(cashDepositMonthProperty)) +// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); +// result.put("cashDepositMonthProperty", cashDepositMonthProperty); +// result.put("cashDepositProperty", cashDepositProperty); +// result.put("cashDepositPropertyUpper", PriceUtil.digitUppercase(cashDepositProperty)); +// +// +// } else { +// result.put("receivePeriodProperty", " "); +// result.put("priceProperty", " "); +// result.put("unitPriceProperty", " "); +// result.put("pricePropertyUpper", " "); +// result.put("unitPricePropertyUpper", " "); +// //首期物业费 +// result.put("rentalStartDateProperty", " "); +// result.put("rentalStartDateYearProperty", " "); +// result.put("rentalStartDateMonthProperty", " "); +// result.put("rentalStartDateDayProperty", " "); +// //结束时间 +// result.put("rentalEndDateProperty", " "); +// result.put("rentalEndDateYearProperty", " "); +// result.put("rentalEndDateMonthProperty", " "); +// result.put("rentalEndDateDayProperty", " "); +// result.put("pricePropertyFirst", " "); +// result.put("pricePropertyFirstUpper", " "); +// //物业保证金 +// result.put("cashDepositMonthProperty", " "); +// result.put("cashDepositProperty", " "); +// result.put("cashDepositPropertyUpper", " "); +// } +// +// +// return result; +// } public void ratioWay(WxRentContract wxRentContract, Map result, Integer lease, int extralease, int extracount, int paycount, int index, int count, BigDecimal rentPrice) { String adjustRatio = wxRentContract.getAdjustRatio();