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 d5cc80df0..010095a24 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 @@ -89,10 +89,17 @@ UPDATE wx_property_contract SET STATUS = 3 WHERE STATUS = 4; UPDATE wx_rent_contract SET STATUS = 1 WHERE STATUS = 8 AND apply_status = 0; UPDATE wx_rent_contract SET STATUS = 10 WHERE STATUS = 8 AND apply_status = 1; +UPDATE wx_property_contract SET STATUS = 1 WHERE STATUS = 8 AND apply_status = 0; +UPDATE wx_property_contract SET STATUS = 10 WHERE STATUS = 8 AND apply_status = 1; + UPDATE wx_rent_contract SET STATUS = 1 WHERE STATUS = 9; +UPDATE wx_property_contract SET STATUS = 1 WHERE STATUS = 9; + delete from wx_rent_contract where status = 0; +delete from wx_property_contract where status = 0; + ALTER TABLE `wx_rent_contract` ADD COLUMN `from_id` BIGINT(20) DEFAULT NULL COMMENT '来源ID,针对续签,从哪个合同续签'; 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 981ebd316..5b546ac6f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -456,30 +456,30 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxRentContract.updateTenantInfo(record); Long shopId = rentInfoObject.getLong("id"); //wxRentContract.setShopId(shopId); - 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 + " 已出租"); - } - if (record.getMerchantId() != null) { - WxMerchantShop wxMerchantShop = new WxMerchantShop(); - wxMerchantShop.setShopId(shopId); - wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); - List wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); - long total = wxMerchantShopList.parallelStream(). - filter(ms -> !ms.getMerchantId().equals(record.getMerchantId())).count(); - if (total > 0) { - return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); - } - } else { - WxShop wxShop = wxShopMapper.selectById(shopId); - if (wxShop == null) { - return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 不存在"); - } - //if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { - // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); - //} - } +// int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract.getTenantId(),wxRentContract.getParentTenantId(),shopId,wxRentContract.getId()); +// if (count > 0) { +// return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); +// } +// if (record.getMerchantId() != null) { +// WxMerchantShop wxMerchantShop = new WxMerchantShop(); +// wxMerchantShop.setShopId(shopId); +// wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); +// List wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); +// long total = wxMerchantShopList.parallelStream(). +// filter(ms -> !ms.getMerchantId().equals(record.getMerchantId())).count(); +// if (total > 0) { +// return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); +// } +// } else { +// WxShop wxShop = wxShopMapper.selectById(shopId); +// if (wxShop == null) { +// return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 不存在"); +// } +// //if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { +// // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); +// //} +// } if (!shopList.contains(shopId)) { shopList.add(shopId); shopName = shopName +","+ shopNumber; @@ -685,25 +685,25 @@ public class WxRentContractServiceImpl implements WxRentContractService { //if (count > 0) { // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); //} - if (record.getMerchantId() != null) { - WxMerchantShop wxMerchantShop = new WxMerchantShop(); - wxMerchantShop.setShopId(shopId); - wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); - List wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); - long total = wxMerchantShopList.parallelStream(). - filter(ms -> !ms.getMerchantId().equals(record.getMerchantId())).count(); - if (total > 0) { - return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); - } - } else { - WxShop wxShop = wxShopMapper.selectById(shopId); - if (wxShop == null) { - return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); - } -// if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { -// return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); +// if (record.getMerchantId() != null) { +// WxMerchantShop wxMerchantShop = new WxMerchantShop(); +// wxMerchantShop.setShopId(shopId); +// wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); +// List wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); +// long total = wxMerchantShopList.parallelStream(). +// filter(ms -> !ms.getMerchantId().equals(record.getMerchantId())).count(); +// if (total > 0) { +// return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); // } - } +// } else { +// WxShop wxShop = wxShopMapper.selectById(shopId); +// if (wxShop == null) { +// return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); +// } +//// if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { +//// return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); +//// } +// } if (!shopList.contains(shopId)) { shopList.add(shopId); shopName = shopName +","+shopNumber;