Browse Source

//..coupon_

release_toaliyun_real
xhxu 2 years ago
parent
commit
8bf0803ba7
4 changed files with 42 additions and 1 deletions
  1. +8
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +20
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  4. +12
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 8
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java View File

@@ -404,6 +404,14 @@ public class WxCoupon extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc")
private String lastStatusDesc;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="poiStatus")
private Integer draftPoiStatus;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="描述",name="statusDesc")
private String draftStatusDesc;

@io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel")
private Integer isDel;


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java View File

@@ -131,4 +131,6 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
WxCoupon selectOnlineCoupon(@Param("id")Long id, @Param("tenantId")String tenantId);

Long selectDraftId(@Param("couponId")Long id,@Param("tenantId")String tenantId);

List<TtCouponVo> findDraftStatus(@Param("tenantId")String tenantId, @Param("ids")List<Long> ids);
}

+ 20
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -188,6 +188,18 @@ public class WxCouponServiceImpl implements WxCouponService {
}

List<Long> ids = wxCouponList.stream().map(p -> p.getId()).collect(toList());

//处理抖音草稿数据
Map<Long ,TtCouponVo> draftStatusMap = new HashMap<>();
if(EnumAppPlat.TOUTIAO.getCode().equals(wxCoupon.getPlat())){
List<TtCouponVo> draftStatus = wxCouponMapper.findDraftStatus(tenantEntity.getTenantId(),ids);
for (TtCouponVo vo:draftStatus) {
draftStatusMap.put(vo.getCouponId(),vo);
}
}



WxCouponChannel wxCouponChannel = new WxCouponChannel();
wxCouponChannel.updateTenantInfo(wxCoupon);
wxCouponChannel.setCouponIds(ids);
@@ -196,7 +208,14 @@ public class WxCouponServiceImpl implements WxCouponService {
List<WxCouponChannel> list = wxCouponChannelMapper.findList(wxCouponChannel);
if (!list.isEmpty()) {
Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId));
for (WxCoupon temp : wxCouponList) {
for (WxCoupon temp: wxCouponList) {
if(!draftStatusMap.isEmpty()){
TtCouponVo draft = draftStatusMap.get(temp.getId());
if(draft != null){
temp.setDraftPoiStatus(draft.getPoiStatus());
temp.setDraftStatusDesc(draft.getStatusDesc());
}
}

if (groupBy.get(temp.getId()) != null) {
List<Integer> channels = new ArrayList<>();


+ 12
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -1621,4 +1621,16 @@
where c.`version` = 1 and coupon_id = #{couponId} and tenant_id = #{tenantId}
</select>

<select id="findDraftStatus" parameterType="com.iformall.domain.vo.TtCouponVo" resultMap="TtCouponVoResultMap">
select c.`id`,c.`coupon_id`,c.`version`,c.`tenant_id`,c.`parent_tenant_id`,
,poi.status poi_status,poi.status_desc
from wx_coupon c
left join tt_coupon_channel_poi poi on poi.id = c.id
where c.`version` = 1 and tenant_id = #{tenantId}
and coupon_id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</select>

</mapper>

Loading…
Cancel
Save