Commit 73004c2a zshaohui

外仓扫码入库校验

1 个父辈 97016b48
......@@ -36,9 +36,9 @@ public class DataLogDaoImpl extends AbstractBaseDao implements IDataLogDao {
}
private List<ChartItem> chart(Date fromTime, Date toTime, int type, String partNumber){
//Date addOneDayToTime = DateUtil.addOneDayNoTime(toTime);
Date addOneDayToTime = DateUtil.addOneDayNoTime(toTime);
Criteria c = new Criteria().andOperator(Criteria.where("updateDate").gte(fromTime),
Criteria.where("updateDate").lt(toTime)).and("type").is(type);
Criteria.where("updateDate").lt(addOneDayToTime)).and("type").is(type);
c.and("status").in(OP_STATUS.END.name(),OP_STATUS.FINISHED.name());
if(Strings.isNotBlank(partNumber)){
c.and("partNumber").is(partNumber);
......
......@@ -363,7 +363,8 @@ public class OutWarehouseController {
}
//判断是否存在其他料箱中
if (StringUtils.isNotBlank(barcode.getPosName())) {
String posName = getPosNameBySubcode(barcode.getBarcode());
if (StringUtils.isNotBlank(posName)) {
return ResultBean.newErrorResult(-1, "", "物料" + barcode.getBarcode() + "已存在料箱:" + barcode.getPosName());
}
......@@ -894,6 +895,7 @@ public class OutWarehouseController {
subBarcode = barcodeManager.save(subBarcode);
}
//更新barcode缓存
log.info(subBarcode.getBarcode()+"的数量为:"+subBarcode.getAmount());
pidBarcode.UpdateSubCode(subBarcode);
if (opType == OP.CHECKOUT && OP_STATUS.FINISHED.name().equals(opStatus)) {
pidBarcode.setAmount(pidBarcode.getAmount() - opQty);
......@@ -908,7 +910,7 @@ public class OutWarehouseController {
pidBarcode.setAmount(pidBarcode.getAmount() + opQty);
pidBarcode.setReelAmount(pidBarcode.getReelAmount() + subBarcode.getReelAmount()); //入库卷数+1
}
pidBarcode = barcodeManager.saveBarcode(pidBarcode);
pidBarcode = barcodeManager.save(pidBarcode);
DataLog task = null;
//先查看是否有相同类型且库位相同的任务
if (currentTask != null) {
......@@ -1129,7 +1131,7 @@ public class OutWarehouseController {
barcodeByOut.setOrderItemId(null);
barcodeByOut = barcodeManager.save(barcodeByOut);
pidBarcode.UpdateSubCode(barcodeByOut);
pidBarcode = barcodeManager.saveBarcode(pidBarcode);
pidBarcode = barcodeManager.save(pidBarcode);
//互换,要出的和隔口中的数据
int amount = barcode.getAmount();
......@@ -1281,4 +1283,25 @@ public class OutWarehouseController {
Pattern pattern = Pattern.compile(QueryHelp.escapeExprSpecialWord(boxStr), Pattern.CASE_INSENSITIVE);
return barcodeManager.findByQuery(new Query(Criteria.where("posName").regex(pattern)));
}
private String getPosNameBySubcode(String barcodeStr) {
String posName = "";
Criteria c = Criteria.where("subCodeList.barcode").is(barcodeStr);
List<Barcode> barcodes = barcodeManager.findByQuery(new Query(c));
if (barcodes != null && !barcodes.isEmpty()) {
for (Barcode barcode : barcodes) {
for (Barcode subCode : barcode.getSubCodeList()) {
if (barcodeStr.equals(subCode.getBarcode())) {
posName = subCode.getPosName();
break;
}
}
if (StringUtils.isNotBlank(posName)) {
break;
}
}
}
return posName;
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!