|
@@ -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) {
|