|
|
|
@@ -1974,6 +1974,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
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()); |
|
|
|
@@ -2008,16 +2010,122 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
result.put("invoiceAddressPhone", " "); |
|
|
|
} |
|
|
|
//租赁合同信息 |
|
|
|
String rentalStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "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(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("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",""); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//交付 |
|
|
|
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.getRentalStartDate() != null && wxRentContract.getRentalEndDate() != null){ |
|
|
|
String rentalStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "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.getStartDate(), "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"); |
|
|
|
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", "/"); |
|
|
|
} |
|
|
|
|
|
|
|
result.put("price", wxRentContract.getPrice()); |
|
|
|
result.put("contractNumber", wxRentContract.getContractNumber()); |
|
|
|
Integer lease = wxRentContract.getLease(); |
|
|
|
@@ -2047,55 +2155,134 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("brand", brand); |
|
|
|
// TODO |
|
|
|
//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)); |
|
|
|
result.put("type", wxRentContract.getType()); |
|
|
|
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()) |
|
|
|
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")); |
|
|
|
result.put("honourDuration",jsonObject.getString("honourDuration")); |
|
|
|
result.put("qualityPledge",jsonObject.getString("qualityPledge")); |
|
|
|
result.put("qualityDuration",jsonObject.getString("qualityDuration")); |
|
|
|
|
|
|
|
} |
|
|
|
//incrementStartDate//租金递增起始日期 |
|
|
|
//increasingProportion//租金递增比例 |
|
|
|
//progressivePay//递增租赁单价 |
|
|
|
String incrementStartDate = ""; |
|
|
|
String increasingProportion = ""; |
|
|
|
String progressivePay = ""; |
|
|
|
if(StringUtils.isNotBlank(wxRentContract.getAdjustRatio())){ |
|
|
|
JSONArray array = JSONArray.parseArray(wxRentContract.getAdjustRatio()); |
|
|
|
if(array != null && array.size() > 0){ |
|
|
|
JSONObject jsonObject = array.getJSONObject(0); |
|
|
|
incrementStartDate = jsonObject.getString("incrementStartDate"); |
|
|
|
increasingProportion = jsonObject.getString("increasingProportion"); |
|
|
|
progressivePay = jsonObject.getString("progressivePay"); |
|
|
|
} |
|
|
|
} |
|
|
|
if(EnumRentContractType.RENT_BY_AREA.getCode().equals(type)){ |
|
|
|
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)); |
|
|
|
result.put("oneRentalStartDateDay2",incrementStartDate.substring(8,10)); |
|
|
|
result.put("oneRentIncreasing2",increasingProportion); |
|
|
|
double priceRent2 = new BigDecimal(priceRent) |
|
|
|
.divide(new BigDecimal(1).add(new BigDecimal(increasingProportion))) |
|
|
|
.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
|
|
|
result.put("oneRentalPrice2", priceRent2); |
|
|
|
result.put("oneRentalPriceUpper2", PriceUtil.digitUppercase(priceRent2)); |
|
|
|
}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)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}else if(EnumRentContractType.RENT_BY_JOINT.getCode().equals(type)){ |
|
|
|
|
|
|
|
|
|
|
|
}else if(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode().equals(type)){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}else{ |
|
|
|
// TODO |
|
|
|
//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("revenue", revenue); |
|
|
|
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); |
|
|
|
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()) |
|
|
|
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
|
|
|
result.put("revenue", revenue); |
|
|
|
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); |
|
|
|
|