| @@ -12,6 +12,7 @@ import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.msg.WxMsg; | import com.iformall.domain.po.msg.WxMsg; | ||||
| import com.iformall.enums.EnumSendWay; | import com.iformall.enums.EnumSendWay; | ||||
| import com.iformall.enums.EnumTemplateType; | |||||
| import com.iformall.service.WxMsgService; | import com.iformall.service.WxMsgService; | ||||
| import com.iformall.service.WxTemplateMsgService; | import com.iformall.service.WxTemplateMsgService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -71,6 +72,29 @@ public class WxMsgController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | ||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | ||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | wxTemplateMsg.updateTenantInfo(getTenantInfo()); | ||||
| List<Integer> types = new ArrayList<>(); | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("模板分页列表接口") | |||||
| @GetMapping("templateListV1") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "moban-列表") | |||||
| public ResultData templateListV1(@ModelAttribute WxTemplateMsg wxTemplateMsg, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | |||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | |||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | |||||
| List<Integer> types = new ArrayList<>(); | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxTemplateMsg; | import com.iformall.domain.po.WxTemplateMsg; | ||||
| import com.iformall.enums.EnumTemplateType; | |||||
| import com.iformall.service.WxTemplateMsgService; | import com.iformall.service.WxTemplateMsgService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -12,6 +13,9 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -33,6 +37,11 @@ public class WxMsgController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | ||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | ||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | wxTemplateMsg.updateTenantInfo(getTenantInfo()); | ||||
| List<Integer> types = new ArrayList<>(); | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -33,6 +33,9 @@ public class WxTemplateMsg extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String typeName; | private String typeName; | ||||
| @TableField(exist = false) | |||||
| private List<Integer> types; | |||||
| public String getTypeName(){ | public String getTypeName(){ | ||||
| if(this.getType() != null) { | if(this.getType() != null) { | ||||
| @@ -12,8 +12,7 @@ public enum EnumTemplateType { | |||||
| PRESS_SUCCESS(3, "砍价成功消息",""), // 小程序(作废) | PRESS_SUCCESS(3, "砍价成功消息",""), // 小程序(作废) | ||||
| /** | /** | ||||
| * *******(4...99)留作模板消息 | |||||
| * *******(4...49)留作全局推送 | |||||
| * | |||||
| */ | */ | ||||
| ACTIVITY_REMIND(4, "活动开始提醒","386"), // 小程序 | ACTIVITY_REMIND(4, "活动开始提醒","386"), // 小程序 | ||||
| LIVE_REMIND(5, "直播开播提醒","8501"), // 小程序 | LIVE_REMIND(5, "直播开播提醒","8501"), // 小程序 | ||||
| @@ -50,6 +50,12 @@ | |||||
| <if test=" null != onOff "> | <if test=" null != onOff "> | ||||
| and `on_off` = #{onOff} | and `on_off` = #{onOff} | ||||
| </if> | </if> | ||||
| <if test=" null != types "> | |||||
| and `type` in | |||||
| <foreach collection="types" index="index" item="item" open="(" separator="," close=")"> | |||||
| #{item} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -71,7 +77,6 @@ | |||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_template_msg | from wx_template_msg | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| and `type` > 3 and `type` < 50 | |||||
| </select> | </select> | ||||
| @@ -12,6 +12,7 @@ import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.msg.WxMsg; | import com.iformall.domain.po.msg.WxMsg; | ||||
| import com.iformall.enums.EnumSendWay; | import com.iformall.enums.EnumSendWay; | ||||
| import com.iformall.enums.EnumTemplateType; | |||||
| import com.iformall.service.WxMsgService; | import com.iformall.service.WxMsgService; | ||||
| import com.iformall.service.WxTemplateMsgService; | import com.iformall.service.WxTemplateMsgService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -71,6 +72,29 @@ public class WxMsgController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | ||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | ||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | wxTemplateMsg.updateTenantInfo(getTenantInfo()); | ||||
| List<Integer> types = new ArrayList<>(); | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("模板分页列表接口") | |||||
| @GetMapping("templateListV1") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "moban-列表") | |||||
| public ResultData templateListV1(@ModelAttribute WxTemplateMsg wxTemplateMsg, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgController::list"); | |||||
| if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg(); | |||||
| wxTemplateMsg.updateTenantInfo(getTenantInfo()); | |||||
| List<Integer> types = new ArrayList<>(); | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | |||||
| types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | |||||
| final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPageForMiniApp(wxTemplateMsg, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||