Commit 82221e5b by 徐高华

发送欢迎语

parent a3b8d8a2
......@@ -18,4 +18,6 @@ public interface HaobanCommonMQApiService {
public void commonHandler(String message);
public void welcomeMQ(String params) ;
}
package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
public interface WelcomeSendService {
/**
* @Description: 发送欢迎语
*/
public void sendWelcome(String params);
/**
* @Title: sendWelcome
* @Description: 发送欢迎语
* @throws
*/
public void sendWelcome(String corpid, String externalUserId, String welcomeCode, String wxUserId, String state);
public String getHmClerk(HmQrcodeDTO hmDTO, String wxEnterpriseId, String staffId);
}
......@@ -3,7 +3,6 @@ package com.gic.haoban.manage.service.service.impl;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.enterprise.api.service.LinkService;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeRemoveCheckDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO;
......@@ -40,7 +39,6 @@ import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitDepartmentBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitStaffBO;
import com.gic.haoban.manage.service.pojo.qo.WelcomeInfoQO;
import com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO;
import com.gic.haoban.manage.service.service.KeyDataService;
import com.gic.haoban.manage.service.service.WelcomeService;
import com.gic.haoban.manage.service.service.WelcomeSuitRangService;
import com.gic.haoban.manage.service.service.hm.HmLinkService;
......
......@@ -14,6 +14,7 @@ import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.api.dto.CommonMQDTO;
import com.gic.haoban.manage.api.service.HaobanCommonMQApiService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.WelcomeSendService;
import com.gic.mq.sdk.GicMQClient;
import com.gic.quartz.api.dto.QuartzTaskDTO;
import com.gic.quartz.api.service.QuartzService;
......@@ -26,14 +27,16 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
@Autowired
private QuartzService quartzService ;
private QuartzService quartzService;
@Autowired
private StaffDepartmentRelatedService staffDepartmentRelatedService ;
private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired
private WelcomeSendService welcomeSendService;
@Override
public void putCommonMessage(CommonMQDTO dto) {
String message = JSONObject.toJSONString(dto);
log.info("加入好办通用队列params={}",message);
log.info("加入好办通用队列params={}", message);
try {
mqClient.sendCommonMessage("haobanCommonRouter", message,
"com.gic.haoban.manage.api.service.HaobanCommonMQApiService", "commonHandler");
......@@ -44,9 +47,9 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
}
@Override
public void putCommonDelayMessage(CommonMQDTO dto , int delay) {
public void putCommonDelayMessage(CommonMQDTO dto, int delay) {
String message = JSONObject.toJSONString(dto);
log.info("加入好办延时通用队列params={}",message);
log.info("加入好办延时通用队列params={}", message);
try {
mqClient.sendMessage("haobanDelayMQ", message, delay);
} catch (Exception e) {
......@@ -57,18 +60,18 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
@Override
public void commonHandler(String message) {
log.info("接收好办通用队列params={}",message);
log.info("接收好办通用队列params={}", message);
CommonMQDTO dto = JSON.parseObject(message, CommonMQDTO.class);
// 好办停用,删除定时
Map<String,String> map = (Map<String, String>) dto.getParams() ;
Map<String, String> map = (Map<String, String>) dto.getParams();
switch (dto.getType()) {
case 1:
String enterpriseId = map.get("enterpriseId") ;
String enterpriseId = map.get("enterpriseId");
this.deleteQuartz(enterpriseId);
break;
case 2:
String staffId = map.get("staffId") ;
if(StringUtils.isNotBlank(staffId)) {
String staffId = map.get("staffId");
if (StringUtils.isNotBlank(staffId)) {
this.staffDepartmentRelatedService.repairStaffDepart(staffId);
}
default:
......@@ -77,10 +80,10 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
}
private void deleteQuartz(String enterpriseId) {
if(StringUtils.isBlank(enterpriseId)) {
return ;
if (StringUtils.isBlank(enterpriseId)) {
return;
}
log.info("删除好办定时eid={}",enterpriseId);
log.info("删除好办定时eid={}", enterpriseId);
// 日报
QuartzTaskDTO task = new QuartzTaskDTO();
task.setTaskService("com.gic.haoban.app.daily.api.service.DailyReportTaskApiService");
......@@ -88,4 +91,9 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
task.setReferId(enterpriseId);
this.quartzService.delQuartzTask(task);
}
@Override
public void welcomeMQ(String params) {
this.welcomeSendService.sendWelcome(params);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment