Преглед изворни кода

1、非司机用户登陆时专场校验;

zk пре 2 година
родитељ
комит
bad9ce1432
17 измењених фајлова са 349 додато и 401 уклоњено
  1. 5 78
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java
  2. 5 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginBase.java
  3. 10 24
      sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java
  4. 157 280
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  5. 3 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/RequestConstant.java
  6. 7 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  7. 8 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java
  8. 55 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SpecialResVo.java
  9. 17 4
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java
  10. 9 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  11. 10 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/KwsSpecial.java
  12. 7 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/KwsSpecialAddReqVo.java
  13. 7 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/KwsSpecialUpdateReqVo.java
  14. 10 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/KwsSpecialResVo.java
  15. 10 4
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  16. 25 3
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsSpecialService.java
  17. 4 4
      sckw-modules/sckw-system/src/main/resources/mapper/KwsSpecialDao.xml

+ 5 - 78
sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

@@ -2,15 +2,9 @@ package com.sckw.auth.controller;
 
 
 import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.service.IAuthService;
 import com.sckw.auth.service.IAuthService;
-import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.model.enums.LoginMethodEnum;
 import com.sckw.core.model.enums.LoginMethodEnum;
-import com.sckw.core.model.enums.SystemTypeEnum;
-import com.sckw.core.utils.RegularUtils;
-import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.redis.constant.RedisConstant;
-import com.sckw.redis.utils.RedissonUtils;
 import jakarta.validation.Valid;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -27,51 +21,6 @@ public class AuthController {
     @Autowired
     @Autowired
     private IAuthService authService;
     private IAuthService authService;
 
 
-    /**
-     * @param
-     * @return
-     * @description 登录参数校验
-     * @author zk
-     * @date 2020/6/14 18:14
-     **/
-    public HttpResult checkParams(LoginBase params) {
-        if (StringUtils.isBlank(params.getSystemType())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "应用服务类型不能为空!");
-        }
-        if (StringUtils.isBlank(params.getClientType())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "客户端类型不能为空!");
-        }
-        if (StringUtils.isBlank(params.getAccount())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的账号!");
-        }
-        if (params.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue() && StringUtils.isBlank(params.getPassword())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的密码!");
-        }
-
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !RegularUtils.matchs(RegularUtils.PHONE_REG, params.getAccount())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, "手机号格式不正确,请检查并重新输入!");
-        }
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(params.getCaptcha())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的验证码!");
-        }
-        String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_LOGIN.getValue(), params.getAccount());
-
-        RedissonUtils.putString(key, params.getCaptcha(), RedisConstant.SMS_VERIFY_CODE_VALID_TIME);
-        String smsCaptcha = RedissonUtils.getString(key);
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
-        }
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
-            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
-        }
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !smsCaptcha.equals(params.getCaptcha())) {
-            return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码不正确,请检查并重新输入!");
-        }
-
-        return HttpResult.ok();
-    }
-    /**--------------------------------------------------------------------------------------------------------------**/
-
     /**
     /**
      * @param reqVo 登录入参
      * @param reqVo 登录入参
      * @return HttpResult
      * @return HttpResult
@@ -82,7 +31,8 @@ public class AuthController {
     @PostMapping("/login")
     @PostMapping("/login")
     public HttpResult login(@Valid @RequestBody LoginReqVo reqVo,
     public HttpResult login(@Valid @RequestBody LoginReqVo reqVo,
                             @RequestHeader(name = "Client-Type", required = true) String clientType,
                             @RequestHeader(name = "Client-Type", required = true) String clientType,
-                            @RequestHeader(name = "System-Type", required = true) int systemType) {
+                            @RequestHeader(name = "System-Type", required = true) int systemType,
+                            @RequestHeader(name = "Access-Special", required = true) String accessSpecial) {
         reqVo.setSystemType(systemType);
         reqVo.setSystemType(systemType);
         reqVo.setClientType(clientType);
         reqVo.setClientType(clientType);
         LoginBase loginBase = new LoginBase();
         LoginBase loginBase = new LoginBase();
@@ -91,33 +41,11 @@ public class AuthController {
         loginBase.setCaptcha(reqVo.getCaptcha());
         loginBase.setCaptcha(reqVo.getCaptcha());
         loginBase.setSystemType(systemType);
         loginBase.setSystemType(systemType);
         loginBase.setClientType(clientType);
         loginBase.setClientType(clientType);
-
+        loginBase.setAccessSpecial(accessSpecial);
         loginBase.setLoginMethod(LoginMethodEnum.ORDINARY.getValue());
         loginBase.setLoginMethod(LoginMethodEnum.ORDINARY.getValue());
-        if (StringUtils.isNotBlank(loginBase.getCaptcha())) {
-            loginBase.setLoginMethod(LoginMethodEnum.SMS.getValue());
-        }
-
-        /**参数校验**/
-        HttpResult result = checkParams(loginBase);
-        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
-            return result;
-        }
-
-        /**运营端/企业端登录(PC/APP)**/
-        if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
-                || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
-            return authService.commonAuth(loginBase);
-        }
-
-        /**司机端**/
-        if (loginBase.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
-            return authService.driverAuth(loginBase);
-        }
-
-        return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
+        return authService.login(loginBase);
     }
     }
 
 
-
     /**
     /**
      * @return HttpResult
      * @return HttpResult
      * @desc: 根据token获取登录信息
      * @desc: 根据token获取登录信息
@@ -130,10 +58,9 @@ public class AuthController {
         return HttpResult.ok(authService.getLoginResByToken(clientType, token));
         return HttpResult.ok(authService.getLoginResByToken(clientType, token));
     }
     }
 
 
-
     /**
     /**
      * @param id 主键ID
      * @param id 主键ID
-     * @description 重置密码
+     * @desc 重置密码
      * @author zk
      * @author zk
      * @date 2023/06/02
      * @date 2023/06/02
      **/
      **/

+ 5 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginBase.java

