#
Junjie
2024-08-01 fd5b35e658ac8cd3d9658c5cc5e1219c9d13915c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.zy.asrs.wms.asrs.entity.enums;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.LocSts;
import com.zy.asrs.wms.asrs.entity.OrderSettle;
import com.zy.asrs.wms.asrs.service.LocStsService;
import com.zy.asrs.wms.asrs.service.OrderSettleService;
 
public enum OrderSettleType {
 
    INIT(0, "初始化"),
    WAIT(1, "待处理"),
    WORKING(2, "作业中"),
    CANCEL(3, "已取消"),
    COMPLETE(4, "已完成"),
    WAIT_CANCEL(5, "准备取消"),
    REPORT_COMPLETE(6, "上报完成"),
    ;
 
 
    public Integer id;
    public String desc;
 
    OrderSettleType(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }
 
    public long val() {
        OrderSettleService service = SpringUtils.getBean(OrderSettleService.class);
        OrderSettle orderSettle = service.getOne(new LambdaQueryWrapper<OrderSettle>().eq(OrderSettle::getSettle, id));
        if (orderSettle == null) {
            throw new CoolException("LocStsType Error!");
        }
        return orderSettle.getId();
    }
 
 
}