|
|
|
@@ -156,6 +156,25 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//m: init 租赁单价 |
|
|
|
String rentInfo = wxRentContract.getRentInfo(); |
|
|
|
if(StringUtils.isNotBlank(rentInfo)){ |
|
|
|
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); |
|
|
|
int size = rentInfoArray.size(); |
|
|
|
//查询rent_info 包括shopId |
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); |
|
|
|
Double rentPrice = rentInfoObject.getDouble("rentPrice"); |
|
|
|
Long price = wxRentContract.getPrice()/100; |
|
|
|
if(rentPrice == null){ |
|
|
|
Double rentArea = Double.parseDouble(wxRentContract.getRentArea()); |
|
|
|
rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
rentInfoObject.put("rentPrice",rentPrice); |
|
|
|
} |
|
|
|
} |
|
|
|
wxRentContract.setRentInfo(rentInfoArray.toJSONString()); |
|
|
|
} |
|
|
|
|
|
|
|
result.put("wxRentContract", wxRentContract); |
|
|
|
//关联的商户 |
|
|
|
if (wxRentContract.getMerchantId() != null) { |
|
|
|
@@ -222,7 +241,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
instance.setTime(record.getRentalStartDate()); |
|
|
|
instance.add(dayType, record.getLease()); |
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
record.setRentalEndDate(instance.getTime()); |
|
|
|
// record.setRentalEndDate(instance.getTime()); |
|
|
|
//起租结束时间 |
|
|
|
if (!record.getStartDate().equals(record.getRentalStartDate())) { |
|
|
|
instance.clear(); |
|
|
|
@@ -407,17 +426,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
instance.setTime(record.getRentalStartDate()); |
|
|
|
instance.add(dayType, record.getLease()); |
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
record.setRentalEndDate(instance.getTime()); |
|
|
|
//record.setRentalEndDate(instance.getTime()); |
|
|
|
|
|
|
|
//起租结束时间 |
|
|
|
if (!record.getStartDate().equals(record.getRentalStartDate())) { |
|
|
|
instance.clear(); |
|
|
|
instance.setTime(record.getRentalStartDate()); |
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
record.setEndDate(instance.getTime()); |
|
|
|
} else { |
|
|
|
record.setEndDate(record.getStartDate()); |
|
|
|
} |
|
|
|
// if (!record.getStartDate().equals(record.getRentalStartDate())) { |
|
|
|
// instance.clear(); |
|
|
|
// instance.setTime(record.getRentalStartDate()); |
|
|
|
// instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
// record.setEndDate(instance.getTime()); |
|
|
|
// } else { |
|
|
|
// record.setEndDate(record.getStartDate()); |
|
|
|
// } |
|
|
|
|
|
|
|
if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { |
|
|
|
BigDecimal hundred = new BigDecimal(100); |
|
|
|
@@ -709,6 +728,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
if (wxRentContract != null) { |
|
|
|
int receivePeriod = wxRentContract.getReceivePeriod().intValue(); |
|
|
|
Integer lease = wxRentContract.getLease(); |
|
|
|
// int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate()); |
|
|
|
// Integer lease = array[0]; |
|
|
|
// if(array[1] >0){ |
|
|
|
// lease = array[0] +1; |
|
|
|
// } |
|
|
|
|
|
|
|
Date rentalStartDate = wxRentContract.getRentalStartDate(); |
|
|
|
Long price = wxRentContract.getPrice(); |
|
|
|
//按月计租 |
|
|
|
|