@@ -35,6 +35,11 @@ public class LoginBase {
      */
      */
     private String clientType;
     private String clientType;
 
 
+    /**
+     * 专场标识
+     */
+    private String accessSpecial;
+
     /**
     /**
      * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
      * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
      */
      */

+ 10 - 24
sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java

@@ -1,22 +1,24 @@
 package com.sckw.auth.service;
 package com.sckw.auth.service;
 
 
 import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.model.vo.req.*;
-import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.auth.model.vo.res.LoginResVo1;
 import com.sckw.auth.model.vo.res.LoginResVo1;
-import com.sckw.core.exception.SystemException;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.HttpResult;
 
 
 /**
 /**
- *
+ * @desc: 登录
+ * @author: czh
+ * @date: 2023/6/19
  */
  */
 public interface IAuthService {
 public interface IAuthService {
 
 
     /**
     /**
-     * 登录
-     * @param reqVo
-     * @return
-     */
-    LoginResVo login(LoginReqVo reqVo) throws SystemException;
+     * @param loginBase {}
+     * @desc 登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
+    HttpResult login(LoginBase loginBase);
+
 
 
     /**
     /**
      * @param reqVo 注册入参
      * @param reqVo 注册入参
@@ -42,22 +44,6 @@ public interface IAuthService {
      */
      */
     void resetPassword(Long id);
     void resetPassword(Long id);
 
 
-    /**
-     * 司机端登录
-     * @param loginBase
-     * @return
-     */
-    HttpResult driverAuth(LoginBase loginBase);
-
-    /**
-     * @param loginBase {}
-     * @desc 运营/企业账号登陆
-     * @author zk
-     * @date 2023/7/26
-     **/
-    HttpResult commonAuth(LoginBase loginBase);
-
-
     /**
     /**
      * @return LoginResVo1
      * @return LoginResVo1
      * @desc: 根据token获取登录信息
      * @desc: 根据token获取登录信息

+ 157 - 280
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -3,10 +3,7 @@ package com.sckw.auth.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.sckw.auth.model.vo.req.ForgetPasswordReqVo;
 import com.sckw.auth.model.vo.req.ForgetPasswordReqVo;
 import com.sckw.auth.model.vo.req.LoginBase;
 import com.sckw.auth.model.vo.req.LoginBase;
-import com.sckw.auth.model.vo.req.LoginReqVo;
 import com.sckw.auth.model.vo.req.RegisterReqVo;
 import com.sckw.auth.model.vo.req.RegisterReqVo;
-import com.sckw.auth.model.vo.res.DeptInfoResVo;
-import com.sckw.auth.model.vo.res.EntInfoResVo;
 import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.auth.model.vo.res.LoginResVo1;
 import com.sckw.auth.model.vo.res.LoginResVo1;
 import com.sckw.auth.service.IAuthService;
 import com.sckw.auth.service.IAuthService;
@@ -14,14 +11,13 @@ import com.sckw.auth.util.AsyncFactory;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.LoginMethodEnum;
 import com.sckw.core.model.enums.LoginMethodEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.utils.*;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.context.LoginUserHolder;
-import com.sckw.core.web.model.EntCertificateInfo;
-import com.sckw.core.web.model.LoginEntInfo;
 import com.sckw.core.web.model.LoginUserInfo;
 import com.sckw.core.web.model.LoginUserInfo;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.RemoteFleetService;
 import com.sckw.fleet.api.RemoteFleetService;
@@ -33,15 +29,11 @@ import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.req.ForgetPasswordReqDto;
 import com.sckw.system.api.model.dto.req.ForgetPasswordReqDto;
 import com.sckw.system.api.model.dto.req.RegisterReqDto;
 import com.sckw.system.api.model.dto.req.RegisterReqDto;
 import com.sckw.system.api.model.dto.req.UserLoginReqDto;
 import com.sckw.system.api.model.dto.req.UserLoginReqDto;
-import com.sckw.system.api.model.dto.res.EntCacheResDto;
-import com.sckw.system.api.model.dto.res.FindEntUserResDto;
-import com.sckw.system.api.model.dto.res.KwsUserResDto;
-import com.sckw.system.api.model.dto.res.UserAccessMenuInfoResDto;
+import com.sckw.system.api.model.dto.res.*;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
-
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**
@@ -63,119 +55,29 @@ public class AuthServiceImpl implements IAuthService {
     private RemoteFleetService fleetService;
     private RemoteFleetService fleetService;
 
 
     @Override
     @Override
-    public LoginResVo login(LoginReqVo reqDto) {
-//        /*1、根据账号密码或者手机号校验码登录, 手机号后面处理*/
-//        KwsUserResDto kwsUser = checkLogin(reqDto);
-//        LoginResVo loginResVo = new LoginResVo();
-//        loginResVo.setClientType(reqDto.getClientType());
-//        BeanUtils.copyProperties(kwsUser, loginResVo);
-//
-//        //平台管理员直接过了
-//        if (kwsUser.getIsMain() == Global.YES && kwsUser.getSystemType().equals(SystemTypeEnum.MANAGE.getCode())) {
-//            afterProcessor(loginResVo);
-//            return loginResVo;
-//        }
-//        /*2、登录成功,查询角色信息*/
-//        Long userId = kwsUser.getId();
-//        List<KwsRoleResDto> kwsRoleResDtos = remoteUserService.queryRoleInfoByUserId(userId);
-//        loginResVo.setRoleInfo(kwsRoleResDtos);
-//
-//
-//        /*3、查询用户机构*/
-//        List<KwsUserDeptResDto> kwsUserDeptResDtos = remoteUserService.queryUserDeptByUserId(userId);
-//        if (CollectionUtils.isEmpty(kwsUserDeptResDtos)) {
-//            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.USER_DEPT_NOT_EXISTS);
-//        }
-//
-//        List<Long> deptIds = kwsUserDeptResDtos.stream().map(KwsUserDeptResDto::getDeptId).toList();
-//        List<KwsDeptResDto> kwsDepts = remoteUserService.queryDeptByIds(deptIds);
-//        if (CollectionUtils.isEmpty(kwsDepts)) {
-//            //数据不全,直接返回
-//            afterProcessor(loginResVo);
-//            return loginResVo;
-//        }
-//
-//        /*3、查企业*/
-//        //目前一个人只能归属于一个企业,所以这里取第一个就行
-//        Long entId = kwsDepts.get(0).getEntId();
-//        KwsEnterpriseResDto kwsEnterpriseResDto = remoteUserService.queryEnterpriseById(entId);
-//        if (Objects.isNull(kwsEnterpriseResDto)) {
-//            //只要查出了机构,这个if其实不会进的,做保险起见还是加上判空
-//            afterProcessor(loginResVo);
-//            return loginResVo;
-//        }
-//
-//        EntInfoResVo entInfoResVo = new EntInfoResVo();
-//        BeanUtils.copyProperties(kwsEnterpriseResDto, entInfoResVo);
-//        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
-//
-//        //查企业类型
-//        List<EntTypeResDto> entTypeResDtos = remoteUserService.queryEntTypeById(entId);
-//        if (CollectionUtils.isNotEmpty(entTypeResDtos)) {
-//            entInfoResVo.setEntTypes(String.join(Global.COMMA, entTypeResDtos.stream().map(EntTypeResDto::getType).map(String::valueOf).distinct().toList()));
-//        }
-//        loginResVo.setEntInfo(entInfoResVo);
-//
-//        /* 4、查资质*/
-//        List<EntCertificateResDto> entCertificateResDtoList = remoteUserService.queryCertificateByEntId(entId);
-//        entInfoResVo.setCertificateInfo(entCertificateResDtoList);
-//
-//        //企业资质有效性判断  1、当前资质没过期,且状态是已认证  2、只要有认证过一次就算有效  参数判断
-//        String checkType = String.valueOf(Global.NUMERICAL_TWO);
-//        if (checkType.equals(Global.NUMERICAL_ONE)) {
-//            for (EntCertificateResDto entCertificateResDto : entCertificateResDtoList) {
-//                Date expireTime = entCertificateResDto.getExpireTime();
-//                entInfoResVo.setValid(DateUtil.compare(new Date(), expireTime) <= 0);
-//            }
-//        } else {
-//            List<EntCheckTrackResDto> entCheckTrackResDtoList = remoteUserService.checkTrackByEntId(entId);
-//            if (CollectionUtils.isEmpty(entCheckTrackResDtoList)) {
-//                entInfoResVo.setValid(false);
-//                afterProcessor(loginResVo);
-//                return loginResVo;
-//            }
-//            entInfoResVo.setValid(entCheckTrackResDtoList.stream().anyMatch(item -> item.getStatus() == Global.NO));
-//        }
-//
-//        /*5、生成token,一些信息存redis*/
-//        afterProcessor(loginResVo);
-//        return loginResVo;
-        return null;
-    }
+    public HttpResult login(LoginBase loginBase) {
+        if (StringUtils.isNotBlank(loginBase.getCaptcha())) {
+            loginBase.setLoginMethod(LoginMethodEnum.SMS.getValue());
+        }
 
 
-    private KwsUserResDto checkLogin(LoginReqVo reqDto) {
-        List<KwsUserResDto> kwsUsers = remoteUserService.checkUserBase(reqDto.getAccount(), reqDto.getSystemType());
-        KwsUserResDto kwsUser = kwsUsers.get(0);
-        //密码校验、验证码
-        if (StringUtils.isNotBlank(reqDto.getPassword())) {
-            remoteUserService.checkPassword(reqDto.getAccount(), reqDto.getPassword(), kwsUser.getPassword(), kwsUser.getSalt());
-        } else {
-            String key = Global.USER_LOGIN_CAPTCHA + reqDto.getSystemType() + Global.COLON + kwsUser.getAccount();
-//            String captcha = RedissonUtils.getString(key);
-//            if (StringUtils.isBlank(captcha) || StringUtils.isBlank(reqDto.getCaptcha()) || !reqDto.getCaptcha().equals(captcha)) {
-//                throw new SystemException(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.CAPCHA_ERROR);
-//            }
-//            RedissonUtils.delete(key);
-        }
-        return kwsUser;
-    }
+        /*参数校验*/
+        HttpResult result = checkParams(loginBase);
+        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+            return result;
+        }
 
 
-    /**
-     * @param loginResVo 登录的返参
-     * @desc: 生成token,存redis
-     * @author: czh
-     * @date: 2023/6/12
-     */
-    private void afterProcessor(LoginResVo loginResVo) {
-        try {
-            //设置token
-            loginResVo.setToken(EncryUtil.encry(Global.PRI_KEY, String.valueOf(loginResVo.getId())));
+        /*运营端/企业端登录(PC/APP)*/
+        if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
+                || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
+            return this.commonAuth(loginBase);
+        }
 
 
-            //异步存redis
-            AsyncFactory.execute(new AsyncProcess(loginResVo, remoteUserService));
-        } catch (Exception e) {
-            throw new SystemException(HttpStatus.GLOBAL_EXCEPTION_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
+        /*司机端*/
+        if (loginBase.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
+            return this.driverAuth(loginBase);
         }
         }
+
+        return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
     }
     }
 
 
     @Override
     @Override
@@ -193,7 +95,6 @@ public class AuthServiceImpl implements IAuthService {
         RedissonUtils.delete(key);
         RedissonUtils.delete(key);
     }
     }
 
 
