|
|
|
@@ -369,35 +369,8 @@ public class WxShopServiceImpl implements WxShopService { |
|
|
|
record.setShopNumber(StringUtils.trimToNull(record.getShopNumber())); |
|
|
|
//如果是写字楼住宅,则自动新增虚拟商户 |
|
|
|
if (record.getType() == EnumRentShopType.XIZILOU.getCode()) { |
|
|
|
WxMerchant merchant = new WxMerchant(); |
|
|
|
merchant.updateTenantInfo(record); |
|
|
|
merchant.setName("[系统铺位号]"+record.getShopNumber()); |
|
|
|
merchant.setCreateFromData(record.getShopNumber()); |
|
|
|
merchant.setCreateFrom(EnumMerchantCreateFrom.SYS_SHOP_CREATE.getCode()); |
|
|
|
List<Long> ids = wxMerchantMapper.findIdList(merchant); |
|
|
|
if (null == ids || ids.size() <= 0 ) { |
|
|
|
merchant.setId(idWorker.nextId()); |
|
|
|
merchant.setLinkPerson("虚拟"); |
|
|
|
merchant.setLinkPhone("11111111111"); |
|
|
|
merchant.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
merchant.setImgUrl("https://formall.oss-accelerate.aliyuncs.com/234/WechatIMG5071.png"); |
|
|
|
merchant.setCoverPicture("[\"https://formall.oss-accelerate.aliyuncs.com/234/WechatIMG5071.png\"]"); |
|
|
|
merchant.setCreateDate(new Date()); |
|
|
|
merchant.setUpdateDate(new Date()); |
|
|
|
merchant.setIsPublic(EnumMerchantPublic.PRIVATE.getCode()); |
|
|
|
merchant.setIsPrivate(EnumYesOrNo.YES.getCode()); |
|
|
|
merchant.setBillSetting(3); |
|
|
|
merchant.setCreateFromId(String.valueOf(record.getId())); |
|
|
|
merchant.setCarVendorType(0); |
|
|
|
merchant.setBusinessId(com.iformall.utils.Constant.default_business); |
|
|
|
//merchant.setType(); |
|
|
|
merchant.setIsAdmin(EnumYesOrNo.NO.getCode()); |
|
|
|
merchant.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
|
merchant.setSearchCardByPhone(EnumYesOrNo.NO.getCode()); |
|
|
|
merchant.setCreditLocked(EnumYesOrNo.NO.getCode()); |
|
|
|
wxMerchantMapper.insert(merchant); |
|
|
|
} |
|
|
|
record.setStatus(EnumShopStatus.RENT.getCode()); |
|
|
|
createPrivateMerchant(record); |
|
|
|
record.setStatus(EnumShopStatus.NOT_RENT.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
wxShopMapper.insert(record); |
|
|
|
@@ -408,6 +381,38 @@ public class WxShopServiceImpl implements WxShopService { |
|
|
|
return new ResultData(Result.SUCCESS,"更新成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void createPrivateMerchant(WxShop record) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxMerchant merchant = new WxMerchant(); |
|
|
|
merchant.updateTenantInfo(record); |
|
|
|
merchant.setName("[系统铺位号]"+record.getShopNumber()); |
|
|
|
merchant.setCreateFromData(record.getShopNumber()); |
|
|
|
merchant.setCreateFrom(EnumMerchantCreateFrom.SYS_SHOP_CREATE.getCode()); |
|
|
|
List<Long> ids = wxMerchantMapper.findIdList(merchant); |
|
|
|
if (null == ids || ids.size() <= 0 ) { |
|
|
|
merchant.setId(idWorker.nextId()); |
|
|
|
merchant.setLinkPerson("虚拟"); |
|
|
|
merchant.setLinkPhone("11111111111"); |
|
|
|
merchant.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
merchant.setImgUrl("https://formall.oss-accelerate.aliyuncs.com/234/WechatIMG5071.png"); |
|
|
|
merchant.setCoverPicture("[\"https://formall.oss-accelerate.aliyuncs.com/234/WechatIMG5071.png\"]"); |
|
|
|
merchant.setCreateDate(new Date()); |
|
|
|
merchant.setUpdateDate(new Date()); |
|
|
|
merchant.setIsPublic(EnumMerchantPublic.PRIVATE.getCode()); |
|
|
|
merchant.setIsPrivate(EnumYesOrNo.YES.getCode()); |
|
|
|
merchant.setBillSetting(3); |
|
|
|
merchant.setCreateFromId(String.valueOf(record.getId())); |
|
|
|
merchant.setCarVendorType(0); |
|
|
|
merchant.setBusinessId(com.iformall.utils.Constant.default_business); |
|
|
|
//merchant.setType(); |
|
|
|
merchant.setIsAdmin(EnumYesOrNo.NO.getCode()); |
|
|
|
merchant.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
|
merchant.setSearchCardByPhone(EnumYesOrNo.NO.getCode()); |
|
|
|
merchant.setCreditLocked(EnumYesOrNo.NO.getCode()); |
|
|
|
wxMerchantMapper.insert(merchant); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData deleteById(Long id, Integer isAdmin) { |
|
|
|
|