|
@@ -8,6 +8,10 @@ import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
|
|
|
import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
|
|
|
import cn.newfeifan.mall.module.product.service.sku.ProductSkuService;
|
|
|
import cn.newfeifan.mall.module.product.service.spuapply.SpuApplyService;
|
|
|
+import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.template.DiyTemplateCreateReqVO;
|
|
|
+import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.template.DiyTemplateUpdateReqVO;
|
|
|
+import cn.newfeifan.mall.module.promotion.dal.dataobject.diy.DiyTemplateDO;
|
|
|
+import cn.newfeifan.mall.module.promotion.service.diy.DiyTemplateService;
|
|
|
import cn.newfeifan.mall.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
|
|
|
import cn.newfeifan.mall.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
import cn.newfeifan.mall.module.system.dal.mysql.user.AdminUserMapper;
|
|
@@ -23,7 +27,6 @@ import cn.newfeifan.mall.sale.dal.dataobject.merchantapply.MerchantApplyDO;
|
|
|
import cn.newfeifan.mall.sale.dal.mysql.merchant.MerchantMapper;
|
|
|
import cn.newfeifan.mall.sale.dal.mysql.merchantapply.MerchantApplyMapper;
|
|
|
import cn.newfeifan.mall.sale.dal.redis.ShopMessage;
|
|
|
-import cn.newfeifan.mall.sale.service.merchantapply.MerchantApplyService;
|
|
|
import cn.newfeifan.mall.sale.service.shop.ShopService;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -70,6 +73,8 @@ public class MerchantServiceImpl implements MerchantService {
|
|
|
private StringRedisTemplate stringRedisTemplate;
|
|
|
@Resource
|
|
|
private MerchantApplyMapper merchantApplyMapper;
|
|
|
+ @Resource
|
|
|
+ private DiyTemplateService diyTemplateService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -102,6 +107,11 @@ public class MerchantServiceImpl implements MerchantService {
|
|
|
HashMap<String, Long> stringLongHashMap = new HashMap<>();
|
|
|
stringLongHashMap.put("shopId", shopId);
|
|
|
stringLongHashMap.put("merId", merchant.getId());
|
|
|
+
|
|
|
+ // 创建店铺模板
|
|
|
+ DiyTemplateCreateReqVO build = DiyTemplateCreateReqVO.builder().merchantId(merchant.getId()).shopId(shopId).build();
|
|
|
+ build.setName(merchant.getName());
|
|
|
+ diyTemplateService.createDiyTemplate(build);
|
|
|
return stringLongHashMap;
|
|
|
}
|
|
|
|
|
@@ -116,6 +126,10 @@ public class MerchantServiceImpl implements MerchantService {
|
|
|
MerchantApplyDO bean = BeanUtils.toBean(updateReqVO, MerchantApplyDO.class);
|
|
|
bean.setId(updateObj.getMerchantApplyId());
|
|
|
merchantApplyMapper.updateById(bean);
|
|
|
+
|
|
|
+ DiyTemplateDO usedDiyTemplate = diyTemplateService.getUsedDiyTemplate(updateObj.getId());
|
|
|
+ usedDiyTemplate.setName(updateObj.getName());
|
|
|
+ diyTemplateService.updateDiyTemplate(BeanUtils.toBean(usedDiyTemplate, DiyTemplateUpdateReqVO.class));
|
|
|
}
|
|
|
|
|
|
@Override
|