Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

yzc 2 лет назад
Родитель
Сommit
9746d6b7eb
16 измененных файлов с 282 добавлено и 67 удалено
  1. 1 1
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java
  2. 10 6
      sckw-auth/src/main/java/com/sckw/auth/model/vo/res/LoginResVo1.java
  3. 6 11
      sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java
  4. 145 34
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  5. 2 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java
  6. 10 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  7. 12 2
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/KwsUserResDto.java
  8. 11 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/REnterpriseVo.java
  9. 1 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java
  10. 23 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  11. 6 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/KwsUserResVo.java
  12. 21 5
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  13. 1 1
      sckw-modules/sckw-system/src/main/resources/mapper/KwsUserDao.xml
  14. 5 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WayBillDetailDTO.java
  15. 20 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillBoardListVO.java
  16. 8 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

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

@@ -42,7 +42,7 @@ public class AuthController {
         /**运营端/企业端登录(PC/APP)**/
         if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
                 || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
-
+            return authService.commonAuth(loginBase);
         }
 
         /**司机端**/

+ 10 - 6
sckw-auth/src/main/java/com/sckw/auth/model/vo/res/LoginResVo1.java

@@ -18,8 +18,7 @@ import java.util.List;
 @Data
 public class LoginResVo1 implements Serializable {
 
-    @Serial
-    private static final long serialVersionUID = 8977846403689927853L;
+
 
     /**
      * 用户id
@@ -28,14 +27,14 @@ public class LoginResVo1 implements Serializable {
     private long id;
 
     /**
-     * 账号
+     * 姓名
      */
-    private String account;
+    private String name;
 
     /**
-     * 姓名
+     * 账号
      */
-    private String name;
+    private String account;
 
     /**
      * 电话
@@ -47,6 +46,11 @@ public class LoginResVo1 implements Serializable {
      */
     private String photo;
 
+    /**
+     * 角色名称
+     */
+    private String roleName;
+
     /**
      * 是否是企业管理(0是 1否)
      */

+ 6 - 11
sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java

@@ -66,16 +66,11 @@ public interface IAuthService {
     HttpResult driverAuth(LoginBase loginBase);
 
     /**
-     * 企业端登录
-     * @param loginBase
-     * @return
-     */
-    HttpResult entAuth(LoginBase loginBase);
+     * @param loginBase {}
+     * @desc 运营/企业账号登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
+    HttpResult commonAuth(LoginBase loginBase);
 
-    /**
-     * 运营端
-     * @param loginBase
-     * @return
-     */
-    HttpResult operateAuth(LoginBase loginBase);
 }

+ 145 - 34
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -8,7 +8,6 @@ import com.sckw.auth.model.vo.res.EntInfoResVo;
 import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.auth.model.vo.res.LoginResVo1;
 import com.sckw.auth.util.AsyncFactory;
-import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.model.EntCertificateInfo;
@@ -359,6 +358,12 @@ public class AuthServiceImpl implements IAuthService {
     }
 
     /**-------------------------------------------------------------------------------------------------------------->**/
+    /**
+     * @param loginBase {}
+     * @desc 司机账号登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
     @Override
     public HttpResult driverAuth(LoginBase loginBase) {
         /**查询用户信息**/
@@ -382,90 +387,113 @@ public class AuthServiceImpl implements IAuthService {
             return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
         }
 
-        /**缓存司机/企业信息**/
-        AsyncFactory.execute(new AsyncProcess1(loginBase, driver, enterprise));
+        /**缓存信息**/
+        AsyncFactory.execute(new AsyncProcess1(loginBase, null, driver, enterprise, remoteUserService));
 
         /**数据组装**/
         LoginResVo1 loginRes = new LoginResVo1();
-        BeanUtils.copyPropertiesValue(driver, loginRes);
+        loginRes.setId(driver.getId());
+        loginRes.setName(driver.getName());
         loginRes.setAccount(loginBase.getAccount());
-        loginRes.setFirmName(enterprise != null ? enterprise.getFirmName() : null);
-        loginRes.setApproval(enterprise != null ? enterprise.getApproval() : null);
-        loginRes.setEntTypeNames(enterprise != null ? enterprise.getEntTypeNames() : null);
+        loginRes.setPhone(driver.getPhone());
+        loginRes.setStatus(driver.getStatus());
+        loginRes.setEntId(driver.getEntId());
+        loginRes.setFirmName(enterprise == null ? enterprise.getFirmName() : null);
+        loginRes.setApproval(enterprise == null ? enterprise.getApproval() : null);
+        loginRes.setEntTypeNames(enterprise == null ? enterprise.getEntTypeNames() : null);
         loginRes.setClientType(loginBase.getClientType());
         loginRes.setSystemType(loginBase.getSystemType());
         loginRes.setToken(token);
         return HttpResult.ok(loginRes);
     }
 
