Browse Source

今正功能优化

peicj 2 weeks ago
parent
commit
dfef76500f

+ 37 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java

@@ -215,6 +215,43 @@ public class CompanyUserController extends BaseController {
         return getDataTable(list);
     }
 
+    @GetMapping("/myQwList")
+    public TableDataInfo myQwList(CompanyUserQwParam user) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+//        user.setCompanyId(loginUser.getCompany().getCompanyId());
+        user.setUserId(loginUser.getUser().getUserId());
+        List<CompanyUserQwListVO> list = companyUserService.selectCompanyUserQwListVO(user);
+        if (!list.isEmpty()){
+            String json = configService.selectConfigByKey("course.config");
+            CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+            Long sendDelayTime = config.getSendDelayTime();
+            List<CompletableFuture<Void>> futures = new ArrayList<>();
+            for (CompanyUserQwListVO companyUserQwListVO : list) {
+                CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
+                    CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUserQwListVO.getCompanyId(), companyUserQwListVO.getUserId());
+                    if (ObjectUtil.isEmpty(companyUserDelayTime)) {
+                        companyUserQwListVO.setSendDelayTime(sendDelayTime);
+                    } else {
+                        companyUserQwListVO.setSendDelayTime(companyUserDelayTime.getSendDelayTime());
+                    }
+                    //是否绑定
+                    if(QwStatusEnum.BOUND.getCode() == companyUserQwListVO.getQwStatus()){
+                        if(!StringUtil.strIsNullOrEmpty(companyUserQwListVO.getQwUserId())){
+                            Long[] ids = Arrays.stream(companyUserQwListVO.getQwUserId().split(","))
+                                    .map(Long::parseLong)
+                                    .toArray(Long[]::new);
+                            List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(ids);
+                            companyUserQwListVO.setQwUsers(qwUserVOS);
+                        }
+                    }
+                });
+                futures.add(future);
+            }
+            CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
+        }
+        return getDataTable(list);
+    }
+
     @Log(title = "用户管理导出", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('company:user:export')")
     @GetMapping("/export")

+ 11 - 3
fs-company/src/main/java/com/fs/company/controller/course/FsCourseWatchLogController.java

@@ -104,11 +104,19 @@ public class FsCourseWatchLogController extends BaseController
 
 
         List<Long> combinedList = new ArrayList<>();
-        //本部门
-        Long deptId = loginUser.getUser().getDeptId();
-        if (deptId!=null){
+        Long deptId;
+
+        if(param.getDeptId() != null){
+            deptId = param.getDeptId();
             combinedList.add(deptId);
+        }else{
+            //本部门
+            deptId = loginUser.getUser().getDeptId();
+            if (deptId!=null){
+                combinedList.add(deptId);
+            }
         }
+
         //本部门的下级部门
         List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
         if (!deptList.isEmpty()){

+ 3 - 0
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseMapper.java

@@ -220,6 +220,9 @@ public interface FsUserCourseMapper
             "<if test = ' maps.cateId !=null '> " +
             "and (cc.cate_id =#{maps.cateId} or cc.pid=#{maps.cateId} )" +
             "</if>" +
+            "<if test = ' maps.courseId !=null '> " +
+            "and (c.course_id =#{maps.courseId})" +
+            "</if>" +
             "<if test = ' maps.courseName!=null and maps.courseName != \"\" '> " +
             "and c.course_name like concat('%', #{maps.courseName}, '%') " +
             "</if>" +

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

@@ -237,6 +237,7 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "left join qw_contact_way cw on cw.id = ec.way_id " +
             "left join qw_contact_way_group wg on wg.id=cw.group_id" +
             "<where>  \n" +
+            "            <if test=\"id != null  and id != ''\"> and ec.id   like concat( #{id}, '%') </if>\n" +
             "            <if test=\"userId != null  and userId != ''\"> and ec.user_id   like concat( #{userId}, '%') </if>\n" +
             "            <if test=\"qwUserName != null  and qwUserName != ''\"> and qu.qw_user_name   like concat( #{qwUserName}, '%') </if>\n" +
             "            <if test=\"externalUserId != null  and externalUserId != ''\"> and ec.external_user_id = #{externalUserId}</if>\n" +
@@ -270,7 +271,6 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "            <if test=\"companyUserId != null \"> and ec.company_user_id = #{companyUserId}</if>\n" +
             "            <if test=\"customerId != null \"> and ec.customer_id = #{customerId}</if>\n" +
             "            <if test=\"status != null \"> and ec.status = #{status}</if>\n" +
-            "            <if test=\"status != null \"> and ec.status = #{status}</if>\n" +
             "<if test = \"statusCondition != null and  statusCondition.length > 0 \" > " +
             "   AND ec.status in " +
             "   <foreach collection='statusCondition' item='item' open='(' separator=',' close=')'> " +

+ 1 - 0
fs-service/src/main/java/com/fs/qw/mapper/QwFriendWelcomeMapper.java

@@ -88,6 +88,7 @@ public interface QwFriendWelcomeMapper
             "           AND qu.qw_user_id = #{qwUserIds} " +
             "       ) AND " +
             "   </if>" +
+            "   <if test=\"id != null  and id != ''\"> qfw.id like concat( #{id}, '%') AND </if>\n" +
             "   <if test=\"isSendMsg != null\"> qfw.is_send_msg = #{isSendMsg} AND </if>" +
             "  <if test=\"createTime != null \"> DATE(qfw.create_time) = DATE(#{createTime}) AND</if>\n" +
             "  <if test=\"updateTime != null \"> DATE(qfw.update_time) = DATE(#{updateTime}) AND</if>\n" +

+ 1 - 0
fs-service/src/main/resources/mapper/course/FsCourseFinishTempParentMapper.xml

@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectFsCourseFinishTempParentList" parameterType="FsCourseFinishTempParent" resultMap="FsCourseFinishTempParentResult">
         <include refid="selectFsCourseFinishTempParentVo"/>
         <where>
+            <if test="id != null "> and id = #{id}</if>
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="courseId != null "> and course_id = #{courseId}</if>
             <if test="companyId != null "> and company_id = #{companyId}</if>

+ 1 - 0
fs-service/src/main/resources/mapper/qw/QwFriendWelcomeMapper.xml

@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             w.*
         from qw_friend_welcome w
         <where>
+            <if test="id != null  and id != ''"> and w.id like concat( #{id}, '%') </if>
             <if test="qwUserIds != null  and qwUserIds != ''">
                 and FIND_IN_SET(#{qwUserIds},REPLACE(REPLACE(REPLACE(qw_user_ids, '[', ''), ']', ''), ' ', '')) > 0
             </if>