Kaynağa Gözat

贸易订单相关字典翻译走字典查询接口

yzc 2 yıl önce
ebeveyn
işleme
9a45357c00

+ 14 - 12
sckw-modules/sckw-order/src/main/java/com/sckw/order/dubbo/TradeOrderInfoServiceImpl.java

@@ -3,7 +3,6 @@ package com.sckw.order.dubbo;
 import com.alibaba.fastjson2.JSON;
 import com.google.common.collect.Lists;
 import com.sckw.contract.api.RemoteContractService;
-import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
@@ -12,6 +11,8 @@ import com.sckw.core.web.response.HttpResult;
 import com.sckw.mongo.model.SckwTradeOrder;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
 import com.sckw.order.api.model.*;
+import com.sckw.order.enums.DeliveryTypeEnum;
+import com.sckw.order.enums.OrderStatusEnum;
 import com.sckw.order.model.KwoTradeOrder;
 import com.sckw.order.model.KwoTradeOrderContract;
 import com.sckw.order.model.KwoTradeOrderTrack;
@@ -76,12 +77,12 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
         }
         Integer status = param.getStatus();
         Long updateBy = param.getUpdateBy();
-        if (Objects.equals(String.valueOf(status), DictEnum.TORDER_STATUS_6.getValue())) {
-            if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_5.getValue())) {
+        if (Objects.equals(status, OrderStatusEnum.RECONCILED.getCode())) {
+            if (!Objects.equals(order.getStatus(), OrderStatusEnum.FINISHED.getCode())) {
                 throw new BusinessException("已完结的订单才可对账!");
             }
-        } else if (Objects.equals(String.valueOf(status), DictEnum.TORDER_STATUS_7.getValue())) {
-            if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_6.getValue())) {
+        } else if (Objects.equals(status, OrderStatusEnum.SETTLED.getCode())) {
+            if (!Objects.equals(order.getStatus(), OrderStatusEnum.RECONCILED.getCode())) {
                 throw new BusinessException("已对账的订单才可结算!");
             }
         } else {
@@ -123,7 +124,7 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
             if (Objects.isNull(order)) {
                 return HttpResult.error("订单不存在!");
             }
-            if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_4.getValue())) {
+            if (!Objects.equals(order.getStatus(), OrderStatusEnum.EXECUTING.getCode())) {
                 return HttpResult.error("执行中的订单才可物流托运!");
             }
             BigDecimal totalEntrustAmount = Objects.isNull(order.getEntrustAmount()) ?
@@ -170,18 +171,18 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
             if (Objects.isNull(order)) {
                 return HttpResult.error("订单不存在!");
             }
-            if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_4.getValue())) {
+            if (!Objects.equals(order.getStatus(), OrderStatusEnum.EXECUTING.getCode())) {
                 return HttpResult.error("执行中的订单才可物流托运!");
             }
             BigDecimal actualAmount = Objects.isNull(order.getActualAmount()) ? BigDecimal.ZERO : order.getActualAmount();
-            BigDecimal addActualAmount = Objects.equals(order.getDeliveryType(), DictEnum.DELIVERY_TYPE_0.getValue())
+            BigDecimal addActualAmount = Objects.equals(order.getDeliveryType(), DeliveryTypeEnum.ISSUE.getType())
                     ? actualLoadAmount : actualUnloadAmount;
             BigDecimal totalActualAmount = actualAmount.add(addActualAmount);
             order.setActualAmount(totalActualAmount).setUpdateBy(param.getUpdateBy());
             //不走自然完结
 //            if (param.getIsAllComplete() && actualAmount.compareTo(order.getAmount()) >= 0) {
 //                //完结订单
-//                order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_5.getValue()));
+//                order.setStatus(OrderStatusEnum.FINISHED.getCode());
 //                //记录状态
 //                KwoTradeOrderTrack track = new KwoTradeOrderTrack();
 //                track.setTOrderId(order.getId()).setTOrderNo(order.getTOrderNo()).setStatus(order.getStatus())
@@ -235,11 +236,12 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
             kwoTradeOrderService.contractCompletedUpdate(ids, updateBy);
             orders.forEach(e -> {
                 KwoTradeOrderTrack track = new KwoTradeOrderTrack();
-                track.setTOrderId(e.getId()).setTOrderNo(e.getTOrderNo()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()))
+                track.setTOrderId(e.getId()).setTOrderNo(e.getTOrderNo())
+                        .setStatus(OrderStatusEnum.EXECUTING.getCode())
                         .setCreateBy(updateBy).setUpdateBy(updateBy);
                 tracks.add(track);
                 SckwTradeOrder updateParam = new SckwTradeOrder();
-                updateParam.setTOrderId(e.getId()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()))
+                updateParam.setTOrderId(e.getId()).setStatus(OrderStatusEnum.EXECUTING.getCode())
                         .setUpdateBy(updateBy).setUpdateByName(param.getUpdateByName()).setUpdateTime(new Date());
                 tradeOrders.add(updateParam);
             });
