| @@ -769,7 +769,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //按月计租 | //按月计租 | ||||
| // if (wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) | // if (wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) | ||||
| // ||wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { | // ||wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { | ||||
| rentList = buildRentMonth(wxMerchant, userId, wxRentContract, receivePeriod, lease, rentalStartDate, price,isPreview); | |||||
| rentList = buildRentMonth(userId, wxRentContract, receivePeriod, lease, rentalStartDate, price, isPreview); | |||||
| // } else { | // } else { | ||||
| // //如果按日 | // //如果按日 | ||||
| // List<Date> yearList = new ArrayList<>(); | // List<Date> yearList = new ArrayList<>(); | ||||
| @@ -830,7 +830,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return priceList; | return priceList; | ||||
| } | } | ||||
| public List<WxBillRent> buildRentMonth(WxMerchant wxMerchant, Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview) { | |||||
| public List<WxBillRent> buildRentMonth(Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview) { | |||||
| int size = 0; | int size = 0; | ||||
| long[] priceArrs = null; | long[] priceArrs = null; | ||||
| List<Map<String, Object>> shopInfos = new ArrayList<>(); | List<Map<String, Object>> shopInfos = new ArrayList<>(); | ||||
| @@ -918,13 +918,27 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| yearList.add(startDate); | yearList.add(startDate); | ||||
| } | } | ||||
| Map<String, Object> resultMap = buildRent(receivePeriod, priceArrs, yearList, Calendar.MONTH, wxRentContract, userId, wxMerchant, billcount, isPreview, shopInfos); | |||||
| String shopInfoStr = null; | |||||
| if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | |||||
| String rentInfo = wxRentContract.getRentInfo(); | |||||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | |||||
| int rentSize = rentInfoArray.size(); | |||||
| Map<String, Object> shopInfoMap = new HashMap<>(rentSize); | |||||
| for (int j = 0; j < rentSize; j++) { | |||||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(j); | |||||
| shopInfoMap.put(rentInfoObject.getString("shopNumber"), rentInfoObject.getString("buildArea")); | |||||
| } | |||||
| shopInfoStr = JSONObject.toJSONString(shopInfoMap); | |||||
| } | |||||
| Map<String, Object> resultMap = buildRent(receivePeriod, priceArrs, yearList, Calendar.MONTH, wxRentContract, userId, billcount, isPreview, shopInfoStr); | |||||
| List<WxBillRent> billRentList = (List<WxBillRent>)resultMap.get("billList"); | List<WxBillRent> billRentList = (List<WxBillRent>)resultMap.get("billList"); | ||||
| resultList.addAll(billRentList); | resultList.addAll(billRentList); | ||||
| return resultList; | return resultList; | ||||
| } | } | ||||
| public Map<String, Object> buildRent(int receivePeriod,long[] priceArrs, List<Date> yearList,int dayType, WxRentContract wxRentContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview,List<Map<String, Object>> shopInfoList) { | |||||
| public Map<String, Object> buildRent(int receivePeriod, long[] priceArrs, List<Date> yearList, int dayType, WxRentContract wxRentContract, Long userId, int billcount, Integer isPreview, String shopInfoStr) { | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| Map<String,Object> resultMap = new HashedMap(); | Map<String,Object> resultMap = new HashedMap(); | ||||
| List<WxBillRent> resultList = new ArrayList<>(); | List<WxBillRent> resultList = new ArrayList<>(); | ||||
| @@ -957,28 +971,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //获取price 、shopInfo | //获取price 、shopInfo | ||||
| long price = priceArrs[index]; | long price = priceArrs[index]; | ||||
| Map<String, Object> shopInfo = null; | |||||
| if(!CollectionUtils.isEmpty(shopInfoList)){ | |||||
| shopInfo = shopInfoList.get(index); | |||||
| } | |||||
| String shopInfoStr = null; | |||||
| if (shopInfo != null) { | |||||
| shopInfoStr = JSONObject.toJSONString(shopInfo); | |||||
| } else { | |||||
| if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) && | |||||
| wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||||
| String rentInfo = wxRentContract.getRentInfo(); | |||||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | |||||
| int rentSize = rentInfoArray.size(); | |||||
| Map<String, Object> shopInfoMap = new HashMap<>(); | |||||
| for (int j = 0; j < rentSize; j++) { | |||||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(j); | |||||
| shopInfoMap.put(rentInfoObject.getString("shopNumber"), 0); | |||||
| } | |||||
| shopInfoStr = JSONObject.toJSONString(shopInfoMap); | |||||
| } | |||||
| } | |||||
| WxBillRent wxBillRent = new WxBillRent(); | WxBillRent wxBillRent = new WxBillRent(); | ||||
| wxBillRent.setIsPreview(isPreview); | wxBillRent.setIsPreview(isPreview); | ||||