Commit add365d1 孙克

料仓接收WMS手动发料

1 个父辈 e8f5a976
package com.neotel.smfcore.custom.lizhen; package com.neotel.smfcore.custom.lizhen;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
...@@ -22,6 +24,9 @@ import com.neotel.smfcore.core.system.service.manager.IDataLogManager; ...@@ -22,6 +24,9 @@ import com.neotel.smfcore.core.system.service.manager.IDataLogManager;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem; import com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem;
import com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache; import com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache;
import com.neotel.smfcore.custom.lizhen.innerBox.util.StorageExportUtil;
import com.neotel.smfcore.custom.lizhen.third.maicheng.bean.AskReelBox;
import com.neotel.smfcore.custom.lizhen.third.maicheng.bean.AskReelBoxList;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -251,6 +256,124 @@ public class LizhenController { ...@@ -251,6 +256,124 @@ public class LizhenController {
return ResultBean.newErrorResult(-1,"","未找到相关信息"); return ResultBean.newErrorResult(-1,"","未找到相关信息");
} }
/**
* "[
* {
* ""ID"": ""L2BG-TOPTX2I-01122A1179700152231SDUQ"",
* ""WORKORDERNO"": ""030000478352"",
* ""LINE"": ""A05-5FSMT-12S"",
* ""MACHINENAME"": ""L2BG-TOP"",
* ""STATION"": ""01_1"",
* ""SIDE"": ""T"",
* ""SLOT"": ""22"",
* ""SUBSLOT"": ""L"",
* ""PARTNUMBER"": ""117S00067"",
* ""LEFTQTY"": ""9003"",
* ""LEFTPCBS"": ""204"",
* ""LEFTTIMES"": ""57"",
* ""PRIORITY"": ""0"",
* ""OP"": """",
* ""PRODUCTBOARDS"": ""204"",
* ""REEL"": ""A1179700152231SDUQ"",
* ""STATUS"": ""MACHINECALL"",
* ""MACHINETYPE"": ""ASM"",
* ""RECIEVETYPE"": ""NEW"",
* ""VENDOR"": """",
* ""PITCH"": ""2"",
* ""TAPLENGTH"": null,
* ""REQ_REEL"": 2,
* ""REQ_QTY"": 1000,
* },
* {
* ""ID"": ""L2BG-TOPTX2I-02131A1179700104231UMAZ"",
* ""WORKORDERNO"": ""030000478352"",
* ""LINE"": ""A05-5FSMT-12S"",
* ""MACHINENAME"": ""L2BG-TOP"",
* ""STATION"": ""02_1"",
* ""SIDE"": ""T"",
* ""SLOT"": ""31"",
* ""SUBSLOT"": ""L"",
* ""PARTNUMBER"": ""117S00067"",
* ""LEFTQTY"": ""19016"",
* ""LEFTPCBS"": ""121"",
* ""LEFTTIMES"": ""34"",
* ""PRIORITY"": ""0"",
* ""OP"": """",
* ""PRODUCTBOARDS"": ""121"",
* ""REEL"": ""A1179700104231UMAZ"",
* ""STATUS"": ""MACHINECALL"",
* ""MACHINETYPE"": ""ASM"",
* ""RECIEVETYPE"": ""DOUBLE"",
* ""VENDOR"": """",
* ""PITCH"": ""2"",
* ""TAPLENGTH"": null,
* ""REQ_REEL"": 2,
* ""REQ_QTY"": 1000,
* }
* ]"
* @return
*
* "{
* ""MSGTY"": ""S"",
* ""MSGTX"": ""接收成功""
* }"
*/
@ApiOperation("Tower接收手动发料信息")
@RequestMapping("/manualTower")
@AnonymousAccess
public Map<String, String> manualTower(@RequestBody List<AskReelBoxList> itemList) {
log.info("收到WMS手动发料数据为:" + JSON.toJSONString(itemList));
createManualOrder(itemList);
Map<String, String> resultMap = new HashMap<>();
resultMap.put("MSGTY", "S");
resultMap.put("MSGTX", "接收成功");
return resultMap;
}
private String createManualOrder(List<AskReelBoxList> itemList) {
Map<String, LiteOrder> orderMap = new HashMap<>();
for (AskReelBoxList askItem : itemList) {
String orderNo = askItem.getWORKORDERNO();
LiteOrder order = orderMap.get(orderNo);
if(order == null){
order = new LiteOrder();
order.setOrderNo(askItem.getWORKORDERNO());
order.setLine(askItem.getLINE());
order = liteOrderManager.save(order);
}
LiteOrderItem orderItem = new LiteOrderItem();
orderItem.setLine(askItem.getLINE());
orderItem.setWarningItemId(askItem.getID());
orderItem.setMo(askItem.getWORKORDERNO());
int needReelCount = NumberUtil.parseInt(askItem.getREQ_REEL());
orderItem.setNeedReelCount(needReelCount);
int needNum = NumberUtil.parseInt(askItem.getREQ_QTY());
orderItem.setNeedNum(needNum);
orderItem.setMachineName(askItem.getMACHINENAME());
orderItem.setPn(askItem.getPARTNUMBER());
orderItem.setSide(askItem.getSIDE()); //设置面别
orderItem.setSlot(askItem.getSLOT()); //站位
orderItem.setSubSlot(askItem.getSUBSLOT());
orderItem.setTableNo(askItem.getSTATION());
orderItem.setOrderNo(order.getOrderNo());
orderItem.setOrderId(order.getId());
orderItem.setMachineName(askItem.getMACHINENAME());
orderItem.setReel(askItem.getREEL());
orderItem.setBrand(askItem.getVENDOR());
orderItem.setWidth(askItem.getWidth());
orderItem.setDia(askItem.getDia());
order.updateOrderItems(orderItem);
}
for (LiteOrder liteOrder : orderMap.values()) {
liteOrderManager.save(liteOrder);
liteOrderCache.addOrderToMap(liteOrder);
log.info("工单["+liteOrder.getOrderNo()+"]已创建完成");
}
return "OK";
}
......
...@@ -28,4 +28,6 @@ public class AskReelBoxList { ...@@ -28,4 +28,6 @@ public class AskReelBoxList {
private String Num; private String Num;
private String Width; private String Width;
private String Dia; private String Dia;
private String REQ_REEL;
private String REQ_QTY;
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!