From cd30d9f4a55606926ee9abc918359dd41308d13f Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 19 Nov 2018 11:48:11 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=95=86=E6=88=B7][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E9=93=BA=E7=9A=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxMerchantServiceImpl.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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){