-
     @Override
     @Override
     public void forgetPassword(ForgetPasswordReqVo reqDto) {
     public void forgetPassword(ForgetPasswordReqVo reqDto) {
         ForgetPasswordReqDto forgetPasswordReqDto = new ForgetPasswordReqDto();
         ForgetPasswordReqDto forgetPasswordReqDto = new ForgetPasswordReqDto();
@@ -206,156 +107,16 @@ public class AuthServiceImpl implements IAuthService {
         remoteUserService.resetPassword(id);
         remoteUserService.resetPassword(id);
     }
     }
 
 
-    static class AsyncProcess implements Runnable {
-
-        private final LoginResVo loginResVo;
-
-        private final RemoteUserService remoteUserService;
-
-        public AsyncProcess(LoginResVo loginResVo, RemoteUserService remoteUserService) {
-            this.loginResVo = loginResVo;
-            this.remoteUserService = remoteUserService;
-        }
-
-        @Override
-        public void run() {
-            //存基础信息
-            saveBaseToCache(loginResVo);
-
-            //存菜单权限
-            saveToCache(loginResVo);
-
-            //存登录记录信息
-            saveLoginInfo(loginResVo);
-        }
-
-
-        /**
-         * @param loginResVo 返参
-         * @desc: 存基础信息
-         * @author: czh
-         * @date: 2023/6/28
-         */
-        private void saveBaseToCache(LoginResVo loginResVo) {
-            //存用户登录信息
-            saveUserLoginInfo();
-
-            EntInfoResVo entInfo = loginResVo.getEntInfo();
-            if (Objects.isNull(entInfo)) {
-                return;
-            }
-            //单独存用户企业
-//            RedissonUtils.putString(Global.getFullUserEntKey(loginResVo.getSystemType(), loginResVo.getId()), JSON.toJSONString(entInfo), Global.PC_TOKEN_EXPIRE);
-
-            //存企业信息
-            saveEntLoginInfo(entInfo);
-        }
-
-        /**
-         * @param entInfo 企业信息
-         * @desc: 存企业信息
-         * @author: czh
-         * @date: 2023/7/3
-         */
-        private void saveEntLoginInfo(EntInfoResVo entInfo) {
-            LoginEntInfo loginEntInfo = new LoginEntInfo();
-            BeanUtils.copyProperties(entInfo, loginEntInfo);
-            loginEntInfo.setCertificateInfo(BeanUtils.copyToList(entInfo.getCertificateInfo(), EntCertificateInfo.class));
-            RedissonUtils.putString(Global.REDIS_ENTERPRISE_PREFIX + entInfo.getId(), JSON.toJSONString(loginEntInfo), Global.PC_TOKEN_EXPIRE);
-        }
-
-        /**
-         * @desc: 存用户登录信息
-         * @author: czh
-         * @date: 2023/6/29
-         */
-        private void saveUserLoginInfo() {
-            //存用户登录信息
-            LoginUserInfo loginUserInfo = new LoginUserInfo();
-            loginUserInfo.setId(loginResVo.getId());
-            loginUserInfo.setSystemType(loginResVo.getSystemType());
-            loginUserInfo.setAccount(loginResVo.getAccount());
-            loginUserInfo.setUserName(loginResVo.getName());
-            loginUserInfo.setPhone(loginResVo.getPhone());
-            loginUserInfo.setIsMain(loginResVo.getIsMain());
-            loginUserInfo.setStatus(loginResVo.getStatus());
-            loginUserInfo.setClientType(loginResVo.getClientType());
-            EntInfoResVo entInfo = loginResVo.getEntInfo();
-            if (!Objects.isNull(entInfo)) {
-                loginUserInfo.setEntId(entInfo.getId());
-                loginUserInfo.setEntName(entInfo.getFirmName());
-                List<DeptInfoResVo> deptInfo = entInfo.getDeptInfo();
-                if (!CollectionUtils.isEmpty(deptInfo)) {
-                    loginUserInfo.setDeptIds(String.join(",", deptInfo.stream().map(item -> String.valueOf(item.getId())).toList()));
-                }
-            }
-            RedissonUtils.putString(Global.getFullUserLoginKey(loginResVo.getSystemType(), loginResVo.getId(), loginResVo.getClientType()), JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
-
-        }
-
-        /**
-         * @param loginResVo 登录返参
-         * @desc: 存缓存
-         * @author: czh
-         * @date: 2023/6/28
-         */
-        private void saveToCache(LoginResVo loginResVo) {
-            //存权限菜单
-            long id = loginResVo.getId();
-            List<UserAccessMenuInfoResDto> userAccessMenuInfo = remoteUserService.queryUserAccessMenu(id);
-            if (CollectionUtils.isEmpty(userAccessMenuInfo)) {
-                RedissonUtils.delete(Global.REDIS_SYS_MENU_PREFIX + loginResVo.getClientType() + Global.COLON + id);
-                log.error("未查询到用户{}的菜单权限", id);
-                return;
-            }
-
-            List<String> menus = new ArrayList<>();
-            for (UserAccessMenuInfoResDto userAccessMenuInfoResDto : userAccessMenuInfo) {
-                String links = userAccessMenuInfoResDto.getLinks();
-                if (StringUtils.isNotBlank(links)) {
-                    menus.addAll(Arrays.asList(userAccessMenuInfoResDto.getLinks().split(",")));
-                }
-            }
-            RedissonUtils.putSet(Global.REDIS_SYS_MENU_PREFIX + loginResVo.getClientType() + Global.COLON + id, menus);
-        }
-
-        /**
-         * @param loginResVo 登录返参
-         * @desc: 存登录记录信息
-         * @author: czh
-         * @date: 2023/6/28
-         */
-        private void saveLoginInfo(LoginResVo loginResVo) {
-            long userId = loginResVo.getId();
-            UserLoginReqDto currentDayLogin = remoteUserService.currentDayLogin(userId);
-            UserLoginReqDto userLoginReqDto = new UserLoginReqDto();
-            userLoginReqDto.setPid(Objects.isNull(currentDayLogin) ? "" : String.valueOf(currentDayLogin.getId()));
-            userLoginReqDto.setIp("");
-            userLoginReqDto.setUserAgent("");
-            userLoginReqDto.setUserId(loginResVo.getId());
-            userLoginReqDto.setToken(loginResVo.getToken());
-            userLoginReqDto.setValidTime("");
-            userLoginReqDto.setFirst(Objects.isNull(currentDayLogin) ? Global.YES : Global.NO);
-            userLoginReqDto.setLock(Global.NO);
-            userLoginReqDto.setType(Global.NO);
-            userLoginReqDto.setSource(loginResVo.getClientType());
-            remoteUserService.saveUserLogin(userLoginReqDto);
-        }
-
-    }
-
-    /**-------------------------------------------------------------------------------------------------------------->**/
     /**
     /**
      * @param loginBase {}
      * @param loginBase {}
      * @desc 司机账号登陆
      * @desc 司机账号登陆
      * @author zk
      * @author zk
      * @date 2023/7/26
      * @date 2023/7/26
      **/
      **/
-    @Override
     public HttpResult driverAuth(LoginBase loginBase) {
     public HttpResult driverAuth(LoginBase loginBase) {
-        /**查询用户信息**/
+        /*查询用户信息**/
         RDriverDetailVo driver = fleetService.findDriverDetai(loginBase.getAccount());
         RDriverDetailVo driver = fleetService.findDriverDetai(loginBase.getAccount());
-        /**信息校验**/
+        /*信息校验**/
         if (driver == null) {
         if (driver == null) {
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
         }
         }
@@ -366,19 +127,20 @@ public class AuthServiceImpl implements IAuthService {
         if (driver.getStatus() == Global.YES) {
         if (driver.getStatus() == Global.YES) {
             return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服!");
             return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服!");
         }
         }
+
         //企业信息
         //企业信息
         EntCacheResDto enterprise = systemService.queryEntDetails(driver.getEntId());
         EntCacheResDto enterprise = systemService.queryEntDetails(driver.getEntId());
 
 
-        /**生成token**/
+        /*生成token**/
         String token = generateToken(loginBase, driver.getId());
         String token = generateToken(loginBase, driver.getId());
         if (StringUtils.isBlank(token)) {
         if (StringUtils.isBlank(token)) {
             return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
             return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
         }
         }
 
 
-        /**缓存信息**/
-        AsyncFactory.execute(new AsyncProcess1(loginBase, null, driver, enterprise, remoteUserService));
+        /*缓存信息**/
+        AsyncFactory.execute(new AsyncProcess(loginBase, null, driver, enterprise, remoteUserService));
 
 
-        /**数据组装**/
+        /*数据组装**/
         LoginResVo1 loginRes = new LoginResVo1();
         LoginResVo1 loginRes = new LoginResVo1();
         loginRes.setId(driver.getId());
         loginRes.setId(driver.getId());
         loginRes.setName(driver.getName());
         loginRes.setName(driver.getName());
@@ -401,12 +163,11 @@ public class AuthServiceImpl implements IAuthService {
      * @author zk
      * @author zk
      * @date 2023/7/26
      * @date 2023/7/26
      **/
      **/
-    @Override
     public HttpResult commonAuth(LoginBase loginBase) {
     public HttpResult commonAuth(LoginBase loginBase) {
-        /**查询用户信息**/
+        /*查询用户信息**/
         KwsUserResDto user = systemService.queryUserDetails(loginBase.getAccount(), loginBase.getSystemType());
         KwsUserResDto user = systemService.queryUserDetails(loginBase.getAccount(), loginBase.getSystemType());
 
 
-        /**信息校验**/
+        /*信息校验**/
         if (user == null) {
         if (user == null) {
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
         }
         }
@@ -429,23 +190,32 @@ public class AuthServiceImpl implements IAuthService {
 
 
         //企业信息
         //企业信息
         EntCacheResDto enterprise = systemService.queryEntDetails(user.getEntId());
         EntCacheResDto enterprise = systemService.queryEntDetails(user.getEntId());
-        if (loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode() && enterprise == null) {
-            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号没有归属企业,请检查并重新输入!");
+        if (loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
+            if (enterprise == null) {
+                return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号没有归属企业,请检查并重新输入!");
+            }
+
+            //校验平台标识码(专场)
+            HttpResult result = checkSpecial(loginBase, enterprise);
+            if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+                return result;
+            }
         }
         }
         if (enterprise != null && enterprise.getStatus() == Global.YES) {
         if (enterprise != null && enterprise.getStatus() == Global.YES) {
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "企业已冻结,如需帮助,请致电平台客服!");
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "企业已冻结,如需帮助,请致电平台客服!");
         }
         }
 
 
-        /**生成token**/
+
+        /*生成token**/
         String token = generateToken(loginBase, user.getId());
         String token = generateToken(loginBase, user.getId());
         if (StringUtils.isBlank(token)) {
         if (StringUtils.isBlank(token)) {
             return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
             return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
         }
         }
 
 
-        /**缓存信息**/
-        AsyncFactory.execute(new AsyncProcess1(loginBase, user, null, enterprise, remoteUserService));
+        /*缓存信息**/
+        AsyncFactory.execute(new AsyncProcess(loginBase, user, null, enterprise, remoteUserService));
 
 
-        /**数据组装**/
+        /*数据组装**/
         LoginResVo1 loginRes = new LoginResVo1();
         LoginResVo1 loginRes = new LoginResVo1();
         loginRes.setId(user.getId());
         loginRes.setId(user.getId());
         loginRes.setName(user.getName());
         loginRes.setName(user.getName());
@@ -476,6 +246,114 @@ public class AuthServiceImpl implements IAuthService {
         return HttpResult.ok(loginRes);
         return HttpResult.ok(loginRes);
     }
     }
 
 
+    /**
+     * @param params 登录参数
+     * @return 返回结构
+     * @desc 登录参数校验
+     * @author zk
+     * @date 2020/6/14 18:14
+     **/
+    public HttpResult checkParams(LoginBase params) {
+        if (StringUtils.isBlank(params.getSystemType())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "应用服务类型不能为空!");
+        }
+        if (StringUtils.isBlank(params.getClientType())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "客户端类型不能为空!");
+        }
+        if (StringUtils.isBlank(params.getAccessSpecial())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "平台标识不能为空!");
+        }
+        if (StringUtils.isBlank(params.getAccount())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的账号!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue() && StringUtils.isBlank(params.getPassword())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的密码!");
+        }
+
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !RegularUtils.matchs(RegularUtils.PHONE_REG, params.getAccount())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, "手机号格式不正确,请检查并重新输入!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(params.getCaptcha())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的验证码!");
+        }
+        String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_LOGIN.getValue(), params.getAccount());
+
+        RedissonUtils.putString(key, params.getCaptcha(), RedisConstant.SMS_VERIFY_CODE_VALID_TIME);
+        String smsCaptcha = RedissonUtils.getString(key);
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !smsCaptcha.equals(params.getCaptcha())) {
+            return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码不正确,请检查并重新输入!");
+        }
+
+        return HttpResult.ok();
+    }
+
+    /**
+     * @param loginBase 登录参数
+     * @param enterprise 企业信息
+     * @return 返回校验结果
+     * @desc 专场标识码校验
+     * @author zk
+     * @date 2023/12/14
+     **/
+    public HttpResult checkSpecial(LoginBase loginBase, EntCacheResDto enterprise) {
+        //平台专场集
+        List<SpecialResVo> specialResVos = systemService.findSpecial();
+        //企业所属专场
+        String special = enterprise != null ? enterprise.getSpecial() : null;
+        //用户当前使用平台
+        String accessSpecial = loginBase.getAccessSpecial();
+
+        /*校验*/
+        //校验是否存在专场数据
+        if (CollectionUtils.isEmpty(specialResVos)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "系统平台标识码缺失,请联系平台系统管理员确认!");
+        }
+
+        //校验Hearder中标识码是否属于系统平台标识码
+        boolean bool = false;
+        SpecialResVo specialRes = null;
+        for (SpecialResVo specialResVo:specialResVos) {
+            bool = specialResVo.getCode().equals(accessSpecial) || bool;
+            specialRes = specialResVo.getCode().equals(accessSpecial) ? specialResVo : null;
+        }
+        if (!bool) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "系统平台标识码不正确,请联系平台系统管理员确认!");
+        }
+
+        //校验专场状态
+        if (specialRes != null && specialRes.getIsMain() != Global.YES) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "您当前使用的平台暂停使用,如有疑问请联系平台系统管理员确认!");
+        }
+
+        //校验企业非专场时,Hearder中标识码是否为主平台标识码
+        if (StringUtils.isBlank(special) ) {
+            if (specialRes != null && specialRes.getIsMain() != NumberConstant.ONE) {
+                String msg = "请进入"+ specialRes.getName() +",平台网站为"+ specialRes.getWebsite() +",如有疑问请联系平台系统管理员确认!";
+                return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, msg);
+            }
+        } else {
+            List<String> specials = Arrays.asList(special.split(Global.COMMA));
+            if (!specials.contains(accessSpecial)) {
+                StringBuilder msg = new StringBuilder();
+                msg.append("请进入");
+                for (String e : specials) {
+                    specialResVos.stream().filter(ee -> {
+                        return e.equals(ee.getCode());
+                    }).map(ee -> "请进入" + ee.getName() + ",平台网站为" + ee.getWebsite() + ",").forEach(msg::append);
+                }
+                msg.append("如有疑问请联系平台系统管理员确认!");
+                return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, msg.toString());
+            }
+
+        }
+        return HttpResult.ok();
+    }
 
 
     /**
     /**
      * @return LoginResVo1
      * @return LoginResVo1
@@ -540,7 +418,7 @@ public class AuthServiceImpl implements IAuthService {
         return token;
         return token;
     }
     }
 
 
-    static class AsyncProcess1 implements Runnable {
+    static class AsyncProcess implements Runnable {
         private final LoginBase loginBase;
         private final LoginBase loginBase;
 
 
         private final KwsUserResDto user;
         private final KwsUserResDto user;
@@ -551,7 +429,7 @@ public class AuthServiceImpl implements IAuthService {
 
 
         private final RemoteUserService remoteUserService;
         private final RemoteUserService remoteUserService;
 
 
-        public AsyncProcess1(LoginBase loginBase, KwsUserResDto user, RDriverDetailVo driver, EntCacheResDto enterprise,
+        public AsyncProcess(LoginBase loginBase, KwsUserResDto user, RDriverDetailVo driver, EntCacheResDto enterprise,
                              RemoteUserService remoteUserService) {
                              RemoteUserService remoteUserService) {
             this.loginBase = loginBase;
             this.loginBase = loginBase;
             this.user = user;
             this.user = user;
@@ -662,10 +540,10 @@ public class AuthServiceImpl implements IAuthService {
                 if (user.getIsMain().equals(Global.YES)) {
                 if (user.getIsMain().equals(Global.YES)) {
                     //获取所以运营端账号关联的企业(客户经理关联的企业)
                     //获取所以运营端账号关联的企业(客户经理关联的企业)
                     List<Long> userIds = remoteUserService.selectUserBySystemType(1);
                     List<Long> userIds = remoteUserService.selectUserBySystemType(1);
-                    /**带有数据权限*/
+                    /*带有数据权限*/
                     enterpriseIds = remoteUserService.findEnterpriseListByIds(userIds);
                     enterpriseIds = remoteUserService.findEnterpriseListByIds(userIds);
                     //无数据权限,运营账号(客户经理关联)关联的企业即可
                     //无数据权限,运营账号(客户经理关联)关联的企业即可
