Commit 81b10db5 zshaohui

1.对接mes系统修改

1 个父辈 a926e363
...@@ -69,14 +69,14 @@ public class SmfApi { ...@@ -69,14 +69,14 @@ public class SmfApi {
public void init(){ public void init(){
apiName = dataCache.getConfigCache("api.name",apiName); apiName = dataCache.getConfigCache("api.name",apiName);
log.info("apiName:" + apiName); log.info("apiName:" + apiName);
inCheckUrl = dataCache.getConfigCache("api.inCheckUrl",inCheckUrl); /* inCheckUrl = dataCache.getConfigCache("api.inCheckUrl",inCheckUrl);
inNotifyUrl = dataCache.getConfigCache("api.inNotifyUrl",inNotifyUrl); inNotifyUrl = dataCache.getConfigCache("api.inNotifyUrl",inNotifyUrl);
outNotifyUrl = dataCache.getConfigCache("api.outNotifyUrl",outNotifyUrl); outNotifyUrl = dataCache.getConfigCache("api.outNotifyUrl",outNotifyUrl);
orderNotifyUrl = dataCache.getConfigCache("api.orderNotifyUrl",orderNotifyUrl); orderNotifyUrl = dataCache.getConfigCache("api.orderNotifyUrl",orderNotifyUrl);
fetchInListUrl = dataCache.getConfigCache("api.fetchInListUrl",fetchInListUrl); fetchInListUrl = dataCache.getConfigCache("api.fetchInListUrl",fetchInListUrl);
fetchOrderUrl = dataCache.getConfigCache("api.fetchOrderUrl",fetchOrderUrl); fetchOrderUrl = dataCache.getConfigCache("api.fetchOrderUrl",fetchOrderUrl);
barcodeInfoUrl = dataCache.getConfigCache("api.barcodeInfoUrl",barcodeInfoUrl); barcodeInfoUrl = dataCache.getConfigCache("api.barcodeInfoUrl",barcodeInfoUrl);
importUrl = dataCache.getConfigCache("api.importUrl",importUrl); importUrl = dataCache.getConfigCache("api.importUrl",importUrl);*/
} }
/** /**
......
...@@ -24,6 +24,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog; ...@@ -24,6 +24,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil; import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.LizhenApi; import com.neotel.smfcore.custom.lizhen.LizhenApi;
import com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest;
import com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.lizhen.innerBox.rest.InnerBoxRestController; import com.neotel.smfcore.custom.lizhen.innerBox.rest.InnerBoxRestController;
import com.neotel.smfcore.security.TokenProvider; import com.neotel.smfcore.security.TokenProvider;
...@@ -428,8 +430,8 @@ public class NLShelfHandler extends BaseDeviceHandler { ...@@ -428,8 +430,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
barcode = lizhenApi.getInDate(barcode); barcode = lizhenApi.getInDate(barcode);
//校验是否可以入库 //校验是否可以入库
Map<String, Object> brandQty = lizhenApi.brandQty(barcode.getPartNumber(), barcode.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(barcode.getPartNumber(), barcode.getProvider()));
if (brandQty == null || brandQty.isEmpty()) { if (brandQtyResult == null) {
throw new ValidateException("smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()}); throw new ValidateException("smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()});
} }
......
...@@ -26,6 +26,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog; ...@@ -26,6 +26,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil; import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.LizhenApi; import com.neotel.smfcore.custom.lizhen.LizhenApi;
import com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest;
import com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import com.neotel.smfcore.core.storage.enums.DeviceType; import com.neotel.smfcore.core.storage.enums.DeviceType;
...@@ -204,8 +206,8 @@ public class DeviceController { ...@@ -204,8 +206,8 @@ public class DeviceController {
} }
} }
//校验是否可以入库 //校验是否可以入库
Map<String, Object> brandQty = lizhenApi.brandQty(barcode.getPartNumber(), barcode.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(barcode.getPartNumber(), barcode.getProvider()));
if (brandQty == null || brandQty.isEmpty()) { if (brandQtyResult == null) {
throw new ValidateException("smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()}); throw new ValidateException("smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()});
} }
Barcode barcodeCanPutIn = smfApi.canPutInAfterResolve(barcode); Barcode barcodeCanPutIn = smfApi.canPutInAfterResolve(barcode);
......
...@@ -537,6 +537,8 @@ public class LiteOrderCache { ...@@ -537,6 +537,8 @@ public class LiteOrderCache {
Collection<String> excludePosIds = excludeOutPosIds(); Collection<String> excludePosIds = excludeOutPosIds();
String partNumber = orderItem.getPn(); String partNumber = orderItem.getPn();
String[] partNumberSpl = partNumber.split(",");
StoragePos pos = null; StoragePos pos = null;
if (cacheOrder.getType() == 2) { if (cacheOrder.getType() == 2) {
//RI //RI
...@@ -550,11 +552,12 @@ public class LiteOrderCache { ...@@ -550,11 +552,12 @@ public class LiteOrderCache {
} else { } else {
//PN //PN
do { do {
for (String pn : partNumberSpl) {
//首先按空闲料仓进行出库 //首先按空闲料仓进行出库
List<StoragePos> storagePosList = storagePosManager.findPartNumberListInStorages(freeStorageIds, partNumber, excludePosIds, checkoutType,orderItem.getBrand()); List<StoragePos> storagePosList = storagePosManager.findPartNumberListInStorages(freeStorageIds, pn, excludePosIds, checkoutType, orderItem.getBrand());
//如果为空的话,则出全部的 //如果为空的话,则出全部的
if (storagePosList == null || storagePosList.isEmpty()) { if (storagePosList == null || storagePosList.isEmpty()) {
storagePosList = storagePosManager.findPartNumberListInStorages(availableStorageIds, partNumber, excludePosIds, checkoutType,orderItem.getBrand()); storagePosList = storagePosManager.findPartNumberListInStorages(availableStorageIds, pn, excludePosIds, checkoutType, orderItem.getBrand());
} }
//排序找到最早的 //排序找到最早的
...@@ -577,6 +580,10 @@ public class LiteOrderCache { ...@@ -577,6 +580,10 @@ public class LiteOrderCache {
} }
} }
} }
if (pos != null) {
break;
}
}
if (pos == null) { if (pos == null) {
break; break;
...@@ -957,13 +964,13 @@ public class LiteOrderCache { ...@@ -957,13 +964,13 @@ public class LiteOrderCache {
if (alreadyCheckBox.contains(barcode.getBarcode())) { if (alreadyCheckBox.contains(barcode.getBarcode())) {
log.info("当前料箱已经校验过:" + barcode.getBarcode()); log.info("当前料箱已经校验过:" + barcode.getBarcode());
} else { } else {
batchCheckList = lizhenApi.batchCheck(subCodeList); batchCheckList = lizhenApi.batchCheckReel(subCodeList,"","");
if (batchCheckList == null || batchCheckList.isEmpty()) { if (batchCheckList == null || batchCheckList.isEmpty()) {
alreadyCheckBox.add(barcode.getBarcode()); alreadyCheckBox.add(barcode.getBarcode());
} }
} }
} else { } else {
batchCheckList = lizhenApi.batchCheck(subCodeList); batchCheckList = lizhenApi.batchCheckReel(subCodeList,"","");
if (batchCheckList == null || batchCheckList.isEmpty()) { if (batchCheckList == null || batchCheckList.isEmpty()) {
alreadyCheckBox.add(barcode.getBarcode()); alreadyCheckBox.add(barcode.getBarcode());
} }
......
...@@ -151,6 +151,8 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -151,6 +151,8 @@ public class LiteOrder extends BasePo implements Serializable {
*/ */
private Date finishDate; private Date finishDate;
private boolean differenceReq = false;
public void setClosed(boolean value){ public void setClosed(boolean value){
this.closed=value; this.closed=value;
......
...@@ -219,6 +219,17 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li ...@@ -219,6 +219,17 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
*/ */
private Date issuanceDate; private Date issuanceDate;
private String station;
private String pickingId;
private String rowId;
private int itemNo;
private String model;
/** /**
* 出库是否满足要求,已出库数量大于需求数量 * 出库是否满足要求,已出库数量大于需求数量
*/ */
......
package com.neotel.smfcore.custom.lizhen;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.order.service.po.LiteOrderItem;
import com.neotel.smfcore.custom.lizhen.bean.DifferentMaterial;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@RestController
public class DifferenceReelController {
@Autowired
private ILiteOrderManager liteOrderManager;
@Autowired
private LiteOrderCache liteOrderCache;
@ApiOperation("工单差异料上传")
@RequestMapping("/api/Mes/differenceReel")
@AnonymousAccess
public synchronized String differenceReel(@RequestBody List<DifferentMaterial> differentMaterialList) {
log.info("收到mes的差异料数据为:" + JSONObject.toJSONString(differentMaterialList));
List<LiteOrderItem> itemList = new ArrayList<>();
for (DifferentMaterial differentMaterial : differentMaterialList) {
String wo = differentMaterial.getWo();
String mc = differentMaterial.getMc();
String ipn = differentMaterial.getIpn();
if (StringUtils.isEmpty(ipn)){
continue;
}
String zone = differentMaterial.getZone();
String gidLineSide = differentMaterial.getGidLineSide();
String[] gidLineSideS = gidLineSide.split("_");
if (gidLineSideS.length < 3){
return gidLineSide+"格式不正确";
}
String line = gidLineSideS[0];
String side = gidLineSideS[2];
LiteOrderItem item = new LiteOrderItem();
item.setMo(wo);
item.setMachineName(mc);
item.setPn(ipn);
item.setStation(zone);
item.setTableNo(zone);
item.setLine(line);
item.setSide(side);
item.setNeedNum(1);
item.setNeedReelCount(1);
itemList.add(item);
}
if (itemList != null && !itemList.isEmpty()){
Map<String, List<LiteOrderItem>> itemMap = itemList.stream().collect(Collectors.groupingBy(LiteOrderItem::getLine));
for (String line : itemMap.keySet()) {
List<LiteOrderItem> item = itemMap.get(line);
LiteOrder liteOrder = new LiteOrder();
liteOrder.setOrderNo(System.currentTimeMillis()+"差异料");
liteOrder.setLine(line);
liteOrder.setTotalTaskReelCount(item.size());
liteOrder.setOrderItems(item);
liteOrder.setDifferenceReq(true);
liteOrder = liteOrderManager.createWithItems(liteOrder);
liteOrderCache.addOrderToMap(liteOrder);
}
}
return "";
}
}
package com.neotel.smfcore.custom.lizhen; package com.neotel.smfcore.custom.lizhen;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ApiException; import com.neotel.smfcore.common.exception.ApiException;
...@@ -14,6 +16,7 @@ import com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE; ...@@ -14,6 +16,7 @@ import com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager; import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
import com.neotel.smfcore.core.order.service.po.LiteOrder; import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.order.service.po.LiteOrderItem; import com.neotel.smfcore.core.order.service.po.LiteOrderItem;
import com.neotel.smfcore.custom.lizhen.bean.ManualTower;
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.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
...@@ -194,26 +197,113 @@ public class LizhenController { ...@@ -194,26 +197,113 @@ public class LizhenController {
@AnonymousAccess @AnonymousAccess
public ResultBean machineCallMaterial(@RequestBody Map<String, String> data) { public ResultBean machineCallMaterial(@RequestBody Map<String, String> data) {
boolean startJob = dataCache.getCache(Constants.CACHE_StartJob); boolean startJob = dataCache.getCache(Constants.CACHE_StartJob);
if (!startJob){ if (!startJob) {
return ResultBean.newErrorResult(-1,"","定时任务未开启"); return ResultBean.newErrorResult(-1, "", "定时任务未开启",new String[]{},false);
} }
log.info("Mes缺料预警---" + JSONObject.toJSONString(data)); //log.info("Mes缺料预警---" + JSONObject.toJSONString(data));
PreWarningItem item = new PreWarningItem(); PreWarningItem item = new PreWarningItem();
item.setMachinename(data.get("MACHINENAME")); item.setMachinename(data.get("MACHINE_NAME"));
item.setStation(data.get("STATION")); item.setStation(data.get("MACHINE"));
item.setSide(data.get("SIDE")); item.setSide(data.get("FACE"));
item.setSlot(data.get("SLOT")); item.setSlot(data.get("SLOT"));
item.setSubslot(data.get("SUBSLOT")); item.setSubslot(data.get("SUBSLOT"));
item.setPartnumber(data.get("PARTNUMBER")); item.setPartnumber(data.get("MATERIAL_CODE"));
item.setLine(data.get("LINE")); item.setLine(data.get("LINE"));
item.setItemId(data.get("ID")); item.setItemId(data.get("ID"));
item.setPickingId(data.get("PICKING_ID"));
String mo = data.get("MO");
item.setMo(mo);
try {
item.setItemNo(Integer.valueOf(data.get("ITEM_NO")));
item.setPriority(Integer.valueOf(data.get("PRIORITY"))); item.setPriority(Integer.valueOf(data.get("PRIORITY")));
} catch (NumberFormatException e) {
e.printStackTrace();
item.setPriority(0);
item.setItemNo(1);
}
item.setReel(data.get("REEL")); item.setReel(data.get("REEL"));
item.setBrand(data.get("VENDOR")); String brand = data.get("VENDOR");
if (StringUtils.isEmpty(brand)){
brand = data.get("BRAND");
}
item.setBrand(brand);
if (StringUtils.isBlank(item.getSide())){
log.info("缺料预警id:"+item.getItemId()+"面别为空,忽略");
return ResultBean.newErrorResult(-1,"","side为空");
}
PreWarningItemCache.addItems(Arrays.asList(item)); PreWarningItemCache.addItems(Arrays.asList(item));
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
@ApiOperation("Tower接收手动发料信息")
@RequestMapping("/manualTower")
@AnonymousAccess
public Map<String, String> manualTower(@RequestBody JSONObject jsonObject) {
log.info("收到WMS手动发料数据为:" + JSON.toJSONString(jsonObject));
Map<String, String> resultMap = new HashMap<>();
String pickingId = jsonObject.getString("PICKING_ID");
String data = jsonObject.getString("DATA");
List<ManualTower> manualTowerList = JSONArray.parseArray(data, ManualTower.class);
if (StringUtils.isEmpty(pickingId) || manualTowerList == null || manualTowerList.isEmpty()){
resultMap.put("MSGTY", "E");
resultMap.put("MSGTX", "请核实参数是否为空");
return resultMap;
}
LiteOrder liteOrder = liteOrderManager.findByOrderNo(pickingId);
if (liteOrder == null){
String line = "";
List<LiteOrderItem> itemList = new ArrayList<>();
for (ManualTower manualTower : manualTowerList) {
LiteOrderItem item = new LiteOrderItem();
item.setPn(manualTower.getMATERIAL_CODE());
item.setNeedReelCount(manualTower.getREQ_REEL() == 0 ? 1 : manualTower.getREQ_REEL());
item.setNeedNum(manualTower.getREQ_QTY());
item.setSide(manualTower.getFACE());
item.setBrand(manualTower.getBRAND());
item.setLine(manualTower.getLINE());
if (StringUtils.isEmpty(line)){
line = manualTower.getLINE();
}
item.setPickingId(pickingId);
item.setRowId(manualTower.getROW_ID());
item.setItemNo(manualTower.getITEM_NO());
item.setTableNo(manualTower.getMACHINE());
item.setMo(manualTower.getMO());
item.setSlot(manualTower.getSLOT());
item.setSubSlot(manualTower.getSUBSLOT());
item.setBatchCode(manualTower.getBATCH_CODE());
item.setModel(manualTower.getMODEL());
item.setWarningItemId(manualTower.getITEM_NO()+"");
item.setMachineName(manualTower.getMACHINE_NAME());
itemList.add(item);
}
liteOrder = new LiteOrder();
liteOrder.setOrderNo(pickingId);
liteOrder.setLine(line);
liteOrder.setOrderItems(itemList);
liteOrder = liteOrderManager.createWithItems(liteOrder);
liteOrderCache.addOrderToMap(liteOrder);
resultMap.put("MSGTY", "S");
resultMap.put("MSGTX", "接收成功");
} else {
resultMap.put("MSGTY", "E");
resultMap.put("MSGTX", pickingId+"已经存在");
}
return resultMap;
}
private String getForwardUrl(String line) { private String getForwardUrl(String line) {
String url = ""; String url = "";
......
...@@ -30,6 +30,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.bean.query.InventoryQuery; ...@@ -30,6 +30,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.bean.query.InventoryQuery;
import com.neotel.smfcore.custom.lizhen.agvBox.service.manager.InventoryDataManager; import com.neotel.smfcore.custom.lizhen.agvBox.service.manager.InventoryDataManager;
import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil; import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil;
import com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil; import com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil;
import com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest;
import com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -625,8 +627,8 @@ public class InventoryController { ...@@ -625,8 +627,8 @@ public class InventoryController {
return barcode.getBarcode() + "存在料箱中:" + barcode.getPosName() + "与当前工位上的料箱:" + boxStr + "不一致"; return barcode.getBarcode() + "存在料箱中:" + barcode.getPosName() + "与当前工位上的料箱:" + boxStr + "不一致";
} }
//判断料号是否正确 //判断料号是否正确
Map<String, Object> barandMap = lizhenApi.brandQty(barcode.getPartNumber(), barcode.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(barcode.getPartNumber(), barcode.getProvider()));
if (barandMap.get("qty") == null) { if (brandQtyResult == null) {
return barcode.getPartNumber() + "MES未返回料卷数量,未找到对应的料卷数量"; return barcode.getPartNumber() + "MES未返回料卷数量,未找到对应的料卷数量";
} }
log.info(barcode.getBarcode() + "隔口信息:" + barcode.getPosName()); log.info(barcode.getBarcode() + "隔口信息:" + barcode.getPosName());
......
...@@ -27,6 +27,8 @@ import com.neotel.smfcore.core.system.util.TaskService; ...@@ -27,6 +27,8 @@ import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.LizhenApi; import com.neotel.smfcore.custom.lizhen.LizhenApi;
import com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE; import com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE;
import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil; import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil;
import com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest;
import com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -246,8 +248,8 @@ public class OutLineController { ...@@ -246,8 +248,8 @@ public class OutLineController {
} }
//校验是否可以入库 //校验是否可以入库
Map<String, Object> brandQty = lizhenApi.brandQty(barcode.getPartNumber(), barcode.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(barcode.getPartNumber(), barcode.getProvider()));
if (brandQty == null || brandQty.isEmpty()) { if (brandQtyResult == null) {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()}); return ResultBean.newErrorResult(-1, "smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()});
} }
......
...@@ -28,6 +28,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE; ...@@ -28,6 +28,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE;
import com.neotel.smfcore.custom.lizhen.agvBox.service.manager.GrLabelManager; import com.neotel.smfcore.custom.lizhen.agvBox.service.manager.GrLabelManager;
import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil; import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil;
import com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil; import com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil;
import com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest;
import com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -115,23 +117,23 @@ public class WarehouseController { ...@@ -115,23 +117,23 @@ public class WarehouseController {
return ResultBean.newErrorResult(-1, "", "Gr:" + grLabel.getLabelId() + "已经失效"); return ResultBean.newErrorResult(-1, "", "Gr:" + grLabel.getLabelId() + "已经失效");
} }
//得到料卷总数量与尺寸 //得到料卷总数量与尺寸
Map<String, Object> barandMap = lizhenApi.brandQty(grLabel.getPartNumber(), grLabel.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(grLabel.getPartNumber(), grLabel.getProvider()));
if (barandMap.get("qty") == null) { if (brandQtyResult == null) {
return ResultBean.newErrorResult(-1, "", grLabel.getPartNumber() + "MES未返回料卷数量,未找到对应的料卷数量"); return ResultBean.newErrorResult(-1, "", grLabel.getPartNumber() + "MES未返回料卷数量,未找到对应的料卷数量");
} }
num = (grLabel.getRemainingAmount() / Integer.valueOf(barandMap.get("qty").toString())) + ""; num = (grLabel.getRemainingAmount() / brandQtyResult.getQty()) + "";
//校验尺寸,如果没有返回也没有手输,返回错误 //校验尺寸,如果没有返回也没有手输,返回错误
if (barandMap.get("reelSize") == null) { if (brandQtyResult.getReel_size() == 0) {
if (StringUtils.isBlank(size)) { if (StringUtils.isBlank(size)) {
return ResultBean.newErrorResult(-1, "", grLabel.getPartNumber() + "MES未返回物料规格,请选择对应的物料规格"); return ResultBean.newErrorResult(-1, "", grLabel.getPartNumber() + "MES未返回物料规格,请选择对应的物料规格");
} }
} else { } else {
String reelSize = barandMap.get("reelSize").toString(); int reelSize = brandQtyResult.getReel_size();
if ("7".equals(reelSize)) { if (7 == reelSize) {
size = "7X8"; size = "7X8";
} /*else if ("13".equals(reelSize)) { } /*else if ("13".equals(reelSize)) {
size = "13X24"; size = "13X24";
} */else if ("15".equals(reelSize)) { } */else if (15 == reelSize) {
size = "15X32"; size = "15X32";
} }
} }
...@@ -402,8 +404,8 @@ public class WarehouseController { ...@@ -402,8 +404,8 @@ public class WarehouseController {
} }
//校验是否可以入库 //校验是否可以入库
Map<String, Object> brandQty = lizhenApi.brandQty(barcode.getPartNumber(), barcode.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(barcode.getPartNumber(), barcode.getProvider()));
if (brandQty == null || brandQty.isEmpty()) { if (brandQtyResult == null) {
return ResultBean.newErrorResult(-1,"smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()}); return ResultBean.newErrorResult(-1,"smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()});
} }
......
package com.neotel.smfcore.custom.lizhen.bean;
import lombok.Data;
@Data
public class DifferentMaterial {
/**
* wo;//工单
* mc;//机台
* ipn;//物料
* zone;//站位
* gidLineSide;//线_Line_面
*/
private String wo;
private String mc;
private String ipn;
private String zone;
private String gidLineSide;
/*
[
{
"wo": "030000248583",
"mc": "NPM-2",
"ipn": "377S00070",
"zone": "1-07-L",
"gidLineSide": "A05-5FRF-01_1A_B"
},
{
"wo": "030000248583",
"mc": "NPM-2",
"ipn": "117S00069$YA0A01B5",
"zone": "1-08-L",
"gidLineSide": "A05-5FRF-01_1A_B"
},
{
"wo": "030000248583",
"mc": "NPM-2",
"ipn": "N/A",
"zone": "1-10",
"gidLineSide": "A05-5FRF-01_1B_T"
}
]
*/
}
package com.neotel.smfcore.custom.lizhen.bean;
import lombok.Data;
@Data
public class ManualTower {
private String ROW_ID; // 假设这是一个唯一标识符,可以使用String
private int ITEM_NO; // 项目号,使用int,如果可能超出int范围,则使用long
private String PLANT_CODE; // 工厂代码
private String MATERIAL_CODE; // 料号
private String LINE; // 线别
private String MACHINE_NAME; // 机台名
private String MACHINE; // 机台(可能与MACHINE_NAME重复,但保持原样)
private String FACE; // 面别
private String SLOT; // 料站
private String SUBSLOT; // 左右料站
private String MO; // 工单
private String BRAND; // 制造商
private String BATCH_CODE; // 批次号
private int LEFT_QTY; // 剩余数量,使用int,根据需求调整
private int LEFT_PCBS; // 剩余板数
private int LEFT_TIMES; // 剩余时间,根据时间单位可能需要调整为long或特定时间类型
private int PRIORITY; // 优先级
private int PRODUCT_BOARDS; // 主板数
private String STATUS; // 状态,如果状态值很多且有具体含义,考虑使用枚举
private String MACHINE_TYPE; // 机台类型
private String RECIEVE_TYPE; // 接收类型,注意拼写错误,应为RECEIVE_TYPE
private String PITCH; // 摊位
private double TAP_LENGTH; // 料盘长度,假设需要较高的精度
private int REQ_REEL; // 需求卷数
private int REQ_QTY; // 需求数量
private String MODEL; // 机种
}
...@@ -30,6 +30,10 @@ public class PreWarningItem extends BasePo { ...@@ -30,6 +30,10 @@ public class PreWarningItem extends BasePo {
private String itemId; private String itemId;
private String reel; private String reel;
private String brand; private String brand;
private String pickingId;
private String mo;
private int itemNo;
/** /**
* 优先级,1:人工 0:机器 * 优先级,1:人工 0:机器
*/ */
......
...@@ -26,6 +26,8 @@ import com.neotel.smfcore.core.system.service.manager.IDataLogManager; ...@@ -26,6 +26,8 @@ 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.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.LizhenApi; import com.neotel.smfcore.custom.lizhen.LizhenApi;
import com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest;
import com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.VirImportLog; import com.neotel.smfcore.custom.lizhen.innerBox.bean.VirImportLog;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.lizhen.innerBox.service.manager.IVirImportLogManager; import com.neotel.smfcore.custom.lizhen.innerBox.service.manager.IVirImportLogManager;
...@@ -127,8 +129,8 @@ public class VirtualRestController { ...@@ -127,8 +129,8 @@ public class VirtualRestController {
} }
//校验是否可以入库 //校验是否可以入库
Map<String, Object> brandQty = lizhenApi.brandQty(barcode.getPartNumber(), barcode.getProvider()); BrandQtyResult brandQtyResult = lizhenApi.brandQty(new BrandQtyRequest(barcode.getPartNumber(), barcode.getProvider()));
if (brandQty == null || brandQty.isEmpty()) { if (brandQtyResult == null) {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()}); return ResultBean.newErrorResult(-1, "smfcore.error.barcode.partNumber.invalid", "{0}不是有效的料号", new String[]{barcode.getPartNumber()});
} }
......
package com.neotel.smfcore.custom.lizhen.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class CommonUtil {
public static String plantCode;
@Value("${api.plantCode}")
private void setPlantCode(String code){
CommonUtil.plantCode = code;
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!