Эх сурвалжийг харах

1.登陆+filter新增redis客户经理
2.贸易订单+客户经理过滤
3.入驻认证+客户经理
4.客户列表+客户经理

lengfaqiang 2 жил өмнө
parent
commit
59b87be9e3

+ 8 - 0
pom.xml

@@ -333,6 +333,14 @@
                 <artifactId>bcprov-jdk18on</artifactId>
                 <version>1.74</version>
             </dependency>
+
+            <!--热部署-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-devtools</artifactId>
+                <optional>true</optional>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
 

+ 21 - 8
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -35,6 +35,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @desc: 用户权限实现类
@@ -525,7 +526,7 @@ public class AuthServiceImpl implements IAuthService {
                 }
             }
             //客户经理  存储相关联企业id
-            customerManager(loginUserInfo);
+            customerManager(loginUserInfo, user, loginBase);
             int expireTime = ClientTypeEnum.expireTime(loginBase.getClientType());
             String key = Global.getFullUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId());
             RedissonUtils.putString(key, JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
@@ -534,20 +535,32 @@ public class AuthServiceImpl implements IAuthService {
             saveMenusToCache(user);
         }
 
-        private void customerManager(LoginUserInfo loginUserInfo) {
+        private void customerManager(LoginUserInfo loginUserInfo, KwsUserResDto user, LoginBase loginBase) {
             if (SystemTypeEnum.MANAGE.getCode().equals(loginBase.getSystemType())) {
                 List<Long> enterpriseIds = new ArrayList<>();
                 if (user.getIsMain().equals(Global.YES)) {
-                    //获取所以运营端账号关联的企业(客户经理关联的企业)
-                    List<Long> userIds = remoteUserService.selectUserBySystemType(1);
-                    /*带有数据权限*/
-                    enterpriseIds = remoteUserService.findEnterpriseListByIds(userIds);
+                    //获取所有企业id
+                    List<Long> enterpriseIdList = remoteUserService.findAllEnterprise();
+                    if (Objects.nonNull(enterpriseIdList) && enterpriseIdList.size() > 0) {
+                        enterpriseIds.addAll(enterpriseIdList);
+                    }
+                    //获取所有运营端账号关联的企业(客户经理关联的企业)
+                    List<Long> userIds = remoteUserService.selectUserBySystemType(SystemTypeEnum.MANAGE.getCode());
+                    /**带有数据权限*/
+                    List<Long> enterpriseListByIds = remoteUserService.findEnterpriseListByIds(userIds);
+                    if (Objects.nonNull(enterpriseListByIds) && enterpriseListByIds.size() > 0) {
+                        enterpriseIds.addAll(enterpriseListByIds);
+                    }
                     //无数据权限,运营账号(客户经理关联)关联的企业即可
-                    //enterpriseIds = remoteUserService.findEnterpriseListByUserIds(userIds);
+//                    enterpriseIds = remoteUserService.findEnterpriseListByUserIds(userIds);
                 } else {
-                    enterpriseIds = remoteUserService.findEnterpriseIds(user.getId());
+                    List<Long> serviceEnterpriseIds = remoteUserService.findEnterpriseIds(user.getId());
+                    if (Objects.nonNull(serviceEnterpriseIds) && serviceEnterpriseIds.size() > 0) {
+                        enterpriseIds.addAll(serviceEnterpriseIds);
+                    }
                 }
                 if (enterpriseIds.size() > 0) {
+                    enterpriseIds = enterpriseIds.stream().distinct().collect(Collectors.toList());
                     String key = Global.getCustomerManagerUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId());
                     RedissonUtils.putSet(key, enterpriseIds);
                     loginUserInfo.setAuthEntIdList(enterpriseIds);

+ 7 - 7
sckw-auth/src/main/resources/bootstrap-test.yml

@@ -2,17 +2,17 @@ spring:
   cloud:
     nacos:
       discovery:
-      # 服务注册地址
-        server-addr: @nacos.server@
+        # 服务注册地址
+        server-addr: 10.10.10.224:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-service-platform
         # 共享配置
         group: sckw-service-platform
       config:
-      # 配置中心地址
-        server-addr: @nacos.server@
+        # 配置中心地址
+        server-addr: 10.10.10.224:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-service-platform
         # 共享配置
         group: sckw-service-platform
         # 配置文件格式
@@ -26,4 +26,4 @@ spring:
         extension-configs:
           - dataId: sckw-common.yml
             group: sckw-service-platform
-            refresh: true
+            refresh: true

+ 18 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java

@@ -2,6 +2,11 @@ package com.sckw.core.model.enums;
 
 import lombok.Getter;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author czh
  * @desc 审批状态枚举
@@ -25,12 +30,12 @@ public enum ApprovalEnum {
 
     private final String name;
 
-    ApprovalEnum(int code, String name){
+    ApprovalEnum(int code, String name) {
         this.code = code;
         this.name = name;
     }
 
-    public static String getName(int code){
+    public static String getName(int code) {
         for (ApprovalEnum approvalEnum : values()) {
             if (approvalEnum.getCode() == code) {
                 return approvalEnum.getName();
@@ -39,4 +44,15 @@ public enum ApprovalEnum {
         return null;
     }
 
+    public static List<Map<String, String>> getDefaultApprovalEnum() {
+        List<Map<String, String>> list = new ArrayList<>();
+        for (ApprovalEnum approvalEnum : ApprovalEnum.values()) {
+            Map<String, String> map = new HashMap<>();
+            map.put("code", String.valueOf(approvalEnum.getCode()));
+            map.put("name", approvalEnum.getName());
+            list.add(map);
+        }
+        return list;
+    }
+
 }

+ 9 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -248,6 +248,13 @@ public interface RemoteUserService {
      */
     List<Long> findEnterpriseIds(Long userId);
 
+    /**
+     * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)-判断是不是管理员账户
+     * @param userId 客户经理id
+     * @return list 企业id数组
+     */
+    List<Long> findEnterpriseIdsByUserIdIsMain(Long userId);
+
     /**
      * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)
      * @param userIds 客户经理id
@@ -268,4 +275,6 @@ public interface RemoteUserService {
      * @return
      */
     List<Long> selectUserBySystemType(Integer systemType);
+
+    List<Long> findAllEnterprise();
 }

+ 3 - 0
sckw-modules/sckw-fleet/pom.xml

@@ -98,6 +98,9 @@
                         </goals>
                     </execution>
                 </executions>
+                <configuration>
+                    <mainClass>com.sckw.fleet.FleetApplication</mainClass>
+                </configuration>
             </plugin>
         </plugins>
     </build>

+ 2 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java

@@ -2,7 +2,6 @@ package com.sckw.fleet.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.fleet.model.KwfTruck;
-import com.sckw.fleet.model.vo.KwfDriverVo;
 import com.sckw.fleet.model.vo.KwfTableTopCount;
 import com.sckw.fleet.model.vo.KwfTruckMonitorVo;
 import com.sckw.fleet.model.vo.KwfTruckVo;
@@ -82,10 +81,11 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
 
     /**
      * 查询全部车辆
+     *
      * @param params {truckNo 车牌号}
      * @return
      */
-    List<KwfTruckMonitorVo> findTruckByAll(Map<String, Object> params);
+    List<KwfTruckMonitorVo> findTruckByAll(@Param("params") Map<String, Object> params, @Param("authEntIdList") List<Long> authEntIdList);
 
 
     /**

+ 78 - 46
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
+
 import java.io.InputStream;
 import java.math.BigDecimal;
 import java.util.*;
@@ -69,9 +70,9 @@ public class KwfTruckService {
     KwfTruckImportMapper kwfTruckImportDao;
     @Autowired
     KwfFleetTruckMapper fleetTruckDao;
-    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private RemoteSystemService remoteSystemService;
-    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private RemoteUserService remoteUserService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private TransportService transportDubboService;
@@ -92,7 +93,7 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/7/11
      **/
-    public KwfTruckDetailVo detail(Long truckId){
+    public KwfTruckDetailVo detail(Long truckId) {
         //车辆信息
         KwfTruck truck = this.selectByKey(truckId);
         KwfTruckDetailVo truckDetailVo = new KwfTruckDetailVo();
@@ -135,7 +136,7 @@ public class KwfTruckService {
         /**统计数据**/
         List<KwfTableTopCount> counts = statisticsHandle(params);
         long tatol = 0;
-        for (KwfTableTopCount topCount:counts) {
+        for (KwfTableTopCount topCount : counts) {
             tatol += topCount.getTotal();
         }
 
@@ -148,10 +149,14 @@ public class KwfTruckService {
         countList.add(allCount);
 
         /**数据处理**/
-        Map<String, Integer> authStatusMap = new HashMap(){{put("正常", 1); put("临时", 2); put("异常", 3);}};
-        for(Map.Entry<String, Integer> entry:authStatusMap.entrySet()){
+        Map<String, Integer> authStatusMap = new HashMap() {{
+            put("正常", 1);
+            put("临时", 2);
+            put("异常", 3);
+        }};
+        for (Map.Entry<String, Integer> entry : authStatusMap.entrySet()) {
             KwfTableTopCount count = new KwfTableTopCount();
-            for (KwfTableTopCount topCount:counts) {
+            for (KwfTableTopCount topCount : counts) {
                 if (Integer.parseInt(topCount.getValue()) == entry.getValue()) {
                     BeanUtils.copyProperties(topCount, count);
                 }
@@ -184,11 +189,16 @@ public class KwfTruckService {
             Object keywords = params.get("keywords");
             if (StringUtils.isNotBlank(keywords)) {
                 //查询企业
-                List<Integer> entTypes = new ArrayList<>(){{add(EntTypeEnum.LOGISTICS3.getCode()); add(EntTypeEnum.LOGISTICS4.getCode());}};
+                List<Integer> entTypes = new ArrayList<>() {{
+                    add(EntTypeEnum.LOGISTICS3.getCode());
+                    add(EntTypeEnum.LOGISTICS4.getCode());
+                }};
                 List<Long> entIds = remoteUserService.findEntIds(entTypes, StringUtils.objectStr(keywords));
                 params.put("entIds", entIds);
                 //查询用户
-                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>(){{add(LoginUserHolder.getEntId());}}, StringUtils.objectStr(keywords));
+                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>() {{
+                    add(LoginUserHolder.getEntId());
+                }}, StringUtils.objectStr(keywords));
                 params.put("createBys", userIds);
             }
             params.put("entId", LoginUserHolder.getEntId());
@@ -216,7 +226,7 @@ public class KwfTruckService {
         List<Long> entIds = new ArrayList<>();
         List<String> dictKey = new ArrayList<>();
 
-        for (KwfTruckVo truck:trucks) {
+        for (KwfTruckVo truck : trucks) {
             createBys.add(Long.parseLong(truck.getCreateBy()));
             entIds.add(Long.parseLong(truck.getEntId()));
             dictKey.add(truck.getColor() != null ? DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor() : null);
@@ -234,7 +244,7 @@ public class KwfTruckService {
         Map<String, SysDictResDto> dicts = this.dict(dictKey);
 
         /**数据组装**/
-        for (KwfTruckVo truck:trucks) {
+        for (KwfTruckVo truck : trucks) {
             UserCacheResDto user = users == null ? null : users.get(Long.parseLong(truck.getCreateBy()));
             EntCacheResDto ent = ents == null ? null : ents.get(Long.parseLong(truck.getEntId()));
             SysDictResDto color = dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
@@ -267,11 +277,16 @@ public class KwfTruckService {
             Object keywords = params.get("keywords");
             if (StringUtils.isNotBlank(keywords)) {
                 //查询企业
-                List<Integer> entTypes = new ArrayList<>(){{add(EntTypeEnum.LOGISTICS3.getCode()); add(EntTypeEnum.LOGISTICS4.getCode());}};
+                List<Integer> entTypes = new ArrayList<>() {{
+                    add(EntTypeEnum.LOGISTICS3.getCode());
+                    add(EntTypeEnum.LOGISTICS4.getCode());
+                }};
                 List<Long> entIds = remoteUserService.findEntIds(entTypes, StringUtils.objectStr(keywords));
                 params.put("entIds", entIds);
                 //查询用户
-                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>(){{add(LoginUserHolder.getEntId());}}, StringUtils.objectStr(keywords));
+                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>() {{
+                    add(LoginUserHolder.getEntId());
+                }}, StringUtils.objectStr(keywords));
                 params.put("createBys", userIds);
             }
             params.put("entId", LoginUserHolder.getEntId());
@@ -307,8 +322,8 @@ public class KwfTruckService {
 
         /**数据处理**/
         int count = 0;
-        List<KwfTruckExcelImportDto> truckExcels = (List)result.getData();
-        for (KwfTruckExcelImportDto kwfTruckExcel:truckExcels) {
+        List<KwfTruckExcelImportDto> truckExcels = (List) result.getData();
+        for (KwfTruckExcelImportDto kwfTruckExcel : truckExcels) {
             //车辆信息
             KwfTruck truck = new KwfTruck();
             truck.setTruckNo(kwfTruckExcel.getTruckNo());
@@ -316,11 +331,11 @@ public class KwfTruckService {
             truck.setAuthStatus(Global.NUMERICAL_TWO);
             result = truckEdit(truck);
             if (result.getCode() == HttpStatus.SUCCESS_CODE) {
-                count ++;
+                count++;
             }
         }
 
-        return HttpResult.ok("成功导入"+count+"行数据!");
+        return HttpResult.ok("成功导入" + count + "行数据!");
     }
 
     /**
@@ -344,7 +359,7 @@ public class KwfTruckService {
         if (result.getCode() != HttpStatus.SUCCESS_CODE) {
             return result;
         }
-        truck = (KwfTruck)result.getData();
+        truck = (KwfTruck) result.getData();
 
         /**车辆行驶证信息**/
         KwfTruckLicenseDto truckLicenseDto = params.getTruckLicense();
@@ -375,7 +390,7 @@ public class KwfTruckService {
     public HttpResult update(KwfTruckDto params) {
         /**数据校验**/
         if (StringUtils.isBlank(params.getId())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE,"车辆信息ID不能为空!");
+            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, "车辆信息ID不能为空!");
         }
         KwfTruck truck = truckDao.selectById(params.getId());
         if (truck == null) {
@@ -453,7 +468,9 @@ public class KwfTruckService {
     public HttpResult truckEdit(KwfTruck params) {
         if (StringUtils.isBlank(params.getId())) {
             /**唯一性交易**/
-            List<KwfTruck> trucks = truckDao.findTruck(new HashMap(){{ put("truckNo", params.getTruckNo()); }});
+            List<KwfTruck> trucks = truckDao.findTruck(new HashMap() {{
+                put("truckNo", params.getTruckNo());
+            }});
             if (CollectionUtils.isEmpty(trucks)) {
                 /**新增**/
                 params.setEntId(LoginUserHolder.getEntId());
@@ -479,7 +496,9 @@ public class KwfTruckService {
             }
         } else {
             /**唯一性交易**/
-            List<KwfTruck> trucks = truckDao.findTruck(new HashMap(){{ put("truckNo", params.getTruckNo()); }});
+            List<KwfTruck> trucks = truckDao.findTruck(new HashMap() {{
+                put("truckNo", params.getTruckNo());
+            }});
             //校验list中对象key值是否存在与value不一致的情况
             boolean bool = listByKeyValue(trucks, params.getId());
             if (bool) {
@@ -637,12 +656,12 @@ public class KwfTruckService {
 
     /**
      * @param truckId 车辆id
-     * @param entId 企业id
+     * @param entId   企业id
      * @desc 查询车队班组
      * @author zk
      * @date 2023/7/20
      **/
-    public KwfFleet findByFleetTruck(Long truckId, Long entId){
+    public KwfFleet findByFleetTruck(Long truckId, Long entId) {
         return fleetTruckDao.findByFleetTruck(truckId, entId);
     }
 
@@ -681,7 +700,7 @@ public class KwfTruckService {
 
     /**
      * @param params {truckNo 車牌號}
-     * @desc 车辆查询(业务关联+归属车辆)
+     * @desc 车辆查询(业务关联 + 归属车辆)
      * @author zk
      * @date 2023/9/5
      **/
@@ -785,9 +804,17 @@ public class KwfTruckService {
             return trucks;
         }
 
-        //运营端
+        //运营端+加客户经理数据过滤
         if (LoginUserHolder.getSystemType() == SystemTypeEnum.MANAGE.getCode()) {
-            return truckDao.findTruckByAll(params);
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)){
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)){
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            return truckDao.findTruckByAll(params,authEntIdList);
         }
         return new ArrayList<>();
     }
@@ -805,7 +832,9 @@ public class KwfTruckService {
         RWaybillOrderVo waybillOrder = getWaybillOrder(truckNo, Global.NUMERICAL_THREE);
         String firmName = LoginEntHolder.getFirmName();
         if (LoginUserHolder.getSystemType() == SystemTypeEnum.MANAGE.getCode()) {
-            List<KwfTruck> trucks = truckDao.findTruck(new HashMap<>(Global.NUMERICAL_SIXTEEN){{put("truckNo", truckNo);}});
+            List<KwfTruck> trucks = truckDao.findTruck(new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
+                put("truckNo", truckNo);
+            }});
             KwfTruck truck = CollectionUtils.isEmpty(trucks) ? null : trucks.get(Global.NUMERICAL_ZERO);
             if (truck != null) {
                 //企业数据集
@@ -838,7 +867,7 @@ public class KwfTruckService {
     }
 
     /**
-     * @param type 字典类型
+     * @param type  字典类型
      * @param value 字典值
      * @desc 获取数据字典值
      * @author zk
@@ -848,7 +877,7 @@ public class KwfTruckService {
         if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
             return null;
         }
-        List<String> dictKey = new ArrayList<>(){{
+        List<String> dictKey = new ArrayList<>() {{
             add(type + Global.POUND + value);
         }};
         Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
@@ -936,7 +965,7 @@ public class KwfTruckService {
             InputStream inputStream = file.getInputStream();
             excelReader = EasyExcel.read(inputStream, importListener).build();
 
-            ReadSheet readSheet = EasyExcel.readSheet( 0) .headRowNumber(2).head(KwfTruckExcelImportDto .class).build();
+            ReadSheet readSheet = EasyExcel.readSheet(0).headRowNumber(2).head(KwfTruckExcelImportDto.class).build();
             excelReader.read(readSheet);
             if (importListener.getErrorList().size() > 0) {
                 return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "数据格式不正确,请确认!", importListener.getErrorList());
@@ -958,7 +987,8 @@ public class KwfTruckService {
 
     /**
      * 校验list中对象key值是否存在与value不一致的情况
-     * @param list 数据集
+     *
+     * @param list  数据集
      * @param value 匹配值
      * @return
      */
@@ -966,7 +996,7 @@ public class KwfTruckService {
         if (CollectionUtils.isEmpty(list)) {
             return false;
         }
-        for (KwfTruck truck:list) {
+        for (KwfTruck truck : list) {
             if (value != null && !truck.getId().equals(value)) {
                 return true;
             }
@@ -980,7 +1010,7 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/9/5
      **/
-    public Map<String, KwfTruckGpsVo> findTruckLocateHandle(List<String> truckNos){
+    public Map<String, KwfTruckGpsVo> findTruckLocateHandle(List<String> truckNos) {
         /**车牌号超过100则分批次请求数据**/
         int maxLimit = 500;
         List<List<String>> truckNoList = new ArrayList<List<String>>();
@@ -995,7 +1025,7 @@ public class KwfTruckService {
 
         /**获取数据**/
         Map<String, KwfTruckGpsVo> truckGpsMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
-        for (List<String> turckNo:truckNoList) {
+        for (List<String> turckNo : truckNoList) {
             Map<String, KwfTruckGpsVo> truckGps = findTruckLocate(turckNo);
             truckGpsMap.putAll(truckGps);
         }
@@ -1033,7 +1063,7 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/9/5
      **/
-    public Map<String, KwfTruckGpsVo> findTruckLocate(List<String> truckNos){
+    public Map<String, KwfTruckGpsVo> findTruckLocate(List<String> truckNos) {
         Map<String, KwfTruckGpsVo> truckGpsMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         if (truckNos == null || truckNos.size() == 0) {
             return truckGpsMap;
@@ -1054,7 +1084,7 @@ public class KwfTruckService {
                 }
                 JSONArray trucks = result.getJSONArray("data");
                 //log.info("车牌号数量="+ truckNos.size() + " GPS数量=" + (trucks != null ? trucks.size() : 0) + " 响应时间="+(entTime - begTime));
-                for (int i=0; trucks != null && i < trucks.size(); i++) {
+                for (int i = 0; trucks != null && i < trucks.size(); i++) {
                     JSONObject truck = trucks.getJSONObject(i);
                     JSONObject locateInfo = truck.getJSONObject("locateInfo");
                     KwfTruckGpsVo truckGps = new KwfTruckGpsVo();
@@ -1080,9 +1110,9 @@ public class KwfTruckService {
      * @date 2023/9/27
      **/
     public List<KwfTruckGpsVo> queryLocateTrack(GpsByTruckNoDto params) {
-        List<KwfTruckGpsVo>  truckGpsList = new ArrayList<>();
+        List<KwfTruckGpsVo> truckGpsList = new ArrayList<>();
         long page = 1, pageSize = 1000, size = 0, pages = 0;
-        Map queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN){{
+        Map queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
             put("vehicleNo", params.getTruckNo());
             put("startTime", params.getStartTime());
             put("endTime", params.getEndTime());
@@ -1101,9 +1131,9 @@ public class KwfTruckService {
                 return truckGpsList;
             }
             size = data.getLong("size");
-            pages = size/pageSize + (size%pageSize > 0 ? 1 : 0);
+            pages = size / pageSize + (size % pageSize > 0 ? 1 : 0);
             JSONArray trucks = data.getJSONArray("list");
-            for (int i=0; trucks != null && i < trucks.size(); i++) {
+            for (int i = 0; trucks != null && i < trucks.size(); i++) {
                 JSONObject truck = trucks.getJSONObject(i);
                 KwfTruckGpsVo truckGps = new KwfTruckGpsVo();
                 truckGps.setLat(truck.getString("lat"));
@@ -1118,7 +1148,7 @@ public class KwfTruckService {
                 return truckGpsList;
             }
 
-            for (long i=2; i <= pages; i++) {
+            for (long i = 2; i <= pages; i++) {
                 queryParams.put("page", i);
                 httpResult = HttpClientUtil.post(queryLocate, JSON.toJSONString(queryParams));
                 if (StringUtils.isNotBlank(httpResult)) {
@@ -1131,7 +1161,7 @@ public class KwfTruckService {
                         continue;
                     }
                     trucks = data.getJSONArray("list");
-                    for (int j=0; trucks != null && j < trucks.size(); j++) {
+                    for (int j = 0; trucks != null && j < trucks.size(); j++) {
                         JSONObject truck = trucks.getJSONObject(j);
                         KwfTruckGpsVo truckGps = new KwfTruckGpsVo();
                         truckGps.setTruckNo(truck.getString("vehicleNo"));
@@ -1156,14 +1186,16 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/9/5
      **/
-    public KwfTruckGpsVo findTruckLocate(String truckNo){
+    public KwfTruckGpsVo findTruckLocate(String truckNo) {
         if (StringUtils.isBlank(truckNo)) {
             return null;
         }
 
         try {
             Map<String, Object> params = new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
-                put("vehicleNoList", new ArrayList<>(){{add(truckNo);}});
+                put("vehicleNoList", new ArrayList<>() {{
+                    add(truckNo);
+                }});
             }};
             String httpResult = HttpClientUtil.post(queryLocate, JSON.toJSONString(params));
             if (StringUtils.isNotBlank(httpResult)) {
@@ -1193,12 +1225,12 @@ public class KwfTruckService {
 
     /**
      * @param gpsTimeStr 地位时间
-     * @param speed 速度
+     * @param speed      速度
      * @desc 校验当前车辆运行状态
      * @author zk
      * @date 2023/9/5
      **/
-    public int runStatus(String gpsTimeStr, Double speed){
+    public int runStatus(String gpsTimeStr, Double speed) {
         if (StringUtils.isBlank(gpsTimeStr)) {
             return Global.NUMERICAL_TWO;
         }

+ 7 - 1
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -391,9 +391,15 @@
         kt.truck_no, kt.business_status businessStatus, kt.ent_id entId
         from kwf_truck kt
         where kt.del_flag = 0
-        <if test="truckNo != null and truckNo != ''">
+        <if test="params.truckNo != null and params.truckNo != ''">
             and kt.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
+        <if test="authEntIdList != null and authEntIdList.size() != 0">
+            and kt.ent_id in
+            <foreach collection="authEntIdList" separator="," close=")" open="(" item="item">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <select id="truckStatistics" resultType="java.util.Map" >

+ 44 - 26
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/operator/TradeOrderManageService.java

@@ -16,8 +16,10 @@ import com.sckw.report.model.vo.OperatorTOrderListQueryVO;
 import com.sckw.report.model.vo.OperatorTOrderStsQueryVO;
 import com.sckw.report.service.KwOrderService;
 import com.sckw.report.service.param.TradeOrderListExport;
+import com.sckw.system.api.RemoteUserService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.data.domain.Sort;
 import org.springframework.data.mongodb.core.query.Criteria;
 import org.springframework.data.mongodb.core.query.Query;
@@ -41,6 +43,9 @@ public class TradeOrderManageService {
 
     private final KwOrderService kwOrderService;
 
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    private RemoteUserService remoteUserService;
+
 
     /**
      * @desc: 贸易订单列表分页查询
@@ -51,10 +56,14 @@ public class TradeOrderManageService {
      */
     public PageResult listPaging(OperatorTOrderListQueryVO params) {
         List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
-        if (CollectionUtils.isEmpty(authEntIdList)){
-            return PageResult.build(params.getPage(), params.getPageSize(), 0L, Collections.emptyList());
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return PageResult.build(params.getPage(), params.getPageSize(), 0L, Collections.emptyList());
+            }
+            authEntIdList.addAll(ids);
         }
-        Criteria criteria = buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), false);
+        Criteria criteria = buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), false, authEntIdList);
         Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
         return kwOrderService.getResult(criteria, sort, params.getPage(), params.getPageSize());
     }
@@ -68,26 +77,30 @@ public class TradeOrderManageService {
      */
     public TableStatisticRes listStatistic(OperatorTOrderStsQueryVO params) {
         List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
-        if (CollectionUtils.isEmpty(authEntIdList)){
-            List<TOrderStatusEnum> enums = TOrderStatusEnum.getSortList();
-            enums.remove(0);
-            List<TableTop> list = new ArrayList<>();
-            for (TOrderStatusEnum e : enums) {
-                Integer value = e.getCode();
-                TableTop tableTop = new TableTop();
-                tableTop.setName(e.getMsg()).setValue(value).setTotal(0);
-                list.add(tableTop);
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                List<TOrderStatusEnum> enums = TOrderStatusEnum.getSortList();
+                enums.remove(0);
+                List<TableTop> list = new ArrayList<>();
+                for (TOrderStatusEnum e : enums) {
+                    Integer value = e.getCode();
+                    TableTop tableTop = new TableTop();
+                    tableTop.setName(e.getMsg()).setValue(value).setTotal(0);
+                    list.add(tableTop);
+                }
+                TableTop all = new TableTop();
+                all.setName("全部").setTotal(0);
+                list.add(0, all);
+                TableBottom tableBottom = new TableBottom();
+                tableBottom.setTotal(0);
+                TableStatisticRes res = new TableStatisticRes();
+                res.setTableTops(list).setTableBottom(tableBottom);
+                return res;
             }
-            TableTop all = new TableTop();
-            all.setName("全部").setTotal(0);
-            list.add(0, all);
-            TableBottom tableBottom = new TableBottom();
-            tableBottom.setTotal(0);
-            TableStatisticRes res = new TableStatisticRes();
-            res.setTableTops(list).setTableBottom(tableBottom);
-            return res;
+            authEntIdList.addAll(ids);
         }
-        Criteria criteria = buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), true);
+        Criteria criteria = buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), true, authEntIdList);
         List<TOrderStatusEnum> enums = TOrderStatusEnum.getSortList();
         enums.remove(0);
         return kwOrderService.getTableStatistic(criteria, enums);
@@ -102,9 +115,13 @@ public class TradeOrderManageService {
      */
     public List<TradeOrderListExport> export(OperatorTOrderExportQueryVO params) {
         List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
-        if (CollectionUtils.isEmpty(authEntIdList)){
-            List<TradeOrderListExport> exports = new ArrayList<>();
-            return exports;
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                List<TradeOrderListExport> exports = new ArrayList<>();
+                return exports;
+            }
+            authEntIdList.addAll(ids);
         }
         Query query = new Query();
         if (StringUtils.isNotBlank(params.getIds())) {
@@ -113,7 +130,7 @@ public class TradeOrderManageService {
             criteria.and("_id").in(ids).and("delFlag").is(0);
             query.addCriteria(criteria);
         } else {
-            query.addCriteria(buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), false));
+            query.addCriteria(buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), false,authEntIdList));
         }
         query.with(Sort.by(Sort.Order.desc("createTime")));
         return kwOrderService.getExportResult(query);
@@ -127,8 +144,9 @@ public class TradeOrderManageService {
      * @Param isStatistic:
      * @return: org.springframework.data.mongodb.core.query.Criteria
      */
-    private Criteria buildCriteria(OperatorTOrderListStsConditionDTO params, boolean isStatistic) {
+    private Criteria buildCriteria(OperatorTOrderListStsConditionDTO params, boolean isStatistic, List<Long> authEntIdList) {
         Criteria condition = new Criteria();
+        condition.and("entId").in(authEntIdList);
         condition.and("delFlag").is(0);
         //状态
         if (!isStatistic && Objects.nonNull(params.getStatus())) {

+ 13 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java

@@ -95,7 +95,7 @@ public interface KwsEnterpriseDao {
      * @param params
      * @return
      */
-    List<FindEntListPojo> findPojoAndManager(@Param(value = "dto") FindPojoParam params);
+    List<FindEntListPojo> findPojoAndManager(@Param(value = "dto") FindPojoParam params,@Param(value = "authEntIdList")  List<Long> authEntIdList);
 
     /**
      * 根据用户查企业信息
@@ -205,5 +205,17 @@ public interface KwsEnterpriseDao {
      */
     List<Long> findEnterpriseIdsByUserIdAndUserRoleIds(@Param("userIds") List<Long> userIds, @Param("roleIds") List<Long> roleIds);
 
+    /**
+     * (客户经理)用户id获取所有关联的企业
+     * @param userIds
+     * @return
+     */
     List<Long> findEnterpriseIdsByUserIds(@Param("userIds") List<Long> userIds);
+
+    /**
+     * 获取所有企业
+     * @return
+     */
+    List<KwsEnterprise> findAllEnterprise();
+
 }

+ 56 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java

@@ -296,6 +296,42 @@ public class RemoteUserServiceImpl implements RemoteUserService {
         return userIds;
     }
 
+
+    /**
+     * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)
+     *
+     * @param userId 客户经理id
+     * @return list 企业id数组
+     */
+    @Override
+    public List<Long> findEnterpriseIdsByUserIdIsMain(Long userId) {
+        List<Long> enterpriseIds = new ArrayList<>();
+        KwsUser kwsUser = userDao.selectByKey(userId);
+        if (Global.YES == kwsUser.getIsMain()) {
+            List<Long> enterpriseIdList = findAllEnterprise();
+            enterpriseIds.addAll(enterpriseIdList);
+        } else {
+            List<KwsUserRole> userRoles = userRoleDao.findAllByUserId(userId);
+            if (!org.springframework.util.CollectionUtils.isEmpty(userRoles) && userRoles.size() > 0) {
+                List<Long> roleIds = userRoles.stream().map(KwsUserRole::getRoleId).distinct().collect(Collectors.toList());
+//            enterpriseIds = kwsEnterpriseDao.findEnterpriseIdsByUserRoleId(userId);
+                List<Long> idsByUserRoleIds = kwsEnterpriseDao.findEnterpriseIdsByUserRoleIds(userId, roleIds);
+                if (idsByUserRoleIds.size() > 0) {
+                    enterpriseIds.addAll(idsByUserRoleIds);
+                }
+            }
+            List<Long> entIds = kwsEnterpriseDao.findEnterpriseIdsByUserIds(Collections.singletonList(userId));
+            if (entIds.size() > 0) {
+                enterpriseIds.addAll(entIds);
+            }
+        }
+        if (CollectionUtils.isNotEmpty(enterpriseIds) && enterpriseIds.size() > 0) {
+            enterpriseIds = enterpriseIds.stream().distinct().collect(Collectors.toList());
+        }
+        return enterpriseIds;
+    }
+
+
     /**
      * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)
      *
@@ -311,6 +347,11 @@ public class RemoteUserServiceImpl implements RemoteUserService {
 //            enterpriseIds = kwsEnterpriseDao.findEnterpriseIdsByUserRoleId(userId);
             enterpriseIds = kwsEnterpriseDao.findEnterpriseIdsByUserRoleIds(userId, roleIds);
         }
+        List<Long> entIds = kwsEnterpriseDao.findEnterpriseIdsByUserIds(Collections.singletonList(userId));
+        if (entIds.size() > 0) {
+            enterpriseIds.addAll(entIds);
+        }
+        enterpriseIds = enterpriseIds.stream().distinct().collect(Collectors.toList());
         return enterpriseIds;
     }
 
@@ -359,6 +400,21 @@ public class RemoteUserServiceImpl implements RemoteUserService {
         return userIds;
     }
 
+    /**
+     * 获取所有企业信息
+     *
+     * @return
+     */
+    @Override
+    public List<Long> findAllEnterprise() {
+        List<Long> entIds = null;
+        List<KwsEnterprise> enterprises = kwsEnterpriseDao.findAllEnterprise();
+        if (CollectionUtils.isNotEmpty(enterprises)) {
+            entIds = enterprises.stream().map(KwsEnterprise::getId).collect(Collectors.toList());
+        }
+        return entIds;
+    }
+
     /**
      * 根据用户名查用户信息
      *

+ 73 - 11
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.*;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
@@ -16,6 +17,7 @@ import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.stream.enums.MessageEnum;
 import com.sckw.stream.model.UserInfo;
+import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.req.RegisterReqDto;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.RegisterResDto;
@@ -88,6 +90,9 @@ public class KwsEnterpriseService {
     @Autowired
     private RemoteSystemServiceImpl remoteSystemService;
 
+    @Autowired
+    private RemoteUserService remoteUserService;
+
     @Autowired
     private SysAreaDao sysAreaDao;
 
@@ -221,9 +226,12 @@ public class KwsEnterpriseService {
 //        List<FindEntListPojo> list = findPojo(reqVo);
         List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
         if (authEntIdList.size() < 1) {
-            return PageHelperUtil.getPageResult(new PageInfo<>(result));
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (ids.size() < 1) {
+                return PageHelperUtil.getPageResult(new PageInfo<>(result));
+            }
         }
-        List<FindEntListPojo> list = findPojoManager(reqVo);
+        List<FindEntListPojo> list = findPojoManager(reqVo, authEntIdList);
         if (CollectionUtils.isEmpty(list)) {
             return PageHelperUtil.getPageResult(new PageInfo<>(result));
         }
@@ -245,7 +253,7 @@ public class KwsEnterpriseService {
         return PageHelperUtil.getPageResult(new PageInfo<>(result), list, reqVo.getPageSize());
     }
 
-    private List<FindEntListPojo> findPojoManager(EntFindPageReqVo reqVo) {
+    private List<FindEntListPojo> findPojoManager(EntFindPageReqVo reqVo, List<Long> authEntIdList) {
         FindPojoParam findPojoParam = new FindPojoParam();
         BeanUtils.copyProperties(reqVo, findPojoParam);
         findPojoParam.setIdList(StringUtils.splitStrToList(reqVo.getIds(), Long.class));
@@ -253,7 +261,7 @@ public class KwsEnterpriseService {
             findPojoParam.setTypeList(Arrays.stream(reqVo.getEntTypes().split(Global.COMMA)).map(Integer::parseInt).toList());
         }
 
-        return kwsEnterpriseDao.findPojoAndManager(findPojoParam);
+        return kwsEnterpriseDao.findPojoAndManager(findPojoParam, authEntIdList);
     }
 
     /**
@@ -345,7 +353,14 @@ public class KwsEnterpriseService {
         kwsEnterprise.setOrgCode("");
         kwsEnterprise.setRegTime(date);
         kwsEnterprise.setUpdateBy(LoginUserHolder.getUserId());
-
+        //默认给一个客户经理(admin账号)
+        if (StringUtils.isBlank(reqVo.getManager())) {
+            List<KwsUserSystemTypeVo> userSystemTypeVos = userDao.selectUserBySystemType(SystemTypeEnum.MANAGE.getCode());
+            if (CollectionUtils.isNotEmpty(userSystemTypeVos)) {
+                KwsUserSystemTypeVo kwsUserSystemTypeVo = userSystemTypeVos.get(0);
+                kwsEnterprise.setManager(kwsUserSystemTypeVo.getId());
+            }
+        }
         List<KwsEntCheckTrack> list = kwsEntCheckTrackDao.findList(entId);
         kwsEnterprise.setApproval(list.stream().anyMatch(item -> item.getStatus().equals(Global.NO)) ? ApprovalEnum.REFRESH.getCode() : ApprovalEnum.PROCESS.getCode());
         if (kwsEnterpriseDao.update(kwsEnterprise) <= 0) {
@@ -882,10 +897,25 @@ public class KwsEnterpriseService {
      * @date: 2023/7/13
      */
     public List<FindListGroupResVo> findListGroup(EntFindPageReqVo reqVo) {
-        List<FindEntListPojo> list = findPojo(reqVo);
-        Map<Integer, List<FindEntListPojo>> collect = list.stream().collect(Collectors.groupingBy(FindEntListPojo::getApproval));
-
         List<FindListGroupResVo> result = new ArrayList<>();
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (ids.size() < 1) {
+                List<Map<String, String>> defaultApprovalEnum = ApprovalEnum.getDefaultApprovalEnum();
+                for (Map<String, String> map : defaultApprovalEnum) {
+                    FindListGroupResVo vo = new FindListGroupResVo();
+                    vo.setApproval(Integer.parseInt(map.get("code")));
+                    vo.setApprovalName(map.get("name"));
+                    vo.setCount(NumberConstant.ZERO);
+                    result.add(vo);
+                }
+                return result;
+            }
+        }
+//        List<FindEntListPojo> list = findPojo(reqVo);
+        List<FindEntListPojo> list = findPojoManager(reqVo, authEntIdList);
+        Map<Integer, List<FindEntListPojo>> collect = list.stream().collect(Collectors.groupingBy(FindEntListPojo::getApproval));
         FindListGroupResVo findListGroupResVo = new FindListGroupResVo();
         findListGroupResVo.setCount(list.size());
         result.add(findListGroupResVo);
@@ -1251,8 +1281,17 @@ public class KwsEnterpriseService {
      * @date: 2023/9/14
      */
     public List<QueryCustomerResVo> queryCustomerGroup(EntFindPageReqVo reqVo) {
-        List<FindEntListPojo> list = findPojo(reqVo);
         List<QueryCustomerResVo> result = new ArrayList<>();
+//        List<FindEntListPojo> list = findPojo(reqVo);
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (ids.size() < 1) {
+                getDefaultReturn(result);
+                return result;
+            }
+        }
+        List<FindEntListPojo> list = findPojoManager(reqVo, authEntIdList);
         Map<Integer, List<FindEntListPojo>> collect = list.stream().collect(Collectors.groupingBy(FindEntListPojo::getStatus));
 
         List<FindEntListPojo> findEntListPojos1 = collect.get(Global.NO);
@@ -1276,6 +1315,25 @@ public class KwsEnterpriseService {
         return result;
     }
 
+    private void getDefaultReturn(List<QueryCustomerResVo> result) {
+        QueryCustomerResVo queryCustomerResVo1 = new QueryCustomerResVo();
+        queryCustomerResVo1.setStatus(Global.NO);
+        queryCustomerResVo1.setStatusName("正常");
+        queryCustomerResVo1.setCnt(0);
+
+        QueryCustomerResVo queryCustomerResVo2 = new QueryCustomerResVo();
+        queryCustomerResVo2.setStatus(Global.YES);
+        queryCustomerResVo2.setStatusName("冻结");
+        queryCustomerResVo2.setCnt(0);
+
+        QueryCustomerResVo queryCustomerResVo = new QueryCustomerResVo();
+        queryCustomerResVo.setStatusName("全部");
+        queryCustomerResVo.setCnt(0);
+        result.add(queryCustomerResVo);
+        result.add(queryCustomerResVo1);
+        result.add(queryCustomerResVo2);
+    }
+
 
     /**
      * @desc: 入驻认证导出
@@ -1285,9 +1343,13 @@ public class KwsEnterpriseService {
     public void exportEntSettle(EntFindPageReqVo reqVo, HttpServletResponse response) {
         List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
         if (CollectionUtils.isEmpty(authEntIdList)) {
-            throw new SystemException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (ids.size() < 1) {
+                throw new SystemException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
+            }
         }
-        List<FindEntListPojo> list = findPojo(reqVo);
+//        List<FindEntListPojo> list = findPojo(reqVo);
+        List<FindEntListPojo> list = findPojoManager(reqVo, authEntIdList);
         List<EntFindPageResVo> result = new ArrayList<>();
 
         if (CollectionUtils.isEmpty(list)) {

+ 4 - 4
sckw-modules/sckw-system/src/main/resources/bootstrap-test.yml

@@ -3,16 +3,16 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: @nacos.server@
+        server-addr: 10.10.10.224:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-service-platform
         # 共享配置
         group: sckw-service-platform
       config:
         # 配置中心地址
-        server-addr: @nacos.server@
+        server-addr: 10.10.10.224:8848
         # 命名空间
-        namespace: @nacos.namespace@
+        namespace: sckw-service-platform
         # 共享配置
         group: sckw-service-platform
         # 配置文件格式

+ 13 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -778,6 +778,12 @@
       left join kws_ent_dep c on a.id = c.ent_id
       left join kws_enterprise d on c.ent_pid = d.id
       where a.del_flag = 0
+      <if test="authEntIdList != null and authEntIdList.size() != 0">
+          and a.id in
+          <foreach collection="authEntIdList" item="item" open="(" close=")" separator=",">
+              #{item}
+          </foreach>
+      </if>
       <if test="dto.typeList != null and dto.typeList.size() > 0">
           and exists (select 1
           from kws_ent_type kt
@@ -900,4 +906,11 @@
           </foreach>
       </if>
   </select>
+
+  <select id="findAllEnterprise" resultMap="BaseResultMap">
+      select
+      <include refid="Base_Column_List" />
+      from kws_enterprise where status = 0
+      and del_flag = 0
+    </select>
 </mapper>