@@ -266,7 +268,7 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
         if (Objects.isNull(order)) {
             throw new BusinessException("订单不存在!");
         }
-        if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_5.getValue())) {
+        if (!Objects.equals(order.getStatus(), OrderStatusEnum.FINISHED.getCode())) {
             throw new BusinessException("已完结的订单才可对账!");
         }
         order.setAssociateStatement(associateStatement).setUpdateBy(updateBy).setUpdateTime(new Date());

+ 23 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/ContractStatusEnum.java

@@ -0,0 +1,23 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 合同状态枚举
+ * @author: yzc
+ * @date: 2023-09-18 16:03
+ */
+@Getter
+@AllArgsConstructor
+public enum ContractStatusEnum {
+
+    /**
+     * 合同状态枚举
+     */
+    SIGNED("0", "已签约"),
+    WAIT_SIGNED("1", "待签约");
+
+    private final String code;
+    private final String msg;
+}

+ 30 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/DeliveryTypeEnum.java

@@ -0,0 +1,30 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 交付类型枚举
+ * @author: yzc
+ * @date: 2023-09-18 15:42
+ */
+@Getter
+@AllArgsConstructor
+public enum DeliveryTypeEnum {
+
+    ISSUE("0", "签发交付"),
+    SIGN("1", "签收交付");
+
+    private final String type;
+
+    private final String label;
+
+    public static String getLabel(String type) {
+        for (DeliveryTypeEnum ele : DeliveryTypeEnum.values()) {
+            if (ele.getType().equals(type)) {
+                return ele.getLabel();
+            }
+        }
+        return null;
+    }
+}

+ 30 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/OrderAddressTypeEnum.java

@@ -0,0 +1,30 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 订单地址类型枚举
+ * @author: yzc
+ * @date: 2023-09-18 15:42
+ */
+@Getter
+@AllArgsConstructor
+public enum OrderAddressTypeEnum {
+
+    LOAD("1", "装货地址"),
+    UNLOAD("2", "卸货地址");
+
+    private final String type;
+
+    private final String label;
+
+    public static String getLabel(String type) {
+        for (OrderAddressTypeEnum ele : OrderAddressTypeEnum.values()) {
+            if (ele.getType().equals(type)) {
+                return ele.getLabel();
+            }
+        }
+        return null;
+    }
+}

+ 30 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/OrderSourceEnum.java

@@ -0,0 +1,30 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 订单来源枚举
+ * @author: yzc
+ * @date: 2023-09-18 15:42
+ */
+@Getter
+@AllArgsConstructor
+public enum OrderSourceEnum {
+
+    PURCHASE("1", "采购下单"),
+    SALE("2", "代客下单");
+
+    private final String type;
+
+    private final String label;
+
+    public static String getLabel(String type) {
+        for (OrderSourceEnum ele : OrderSourceEnum.values()) {
+            if (ele.getType().equals(type)) {
+                return ele.getLabel();
+            }
+        }
+        return null;
+    }
+}

+ 39 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/OrderStatusEnum.java

@@ -0,0 +1,39 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 订单状态枚举
+ * @author: yzc
+ * @date: 2023-09-18 15:32
+ */
+@Getter
+@AllArgsConstructor
+public enum OrderStatusEnum {
+
+    /**
+     * 订单状态枚举
+     */
+    SAVED(0, "已保存"),
+    WAIT_ACCEPTED(1, "待受理"),
+    RETURNED(2, "已退回"),
+    WAIT_SIGNED(3, "待签约"),
+    EXECUTING(4, "执行中"),
+    FINISHED(5, "已完结"),
+    RECONCILED(6, "已对账"),
+    SETTLED(7, "已结算");
+
+    private final Integer code;
+    private final String msg;
+
+    public static String getMsg(Integer code) {
+        for (OrderStatusEnum ele : OrderStatusEnum.values()) {
+            if (ele.getCode().equals(code)) {
+                return ele.getMsg();
+            }
+        }
+        return null;
+    }
+
+}

+ 30 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/OrderUnitTypeEnum.java

@@ -0,0 +1,30 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 订单单位类型枚举
+ * @author: yzc
+ * @date: 2023-09-18 15:42
+ */
+@Getter
+@AllArgsConstructor
+public enum OrderUnitTypeEnum {
+
+    PURCHASE("1", "采购单位"),
+    SALE("2", "销售单位");
+
+    private final String type;
+
+    private final String label;
+
+    public static String getLabel(String type) {
+        for (OrderUnitTypeEnum ele : OrderUnitTypeEnum.values()) {
+            if (ele.getType().equals(type)) {
+                return ele.getLabel();
+            }
+        }
+        return null;
+    }
+}

+ 47 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/WantBuyStatusEnum.java

@@ -0,0 +1,47 @@
+package com.sckw.order.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @desc: 求购状态枚举
+ * @author: yzc
+ * @date: 2023-07-06 13:53
+ */
+@AllArgsConstructor
+@Getter
+public enum WantBuyStatusEnum {
+
+    /**
+     * 产品状态枚举
+     */
+    SAVED(0, "已保存"),
+    PUT_ON_SHELVES(1, "上架中"),
+    TAKE_OFF_SHELVES(2, "已下架");
+
+    private final Integer code;
+    private final String msg;
+
+
+    public static String getNameByCode(Integer code) {
+        WantBuyStatusEnum[] enums = WantBuyStatusEnum.values();
+        for (WantBuyStatusEnum instance : enums) {
+            if (Objects.equals(instance.getCode(), code)) {
+                return instance.getMsg();
+            }
+        }
+        return null;
+    }
+
+    public static List<WantBuyStatusEnum> getSortList() {
+        WantBuyStatusEnum[] enums = WantBuyStatusEnum.values();
+        return Arrays.stream(enums).sorted(Comparator.comparingInt(WantBuyStatusEnum::getCode)).collect(Collectors.toList());
+    }
+
+}

+ 96 - 63
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.sckw.contract.api.RemoteContractService;
 import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
-import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
@@ -24,6 +23,7 @@ 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.KwoTradeOrderMapper;
+import com.sckw.order.enums.*;
 import com.sckw.order.model.*;
 import com.sckw.order.model.dto.OrderCheckDTO;
 import com.sckw.order.model.dto.WbTOrderExcelStsReqDTO;
@@ -120,7 +120,7 @@ public class KwoTradeOrderService {
         KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
         order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
                 .setUnit(Objects.nonNull(param.getGoodsInfo()) ? param.getGoodsInfo().getUnit() : null)
-                .setSource(DictEnum.TORDER_SOURCE_1.getValue()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_0.getValue()));
+                .setSource(OrderSourceEnum.PURCHASE.getType()).setStatus(OrderStatusEnum.SAVED.getCode());
         kwoTradeOrderMapper.insert(order);
         addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
     }
@@ -183,7 +183,7 @@ public class KwoTradeOrderService {
                 KwoTradeOrderUnit unit = BeanUtils.copyProperties(e, KwoTradeOrderUnit.class);
                 unit.setTOrderId(id).setTOrderNo(tOrderNo).setTopEntId(ent.getId());
                 list.add(unit);
-                if (Objects.equals(e.getUnitType(), DictEnum.TORDER_UNIT_TYPE_1.getValue())) {
+                if (Objects.equals(e.getUnitType(), OrderUnitTypeEnum.PURCHASE.getType())) {
                     order.setProcureEntId(e.getEntId()).setProcureTopEntId(unit.getTopEntId()).setProcureFirmName(e.getFirmName())
                             .setProcureContacts(e.getContacts()).setProcurePhone(e.getPhone()).setProcureContactsId(e.getContactsId());
                 } else {
@@ -202,7 +202,7 @@ public class KwoTradeOrderService {
                 KwoTradeOrderAddress address = BeanUtils.copyProperties(e, KwoTradeOrderAddress.class);
                 address.setTOrderId(id).setTOrderNo(tOrderNo);
                 list.add(address);
-                if (Objects.equals(e.getAddressType(), DictEnum.TORDER_ADDRESS_TYPE_1.getValue())) {
+                if (Objects.equals(e.getAddressType(), OrderAddressTypeEnum.LOAD.getType())) {
                     order.setLoadName(e.getName()).setLoadType(e.getType()).setLoadContacts(e.getContacts())
                             .setLoadPhone(e.getPhone()).setLoadCityCode(String.valueOf(e.getCityCode())).setLoadCityName(e.getCityName())
                             .setLoadDetailAddress(e.getDetailAddress()).setLoadLat(e.getLat()).setLoadLng(e.getLng());
@@ -224,7 +224,7 @@ public class KwoTradeOrderService {
             BeanUtils.copyProperties(contractInfo, order);
         }
         //状态信息(草稿更新不加状态记录)
-        if (!isUpdate || !Objects.equals(DictEnum.TORDER_STATUS_0.getValue(), String.valueOf(tradeOrder.getStatus()))) {
+        if (!isUpdate || !Objects.equals(OrderStatusEnum.SAVED.getCode(), tradeOrder.getStatus())) {
             KwoTradeOrderTrack track = new KwoTradeOrderTrack();
             track.setTOrderId(id).setTOrderNo(tOrderNo).setStatus(tradeOrder.getStatus()).setRemark(tradeOrder.getRemark());
             kwoTradeOrderTrackService.insert(track);
@@ -262,7 +262,7 @@ public class KwoTradeOrderService {
         KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
         order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
                 .setUnit(Objects.nonNull(param.getGoodsInfo()) ? param.getGoodsInfo().getUnit() : null)
-                .setSource(DictEnum.TORDER_SOURCE_2.getValue()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_0.getValue()));
+                .setSource(OrderSourceEnum.SALE.getType()).setStatus(OrderStatusEnum.SAVED.getCode());
         kwoTradeOrderMapper.insert(order);
         addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
     }
@@ -282,12 +282,13 @@ public class KwoTradeOrderService {
         OrderCheckDTO orderCheck = BeanUtils.copyProperties(param, OrderCheckDTO.class);
         getTopEnt(orderCheck, param.getUnitInfo());
         orderCheck.setGoodsId(goodsInfo.getGoodsId()).setUnitPrice(goodsInfo.getUnitPrice())
-                .setOrderSource(DictEnum.TORDER_SOURCE_1.getValue());
+                .setOrderSource(OrderSourceEnum.PURCHASE.getType());
         orderCheck(orderCheck, false);
         KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
         order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
-                .setUnit(param.getGoodsInfo().getUnit()).setSource(DictEnum.TORDER_SOURCE_1.getValue())
-                .setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_1.getValue()));
+                .setUnit(param.getGoodsInfo().getUnit())
+                .setSource(OrderSourceEnum.PURCHASE.getType())
+                .setStatus(OrderStatusEnum.WAIT_ACCEPTED.getCode());
         kwoTradeOrderMapper.insert(order);
         //扣减库存
         HttpResult updateResult = goodsInfoService.updateGoodsAmount(param.getGoodsInfo().getGoodsId(), param.getAmount());
@@ -316,7 +317,7 @@ public class KwoTradeOrderService {
         UserInfo createUser = new UserInfo();
         createUser.setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId());
         userInfos.add(createUser);
-        boolean flag = Objects.equals(orderCheck.getOrderSource(), DictEnum.TORDER_SOURCE_1.getValue());
+        boolean flag = Objects.equals(orderCheck.getOrderSource(), OrderSourceEnum.PURCHASE.getType());
         UserInfo procureUser = orderCheck.getProcureUser();
         String procureFireName = orderCheck.getProcureFireName();
         UserInfo supplyUser = orderCheck.getSupplyUser();
@@ -388,7 +389,7 @@ public class KwoTradeOrderService {
                 log.error("企业:{}找不到对应一级企业信息", entId);
                 throw new BusinessException("一级企业信息不存在!");
             }
-            if (Objects.equals(e.getUnitType(), DictEnum.TORDER_UNIT_TYPE_1.getValue())) {
+            if (Objects.equals(e.getUnitType(), OrderUnitTypeEnum.PURCHASE.getType())) {
                 UserInfo procureUser = new UserInfo();
                 orderCheck.setProcureTopEntId(ent.getId());
                 orderCheck.setProcureEntId(entId);
@@ -423,7 +424,7 @@ public class KwoTradeOrderService {
                 throw new BusinessException("订单总金额不等于商品单价*订单总量!");
             }
             List<FindEntCooperateResVo> entCooperate;
-            if (DictEnum.TORDER_SOURCE_1.getValue().equals(param.getOrderSource())) {
+            if (OrderSourceEnum.PURCHASE.getType().equals(param.getOrderSource())) {
                 entCooperate = remoteManageService.findEntCooperate(param.getProcureEntId()
                         , param.getSupplyEntId(), CooperateTypeEnum.SUPPLIER.getCode());
             } else {
@@ -445,7 +446,7 @@ public class KwoTradeOrderService {
         if (trading.startsWith("1")) {
             BigDecimal advancePrice = goods.getAdvancePrice().multiply(new BigDecimal("10000"));
             //直接采购下单才校验预付款限额
-            if (Objects.equals(param.getOrderSource(), DictEnum.TORDER_SOURCE_1.getValue()) && price.compareTo(advancePrice) < 0) {
+            if (Objects.equals(param.getOrderSource(), OrderSourceEnum.PURCHASE.getType()) && price.compareTo(advancePrice) < 0) {
                 throw new BusinessException("您的订单总额未达到预付限额,请确认");
             }
             R<List<WalletDto>> wallet = payCenterDubboService.wallet(param.getProcureTopEntId(), ChannelEnum.getByCode(trading), param.getSupplyTopEntId());
@@ -474,19 +475,19 @@ public class KwoTradeOrderService {
         OrderCheckDTO orderCheck = BeanUtils.copyProperties(param, OrderCheckDTO.class);
         getTopEnt(orderCheck, param.getUnitInfo());
         orderCheck.setGoodsId(param.getGoodsInfo().getGoodsId()).setUnitPrice(param.getGoodsInfo().getUnitPrice())
-                .setOrderSource(DictEnum.TORDER_SOURCE_2.getValue());
+                .setOrderSource(OrderSourceEnum.SALE.getType());
         orderCheck(orderCheck, false);
         ContractInfo contract = param.getContractInfo();
         contractCheck(contract);
         param.setContractInfo(contract);
         KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
         order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
-                .setUnit(param.getGoodsInfo().getUnit()).setSource(DictEnum.TORDER_SOURCE_2.getValue());
+                .setUnit(param.getGoodsInfo().getUnit()).setSource(OrderSourceEnum.SALE.getType());
         String contractStatus = contract.getContractStatus();
-        if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_0.getValue())) {
-            order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()));
-        } else if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_1.getValue())) {
-            order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
+        if (Objects.equals(contractStatus, ContractStatusEnum.WAIT_SIGNED.getCode())) {
+            order.setStatus(OrderStatusEnum.WAIT_SIGNED.getCode());
+        } else if (Objects.equals(contractStatus, ContractStatusEnum.SIGNED.getCode())) {
+            order.setStatus(OrderStatusEnum.EXECUTING.getCode());
         } else {
             throw new BusinessException("Invalid contract status");
         }
@@ -578,7 +579,7 @@ public class KwoTradeOrderService {
                     process.setRoleName(String.join(",", roleNames));
                 }
             }
-            process.setStatusLabel(DictEnum.getLabel(DictTypeEnum.TORDER_STATUS.getType(), String.valueOf(process.getStatus())));
+            process.setStatusLabel(OrderStatusEnum.getMsg(process.getStatus()));
             orderProcesses.add(process);
         });
         detail.setOrderProcess(orderProcesses);
@@ -597,17 +598,48 @@ public class KwoTradeOrderService {
         if (Objects.isNull(order)) {
             throw new BusinessException("不存在该订单!");
         }
+        Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(
+                List.of(DictTypeEnum.TRADE_TYPE.getType(), DictTypeEnum.PICKUP_TYPE.getType(),
+                        DictTypeEnum.DELIVERY_TYPE.getType(), DictTypeEnum.TORDER_SOURCE.getType(), DictTypeEnum.TORDER_STATUS.getType(),
+                        DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.UNIT_TYPE.getType(), DictTypeEnum.TAX_RATE.getType(),
+                        DictTypeEnum.TORDER_UNIT_TYPE.getType(), DictTypeEnum.TORDER_ADDRESS_TYPE.getType(), DictTypeEnum.ADDRESS_TYPE.getType()));
+        Map<String, String> tradeMap = new HashMap<>();
+        Map<String, String> pickupMap = new HashMap<>();
+        Map<String, String> deleveryMap = new HashMap<>();
+        Map<String, String> sourceMap = new HashMap<>();
+        Map<String, String> statusMap = new HashMap<>();
+        Map<String, String> prodcutNameMap = new HashMap<>();
+        Map<String, String> unitMap = new HashMap<>();
+        Map<String, String> taxRateMap = new HashMap<>();
+        Map<String, String> orderUnitMap, orderAddressMap, addressMap;
+        if (CollectionUtils.isNotEmpty(dict)) {
+            tradeMap = dict.get(DictTypeEnum.TRADE_TYPE.getType());
+            pickupMap = dict.get(DictTypeEnum.PICKUP_TYPE.getType());
+            deleveryMap = dict.get(DictTypeEnum.DELIVERY_TYPE.getType());
+            sourceMap = dict.get(DictTypeEnum.TORDER_SOURCE.getType());
+            statusMap = dict.get(DictTypeEnum.TORDER_STATUS.getType());
+            prodcutNameMap = dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
+            unitMap = dict.get(DictTypeEnum.UNIT_TYPE.getType());
+            taxRateMap = dict.get(DictTypeEnum.TAX_RATE.getType());
+            orderUnitMap = dict.get(DictTypeEnum.TORDER_UNIT_TYPE.getType());
+            orderAddressMap = dict.get(DictTypeEnum.TORDER_ADDRESS_TYPE.getType());
+            addressMap = dict.get(DictTypeEnum.ADDRESS_TYPE.getType());
+        } else {
+            orderUnitMap = new HashMap<>();
+            orderAddressMap = new HashMap<>();
+            addressMap = new HashMap<>();
+        }
         //订单基本信息
         OrderDetailRes detail = BeanUtils.copyProperties(order, OrderDetailRes.class);
         UserCacheResDto createUser = remoteSystemService.queryUserCacheById(detail.getCreateBy());
         EntCacheResDto ent = remoteSystemService.queryEntCacheById(detail.getEntId());
         detail.setFirmName(Objects.isNull(ent) ? null : ent.getFirmName())
                 .setCreateByName(Objects.isNull(createUser) ? null : createUser.getName())
-                .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), detail.getTrading()))
-                .setPickupTypeLabel(DictEnum.getLabel(DictTypeEnum.PICKUP_TYPE.getType(), detail.getPickupType()))
-                .setDeliveryTypeLabel(DictEnum.getLabel(DictTypeEnum.DELIVERY_TYPE.getType(), detail.getDeliveryType()))
-                .setSourceLabel(DictEnum.getLabel(DictTypeEnum.TORDER_SOURCE.getType(), detail.getSource()))
-                .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TORDER_STATUS.getType(), String.valueOf(detail.getStatus())));
+                .setTradingLabel(CollectionUtils.isNotEmpty(tradeMap) ? tradeMap.get(detail.getTrading()) : null)
+                .setPickupTypeLabel(CollectionUtils.isNotEmpty(pickupMap) ? pickupMap.get(detail.getPickupType()) : null)
+                .setDeliveryTypeLabel(CollectionUtils.isNotEmpty(deleveryMap) ? deleveryMap.get(detail.getDeliveryType()) : null)
+                .setSourceLabel(CollectionUtils.isNotEmpty(sourceMap) ? sourceMap.get(detail.getSource()) : null)
+                .setStatusLabel(CollectionUtils.isNotEmpty(statusMap) ? statusMap.get(String.valueOf(detail.getStatus())) : null);
         //商品信息
         KwoTradeOrderGoods orderGoods = kwoTradeOrderGoodsService.getByOrderId(id);
         if (Objects.nonNull(orderGoods)) {
@@ -615,9 +647,10 @@ public class KwoTradeOrderService {
             if (Objects.nonNull(goods)) {
                 EntCacheResDto entCache = remoteSystemService.queryEntCacheById(goods.getEntId());
                 GoodsInfoDetailRes goodsDetail = new GoodsInfoDetailRes();
-                goodsDetail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), goods.getGoodsType()))
-                        .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), goods.getUnit())).setGoodsAmount(goods.getAmount())
-                        .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), goods.getTaxRate()))
+                goodsDetail.setGoodsTypeLabel(CollectionUtils.isNotEmpty(prodcutNameMap) ? prodcutNameMap.get(goods.getGoodsType()) : null)
+                        .setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(goods.getUnit()) : null)
+                        .setTaxRateLabel(CollectionUtils.isNotEmpty(taxRateMap) ? taxRateMap.get(goods.getTaxRate()) : null)
+                        .setGoodsAmount(goods.getAmount())
                         .setGoodsId(goods.getId()).setCode(goods.getCode()).setName(goods.getName())
                         .setGoodsType(goods.getGoodsType()).setTaxRate(goods.getTaxRate()).setSpec(goods.getSpec())
                         .setUnit(goods.getUnit()).setPriceRangeId(orderGoods.getPriceRangeId()).setUnitPrice(orderGoods.getUnitPrice())
