From 2cd1fab84d88a16063d5036e77d690e9709f5d68 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期三, 10 七月 2024 08:28:32 +0800
Subject: [PATCH] #MES上报
---
src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java | 58 ++++++++++++++++++++++++++++-
src/main/java/com/zy/asrs/entity/param/MesPakoutReportParam.java | 10 +++++
src/main/java/com/zy/asrs/entity/param/MesPakinReportParam.java | 14 +++++++
3 files changed, 80 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/asrs/entity/param/MesPakinReportParam.java b/src/main/java/com/zy/asrs/entity/param/MesPakinReportParam.java
index a291f39..f85e7b7 100644
--- a/src/main/java/com/zy/asrs/entity/param/MesPakinReportParam.java
+++ b/src/main/java/com/zy/asrs/entity/param/MesPakinReportParam.java
@@ -7,12 +7,20 @@
private String bizType;
private String inboundOrderCode;
private String remark;
+ private InventoryAttr inventoryAttr;
+ private NoQrCodeExecAmount noQrCodeExecAmount;
@Data
public static class InventoryAttr{
private String batchNo;
private String materialCode;
private String storageLocationCode;
+
+ public InventoryAttr(String batchNo,String materialCode,String storageLocationCode){
+ this.batchNo = batchNo;
+ this.materialCode = materialCode;
+ this.storageLocationCode = storageLocationCode;
+ }
}
@Data
@@ -20,5 +28,11 @@
private Double amount;
private String unitName;
private String unitCode;
+
+ public NoQrCodeExecAmount(Double amount, String unitName, String unitCode) {
+ this.amount = amount;
+ this.unitName = unitName;
+ this.unitCode = unitCode;
+ }
}
}
diff --git a/src/main/java/com/zy/asrs/entity/param/MesPakoutReportParam.java b/src/main/java/com/zy/asrs/entity/param/MesPakoutReportParam.java
index a90c13d..cd63e2d 100644
--- a/src/main/java/com/zy/asrs/entity/param/MesPakoutReportParam.java
+++ b/src/main/java/com/zy/asrs/entity/param/MesPakoutReportParam.java
@@ -2,6 +2,8 @@
import lombok.Data;
+import java.util.List;
+
@Data
public class MesPakoutReportParam {
//鐗╂枡缂栫爜
@@ -13,6 +15,8 @@
//浠撳簱缂栧彿
private String wareHouseCode;
+ private List<String> batchNos;
+
private Amount amount;
@Data
@@ -22,5 +26,11 @@
private String unitCode;
//鍗曚綅鍚嶇О(缂栧彿鍜屽悕绉板繀濉竴涓�,涓よ�呬笉涓�鑷翠笖閮芥湁鏁堜互缂栧彿涓哄噯)
private String unitName;
+
+ public Amount(Double amount, String unitName, String unitCode) {
+ this.amount = amount;
+ this.unitCode = unitCode;
+ this.unitName = unitName;
+ }
}
}
diff --git a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
index 0d2f99b..e7a3b9d 100644
--- a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
@@ -8,10 +8,13 @@
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.MesOrderReportParam;
+import com.zy.asrs.entity.param.MesPakinReportParam;
+import com.zy.asrs.entity.param.MesPakoutReportParam;
import com.zy.asrs.service.*;
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;
@@ -26,6 +29,13 @@
@Slf4j
@Service
public class AgvWrkMastHandler extends AbstractHandler<String> {
+
+ //鍏ュ簱绫诲瀷鏁扮粍
+ private static final int[] IN_TYPE_ARRAY = new int[1];
+ //鍑哄簱绫诲瀷鏁扮粍
+ private static final int[] OUT_TYPE_ARRAY = new int[1];
+ //绉诲簱绫诲瀷鏁扮粍
+ private static final int[] MOVE_TYPE_ARRAY = new int[1];
@Value("${agvBasDev.maxWorkNum}")
private int maxWrokNum;
@@ -574,11 +584,55 @@
return wrkMast;
}
- private MesOrderReportParam generateMesParam(AgvWrkMast agvWrkMast, List<AgvWrkDetl> agvWrkDetls){
-
+ private Object getReportParamByIoType(AgvWrkMast agvWrkMast, List<AgvWrkDetl> agvWrkDetls){
if(Cools.isEmpty(agvWrkDetls)){
return null;
}
+ //鍖哄垎涓嶅悓浠诲姟绫诲瀷鐨勪笂鎶ユ柟寮�
+
+ if(Arrays.asList(IN_TYPE_ARRAY).contains(agvWrkMast.getIoType())){
+
+ }
+ if(Arrays.asList(OUT_TYPE_ARRAY).contains(agvWrkMast.getIoType())){
+
+ }
+ if(Arrays.asList(MOVE_TYPE_ARRAY).contains(agvWrkMast.getIoType())){
+ return generateMesParam(agvWrkMast,agvWrkDetls);
+ }
+
+ return null;
+ }
+
+ 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(),agvWrkDetl.getMatnr(),agvWrkMast.getLocNo()));
+ mesPakinReportParam.setNoQrCodeExecAmount(new MesPakinReportParam.NoQrCodeExecAmount(agvWrkDetl.getAnfme(),agvWrkDetl.getUnit(),null));
+
+ doHttpRequest(mesPakinReportParam,getMesTokenInfo(),"涓婃姤mes鍗曟嵁淇℃伅",url,orderReportPath,null,"127.0.0.1");
+ }
+
+ }
+
+ private void reportMesPakoutOrder(AgvWrkMast agvWrkMast, List<AgvWrkDetl> agvWrkDetls){
+ for (AgvWrkDetl agvWrkDetl : agvWrkDetls){
+ MesPakoutReportParam mesPakoutReportParam = new MesPakoutReportParam();
+ mesPakoutReportParam.setStorageCode(agvWrkMast.getLocNo());
+ AgvLocMast agvLocMast = agvLocMastService.selectById(agvWrkMast.getLocNo());
+ mesPakoutReportParam.setWareHouseCode(agvLocMast.getPltType().toString());
+ mesPakoutReportParam.setMaterialCode(agvWrkDetl.getMatnr());
+ mesPakoutReportParam.setBatchNos(Arrays.asList(agvWrkDetl.getBatch()));
+ mesPakoutReportParam.setAmount(new MesPakoutReportParam.Amount(agvWrkDetl.getAnfme(),agvWrkDetl.getUnit(),null));
+
+ doHttpRequest(mesPakoutReportParam,getMesTokenInfo(),"涓婃姤mes鍗曟嵁淇℃伅",url,orderReportPath,null,"127.0.0.1");
+
+ }
+ }
+
+ private MesOrderReportParam generateMesParam(AgvWrkMast agvWrkMast, List<AgvWrkDetl> agvWrkDetls){
if(agvWrkMast.getIoType() == 53){
String locNo = agvWrkMast.getLocNo();
--
Gitblit v1.9.1