Explorar o código

任务日历视图修改,登录接口修改

yusm hai 3 semanas
pai
achega
56ecd0cf8f

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/TaskMapper.java

@@ -72,5 +72,5 @@ public interface TaskMapper extends BaseMapper<Task> {
 
     List<TaskDto> getTaskListByStartAndEnd(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("departmentId") Integer departmentId, @Param("executor") String executor, @Param("companyId")Integer companyId);
 
-    List<TaskDto> selectListByIds(@Param("list") List<Integer> list);
+    List<TaskDto> selectListByIds(@Param("list") List<Integer> list,@Param("companyId") Integer companyId);
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -2544,7 +2544,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     .map(TaskRemind::getTaskId)
                     .collect(Collectors.toList());
 
-            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect);
+            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect,companyId);
 
             ArrayList<TaskDto> taskDtos = new ArrayList<>();
             for (TaskRemind remind : remindList) {

+ 31 - 23
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -17,6 +17,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.task.SFTPAsyncUploader;
 import com.management.platform.util.*;
+import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
@@ -62,6 +63,7 @@ import java.util.stream.Collectors;
  * @since 2019-12-31
  */
 @Service
+@Slf4j
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
 
     @Value(value = "${upload.path}")
@@ -289,29 +291,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
                     }
                 }*/
-                if (company.getIsSimple()==1){
-                    List<SysModule> collect = userVO.getModuleList().stream().filter(m -> !"联系人".equals(m.getName()) && !"销售订单".equals(m.getName())).collect(Collectors.toList());
-                    userVO.setModuleList(collect);
-                }
-                if (company.getIsExistBusiness()==0) {
-                    List<SysModule> moduleList = userVO.getModuleList();
-                    for (SysModule sysModule : moduleList) {
-                        sysModule.setName(sysModule.getName().replaceAll("商机","项目"));
-
-                        List<SysFunction> sysFunctionList = sysModule.getFunctionList();
-                        for (SysFunction function : sysFunctionList) {
-                            function.setName(function.getName().replaceAll("商机","项目"));
-                        }
-                        sysModule.setFunctionList(sysFunctionList);
-                    }
-                    userVO.setModuleList(moduleList);
-
-                    List<SysFunction> list = userVO.getFunctionList();
-                    for (SysFunction function : list) {
-                        function.setName(function.getName().replaceAll("商机","项目"));
-                    }
-                    userVO.setFunctionList(list);
-                }
                 httpRespMsg.data = userVO;
             }else {
                 httpRespMsg.setError(MessageUtils.message("user.pwdError"));
@@ -320,6 +299,33 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return httpRespMsg;
     }
 
+    private static void replaceShowNameByField(Company company, UserVO userVO) {
+        log.info("根据公司配置的字段,控制返回展示");
+        if (company.getIsSimple()==1){
+            List<SysModule> collect = userVO.getModuleList().stream().filter(m -> !"联系人".equals(m.getName()) && !"销售订单".equals(m.getName())).collect(Collectors.toList());
+            userVO.setModuleList(collect);
+        }
+        if (company.getIsExistBusiness()==0) {
+            List<SysModule> moduleList = userVO.getModuleList();
+            for (SysModule sysModule : moduleList) {
+                sysModule.setName(sysModule.getName().replaceAll("商机","项目"));
+
+                List<SysFunction> sysFunctionList = sysModule.getFunctionList();
+                for (SysFunction function : sysFunctionList) {
+                    function.setName(function.getName().replaceAll("商机","项目"));
+                }
+                sysModule.setFunctionList(sysFunctionList);
+            }
+            userVO.setModuleList(moduleList);
+
+            List<SysFunction> list = userVO.getFunctionList();
+            for (SysFunction function : list) {
+                function.setName(function.getName().replaceAll("商机","项目"));
+            }
+            userVO.setFunctionList(list);
+        }
+    }
+
     public String getSuperSonicToken(){
         String token = "";
         String apiUrl = "http://"+superSonicConfig.getSupersonicIP()+":"+superSonicConfig.getSupersonicPort()+"/api/auth/user/login";
@@ -744,6 +750,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         }
 
         user.setModuleList(menuList);
+        //根据公司配置的字段,控制返回展示
+        replaceShowNameByField(company, user);
     }
 
     private boolean judgeIsLeader(String userId) {

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/VisitPlanServiceImpl.java

@@ -408,7 +408,7 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
                     .map(TaskRemind::getTaskId)
                     .collect(Collectors.toList());
 
-            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect);
+            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect,companyId);
 
             ArrayList<TaskDto> taskDtos = new ArrayList<>();
             for (TaskRemind remind : remindList) {
@@ -543,7 +543,7 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
                     .map(TaskRemind::getTaskId)
                     .collect(Collectors.toList());
 
-            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect);
+            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect,companyId);
 
             ArrayList<TaskDto> taskDtos = new ArrayList<>();
             for (TaskRemind remind : remindList) {

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

@@ -559,6 +559,9 @@
                    #{item}
                 </foreach>
             </if>
+            <if test="companyId!=null">
+                AND task.company_id = #{companyId}
+            </if>
         </where>
 
     </select>