@@ -633,7 +666,7 @@ public class KwoTradeOrderService {
             List<UnitInfoDetailRes> unitInfos = new ArrayList<>(units.size());
             units.forEach(e -> {
                 UnitInfoDetailRes unit = BeanUtils.copyProperties(e, UnitInfoDetailRes.class);
-                unit.setUnitTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_UNIT_TYPE.getType(), unit.getUnitType()));
+                unit.setUnitTypeLabel(CollectionUtils.isNotEmpty(orderUnitMap) ? orderUnitMap.get(unit.getUnitType()) : null);
                 unitInfos.add(unit);
             });
             detail.setUnitInfo(unitInfos);
@@ -644,8 +677,8 @@ public class KwoTradeOrderService {
             List<AddressInfoDetailRes> addressInfoDetails = new ArrayList<>(addressList.size());
             addressList.forEach(e -> {
                 AddressInfoDetailRes address = BeanUtils.copyProperties(e, AddressInfoDetailRes.class);
-                address.setAddressTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_ADDRESS_TYPE.getType(), address.getAddressType()));
-                address.setTypeLabel(DictEnum.getLabel(DictTypeEnum.ADDRESS_TYPE.getType(), address.getType()));
+                address.setAddressTypeLabel(CollectionUtils.isNotEmpty(orderAddressMap) ? orderAddressMap.get(address.getAddressType()) : null);
+                address.setTypeLabel(CollectionUtils.isNotEmpty(addressMap) ? addressMap.get(address.getType()) : null);
                 addressInfoDetails.add(address);
             });
             detail.setAddressInfo(addressInfoDetails);
