| @@ -460,9 +460,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| Date date = new Date(); | Date date = new Date(); | ||||
| wxMerchant.setUpdateDate(date); | wxMerchant.setUpdateDate(date); | ||||
| wxMerchantMapper.updateById(wxMerchant); | wxMerchantMapper.updateById(wxMerchant); | ||||
| List<Long> shopIds = wxMerchant.getShopids(); | |||||
| //如果原来店铺在商户里面有有效的合同,则不能操作 | //如果原来店铺在商户里面有有效的合同,则不能操作 | ||||
| List<Long> oldShopIds = wxMerchantShopMapper.findShopIds(wxMerchant.getId()); | List<Long> oldShopIds = wxMerchantShopMapper.findShopIds(wxMerchant.getId()); | ||||
| if (null != oldShopIds && oldShopIds.size() > 0) { | if (null != oldShopIds && oldShopIds.size() > 0) { | ||||
| if(null != shopIds) { | |||||
| //去重 | |||||
| oldShopIds.removeAll(shopIds); | |||||
| } | |||||
| for (Long osid : oldShopIds) { | for (Long osid : oldShopIds) { | ||||
| WxRentContract wrc = new WxRentContract(); | WxRentContract wrc = new WxRentContract(); | ||||
| wrc.setMerchantId(wxMerchant.getId()); | wrc.setMerchantId(wxMerchant.getId()); | ||||
| @@ -481,7 +486,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxShopMapper.updateUnRentByIds(oldShopIds); | wxShopMapper.updateUnRentByIds(oldShopIds); | ||||
| wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId()); | wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId()); | ||||
| } | } | ||||
| List<Long> shopIds = wxMerchant.getShopids(); | |||||
| if (null != shopIds) { | if (null != shopIds) { | ||||
| for (Long sid: shopIds) { | for (Long sid: shopIds) { | ||||
| WxMerchantShop mcs = new WxMerchantShop(); | WxMerchantShop mcs = new WxMerchantShop(); | ||||