Commit 42e47a46 zshaohui

1.料串和出库的物料进行绑定,返回给流水线

1 个父辈 3a946d8c
...@@ -673,10 +673,10 @@ public class CDeviceController { ...@@ -673,10 +673,10 @@ public class CDeviceController {
if (StringUtils.isNotEmpty(targetLoc)){ if (StringUtils.isNotEmpty(targetLoc)){
if (targetLoc.endsWith("BG")){ if (targetLoc.endsWith("BG")){
log.info("自动绑定料串["+materialStr+"]目的地:C2-3F-BG"); log.info("自动绑定料串["+materialStr+"]目的地:C2-3F-BG");
MaterialLocUtil.updateStackerLoc(materialStr,"", "C2-3F-BG",1,orderItem.getOrderNo()); MaterialLocUtil.updateStackerLoc(materialStr,"", "C2-3F-BG",1,orderItem.getOrderNo(),barcode);
} else if (targetLoc.endsWith("CG")){ } else if (targetLoc.endsWith("CG")){
log.info("自动绑定料串["+materialStr+"]目的地:C2-3F-CG"); log.info("自动绑定料串["+materialStr+"]目的地:C2-3F-CG");
MaterialLocUtil.updateStackerLoc(materialStr,"", "C2-3F-CG",1,orderItem.getOrderNo()); MaterialLocUtil.updateStackerLoc(materialStr,"", "C2-3F-CG",1,orderItem.getOrderNo(),barcode);
} }
} }
...@@ -1372,10 +1372,10 @@ public class CDeviceController { ...@@ -1372,10 +1372,10 @@ public class CDeviceController {
if (StringUtils.isNotEmpty(targetLoc)) { if (StringUtils.isNotEmpty(targetLoc)) {
if (targetLoc.endsWith("BG")) { if (targetLoc.endsWith("BG")) {
log.info("自动绑定料串[" + stacker + "]目的地:C2-3F-BG"); log.info("自动绑定料串[" + stacker + "]目的地:C2-3F-BG");
MaterialLocUtil.updateStackerLoc(stacker, "", "C2-3F-BG", 1, orderItem.getOrderNo()); MaterialLocUtil.updateStackerLoc(stacker, "", "C2-3F-BG", 1, orderItem.getOrderNo(),barcode);
} else if (targetLoc.endsWith("CG")) { } else if (targetLoc.endsWith("CG")) {
log.info("自动绑定料串[" + stacker + "]目的地:C2-3F-CG"); log.info("自动绑定料串[" + stacker + "]目的地:C2-3F-CG");
MaterialLocUtil.updateStackerLoc(stacker, "", "C2-3F-CG", 1, orderItem.getOrderNo()); MaterialLocUtil.updateStackerLoc(stacker, "", "C2-3F-CG", 1, orderItem.getOrderNo(),barcode);
} }
} }
...@@ -1562,7 +1562,7 @@ public class CDeviceController { ...@@ -1562,7 +1562,7 @@ public class CDeviceController {
//kafkaService.sendMachineParameterStackerAndBox(stacker, "", 0, "", 0, 6); //kafkaService.sendMachineParameterStackerAndBox(stacker, "", 0, "", 0, 6);
log.info("料串["+stacker+"]是否放满:["+isFull+"]"); log.info("料串["+stacker+"]是否放满:["+isFull+"]");
int status = isFull ? 2 : 1; int status = isFull ? 2 : 1;
MaterialLocUtil.updateStackerLoc(stacker,"","",status,""); MaterialLocUtil.updateStackerLoc(stacker,"","",status,"",null);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
......
...@@ -37,7 +37,7 @@ public class MaterialRestController { ...@@ -37,7 +37,7 @@ public class MaterialRestController {
String materialStr = paramMap.get("materialStr"); String materialStr = paramMap.get("materialStr");
String loc = paramMap.get("loc"); String loc = paramMap.get("loc");
log.info("收到料串位置更新,料串为:"+materialStr+",位置为:"+loc); log.info("收到料串位置更新,料串为:"+materialStr+",位置为:"+loc);
MaterialLocUtil.updateStackerLoc(materialStr,loc,null,-1,""); MaterialLocUtil.updateStackerLoc(materialStr,loc,null,-1,"",null);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
...@@ -81,7 +81,7 @@ public class MaterialRestController { ...@@ -81,7 +81,7 @@ public class MaterialRestController {
} }
} }
log.info("手动绑定料串["+stackerCode+"]目的地:" + destination); log.info("手动绑定料串["+stackerCode+"]目的地:" + destination);
MaterialLocUtil.updateStackerLoc(stackerCode,"", destination,2,""); MaterialLocUtil.updateStackerLoc(stackerCode,"", destination,2,"",null);
return ResultBean.newOkResult("绑定成功"); return ResultBean.newOkResult("绑定成功");
} }
...@@ -114,7 +114,7 @@ public class MaterialRestController { ...@@ -114,7 +114,7 @@ public class MaterialRestController {
log.info("获取料串信息:" + JSON.toJSONString(paramMap)); log.info("获取料串信息:" + JSON.toJSONString(paramMap));
String stacker = paramMap.get("stacker"); String stacker = paramMap.get("stacker");
MaterialLoc materialLoc = MaterialLocUtil.getStacker(stacker); MaterialLoc materialLoc = MaterialLocUtil.getStacker(stacker);
Map<String,String> resultMap = new HashMap<>(); Map<String,Object> resultMap = new HashMap<>();
resultMap.put("stacker",stacker); resultMap.put("stacker",stacker);
String destination = materialLoc.getDestination(); String destination = materialLoc.getDestination();
...@@ -124,6 +124,7 @@ public class MaterialRestController { ...@@ -124,6 +124,7 @@ public class MaterialRestController {
resultMap.put("destination",destination); resultMap.put("destination",destination);
resultMap.put("orderNo",materialLoc.getOrderNo()); resultMap.put("orderNo",materialLoc.getOrderNo());
resultMap.put("executingOrderNo",liteOrderCache.hasExecutingOrder()); resultMap.put("executingOrderNo",liteOrderCache.hasExecutingOrder());
resultMap.put("reelList",materialLoc.getReelList());
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(resultMap);
} }
} }
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
public class MaterialLoc { public class MaterialLoc {
...@@ -41,6 +42,9 @@ public class MaterialLoc { ...@@ -41,6 +42,9 @@ public class MaterialLoc {
private int status = 0; private int status = 0;
private List<Map<String, Object>> reelList = new ArrayList<>();
private Date createDate = new Date(); private Date createDate = new Date();
private Date updateDate = new Date(); private Date updateDate = new Date();
......
...@@ -42,7 +42,7 @@ public class MaterialLocUtil { ...@@ -42,7 +42,7 @@ public class MaterialLocUtil {
/** /**
* 更新料串位置或目的地 * 更新料串位置或目的地
*/ */
public static synchronized void updateStackerLoc(String stackerCode, String loc, String destination,int isFull,String orderNo){ public static synchronized void updateStackerLoc(String stackerCode, String loc, String destination,int isFull,String orderNo,Barcode barcode){
log.info("更新料串["+stackerCode+"]位置为["+loc+"] 目的地为:["+destination+"]"); log.info("更新料串["+stackerCode+"]位置为["+loc+"] 目的地为:["+destination+"]");
MaterialLoc materialLoc = stackerLocMap.get(stackerCode); MaterialLoc materialLoc = stackerLocMap.get(stackerCode);
if (materialLoc == null) { if (materialLoc == null) {
...@@ -73,6 +73,19 @@ public class MaterialLocUtil { ...@@ -73,6 +73,19 @@ public class MaterialLocUtil {
materialLoc.setUpdateDate(new Date()); materialLoc.setUpdateDate(new Date());
if (barcode != null) {
List<Map<String, Object>> reelList = materialLoc.getReelList();
if (reelList == null || reelList.isEmpty()){
reelList = new ArrayList<>();
}
Map<String,Object> reelMap = new HashMap<>();
reelMap.put("barcode",barcode.getBarcode());
reelMap.put("partNumber",barcode.getPartNumber());
reelMap.put("checkOutDate",new Date());
reelList.add(reelMap);
materialLoc.setReelList(reelList);
}
stackerLocMap.put(stackerCode, materialLoc); stackerLocMap.put(stackerCode, materialLoc);
dataCache.updateCache(CACHE_STACKER_LOC, stackerLocMap); dataCache.updateCache(CACHE_STACKER_LOC, stackerLocMap);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!