diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 698d3350b..28823db69 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -13,6 +13,7 @@ import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.po.WxCouponPassword; import com.iformall.domain.po.WxPayAccount; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.TtCouponVo; import com.iformall.domain.vo.WxCouponStatisVo; import com.iformall.douyin.web.bean.GoodsTemplateGet; import com.iformall.enums.*; @@ -69,6 +70,25 @@ public class WxCouponController extends BaseController { @Qualifier("objectCommonRedisTemplate") RedisTemplate redisTemplate; + @ApiOperation("分页列表接口") + @GetMapping("ttgoodslist") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + @SystemControllerLog(description = "-列表") + public ResultData ttgoodslist(@ModelAttribute TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCouponController::ttgoodslist"); + if (ttCouponVo == null) ttCouponVo = new TtCouponVo(); + ttCouponVo.updateTenantInfo(getTenantInfo()); + ttCouponVo.setType(EnumCouponType.COUPON_DOUYIN.getCode()); + if(StringUtils.isNotBlank(ttCouponVo.getSortColumn())){ + String coryColumn = "c."+ttCouponVo.getSortColumns(); + ttCouponVo.setSortColumns(coryColumn); + ttCouponVo.setSortColumn(null); + } + return wxCouponService.ttgoodslist(ttCouponVo, pageNum, pageSize); + } + @ApiOperation("分页列表接口") @GetMapping("list") @ApiImplicitParams({ @@ -597,7 +617,7 @@ public class WxCouponController extends BaseController { if(couponId == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } - WxCoupon coupon = wxCouponService.getById(couponId, getTenantInfo().getTenantId()); + WxCoupon coupon = wxCouponService.getAttrsById(couponId, getTenantInfo().getTenantId()); if(coupon == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/TtCouponVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/TtCouponVo.java new file mode 100644 index 000000000..059c519b5 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/TtCouponVo.java @@ -0,0 +1,34 @@ +package com.iformall.domain.vo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.iformall.domain.po.WxCoupon; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class TtCouponVo extends WxCoupon implements Serializable { + private static final long serialVersionUID = 1L; + + @io.swagger.annotations.ApiModelProperty(value="couponChannelId",name="couponChannelId") + private Long couponChannelId; + + @io.swagger.annotations.ApiModelProperty(value="spuId",name="spuId") + private String spuId; + + @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="status") + private Integer status; + + @io.swagger.annotations.ApiModelProperty(value="描述",name="statusDesc") + private String statusDesc; + + @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="lastStatus") + private Integer lastStatus; + + @io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc") + private String lastStatusDesc; +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 6e5f61e64..40dc53672 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -30,6 +30,8 @@ public interface WxCouponMapper extends CommonMapper { List findSendCouponIds(@Param("expired")Integer expired,@Param("tenantId")String tenantId); WxCoupon selectById(@Param("id")Long id,@Param("tenantId")String tenantId); + + WxCoupon getAttrsById(@Param("id")Long id, @Param("tenantId")String tenantId); WxCoupon getPriceAndStock(@Param("id")Long id,@Param("tenantId")String tenantId); List batchGetPriceAndStock(@Param("ids")List ids,@Param("tenantId")String tenantId); @@ -118,4 +120,5 @@ public interface WxCouponMapper extends CommonMapper { List newfindCList(WxCoupon couponQ); List findIdsListHasConditons(WxCoupon couponQ); + } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index a20127341..e518b9f44 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -9,12 +9,14 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.TtCouponVo; import com.iformall.domain.vo.WxCouponCVo; import com.iformall.domain.vo.WxCouponStatisVo; import com.iformall.domain.vo.WxMerchantVo; public interface WxCouponService { + ResultData ttgoodslist(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize); ResultData list(TenantEntity tenantEntity,WxCoupon wxCoupon, Integer pageNum, Integer pageSize); @@ -79,6 +81,8 @@ public interface WxCouponService { WxCouponCVo getVoById(Long id,String tenantId); WxCouponCVo getVoStatusById(Long id,String tenantId); + + WxCoupon getAttrsById(Long couponId, String tenantId); /** * 保存或更新实体 * @@ -274,4 +278,6 @@ public interface WxCouponService { ResultData productSave(WxCoupon coupon); + + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/TtGoodsCategoryServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/TtGoodsCategoryServiceImpl.java index e818c1538..89f352856 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/TtGoodsCategoryServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/TtGoodsCategoryServiceImpl.java @@ -125,7 +125,6 @@ public class TtGoodsCategoryServiceImpl implements TtGoodsCategoryService { @Override public void handTemplate(GoodsTemplateGet temp, WxCoupon coupon) { if(!coupon.getProductAttrKeyValueMap().isEmpty()){ - List productAttrs = new ArrayList<>(); for (GoodsTemplateGet.ProductAttrs attr: temp.getProductAttrs()) { String value = coupon.getProductAttrKeyValueMap().get(attr.getKey()); if(StringUtils.isNotBlank(value)){ 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 b20c43620..26fc53f8a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -57,7 +57,7 @@ import static java.util.stream.Collectors.toList; @Service -public class WxCouponServiceImpl
implements WxCouponService { +public class WxCouponServiceImpl implements WxCouponService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired @@ -140,6 +140,11 @@ public class WxCouponServiceImpl
implements WxCouponService { @Autowired private MqBaseProducer mqBaseProducer; + @Override + public ResultData ttgoodslist(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { + return null; + } + @Override public ResultData list(TenantEntity tenantEntity,WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { if (null == wxCoupon) wxCoupon = new WxCoupon(); @@ -302,6 +307,11 @@ public class WxCouponServiceImpl
implements WxCouponService { return wxCouponCVo; } + @Override + public WxCoupon getAttrsById(Long id, String tenantId) { + return wxCouponMapper.getAttrsById(id,tenantId); + } + private Long parseMerchantId(JSONObject merchantParam){ return Long.valueOf(merchantParam.getString("id")); diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 018e82805..f7069666d 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -326,6 +326,19 @@ + + + + + + + + + +