zjj
3 小时以前 32286d19d0a0b347c3787f051e95f413566ab4ae
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
42
43
44
45
46
47
48
49
50
package com.vincent.rsf.server.manager.utils;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.vincent.rsf.framework.common.SpringUtils;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.manager.entity.DeviceSite;
import com.vincent.rsf.server.manager.entity.Loc;
import com.vincent.rsf.server.manager.service.DeviceSiteService;
import com.vincent.rsf.server.manager.service.LocService;
import com.vincent.rsf.server.system.enums.LocStsType;
import org.apache.commons.lang3.StringUtils;
 
import java.util.Objects;
 
public class LocManageUtil {
 
    /**
     * @author Ryan
     * @description  获取目标库位, 包含库位获取策略
     * @param
     * @return
     * @time 2025/3/31 08:50
     */
    public static String getTargetLoc(Long areaId) {
        //TODO 库位策略后续排期
        LocService locService = SpringUtils.getBean(LocService.class);
 
        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
                .eq(Loc::getAreaId, areaId)
                .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type), false
        );
 
        return !Objects.isNull(loc) ? loc.getCode() : null;
    }
 
 
    /**
    * @author Ryan
    * @description 获取目标站点
    * @param
    * @return
    * @time 2025/3/31 09:49
    */
    public static String getTargetSite() {
        //TODO 站点策略后续排期
        DeviceSiteService deviceSite = SpringUtils.getBean(DeviceSiteService.class);
        DeviceSite loc = deviceSite.getOne(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getStatus, 1), false);
        return !Objects.isNull(loc) ? loc.getSite() : null;
    }
}