|
|
@@ -1,6 +1,8 @@
|
|
|
package com.cyksj.web.controller.manage.corp.wxkf;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
@@ -8,11 +10,19 @@ import com.cyksj.mapper.corp.kf.CorpKfUserMapper;
|
|
|
import com.cyksj.model.entity.CorpKfUser;
|
|
|
import com.cyksj.model.kf.CorpKfUserInfo;
|
|
|
import com.cyksj.model.request.CorpKfUserMarkReq;
|
|
|
+import com.cyksj.model.views.CustomerConsultationRecordView;
|
|
|
import com.cyksj.service.corp.WxCorpOps;
|
|
|
+import com.cyksj.service.user.UserBindRelationService;
|
|
|
+import com.ejlchina.searcher.BeanSearcher;
|
|
|
+import com.ejlchina.searcher.param.Operator;
|
|
|
+import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.dao.DuplicateKeyException;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* admin/企业微信/微信客服
|
|
|
* 项目名: yhlxj2
|
|
|
@@ -28,6 +38,12 @@ public class CorpKfUserController {
|
|
|
|
|
|
private final WxCorpOps wxCorpOps;
|
|
|
|
|
|
+ private final UserBindRelationService userBindRelationService;
|
|
|
+
|
|
|
+ private final BeanSearcher beanSearcher;
|
|
|
+
|
|
|
+ private final HttpServletRequest request;
|
|
|
+
|
|
|
/**
|
|
|
* 微信客户详情
|
|
|
*/
|
|
|
@@ -66,6 +82,20 @@ public class CorpKfUserController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户当日咨询问题列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/consultation/questions")
|
|
|
+ public Result<List<CustomerConsultationRecordView>> getUserConsultationQuestions(Long userId) throws Exception {
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ List<CustomerConsultationRecordView> customerConsultationRecords = beanSearcher.searchAll(CustomerConsultationRecordView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .field(CustomerConsultationRecordView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .field(CustomerConsultationRecordView::getCreatedTime, DateUtil.beginOfDay(DateTime.now()), DateUtil.endOfDay(DateTime.now())).op(Operator.Between)
|
|
|
+ .orderBy(CustomerConsultationRecordView::getId).desc()
|
|
|
+ .build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(customerConsultationRecords);
|
|
|
+ }
|
|
|
+
|
|
|
public CorpKfUser getCorpUser(String externalUserid) throws Exception {
|
|
|
CorpKfUser corpKfUser = corpKfUserMapper.selectOne(Wrappers.lambdaQuery(CorpKfUser.class)
|
|
|
.eq(CorpKfUser::getExternalUserid, externalUserid)
|