@@ -679,12 +712,12 @@ public class KwoTradeOrderService {
             throw new BusinessException("Order not found");
         }
         String source = order.getSource();
-        String status = String.valueOf(order.getStatus());
-        if ((!Objects.equals(status, DictEnum.TORDER_STATUS_0.getValue()) && !Objects.equals(status, DictEnum.TORDER_STATUS_2.getValue()))
-                && Objects.equals(source, DictEnum.TORDER_SOURCE_1.getValue())) {
+        Integer status = order.getStatus();
+        if ((!Objects.equals(status, OrderStatusEnum.SAVED.getCode()) && !Objects.equals(status, OrderStatusEnum.RETURNED.getCode()))
+                && Objects.equals(source, OrderSourceEnum.PURCHASE.getType())) {
             throw new BusinessException("采购下单只能修改已保存及已退回状态的订单!");
         }
-        if (Objects.equals(source, DictEnum.TORDER_SOURCE_2.getValue()) && !Objects.equals(status, DictEnum.TORDER_STATUS_0.getValue())) {
+        if (Objects.equals(source, OrderSourceEnum.SALE.getType()) && !Objects.equals(status, OrderStatusEnum.SAVED.getCode())) {
             throw new BusinessException("代客下单只能修改已保存状态的订单!");
         }
         if (!Objects.equals(0, order.getStatus())
@@ -694,17 +727,17 @@ public class KwoTradeOrderService {
         OrderCheckDTO orderCheck = new OrderCheckDTO();
         if (Objects.equals(param.getOperateType(), 1)) {
             checkParams(param, source);
-            if (Objects.equals(source, DictEnum.TORDER_SOURCE_1.getValue())) {
-                order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_1.getValue()));
+            if (Objects.equals(source, OrderSourceEnum.PURCHASE.getType())) {
+                order.setStatus(OrderStatusEnum.WAIT_ACCEPTED.getCode());
             } else {
                 ContractInfo contract = param.getContractInfo();
                 contractCheck(contract);
                 param.setContractInfo(contract);
                 String contractStatus = contract.getContractStatus();
-                if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_0.getValue())) {
-                    order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()));
-                } else if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_1.getValue())) {
-                    order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
+                if (Objects.equals(contractStatus, ContractStatusEnum.WAIT_SIGNED.getCode())) {
+                    order.setStatus(OrderStatusEnum.WAIT_SIGNED.getCode());
+                } else if (Objects.equals(contractStatus, ContractStatusEnum.SIGNED.getCode())) {
+                    order.setStatus(OrderStatusEnum.EXECUTING.getCode());
                 } else {
                     throw new BusinessException("Invalid contract status");
                 }
@@ -755,7 +788,7 @@ public class KwoTradeOrderService {
             throw new BusinessException("结束时间不能为空!");
         }
         ContractInfo contractInfo = param.getContractInfo();
-        if (Objects.equals(source, DictEnum.TORDER_SOURCE_2.getValue())) {
+        if (Objects.equals(source, OrderSourceEnum.SALE.getType())) {
             if (StringUtils.isBlank(param.getDeliveryType())) {
                 throw new BusinessException("交付类型不能为空!");
             }
@@ -776,7 +809,7 @@ public class KwoTradeOrderService {
         if (StringUtils.isBlank(goodsInfo.getUnit())) {
             throw new BusinessException("商品单位不能为空!");
         }
-        if (Objects.isNull(goodsInfo.getPriceRangeId()) && Objects.equals(source, DictEnum.TORDER_SOURCE_1.getValue())) {
+        if (Objects.isNull(goodsInfo.getPriceRangeId()) && Objects.equals(source, OrderSourceEnum.PURCHASE.getType())) {
             throw new BusinessException("价格段id不能为空!");
         }
         if (Objects.isNull(goodsInfo.getUnitPrice()) || goodsInfo.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0) {
@@ -861,10 +894,10 @@ public class KwoTradeOrderService {
         if (Objects.isNull(order)) {
             throw new BusinessException("Order not found");
         }
-        if (!Objects.equals(DictEnum.TORDER_STATUS_1.getValue(), String.valueOf(order.getStatus()))) {
+        if (!Objects.equals(OrderStatusEnum.WAIT_ACCEPTED.getCode(), order.getStatus())) {
             throw new BusinessException("订单状态不为待受理!");
         }
-        if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
+        if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), OrderUnitTypeEnum.SALE.getType())) {
             throw new BusinessException("无订单操作权限!");
         }
         KwoTradeOrderGoods goods = kwoTradeOrderGoodsService.getByOrderId(order.getId());
@@ -887,10 +920,10 @@ public class KwoTradeOrderService {
         ContractInfo contractInfo = param.getContractInfo();
         contractCheck(contractInfo);
         String contractStatus = contractInfo.getContractStatus();
-        if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_0.getValue())) {
-            order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()));
-        } else if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_1.getValue())) {
-            order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
+        if (Objects.equals(contractStatus, ContractStatusEnum.WAIT_SIGNED.getCode())) {
+            order.setStatus(OrderStatusEnum.WAIT_SIGNED.getCode());
+        } else if (Objects.equals(contractStatus, ContractStatusEnum.SIGNED.getCode())) {
+            order.setStatus(OrderStatusEnum.EXECUTING.getCode());
         } else {
             throw new BusinessException("Invalid contract status");
         }
@@ -942,13 +975,13 @@ public class KwoTradeOrderService {
         if (Objects.isNull(order)) {
             throw new BusinessException("Order not found");
         }
-        if (!Objects.equals(DictEnum.TORDER_STATUS_1.getValue(), String.valueOf(order.getStatus()))) {
+        if (!Objects.equals(OrderStatusEnum.WAIT_ACCEPTED.getCode(), order.getStatus())) {
             throw new BusinessException("订单状态不为待受理!");
         }
-        if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
+        if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), OrderUnitTypeEnum.SALE.getType())) {
             throw new BusinessException("无订单操作权限!");
         }
