From 24434ba800559a6b79b22739544c8e1bf14b5d8d Mon Sep 17 00:00:00 2001 From: xhxu Date: Thu, 11 Aug 2022 14:50:59 +0800 Subject: [PATCH] // theme --- .../controller/app/WxAppinfoController.java | 36 ++++++++++----- .../basic/WxCustomizeModuleController.java | 45 +++++++++++++++++-- .../basic/WxMiniappThemeController.java | 41 ++++++++--------- .../iformall/controller/WxInfoController.java | 16 +++---- .../WxCustomizeModuleController.java | 27 +++++++++-- .../com/iformall/enums/EnumCouponType.java | 4 +- .../com/iformall/enums/EnumThemeType.java | 5 ++- .../iformall/service/WxAppinfoService.java | 6 --- .../service/WxCustomizeModuleService.java | 4 +- .../service/impl/WxAppinfoServiceImpl.java | 33 ++++++++------ .../service/impl/WxCouponServiceImpl.java | 3 +- .../impl/WxCustomizeModuleServiceImpl.java | 8 ++-- 12 files changed, 148 insertions(+), 80 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java index 7de072c6e..e0dc5d915 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java @@ -184,31 +184,43 @@ public class WxAppinfoController extends BaseController { @GetMapping("/getAppMouldType") public ResultData getAppMouldType(Integer plat) { logger.debug("[" + getIpAddr() + "] WxAppinfoController::getAppMouldType"); - -// if(plat == null){ -// plat = EnumAppPlat.WX.getCode(); -// } + EnumAppPlat enumPlat = EnumAppPlat.getByCode(plat); + if(enumPlat == null){ + enumPlat = EnumAppPlat.WX; + } // EnumAppPlat byCode = EnumAppPlat.getByCode(plat); // if(byCode == null){ // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); // } - WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(getTenantInfo().getTenantId(), null); + WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(getTenantInfo().getTenantId(), enumPlat); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND); + } return new ResultData(new WxAppinfo(cAppInfo.getMouldType())); } @PostMapping("updateAppMouldType") - @SystemControllerLog(description = "修改小程序首页风格") + @SystemControllerLog(description = "修改微信小程序首页风格") public ResultData updateAppMouldType(@RequestBody WxAppinfo appinfo) { logger.debug("[" + getIpAddr() + "] WxAppinfoController::updateAppMouldType"); if(appinfo.getMouldType() == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } -// WxAppinfo updateAppinfo = new WxAppinfo(); -// updateAppinfo.setId(appinfo.getId()); -// updateAppinfo.setMouldType(appinfo.getMouldType()); -// updateAppinfo.updateTenantInfo(ifParentUpdateAloneTenantInfo()); -// wxAppinfoService.saveOrUpdate(updateAppinfo); - wxAppinfoService.updateCMouldType(getTenantInfo(),appinfo.getMouldType()); + EnumAppPlat plat = EnumAppPlat.getByCode(appinfo.getPlat()); + if(plat == null){ + plat = EnumAppPlat.WX; + } + + WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(getTenantInfo().getTenantId(), plat); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND); + } + + WxAppinfo updateAppinfo = new WxAppinfo(); + updateAppinfo.setId(cAppInfo.getId()); + updateAppinfo.setMouldType(appinfo.getMouldType()); + updateAppinfo.updateTenantInfo(getTenantInfo()); + wxAppinfoService.saveOrUpdate(updateAppinfo); return new ResultData(); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxCustomizeModuleController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxCustomizeModuleController.java index 97ccea76b..70930de85 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxCustomizeModuleController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxCustomizeModuleController.java @@ -6,9 +6,12 @@ import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.WxAppinfo; import com.iformall.domain.po.WxCustomizeModule; +import com.iformall.enums.EnumAppPlat; import com.iformall.enums.EnumThemeType; import com.iformall.enums.EnumYesOrNo; +import com.iformall.service.WxAppinfoService; import com.iformall.service.WxCustomizeModuleService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -30,15 +33,18 @@ public class WxCustomizeModuleController extends BaseController { @Autowired WxCustomizeModuleService wxCustomizeModuleService; + @Autowired + WxAppinfoService wxAppinfoService; + @ApiOperation("查询CustomizeModule列表") @GetMapping(value = "/getDesc") @SystemControllerLog(description = "查询CustomizeModule列表") - public ResultData getDesc() { + public ResultData getDesc(Integer themeType) { logger.debug("[" + getIpAddr() + "] WxCustomizeModuleController::getDesc"); try { WxCustomizeModule wxCustomizeModule = new WxCustomizeModule(); wxCustomizeModule.updateTenantInfo(getTenantInfo()); - if(wxCustomizeModule.getThemeType() == null){ + if(themeType == null){ wxCustomizeModule.setThemeType(EnumThemeType.C.getCode()); } wxCustomizeModule.setIsUsing(EnumYesOrNo.YES.getCode()); @@ -92,7 +98,23 @@ public class WxCustomizeModuleController extends BaseController { if(wxCustomizeModule.getThemeType() == null){ wxCustomizeModule.setThemeType(EnumThemeType.C.getCode()); } - List aDefault = wxCustomizeModuleService.findDefault(wxCustomizeModule); + WxAppinfo cAppInfo = null; + if(EnumThemeType.C.getCode().equals(wxCustomizeModule.getThemeType())){ + cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到微信C端小程序"); + } + }else if(EnumThemeType.TT_C.getCode().equals(wxCustomizeModule.getThemeType())){ + cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到抖音C端小程序"); + } + } + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到C端小程序"); + } + + List aDefault = wxCustomizeModuleService.findDefault(wxCustomizeModule,cAppInfo); PageInfo page = new PageInfo(aDefault); return new ResultData(page); }catch (Exception e){ @@ -113,7 +135,22 @@ public class WxCustomizeModuleController extends BaseController { if(wxCustomizeModule.getThemeType() == null){ wxCustomizeModule.setThemeType(EnumThemeType.C.getCode()); } - return wxCustomizeModuleService.updateDefault(wxCustomizeModule); + WxAppinfo cAppInfo = null; + if(EnumThemeType.C.getCode().equals(wxCustomizeModule.getThemeType())){ + cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到微信C端小程序"); + } + }else if(EnumThemeType.TT_C.getCode().equals(wxCustomizeModule.getThemeType())){ + cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到抖音C端小程序"); + } + } + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到C端小程序"); + } + return wxCustomizeModuleService.updateDefault(wxCustomizeModule,cAppInfo); } @ApiOperation("根据id查询接口") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java index e8472708a..a2e214f7e 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java @@ -6,33 +6,18 @@ import com.iformall.annotation.TenantIgnore; import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; -import com.iformall.config.WechatWebProperties; import com.iformall.controller.base.BaseController; import com.iformall.domain.po.*; -import com.iformall.domain.po.base.TenantEntity; -import com.iformall.domain.vo.WxWeappInfo; import com.iformall.enums.*; import com.iformall.service.*; -import com.iformall.shiro.PasswordHelper; -import com.iformall.utils.Constant; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - @RestController @Api(description = "MiniappTheme相关接口") @RequestMapping("wxMiniappTheme") @@ -59,8 +44,22 @@ public class WxMiniappThemeController extends BaseController { if(wxMiniappTheme.getType() == null){ wxMiniappTheme.setType(EnumThemeType.C.getCode()); } - WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), null); - wxMiniappTheme.setMouldType(cAppInfo.getMouldType()); + if(EnumThemeType.C.getCode().equals(wxMiniappTheme.getType())){ + WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到微信C端小程序"); + } + wxMiniappTheme.setMouldType(cAppInfo.getMouldType()); + }else if(EnumThemeType.TT_C.getCode().equals(wxMiniappTheme.getType())){ + WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到抖音C端小程序"); + } + wxMiniappTheme.setMouldType(cAppInfo.getMouldType()); + } + if(wxMiniappTheme.getMouldType() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请先确认模板类型"); + } PageInfo page = wxMiniappThemeService.listAsPage(wxMiniappTheme, pageNum, pageSize); if(page.getList() != null && page.getList().size() > 0){ @@ -111,9 +110,7 @@ public class WxMiniappThemeController extends BaseController { wxThemeMall.setTenantId(getTenantInfo().getTenantId()); wxThemeMall.setMouldType(theme.getMouldType()); - if(wxThemeMall.getThemeType() == null){ - wxThemeMall.setThemeType(EnumThemeType.C.getCode()); - } + wxThemeMall.setThemeType(theme.getType()); wxMiniappThemeService.updateEffect(wxThemeMall); return new ResultData(Result.SUCCESS); @@ -141,10 +138,14 @@ public class WxMiniappThemeController extends BaseController { if(wxMiniappTheme == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } + wxMiniappTheme.setTenantId(getTenantInfo().getTenantId()); if(wxMiniappTheme.getType() == null){ wxMiniappTheme.setType(EnumThemeType.C.getCode()); } + if(wxMiniappTheme.getMouldType() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"请确认模板类型"); + } wxMiniappThemeService.saveOrUpdate(wxMiniappTheme); return new ResultData(); } diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java index ec71cf01c..cf534d0c2 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java @@ -525,14 +525,14 @@ public class WxInfoController extends BaseController { @GetMapping("/getAppMouldType") public ResultData getAppMouldType(Integer plat) { logger.debug("[" + getIpAddr() + "] WxAppinfoController::getAppMouldType"); -// if(plat == null){ -// plat = EnumAppPlat.WX.getCode(); -// } -// EnumAppPlat byCode = EnumAppPlat.getByCode(plat); -// if(byCode == null){ -// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); -// } - WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(getTenantInfo().getTenantId(), null); + EnumAppPlat enumPlat = EnumAppPlat.getByCode(plat); + if(enumPlat == null){ + enumPlat = EnumAppPlat.WX; + } + WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(getTenantInfo().getTenantId(), enumPlat); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND); + } return new ResultData(new WxAppinfo(cAppInfo.getMouldType())); } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCustomizeModuleController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCustomizeModuleController.java index d012d001b..1cf742de2 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCustomizeModuleController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCustomizeModuleController.java @@ -2,9 +2,12 @@ package com.iformall.controller; import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; +import com.iformall.domain.po.WxAppinfo; import com.iformall.domain.po.WxCustomizeModule; +import com.iformall.enums.EnumAppPlat; import com.iformall.enums.EnumThemeType; import com.iformall.enums.EnumYesOrNo; +import com.iformall.service.WxAppinfoService; import com.iformall.service.WxCustomizeModuleService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,20 +28,38 @@ public class WxCustomizeModuleController extends BaseController { @Autowired WxCustomizeModuleService wxCustomizeModuleService; + @Autowired + WxAppinfoService wxAppinfoService; + @ApiOperation("查询CustomizeModule列表") @GetMapping(value = "/list") - public ResultData getList() { + public ResultData getList(Integer themeType) { logger.debug("[" + getIpAddr() + "] WxCustomizeModuleController::getList"); try { WxCustomizeModule wxCustomizeModule = new WxCustomizeModule(); wxCustomizeModule.updateTenantInfo(getTenantInfo()); - if(wxCustomizeModule.getThemeType() == null){ + if(themeType == null){ wxCustomizeModule.setThemeType(EnumThemeType.C.getCode()); } wxCustomizeModule.setIsUsing(EnumYesOrNo.YES.getCode()); List list = wxCustomizeModuleService.findList(wxCustomizeModule); if(list == null || list.size() < 4 || list.size() > 8){ - list = wxCustomizeModuleService.findDefault(wxCustomizeModule); + WxAppinfo cAppInfo = null; + if(EnumThemeType.C.getCode().equals(wxCustomizeModule.getThemeType())){ + cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到微信C端小程序"); + } + }else if(EnumThemeType.TT_C.getCode().equals(wxCustomizeModule.getThemeType())){ + cAppInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到抖音C端小程序"); + } + } + if(cAppInfo == null){ + return new ResultData(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未找到C端小程序"); + } + list = wxCustomizeModuleService.findDefault(wxCustomizeModule,cAppInfo); } return new ResultData(list); }catch (Exception e){ diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCouponType.java b/mallinkService/src/main/java/com/iformall/enums/EnumCouponType.java index 1c5a70726..f6fa467ff 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumCouponType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCouponType.java @@ -63,10 +63,10 @@ public enum EnumCouponType { return message; } - //只有抖音卷才能同步poi - public static List getSpuSyncType(){ + public static List getDouYinType(){ List typeList = new ArrayList<>(); typeList.add(COUPON_DOUYIN.getCode()); return typeList; } + } diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumThemeType.java b/mallinkService/src/main/java/com/iformall/enums/EnumThemeType.java index cba483833..c1d1aae1b 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumThemeType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumThemeType.java @@ -5,11 +5,12 @@ package com.iformall.enums; */ public enum EnumThemeType { - // 1-B端, 2-C端, 3-服务号, 4-订阅号 + // A(0, "A端"), B(1, "B端"), - C(2, "C端"), + C(2, "微信C端"), + TT_C(3, "抖音C端"), ; public static EnumThemeType getEnum(Integer code) { diff --git a/mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java b/mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java index 3123d1d9c..752c04d69 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java @@ -88,10 +88,4 @@ public interface WxAppinfoService { WxAppinfo getCAppInfoFromRedis(String tenantId, EnumAppPlat appPlat); - /** - * 修改所有C端风格 - * - * @param - */ - void updateCMouldType(TenantEntity tenantEntity, Integer mouldType); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCustomizeModuleService.java b/mallinkService/src/main/java/com/iformall/service/WxCustomizeModuleService.java index 367dd6611..1a8d8508b 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCustomizeModuleService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCustomizeModuleService.java @@ -23,7 +23,7 @@ public interface WxCustomizeModuleService { */ int updateDel(WxCustomizeModule record); - List findDefault(WxCustomizeModule record); + List findDefault(WxCustomizeModule record, WxAppinfo cAppInfo); - ResultData updateDefault(WxCustomizeModule record); + ResultData updateDefault(WxCustomizeModule record, WxAppinfo cAppInfo); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java index 3823f0930..737d4964d 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java @@ -10,6 +10,7 @@ import com.iformall.domain.po.WxProjectConfig; import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumAppPlat; import com.iformall.enums.EnumAppType; +import com.iformall.enums.EnumCouponType; import com.iformall.enums.EnumPayWay; import com.iformall.mapper.WxAppinfoMapper; import com.iformall.service.WxAppinfoService; @@ -45,6 +46,8 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { WxAppinfo appinfoQ = new WxAppinfo(); if (appPlat != null) { appinfoQ.setPlat(appPlat.getCode()); + }else{ + return null; } appinfoQ.updateTenantInfo(tenantEntity); @@ -62,6 +65,8 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { WxAppinfo appinfoQ = new WxAppinfo(); if (appPlat != null) { appinfoQ.setPlat(appPlat.getCode()); + }else{ + return null; } appinfoQ.updateTenantInfo(tenantEntity); @@ -75,7 +80,17 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { @Override public WxAppinfo getCouponAppInfo(WxCoupon coupon) { - return 111111111111111111; + if(coupon != null && coupon.getType() != null){ + //todo + //抖音券---抖音平台 + //其他---微信平台 + if(EnumCouponType.getDouYinType().contains(coupon.getType())){ + return this.getCAppInfo(coupon,EnumAppPlat.TOUTIAO); + }else{ + return this.getCAppInfo(coupon,EnumAppPlat.WX); + } + } + return null; } @Override @@ -172,6 +187,9 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { @Override public WxAppinfo getCAppInfoFromRedis(String tenantId, EnumAppPlat plat) { WxAppinfo record = null; + if(plat == null){ + return null; + } String key = Constant.appinfoPrev + tenantId + "-" + plat + "-" + EnumAppType.C.getCode(); record = RedisCacheUtils.getCacheObject(wxAppinfoRedisTemplate, key, WxAppinfo.class); @@ -186,19 +204,6 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { return record; } - @Override - @Transactional(rollbackFor = {Exception.class}) - public void updateCMouldType(TenantEntity tenantEntity, Integer mouldType) { - WxAppinfo appinfoQ = new WxAppinfo(); - appinfoQ.updateTenantInfo(tenantEntity); - appinfoQ.setType(EnumAppType.C.getCode()); - List appList = wxAppinfoMapper.selectList(new QueryWrapper(appinfoQ)); - for (WxAppinfo appinfo:appList) { - appinfo.setMouldType(mouldType); - this.saveOrUpdate(appinfo); - } - } - private void deleteRedis(Long id){ WxAppinfo record = this.getById(id); if(record != null){ diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 14c7dfb15..f573ce5dc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -634,8 +634,7 @@ public class WxCouponServiceImpl implements WxCouponService { return new ResultData(); } if(record.getSalePrice() != null && record.getSalePrice() > 0) { - //todo 目前模式下券只能在一个平台下卖,即一个广场只有一个C端 - WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(record, null); + WxAppinfo cAppInfo = wxAppinfoService.getCouponAppInfo(record); if (cAppInfo == null) { return new ResultData(ErrorCode.APP_ID_NOT_FOUND); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java index 832d8e962..2b8ec2294 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java @@ -57,9 +57,7 @@ public class WxCustomizeModuleServiceImpl implements WxCustomizeModuleService { } @Override - public List findDefault(WxCustomizeModule record) { - //获取风格 - WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(record, null); + public List findDefault(WxCustomizeModule record, WxAppinfo cAppInfo) { //获取主题 WxThemeMall wxThemeMall = new WxThemeMall(); wxThemeMall.setTenantId(record.getTenantId()); @@ -88,8 +86,8 @@ public class WxCustomizeModuleServiceImpl implements WxCustomizeModuleService { @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) - public ResultData updateDefault(WxCustomizeModule record) { - List aDefault = this.findDefault(record); + public ResultData updateDefault(WxCustomizeModule record, WxAppinfo cAppInfo) { + List aDefault = this.findDefault(record, cAppInfo); //删除旧数据 wxCustomizeModuleMapper.updateDelByTenantId(record); //创建新数据