自动化立体仓库 - WMS系统
#
LSH
2023-02-13 8c890f686ae2060c4c2e6afebce6c69c493c2e04
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -1,14 +1,21 @@
package com.zy.asrs.task.handler;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.service.*;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.PostMesDataUtils;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -36,6 +43,13 @@
    private TestMastService testMastService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
    private ApiLogService apiLogService;
    @Value("${mes.url}")
    private String mesUrl;
    @Value("${mes.inPath}")
    private String inpath;
    public ReturnT<String> start(WrkMast wrkMast) {
        // 4.入库完成
@@ -279,6 +293,7 @@
                    }
                    // 修改源库位状态 ==> O
                    LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo());
                    Integer packStatus =sourceLoc.getPackStatus();
                    if (null != sourceLoc) {
                        sourceLoc.setBarcode("");
                        sourceLoc.setLocSts("O");
@@ -299,9 +314,9 @@
                    locMast.setModiTime(now);
                    locMast.setFireStatus(0);
                    if (locMast.getLocType1()==sourceLoc.getLocType1()){
                        locMast.setPackStatus(sourceLoc.getPackStatus());
                        locMast.setPackStatus(packStatus);
                    }else {
                        locMast.setPackStatus(4); //4:静置中
                        locMast.setPackStatus(5); //5:静置中
                        if (locMast.getLocType1()==1 && sourceLoc.getLocType1()==2){
                            TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                                    .eq("loc_no",sourceLoc.getLocNo())
@@ -314,6 +329,12 @@
                                throw new CoolException("更改测试状态失败");
                            }
                        }
                        CombParam combParam = new CombParam();
                        combParam.setPackNo(locMast.getBarcode());
                        combParam.setLocNo(locMast.getLocNo());
                        combParam.setPackSts(5);
                        combParam.setRequestTime(DateUtils.convert(new Date()));
                        new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                    }
                    if (!locMastService.updateById(locMast)) {
//                        exceptionHandle("库位移转 ===>> 修改目标库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());