|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.snowflake.Sequence;
|
|
|
import com.cyksj.common.util.Codec;
|
|
|
@@ -15,8 +16,8 @@ import com.cyksj.dto.CorpJsSdkTicket;
|
|
|
import com.cyksj.dto.CorpOauth2UserInfo;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
-import com.cyksj.mapper.GroupsRelationCustomerServiceFollowRecordMapper;
|
|
|
import com.cyksj.mapper.GroupsRelationExpiryRecordMapper;
|
|
|
+import com.cyksj.mapper.corp.CorpUserTagMapper;
|
|
|
import com.cyksj.model.dto.AuthRedirect;
|
|
|
import com.cyksj.model.entity.CorpCustomerAcquistionCallback;
|
|
|
import com.cyksj.model.entity.CorpFollow;
|
|
|
@@ -24,6 +25,8 @@ import com.cyksj.model.entity.CorpMsgFollowAssociation;
|
|
|
import com.cyksj.model.entity.QyMsgContent;
|
|
|
import com.cyksj.model.manage.views.CorpQyMsgAuditChatView;
|
|
|
import com.cyksj.model.request.corp.CorpCommonReq;
|
|
|
+import com.cyksj.model.views.CorpUserIntentionView;
|
|
|
+import com.cyksj.model.views.UserIntentionPieView;
|
|
|
import com.cyksj.model.views.YHLXUserDetailView;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.corp.CorpService;
|
|
|
@@ -73,7 +76,7 @@ public class WxCorpController {
|
|
|
|
|
|
private final GroupsRelationExpiryRecordMapper groupsRelationExpiryRecordMapper;
|
|
|
|
|
|
- private final GroupsRelationCustomerServiceFollowRecordMapper relationCustomerServiceFollowRecordMapper;
|
|
|
+ private final CorpUserTagMapper corpUserTagMapper;
|
|
|
|
|
|
private final static String CORP_UUID = "corp-uuid";
|
|
|
|
|
|
@@ -81,7 +84,7 @@ public class WxCorpController {
|
|
|
* 企业微信 消息推送url
|
|
|
*/
|
|
|
@RequestMapping(value = "/msg/notify", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
- public String msgNotify(@RequestParam(value = "msg_signature") String msgSignature, String timestamp, String nonce, @RequestParam(value = "echostr",required = false) String echoStr) throws Exception {
|
|
|
+ public String msgNotify(@RequestParam(value = "msg_signature") String msgSignature, String timestamp, String nonce, @RequestParam(value = "echostr", required = false) String echoStr) throws Exception {
|
|
|
if (StrUtil.hasEmpty(msgSignature, timestamp, nonce)) {
|
|
|
return StringUtil.EMPTY;
|
|
|
}
|
|
|
@@ -217,7 +220,7 @@ public class WxCorpController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(jsSdkTicket);
|
|
|
}
|
|
|
|
|
|
- public String getCorpUuid(){
|
|
|
+ public String getCorpUuid() {
|
|
|
return Optional.ofNullable(request.getHeader(CORP_UUID)).orElse(StringUtil.EMPTY);
|
|
|
}
|
|
|
|
|
|
@@ -277,6 +280,7 @@ public class WxCorpController {
|
|
|
|
|
|
/**
|
|
|
* 企微会话列表
|
|
|
+ *
|
|
|
* @param externalUserid 用户 externalUserid
|
|
|
*/
|
|
|
@GetMapping("/getMsgAuditChat")
|
|
|
@@ -301,27 +305,29 @@ public class WxCorpController {
|
|
|
* 获取聊天记录
|
|
|
*/
|
|
|
@GetMapping("/getMsgByFollowIdAndUserId")
|
|
|
- public Result<SearchResult<QyMsgContent>> getMsgByFollowIdAndUserId(){
|
|
|
+ public Result<SearchResult<QyMsgContent>> getMsgByFollowIdAndUserId() {
|
|
|
SearchResult<QyMsgContent> search = beanSearcher.search(QyMsgContent.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取主动回传 回传数据
|
|
|
+ *
|
|
|
* @Param unionId 用户unionId
|
|
|
*/
|
|
|
@GetMapping("/acquistionLinkCallback")
|
|
|
- public Result<CorpCustomerAcquistionCallback> getAcquistionLinkCallback(){
|
|
|
+ public Result<CorpCustomerAcquistionCallback> getAcquistionLinkCallback() {
|
|
|
CorpCustomerAcquistionCallback corpCustomerAcquistionCallback = beanSearcher.searchFirst(CorpCustomerAcquistionCallback.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(corpCustomerAcquistionCallback);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 主动回传
|
|
|
+ *
|
|
|
* @param id 记录id
|
|
|
*/
|
|
|
@GetMapping("/acquistionLinkCallback/{id}")
|
|
|
- public Result<String> postAcquistionLinkCallback(@PathVariable Long id){
|
|
|
+ public Result<String> postAcquistionLinkCallback(@PathVariable Long id) {
|
|
|
corpService.postAcquistionLinkCallback(id);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
@@ -330,12 +336,30 @@ public class WxCorpController {
|
|
|
* 修改 意向
|
|
|
*/
|
|
|
@PutMapping("/upCallbackIntention")
|
|
|
- public Result<String> upCallbackIntention(@RequestBody CorpCustomerAcquistionCallback corpCustomerAcquistionCallback){
|
|
|
+ public Result<String> upCallbackIntention(@RequestBody CorpCustomerAcquistionCallback corpCustomerAcquistionCallback) {
|
|
|
log.info("修改意向:{}", corpCustomerAcquistionCallback);
|
|
|
- if(corpCustomerAcquistionCallback.getId() == null || corpCustomerAcquistionCallback.getId() == 0 || corpCustomerAcquistionCallback.getIntention() == null){
|
|
|
+ if (corpCustomerAcquistionCallback.getId() == null || corpCustomerAcquistionCallback.getId() == 0 || corpCustomerAcquistionCallback.getIntention() == null) {
|
|
|
throw BusinessRuntimeException.getInstance("缺少必填参数.");
|
|
|
}
|
|
|
corpService.upCallbackIntention(corpCustomerAcquistionCallback);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户意愿饼图
|
|
|
+ */
|
|
|
+ @GetMapping("/get/user/intention/pie")
|
|
|
+ public Result<UserIntentionPieView> getUserIntentionPie(String tagId, String date) {
|
|
|
+ UserIntentionPieView userIntentionPieView = corpUserTagMapper.getUserIntentionPie(tagId, date);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(userIntentionPieView);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 标签用户列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/tag/user/list")
|
|
|
+ public Result<Page<CorpUserIntentionView>> getCorpUserIntentionView(Long userId, String nickname, String tagId, String date) {
|
|
|
+ Page<CorpUserIntentionView> page = corpUserTagMapper.getCorpUserIntentionView(userId, nickname, tagId, date);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
|
+ }
|
|
|
}
|