Commit 4282a081 by 徐高华

企微托管

parent 27c3d832
......@@ -25,6 +25,8 @@ public interface OpenStaffApiService {
*/
public ServiceResponse<OpenStaffDTO> getById(Long openStaffId) ;
public ServiceResponse<OpenStaffDTO> getByStaffId(String staffId) ;
public ServiceResponse<OpenStaffDTO> getByQwUserId(Long qwUserId) ;
......
......@@ -8,6 +8,7 @@ import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.dto.qdto.NoticeMessageQDTO;
import java.util.List;
import java.util.Map;
/**
* Created 2021/12/17.
......@@ -91,4 +92,7 @@ public interface NoticeMessageApiService {
*/
public ServiceResponse<Boolean> addOrCreateNoticeMessage(List<NoticeMessageQDTO> qdto);
public void sendMessageForOpenStaff(String enterpriseId, Map<String, String> map) ;
}
\ No newline at end of file
......@@ -13,9 +13,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.gic.clerk.api.dto.ClerkListDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.commons.util.*;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.notify.dto.NotifyMessageMQDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
......@@ -28,6 +26,7 @@ import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.message.NoticeMessageHandler;
import com.gic.haoban.manage.service.util.ApolloUtils;
import com.gic.message.center.api.subscribe.model.NoticeMessageForm;
import com.gic.mq.sdk.GicMQClient;
import com.gic.wechat.api.dto.qywx.QywxTemplateCardSendMessageDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
......@@ -41,7 +40,6 @@ import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO;
......@@ -545,7 +543,7 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
* 发送消息
*
* @param contentList
* @param wxUserId
* @param
* @param messageTypeEnum
*/
private void sendMessage(List<TemplateContentBO> contentList, String wxEnterpriseId, String staffId, NoticeMessageTypeEnum messageTypeEnum, String data,String title) {
......@@ -589,4 +587,24 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
messageDTO.setItems(items);
qywxSuiteApiService.sendMessage(corpid, qwDTO.getSelf3thSecret(), messageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
}
public void sendMessageForOpenStaff(String enterpriseId, Map<String, String> map) {
String mqName = "haobanNotice" ;
NoticeMessageForm noticeMessageForm = new NoticeMessageForm();
noticeMessageForm.setMessageCode("haobanOpenStaffNotice");
noticeMessageForm.setMqRouterCode(mqName);
noticeMessageForm.setEnterpriseId(enterpriseId);
noticeMessageForm.setBusinessId(ToolUtil.randomUUID());
noticeMessageForm.setUniqueKey(UniqueIdUtils.uniqueLongHex());
noticeMessageForm.setUserIdList(null);
noticeMessageForm.setCreateTime(new Date());
noticeMessageForm.setVariableMap(map);
try {
GicMQClient client = GICMQClientUtil.getClientInstance();
client.sendMessage(mqName, JSON.toJSONString(noticeMessageForm));
} catch (Exception e) {
logger.error("路由规则名称:" + mqName + ",message:" + JSON.toJSONString(noticeMessageForm),e);
}
}
}
......@@ -219,4 +219,14 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
public ServiceResponse<Page<OpenStaffListDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo) {
return this.openStaffService.page(qdto,basePageInfo);
}
@Override
public ServiceResponse<OpenStaffDTO> getByStaffId(String staffId) {
TabOpenStaff tab = this.openStaffMapper.getByStaffId(staffId) ;
if(null == tab) {
return ServiceResponse.failure("9999","已删除") ;
}
OpenStaffDTO dto = EntityUtil.changeEntityByJSON(OpenStaffDTO.class,tab) ;
return ServiceResponse.success(dto);
}
}
......@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 企微托管
* 企微托管-好办小程序
*/
@RestController
@RequestMapping("/qw-open")
......@@ -30,6 +30,7 @@ public class QywxOpenController {
/**
* 获取详情
* @param staffId
* @param authFlag 1授权 0查询
* @return
*/
@RequestMapping("get-open-staff")
......
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