Commit e230cfd4 张少辉

1.电子仓对接momo功能

1 个父辈 569043b0
......@@ -744,6 +744,11 @@ public class BaseDeviceHandler implements IDeviceHandler {
//二维码状态
Barcode barcode = barcodeManager.findByBarcode(task.getBarcode());
if (barcode != null) {
task.setStockoutNo(barcode.getStockoutNo());
barcode.setStockoutNoLine("");
barcode.setLastStockOutNum("");
barcode.setStockoutNo("");
barcode.setNeedStockNum(0);
barcode.setUsedCount(barcode.getUsedCount() + 1);
barcode.setPutInTime(System.currentTimeMillis());
barcode.updateSluggishTime(dataCache.getPNsluggishDay(barcode.getPartNumber()));
......
......@@ -77,8 +77,8 @@ public class XLRBoxHandler extends BaseDeviceHandler {
} else if (BOX_STATUS.OUT_FINISHED == status) {//出仓完成
finishedOutPos(statusBean.getCid(),posName,barcode,executeTime,OP_STATUS.OUT_BOX);
} else if (BOX_STATUS.OUT_END == status) {//出库完成(放到仓门口
log.info(statusBean.getCid() +"将物料从库位["+posName+"]出库到门口/料串完成");
reelOnShelf(statusBean.getCid(),posName);
/*log.info(statusBean.getCid() +"将物料从库位["+posName+"]出库到门口/料串完成");
reelOnShelf(statusBean.getCid(),posName);*/
}
}
} catch (ValidateException e) {
......
......@@ -9,6 +9,7 @@ import com.google.common.collect.Maps;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.service.po.Component;
......@@ -22,6 +23,7 @@ import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.storage.bean.InventoryItem;
import com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE;
import com.neotel.smfcore.core.storage.enums.COMPATIBLE_TYPE;
import com.neotel.smfcore.core.storage.enums.CORRESPONDING_WAREHOUSE;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.rest.dto.InventoryItemDto;
import com.neotel.smfcore.core.storage.rest.query.InventoryQueryCriteria;
......@@ -743,6 +745,12 @@ public class DataCache {
//入库单处理
if (ObjectUtil.isNotEmpty(storage.getInListName())) {
inListCache.UpdateInList(storage.getInListName(), pos, barcode);
} else {
if (storage.getCorrespondingWarehouse() == CORRESPONDING_WAREHOUSE.ELECTRONIC_WAREHOUSE){
if (StringUtils.isNotEmpty(barcode.getReceiptOrder())){
inListCache.UpdateInList(barcode.getReceiptOrder(), pos, barcode);
}
}
}
updateInOutData(cid, storage.getId(), 1);
}
......@@ -1020,4 +1028,12 @@ public class DataCache {
}
return list;
}
public boolean isElectronicWarehouseDocking() {
Boolean ddocking = getCache(Constants.Cache_Electronic_Warehouse_Docking);
if (ddocking == null) {
ddocking = false;
}
return ddocking;
}
}
......@@ -115,6 +115,7 @@ public class InListCache {
}
}else if(item.getRi().equals(barcode.getBarcode())){
item.addReelInfo(new ItemReelInfo(barcode.getBarcode(), barcode.getAmount(), new Date(), pos.getPosName()));
item.setNum(item.getInNum());
listItemManager.save(item);
log.info("UpdateInList 成功: 入库单[" + inListName + "]posName[" + pos.getPosName() + "]PN[" + barcode.getPartNumber() + "]RI[" + barcode.getBarcode() + "]num[" + barcode.getAmount() + "]");
updateOk = true;
......@@ -135,8 +136,8 @@ public class InListCache {
inList.setStatus(INLIST_STATUS.OK);
log.info("UpdateInList 入库单[" + inListName + "]更改状态为:OK");
} else if (!listOk && updateOk) {
inList.setStatus(INLIST_STATUS.ABNORMAL);
log.info("UpdateInList 入库单[" + inListName + "]更改状态为:ABNORMAL");
//inList.setStatus(INLIST_STATUS.ABNORMAL);
//log.info("UpdateInList 入库单[" + inListName + "]更改状态为:ABNORMAL");
}
listManager.save(inList);
addInListToMap(inList);
......
......@@ -267,6 +267,8 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
private String currentLoc;
private String stockoutNo = "";
public String getBarcode() {
if(barcode == null){
return "";
......
......@@ -58,13 +58,45 @@ public class MomoApi extends BaseSmfApiListener {
String storageId = task.getStorageId();
Storage storage = dataCache.getStorageById(storageId);
if (storage != null) {
String barcodeStr = task.getBarcode();
Barcode barcode = barcodeManager.findByBarcode(barcodeStr);
//默认结构仓的
if (storage.getCorrespondingWarehouse() == CORRESPONDING_WAREHOUSE.STRUCTURAL_WAREHOUSE) {
String barcodeStr = task.getBarcode();
Barcode barcode = barcodeManager.findByBarcode(barcodeStr);
if (storage.getCorrespondingWarehouse() == CORRESPONDING_WAREHOUSE.STRUCTURAL_WAREHOUSE
|| storage.getCorrespondingWarehouse() == CORRESPONDING_WAREHOUSE.ELECTRONIC_WAREHOUSE
) {
String receiptOrder = barcode.getReceiptOrder();
if (StringUtils.isNotEmpty(receiptOrder)) {
stockIn(barcode);
} else {
if (storage.getCorrespondingWarehouse() == CORRESPONDING_WAREHOUSE.ELECTRONIC_WAREHOUSE) {
if (StringUtils.isNotEmpty(task.getStockoutNo())){
stockReturn(barcode);
}
}
}
}
}
}
}
/**
* 接口5:MOM接收WMS的出库结果
* @param outNotifyUrl
* @param task
*/
@Override
public void outTaskStatusChange(String outNotifyUrl, DataLog task) {
if (!task.isOutFromPos()) {
String storageId = task.getStorageId();
Storage storage = dataCache.getStorageById(storageId);
if (storage != null) {
//电子仓出库通知
if (storage.getCorrespondingWarehouse() == CORRESPONDING_WAREHOUSE.ELECTRONIC_WAREHOUSE) {
String barcodeStr = task.getBarcode();
Barcode barcode = barcodeManager.findByBarcode(barcodeStr);
String stockoutNo = barcode.getStockoutNo();
if (StringUtils.isNotEmpty(stockoutNo)) {
stockOut(barcode);
}
}
}
......@@ -132,18 +164,6 @@ public class MomoApi extends BaseSmfApiListener {
/**
* 接口5:MOM接收WMS的出库结果
* @param outNotifyUrl
* @param task
*/
@Override
public void outTaskStatusChange(String outNotifyUrl, DataLog task) {
if (!task.isNotifyMomo()) {
}
}
/**
* 接口10:WMS从MOM获取新包装条码
* @param request
* @return
......
......@@ -13,10 +13,15 @@ import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.api.SmfApi;
import com.neotel.smfcore.core.api.bean.CodeValidateParam;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.service.po.Component;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
......@@ -71,6 +76,12 @@ public class ZhongCheDeviceController {
@Autowired
private IAlarmInfoDao alarmInfoDao;
@Autowired
private InListCache inListCache;
@Autowired
private IComponentManager componentManager;
private static String lineMsg = "";
/**
......@@ -291,6 +302,49 @@ public class ZhongCheDeviceController {
}
}
//判断是不是对接momo
boolean isDocking = dataCache.isElectronicWarehouseDocking();
if (isDocking) {
//判断是不是退库操作
if (StringUtils.isEmpty(barcode.getStockoutNo())) {
//判断是否有入库单
Collection<InList> aLlInList = inListCache.getALlInList();
InListItem item = null;
for (InList inList : aLlInList) {
List<InListItem> inListItems = inList.getInListItems();
for (InListItem inListItem : inListItems) {
if (barcode.getBarcode().equals(inListItem.getRi())) {
item = inListItem;
break;
}
}
if (item != null) {
break;
}
}
if (item == null) {
throw new ValidateException("smfcore.noValidInList", "[{0}]入库单中未找到该物料", new String[]{barcode.getBarcode()});
}
if (item.getInNum() >= item.getNum()) {
throw new ValidateException("smfcore.noValidInList", "[{0}]入库单中该物料已入库完成,不能继续入库", new String[]{barcode.getBarcode()});
}
barcode.setReceiptOrder(item.getName());
barcode.setRowNumber(item.getRowNumber());
}
}
//设置元器件中的其他值
Component component = componentManager.findByPartNumberAndProvider(barcode.getPartNumber(), barcode.getProvider());
if(component!=null){
barcode.setDescription(component.getDescription());
barcode.setProviderMaterialCode(component.getProviderMaterialCode());
barcode.setProviderNumber(component.getProviderNumber());
barcode.setContainmentAmount(component.getContainmentAmount());
barcode.setPlant(component.getPlant());
barcode.setOriginalFactory(component.getOriginalFactory());
barcode.setMassProduction(component.getMassProduction());
}
//先移除被锁定的库位
ReelLockPosUtil.removeReelLockPosInfo(barcode.getBarcode());
log.info(barcode.getBarcode() + "料盘重新入库,先移除被锁定的库位");
......@@ -570,6 +624,8 @@ public class ZhongCheDeviceController {
//仓位状态
barcode.setCheckOutDate(new Date(), "");
barcode.setPosName("");
barcode.setReceiptOrder("");
barcode.setRowNumber("");
barcodeManager.save(barcode);
}
}
......@@ -583,11 +639,12 @@ public class ZhongCheDeviceController {
if (status.equals(OP_STATUS.EXECUTING.name())) {
taskService.updateQueueTask(opTask);
} else {
taskService.moveTaskToFinished(opTask);
taskService.updateFinishedTask(opTask);
if (!opTask.isOutFromPos()) {
outFromPos(opTask);
opTask.setOutFromPos(true);
}
taskService.moveTaskToFinished(opTask);
taskService.updateFinishedTask(opTask);
}
return ResultBean.newOkResult("");
......@@ -657,6 +714,7 @@ public class ZhongCheDeviceController {
barcode.setUsed(true);
barcode.setUsedDate(new Date());
barcode.setReceiptOrder("");
//仓位状态
barcode.setCheckOutDate(new Date(), "");
barcode.setPosName("");
......
......@@ -438,4 +438,5 @@ smfcore.receiptOrder.hasFinish=\u4EFB\u52A1\u5355[{0}]\u5BF9\u5E94\u6761\u7801[{
smfcore.component.setMinimumPackagingQuantity=\u8BF7\u8BBE\u7F6E\u6700\u5C0F\u5305\u88C5\u6570\u91CF
smfcore.component.minimumPackagingQuantityError=\u6700\u5C0F\u5305\u88C5\u6570\u91CF[{0}]\u8F93\u5165\u9519\u8BEF
smfcore.momo.newBarcodeContentError=\u83B7\u53D6\u65B0\u7684\u6761\u7801\u5185\u5BB9\u5931\u8D25[{0}]
smfcore.splitContainer.error=\u62C6\u5305\u901A\u77E5\u5931\u8D25[{0}]
\ No newline at end of file
smfcore.splitContainer.error=\u62C6\u5305\u901A\u77E5\u5931\u8D25[{0}]
smfcore.noValidInList=[{0}]\u5165\u5E93\u5355\u4E2D\u672A\u627E\u5230\u8BE5\u7269\u6599
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!