Przeglądaj źródła

Merge branch 'release_toaliyun_20210901' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_20210901

release_toaliyun_real
xiaohanzi 4 lat temu
rodzic
commit
a777197c63
2 zmienionych plików z 74 dodań i 42 usunięć
  1. +62
    -42
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  2. +12
    -0
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java

+ 62
- 42
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Wyświetl plik

@@ -1180,7 +1180,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
JSONObject jsonObject = array.getJSONObject(0); JSONObject jsonObject = array.getJSONObject(0);
String increasingProportion = jsonObject.getString("increasingProportion"); String increasingProportion = jsonObject.getString("increasingProportion");
if(StringUtils.isNotBlank(increasingProportion)){ if(StringUtils.isNotBlank(increasingProportion)){
integers.add(Integer.parseInt(increasingProportion));
int ratio = new BigDecimal(increasingProportion).multiply(new BigDecimal(100)).intValue();
integers.add(ratio);
}else{
integers.add(0);
} }
} }
} }
@@ -1891,6 +1894,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
logger.info("获取租赁物业合同数据>>>>>>rentId:" + rentId +" >>>>propertyId:"+propertyId); logger.info("获取租赁物业合同数据>>>>>>rentId:" + rentId +" >>>>propertyId:"+propertyId);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
WxRentContract wxRentContract = wxRentContractMapper.selectById(rentId); WxRentContract wxRentContract = wxRentContractMapper.selectById(rentId);

result.put("operationType", wxRentContract.getOperationType()); result.put("operationType", wxRentContract.getOperationType());
if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
JSONArray jsonArray = JSONArray.parseArray(wxRentContract.getRentInfo()); JSONArray jsonArray = JSONArray.parseArray(wxRentContract.getRentInfo());
@@ -2213,22 +2217,25 @@ public class WxRentContractServiceImpl implements WxRentContractService {


} }
//[{"progressivePay": "", "tempAdjustRatio": "2021-11-30 00:00:00", "incrementStartDate": "2021-11-29T16:00:00.000Z", "increasingProportion": "1.78"}] //[{"progressivePay": "", "tempAdjustRatio": "2021-11-30 00:00:00", "incrementStartDate": "2021-11-29T16:00:00.000Z", "increasingProportion": "1.78"}]
//incrementStartDate
//tempAdjustRatio//租金递增起始日期
//increasingProportion//租金递增比例 //increasingProportion//租金递增比例
//progressivePay//递增租赁单价 //progressivePay//递增租赁单价
String incrementStartDate = "";
String tempAdjustRatio = "";
String increasingProportion = "";
String progressivePay = "";
List<Map<String,String>> ratioList = new ArrayList<>();
if(StringUtils.isNotBlank(wxRentContract.getAdjustRatio())){ if(StringUtils.isNotBlank(wxRentContract.getAdjustRatio())){
JSONArray array = JSONArray.parseArray(wxRentContract.getAdjustRatio()); JSONArray array = JSONArray.parseArray(wxRentContract.getAdjustRatio());
if(array != null && array.size() > 0){ if(array != null && array.size() > 0){
JSONObject jsonObject = array.getJSONObject(0);
incrementStartDate = jsonObject.getString("incrementStartDate");
tempAdjustRatio = jsonObject.getString("tempAdjustRatio");
increasingProportion = jsonObject.getString("increasingProportion");
progressivePay = jsonObject.getString("progressivePay");
for(int i=0;i<array.size();i++){
JSONObject jsonObject = array.getJSONObject(i);
if(jsonObject != null && StringUtils.isNotBlank(jsonObject.getString("increasingProportion"))){
Map<String,String> 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);
}
}
} }
} }
if(EnumRentContractType.RENT_BY_AREA.getCode().equals(type)){ if(EnumRentContractType.RENT_BY_AREA.getCode().equals(type)){
@@ -2243,19 +2250,30 @@ public class WxRentContractServiceImpl implements WxRentContractService {
.divide(new BigDecimal(100)) .divide(new BigDecimal(100))
.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); .setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("oneRentPrice",oneRentPrice); result.put("oneRentPrice",oneRentPrice);
//稍后详细计算
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));


WxBillRent wxBillRent = new WxBillRent();
wxBillRent.setRentContractId(wxRentContract.getId());
wxBillRent.setSortColumns(BaseEntity.SortField.Period_ASC);
List<WxBillRent> 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));
}


result.put("oneRentalStartDateYear2",tempAdjustRatio.substring(0,4));
result.put("oneRentalStartDateMonth2",tempAdjustRatio.substring(5,7));
result.put("oneRentalStartDateDay2",tempAdjustRatio.substring(8,10));
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); result.put("oneRentIncreasing2",increasingProportion);
double priceRent2 = new BigDecimal(priceRent) double priceRent2 = new BigDecimal(priceRent)
.multiply(new BigDecimal(1).add(new BigDecimal(increasingProportion).divide(new BigDecimal(100)))) .multiply(new BigDecimal(1).add(new BigDecimal(increasingProportion).divide(new BigDecimal(100))))
@@ -2277,15 +2295,16 @@ public class WxRentContractServiceImpl implements WxRentContractService {
.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); .setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("twoPayRatio1",twoPayRatio1); result.put("twoPayRatio1",twoPayRatio1);
result.put("twoPayDate",wxRentContract.getPayDate()); 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",tempAdjustRatio.substring(0,4));
result.put("twoRentalStartDateMonth2",tempAdjustRatio.substring(5,7));
result.put("twoRentalStartDateDay2",tempAdjustRatio.substring(8,10));
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); result.put("twoRentIncreasing2",increasingProportion);
Double twoPayRatio2 = new BigDecimal(twoPayRatio1) Double twoPayRatio2 = new BigDecimal(twoPayRatio1)
.add(new BigDecimal(increasingProportion)) .add(new BigDecimal(increasingProportion))
@@ -2316,22 +2335,23 @@ public class WxRentContractServiceImpl implements WxRentContractService {
result.put("threePayRatio1",threePayRatio1); result.put("threePayRatio1",threePayRatio1);


result.put("threePayDate",wxRentContract.getPayDate()); 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",tempAdjustRatio.substring(0,4));
result.put("threeRentalStartDateMonth2",tempAdjustRatio.substring(5,7));
result.put("threeRentalStartDateDay2",tempAdjustRatio.substring(8,10));
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) double threeProgressivePay2 = new BigDecimal(progressivePay)
.multiply(new BigDecimal(wxRentContract.getRentArea())) .multiply(new BigDecimal(wxRentContract.getRentArea()))
.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); .setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("threeProgressivePay2",threeProgressivePay2); result.put("threeProgressivePay2",threeProgressivePay2);
result.put("threeProgressivePayUpper2",PriceUtil.digitUppercase(threeProgressivePay2)); result.put("threeProgressivePayUpper2",PriceUtil.digitUppercase(threeProgressivePay2));

result.put("threeRentPrice2",progressivePay); result.put("threeRentPrice2",progressivePay);
String increasingProportion = ratioList.get(0).get("increasingProportion");
result.put("threeRentIncreasing2",increasingProportion); result.put("threeRentIncreasing2",increasingProportion);


}else{ }else{


+ 12
- 0
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Wyświetl plik

@@ -1393,4 +1393,16 @@ public class DateUtils {
return isSameDate; return isSameDate;
} }


/**
* 获取i年后的今天
* @return
*/
public static String getAfterYear(Date date,int i){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cale = Calendar.getInstance();
cale.setTime(date);
cale.add(Calendar.YEAR, i);
return format.format(cale.getTime());
}

} }

Ładowanie…
Anuluj
Zapisz