-//                    enterpriseIds = remoteUserService.findEnterpriseListByUserIds(userIds);
+                    //enterpriseIds = remoteUserService.findEnterpriseListByUserIds(userIds);
                 } else {
                 } else {
                     enterpriseIds = remoteUserService.findEnterpriseIds(user.getId());
                     enterpriseIds = remoteUserService.findEnterpriseIds(user.getId());
                 }
                 }
@@ -725,6 +603,5 @@ public class AuthServiceImpl implements IAuthService {
             userLoginReqDto.setSource(loginResVo.getClientType());
             userLoginReqDto.setSource(loginResVo.getClientType());
             remoteUserService.saveUserLogin(userLoginReqDto);
             remoteUserService.saveUserLogin(userLoginReqDto);
         }
         }
-
     }
     }
 }
 }

+ 3 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/RequestConstant.java

@@ -1,7 +1,7 @@
 package com.sckw.core.web.constant;
 package com.sckw.core.web.constant;
 
 
 /**
 /**
- * @Description web请求常量
+ * @Desc web请求常量
  * @Author zk
  * @Author zk
  * @Date 2022/6/16
  * @Date 2022/6/16
  */
  */
@@ -13,5 +13,7 @@ public class RequestConstant {
     public static final String CLIENT_TYPE = "Client-Type";
     public static final String CLIENT_TYPE = "Client-Type";
     /**系统类型*/
     /**系统类型*/
     public static final String SYSTEM_TYPE = "System-Type";
     public static final String SYSTEM_TYPE = "System-Type";
+    /**专场标识*/
+    public static final String ACCESS_SPECIAL = "Access-Special";
 
 
 }
 }