+    /**
+     * @param loginBase {}
+     * @desc 运营/企业账号登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
     @Override
-    public HttpResult entAuth(LoginBase loginBase) {
+    public HttpResult commonAuth(LoginBase loginBase) {
         /**查询用户信息**/
-        KwsUserResDto user = findUser(loginBase);
+        KwsUserResDto user = systemService.queryUserDetails(loginBase.getAccount(), loginBase.getSystemType());
         /**信息校验**/
         if (user == null) {
-            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
         }
         if (!PasswordUtils.validatePassword(loginBase.getPassword(), user.getPassword())) {
-            return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
+            return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
         }
         if (user.getStatus() == Global.YES) {
-            return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服:400-803-6377!");
+            return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服:400-803-6377!");
         }
         //企业信息
-        REnterpriseVo enterprise = systemService.queryEntDetails(null);
+        REnterpriseVo enterprise = systemService.queryEntDetails(user.getEntId());
+        if (loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode() && enterprise == null) {
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号没有归属企业,请检查并重新输入!");
+        }
+        if (enterprise != null && enterprise.getStatus() == Global.YES) {
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "企业已冻结,如需帮助,请致电平台客服:400-803-6377!");
+        }
 
         /**生成token**/
         String token = EncryUtil.encryV1(Global.PRI_KEY, String.valueOf(user.getId()));
         if (StringUtils.isBlank(token)) {
-            return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
+            return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员");
         }
 
-        /**缓存司机/企业信息**/
-        AsyncFactory.execute(new AsyncProcess1(loginBase, null, enterprise));
+        /**缓存信息**/
+        AsyncFactory.execute(new AsyncProcess1(loginBase, user, null, enterprise, remoteUserService));
 
         /**数据组装**/
         LoginResVo1 loginRes = new LoginResVo1();
+        loginRes.setId(user.getId());
+        loginRes.setName(user.getName());
         loginRes.setAccount(loginBase.getAccount());
-        loginRes.setFirmName(enterprise.getFirmName());
-        loginRes.setApproval(enterprise.getApproval());
-        loginRes.setEntTypeNames(enterprise.getEntTypeNames());
+        loginRes.setPhone(user.getPhone());
+        loginRes.setPhoto(user.getPhoto());
+        loginRes.setIsMain(user.getIsMain());
+        loginRes.setStatus(user.getStatus());
+        loginRes.setRoleName(user.getRoleName());
+        loginRes.setClientId(user.getClientId());
+        loginRes.setEntId(user.getEntId());
+        loginRes.setFirmName(enterprise == null ? enterprise.getFirmName() : null);
+        loginRes.setApproval(enterprise == null ? enterprise.getApproval() : null);
+        loginRes.setEntTypeNames(enterprise == null ? enterprise.getEntTypeNames() : null);
         loginRes.setClientType(loginBase.getClientType());
         loginRes.setSystemType(loginBase.getSystemType());
         loginRes.setToken(token);
         return HttpResult.ok(loginRes);
     }
 
