Browse Source

Merge branch 'refs/heads/master' into 转接增加清空标签配置

ct 2 ngày trước cách đây
mục cha
commit
7841a0845c

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/course/FsCourseAnswerLogsController.java

@@ -82,7 +82,7 @@ public class FsCourseAnswerLogsController extends BaseController
 
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
-        param.setCompanyUserId(loginUser.getUser().getUserId());
+        //param.setCompanyUserId(loginUser.getUser().getUserId());
         if (param.getPhoneMk() != null && param.getPhoneMk() != "") {
             param.setPhone(param.getPhoneMk());
         }

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/course/FsCourseRedPacketLogController.java

@@ -89,7 +89,7 @@ public class FsCourseRedPacketLogController extends BaseController
         startPage();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
-        fsCourseRedPacketLog.setCompanyUserId(loginUser.getUser().getUserId());
+        //fsCourseRedPacketLog.setCompanyUserId(loginUser.getUser().getUserId());
         if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
             fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
         }

+ 3 - 7
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactTransferLogController.java

@@ -14,7 +14,6 @@ import com.fs.framework.service.TokenService;
 import com.fs.qw.domain.QwExternalContactTransferLog;
 import com.fs.qw.param.QwExternalContactTransferLogParam;
 import com.fs.qw.service.IQwExternalContactTransferLogService;
-import com.fs.qw.service.impl.AsyncQwExternalContactTransferService;
 import com.fs.qw.vo.QwExternalContactTransferLogListVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -42,9 +41,6 @@ public class QwExternalContactTransferLogController extends BaseController
     @Autowired
     private CompanyDeptServiceImpl companyDeptService;
 
-    @Autowired
-    private AsyncQwExternalContactTransferService transferService;
-
     /**
      * 查询转接记录列表
      */