+ 7 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -244,4 +244,11 @@ public interface RemoteSystemService {
      * @date 2023/8/10
      * @date 2023/8/10
      **/
      **/
     KwsUserResDto queryUserDetails(String account, Integer systemType);
     KwsUserResDto queryUserDetails(String account, Integer systemType);
+
+    /**
+     * @desc 查询专场集
+     * @author zk
+     * @date 2023/12/14
+     **/
+    List<SpecialResVo> findSpecial();
 }
 }

+ 8 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java

@@ -2,7 +2,6 @@ package com.sckw.system.api.model.dto.res;
 
 
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import lombok.Data;
 import lombok.Data;
-
 import java.io.Serial;
 import java.io.Serial;
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
@@ -115,6 +114,9 @@ public class EntCacheResDto implements Serializable {
      */
      */
     private String head;
     private String head;
 
 
+    /**
+     * 状态
+     */
     private Integer status;
     private Integer status;
 
 
     /**
     /**
@@ -127,4 +129,9 @@ public class EntCacheResDto implements Serializable {
      */
      */
     private String legalPhone;
     private String legalPhone;
 
 
+    /**
+     * 专场标识
+     */
+    private String special;
+
 }
 }

+ 55 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SpecialResVo.java

@@ -0,0 +1,55 @@
+package com.sckw.system.api.model.dto.res;
+
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * @desc 专场信息
+ * @author zk
+ * @date 2023/12/13 0013
+ */
+@Data
+public class SpecialResVo implements Serializable {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 网址
+     */
+    private String website;
+
+    /**
+     * 开户经理
+     */
+    private Long manager;
+
+    /**
+     * 专场编号
+     */
+    private String code;
+
+    /**
+     * 专场主企业ID
+     */
+    private Long entId;
+
+    /**
+     * 是否主平台(0否、1是)
+     */
+    private Integer isMain;
+
+    /**
+     * 状态:0正常/1锁定
+     */
+    private Integer status;
+
+
+}

