Commit 117bb03e zshaohui

1.库存报表增加在库天数

2.空箱子也要扫码确认后CTU背上架
1 个父辈 f17665ef
...@@ -781,6 +781,9 @@ public class InventoryController { ...@@ -781,6 +781,9 @@ public class InventoryController {
if (extraDataMap != null && !extraDataMap.isEmpty()){ if (extraDataMap != null && !extraDataMap.isEmpty()){
data.setNeedInventory(true); data.setNeedInventory(true);
} else { } else {
if (StringUtils.isEmpty(partition)){
partition = boxPar;
}
if (partition.equals(boxPar)){ if (partition.equals(boxPar)){
data.setNeedInventory(true); data.setNeedInventory(true);
} else { } else {
......
...@@ -180,6 +180,38 @@ public class BoxUtil { ...@@ -180,6 +180,38 @@ public class BoxUtil {
return infoList; return infoList;
} }
public static void finishInventoryData(String boxStr) {
String inventoryBatch = dataCache.getCache(INVENTORY_DATA) + "";
if (StringUtils.isBlank(inventoryBatch) || "-1".equals(inventoryBatch)) {
return;
}
boolean hasSubBarcode = false;
Barcode barcode = barcodeManager.findByBarcode(boxStr);
if (barcode != null) {
List<Barcode> subCodeList = barcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
hasSubBarcode = true;
}
}
List<InventoryData> dataList = inventoryDataManager.findByQuery(new Query(
Criteria.where("inventoryBatch").is(inventoryBatch).and("box").is(boxStr)));
if (dataList != null && !dataList.isEmpty()) {
for (InventoryData data : dataList) {
if (data.getReelCount() <= 0 || !hasSubBarcode) {
data.setStatus(InventoryStatus.FINISHED.name());
inventoryDataManager.save(data);
}
if (data.getInventoryReelCount() >= data.getReelCount()) {
data.setStatus(InventoryStatus.FINISHED.name());
inventoryDataManager.save(data);
}
}
}
}
/** /**
* 判断是否盘点完成 * 判断是否盘点完成
* @param boxStr * @param boxStr
...@@ -191,18 +223,18 @@ public class BoxUtil { ...@@ -191,18 +223,18 @@ public class BoxUtil {
return true; return true;
} }
boolean hasSubBarcode = false; /*boolean hasSubBarcode = false;
Barcode barcode = barcodeManager.findByBarcode(boxStr); Barcode barcode = barcodeManager.findByBarcode(boxStr);
if(barcode != null){ if(barcode != null){
List<Barcode> subCodeList = barcode.getSubCodeList(); List<Barcode> subCodeList = barcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()){ if (subCodeList != null && !subCodeList.isEmpty()){
hasSubBarcode = true; hasSubBarcode = true;
} }
} }*/
List<InventoryData> dataList = inventoryDataManager.findByQuery(new Query(Criteria.where("inventoryBatch").is(inventoryBatch).and("box").is(boxStr))); List<InventoryData> dataList = inventoryDataManager.findByQuery(new Query(Criteria.where("inventoryBatch").is(inventoryBatch).and("box").is(boxStr)));
if (dataList != null && !dataList.isEmpty()) { if (dataList != null && !dataList.isEmpty()) {
for (InventoryData data : dataList) { /*for (InventoryData data : dataList) {
if (data.getReelCount() <= 0 || !hasSubBarcode){ if (data.getReelCount() <= 0 || !hasSubBarcode){
data.setStatus(InventoryStatus.FINISHED.name()); data.setStatus(InventoryStatus.FINISHED.name());
inventoryDataManager.save(data); inventoryDataManager.save(data);
...@@ -214,13 +246,13 @@ public class BoxUtil { ...@@ -214,13 +246,13 @@ public class BoxUtil {
} }
if (!hasSubBarcode){ if (!hasSubBarcode){
return true; return true;
} }*/
for (InventoryData data : dataList) { for (InventoryData data : dataList) {
if (data.getReelCount() > 0){ //if (data.getReelCount() > 0){
if (!data.getStatus().equals(InventoryStatus.FINISHED.name())) { if (!data.getStatus().equals(InventoryStatus.FINISHED.name())) {
return false; return false;
} }
} //}
} }
} }
return true; return true;
......
...@@ -117,4 +117,6 @@ public class InventoryDto { ...@@ -117,4 +117,6 @@ public class InventoryDto {
* 来源 * 来源
*/ */
private String source; private String source;
private long inStockDays = 0;
} }
...@@ -558,6 +558,10 @@ public class OuterReportController { ...@@ -558,6 +558,10 @@ public class OuterReportController {
dto.setPutInDate(barcode.getPutInDate()); dto.setPutInDate(barcode.getPutInDate());
dto.setCreator(barcode.getCreator()); dto.setCreator(barcode.getCreator());
dto.setBarcode(barcode.getBarcode()); dto.setBarcode(barcode.getBarcode());
long inStockDays = DateUtil.betweenDay(barcode.getPutInDate(), new Date(), false);
dto.setInStockDays(inStockDays);
dtos.add(dto); dtos.add(dto);
} }
} }
...@@ -600,6 +604,7 @@ public class OuterReportController { ...@@ -600,6 +604,7 @@ public class OuterReportController {
header.add(Lists.newArrayList("禁用信息")); header.add(Lists.newArrayList("禁用信息"));
header.add(Lists.newArrayList("首次入库时间")); header.add(Lists.newArrayList("首次入库时间"));
header.add(Lists.newArrayList("当前入库时间")); header.add(Lists.newArrayList("当前入库时间"));
header.add(Lists.newArrayList("在库天数"));
header.add(Lists.newArrayList("工号")); header.add(Lists.newArrayList("工号"));
header.add(Lists.newArrayList("姓名")); header.add(Lists.newArrayList("姓名"));
header.add(Lists.newArrayList("来源")); header.add(Lists.newArrayList("来源"));
...@@ -635,6 +640,7 @@ public class OuterReportController { ...@@ -635,6 +640,7 @@ public class OuterReportController {
result.add(dto.getDisableMsg()); result.add(dto.getDisableMsg());
result.add(dto.getFirstPutInDate()); result.add(dto.getFirstPutInDate());
result.add(dto.getPutInDate()); result.add(dto.getPutInDate());
result.add(dto.getInStockDays());
result.add(dto.getCreator()); result.add(dto.getCreator());
result.add(""); result.add("");
result.add(dto.getSource()); result.add(dto.getSource());
......
...@@ -364,6 +364,8 @@ public class ManualGrPutInController { ...@@ -364,6 +364,8 @@ public class ManualGrPutInController {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.invalid", "条码无效"); return ResultBean.newErrorResult(-1, "smfcore.error.barcode.invalid", "条码无效");
} }
BoxUtil.finishInventoryData(boxStr);
//判断盘点是否完成 //判断盘点是否完成
boolean finished = BoxUtil.isInventoryFinished(boxStr); boolean finished = BoxUtil.isInventoryFinished(boxStr);
if (!finished) { if (!finished) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!