| @@ -404,6 +404,14 @@ public class WxCoupon extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc") | @io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc") | ||||
| private String 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") | @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @@ -131,4 +131,6 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| WxCoupon selectOnlineCoupon(@Param("id")Long id, @Param("tenantId")String tenantId); | WxCoupon selectOnlineCoupon(@Param("id")Long id, @Param("tenantId")String tenantId); | ||||
| Long selectDraftId(@Param("couponId")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); | |||||
| } | } | ||||
| @@ -188,6 +188,18 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| List<Long> ids = wxCouponList.stream().map(p -> p.getId()).collect(toList()); | 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 wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.updateTenantInfo(wxCoupon); | wxCouponChannel.updateTenantInfo(wxCoupon); | ||||
| wxCouponChannel.setCouponIds(ids); | wxCouponChannel.setCouponIds(ids); | ||||
| @@ -196,7 +208,14 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| List<WxCouponChannel> list = wxCouponChannelMapper.findList(wxCouponChannel); | List<WxCouponChannel> list = wxCouponChannelMapper.findList(wxCouponChannel); | ||||
| if (!list.isEmpty()) { | if (!list.isEmpty()) { | ||||
| Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId)); | 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) { | if (groupBy.get(temp.getId()) != null) { | ||||
| List<Integer> channels = new ArrayList<>(); | List<Integer> channels = new ArrayList<>(); | ||||
| @@ -1621,4 +1621,16 @@ | |||||
| where c.`version` = 1 and coupon_id = #{couponId} and tenant_id = #{tenantId} | where c.`version` = 1 and coupon_id = #{couponId} and tenant_id = #{tenantId} | ||||
| </select> | </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> | </mapper> | ||||