+ 17 - 4
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java

@@ -16,10 +16,7 @@ import com.sckw.system.model.pojo.FindManagePojo;
 import com.sckw.system.model.vo.res.CertificateResVo;
 import com.sckw.system.model.vo.res.CertificateResVo;
 import com.sckw.system.model.vo.res.KwsDeptResVo;
 import com.sckw.system.model.vo.res.KwsDeptResVo;
 import com.sckw.system.model.vo.res.KwsUserResVo;
 import com.sckw.system.model.vo.res.KwsUserResVo;
-import com.sckw.system.service.KwsDeptService;
-import com.sckw.system.service.KwsEnterpriseService;
-import com.sckw.system.service.KwsRoleService;
-import com.sckw.system.service.KwsUserService;
+import com.sckw.system.service.*;
 import jakarta.annotation.Resource;
 import jakarta.annotation.Resource;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -36,6 +33,9 @@ public class RemoteBaseService {
     @Resource
     @Resource
     private KwsEnterpriseService kwsEnterpriseService;
     private KwsEnterpriseService kwsEnterpriseService;
 
 
+    @Resource
+    private KwsSpecialService kwsSpecialService;
+
     @Resource
     @Resource
     private KwsAuthorityDao kwsAuthorityDao;
     private KwsAuthorityDao kwsAuthorityDao;
 
 
@@ -253,4 +253,17 @@ public class RemoteBaseService {
         }
         }
         return kwsUserService.selectByKey(manageInfoByEntId.getUserId());
         return kwsUserService.selectByKey(manageInfoByEntId.getUserId());
     }
     }
