Explorar el Código

Merge remote-tracking branch 'origin/master_feat_ysy_20250929' into master_feat_ysy_20250929

三七 hace 3 días
padre
commit
696660c9e2

+ 7 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsUserInformationCollectionController.java

@@ -130,4 +130,11 @@ public class FsUserInformationCollectionController extends BaseController
         LoginUser loginUser = SecurityUtils.getLoginUser();
         return fsUserInformationCollectionService.stopCollection(param,loginUser.getUser().getUserId());
     }
+
+
+    @PutMapping("/salesHelpConfirm")
+    public R salesHelpConfirm(@RequestBody FsUserInformationCollectionSchedule param){
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        return fsUserInformationCollectionService.salesHelpConfirm(param.getCollectionId(),loginUser.getUser().getUserId());
+    }
 }

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/IFsUserInformationCollectionService.java

@@ -95,5 +95,5 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     R stopCollection(FsUserInformationCollectionSchedule param, Long operateId);
 
     //销售帮助客户二次确认
-    R salesHelpConfirm(Long collectionId);
+    R salesHelpConfirm(Long collectionId, Long operateId);
 }

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -989,8 +989,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     }
 
     @Override
-    @Transactional
-    public R salesHelpConfirm(Long collectionId) {
+    @Transactional public R salesHelpConfirm(Long collectionId, Long operateId) {
         if (collectionId == null) {
             return R.error("参数错误");
         }
@@ -1028,6 +1027,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         //"完成"任务状态
         editSchedule.setStatus(CollectionTaskStatusEnum.COMPLETED.getCode());
         editSchedule.setCompletedTime(DateUtils.getNowDate());
+        editSchedule.setTerminatedBy(operateId);
         log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_COMPLETED.getDesc(),schedule.getCollectionId());
         if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(editCollection) > 0 && scheduleMapper.updateFsUserInformationCollectionSchedule(editSchedule) > 0) {
             return R.ok();

+ 101 - 0
fs-service/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -53,6 +53,107 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFsCourseWatchLogVo"/>
         where log_id = #{logId}
     </select>
+    <select id="selectFsCourseWatchLogListVO_COUNT" resultType="java.lang.Long">
+        SELECT COUNT(*) AS total
+        FROM fs_course_watch_log l
+        <!-- 动态LEFT JOIN:仅当筛选用到对应表字段时才关联 -->
+        <if test="maps.nickName != null and maps.nickName != ''">
+            LEFT JOIN fs_user u ON u.user_id = l.user_id
+        </if>
+        <if test="maps.companyUserName != null and maps.companyUserName != ''">
+            LEFT JOIN company_user cu ON cu.user_id = l.company_user_id
+        </if>
+        <if test="maps.externalUserName != null and maps.externalUserName != ''
+            or maps.qecSTime != null or maps.qecETime != null">
+            LEFT JOIN qw_external_contact qec ON l.qw_external_contact_id = qec.id
+        </if>
+        <where>
+            <!-- 原筛选条件:仅保留基于主表的条件,关联表条件需判断表是否关联 -->
+            <if test ='maps.isVip != null and maps.isVip == 0'>
+                and (l.user_id = #{maps.isVip} or l.user_id is null)
+            </if>
+            <if test ='maps.isVip != null and maps.isVip == 1'>
+                and l.user_id != 0 and l.user_id is not null
+            </if>
+            <if test ='maps.sendType !=null'>
+                and l.send_type = #{maps.sendType}
+            </if>
+            <if test ='maps.userId !=null'>
+                and l.user_id = #{maps.userId}
+            </if>
+            <if test ='maps.qwExternalContactId !=null'>
+                and l.qw_external_contact_id = #{maps.qwExternalContactId}
+            </if>
+            <if test ='maps.qwUserId !=null'>
+                and l.qw_user_id = #{maps.qwUserId}
+            </if>
+            <if test ='maps.courseId !=null'>
+                and l.course_id = #{maps.courseId}
+            </if>
+            <if test ='maps.videoId !=null'>
+                and l.video_id = #{maps.videoId}
+            </if>
+            <if test ='maps.logType !=null'>
+                and l.log_type = #{maps.logType}
+            </if>
+            <if test ='maps.companyId !=null'>
+                and l.company_id = #{maps.companyId}
+            </if>
+            <if test ='maps.companyUserId !=null'>
+                and l.company_user_id = #{maps.companyUserId}
+            </if>
+            <!-- 关联company_user后才执行该条件 -->
+            <if test="maps.companyUserName !=null and maps.companyUserName!=''">
+                and cu.nick_name like concat('%', #{maps.companyUserName}, '%')
+            </if>
+            <!-- 关联fs_user后才执行该条件 -->
+            <if test="maps.nickName !=null and maps.nickName!=''">
+                and u.nick_name like concat('%', #{maps.nickName}, '%')
+            </if>
+            <!-- 关联qw_external_contact后才执行该类条件 -->
+            <if test="maps.externalUserName !=null and maps.externalUserName!=''">
+                and qec.name like concat('%', #{maps.externalUserName}, '%')
+            </if>
+            <if test='maps.qecSTime != null '>
+                and DATE(qec.create_time) &gt;= DATE(#{maps.qecSTime})
+            </if>
+            <if test='maps.qecETime != null '>
+                and DATE(qec.create_time) &lt;= DATE(#{maps.qecETime})
+            </if>
+            <!-- 主表时间条件 -->
+            <if test='maps.sTime != null '>
+                and DATE(l.create_time) &gt;= DATE(#{maps.sTime})
+            </if>
+            <if test='maps.eTime != null '>
+                and DATE(l.create_time) &lt;= DATE(#{maps.eTime})
+            </if>
+            <if test='maps.scheduleStartTime != null '>
+                and DATE(l.camp_period_time) &gt;= DATE(#{maps.scheduleStartTime})
+            </if>
+            <if test='maps.scheduleEndTime != null '>
+                and DATE(l.camp_period_time) &lt;= DATE(#{maps.scheduleEndTime})
+            </if>
+            <if test='maps.upSTime != null '>
+                and DATE(l.update_time) &gt;= DATE(#{maps.upSTime})
+            </if>
+            <if test='maps.upETime != null '>
+                and DATE(l.update_time) &lt;= DATE(#{maps.upETime})
+            </if>
+            <!-- SOP相关条件 -->
+            <if test="maps.sopIds != null and maps.sopIds.size() > 0">
+                and l.sop_id in
+                <foreach item="sopId" index="index" collection="maps.sopIds" open="(" separator="," close=")">
+                    #{sopId}
+                </foreach>
+            </if>
+            <if test ='maps.project !=null'>
+                and l.project = #{maps.project}
+            </if>
+            <if test="maps.sopId != null  and maps.sopId != '' ">
+                and l.sop_id = #{maps.sopId}
+            </if>
+        </where>
+    </select>
 
     <select id="selectFsCourseWatchLogListVO" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
         select l.log_id,l.user_id,uc.course_name,v.title as video_name,qec.avatar as external_user_avatar,