|
@@ -1,17 +1,23 @@
|
|
|
package com.fs.app.controller;
|
|
package com.fs.app.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
|
|
+import com.fs.common.utils.sign.Md5Utils;
|
|
|
import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
|
import com.fs.course.mapper.FsUserCourseVideoMapper;
|
|
import com.fs.course.mapper.FsUserCourseVideoMapper;
|
|
|
import com.fs.course.service.IFsCourseLinkService;
|
|
import com.fs.course.service.IFsCourseLinkService;
|
|
|
|
|
+import com.fs.fastGpt.domain.FastGptPushTokenTotal;
|
|
|
import com.fs.fastGpt.mapper.FastgptChatVoiceHomoMapper;
|
|
import com.fs.fastGpt.mapper.FastgptChatVoiceHomoMapper;
|
|
|
import com.fs.his.domain.FsAppVersion;
|
|
import com.fs.his.domain.FsAppVersion;
|
|
|
|
|
+import com.fs.his.domain.FsUser;
|
|
|
|
|
+import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.fs.his.service.IFsAppVersionService;
|
|
import com.fs.his.service.IFsAppVersionService;
|
|
|
import com.fs.qw.domain.QwUser;
|
|
import com.fs.qw.domain.QwUser;
|
|
|
import com.fs.qw.mapper.QwCompanyMapper;
|
|
import com.fs.qw.mapper.QwCompanyMapper;
|
|
|
import com.fs.qw.mapper.QwExternalContactCrmMapper;
|
|
import com.fs.qw.mapper.QwExternalContactCrmMapper;
|
|
|
|
|
+import com.fs.qw.mapper.QwRestrictionPushRecordMapper;
|
|
|
import com.fs.qw.mapper.QwUserMapper;
|
|
import com.fs.qw.mapper.QwUserMapper;
|
|
|
import com.fs.qw.param.QwConfigSignatureParam;
|
|
import com.fs.qw.param.QwConfigSignatureParam;
|
|
|
import com.fs.qw.service.IQwJsApiService;
|
|
import com.fs.qw.service.IQwJsApiService;
|
|
@@ -26,10 +32,15 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+import static com.fs.his.utils.PhoneUtil.encryptPhone;
|
|
|
|
|
+import static com.fs.his.utils.PhoneUtil.encryptPhoneOldKey;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Api("公共接口")
|
|
@Api("公共接口")
|
|
@@ -77,6 +88,83 @@ public class ApisCommonController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsCourseLinkService iFsCourseLinkService;
|
|
private IFsCourseLinkService iFsCourseLinkService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private QwRestrictionPushRecordMapper qwRestrictionPushRecordMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsUserMapper userMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/findUsersByPhone")
|
|
|
|
|
+ public void findUsersByPhone(String phone) {
|
|
|
|
|
+
|
|
|
|
|
+ // 先根据加密手机号查询用户
|
|
|
|
|
+ String jiami = (encryptPhone(phone));
|
|
|
|
|
+
|
|
|
|
|
+ FsUser user = null;
|
|
|
|
|
+ List<FsUser> usersByPhone = userMapper.selectFsUsersByPhoneLimitOne(jiami);
|
|
|
|
|
+ if (CollectionUtil.isEmpty(usersByPhone)) {
|
|
|
|
|
+ usersByPhone = userMapper.selectFsUsersByPhoneLimitOne(encryptPhoneOldKey(phone));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果没有找到用户,再根据手机号查询
|
|
|
|
|
+ if (CollectionUtil.isEmpty(usersByPhone)) {
|
|
|
|
|
+ usersByPhone = userMapper.selectFsUsersByPhoneLimitOne(phone);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (CollectionUtil.isEmpty(usersByPhone)){
|
|
|
|
|
+ log.error("1111111111111111");
|
|
|
|
|
+ }
|
|
|
|
|
+ //当前手机号只绑定了单个微信,直接登录
|
|
|
|
|
+ if (usersByPhone.size()==1){
|
|
|
|
|
+ user = usersByPhone.get(0);
|
|
|
|
|
+ // 校验用户是否存在及账号状态
|
|
|
|
|
+ if (user == null) {
|
|
|
|
|
+ log.error("222222222222");
|
|
|
|
|
+ } else if (user.getStatus() == 0) {
|
|
|
|
|
+ log.error("33333333333");
|
|
|
|
|
+ } else if (StringUtils.isEmpty(user.getPassword())) {
|
|
|
|
|
+ log.error("4444444");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println(usersByPhone);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/sopPushTokenTotal")
|
|
|
|
|
+ public void sopPushTokenTotal(String dateTime) {
|
|
|
|
|
+
|
|
|
|
|
+ // 获取日期字符串(今天或昨天)
|
|
|
|
|
+// String dateTime;
|
|
|
|
|
+// dateTime = DateUtils.getDate();
|
|
|
|
|
+ log.info("开始执行sop任务token消耗统计");
|
|
|
|
|
+ try {
|
|
|
|
|
+ List<FastGptPushTokenTotal> fastGptPushTotalList = qwRestrictionPushRecordMapper.selectFastgptPushTokenTotal(dateTime);
|
|
|
|
|
+ if (fastGptPushTotalList != null && !fastGptPushTotalList.isEmpty()) {
|
|
|
|
|
+ for (FastGptPushTokenTotal fastGptPushTotal : fastGptPushTotalList) {
|
|
|
|
|
+ // 获取统计数据
|
|
|
|
|
+ Integer type = fastGptPushTotal.getType();
|
|
|
|
|
+ Long count = 0L;
|
|
|
|
|
+ if(type == 7){
|
|
|
|
|
+ count = fastGptPushTotal.getCount() * 450;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ count = fastGptPushTotal.getCount() * 150;
|
|
|
|
|
+ }
|
|
|
|
|
+ fastGptPushTotal.setCount(count);
|
|
|
|
|
+ FastGptPushTokenTotal pushTotal = qwRestrictionPushRecordMapper.selectFastGptPushTokenTotalByInfo(fastGptPushTotal);
|
|
|
|
|
+ if(pushTotal == null){
|
|
|
|
|
+ qwRestrictionPushRecordMapper.insertPushTokenTotal(fastGptPushTotal);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ fastGptPushTotal.setId(pushTotal.getId());
|
|
|
|
|
+ qwRestrictionPushRecordMapper.updatePushTokenTotal(fastGptPushTotal);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("结束执行sop任务token消耗统计");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("执行sop任务token消耗统计异常", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取跳转微信小程序的链接地址
|
|
* 获取跳转微信小程序的链接地址
|
|
|
*/
|
|
*/
|