|  | @ -2,6 +2,7 @@ package com.yihu.jw.base.endpoint.wx;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONArray;
 | 
	
		
			
				|  |  | import com.yihu.jw.base.service.wx.WechatService;
 | 
	
		
			
				|  |  | import com.yihu.jw.base.service.wx.WxTemplateService;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.wx.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.base.wx.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
	
		
			
				|  | @ -9,10 +10,12 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ObjEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.base.BaseRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.base.WechatRequestMapping;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.http.MediaType;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
	
		
			
				|  | @ -27,6 +30,8 @@ public class WechatController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private WechatService wechatService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private WxTemplateService wxTemplateService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //====================微信与租户管理=======================
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -199,6 +204,13 @@ public class WechatController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseRequestMapping.WeChat.findDefaultReply)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取默认事件配置", notes = "获取默认事件配置")
 | 
	
		
			
				|  |  |     public ObjEnvelop<WxReplySceneVO> findDefaultReply(@ApiParam(name = "wechatId", value = "事件配置json")
 | 
	
		
			
				|  |  |                                                        @RequestParam(value = "wechatId", required = true)String wechatId) {
 | 
	
		
			
				|  |  |         return success(wechatService.findDefaultReply(wechatId),WxReplySceneVO.class);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.WeChat.findWxReplySceneExist)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "验证事件配置是否存在", notes = "验证事件配置是否存在")
 | 
	
		
			
				|  |  |     public Envelop findWxReplySceneExist(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
	
		
			
				|  | @ -224,11 +236,13 @@ public class WechatController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |                                                                       @RequestParam(value = "event", required = false)String event,
 | 
	
		
			
				|  |  |                                                                       @ApiParam(name = "content", value = "回复内容")
 | 
	
		
			
				|  |  |                                                                       @RequestParam(value = "content", required = false)String content,
 | 
	
		
			
				|  |  |                                                                       @ApiParam(name = "status", value = "删除状态")
 | 
	
		
			
				|  |  |                                                                       @RequestParam(value = "status", required = true)Integer status,
 | 
	
		
			
				|  |  |                                                                       @ApiParam(name = "page", value = "页数")
 | 
	
		
			
				|  |  |                                                                       @RequestParam(value = "page", required = true)Integer page,
 | 
	
		
			
				|  |  |                                                                       @ApiParam(name = "size", value = "每页大小")
 | 
	
		
			
				|  |  |                                                                       @RequestParam(value = "size", required = true)Integer size) {
 | 
	
		
			
				|  |  |         return wechatService.findWxReplyScene(wechatId, msgType, event, content, page, size);
 | 
	
		
			
				|  |  |         return wechatService.findWxReplyScene(wechatId, msgType, event, content,status, page, size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     //====================图文素材管理end============================
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -242,6 +256,27 @@ public class WechatController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |         return wechatService.saveWxTemp(wxTemplate);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.WeChat.findWxTempExist)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "判断微信模板(模板id且模板名称)是否存在", notes = "判断微信模板(模板id且模板名称)是否存在")
 | 
	
		
			
				|  |  |     public Envelop findWxTempExist(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
		
			
				|  |  |                                    @RequestParam(value = "wechatId", required = true)String wechatId,
 | 
	
		
			
				|  |  |                                    @ApiParam(name = "templateName", value = "微信模板名称")
 | 
	
		
			
				|  |  |                                    @RequestParam(value = "templateName", required = true)String templateName,
 | 
	
		
			
				|  |  |                                    @ApiParam(name = "templateId", value = "微信模板id(微信的同步的id)")
 | 
	
		
			
				|  |  |                                    @RequestParam(value = "templateId", required = true)String templateId) {
 | 
	
		
			
				|  |  |        return success(BaseRequestMapping.WeChat.api_success,wechatService.findWxTempExist(wechatId,templateId,templateName));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.WeChat.findWxTempNameExist)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "判断微信模板(模板名称)是否存在", notes = "判断微信模板(模板名称)是否存在")
 | 
	
		
			
				|  |  |     public Envelop findWxTempNameExist(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
		
			
				|  |  |                                        @RequestParam(value = "wechatId", required = true)String wechatId,
 | 
	
		
			
				|  |  |                                        @ApiParam(name = "templateName", value = "微信模板名称")
 | 
	
		
			
				|  |  |                                        @RequestParam(value = "templateName", required = true)String templateName) {
 | 
	
		
			
				|  |  |         return success(BaseRequestMapping.WeChat.api_success,wechatService.findWxTempNameExist(wechatId,templateName));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.WeChat.findWxtemp)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取微信模板消息基础信息(列表)", notes = "获取微信模板消息基础信息(列表)")
 | 
	
		
			
				|  |  |     public MixEnvelop<WxTemplateVO,WxTemplateVO> findWxtemp(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
	
		
			
				|  | @ -272,14 +307,18 @@ public class WechatController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     public MixEnvelop<WxTemplateConfigVO,WxTemplateConfigVO> findWxTempConfigList(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
		
			
				|  |  |                                                                                   @RequestParam(value = "wechatId", required = true)String wechatId,
 | 
	
		
			
				|  |  |                                                                                   @ApiParam(name = "scene", value = "微信场景值")
 | 
	
		
			
				|  |  |                                                                                   @RequestParam(value = "scene", required = true)String scene,
 | 
	
		
			
				|  |  |                                                                                   @RequestParam(value = "scene", required = false)String scene,
 | 
	
		
			
				|  |  |                                                                                   @ApiParam(name = "templateId", value = "微信公众号模板id")
 | 
	
		
			
				|  |  |                                                                                   @RequestParam(value = "templateId", required = false)String templateId,
 | 
	
		
			
				|  |  |                                                                                   @ApiParam(name = "page", value = "第几页")
 | 
	
		
			
				|  |  |                                                                                   @RequestParam(value = "page", required = true)Integer page,
 | 
	
		
			
				|  |  |                                                                                   @ApiParam(name = "size", value = "分页大小")
 | 
	
		
			
				|  |  |                                                                                   @RequestParam(value = "size", required = true)Integer size) {
 | 
	
		
			
				|  |  |         return wechatService.findWxTempConfigList(wechatId, scene, page, size);
 | 
	
		
			
				|  |  |         return wechatService.findWxTempConfigList(wechatId,templateId,scene, page, size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.WeChat.findWxTemplateConfig)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取微信模板列表(单条)", notes = "获取微信模板列表(单条)")
 | 
	
		
			
				|  |  |     public ObjEnvelop<WxTemplateConfigVO>  findWxTemplateConfig(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
	
		
			
				|  | @ -289,7 +328,22 @@ public class WechatController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |                                                                 @ApiParam(name = "scene", value = "场景值")
 | 
	
		
			
				|  |  |                                                                 @RequestParam(value = "scene", required = true)String scene) {
 | 
	
		
			
				|  |  |         return success(wechatService.findWxTemplateConfig(wechatId,name,scene), WxTemplateConfigVO.class);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = BaseRequestMapping.WeChat.findWxTemplateConfigExist)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "判断微信配置模板场景值是否存在", notes = "判断微信配置模板场景值是否存在(单条)")
 | 
	
		
			
				|  |  |     public Envelop findWxTemplateConfigExist(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
		
			
				|  |  |                                              @RequestParam(value = "wechatId", required = true)String wechatId,
 | 
	
		
			
				|  |  |                                              @ApiParam(name = "scene", value = "场景值")
 | 
	
		
			
				|  |  |                                              @RequestParam(value = "scene", required = true)String scene) {
 | 
	
		
			
				|  |  |         return success(BaseRequestMapping.WeChat.api_success,wechatService.findWxTemplateConfigExist(wechatId,scene));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseRequestMapping.WeChat.getAllTemp)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取所有微信模板(微信拉取)", notes = "获取所有微信模板(微信拉取)")
 | 
	
		
			
				|  |  |     public Envelop getAllTemp(@ApiParam(name = "wechatId", value = "微信id")
 | 
	
		
			
				|  |  |                               @RequestParam(value = "wechatId", required = true)String wechatId) {
 | 
	
		
			
				|  |  |         return wxTemplateService.getAllTemp(wechatId);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     //===================模板消息end==========================================
 | 
	
		
			
				|  |  | 
 |