Commit a6d2d05d zshaohui

盘点数据优化

bug修改
1 个父辈 6fb330ee
...@@ -558,9 +558,12 @@ public class BarcodeRule { ...@@ -558,9 +558,12 @@ public class BarcodeRule {
} }
if(batch_item.hasThisField()){ if(batch_item.hasThisField()){
String batch = batch_item.getStrValue(codeArr); String batch = batch_item.getStrValue(codeArr);
if (batch.indexOf("-") != -1){ if (batch.indexOf("-") == -1){
batch = batch.substring(0,batch.lastIndexOf("-")); log.info("条码解析失败,BATCH字段不合规则");
codeBean.setError("smfcore.error.barcode.noField",new String[]{"BATCH"},"条码解析失败,未找到{0}字段");
return codeBean;
} }
batch = batch.substring(0,batch.lastIndexOf("-"));
b.setBatch(batch); b.setBatch(batch);
} }
int quantity = 0; int quantity = 0;
...@@ -612,9 +615,12 @@ public class BarcodeRule { ...@@ -612,9 +615,12 @@ public class BarcodeRule {
if (dateCode_item.hasThisField()){ if (dateCode_item.hasThisField()){
String dateCode = dateCode_item.getStrValue(codeArr); String dateCode = dateCode_item.getStrValue(codeArr);
if (dateCode.indexOf("-") != -1){ if (dateCode.indexOf("-") == -1){
dateCode = dateCode.substring(dateCode.lastIndexOf("-")+1); log.info("条码解析失败,DATECODE字段不合规则");
codeBean.setError("smfcore.error.barcode.noField",new String[]{"DATECODE"},"条码解析失败,未找到{0}字段");
return codeBean;
} }
dateCode = dateCode.substring(dateCode.lastIndexOf("-")+1);
b.setDateCode(dateCode); b.setDateCode(dateCode);
} }
......
...@@ -365,6 +365,7 @@ public class DeviceController { ...@@ -365,6 +365,7 @@ public class DeviceController {
for (ReelLockPosInfo lockPosInfo : copyList) { for (ReelLockPosInfo lockPosInfo : copyList) {
if (System.currentTimeMillis() - lockPosInfo.getCreateDate().getTime() >= 1000 * 60 * 60) { if (System.currentTimeMillis() - lockPosInfo.getCreateDate().getTime() >= 1000 * 60 * 60) {
ReelLockPosUtil.removeReelLockPosInfo(lockPosInfo.getBarcode()); ReelLockPosUtil.removeReelLockPosInfo(lockPosInfo.getBarcode());
log.info(lockPosInfo.getBarcode()+"锁定时间超过1小时,解除锁定:"+lockPosInfo.getCreateDate());
} }
} }
return resultMap; return resultMap;
......
...@@ -15,6 +15,11 @@ import java.util.List; ...@@ -15,6 +15,11 @@ import java.util.List;
public class InventoryData extends BasePo { public class InventoryData extends BasePo {
/** /**
* 原始库位
*/
private String oriPosName;
/**
* 料箱号 * 料箱号
*/ */
private String box; private String box;
...@@ -77,13 +82,17 @@ public class InventoryData extends BasePo { ...@@ -77,13 +82,17 @@ public class InventoryData extends BasePo {
/** /**
* 盘点批次 * 盘点批次
*/ */
private Long inventoryBatch; private String inventoryBatch;
/** /**
* 盘点的barcode集合 * 盘点的barcode集合
*/ */
private List<Barcode> barcodeList; private List<Barcode> barcodeList;
/**
* 是否需要盘点,默认false
*/
private boolean needInventory = false;
public synchronized void updateBarcodeList(Barcode barcode) { public synchronized void updateBarcodeList(Barcode barcode) {
if (barcodeList == null) { if (barcodeList == null) {
......
...@@ -65,8 +65,11 @@ public class BoxUtil { ...@@ -65,8 +65,11 @@ public class BoxUtil {
* @return * @return
*/ */
public static int getPartitionNum(String partition, List<Barcode> subCodeList) { public static int getPartitionNum(String partition, List<Barcode> subCodeList) {
int num = subCodeList.stream().filter(item -> partition.equals(item.getPosName())).mapToInt(Barcode::getAmount).sum(); if (subCodeList != null && !subCodeList.isEmpty()) {
return num; int num = subCodeList.stream().filter(item -> partition.equals(item.getPosName())).mapToInt(Barcode::getAmount).sum();
return num;
}
return 0;
} }
...@@ -97,8 +100,11 @@ public class BoxUtil { ...@@ -97,8 +100,11 @@ public class BoxUtil {
* @return * @return
*/ */
public static int getPartitionCount(String partition, List<Barcode> subCodeList) { public static int getPartitionCount(String partition, List<Barcode> subCodeList) {
int partitionCount = (int) subCodeList.stream().filter(item -> partition.equals(item.getPosName())).count(); if (subCodeList != null && !subCodeList.isEmpty()) {
return partitionCount; int partitionCount = (int) subCodeList.stream().filter(item -> partition.equals(item.getPosName())).count();
return partitionCount;
}
return 0;
} }
/** /**
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!