Commit 05e56ac7 LN

NL料架增加入库单验证

1 个父辈 a824869c
......@@ -9,6 +9,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.api.IOpAuthApi;
import com.neotel.smfcore.core.device.bean.NLShelfOperateBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.storage.enums.DeviceType;
......@@ -48,6 +49,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
@Autowired
private ILiteOrderManager liteOrderManager;
@Autowired
private InListCache inListCache;
@Override
public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) {
......@@ -287,6 +290,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
//入库
NLShelfOperateBean operateBean = getOperateBean(token);
StoragePos opPos = operateBean.getOpPos();
currentStorage=dataCache.getStorageById(opPos.getStorageId());
if (opPos == null) {
//未扫描库位
String operatePosId = operateBean.getNextPosId();
......@@ -297,6 +301,13 @@ public class NLShelfHandler extends BaseDeviceHandler {
//有下一个库位
StoragePos currentPos = storagePosManager.get(String.valueOf(operatePosId));
if (currentPos != null) {
//入库单验证
ResultBean resultBean= inListCache.inListValidate(currentStorage.getInListName(),barcode.getPartNumber() );
if(!resultBean.isOkResult()){
return resultBean;
}
canBarcodePutInPos(currentPos, barcode);
//验证通过,先灭上一个库位灯
closeLastPos(token);
......@@ -324,6 +335,11 @@ public class NLShelfHandler extends BaseDeviceHandler {
}
}
} else {
//入库单验证
ResultBean resultBean= inListCache.inListValidate(currentStorage.getInListName(),barcode.getPartNumber() );
if(!resultBean.isOkResult()){
return resultBean;
}
//已扫过库位
canBarcodePutInPos(opPos, barcode);
log.info(barcode.getPartNumber() + " [ " + barcode.getBarcode() + " ] " + "入库到:" + opPos.getPosName());
......
......@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.common.utils.YmlUpdateUtil;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.language.service.bean.LanguageInfo;
import com.neotel.smfcore.core.language.service.po.LanguageMsg;
import com.neotel.smfcore.core.language.util.MessageUtils;
......@@ -57,6 +58,10 @@ public class DataCache {
@Autowired
private ICacheItemDao cacheItemDao;
@Autowired
private InListCache inListCache;
/**
* 是否需要推送温湿度报警值
*/
......@@ -519,6 +524,11 @@ public class DataCache {
//入库
amount = barcode.getAmount();
storage.useOnePos(pos);
//入库单处理
if(ObjectUtil.isNotEmpty(storage.getInListName())){
inListCache.UpdateInList(storage.getInListName(),pos,barcode);
}
}
allStorage.put(cid, storage);
return updateInventoryAmount(cid,partNumber,amount);
......
......@@ -17,7 +17,7 @@ public class ItemReelInfo implements Serializable {
/**
* 唯一编号
*/
private String RI;
private String ri;
/**
* 入库数量
......
......@@ -22,6 +22,7 @@ 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.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.manager.IStorageManager;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import com.neotel.smfcore.security.bean.FileProperties;
......@@ -66,6 +67,9 @@ public class InListController {
@Autowired
private DataCache dataCache;
@Autowired
private IStorageManager storageManager;
@ApiOperation("上传入库单")
@PostMapping(value = "/upload")
@AnonymousAccess
......@@ -180,6 +184,10 @@ public class InListController {
String inListName = params.get("inListName");
String storageId = params.get("storageId");
String groupId = params.get("groupId");
if(ObjectUtil.isEmpty(inListName)){
}
else {
InList inList = inListCache.getInList(inListName);
if (inList == null) {
return ResultBean.newErrorResult(1, "smfcore.inlist.notFound", "未找到入库单[{0}]", new String[]{inListName});
......@@ -187,6 +195,7 @@ public class InListController {
if (inList.getStatus() == INLIST_STATUS.OK) {
return ResultBean.newErrorResult(1, "smfcore.inlist.listOk", "入库单[{0}]已完成", new String[]{inListName});
}
}
if (ObjectUtil.isEmpty(storageId)) {
List<String> cidList = dataCache.getCidsByGroupId(groupId, false);
......@@ -194,9 +203,11 @@ public class InListController {
for (String cid : cidList) {
Storage storage = dataCache.getStorage(cid);
if (storage != null) {
if (storage.isShelf() || storage.isNLShelf() || storage.isAccShelf() || storage.isCodeShelf()) {
if (storage.isType(new DeviceType[]{DeviceType.NLP,DeviceType.NL})) {
storage.setInListName(inListName);
log.info("设置组[" + groupId + "]料架[" + storage.getName() + "]的入库单为:[" + inListName + "]");
storageManager.save(storage);
dataCache.reloadStorage(storage,storage.getCid());
}
}
......@@ -204,9 +215,11 @@ public class InListController {
} else {
Storage storage = dataCache.getStorageById(storageId);
if (storage != null) {
if (storage.isShelf() || storage.isNLShelf() || storage.isAccShelf() || storage.isCodeShelf()) {
if (storage.isType(new DeviceType[]{DeviceType.NLP,DeviceType.NL})) {
storage.setInListName(inListName);
log.info("设置料架[" + storage.getName() + "]的入库单为:[" + inListName + "]");
storageManager.save(storage);
dataCache.reloadStorage(storage,storage.getCid());
}
}
}
......
......@@ -105,7 +105,12 @@ public enum DeviceType {
NL("storage.type.nl"),
/**
* 17 (默认料仓)
* 17 感应料架NLP
*/
NLP("storage.type.nlp"),
/**
* 18 (默认料仓)
*/
DEFAULT("storage.type.default")
;
......@@ -129,6 +134,6 @@ public enum DeviceType {
}
public static List<DeviceType> availableTypeList(){
return Lists.newArrayList(AUTO,LINE,BATCH,ACCSHELF,CODESHELF,SOLDERPASTE,VERTICALBOX,SMD_XL,SMD_DUO);
return Lists.newArrayList(AUTO,LINE,BATCH,SOLDERPASTE,VERTICALBOX,SMD_XL,SMD_DUO,SMD_XLC,VIRTUAL,NL,NLP);
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!