Просмотр исходного кода

fix contract

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
28fe22e124
2 измененных файлов: 48 добавлений и 41 удалений
  1. +7
    -0
      mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql
  2. +41
    -41
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 7
- 0
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,针对续签,从哪个合同续签';



+ 41
- 41
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<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;


Загрузка…
Отмена
Сохранить