diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index 44b28e307..e2885026e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -152,22 +152,21 @@ public class WxMerchantServiceImpl implements WxMerchantService { } wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode()); wxMerchantMapper.updateByPrimaryKeySelective(wxMerchant); - //解绑商铺 WxMerchantShop wxMerchantShopQuery = new WxMerchantShop(); wxMerchantShopQuery.setTenantId(wxMerchant.getTenantId()); wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); + wxMerchantShopQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); List wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShopQuery); - for (WxMerchantShop merchantShop : wxMerchantShopList) { - merchantShop.setIsDel(EnumDelStatus.DEL.getCode()); - wxMerchantShopMapper.updateByPrimaryKeySelective(merchantShop); + for(WxMerchantShop wxMerchantShop:wxMerchantShopList){ + wxMerchantShop.setIsDel(EnumDelStatus.DEL.getCode()); + wxMerchantShopMapper.updateByPrimaryKeySelective(wxMerchantShop); //更新商铺状态 WxShop wxShop = new WxShop(); - wxShop.setId(merchantShop.getShopId()); + wxShop.setId(wxMerchantShop.getShopId()); wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); wxShopMapper.updateByPrimaryKeySelective(wxShop); } - //解绑用户 WxMerchantBUser bUser = new WxMerchantBUser(); bUser.setMerchantId(wxMerchant.getId()); @@ -176,7 +175,6 @@ public class WxMerchantServiceImpl implements WxMerchantService { wxMerchantBUser.setStatus(EnumMerchantBUserStatus.INVALID.getCode()); wxMerchantBUserMapper.updateByPrimaryKeySelective(wxMerchantBUser); } - //作废卡券 WxCoupon wxCoupon = new WxCoupon(); wxCoupon.setMerchantId(wxMerchant.getId()); @@ -185,7 +183,6 @@ public class WxMerchantServiceImpl implements WxMerchantService { c.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()); wxCouponService.updateCoupon(c); } - } @Transactional(rollbackFor = {Exception.class}) @@ -200,6 +197,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { if(null!=shopidlist && !shopidlist.isEmpty()){ Long shopid = shopidlist.get(0); WxMerchantShop wxMerchantShop = new WxMerchantShop(); + wxMerchantShop.setTenantId(wxMerchant.getTenantId()); + wxMerchantShop.setShopId(shopid); wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); long count = wxMerchantShopMapper.findList(wxMerchantShop).size(); if(count>0){