@@ -120,9 +116,9 @@ public class QwExternalContactTransferLogController extends BaseController
     @GetMapping("/sync/{corpId}")
     public R syncTag(@PathVariable("corpId") String corpId)
     {
-        transferService.syncQwExternalContactTransferLog(corpId);
-
-//        return qwExternalContactTransferLogService.syncQwExternalContactTransferLog(corpId);
+//        transferService.syncQwExternalContactTransferLog(corpId);
+//
+         qwExternalContactTransferLogService.syncQwExternalContactTransferLog(corpId);
         return R.ok();
     }
     /**

+ 10 - 0
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoRedPackageMapper.java

@@ -5,6 +5,7 @@ import java.util.List;
 import com.fs.course.domain.FsUserCourseVideo;
 import com.fs.course.domain.FsUserCourseVideoRedPackage;
 import com.fs.course.param.FsUserCourseVideoParam;
+import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -103,5 +104,14 @@ public interface FsUserCourseVideoRedPackageMapper
             "</script>")
     int updateBatchDelFlag(@Param("ids") Long [] ids, @Param("delFlag") Integer delFlag);
 
+    @Delete("<script>" +
+            "DELETE FROM fs_user_course_video_red_package WHERE video_id IN " +
+            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>" +
+            "#{id}" +
+            "</foreach>" +
+            "</script>")
+    int deleteBatchByVideoIds(@Param("ids") Long[] ids);
+
+
     Integer selectRedPacketByCompanyCount(@Param("videoId") Long videoId,@Param("companyId") Long companyId, @Param("periodId") Long periodId);
 }

+ 4 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodServiceImpl.java

@@ -171,8 +171,10 @@ public class FsUserCoursePeriodServiceImpl implements IFsUserCoursePeriodService
         List<Long> videoIds = fsUserCoursePeriodDays.stream().map(FsUserCoursePeriodDays::getVideoId).collect(Collectors.toList());
         if(!periodDayIds.isEmpty()){
             fsUserCoursePeriodDaysMapper.updateBatchDelFlag(periodDayIds.toArray(new Long[0]),1);
-            //删除红包记录
-            fsUserCourseVideoRedPackageMapper.updateBatchDelFlag(videoIds.toArray(new Long[0]),1);
+            //删除红包记录(修改状态)
+            //fsUserCourseVideoRedPackageMapper.updateBatchDelFlag(videoIds.toArray(new Long[0]),1);
+            //直接删除
+            fsUserCourseVideoRedPackageMapper.deleteBatchByVideoIds(videoIds.toArray(new Long[0]));
         }
         return flag;
     }

+ 4 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseTrainingCampServiceImpl.java

@@ -100,8 +100,10 @@ public class FsUserCourseTrainingCampServiceImpl extends ServiceImpl<FsUserCours
         List<Long> videoIds = fsUserCoursePeriodDays.stream().map(FsUserCoursePeriodDays::getVideoId).collect(Collectors.toList());
         if(!periodDayIds.isEmpty()){
             fsUserCoursePeriodDaysMapper.updateBatchDelFlag(periodDayIds.toArray(new Long[0]),1);
-            //删除红包记录
-            fsUserCourseVideoRedPackageMapper.updateBatchDelFlag(videoIds.toArray(new Long[0]),1);
+            //删除红包记录(修改状态)
+            //fsUserCourseVideoRedPackageMapper.updateBatchDelFlag(videoIds.toArray(new Long[0]),1);
+            //直接删除
+            fsUserCourseVideoRedPackageMapper.deleteBatchByVideoIds(videoIds.toArray(new Long[0]));
         }
     }
 

+ 8 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsInquiryOrderServiceImpl.java

@@ -14,6 +14,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.exception.CustomException;
 import com.fs.common.service.impl.SmsServiceImpl;
+import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.StringUtils;
@@ -791,6 +792,13 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
             map.setPayTime(new Date());
             map.setTradeNo(tradeNo);
             fsInquiryOrderMapper.updateFsInquiryOrder(map);
+            // 木易华康特殊处理(支付成功医生自动接单)
+            if (CloudHostUtils.hasCloudHostName("木易华康")&&order.getDoctorId()!=null) {
+                FsInquiryOrderReceiveParam fsInquiryOrderReceiveParam = new FsInquiryOrderReceiveParam();
+                fsInquiryOrderReceiveParam.setOrderId(order.getOrderId());
+                fsInquiryOrderReceiveParam.setDoctorId(order.getDoctorId());
+                receiveOrder(fsInquiryOrderReceiveParam);
+            }
             try {
                 FsUser fsUser = userMapper.selectFsUserByUserId(order.getUserId());
                 imService.addAccount(fsUser.getUserId(),fsUser.getAvatar(),fsUser.getNickName());

+ 1 - 1
fs-service/src/main/java/com/fs/qw/service/IQwExternalContactTransferLogService.java

@@ -65,7 +65,7 @@ public interface IQwExternalContactTransferLogService extends IService<QwExterna
      */
     public int deleteQwExternalContactTransferLogById(Long id);
 
-    public R syncQwExternalContactTransferLog(String corpId);
+    public void syncQwExternalContactTransferLog(String corpId);
 
     List<QwExternalContactTransferLogListVO> selectQwExternalContactTransferLogListVO(QwExternalContactTransferLogParam qwExternalContactTransferLog);
 

+ 0 - 174
fs-service/src/main/java/com/fs/qw/service/impl/AsyncQwExternalContactTransferService.java

