From 3a7b765ea7619bebb6260b2c6c8c2004adb8d631 Mon Sep 17 00:00:00 2001 From: xiaohanzi Date: Thu, 13 Aug 2020 22:20:15 +0800 Subject: [PATCH] update --- .../V202007311200__FOR_MEMBER_ONLY_001.sql | 3 +- .../iformall/domain/po/WxRentContract.java | 17 ++ .../domain/vo/WxRentPropertyContractVo.java | 4 +- .../iformall/mapper/WxRentContractMapper.java | 6 +- .../WxRentPropertyContractService.java | 2 +- .../impl/WxPropertyContractServiceImpl.java | 7 +- .../impl/WxRentContractServiceImpl.java | 191 ++++++++++-------- .../WxRentPropertyContractServiceImpl.java | 8 +- .../service/impl/WxShopServiceImpl.java | 4 +- .../invest/impl/InvestBizServiceImpl.java | 62 +++--- .../resources/mapper/WxRentContractMapper.xml | 21 +- 11 files changed, 184 insertions(+), 141 deletions(-) diff --git a/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql b/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql index 4c74bc9a5..e170666f2 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql @@ -51,6 +51,7 @@ ALTER TABLE `wx_profit_sharing_receiver` ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; + ALTER TABLE wx_rent_contract DROP COLUMN shop_id; CREATE TABLE `wx_rent_contract_shop` ( @@ -61,5 +62,5 @@ CREATE TABLE `wx_rent_contract_shop` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='租金合同关联的店铺'; -ALTER TABLE `wx_rent_contract` ADD COLUMN `shop_name` VARCHAR(30) COMMENT '店铺名称'; +ALTER TABLE `wx_rent_contract` ADD COLUMN `shop_name` VARCHAR(100) COMMENT '店铺名称'; 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 a797006a6..74de4e2a1 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -1,5 +1,7 @@ package com.iformall.domain.po; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.iformall.common.SortColumn; @@ -9,6 +11,8 @@ import com.iformall.enums.EnumRentContractAdjustPeriod; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; + +import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; @@ -257,5 +261,18 @@ public class WxRentContract extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") private Integer contractType; + + public List shopIdsByRentInfo() { + List shopList = Lists.newArrayList(); + String rentInfo = this.getRentInfo(); + JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); + int size = rentInfoArray.size(); + for (int i = 0; i < size; i++) { + JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); + Long shopId = rentInfoObject.getLong("shopId"); + shopList.add(shopId); + } + return shopList; + } } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java index 3bc401568..fb5300b91 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java @@ -20,8 +20,8 @@ public class WxRentPropertyContractVo extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "contractNumber") private String contractNumber; - @io.swagger.annotations.ApiModelProperty(value = "商铺号", name = "shopNumber") - private String shopNumber; + @io.swagger.annotations.ApiModelProperty(value = "商铺号", name = "shopName") + private String shopName; @io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "rentInfo") private String rentInfo; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java index 0bf63107a..16b39dc6c 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java @@ -57,11 +57,11 @@ public interface WxRentContractMapper extends CommonMapper int selectRentContractCountByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("id") Long id); - void updateInvalidContract(WxRentContract record); + //void updateInvalidContract(WxRentContract record); List selectRentContractByMerchantId(WxRentContract wxRentContract); - List selectRentContractByShopId(WxRentContract record); + List selectRentContractByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("status") Integer status); //List selectRentContractByShopIds(@Param("shopIds") Collection shopIds,@Param("shopIdsRegexp") String shopIdsRegexp,@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId); @@ -69,7 +69,7 @@ public interface WxRentContractMapper extends CommonMapper //Integer getShopType(WxRentContract wxRentContract); - //List listContractVo(WxRentPropertyContractVo record); + List listContractVo(WxRentPropertyContractVo record); WxRentContract getByBill(WxBillRent billRent); diff --git a/mallinkService/src/main/java/com/iformall/service/WxRentPropertyContractService.java b/mallinkService/src/main/java/com/iformall/service/WxRentPropertyContractService.java index ce8b484cb..2cb1f12c5 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxRentPropertyContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxRentPropertyContractService.java @@ -10,7 +10,7 @@ import com.iformall.domain.vo.WxRentPropertyContractVo; */ public interface WxRentPropertyContractService { - //PageInfo listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize); + PageInfo listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize); ResultData getContractInfo(Long id); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index efe470c96..cbc199abe 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -1131,9 +1131,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService wxPropertyContract.updateTenantInfo(wxRentContract); if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { wxPropertyContract.setMerchantId(wxRentContract.getMerchantId()); - } else { - wxPropertyContract.setShopId(wxRentContract.getShopId()); } + if (wxRentContract.shopIdsByRentInfo().size()==0) { + wxPropertyContract.setShopId(wxRentContract.shopIdsByRentInfo().get(0)); + } + + List select = wxPropertyContractMapper.selectList(new QueryWrapper(wxPropertyContract)); if (select.size() > 0) { // long count = select.stream().filter(propertyContract -> propertyContract.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) || 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 8a72d139d..ebe567120 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -214,9 +214,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("wxMerchant", null); } //关联的店铺 - if (wxRentContract.getShopId() != null) { + if (wxRentContract.shopIdsByRentInfo().size()> 0) { WxShop record = new WxShop(); - record.setId(wxRentContract.getShopId()); + //record.setId(wxRentContract.getShopId()); + record.setIds(wxRentContract.shopIdsByRentInfo()); List> list = wxShopMapper.findListMap(record); result.put("wxShops", list); } else { @@ -445,13 +446,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { return new ResultData(ErrorCode.SHOP_NOT_SELECTED); } //查询rent_info 包括 shopId + String shopName = ""; for (int i = 0; i < size; i++) { JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); WxRentContract wxRentContract = new WxRentContract(); wxRentContract.updateTenantInfo(record); Long shopId = rentInfoObject.getLong("shopId"); //wxRentContract.setShopId(shopId); - int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract); + int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract.getTenantId(),wxRentContract.getParentTenantId(),shopId,wxRentContract.getId()); String shopNumber = rentInfoObject.getString("shopNumber"); if (count > 0) { return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); @@ -477,6 +479,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { } if (!shopList.contains(shopId)) { shopList.add(shopId); + shopName = shopName +","+ shopNumber; } } @@ -485,6 +488,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { record.setStatus(EnumRentContractStatus.DRAFT.getCode()); Date tempDate = record.getRentalStartDate(); record.setRentalStartDate(oldRentStartDate); + record.setShopName(shopName); wxRentContractMapper.insert(record); wxRentContractShopMapper.deleteShops(record.getId()); record.setShopIdList(shopList); @@ -519,26 +523,27 @@ public class WxRentContractServiceImpl implements WxRentContractService { @Override public List getShopIds(WxRentContract record) { - List shopList = Lists.newArrayList(); - if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { - String rentInfo = record.getRentInfo(); - JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); - int size = rentInfoArray.size(); - //查询rent_info 包括 shopId - for (int i = 0; i < size; i++) { - JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); - WxRentContract wxRentContract = new WxRentContract(); - wxRentContract.updateTenantInfo(record); - Long shopId = rentInfoObject.getLong("shopId"); - shopList.add(shopId); - } - } else { - WxRentContract wxRentContract = new WxRentContract(); - wxRentContract.updateTenantInfo(record); - wxRentContract.setShopId(record.getShopId()); - shopList.add(record.getShopId()); - } - return shopList; + return record.shopIdsByRentInfo(); +// List shopList = Lists.newArrayList(); +// if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { +// String rentInfo = record.getRentInfo(); +// JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); +// int size = rentInfoArray.size(); +// //查询rent_info 包括 shopId +// for (int i = 0; i < size; i++) { +// JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); +// WxRentContract wxRentContract = new WxRentContract(); +// wxRentContract.updateTenantInfo(record); +// Long shopId = rentInfoObject.getLong("shopId"); +// shopList.add(shopId); +// } +// } else { +// WxRentContract wxRentContract = new WxRentContract(); +// wxRentContract.updateTenantInfo(record); +// wxRentContract.setShopId(record.getShopId()); +// shopList.add(record.getShopId()); +// } +// return shopList; } @Transactional(rollbackFor = {Exception.class}) @@ -586,6 +591,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); final IdWorker idWorker = IdWorker.get(); int count = 1; + List shopIds = record.shopIdsByRentInfo(); for (WxBillRent bill:record.getPreviewBillRentList()) { bill.setId(idWorker.nextId()); Date date = new Date(); @@ -602,7 +608,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { bill.setLatePayRatio(0); bill.setPay(0L); bill.setIsDel(EnumDelStatus.NOT_DEL.getCode()); - bill.setShopId(record.getShopId()); + if (null != shopIds && shopIds.size() == 1) { + bill.setShopId(shopIds.get(0)); + } setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); if (bill.getReceivePay().equals(0L)) { bill.setStatus(EnumBillRentStatus.PAID.getCode()); @@ -772,7 +780,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxBillDeposit.setIsDel(0); wxBillDeposit.setMerchantId(wxRentContract.getMerchantId()); wxBillDeposit.setUserId(userId); - wxBillDeposit.setShopId(wxRentContract.getShopId()); + if (wxRentContract.shopIdsByRentInfo().size()==1) { + wxBillDeposit.setShopId(wxRentContract.shopIdsByRentInfo().get(0)); + } wxBillDeposit.setCreatetime(date); wxBillDeposit.setUpdatetime(date); wxBillDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode()); @@ -855,8 +865,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { if (shopId == null) { return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); } - wxRentContractQuery.setShopId(Long.valueOf(shopId)); - int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery); + //wxRentContractQuery.setShopId(Long.valueOf(shopId)); + int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery.getTenantId(),wxRentContractQuery.getParentTenantId(),Long.valueOf(shopId),wxRentContractQuery.getId()); if (count > 0) { return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); } @@ -1694,23 +1704,26 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("buildArea", buildAreaStr); result.put("operationArea", operationAreaStr); } else { - WxShop record = new WxShop(); - record.setId(wxRentContract.getShopId()); - List> wxShops = wxShopMapper.findListMap(record); - if (!wxShops.isEmpty()) { - //店铺信息 - Map wxShop = wxShops.get(0); - result.put("shopNumber", wxShop.get("shopNumber")); - result.put("floorName", wxShop.get("floor")); - result.put("buildingName", wxShop.get("building")); - result.put("buildArea", wxShop.get("buildArea")); - result.put("operationArea", wxShop.get("operationArea")); - } else { - result.put("shopNumber", " "); - result.put("floorName", " "); - result.put("buildingName", " "); - result.put("buildArea", " "); - result.put("operationArea", " "); + //record.setId(wxRentContract.getShopId()); + if (wxRentContract.shopIdsByRentInfo().size() == 0) { + result.put("shopNumber", " "); + result.put("floorName", " "); + result.put("buildingName", " "); + result.put("buildArea", " "); + result.put("operationArea", " "); + }else { + WxShop record = new WxShop(); + record.setIds(wxRentContract.shopIdsByRentInfo()); + List> wxShops = wxShopMapper.findListMap(record); + if (!wxShops.isEmpty()) { + //店铺信息 + Map wxShop = wxShops.get(0); + result.put("shopNumber", wxShop.get("shopNumber")); + result.put("floorName", wxShop.get("floor")); + result.put("buildingName", wxShop.get("building")); + result.put("buildArea", wxShop.get("buildArea")); + result.put("operationArea", wxShop.get("operationArea")); + } } } //MALL信息 @@ -2511,7 +2524,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { record.setUpdatetime(date); List shopList = Lists.newArrayList(); - if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { + String shopName = ""; + //if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { String rentInfo = record.getRentInfo(); JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); int size = rentInfoArray.size(); @@ -2529,17 +2543,21 @@ public class WxRentContractServiceImpl implements WxRentContractService { if (wxShop == null) { return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); } - shopList.add(shopId); + if (!shopList.contains(shopId)) { + shopList.add(shopId); + shopName = shopName+","+shopNumber; + } } - } else { - shopList.add(record.getShopId()); - } + //} else { + // shopList.add(record.getShopId()); + //} try { record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); record.setStatus(EnumRentContractStatus.DRAFT.getCode()); Date tempDate = record.getRentalStartDate(); record.setRentalStartDate(oldRentStartDate); + record.setShopName(shopName); wxRentContractMapper.insert(record); record.setRentalStartDate(tempDate); } catch (Exception e) { @@ -2548,14 +2566,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { } //生成预览账单(补录第二步,第三步走编辑) - if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null - && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) { - wxBillRentMapper.deletePreviewBill(record); - //重新生成 - List resultList = buildRent(new WxMerchant(), null, record, EnumIsPreview.YES.getCode(),true); - record.setPreviewBillRentList(resultList); - } - +// if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null +// && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) { +// wxBillRentMapper.deletePreviewBill(record); +// //重新生成 +// List resultList = buildRent(new WxMerchant(), null, record, EnumIsPreview.YES.getCode(),true); +// record.setPreviewBillRentList(resultList); +// } + List resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); + record.setPreviewBillRentList(resultList); EventUtil.publistRentEvent(this, record); return new ResultData(Result.SUCCESS, "保存租赁合同信息成功", record); } @@ -2581,7 +2600,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { //删除预账单,重新生成 wxBillRentMapper.deletePreviewBill(record); - resultList = buildRent(new WxMerchant(), null, record, EnumIsPreview.YES.getCode(),true); + resultList = buildRent( null, record, EnumIsPreview.YES.getCode(),true); } } @@ -2637,7 +2656,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { record.setUpdatetime(new Date()); - if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { +// if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { String rentInfo = record.getRentInfo(); JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); int size = rentInfoArray.size(); @@ -2659,21 +2678,21 @@ public class WxRentContractServiceImpl implements WxRentContractService { return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); } } - } else { - WxRentContract wxRentContractQuery = new WxRentContract(); - wxRentContractQuery.updateTenantInfo(record); - wxRentContractQuery.setShopId(record.getShopId()); -// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream(). -// filter(rc -> rc.get("status").equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) -// || rc.get("status").equals(EnumRentContractStatus.RENT_PAID.getCode()) -// || rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); - long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream(). - filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) - || rc.get("status").equals(EnumRentContractStatus.PAING.getCode())).count(); - if (count > 0) { - return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); - } - } +// } else { +// WxRentContract wxRentContractQuery = new WxRentContract(); +// wxRentContractQuery.updateTenantInfo(record); +// wxRentContractQuery.setShopId(record.getShopId()); +//// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream(). +//// filter(rc -> rc.get("status").equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) +//// || rc.get("status").equals(EnumRentContractStatus.RENT_PAID.getCode()) +//// || rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); +// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream(). +// filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) +// || rc.get("status").equals(EnumRentContractStatus.PAING.getCode())).count(); +// if (count > 0) { +// return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); +// } +// } try { Date tempDate = record.getRentalStartDate(); @@ -2764,17 +2783,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { WxRentContract wxRentContract = new WxRentContract(); wxRentContract.setTenantId(tenantId); wxRentContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode()); - List> rentContractData = wxRentContractMapper.queryRentContractData(wxRentContract); - for (int i = 0, size = rentContractData.size(); i < size; i++) { - Map contract = rentContractData.get(i); - Object merchantId = contract.get("merchantId"); - if (merchantId != null) { - WxMerchant merchant = wxMerchantMapper.selectById((Long) merchantId); - Integer status = merchant.getStatus(); - if (status.equals(EnumMerchantStatus.VALID.getCode())) { - wxMerchantService.disableMerchat((Long) merchantId); - } - } - } +// List> rentContractData = wxRentContractMapper.queryRentContractData(wxRentContract); +// for (int i = 0, size = rentContractData.size(); i < size; i++) { +// Map contract = rentContractData.get(i); +// Object merchantId = contract.get("merchantId"); +// if (merchantId != null) { +// WxMerchant merchant = wxMerchantMapper.selectById((Long) merchantId); +// Integer status = merchant.getStatus(); +// if (status.equals(EnumMerchantStatus.VALID.getCode())) { +// wxMerchantService.disableMerchat((Long) merchantId); +// } +// } +// } } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java index 4b18edd30..87e18b897 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java @@ -46,10 +46,10 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract @Autowired WxRentContractService wxRentContractService; -// @Override -// public PageInfo listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { -// return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); -// } + @Override + public PageInfo listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); + } @Override public ResultData getContractInfo(Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index 13067dcbc..fa81f7007 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -125,11 +125,11 @@ public class WxShopServiceImpl implements WxShopService { if (isAdmin.equals(EnumUserAdmin.ADMIN.getCode())) { //3、合同 两种 都要查一下 存在时不能删除 WxRentContract wxRentContract = new WxRentContract(); - wxRentContract.setShopId(wxShop.getId()); + //wxRentContract.setShopId(wxShop.getId()); wxRentContract.updateTenantInfo(wxShop); long count = 0; if (wxShop.getType().equals(EnumRentShopType.SHOP.getCode())) { - count = wxRentContractMapper.selectRentContractByShopId(wxRentContract).parallelStream() + count = wxRentContractMapper.selectRentContractByShopId(wxRentContract.getTenantId(),wxRentContract.getParentTenantId(),wxShop.getId(),null).parallelStream() // .filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) && // !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) && // !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index a392e9786..6cac49e00 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -549,21 +549,21 @@ public class InvestBizServiceImpl implements InvestBizService { //2、目标信息 Collection shops = shopService.getByIds(getIds(taskList, InvestTaskEntity::getTargetId)); //3、商品合同信息 - Map shopContractMap = new HashMap<>(); - if (CollectionUtils.isNotEmpty(shops)) { - Collection shopPointIds = buildShopContractQuery(shops, EnumRentShopType.POINT); - Collection shopIds = buildShopContractQuery(shops, EnumRentShopType.SHOP); - shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, - StringUtils.join(shopIds, "|"), - InvestUserContext.getUser()); - } - for (WxShop shop : shops) { - WxRentContract contract = shopContractMap.get(shop.getId()); - if (Objects.nonNull(contract)) { - shop.setStartdate(contract.getRentalStartDate()); - shop.setEnddate(contract.getRentalEndDate()); - } - } +// Map shopContractMap = new HashMap<>(); +// if (CollectionUtils.isNotEmpty(shops)) { +// Collection shopPointIds = buildShopContractQuery(shops, EnumRentShopType.POINT); +// Collection shopIds = buildShopContractQuery(shops, EnumRentShopType.SHOP); +// shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, +// StringUtils.join(shopIds, "|"), +// InvestUserContext.getUser()); +// } +// for (WxShop shop : shops) { +// WxRentContract contract = shopContractMap.get(shop.getId()); +// if (Objects.nonNull(contract)) { +// shop.setStartdate(contract.getRentalStartDate()); +// shop.setEnddate(contract.getRentalEndDate()); +// } +// } Map shopsMap = getMap(shops, WxShop::getId); //4、用户信息 @@ -765,18 +765,19 @@ public class InvestBizServiceImpl implements InvestBizService { @Override public Map shopRentInfo(Long shopId) { - WxShop shop = shopService.getById(shopId); - InvestHelper.notNull(shop, "shop 不存在"); - //3、商品合同信息 - Map shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), - StringUtils.join(shop.getId()), - InvestUserContext.getUser()); - WxRentContract contract = shopContractMap.get(shop.getId()); - InvestHelper.notNull(contract, "合同信息不存在"); - Map map = new HashMap<>(); - map.put("startdate", contract.getRentalStartDate()); - map.put("enddate", contract.getRentalEndDate()); - return map; +// WxShop shop = shopService.getById(shopId); +// InvestHelper.notNull(shop, "shop 不存在"); +// //3、商品合同信息 +// Map shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), +// StringUtils.join(shop.getId()), +// InvestUserContext.getUser()); +// WxRentContract contract = shopContractMap.get(shop.getId()); +// InvestHelper.notNull(contract, "合同信息不存在"); +// Map map = new HashMap<>(); +// map.put("startdate", contract.getRentalStartDate()); +// map.put("enddate", contract.getRentalEndDate()); +// return map; + return null; } public List queryUserList(EnumInvestUserType userType) { @@ -921,9 +922,10 @@ public class InvestBizServiceImpl implements InvestBizService { if (Objects.isNull(shop)) { return new HashMap<>(); } - return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), - StringUtils.join(shop.getId(), ""), - InvestUserContext.getUser()); +// return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), +// StringUtils.join(shop.getId(), ""), +// InvestUserContext.getUser()); + return new HashMap<>(); } @Override diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 41f76ac49..c926045c2 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -450,7 +450,7 @@ and status=#{status} and status!=7 - + --> +