自动化立体仓库 - WMS系统
zyx
2024-08-05 e332958154ab5a4d5cc77a92e2f8c35068d2b943
src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
@@ -4,10 +4,10 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.beust.jcommander.internal.Lists;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.MesBuyPakinReportParam;
import com.zy.asrs.entity.param.MesOrderReportParam;
import com.zy.asrs.entity.param.MesPakinReportParam;
import com.zy.asrs.entity.param.MesPakoutReportParam;
@@ -15,7 +15,6 @@
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.common.utils.HttpHandler;
import io.swagger.models.auth.In;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -59,6 +58,8 @@
    private String orderReportPath;
    @Value("${mes.pakinReportPath}")
    private String pakinReportPath;
    @Value("${mes.buyPakinReportPath}")
    private String buyPakinReportPath;
    @Value("${mes.pakoutReportPath}")
    private String pakoutReportPath;
    @Value("${mes.getTokenPath}")
@@ -93,6 +94,10 @@
    private AgvWorkService agvWorkService;
    @Autowired
    private ApiLogService apiLogService;
    @Autowired
    private DocTypeService docTypeService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Transactional
    public ReturnT<String> completedPutWayWrk(AgvWrkMast agvWrkMast) {
@@ -622,13 +627,42 @@
    private void reportMesPakinOrder(AgvWrkMast agvWrkMast, List<AgvWrkDetl> agvWrkDetls){
        for (AgvWrkDetl agvWrkDetl : agvWrkDetls){
            MesPakinReportParam mesPakinReportParam = new MesPakinReportParam();
            mesPakinReportParam.setInboundOrderCode(agvWrkDetl.getOrderNo());
            mesPakinReportParam.setBizType("0");
            mesPakinReportParam.setInventoryAttr(new MesPakinReportParam.InventoryAttr(agvWrkDetl.getThreeCode().trim(),agvWrkDetl.getMatnr(),agvWrkMast.getLocNo()));
            mesPakinReportParam.setNoQrCodeExecAmount(new MesPakinReportParam.NoQrCodeExecAmount(agvWrkDetl.getAnfme(),agvWrkDetl.getUnit(),null));
            //判断是否采购入库
            doHttpRequest(mesPakinReportParam,getMesTokenInfo(),"上报mes入库信息",url,pakinReportPath,null,"127.0.0.1");
            String orderNo = agvWrkDetl.getOrderNo();
            Order order = orderService.selectByNo(orderNo);
            DocType docType = docTypeService.selectById(order.getDocType());
            if (docType.getDocName().contains("采购")){
                OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMatnr(orderNo, agvWrkDetl.getMatnr(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime());
                MesBuyPakinReportParam mesBuyPakinReportParam = new MesBuyPakinReportParam();
                List<MesBuyPakinReportParam.Iteam> iteams = new ArrayList<>();
                MesBuyPakinReportParam.Iteam iteam = new MesBuyPakinReportParam.Iteam();
                iteam.setMaterialCode(agvWrkDetl.getMatnr());
                iteam.setBatchNo(agvWrkDetl.getBatch());
                iteam.setAmount(agvWrkDetl.getAnfme());
                iteam.setStorageLocationCode(agvWrkMast.getLocNo());
                iteam.setLineNo(orderDetl.getItemNum());
                iteam.setSupplierCode(order.getSalesman());
                iteam.setUnit(agvWrkDetl.getUnit());
                mesBuyPakinReportParam.setCode(orderNo);
                mesBuyPakinReportParam.setIteam(iteams);
                doHttpRequest(mesBuyPakinReportParam,getMesTokenInfo(),"上报mes采购入库信息",url,buyPakinReportPath,null,"127.0.0.1");
            }else {
                MesPakinReportParam mesPakinReportParam = new MesPakinReportParam();
                mesPakinReportParam.setInboundOrderCode(agvWrkDetl.getOrderNo());
                mesPakinReportParam.setBizType("0");
                mesPakinReportParam.setInventoryAttr(new MesPakinReportParam.InventoryAttr(agvWrkDetl.getThreeCode().trim(),agvWrkDetl.getMatnr(),agvWrkMast.getLocNo()));
                mesPakinReportParam.setNoQrCodeExecAmount(new MesPakinReportParam.NoQrCodeExecAmount(agvWrkDetl.getAnfme(),agvWrkDetl.getUnit(),null));
                doHttpRequest(mesPakinReportParam,getMesTokenInfo(),"上报mes入库信息",url,pakinReportPath,null,"127.0.0.1");
            }
        }
    }