Explorar el Código

[商户][修改][添加店铺]

release_toaliyun_real
gongbiao hace 7 años
padre
commit
cb1ae65780
Se han modificado 1 ficheros con 9 adiciones y 7 borrados
  1. +9
    -7
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java

+ 9
- 7
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Ver fichero

@@ -307,22 +307,24 @@ public class WxMerchantServiceImpl implements WxMerchantService {
if (shopidlist.isEmpty()) {
return new ResultData(ErrorCode.SHOP_NOT_SELECTED);
}
//先检查是否存在已出租的商铺

//更新商铺
for (long shopid : shopidlist) {
WxShop shop = wxShopMapper.selectByPrimaryKey(shopid);
if (shop.getStatus().equals(EnumShopStatus.RENT.getCode())) {
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shop.getShopNumber() + " 已出租");
}
}
//更新商铺
for (long shopid : shopidlist) {
WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setShopId(shopid);
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode());
int count = wxMerchantShopMapper.selectCount(wxMerchantShop);
if (count > 0) {
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shop.getShopNumber() + " 已出租");
}
//更新商铺状态
WxShop shop = new WxShop();
shop.setId(shopid);
shop.setStatus(EnumShopStatus.RENT.getCode());
wxShopMapper.updateByPrimaryKeySelective(shop);
//关联表插入
WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setId(idWorker.nextId());
wxMerchantShop.setMerchantId(merchantId);
wxMerchantShop.setTenantId(wxMerchant.getTenantId());


Cargando…
Cancelar
Guardar