-        order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_2.getValue()));
+        order.setStatus(OrderStatusEnum.RETURNED.getCode());
         kwoTradeOrderMapper.updateById(order);
         //订单状态记录
         KwoTradeOrderTrack track = new KwoTradeOrderTrack();
@@ -983,8 +1016,8 @@ public class KwoTradeOrderService {
         map.put("orderNo", order.getTOrderNo());
         Map<String, KwoTradeOrderUnit> unitMap = units.stream().collect
                 (Collectors.toMap(KwoTradeOrderUnit::getUnitType, Function.identity()));
-        KwoTradeOrderUnit purchase = unitMap.get(DictEnum.TORDER_UNIT_TYPE_1.getValue());
-        KwoTradeOrderUnit supply = unitMap.get(DictEnum.TORDER_UNIT_TYPE_2.getValue());
+        KwoTradeOrderUnit purchase = unitMap.get(OrderUnitTypeEnum.PURCHASE.getType());
+        KwoTradeOrderUnit supply = unitMap.get(OrderUnitTypeEnum.SALE.getType());
         //给供应企业联系人发消息
         map.put("firmName", purchase.getFirmName());
         UserInfo supplyUser = new UserInfo();
@@ -1019,7 +1052,7 @@ public class KwoTradeOrderService {
         if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), null)) {
             throw new BusinessException("无订单操作权限!");
         }
