|
|
|
@@ -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<WxMerchantShop> 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<WxMerchantShop> 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<WxMerchantShop> 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<WxMerchantShop> 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; |
|
|
|
|