| @@ -26,6 +26,14 @@ public class WxTopicController extends BaseController { | |||||
| return new ResultData(wxTopicService.show(wxTopic)); | return new ResultData(wxTopicService.show(wxTopic)); | ||||
| } | } | ||||
| @GetMapping("showList") | |||||
| public ResultData showList() { | |||||
| logger.debug("[" + getIpAddr() + "] WxTopicController::showList"); | |||||
| WxTopic wxTopic = new WxTopic(); | |||||
| wxTopic.updateTenantInfo(getTenantInfo()); | |||||
| return new ResultData(wxTopicService.showList(wxTopic)); | |||||
| } | |||||
| @GetMapping("findById") | @GetMapping("findById") | ||||
| public ResultData findById(WxTopic wxTopic) { | public ResultData findById(WxTopic wxTopic) { | ||||
| logger.debug("[" + getIpAddr() + "] WxTopicController::findById"); | logger.debug("[" + getIpAddr() + "] WxTopicController::findById"); | ||||
| @@ -68,9 +68,6 @@ public class WxTopic extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="上架标志 1正在上架",name="isOnline") | @io.swagger.annotations.ApiModelProperty(value="上架标志 1正在上架",name="isOnline") | ||||
| private Integer isOnline; | private Integer isOnline; | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value="couponChannelId渠道ID",name="couponChannelId") | |||||
| private Long couponChannelId; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="小程序路径",name="weappPath") | @io.swagger.annotations.ApiModelProperty(value="小程序路径",name="weappPath") | ||||
| @@ -12,8 +12,10 @@ public interface WxTopicMapper extends CommonMapper<WxTopic, String> { | |||||
| List<WxTopic> findExist(WxTopic wxTopic); | List<WxTopic> findExist(WxTopic wxTopic); | ||||
| WxTopic show(WxTopic record); | WxTopic show(WxTopic record); | ||||
| List<WxTopic> showList(WxTopic record); | |||||
| void updateStatus(WxTopic record); | void updateStatus(WxTopic record); | ||||
| void couponDownLine(WxTopic record); | void couponDownLine(WxTopic record); | ||||
| } | } | ||||
| @@ -5,6 +5,8 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxTopic; | import com.iformall.domain.po.WxTopic; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import java.util.List; | |||||
| public interface WxTopicService { | public interface WxTopicService { | ||||
| /** | /** | ||||
| @@ -20,6 +22,9 @@ public interface WxTopicService { | |||||
| ResultData saveOrUpdate(WxTopic record); | ResultData saveOrUpdate(WxTopic record); | ||||
| WxTopic show(WxTopic record); | WxTopic show(WxTopic record); | ||||
| List<WxTopic> showList(WxTopic record); | |||||
| WxTopic findById(WxTopic record); | WxTopic findById(WxTopic record); | ||||
| } | } | ||||
| @@ -68,6 +68,15 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| return wxTopic; | return wxTopic; | ||||
| } | } | ||||
| @Override | |||||
| public List<WxTopic> showList(WxTopic record) { | |||||
| List<WxTopic> topicList = wxTopicMapper.showList(record); | |||||
| for (WxTopic topic:topicList) { | |||||
| topic.setCouponList(wxCouponMapper.findCouponByTopic(record)); | |||||
| } | |||||
| return topicList; | |||||
| } | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxTopic record) { | public ResultData saveOrUpdate(WxTopic record) { | ||||
| //验证是否存在已发放的专题 | //验证是否存在已发放的专题 | ||||
| @@ -18,7 +18,6 @@ | |||||
| <result column="createtime" property="createtime"/> | <result column="createtime" property="createtime"/> | ||||
| <result column="updatetime" property="updatetime"/> | <result column="updatetime" property="updatetime"/> | ||||
| <result column="bg_color" property="bgColor"/> | <result column="bg_color" property="bgColor"/> | ||||
| <result column="couponChannelId" property="couponChannelId"/> | |||||
| </resultMap> | </resultMap> | ||||
| @@ -83,13 +82,21 @@ | |||||
| </select> | </select> | ||||
| <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap"> | <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap"> | ||||
| select t.*,cc.id as couponChannelId from wx_topic t left join wx_coupon_channel cc on(cc.sub_target_id = t.id) | |||||
| select t.* from wx_topic t | |||||
| where t.status = 1 | where t.status = 1 | ||||
| and now() >= t.begin_time and now() <= t.end_time | and now() >= t.begin_time and now() <= t.end_time | ||||
| and t.tenant_id = #{tenantId} | and t.tenant_id = #{tenantId} | ||||
| order by t.begin_time desc limit 1 | order by t.begin_time desc limit 1 | ||||
| </select> | </select> | ||||
| <select id="showList" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap"> | |||||
| select t.* from wx_topic t | |||||
| where t.status = 1 | |||||
| and now() >= t.begin_time and now() <= t.end_time | |||||
| and t.tenant_id = #{tenantId} | |||||
| order by t.begin_time desc | |||||
| </select> | |||||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxTopic"> | <update id="updateStatus" parameterType="com.iformall.domain.po.WxTopic"> | ||||
| update wx_topic set status = 3 where id in( | update wx_topic set status = 3 where id in( | ||||
| select t.id from ( | select t.id from ( | ||||