自动化立体仓库 - WMS系统
#
lsh
2024-02-17 b43b90ed4ff5e61df7c87553c8cab5daea66cb8e
#
5个文件已修改
130 ■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/WrkMastCrn.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/WrkMastCrnScheduler.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WrkMastCrnHandler.java 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/stockOut.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMastCrn.java
@@ -202,7 +202,7 @@
    public WrkMastCrn(WrkMast wrkMast,WrkMast wrkMastOther,Date now) {
        this.wrkNo = wrkMast.getWrkNo().longValue();
        this.wrkSts = 2L;
        this.wrkSts = wrkMast.getWrkSts();
        this.ioType = wrkMast.getIoType();
        this.crnNo = wrkMast.getCrnNo();
        this.locNo = wrkMast.getLocNo();
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -536,6 +536,7 @@
        if (Cools.isEmpty(param.getOutSite())) {
            throw new CoolException("站点不存在");
        }
        List<String> locNoOtherList = new ArrayList<>();
        for (String locNo : param.getLocNos()) {
            // 获取工作号
            int workNo = commonService.getWorkNo(WorkNoType.PAKOUT.type);
@@ -594,6 +595,48 @@
        }
    }
    public String[] staNoOther(String locNo){
        String[] strings = new String[2];
        int row = Utils.getRow(locNo);
        if (row==1 || row==5 ){
            strings[0] = locNo;
            strings[1] = getDeepLoc2(locNo,row);
            return strings;
        } else if (row == 4 || row == 8){
            strings[0] = getDeepLoc2(locNo,row);
            strings[1] = locNo;
            return strings;
        }else {
            return null;
        }
    }
    /**
     * 获取 浅库位对应的深库位号
     */
    public static String getDeepLoc(String shallowLoc,int row) {
        if (row == 2 || row == 6) {
            return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2);
        } else if (row == 3 || row == 7) {
            return Utils.zerofill(String.valueOf(row+1), 2) + shallowLoc.substring(2);
        }else {
            return shallowLoc;
        }
    }
    /**
     * 获取 深库位对应的浅库位号
     */
    public static String getDeepLoc2(String shallowLoc,int row) {
        if (row == 1 || row == 5) {
            return Utils.zerofill(String.valueOf(row+1), 2) + shallowLoc.substring(2);
        } else if (row == 4 || row == 8) {
            return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2);
        }else {
            return null;
        }
    }
    @Override
    @Transactional
    public WrkMast emptyPlateOut(EmptyPlateOutParam param) {
src/main/java/com/zy/asrs/task/WrkMastCrnScheduler.java
@@ -7,6 +7,7 @@
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.WrkMastCrnHandler;
import com.zy.asrs.task.handler.WrkMastStaInItHandler;
import com.zy.asrs.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,14 +43,18 @@
    @Autowired
    private WrkMastCrnService wrkMastCrnService;
    public static final List<Integer> STA_WORK_RU = new ArrayList<Integer>() {{
    public static final List<Integer> CRN_WORK_RU = new ArrayList<Integer>() {{
        add(153);add(145);
    }};
    public static final List<Integer> CRN_WORK_CU = new ArrayList<Integer>() {{
        add(100);add(148);
    }};
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        for(Integer staNo : STA_WORK_RU){
        for(Integer staNo : CRN_WORK_RU){
            BasDevp basDevp = basDevpService.selectById(staNo);
            if (basDevp.getWrkNo()!=0 && basDevp.getLoading().equals("Y") && basDevp.getAutoing().equals("Y") && basDevp.getInEnable().equals("Y")){
                WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo()));
@@ -72,9 +77,7 @@
                        }
                        if (!Cools.isEmpty(wrkMast)){
                            ReturnT<String> result = wrkMastCrnHandler.start(wrkMast,wrkMastOther);
                            if (result.getCode()==200){
                                continue;
                            }else {
                            if (result.getCode()!=200){
                                System.out.println(staNo+"失败!");
                            }
                        }
@@ -84,6 +87,24 @@
        }
    }
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute2(){
        for(Integer staNo : CRN_WORK_CU) {
            List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                    .eq("source_sta_no", staNo).eq("wrk_sts", 11L)
                    .orderBy("io_pri",false));
            for (WrkMast wrkMast:wrkMasts){
                int row = Utils.getRow(wrkMast.getSourceLocNo());
                if (row == wrkMast.getCrnNo()*4 || row == wrkMast.getCrnNo()*4-3){
                    WrkMastCrn wrkMastCrn = wrkMastCrnService.selectOne(new EntityWrapper<WrkMastCrn>().eq("wrk_no", wrkMast.getWrkNo()));
                    if (Cools.isEmpty(wrkMastCrn)){
                        ReturnT<String> result = wrkMastCrnHandler.start(wrkMast);
                    }
                }
            }
        }
    }
    public Integer staNoOther(Integer staNo){
        return staNo-1;
    }
src/main/java/com/zy/asrs/task/handler/WrkMastCrnHandler.java
@@ -65,7 +65,7 @@
                return FAIL;
            }
            String[] strings = staNoOther(locMast1.getLocNo());
            if (Cools.isEmpty(strings)){
            if (Cools.isEmpty(strings) || Cools.isEmpty(strings[0]) || Cools.isEmpty(strings[1])){
                return FAIL;
            }
            wrkMast.setLocNo(strings[0]);
@@ -109,6 +109,30 @@
        return SUCCESS;
    }
    public ReturnT<String> start(WrkMast wrkMast) {
        try {
            Date now = new Date();
            LocTypeDto locTypeDto = new LocTypeDto();
            locTypeDto.setLocType1((short)1);
            String deepLocOther = getDeepLoc2(wrkMast.getSourceLocNo(), Utils.getRow(wrkMast.getSourceLocNo()));
            if (Cools.isEmpty(deepLocOther)){
                return FAIL;
            }
            WrkMast wrkMastOther = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no", deepLocOther));
            if (!Cools.isEmpty(wrkMastOther)){
                WrkMastCrn wrkMastCrn = new WrkMastCrn(wrkMast,wrkMastOther,now);
                wrkMastCrnService.insert(wrkMastCrn);
            }else {
                return FAIL;
            }
        }catch (Exception e){
            log.error("异常!!!"+e);
            return FAIL;
        }
        return SUCCESS;
    }
    public String[] staNoOther(String locNo){
        String[] strings = new String[2];
        int row = Utils.getRow(locNo);
@@ -125,18 +149,18 @@
        }
    }
    /**
     * 获取 浅库位对应的深库位号
     */
    public static String getDeepLoc(String shallowLoc,int row) {
        if (row == 2 || row == 6) {
            return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2);
        } else if (row == 3 || row == 7) {
            return Utils.zerofill(String.valueOf(row+1), 2) + shallowLoc.substring(2);
        }else {
            return shallowLoc;
        }
    }
//    /**
//     * 获取 浅库位对应的深库位号
//     */
//    public static String getDeepLoc(String shallowLoc,int row) {
//        if (row == 2 || row == 6) {
//            return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2);
//        } else if (row == 3 || row == 7) {
//            return Utils.zerofill(String.valueOf(row+1), 2) + shallowLoc.substring(2);
//        }else {
//            return shallowLoc;
//        }
//    }
    /**
     * 获取 深库位对应的浅库位号
@@ -147,7 +171,7 @@
        } else if (row == 4 || row == 8) {
            return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2);
        }else {
            return shallowLoc;
            return null;
        }
    }
src/main/webapp/views/pda/stockOut.html
@@ -185,7 +185,7 @@
                    layui.form.render('select');
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/pda";
                }else {
                } else {
                    tips("获取出库口失败", true)
                }
            }