@@ -1,174 +0,0 @@
-package com.fs.qw.service.impl;
-
-
-import com.fs.course.domain.FsUserCourse;
-import com.fs.qw.domain.QwExternalContact;
-import com.fs.qw.domain.QwExternalContactTransferLog;
-import com.fs.qw.mapper.QwExternalContactTransferLogMapper;
-import com.fs.qw.service.IQwExternalContactService;
-import com.fs.qw.service.IQwExternalContactTransferLogService;
-import com.fs.qwApi.domain.QwGetTransferResult;
-import com.fs.qwApi.param.QwGetTransferParam;
-import com.fs.qwApi.service.QwApiService;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-@Slf4j
-@Service
-@AllArgsConstructor
-public class AsyncQwExternalContactTransferService {
-
-    @Autowired
-    private QwExternalContactTransferLogMapper qwExternalContactTransferLogMapper;
-
-    @Autowired
-    private QwApiService qwApiService;
-
-    @Autowired
-    private IQwExternalContactService iQwExternalContactService;
-
-    @Autowired
-    private IQwExternalContactTransferLogService iQwExternalContactTransferLogService;
-
-    @Async("scheduledExecutorService")
-    public void syncQwExternalContactTransferLog(String corpId) {
-        try {
-            QwExternalContactTransferLog qwExternalContactTransferLog = new QwExternalContactTransferLog();
-            qwExternalContactTransferLog.setStatus(2);
-            qwExternalContactTransferLog.setCorpId(corpId);
-            List<QwExternalContactTransferLog> qwExternalContactTransferLogs = qwExternalContactTransferLogMapper.selectQwExternalContactTransferLogList(qwExternalContactTransferLog);
-
-            Map<String, List<QwExternalContactTransferLog>> groupedLogs = qwExternalContactTransferLogs.stream()
-                    .collect(Collectors.groupingBy(log ->
-                            log.getCorpId() + "/-/" + log.getTakeoverUserId() + "/-/" + log.getHandoverUserId()
-                    ));
-
-            for (Map.Entry<String, List<QwExternalContactTransferLog>> entry : groupedLogs.entrySet()) {
-
-
-                try {
-                    // 拆分key
-                    String[] keyParts = entry.getKey().split("/-/");
-                    String keyPartsCorpId = keyParts[0];
-                    String keyPartsTakeoverUserId = keyParts[1];
-                    String keyPartsHandoverUserId = keyParts[2];
-
-                    List<QwExternalContactTransferLog> transferLogListEntry = entry.getValue();
-
-
-                    QwGetTransferParam getTransferParam = new QwGetTransferParam();
-                    getTransferParam.setTakeover_userid(keyPartsTakeoverUserId);
-                    getTransferParam.setHandover_userid(keyPartsHandoverUserId);
-
-
-                    // 第一次请求游标为空
-                    String cursor = null;
-                    List<QwGetTransferResult.Customer> allCustomers = new ArrayList<>();
-
-                    int page = 0;
-                    do {
-                        page++;
-
-                        // 设置游标(第一次请求可能不需要设置或设为空)
-                        if (cursor != null) {
-                            getTransferParam.setCursor(cursor);
-                        }
-
-                        // 调用接口
-                        QwGetTransferResult transfer = qwApiService.getTransfer(getTransferParam, keyPartsCorpId);
-
-                        // 检查接口返回是否成功
-                        if (transfer.getErrcode() != 0) {
-                            log.error("获取转移记录失败: errcode={}, errmsg={}, takeover_userid={}, handover_userid={}",
-                                    transfer.getErrcode(), transfer.getErrmsg(),
-                                    keyPartsTakeoverUserId, keyPartsHandoverUserId);
-                            break;
-                        }
-
-                        // 获取当前页数据
-                        List<QwGetTransferResult.Customer> customers = transfer.getCustomer();
-                        if (customers != null && !customers.isEmpty()) {
-                            allCustomers.addAll(customers);
-                            log.info("第 {} 页获取到 {} 条转移记录", page, customers.size());
-                        } else {
-                            log.info("第 {} 页没有数据", page);
-                            // 如果没有数据,也退出循环
-                            break;
-                        }
-
-                        // 更新游标,准备下一次请求
-                        cursor = transfer.getNext_cursor();
-
-                        // 添加短暂延时,避免请求过快
-                        try {
-                            Thread.sleep(200);
-                        } catch (InterruptedException e) {
-                            Thread.currentThread().interrupt();
-                            break;
-                        }
-
-                        // 如果next_cursor为空或没有更多数据,则退出循环
-                    } while (cursor != null && !cursor.isEmpty() && !"0".equals(cursor));
-
-                    List<QwExternalContactTransferLog> transferLogList=new ArrayList<>();
-
-                    List<QwExternalContact> contactList = new ArrayList<>();
-
-
-                    Map<String, QwGetTransferResult.Customer> allCustomersMap = allCustomers.stream()
-                            .collect(Collectors.toMap(
-                                    QwGetTransferResult.Customer::getExternal_userid,
-                                    customer -> customer
-                            ));
-
-                    for (QwExternalContactTransferLog transferLog : transferLogListEntry) {
-
-                        QwGetTransferResult.Customer customer = allCustomersMap.get(transferLog.getExternalUserId());
-
-                        if (customer != null && customer.getStatus() != 2) {
-                            transferLog.setStatus(customer.getStatus());
-                            transferLogList.add(transferLog);
-
-                            QwExternalContact qwExternalContact = new QwExternalContact();
-                            qwExternalContact.setId(transferLog.getExternalContactId());
-                            qwExternalContact.setTransferStatus(customer.getStatus());
-
-                            if (customer.getStatus() == 1) {
-                                qwExternalContact.setUserId(transferLog.getTakeoverUserId());
-                                qwExternalContact.setQwUserId(transferLog.getQwUserId());
-                                qwExternalContact.setCompanyUserId(transferLog.getCompanyUserId());
-                            }
-                            contactList.add(qwExternalContact);
-                        }
-                    }
-
-                    if (!transferLogList.isEmpty()){
-                        log.info("更新{}条外部联系人转移日志",transferLogList.size());
-                        iQwExternalContactTransferLogService.updateBatchById(transferLogList,300);
-                    }
-                    if (!contactList.isEmpty()){
-                        log.info("更新{}条外部联系人",contactList.size());
-                        iQwExternalContactService.updateBatchById(contactList,300);
-                    }
-                }catch (Exception e){
-                    log.error("查询转接记录失败:"+entry);
-                }
-
-
-            }
-
-            log.info("转接记录同步成功");
-        } catch (Exception e){
-            e.printStackTrace();
-            log.info("转接记录同步失败");
-        }
-    }
-}