+
+    /**
+     * @desc 查询专场集
+     * @author zk
+     * @date 2023/12/14
+     **/
+    public List<SpecialResVo> findSpecial() {
+        List<KwsSpecial> specials = kwsSpecialService.findList(null);
+        if (CollectionUtils.isNotEmpty(specials)) {
+            return BeanUtils.copyToList(specials, SpecialResVo.class);
+        }
+        return new ArrayList<>();
+    }
 }
 }

+ 9 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -1,6 +1,5 @@
 package com.sckw.system.dubbo;
 package com.sckw.system.dubbo;
 
 
-
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
@@ -23,7 +22,6 @@ import com.sckw.system.service.SysAreaService;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.Nullable;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
@@ -805,4 +803,13 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return userResDto;
         return userResDto;
     }
     }
 
 
+    /**
+     * @desc 查询专场集
+     * @author zk
+     * @date 2023/12/14
+     **/
+    public List<SpecialResVo> findSpecial() {
+        return remoteBaseService.findSpecial();
+    }
+
 }
 }

+ 10 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/KwsSpecial.java

@@ -16,6 +16,11 @@ public class KwsSpecial extends BaseModel {
      */
      */
     private String name;
     private String name;
 
 
+    /**
+     * 网址
+     */
+    private String website;
+
     /**
     /**
      * 开户经理
      * 开户经理
      */
      */
@@ -30,4 +35,9 @@ public class KwsSpecial extends BaseModel {
      * 专场主企业ID
      * 专场主企业ID
      */
      */
     private Long entId;
     private Long entId;
+
+    /**
+     * 是否主平台(0否、1是)
+     */
+    private Integer isMain;
 }
 }

+ 7 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/KwsSpecialAddReqVo.java

@@ -25,6 +25,13 @@ public class KwsSpecialAddReqVo implements Serializable {
     @Size(max=40, message = "名称长度不能大于40个字符!")
     @Size(max=40, message = "名称长度不能大于40个字符!")
     private String name;
     private String name;
 
 
+    /**
+     * 网址
+     */
+    @NotBlank(message = "网址不能为空!")
+    @Size(max=50, message = "网址长度不能大于50个字符!")
+    private String website;
+
     /**
     /**
      * 专场编号
      * 专场编号
      */
      */

+ 7 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/KwsSpecialUpdateReqVo.java

@@ -31,6 +31,13 @@ public class KwsSpecialUpdateReqVo implements Serializable {
     @Size(max=40, message = "名称长度不能大于40个字符!")
     @Size(max=40, message = "名称长度不能大于40个字符!")
     private String name;
     private String name;
 
 
+    /**
+     * 网址
+     */
+    @NotBlank(message = "网址不能为空!")
+    @Size(max=50, message = "网址长度不能大于50个字符!")
+    private String website;
+
     /**
     /**
      * 专场编号
      * 专场编号
      */
      */

+ 10 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/KwsSpecialResVo.java

@@ -24,6 +24,11 @@ public class KwsSpecialResVo  implements Serializable {
      */
      */
     private String name;
     private String name;
 
 
+    /**
+     * 网址
+     */
+    private String website;
+
     /**
     /**
      * 开户经理
      * 开户经理
      */
      */
@@ -49,6 +54,11 @@ public class KwsSpecialResVo  implements Serializable {
      */
      */
     private String firmName;
     private String firmName;
 
 
+    /**
+     * 是否主平台(0否、1是)
+     */
+    private Integer isMain;
+
     /**
     /**
      * 备注
      * 备注
      */
      */

+ 10 - 4
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -52,15 +52,18 @@ public class KwsEnterpriseService {
     @Autowired
     @Autowired
     private KwsEnterpriseDao kwsEnterpriseDao;
     private KwsEnterpriseDao kwsEnterpriseDao;
 
 
-    @Autowired
-    private KwsEntTypeDao kwsEntTypeDao;
-
     @Autowired
     @Autowired
     private KwsEntCertificateDao kwsEntCertificateDao;
     private KwsEntCertificateDao kwsEntCertificateDao;
 
 
     @Autowired
     @Autowired
     private KwsEntCheckTrackDao kwsEntCheckTrackDao;
     private KwsEntCheckTrackDao kwsEntCheckTrackDao;
 
 
+    @Autowired
+    private KwsSpecialService kwsSpecialService;
+
+    @Autowired
+    private KwsEntTypeDao kwsEntTypeDao;
+
     @Autowired
     @Autowired
     private KwsEntDeptDao kwsEntDeptDao;
     private KwsEntDeptDao kwsEntDeptDao;
 
 
@@ -1222,6 +1225,10 @@ public class KwsEnterpriseService {
             }
             }
             entCacheResDto.setValid(entCheckTrackResDtoList.stream().anyMatch(item -> item.getStatus() == Global.NO));
             entCacheResDto.setValid(entCheckTrackResDtoList.stream().anyMatch(item -> item.getStatus() == Global.NO));
         }
         }
+
+        //专场
+        List<String> specialCode = kwsSpecialService.findSpecialByEntId(enterprise.getId());
+        entCacheResDto.setSpecial(String.join(Global.COMMA, specialCode));
         return entCacheResDto;
         return entCacheResDto;
     }
     }
 
 
