Ver código fonte

1、专场认证处理;
2、贸易订单辅助单位调整;

zk 2 anos atrás
pai
commit
02161549aa

+ 2 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -16,8 +16,10 @@ public enum DictTypeEnum {
     SEND_SMS_TYPE("send_sms_type", "发送短信类型"),
     INTEGRAL_TYPE("integral_type", "积分类型"),
     UNIT_TYPE("unit_type", "商品单位类型"),
+    UNIT_LOSS_TYPE("unit_loss_type", "货物单位与合理损耗单位"),
     TAX_RATE("tax_rate", "商品税率"),
     PRICE_TYPE("price_type", "运价方式"),
+    MONETARY_UNIT("monetary_unit", "货币单位"),
     TRADE_TYPE("trade_type", "支付方式"),
     PICKUP_TYPE("pickup_type", "提货方式"),
     DELIVERY_TYPE("delivery_type", "交付类型"),

+ 0 - 47
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/LoginBase.java

@@ -1,47 +0,0 @@
-package com.sckw.core.model.auth;
-
-import lombok.Data;
-
-/**
- * @author zk
- * @description 登录信息
- * @date 2020/06/12 09:06:14
- */
-@Data
-public class LoginBase {
-
-    /**
-     * 账号
-     */
-    private String account;
-
-    /**
-     * 密码
-     */
-    private String password;
-
-    /**
-     * 验证码
-     */
-    private String captcha;
-
-    /**
-     * 系统类型(1 运营管理中心/2 运营管理中心/3 官网/4 司机应用)
-     */
-    private String systemType;
-
-    /**
-     * 客户端类型(ios 苹果设备/android 安卓设备/pc 浏览器/pc-background 管理系统)
-     */
-    private String clientType;
-
-    /**
-     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
-     */
-    private int loginMethod;
-
-    /**
-     * 用户类型(1 表示官网 )
-     */
-    private String userType;
-}

+ 0 - 52
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/LoginEnterpriseInfo.java

@@ -1,52 +0,0 @@
-package com.sckw.core.model.auth;
-
-import lombok.Data;
-import java.util.Date;
-
-/**
- * 登录中的用户企业信息
- * @Author zhaokang
- * @date 2020/04/13 0021
- */
-@Data
-public class LoginEnterpriseInfo {
-    /**
-     * 用户所属企业id
-     */
-    private Long id;
-    /**
-     * 用户所属企业名称
-     */
-    private String firmName;
-    /**
-     * 用户类型
-     */
-    private int userType;
-    /**
-     * 用户分支类型(1承运商企业、2车主)
-     */
-    private int branchType;
-    /**
-     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
-     */
-    private int approval;
-    /**
-     * 用户状态(-1删除、0正常、1已锁)
-     */
-    private int status;
-
-    /**
-     * 交通安培账号状态
-     */
-    private int jtaqStatus;
-
-    /**
-     * 交通安培账号删除标识
-     */
-    private int jtaqDelFlag;
-
-    /**
-     * 企业注册时间
-     */
-    private Date regTime;
-}

+ 0 - 74
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/LoginUserInfo.java

@@ -1,74 +0,0 @@
-package com.sckw.core.model.auth;
-
-import lombok.Data;
-
-/**
- * 登录中的用户信息
- * @Author zhaokang
- * @date 2020/04/13 0021
- */
-@Data
-public class LoginUserInfo {
-    /**
-     * 用户id
-     */
-    private Long id;
-    /**
-     * 用户所属系统
-     */
-    private Integer systemType;
-    /**
-     * 用户账号
-     */
-    private String account;
-    /**
-     * 用户姓名
-     */
-    private String userName;
-    /**
-     * 用户电话
-     */
-    private String phone;
-    /**
-     *是否主账号(0是/1否)
-     */
-    private int isMain;
-    /**
-     *用户账号状态(0正常/1锁定)
-     */
-    private int status;
-    /**
-     * 用户所属企业id
-     */
-    private Long entId;
-    /**
-     * 用户登录终端
-     */
-    private String clientType;
-    /**
-     * 用户所属机构id
-     */
-    private Long deptId;
-    /**
-     * (司机)
-     */
-    private String userIds;
-
-
-    public LoginUserInfo() {
-    }
-
-    public LoginUserInfo(Long id, Integer systemType, String account, String userName, String phone,
-                         int isMain, int status, Long entId, String clientType, Long deptId) {
-        this.id = id;
-        this.systemType = systemType;
-        this.account = account;
-        this.userName = userName;
-        this.phone = phone;
-        this.isMain = isMain;
-        this.status = status;
-        this.entId = entId;
-        this.clientType = clientType;
-        this.deptId = deptId;
-    }
-}

+ 0 - 95
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/context/LoginEnterpriseHolder.java

@@ -1,95 +0,0 @@
-package com.sckw.core.model.auth.context;
-
-import com.sckw.core.model.auth.LoginEnterpriseInfo;
-
-/**
- * 当前登录用户企业的临时保存容器
- * @Author zhaokang
- * @date 2020/04/13 0021
- */
-public class LoginEnterpriseHolder {
-    private static final ThreadLocal<LoginEnterpriseInfo> LONGIN_ENTERPRISE_HOLDER = new ThreadLocal<LoginEnterpriseInfo>();
-
-    /**
-     * 赋值
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static void set(LoginEnterpriseInfo loginEnterpriseInfo) {
-        LONGIN_ENTERPRISE_HOLDER.set(loginEnterpriseInfo);
-    }
-
-    /**
-     * 取值
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static LoginEnterpriseInfo get() {
-        return LONGIN_ENTERPRISE_HOLDER == null ? null : LONGIN_ENTERPRISE_HOLDER.get();
-    }
-
-    /**
-     * 删除保存的用户
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static void remove() {
-        LONGIN_ENTERPRISE_HOLDER.remove();
-    }
-
-    /**
-     * 用户所属企业id
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static Long getEntId(){
-        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getId();
-    }
-
-    /**
-     * 用户所属企业名称
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static String getFirmName(){
-        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getFirmName();
-    }
-
-    /**
-     * 用户类型
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static Integer getUserType(){
-        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getUserType();
-    }
-
-    /**
-     * 资料审批状态(1通过、0未审批、2未通过、3审批中)
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static Integer getApproval(){
-        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getApproval();
-    }
-
-    /**
-     * 用户状态(-1删除、0正常、1已锁)
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static Integer getStatus(){
-        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getStatus();
-    }
-
-    /**
-     * 用户分支类型
-     * @author zk
-     * @date 2021/3/16 11:24
-     **/
-    public static Integer getBranchType(){
-        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getBranchType();
-    }
-
-
-}

+ 0 - 140
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/context/LoginUserHolder.java

@@ -1,140 +0,0 @@
-//package com.sckw.core.model.auth.context;
-//
-//import com.sckw.core.model.auth.LoginUserInfo;
-//
-///**
-// * 当前登录用户的临时保存容器
-// * @Author zhaokang
-// * @date 2020/04/13 0021
-// */
-//public class LoginUserHolder {
-//
-//    private static final ThreadLocal<LoginUserInfo> LONGIN_USER_HOLDER = new ThreadLocal<LoginUserInfo>();
-//
-//    /**
-//     * 赋值
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static void set(LoginUserInfo loginUserInfo) {
-//        LONGIN_USER_HOLDER.set(loginUserInfo);
-//    }
-//
-//    /**
-//     * 取值
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static LoginUserInfo get() {
-//        return LONGIN_USER_HOLDER == null ? null : LONGIN_USER_HOLDER.get();
-//    }
-//
-//    /**
-//     * 删除保存的用户
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static void remove() {
-//        LONGIN_USER_HOLDER.remove();
-//    }
-//
-//    /**
-//     * 用户id
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static Long getUserId(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getId();
-//    }
-//
-//    /**
-//     * 用户所属系统
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static Integer getSystemType(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getSystemType();
-//    }
-//
-//    /**
-//     * 用户账号
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static String getAccount(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getAccount();
-//    }
-//
-//    /**
-//     * 用户姓名
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static String getUserName(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getUserName();
-//    }
-//
-//    /**
-//     * 用户电话
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static String getPhone(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getPhone();
-//    }
-//
-//    /**
-//     * 是否主账号(0是/1否)
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static Integer getIsMain(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getIsMain();
-//    }
-//
-//    /**
-//     * 用户账号状态(0正常/1锁定)
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static Integer getStatus(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getStatus();
-//    }
-//
-//    /**
-//     * 用户所属企业
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static Long getEntId(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getEntId();
-//    }
-//
-//    /**
-//     * 用户登录终端
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static String getClientType(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getClientType();
-//    }
-//
-//    /**
-//     * 用户机构
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static Long getDeptId(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getDeptId();
-//    }
-//
-//    /**
-//     * (司机)
-//     * @author zhaokang
-//     * @Date 2020/04/13 0021
-//     */
-//    public static String getUserIds(){
-//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getUserIds();
-//    }
-//
-//}

+ 6 - 16
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginEntHolder.java

@@ -55,15 +55,6 @@ public class LoginEntHolder {
         return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getFirmName();
     }
 
-    /**
-     * 用户类型
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static Integer getUserType(){
-        return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getUserType();
-    }
-
     /**
      * 资料审批状态(1通过、0未审批、2未通过、3审批中)
      * @author zhaokang
@@ -83,13 +74,12 @@ public class LoginEntHolder {
     }
 
     /**
-     * 用户分支类型
-     * @author zk
-     * @date 2021/3/16 11:24
-     **/
-    public static Integer getBranchType(){
-        return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getBranchType();
+     * 专场标识
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static String getSpecial(){
+        return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getSpecial();
     }
 
-
 }

+ 7 - 7
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginBase.java

@@ -25,6 +25,11 @@ public class LoginBase {
      */
     private String captcha;
 
+    /**
+     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
+     */
+    private int loginMethod;
+
     /**
      * 系统类型(1 运营管理中心/2 运营管理中心/3 官网/4 司机应用)
      */
@@ -36,12 +41,7 @@ public class LoginBase {
     private String clientType;
 
     /**
-     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
-     */
-    private int loginMethod;
-
-    /**
-     * 用户类型(1 表示官网 )
+     * 专场标识
      */
-    private String userType;
+    private String accessSpecial;
 }

+ 9 - 34
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java

@@ -11,26 +11,22 @@ import java.util.List;
  */
 @Data
 public class LoginEntInfo {
+
     /**
      * 用户所属企业id
      */
     private Long id;
+
     /**
      * 用户所属企业名称
      */
     private String firmName;
-    /**
-     * 用户类型
-     */
-    private int userType;
-    /**
-     * 用户分支类型(1承运商企业、2车主)
-     */
-    private int branchType;
+
     /**
      * 资料审批状态(0未审批、1通过、2未通过、3审批中)
      */
     private int approval;
+
     /**
      * 用户状态(-1删除、0正常、1已锁)
      */
@@ -81,37 +77,16 @@ public class LoginEntInfo {
      */
     private String entTypes;
 
+    /**
+     * 专场标识
+     */
+    private String special;
+
     /**
      * 资质
      */
     private List<EntCertificateInfo> certificateInfo;
 
-
-//    /**
-//     * 企业编号
-//     */
-//    private Long id;
-//
-//    /**
-//     * 企业名称
-//     */
-//    private String firmName;
-//
-//    /**
-//     * 注册时间
-//     */
-//    private Date regTime;
-//
-//    /**
-//     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
-//     */
-//    private Integer approval;
-//
-//    /**
-//     * 企业类型(值)
-//     */
-//    private String entTypes;
-
     /**
      * 企业类型(名称)
      */

+ 1 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginUserInfo.java

@@ -63,7 +63,7 @@ public class LoginUserInfo {
     private List<Long> authUserIdList;
 
     /**
-     * 运营端客户经理(用户)关联企业
+     * 用户(客户经理)企业权限
      */
     private List<Long> authEntIdList;
 

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

@@ -1,7 +1,6 @@
 package com.sckw.system.api.model.dto.res;
 
 import lombok.Data;
-
 import java.io.Serial;
 import java.io.Serializable;
 
@@ -36,4 +35,9 @@ public class SysDictResDto implements Serializable {
      */
     private String type;
 
+    /**
+     * 父级字典ID
+     */
+    private Long parentId;
+
 }

+ 7 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/GoodsUnitRes.java

@@ -3,6 +3,8 @@ package com.sckw.order.model.vo.res;
 import lombok.Data;
 import java.io.Serial;
 import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
 
 /**
  * desc 交易订单商品信息单位
@@ -30,6 +32,11 @@ public class GoodsUnitRes implements Serializable {
      */
     private boolean isMain;
 
+    /**
+     * 合理损耗单位
+     */
+    public List<Map<String, Object>> lossUnit;
+
     public GoodsUnitRes() {
     }
 

+ 23 - 8
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -10,6 +10,7 @@ import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
 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.CooperateTypeEnum;
 import com.sckw.core.model.enums.OrderRuleEnum;
@@ -22,7 +23,6 @@ import com.sckw.manage.api.RemoteManageService;
 import com.sckw.manage.api.model.dto.res.FindEntCooperateResVo;
 import com.sckw.mongo.model.SckwTradeOrder;
 import com.sckw.order.api.model.TradeOrderCountStatisticsDTO;
-import com.sckw.order.dao.KwoTradeOrderGoodsUnitMapper;
 import com.sckw.order.dao.KwoTradeOrderMapper;
 import com.sckw.order.enums.*;
 import com.sckw.order.model.*;
@@ -47,10 +47,7 @@ import com.sckw.stream.model.SckwBusSum;
 import com.sckw.stream.model.SckwMessage;
 import com.sckw.stream.model.UserInfo;
 import com.sckw.system.api.RemoteSystemService;
-import com.sckw.system.api.model.dto.res.AreaTreeFrontResDto;
-import com.sckw.system.api.model.dto.res.EntCacheResDto;
-import com.sckw.system.api.model.dto.res.KwsRoleResDto;
-import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import com.sckw.system.api.model.dto.res.*;
 import com.sckw.transport.api.dubbo.TransportService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -58,7 +55,6 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cloud.stream.function.StreamBridge;
 import org.springframework.stereotype.Service;
-
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.function.Function;
@@ -561,8 +557,7 @@ public class KwoTradeOrderService {
 
     /**
      * 生成贸易订单号
-     *
-     * @return
+     * @return 订单编号
      */
     private String getOrderNo() {
         Date date = new Date();
@@ -1409,6 +1404,8 @@ public class KwoTradeOrderService {
 
         //数据组装
         if (CollectionUtils.isNotEmpty(unitDetails)) {
+            //货物单位与合理损耗单位
+            List<SysDictResDto> dicts = remoteSystemService.queryDictByType(DictTypeEnum.UNIT_LOSS_TYPE.getType());
             //单位
             Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.UNIT_TYPE.getType()));
             Map<String, String> unitMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
@@ -1418,6 +1415,24 @@ public class KwoTradeOrderService {
             Map<String, String> finalUnitMap = unitMap;
             unitDetails.forEach(e -> {
                 e.setLabel( finalUnitMap != null ? finalUnitMap.get(e.getValue()) : null);
+                //组装合理损耗
+                if (CollectionUtils.isNotEmpty(dicts)) {
+                    for (SysDictResDto ee : dicts)
+                        if (ee.getParentId().equals((long) NumberConstant.ZERO)) {
+                            if (ee.getValue().equals(e.getValue())) {
+                                List<Map<String, Object>> lossUnit = new ArrayList();
+                                for (SysDictResDto eee : dicts) {
+                                    if (eee.getParentId().equals(ee.getId())) {
+                                        lossUnit.add(new HashMap<>(NumberConstant.SIXTEEN) {{
+                                            put("value", eee.getValue());
+                                            put("lable", eee.getLabel());
+                                        }});
+                                    }
+                                }
+                                e.setLossUnit(lossUnit);
+                            }
+                        }
+                }
             });
         }