-        KwoTradeOrderTrack track = kwoTradeOrderTrackService.getByOrderId(id, Integer.valueOf(DictEnum.TORDER_STATUS_2.getValue()));
+        KwoTradeOrderTrack track = kwoTradeOrderTrackService.getByOrderId(id, OrderStatusEnum.RETURNED.getCode());
 
         return Objects.isNull(track) ? null : track.getRemark();
     }
@@ -1038,10 +1071,10 @@ public class KwoTradeOrderService {
         if (Objects.isNull(order)) {
             throw new BusinessException("Order not found");
         }
-        if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_4.getValue())) {
+        if (!Objects.equals(order.getStatus(), OrderStatusEnum.EXECUTING.getCode())) {
             throw new BusinessException("执行中的订单才能完结订单!");
         }
-        if (kwoTradeOrderUnitService.entMatch(param.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
+        if (kwoTradeOrderUnitService.entMatch(param.getId(), LoginUserHolder.getEntId(), OrderUnitTypeEnum.SALE.getType())) {
             throw new BusinessException("无订单操作权限!");
         }
         if (transportDubboService.checkLogisticsOrderByTradeOrderId(tOrderId)) {
@@ -1052,7 +1085,7 @@ public class KwoTradeOrderService {
             throw new BusinessException("业务繁忙,请稍后再试!");
         }
         try {
-            order.setActualAmount(actualAmount).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_5.getValue()));
+            order.setActualAmount(actualAmount).setStatus(OrderStatusEnum.FINISHED.getCode());
             kwoTradeOrderMapper.updateById(order);
             //订单状态记录
             KwoTradeOrderTrack track = new KwoTradeOrderTrack();
@@ -1160,7 +1193,7 @@ public class KwoTradeOrderService {
      */
     public List<KwoTradeOrder> getWaitSignByIds(List<Long> tOrderIds) {
         LambdaQueryWrapper<KwoTradeOrder> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(KwoTradeOrder::getStatus, Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()))
+        wrapper.eq(KwoTradeOrder::getStatus, OrderStatusEnum.WAIT_SIGNED.getCode())
                 .in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getDelFlag, Global.NO);
         List<KwoTradeOrder> list = kwoTradeOrderMapper.selectList(wrapper);
         return CollectionUtils.emptyIfNull(list);
@@ -1176,9 +1209,9 @@ public class KwoTradeOrderService {
      */
     public void contractCompletedUpdate(List<Long> tOrderIds, Long updateBy) {
         LambdaUpdateWrapper<KwoTradeOrder> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getStatus, Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()))
+        wrapper.in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getStatus, OrderStatusEnum.WAIT_SIGNED.getCode())
                 .eq(KwoTradeOrder::getDelFlag, Global.NO).set(KwoTradeOrder::getUpdateBy, updateBy)
-                .set(KwoTradeOrder::getStatus, Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
+                .set(KwoTradeOrder::getStatus, OrderStatusEnum.EXECUTING.getCode());
         kwoTradeOrderMapper.update(null, wrapper);
     }
 
@@ -1206,9 +1239,9 @@ public class KwoTradeOrderService {
         Map<String, List<Integer>> map = addressList.stream().collect(Collectors.
                 groupingBy(KwoTradeOrderAddress::getAddressType, Collectors.mapping(KwoTradeOrderAddress::getCityCode, Collectors.toList())));
         //装货地址下拉列表树
-        List<AreaTreeFrontResDto> loadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(DictEnum.TORDER_ADDRESS_TYPE_1.getValue()));
+        List<AreaTreeFrontResDto> loadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(OrderAddressTypeEnum.LOAD.getType()));
         //卸货地址下拉列表树
-        List<AreaTreeFrontResDto> unloadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(DictEnum.TORDER_ADDRESS_TYPE_2.getValue()));
+        List<AreaTreeFrontResDto> unloadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(OrderAddressTypeEnum.UNLOAD.getType()));
         res.setLoadAddressList(loadTree).setUnloadAddressList(unloadTree);
         return res;
     }