Commit 10cb1e1f zshaohui

1.库存报表优化

2.增加料串获取目的地接口
1 个父辈 6b2c7deb
......@@ -862,7 +862,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
Criteria c = Criteria.where("barcode").exists(true)
.and("enabled").is(true);//可用;
Query query = new Query(c);
query.fields().include("posName").include("storageId").include("barcode.barcode").include("barcode.subCodeList.posName");
query.fields().include("posName").include("storageId").include("barcode.barcode").include("barcode.subCodeList.posName").include("barcode.subCodeList.barcode");
return storagePosDao.findByQuery(query);
}
......
......@@ -35,6 +35,9 @@ public class TaskQueryCondition {
@DateTimeFormat(pattern = "yyyy-MM-dd")
private BetweenData<Date> updateDate;
@QueryCondition(type = QueryCondition.Type.EQ,propName = "sourceName")
private String sourceName;
@QueryCondition
@ApiModelProperty("來源ID")
private String sourceId;
......
......@@ -508,14 +508,16 @@ public class OuterReportController {
}
}*/
//获取隔口信息
if (pos == null){
pos = new StoragePos();
}
Barcode pidBarcode = pos.getBarcode();
if (pidBarcode == null){
pidBarcode = barcodeManager.findByBarcode(newPosName);
}
if (countMap.get(posName) == null) {
if (pos == null){
pos = new StoragePos();
}
Barcode pidBarcode = pos.getBarcode();
if (pidBarcode == null) {
pidBarcode = barcodeManager.findByBarcode(newPosName);
}
if (pidBarcode != null) {
List<Barcode> subCodeList = pidBarcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
......@@ -558,8 +560,8 @@ public class OuterReportController {
dto.setPutInDate(barcode.getPutInDate());
dto.setCreator(barcode.getCreator());
dto.setBarcode(barcode.getBarcode());
dto.setSeq(barcode.getSeq());
int seq = getSeq(pidBarcode,barcode);
dto.setSeq(seq);
long putInTime = barcode.getPutInTime();
if (putInTime != -1){
long inStockDays = DateUtil.betweenDay(new Date(putInTime), new Date(), false);
......@@ -1021,6 +1023,30 @@ public class OuterReportController {
});
}
private int getSeq(Barcode pidBarcode, Barcode barcode) {
int seq = barcode.getSeq();
if (pidBarcode != null) {
List<Barcode> newSubCodeList = new ArrayList<>();
List<Barcode> subCodeList = pidBarcode.getSubCodeList();
for (Barcode subCode : subCodeList) {
if (barcode.getPosName().equals(subCode.getPosName())) {
newSubCodeList.add(subCode);
}
}
if (newSubCodeList != null && !newSubCodeList.isEmpty()) {
newSubCodeList = newSubCodeList.stream().sorted(Comparator.comparing(Barcode::getSeq)).collect(Collectors.toList());
for (int i = 0; i < newSubCodeList.size(); i++) {
Barcode subCode = newSubCodeList.get(i);
if (barcode.getBarcode().equals(subCode.getBarcode())) {
seq = (i + 1);
break;
}
}
}
}
return seq;
}
private List<LiteOrderItem> getLackItems(Collection<LiteOrder> liteOrders, ReportQueryCondition queryCondition) {
List<LiteOrderItem> items = new ArrayList<>();
//开始比较库存
......
......@@ -1653,4 +1653,21 @@ public class CDeviceController {
return ResultBean.newOkResult(full);
}
@ApiOperation("根据料串编号,获取目的地信息")
@RequestMapping("/getStackerDestination")
@AnonymousAccess
public ResultBean getStackerDestination(@RequestBody Map<String, String> paramMap) {
log.info("获取料串信息:" + JSON.toJSONString(paramMap));
String stacker = paramMap.get("stacker");
MaterialLoc materialLoc = MaterialLocUtil.getStacker(stacker);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("stacker", stacker);
String destination = materialLoc.getDestination();
if (StringUtils.isEmpty(destination)) {
destination = "";
}
resultMap.put("destination", destination);
return ResultBean.newOkResult(resultMap);
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!