配置场馆和管理员挂钩发送微信消息
This commit is contained in:
@@ -4,6 +4,7 @@ import com.enums.VenueTypeEnum;
|
||||
import com.sv.entity.Constants;
|
||||
import com.sv.entity.Venue;
|
||||
import com.sv.entity.VenueLesson;
|
||||
import com.sv.mapper.WxConfigMapper;
|
||||
import com.sv.service.api.VenueLessonService;
|
||||
import com.sv.service.api.VenueService;
|
||||
import com.sv.service.api.util.DateUtilCard;
|
||||
@@ -12,12 +13,14 @@ import com.sv.service.message.SendMsg;
|
||||
import com.sv.service.message.WeiXinSendUtils;
|
||||
import com.ydd.framework.core.common.dto.ResponseDTO;
|
||||
import com.ydd.framework.core.controller.BaseApiController;
|
||||
import com.ydd.oms.entity.sys.WxConfig;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -65,6 +68,8 @@ public class SmsController extends BaseApiController {
|
||||
VenueLessonService venueLessonService;
|
||||
@Resource
|
||||
VenueService venueService;
|
||||
@Resource
|
||||
WeiXinSendUtils weiXinSendUtils;
|
||||
@RequestMapping(value = "/test/send/wx/message",method = RequestMethod.GET)
|
||||
public String sendTestMessage() {
|
||||
VenueLesson venueLesson = venueLessonService.findById(30858);
|
||||
@@ -82,10 +87,24 @@ public class SmsController extends BaseApiController {
|
||||
if (!StringUtils.isEmpty(openId)) {
|
||||
String[] split = openId.split(",");
|
||||
for (String s : split) {
|
||||
WeiXinSendUtils.sendCard(sendMsg,s);
|
||||
weiXinSendUtils.sendCard(sendMsg,s);
|
||||
}
|
||||
}
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@Resource
|
||||
WxConfigMapper wxConfigMapper;
|
||||
@RequestMapping(value = "/test/add/wx/openid",method = RequestMethod.GET)
|
||||
public String addWxConfig(@RequestParam("open") String open,@RequestParam("id") Integer id) {
|
||||
WxConfig wxConfig = new WxConfig();
|
||||
wxConfig.setWxOpenId(open);
|
||||
wxConfig.setVenueId(id);
|
||||
wxConfig.setCreatedId(999);
|
||||
wxConfig.setModifiedId(999);
|
||||
wxConfig.setVenueId(id);
|
||||
wxConfigMapper.insert(wxConfig);
|
||||
return "OK";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ public class SendMessageTest {
|
||||
VenueLessonService venueLessonService;
|
||||
@Resource
|
||||
VenueService venueService;
|
||||
@Resource
|
||||
WeiXinSendUtils weiXinSendUtils;
|
||||
|
||||
@Test
|
||||
public void testTask(){
|
||||
@@ -50,7 +52,7 @@ public class SendMessageTest {
|
||||
if (!StringUtils.isEmpty(openId)) {
|
||||
String[] split = openId.split(",");
|
||||
for (String s : split) {
|
||||
WeiXinSendUtils.sendCard(sendMsg,s);
|
||||
weiXinSendUtils.sendCard(sendMsg,s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user