+ 4 - 2
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactTransferLogServiceImpl.java

@@ -16,6 +16,7 @@ import com.fs.qwApi.param.QwGetTransferParam;
 import com.fs.qwApi.service.QwApiService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -117,7 +118,8 @@ public class QwExternalContactTransferLogServiceImpl extends ServiceImpl<QwExter
     }
 
     @Override
-    public R syncQwExternalContactTransferLog(String corpId) {
+    @Async
+    public void syncQwExternalContactTransferLog(String corpId) {
 
         try {
         QwExternalContactTransferLog qwExternalContactTransferLog = new QwExternalContactTransferLog();
@@ -248,7 +250,7 @@ public class QwExternalContactTransferLogServiceImpl extends ServiceImpl<QwExter
             e.printStackTrace();
             log.info("转接记录同步失败");
         }
-        return null;
+
     }
 
     @Override

+ 4 - 2
fs-service/src/main/java/com/fs/statis/service/impl/StatisticsServiceImpl.java

@@ -698,8 +698,10 @@ public class StatisticsServiceImpl implements IStatisticsService {
         dealerAggregatedDTO.setRecvTodayNum(dayPaymentCount);
         dealerAggregatedDTO.setGoodsTotalNum(productCount);
         dealerAggregatedDTO.setTodayGoodsNum(dayProductCount);
-        dealerAggregatedDTO.setPadTotalNum(padInfo.getTotalCount());
-        dealerAggregatedDTO.setPadUsedNum(padInfo.getCount());
+        if (padInfo != null){
+            dealerAggregatedDTO.setPadTotalNum(padInfo.getTotalCount());
+            dealerAggregatedDTO.setPadUsedNum(padInfo.getCount());
+        }
         return dealerAggregatedDTO;
     }
 

+ 1 - 0
fs-service/src/main/resources/application-dev-jnlzjk.yml

@@ -149,5 +149,6 @@ rocketmq:
 openIM:
     secret: openIM123
     userID: imAdmin
+    url: https://im.muyi88.com/api
 #是否为新商户,新商户不走mpOpenId
 isNewWxMerchant: true

+ 3 - 0
fs-service/src/main/resources/mapper/company/CompanyUserMapper.xml

@@ -64,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="qrCodeWecom" column="qr_code_wecom"/>
         <result property="jpushId" column="jpush_id"/>
         <result property="callerNo" column="caller_no"/>
+        <result property="isNeedRegisterMember"    column="is_need_register_member" />
+        <result property="isAllowedAllRegister"    column="is_allowed_all_register" />
         <collection property="roleNames" ofType="java.lang.String" javaType="java.util.ArrayList"
                     select="selectUserRoles" column="user_id"/>
     </resultMap>
@@ -90,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         u.user_id, u.user_name, u.nick_name, u.company_id, u.status,
         u.qw_status, u.phonenumber, u.create_time, u.dept_id,
         u.qr_code_weixin, u.user_type, u.qr_code_wecom, u.jpush_id,
+        u.is_need_register_member,u.is_allowed_all_register,
         u.avatar,
         u.qw_user_id,
         d.dept_name,