-    @Override
-    public HttpResult operateAuth(LoginBase loginBase) {
-
-        return null;
-    }
-
-
-    private KwsUserResDto findUser(LoginBase loginBase) throws SystemException {
-        List<KwsUserResDto> kwsUsers = remoteUserService.checkUserBase(loginBase.getAccount(), loginBase.getSystemType());
-        return kwsUsers == null || kwsUsers.size() == Global.NUMERICAL_ZERO ? null : kwsUsers.get(0);
-    }
-
     static class AsyncProcess1 implements Runnable {
         private final LoginBase loginBase;
 
+        private final KwsUserResDto user;
+
         private final RDriverDetailVo driver;
 
         private final REnterpriseVo enterprise;
 
-        public AsyncProcess1(LoginBase loginBase, RDriverDetailVo driver, REnterpriseVo enterprise) {
+        private final RemoteUserService remoteUserService;
+
+        public AsyncProcess1(LoginBase loginBase, KwsUserResDto user, RDriverDetailVo driver, REnterpriseVo enterprise ,
+                             RemoteUserService remoteUserService) {
             this.loginBase = loginBase;
+            this.user = user;
             this.driver = driver;
             this.enterprise = enterprise;
+            this.remoteUserService = remoteUserService;
         }
 
         @Override
         public void run() {
-            //用户信息
+            //司机信息
             SaveDriverToCache(loginBase, driver);
 
+            //用户信息
+            SaveUserToCache(loginBase, user);
+
             //企业信息
             SaveEntToCache(enterprise);
         }
@@ -489,11 +517,14 @@ public class AuthServiceImpl implements IAuthService {
         /**
          * @param loginBase 登录信息
          * @param driver 司机信息
-         * @desc: 缓存用户业信息
+         * @desc: 缓存司机信息
          * @author: czh
          * @date: 2023/7/3
          */
         private void SaveDriverToCache(LoginBase loginBase, RDriverDetailVo driver) {
+            if (driver == null) {
+                return;
+            }
             //存用户登录信息
             LoginUserInfo loginUserInfo = new LoginUserInfo();
             loginUserInfo.setId(driver.getId());
@@ -504,8 +535,88 @@ public class AuthServiceImpl implements IAuthService {
             loginUserInfo.setStatus(driver.getStatus());
             loginUserInfo.setEntId(enterprise != null ? enterprise.getId() : null);
             loginUserInfo.setEntName(enterprise != null ? enterprise.getFirmName() : null);
+            loginUserInfo.setClientType(loginBase.getClientType());
+            String key = Global.getFullUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId(), loginBase.getClientType());
+            RedissonUtils.putString(key, JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
+        }
+
+        /**
+         * @param loginBase 登录信息
+         * @param user 用户信息
+         * @desc: 缓存用户信息
+         * @author: czh
+         * @date: 2023/7/3
+         */
+        private void SaveUserToCache(LoginBase loginBase, KwsUserResDto user) {
+            if (user == null) {
+                return;
+            }
+            //存用户登录信息
+            LoginUserInfo loginUserInfo = new LoginUserInfo();
+            loginUserInfo.setId(user.getId());
+            loginUserInfo.setSystemType(loginBase.getSystemType());
+            loginUserInfo.setAccount(user.getPhone());
+            loginUserInfo.setUserName(user.getName());
+            loginUserInfo.setPhone(user.getPhone());
+            loginUserInfo.setStatus(user.getStatus());
+            loginUserInfo.setIsMain(user.getIsMain());
+            loginUserInfo.setEntId(user.getEntId());
+            loginUserInfo.setEntName(enterprise != null ? enterprise.getFirmName() : null);
             String key = Global.getFullUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId(), loginBase.getClientType());
             RedissonUtils.putString(key, JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
+
+            //存缓存请求地址
+            SaveMenusToCache(user);
         }
+
+        /**
+         * @param loginResVo 登录返参
+         * @desc: 存缓存请求地址
+         * @author: czh
+         * @date: 2023/6/28
+         */
+        private void SaveMenusToCache(KwsUserResDto loginResVo) {
+            //存权限菜单
+            long id = loginResVo.getId();
+            List<UserAccessMenuInfoResDto> userAccessMenuInfo = remoteUserService.queryUserAccessMenu(id);
+            if (CollectionUtils.isEmpty(userAccessMenuInfo)) {
+                RedissonUtils.delete(Global.REDIS_SYS_MENU_PREFIX + loginResVo.getSystemType() + 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 + 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);
+        }
+
     }
 }

+ 2 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java

@@ -122,8 +122,8 @@ public class PasswordUtils {
 
     public static void main(String[] args) {
 
-        String password = PasswordUtils.entryptPassword(PasswordUtils.md5("13868885042"));
-        String md5 = PasswordUtils.md5("13868885042");
+        String password = PasswordUtils.entryptPassword(PasswordUtils.md5("18000000000"));
+        String md5 = PasswordUtils.md5("123456");
         System.out.println(password);
         System.out.println(md5);
         System.out.println(validatePassword(md5, password));

+ 10 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -1,6 +1,6 @@
 package com.sckw.system.api;
 
-import com.sckw.system.api.model.dto.req.REnterpriseVo;
+import com.sckw.system.api.model.dto.res.REnterpriseVo;
 import com.sckw.system.api.model.dto.res.*;
 
 import java.util.List;
@@ -190,4 +190,13 @@ public interface RemoteSystemService {
      * @date 2023/8/10
      **/
     REnterpriseVo queryEntDetails(Long entId);
+
+    /**
+     * @param account 账号
+     * @param systemType 系统类型
+     * @desc 用户详情(企业端登录/运营端登录)
+     * @author zk
+     * @date 2023/8/10
+     **/
+    KwsUserResDto queryUserDetails(String account, int systemType);
 }

+ 12 - 2
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/KwsUserResDto.java

@@ -14,8 +14,7 @@ import java.util.Date;
 @Data
 public class KwsUserResDto implements Serializable {
 
-    @Serial
-    private static final long serialVersionUID = 612080679888497523L;
+
 
     /**
      * 系统类型(1运营端、2企业开户)
@@ -101,4 +100,15 @@ public class KwsUserResDto implements Serializable {
      */
     private Integer delFlag;
 
+
+    /**
+     * 角色名称
+     */
+    private String roleName;
+
+    /**
+     * 企业Id
+     */
+    private Long entId;
+
 }

+ 11 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/REnterpriseVo.java → sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/REnterpriseVo.java

@@ -1,4 +1,4 @@
-package com.sckw.system.api.model.dto.req;
+package com.sckw.system.api.model.dto.res;
 
 import lombok.Data;
 
@@ -32,11 +32,21 @@ public class REnterpriseVo implements Serializable {
      */
     private Date regTime;
 
+    /**
+     * 用户状态(0正常、1已锁)
+     */
+    private Integer status;
+
     /**
      * 资料审批状态(0未审批、1通过、2未通过、3审批中)
      */
     private Integer approval;
 
+    /**
+     * 是否有效
+     */
+    private Boolean valid;
+
     /**
      * 企业类型(值)
      */

+ 1 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java

@@ -3,7 +3,7 @@ package com.sckw.system.dubbo;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
-import com.sckw.system.api.model.dto.req.REnterpriseVo;
+import com.sckw.system.api.model.dto.res.REnterpriseVo;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import com.sckw.system.dao.KwsEntDeptDao;
@@ -20,7 +20,6 @@ import org.springframework.stereotype.Service;
 
 import java.util.Collections;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 
 /**

+ 23 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -9,12 +9,13 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.api.RemoteSystemService;
-import com.sckw.system.api.model.dto.req.REnterpriseVo;
+import com.sckw.system.api.model.dto.res.REnterpriseVo;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import com.sckw.system.dao.SysDictDao;
 import com.sckw.system.model.*;
 import com.sckw.system.model.vo.res.FindAreaTreeResVo;
+import com.sckw.system.model.vo.res.KwsUserResVo;
 import com.sckw.system.service.KwsUserService;
 import com.sckw.system.service.SysAreaService;
 import org.apache.dubbo.config.annotation.DubboService;
@@ -585,4 +586,25 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return remoteBaseService.queryEntDetails(entId);
     }
 
+    /**
+     * @param account 账号
+     * @param systemType 系统类型
+     * @desc 用户详情(企业端登录/运营端登录)
+     * @author zk
+     * @date 2023/8/10
+     **/
+    public KwsUserResDto queryUserDetails(String account, int systemType) {
+        KwsUser params = new KwsUser();
+        params.setAccount(account);
+        params.setSystemType(systemType);
+        List<KwsUserResVo> users = kwsUserService.findList(params);
+        if(CollectionUtils.isEmpty(users)) {
+            return null;
+        }
+        KwsUserResVo userResVo = users.get(Global.NUMERICAL_ZERO);
+        KwsUserResDto userResDto = new KwsUserResDto();
+        BeanUtils.copyPropertiesValue(userResVo, userResDto);
+        return userResDto;
+    }
+
 }

+ 6 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/KwsUserResVo.java

@@ -87,6 +87,12 @@ public class KwsUserResVo implements Serializable {
     @JsonSerialize(using = LongToStringUtils.class)
     private Long roleId;
 
+    /**
+     * 企业Id
+     */
+    @JsonSerialize(using = LongToStringUtils.class)
+    private Long entId;
+
     /**
      * 机构名
      */

+ 21 - 5
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -1,5 +1,6 @@
 package com.sckw.system.service;
 
+import cn.hutool.core.date.DateUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
@@ -11,11 +12,8 @@ import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.model.EntCertificateInfo;
-import com.sckw.system.api.model.dto.req.REnterpriseVo;
-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.EntTypeResDto;
-import com.sckw.system.api.model.dto.res.RegisterResDto;
+import com.sckw.system.api.model.dto.res.REnterpriseVo;
+import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.dao.*;
 import com.sckw.system.dubbo.RemoteSystemServiceImpl;
 import com.sckw.system.model.*;
@@ -25,6 +23,7 @@ import com.sckw.system.model.pojo.FindManagePojo;
 import com.sckw.system.model.pojo.FindPojoParam;
 import com.sckw.system.model.vo.req.*;
 import com.sckw.system.model.vo.res.*;
+import com.sckw.system.model.vo.res.KwsUserResVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -892,6 +891,7 @@ public class KwsEnterpriseService {
         enterpriseVo.setId(enterprise.getId());
         enterpriseVo.setFirmName(enterprise.getFirmName());
         enterpriseVo.setRegTime(enterprise.getRegTime());
+        enterpriseVo.setStatus(enterprise.getStatus());
         enterpriseVo.setApproval(enterprise.getApproval());
 
         //企业类型
@@ -905,6 +905,22 @@ public class KwsEnterpriseService {
         enterpriseVo.setMainId(user != null ? user.getId() : null);
         enterpriseVo.setMainName(user != null ? user.getName() : null);
         enterpriseVo.setMainPhone(user != null ? user.getPhone() : null);
+
+        //企业资质有效性判断  1、当前资质没过期,且状态是已认证  2、只要有认证过一次就算有效  参数判断
+        String checkType = "2";
+        if (checkType.equals("1")) {
+            List<CertificateResVo> certificates = queryCertificate(entId);
+            for (CertificateResVo certificate : certificates) {
+                Date expireTime = certificate.getExpireTime();
+                enterpriseVo.setValid(DateUtil.compare(new Date(), expireTime) <= 0);
+            }
+        } else {
+            List<KwsEntCheckTrack> entCheckTrackResDtoList = entCheck(entId);
+            if (CollectionUtils.isEmpty(entCheckTrackResDtoList)) {
+                enterpriseVo.setValid(false);
+            }
+            enterpriseVo.setValid(entCheckTrackResDtoList.stream().anyMatch(item -> item.getStatus() == Global.NO));
+        }
         return enterpriseVo;
     }
 

+ 1 - 1
sckw-modules/sckw-system/src/main/resources/mapper/KwsUserDao.xml

@@ -280,7 +280,7 @@
     select
       su.id, su.system_type systemType, su.account, su.password, su.name,
       su.phone, su.photo, su.email, su.is_main isMain, su.remark, su.status, su.salt,
-      c.id deptId,c.name deptName,e.id roleId, e.name roleName,
+      c.id deptId, c.name deptName, c.ent_id entId, e.id roleId, e.name roleName,
       u1.name createByName, su.create_time createTime, su.update_time updateTime
     from kws_user su
     left join kws_user_dept b on su.id = b.user_id

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WayBillDetailDTO.java

@@ -80,6 +80,11 @@ public class WayBillDetailDTO{
      */
     private String type;
 
+    /**
+     * 运单类型-字符
+     */
+    private String typeLabel;
+
     /**
      * 计划开始时间
      */

+ 20 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillBoardListVO.java

@@ -23,16 +23,36 @@ public class WaybillBoardListVO {
      */
     private String wOrderNo;
 
+    /**
+     * 运单状态
+     */
+    private String status;
+
+    /**
+     * 运单状态-字符
+     */
+    private String statusLabel;
+
     /**
      * 商品名称
      */
     private String goodsName;
 
+    /**
+     * 装货地点名称
+     */
+    private String loadName;
+
     /**
      * 装货地点
      */
     private String loadDetailAddress;
 
+    /**
+     * 卸货地点名称
+     */
+    private String unloadName;
+
     /**
      * 卸货地点
      */

+ 8 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

@@ -105,6 +105,7 @@ public class WaybillManagementService {
             wayBillDetailDTO.setLOrderNo(info.getLOrderNo());
             wayBillDetailDTO.setEntrustAmount(String.valueOf(info.getEntrustAmount()));
             wayBillDetailDTO.setType(String.valueOf(info.getType()));
+            wayBillDetailDTO.setTypeLabel(info.getType().equals(NumberConstant.ONE) ? "趟次" : "循环");
             wayBillDetailDTO.setStartTime(DateUtil.getDateTime(info.getStartTime()));
             wayBillDetailDTO.setEndTime(DateUtil.getDateTime(info.getEndTime()));
             wayBillDetailDTO.setCreateBy(info.getCreateByName());
@@ -147,6 +148,9 @@ public class WaybillManagementService {
             waybillTicketVO.setUnloadTime(DateUtil.getDateTime(info.getUnloadTime()));
             waybillTicketVO.setUnloadWeight(String.valueOf(info.getUnloadAmount()));
             waybillTicketVO.setUnloadUrl(String.valueOf(info.getUnloadUrls()));
+//            waybillBoardListVO.setLoadUrls(sckwWaybillOrder.getLoadUrls() != null ? FileUtils.getOSSAddressPrefix() + sckwWaybillOrder.getLoadUrls() : null);
+//            waybillBoardListVO.setUnloadUrls(sckwWaybillOrder.getUnloadUrls() != null ? FileUtils.getOSSAddressPrefix() + sckwWaybillOrder.getUnloadUrls() : null);
+
         }
         List<Integer> statuses = initWaybillIndexStatus();
         // 初始化各状态
@@ -233,8 +237,12 @@ public class WaybillManagementService {
             WaybillBoardListVO waybillBoardListVO = new WaybillBoardListVO();
             waybillBoardListVO.setWOrderId(String.valueOf(sckwWaybillOrder.getWOrderId()));
             waybillBoardListVO.setWOrderNo(String.valueOf(sckwWaybillOrder.getWOrderNo()));
+            waybillBoardListVO.setStatus(String.valueOf(sckwWaybillOrder.getStatus()));
+            waybillBoardListVO.setStatusLabel(CarWaybillEnum.getName(sckwWaybillOrder.getStatus()));
             waybillBoardListVO.setGoodsName(String.valueOf(sckwWaybillOrder.getGoodsName()));
+            waybillBoardListVO.setLoadName(sckwWaybillOrder.getLoadName());
             waybillBoardListVO.setLoadDetailAddress(String.valueOf(sckwWaybillOrder.getLoadDetailAddress()));
+            waybillBoardListVO.setUnloadName(sckwWaybillOrder.getUnloadName());
             waybillBoardListVO.setUnloadDetailAddress(String.valueOf(sckwWaybillOrder.getUnloadDetailAddress()));
             waybillBoardListVO.setStartTime(DateUtil.getDateTime(sckwWaybillOrder.getStartTime()));
             waybillBoardListVO.setEndTime(DateUtil.getDateTime(sckwWaybillOrder.getEndTime()));