@@ -1236,7 +1243,6 @@ public class KwsEnterpriseService {
         return kwsEnterpriseDao.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList, entName);
         return kwsEnterpriseDao.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList, entName);
     }
     }
 
 
-
     /**
     /**
      * @param reqVo 查询
      * @param reqVo 查询
      * @return QueryCustomerResVo
      * @return QueryCustomerResVo

+ 25 - 3
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsSpecialService.java

@@ -27,9 +27,11 @@ import com.sckw.system.model.KwsUser;
 import com.sckw.system.model.vo.req.KwsSpecialAddReqVo;
 import com.sckw.system.model.vo.req.KwsSpecialAddReqVo;
 import com.sckw.system.model.vo.req.KwsSpecialUpdateReqVo;
 import com.sckw.system.model.vo.req.KwsSpecialUpdateReqVo;
 import com.sckw.system.model.vo.res.KwsSpecialResVo;
 import com.sckw.system.model.vo.res.KwsSpecialResVo;
+import org.checkerframework.checker.units.qual.C;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -100,9 +102,7 @@ public class KwsSpecialService {
      * @date 2023/12/13
      * @date 2023/12/13
      **/
      **/
     public List<KwsSpecialResVo> findPage(Map<String, Object> params) {
     public List<KwsSpecialResVo> findPage(Map<String, Object> params) {
-        /*查询分页数据**/
-        List<KwsSpecialResVo> specials = kwsSpecialDao.findPage(params);
-        return specials;
+        return kwsSpecialDao.findPage(params);
     }
     }
 
 
     /**
     /**
@@ -143,6 +143,7 @@ public class KwsSpecialService {
         /*数据更新*/
         /*数据更新*/
         KwsSpecial special = new KwsSpecial();
         KwsSpecial special = new KwsSpecial();
         BeanUtils.copyProperties(params, special);
         BeanUtils.copyProperties(params, special);
+        special.setIsMain(NumberConstant.ZERO);
         int count = kwsSpecialDao.insert(special);
         int count = kwsSpecialDao.insert(special);
         return count > 0 ? HttpResult.ok("专场信息新增成功!") : HttpResult.error("专场信息新增失败!");
         return count > 0 ? HttpResult.ok("专场信息新增成功!") : HttpResult.error("专场信息新增失败!");
     }
     }
@@ -259,4 +260,25 @@ public class KwsSpecialService {
 
 
         return HttpResult.ok("加入专场成功!");
         return HttpResult.ok("加入专场成功!");
     }
     }
+
+    /**
+     * @param entId 企业ID
+     * @desc 企业专场编号查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public List<String> findSpecialByEntId(Long entId) {
+        List<KwsEntSpecial> entSpecials = kwsEntSpecialDao.findList(new HashMap<>(){{put("entId", entId);}});
+        if (CollectionUtils.isNotEmpty(entSpecials)) {
+            List<String> specialCode = new ArrayList<>();
+            entSpecials.forEach(e ->{
+                KwsSpecial special = kwsSpecialDao.selectById(e.getSpecialId());
+                if (special != null) {
+                    specialCode.add(special.getCode());
+                }
+            });
+            return CollectionUtils.isNotEmpty(specialCode) ? specialCode : null;
+        }
+        return null;
+    }
 }
 }

+ 4 - 4
sckw-modules/sckw-system/src/main/resources/mapper/KwsSpecialDao.xml

@@ -4,9 +4,9 @@
 
 
   <select id="findPage" resultType="com.sckw.system.model.vo.res.KwsSpecialResVo" parameterType="java.util.Map" >
   <select id="findPage" resultType="com.sckw.system.model.vo.res.KwsSpecialResVo" parameterType="java.util.Map" >
     SELECT
     SELECT
-      ks.id, ks.name, ks.manager, ks.code, ks.ent_id entId, ks.remark, ks.status, ks.create_by createBy,
-      ks.create_time createTime, ks.update_by updateBy, ks.update_time updateTime, ke.firm_name firmName,
-      ku.`name` createByName, ku1.`name` managerName
+      ks.id, ks.name, ks.website, ks.manager, ks.code, ks.ent_id entId, ks.is_main, ks.remark, ks.status,
+      ks.create_by createBy, ks.create_time createTime, ks.update_by updateBy, ks.update_time updateTime,
+      ke.firm_name firmName, ku.`name` createByName, ku1.`name` managerName
     from kws_special ks
     from kws_special ks
     left join kws_enterprise ke on ke.id = ks.ent_id
     left join kws_enterprise ke on ke.id = ks.ent_id
     left join kws_user ku on ku.id = ks.create_by
     left join kws_user ku on ku.id = ks.create_by
@@ -31,7 +31,7 @@
 
 
   <select id="findList" resultType="com.sckw.system.model.KwsSpecial" parameterType="java.util.Map" >
   <select id="findList" resultType="com.sckw.system.model.KwsSpecial" parameterType="java.util.Map" >
     SELECT
     SELECT
-    id, name, manager, code, ent_id entId, remark, status, create_by createBy,
+    id, name, website, manager, code, ent_id entId, is_main isMain, remark, status, create_by createBy,
     create_time createTime, update_by updateBy, update_time updateTime
     create_time createTime, update_by updateBy, update_time updateTime
     from kws_special
     from kws_special
     where del_flag = 0
     where del_flag = 0