From 2bde450b5f6fc52479fe7bd6b0096104837c8582 Mon Sep 17 00:00:00 2001 From: winter Date: Sat, 3 Aug 2024 18:53:08 +0800 Subject: [PATCH] fix --- .../contract/WxRentContractController.java | 64 ------------------- .../iformall/domain/po/WxRentContract.java | 22 +++++++ .../impl/WxRentContractServiceImpl.java | 17 ++++- 3 files changed, 37 insertions(+), 66 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index 54f9465f4..861d65e40 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -1,10 +1,8 @@ package com.iformall.controller.contract; -import com.alibaba.fastjson.JSONArray; import com.github.pagehelper.PageInfo; import com.iformall.annotation.SystemControllerLog; import com.iformall.annotation.TenantIgnore; -import com.iformall.annotation.UserDataRuleAnnotation; import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; @@ -87,68 +85,6 @@ public class WxRentContractController extends WxContractBaseController { } } wrc.setFlowHas(hasFlow); -// String renInfo = wrc.getRentInfo(); -// if (!StringUtils.isBlank(renInfo)) { -// String floorName = ""; -// String buildingName = ""; -// String shopNumber = ""; -// JSONArray arrays = JSONArray.parseArray(renInfo); -// if ( null != arrays) { -//// List floorIds = new ArrayList(); -//// List buildIds = new ArrayList(); -//// List shopIds = new ArrayList(); -//// for (int i = 0 ; i < arrays.size(); i ++) { -//// JSONObject o = arrays.getJSONObject(i); -//// try { -//// floorIds.add(Long.parseLong(o.getString("floor"))); -//// }catch(Exception e) { -//// floorName = floorName +","+o.getString("floor"); -//// } -//// try { -//// buildIds.add(Long.parseLong(o.getString("building"))); -//// }catch(Exception e) { -//// buildingName = buildingName + ","+ o.getString("building"); -//// } -//// try { -//// shopIds.add(Long.parseLong(o.getString("id"))); -//// }catch(Exception e) { -//// shopNumber = shopNumber +","+o.getString("id"); -//// } -//// } -//// -//// WxMallBuilding bq = new WxMallBuilding(); -//// bq.setIds(buildIds); -//// PageInfo bpage = buildingService.listAsPage(bq, 1, 1000); -//// if (null != bpage && null != bpage.getList()) { -//// for (WxMallBuilding wmb : bpage.getList()) { -//// buildingName = buildingName +"," + wmb.getBuildingName(); -//// } -//// } -//// -//// WxMallFloor fq = new WxMallFloor(); -//// fq.setIds(floorIds); -//// PageInfo fpage = floorService.listAsPage(fq, 1, 1000); -//// if (null != fpage && null != fpage.getList()) { -//// for (WxMallFloor wmf : fpage.getList()) { -//// floorName = floorName +"," + wmf.getFloorName(); -//// } -//// } -//// -//// WxShop ws = new WxShop(); -//// ws.setIds(shopIds); -//// PageInfo spage = wxShopService.listAsPage(ws, 1, 1000); -//// if (null != spage && null != spage.getList()) { -//// for (WxShop shop : spage.getList()) { -//// shopNumber = shopNumber+","+shop.getShopNumber(); -//// } -//// } -// -// wrc.setFloorName(floorName); -// wrc.setBuildingName(buildingName); -// wrc.setShopNumber(shopNumber); -// } -// -// } } } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 52aef1b09..99a972dba 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -567,5 +568,26 @@ public class WxRentContract extends TenantEntity { private Long propertyContractId; @TableField(exist = false) private List freePeriods; + public void setFreeVo(List freePeriods) { + if (null != freePeriods) { + Map yearVoMap = new HashMap(); + List voList = new ArrayList(); + for (int i = 0 ; i < freePeriods.size() ; i ++) { + WxRentContractFreePeriod fp = freePeriods.get(i); + RentContractFreePeriodVo vo = yearVoMap.get(fp.getYearIndex()); + if (null == vo ) { + vo = new RentContractFreePeriodVo(); + yearVoMap.put(fp.getYearIndex(), vo); + voList.add(vo); + vo.setYearIndex(fp.getYearIndex()); + } + if (null == vo.getPeriods()) { + vo.setPeriods(new ArrayList()); + } + vo.getPeriods().add(fp); + } + this.setFreePeriods(voList); + } + } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 3a427f7eb..4e246a5b9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -284,6 +284,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxRentContract.setPrice(StringUtils.isNotBlank(wxRentContract.getPrice()) ? wxRentContract.getPrice() : "0"); wxRentContract.setDeposit(StringUtils.isNotBlank(wxRentContract.getDeposit()) ? wxRentContract.getDeposit() : "0"); + //免租期 + WxRentContractFreePeriod fpq = new WxRentContractFreePeriod(); + fpq.updateTenantInfo(wxRentContract); + fpq.setRentContractId(wxRentContract.getId()); + fpq.setSortColumn("year_index asc,start_date asc"); + List freePeroids = wxRentContractFreePeriodMapper.findList(fpq); + wxRentContract.setFreeVo(freePeroids); result.put("wxRentContract", wxRentContract); //关联的商户 if (wxRentContract.getMerchantId() != null) { @@ -1355,6 +1362,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { } } + //免租期 + WxRentContractFreePeriod fpq = new WxRentContractFreePeriod(); + fpq.updateTenantInfo(wxRentContract); + fpq.setRentContractId(wxRentContract.getId()); + fpq.setSortColumn("start_date asc"); + List freePeroids = wxRentContractFreePeriodMapper.findList(fpq); + int index = 0; for (int i = 0; i < billTimeVoList.size(); i++) { BillTimeVo billTimeVo = billTimeVoList.get(i); @@ -1971,10 +1985,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { // } - public static List initBillTimeList(Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){ List list = new ArrayList<>(); - int count = 0; while (true){ BillTimeVo timeVo = new BillTimeVo(); @@ -2355,6 +2367,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { fpq.updateTenantInfo(wxRentContract); fpq.setRentContractId(wxRentContract.getId()); fpq.setYearIndex(i+1); + fpq.setSortColumn("start_date asc"); vo.setPeriods(wxRentContractFreePeriodMapper.findList(fpq)); volist.add(vo); }