|
|
|
@@ -231,9 +231,8 @@ public class WxShopServiceImpl implements WxShopService { |
|
|
|
merchantShopQ.setShopIdList(record.getIds()); |
|
|
|
merchantShopQ.setIsDel(0); |
|
|
|
List<WxMerchantShop> merchantShopList = wxMerchantShopMapper.findList(merchantShopQ); |
|
|
|
List<Long> merchantIds = new ArrayList<Long>(); |
|
|
|
if (null != merchantShopList && merchantShopList.size() > 0) { |
|
|
|
List<Long> merchantIds = new ArrayList<Long>(); |
|
|
|
|
|
|
|
for (int i = 0 ;i < merchantShopList.size() ; i ++) { |
|
|
|
WxMerchantShop ms = merchantShopList.get(i); |
|
|
|
if (null != ms ) { |
|
|
|
@@ -245,8 +244,44 @@ public class WxShopServiceImpl implements WxShopService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
merchantMap = getMerchantMap(record,merchantIds,merchantMap); |
|
|
|
} |
|
|
|
//还得查一下虚拟商户,如果店铺既有品牌商户关联,又有虚拟商户,则取虚拟商户。因为这种情况代表的是已售铺创建的品牌,不能创建合同,智能做营销。 |
|
|
|
WxShop sq = new WxShop(); |
|
|
|
sq.setId(record.getId()); |
|
|
|
sq.setIds(record.getIds()); |
|
|
|
sq.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
|
List<WxShop> shopList = wxShopMapper.findList(sq); |
|
|
|
if (null != shopList && shopList.size() > 0 ) { |
|
|
|
Map<String,Long> shopNumberMap = new HashMap<String,Long>(); |
|
|
|
List<String> shopNumberList = new ArrayList<String>(); |
|
|
|
for (int i = 0 ; i < shopList.size() ; i ++ ) { |
|
|
|
WxShop s = shopList.get(i); |
|
|
|
shopNumberMap.put(s.getShopNumber(), s.getId()); |
|
|
|
shopNumberList.add(s.getShopNumber()); |
|
|
|
} |
|
|
|
|
|
|
|
WxMerchant mq = new WxMerchant(); |
|
|
|
mq.updateTenantInfo(record); |
|
|
|
sq.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
|
mq.setCreateShopNumberList(shopNumberList); |
|
|
|
List<WxMerchant> mlist = wxMerchantMapper.findList(mq); |
|
|
|
if (null != mlist && mlist.size() > 0) { |
|
|
|
for (int i = 0 ; i < mlist.size() ; i ++ ) { |
|
|
|
WxMerchant m = mlist.get(i); |
|
|
|
String createshopNumber = m.getCreateShopNumber(); |
|
|
|
if (StringUtils.isNotBlank(createshopNumber)) { |
|
|
|
Long shopId = shopNumberMap.get(createshopNumber); |
|
|
|
if (null != shopId) { |
|
|
|
shopMerchantIdMap.put(shopId, m.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!merchantIds.contains(m.getId())) { |
|
|
|
merchantIds.add(m.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
merchantMap = getMerchantMap(record,merchantIds,merchantMap); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|