| @@ -94,6 +94,7 @@ public class WxMsgController extends BaseController { | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | types.add(EnumTemplateType.LIVE_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.SEND_COUPON_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | 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); | ||||
| @@ -0,0 +1,11 @@ | |||||
| INSERT INTO `wx_template_msg`(`id`, `tenant_id`, `parent_tenant_id`, `template_id`, `type`, `custom_param`, `create_date`, `update_date`) | |||||
| select CEILING(RAND()*90000000000+10000000000) ,tenant_id,parent_tenant_id,'',51,'{\"index\": [\"thing1\", \"time3\", \"time4\", \"thing5\"], \"emphasis\": \"\"}',now(),now() | |||||
| from wx_mall | |||||
| where id != 1 and id != 10011 and id != 10071 and id != 10141 ; | |||||
| INSERT INTO `wx_template_msg`(`id`, `tenant_id`, `parent_tenant_id`, `template_id`, `type`, `custom_param`, `create_date`, `update_date`, `on_off`) VALUES (CEILING(RAND()*90000000000+10000000000), '1001', NULL, '', 51, '{\"index\": [\"character_string1\", \"character_string2\", \"time4\", \"thing3\"], \"emphasis\": \"\"}', '2021-07-12 17:00:00', '2021-07-12 17:00:00', 0); | |||||
| INSERT INTO `wx_template_msg`(`id`, `tenant_id`, `parent_tenant_id`, `template_id`, `type`, `custom_param`, `create_date`, `update_date`, `on_off`) VALUES (CEILING(RAND()*90000000000+10000000000), '1007', NULL, '', 51, '{\"index\": [\"character_string1\", \"character_string2\", \"time4\", \"thing3\"], \"emphasis\": \"\"}', '2021-07-12 17:00:00', '2021-07-12 17:00:00', 0); | |||||
| INSERT INTO `wx_template_msg`(`id`, `tenant_id`, `parent_tenant_id`, `template_id`, `type`, `custom_param`, `create_date`, `update_date`, `on_off`) VALUES (CEILING(RAND()*90000000000+10000000000), '1014', NULL, '', 51, '{\"index\": [\"character_string1\", \"character_string2\", \"time4\", \"thing3\"], \"emphasis\": \"\"}', '2021-07-12 17:00:00', '2021-07-12 17:00:00', 0); | |||||
| @@ -41,6 +41,7 @@ public class WxMsgController extends BaseController { | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | types.add(EnumTemplateType.LIVE_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.SEND_COUPON_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | 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); | ||||
| @@ -17,6 +17,7 @@ public enum EnumTemplateType { | |||||
| ACTIVITY_REMIND(4, "活动开始提醒","386"), // 小程序 | ACTIVITY_REMIND(4, "活动开始提醒","386"), // 小程序 | ||||
| LIVE_REMIND(5, "直播开播提醒","8501"), // 小程序 | LIVE_REMIND(5, "直播开播提醒","8501"), // 小程序 | ||||
| CREDIT_UPD_REMIND(50, "积分变更提醒","310"), // 小程序 | CREDIT_UPD_REMIND(50, "积分变更提醒","310"), // 小程序 | ||||
| SEND_COUPON_REMIND(51, "优惠券到账提醒","3209"), // 小程序 | |||||
| AUDIT_MESSAGE(101, "公众号审核结果通知",""), // 公众号 | AUDIT_MESSAGE(101, "公众号审核结果通知",""), // 公众号 | ||||
| VERIFY_RESULT(102, "公众号卡券核销通知",""), // 公众号 | VERIFY_RESULT(102, "公众号卡券核销通知",""), // 公众号 | ||||
| @@ -431,6 +431,19 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| customParam.getString("time4"), | customParam.getString("time4"), | ||||
| customParam.getString("thing3") | customParam.getString("thing3") | ||||
| )); | )); | ||||
| }else if(wxTemplateMsg.getType() == EnumTemplateType.SEND_COUPON_REMIND.getCode()){ | |||||
| /** | |||||
| * 券名称{{thing1.DATA}} | |||||
| * 获取时间{{time3.DATA}} | |||||
| * 过期日期{{time4.DATA}} | |||||
| * 备注{{thing5.DATA}} | |||||
| */ | |||||
| smartAppMsg.setDataList(Lists.newArrayList( | |||||
| customParam.getString("thing1"), | |||||
| customParam.getString("time3"), | |||||
| customParam.getString("time4"), | |||||
| customParam.getString("thing5") | |||||
| )); | |||||
| }else{ | }else{ | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -61,6 +61,10 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||||
| wxTemplateMsg.setType(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | wxTemplateMsg.setType(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | ||||
| wxTemplateMsg.setCustomParam("{\"index\": [\"character_string1\", \"character_string2\", \"time4\", \"thing3\"], \"emphasis\": \"\"}"); | wxTemplateMsg.setCustomParam("{\"index\": [\"character_string1\", \"character_string2\", \"time4\", \"thing3\"], \"emphasis\": \"\"}"); | ||||
| wxTemplateMsgMapper.insert(wxTemplateMsg); | wxTemplateMsgMapper.insert(wxTemplateMsg); | ||||
| wxTemplateMsg.setId(null); | |||||
| wxTemplateMsg.setType(EnumTemplateType.SEND_COUPON_REMIND.getCode()); | |||||
| wxTemplateMsg.setCustomParam("{\"index\": [\"thing1\", \"time3\", \"time4\", \"thing5\"], \"emphasis\": \"\"}"); | |||||
| wxTemplateMsgMapper.insert(wxTemplateMsg); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -142,6 +146,13 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||||
| } catch (WxErrorException e) { | } catch (WxErrorException e) { | ||||
| return new ResultData(ErrorCode.TEMPLATE_ADD_ERROR); | return new ResultData(ErrorCode.TEMPLATE_ADD_ERROR); | ||||
| } | } | ||||
| }else if(byId.getType() == EnumTemplateType.SEND_COUPON_REMIND.getCode()){ | |||||
| try { | |||||
| s = wxMaService.getSubscribeService().addTemplate(EnumTemplateType.SEND_COUPON_REMIND.getTid(), | |||||
| Lists.newArrayList(1, 3, 4, 5),EnumTemplateType.SEND_COUPON_REMIND.getMessage()); | |||||
| } catch (WxErrorException e) { | |||||
| return new ResultData(ErrorCode.TEMPLATE_ADD_ERROR); | |||||
| } | |||||
| }else{ | }else{ | ||||
| return new ResultData(ErrorCode.TEMPLATE_NOT_FOUND); | return new ResultData(ErrorCode.TEMPLATE_NOT_FOUND); | ||||
| } | } | ||||
| @@ -94,6 +94,7 @@ public class WxMsgController extends BaseController { | |||||
| types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | types.add(EnumTemplateType.ACTIVITY_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.LIVE_REMIND.getCode()); | types.add(EnumTemplateType.LIVE_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | types.add(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | ||||
| types.add(EnumTemplateType.SEND_COUPON_REMIND.getCode()); | |||||
| wxTemplateMsg.setTypes(types); | 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); | ||||