|
|
|
@@ -94,8 +94,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMerchantShopMapper wxMerchantShopMapper; |
|
|
|
@Autowired |
|
|
|
WxShopService wxShopService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -156,6 +154,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(wxRentContract.getPriceUnit() == null){ |
|
|
|
wxRentContract.setPriceUnit(EnumPriceUnit.M.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
//商场信息 |
|
|
|
WxMall wxMall = new WxMall(); |
|
|
|
@@ -167,23 +168,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() : 0); |
|
|
|
wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() : 0); |
|
|
|
|
|
|
|
//目前只有多经点位租赁合同 |
|
|
|
// WxShop wxShop = wxShopService.getById(wxRentContract.getShopId()); |
|
|
|
// if(wxShop !=null && EnumRentShopType.POINT.getCode().equals(wxShop.getType())){ |
|
|
|
// //handle adjustPeriod 1日 2月 monthHandleType 2按账单周期 3按自然月 |
|
|
|
// if(wxRentContract.getAdjustPeriod().intValue() == 1){ |
|
|
|
// wxRentContract.setAdjustPeriod(1); |
|
|
|
// wxRentContract.setMonthHandleType(null); |
|
|
|
// }else if(wxRentContract.getAdjustPeriod().intValue() == 2){ |
|
|
|
// wxRentContract.setAdjustPeriod(2); |
|
|
|
// wxRentContract.setMonthHandleType(2); |
|
|
|
// }else if(wxRentContract.getAdjustPeriod().intValue() == 3){ |
|
|
|
// wxRentContract.setAdjustPeriod(2); |
|
|
|
// wxRentContract.setMonthHandleType(3); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
result.put("wxRentContract", wxRentContract); |
|
|
|
//关联的商户 |
|
|
|
if (wxRentContract.getMerchantId() != null) { |
|
|
|
@@ -250,7 +234,6 @@ 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()); |
|
|
|
//起租结束时间 |
|
|
|
if (!record.getStartDate().equals(record.getRentalStartDate())) { |
|
|
|
instance.clear(); |
|
|
|
@@ -435,17 +418,6 @@ 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()); |
|
|
|
|
|
|
|
//起租结束时间 |
|
|
|
// 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); |
|
|
|
@@ -899,12 +871,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
int paycount = lease / receivePeriod + extracount; |
|
|
|
int index = paycount - 1; |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
|
|
//自然月计租,而且残月,周期整除,n+1,最后一个周期作为残月 |
|
|
|
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode()) |
|
|
|
&& !isFirstDay(wxRentContract.getRentalStartDate()) |
|
|
|
&& (wxRentContract.getLease() % wxRentContract.getReceivePeriod() == 0) |
|
|
|
&& isLastYesr |
|
|
|
|
|
|
|
&& wxRentContract.getReceivePeriod() != 1 |
|
|
|
){ |
|
|
|
paycount ++; |
|
|
|
} |
|
|
|
@@ -1078,14 +1051,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
//最后一期截止到结束日期 |
|
|
|
if(i == paycount - 1){ |
|
|
|
if(wxBillRent.getEndtime().after(wxRentContract.getRentalEndDate())) { |
|
|
|
wxBillRent.setEndtime(wxRentContract.getRentalEndDate()); |
|
|
|
} |
|
|
|
wxBillRent.setEndtime(wxRentContract.getRentalEndDate()); |
|
|
|
|
|
|
|
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
System.out.println(s.format(wxBillRent.getStarttime())); |
|
|
|
System.out.println(s.format(wxBillRent.getEndtime())); |
|
|
|
int[] diff = DateUtils.getDiff(wxBillRent.getStarttime(),wxBillRent.getEndtime()); |
|
|
|
//当天也算,加1天 |
|
|
|
Date newEndDate = DateUtils.getDaySet(wxBillRent.getEndtime(),Calendar.DATE,1); |
|
|
|
int[] diff = DateUtils.getDiff(wxBillRent.getStarttime(),newEndDate); |
|
|
|
needpay = diff[0]*price; |
|
|
|
|
|
|
|
double oneDayProce = (double) price/DateUtils.getMonthDayCount(wxRentContract.getRentalEndDate()); |
|
|
|
|