|
@@ -61,7 +61,7 @@ public class IndexServiceImpl extends ServiceImpl<IndexMapper, Object> implement
|
|
|
String url = "http://mes.cfmfactory.com:8087/MesWeb/planPersonOutAction.do";
|
|
|
Date date = new Date();
|
|
|
|
|
|
- DateTime parse = DateUtil.parse(DateUtil.format(date, "yyyy-MM-dd 7:30:00"));
|
|
|
+ DateTime parse = DateUtil.parse(DateUtil.format(date, "yyyy-MM-dd 7:00:00"));
|
|
|
|
|
|
if (date.compareTo(parse) < 0) {
|
|
|
date = DateUtil.offsetDay(date, -1);
|
|
@@ -120,20 +120,42 @@ public class IndexServiceImpl extends ServiceImpl<IndexMapper, Object> implement
|
|
|
allMaterialList = baseMapper.selectAllMaterialList(query, jobNo);
|
|
|
for (Map<String, Object> material : allMaterialList) {
|
|
|
for (Map<String, Object> stringObjectMap : v3DataList) {
|
|
|
- if (material.get("materialName").toString().startsWith(stringObjectMap.get("name").toString())) {
|
|
|
+ String name = stringObjectMap.get("name").toString();
|
|
|
+
|
|
|
+ if (material.get("materialName").toString().startsWith(name)) {
|
|
|
+
|
|
|
|
|
|
BigDecimal canTakeQty = (BigDecimal) stringObjectMap.get("canTakeQty");
|
|
|
|
|
|
BigDecimal width = floatToBig((Float) material.get("width"));
|
|
|
BigDecimal bigDecimal = new BigDecimal("100");
|
|
|
|
|
|
- BigDecimal userStockQty = (BigDecimal) material.get("userStockQty");
|
|
|
- userStockQty = userStockQty == null ? BigDecimal.ZERO : userStockQty;
|
|
|
+// BigDecimal userStockQty = (BigDecimal) material.get("userStockQty");
|
|
|
+// userStockQty = userStockQty == null ? BigDecimal.ZERO : userStockQty;
|
|
|
+
|
|
|
+ BigDecimal qty;
|
|
|
+ if (date.compareTo(parse) < 0) {
|
|
|
+ qty = baseMapper.getOutMaterial(jobNo, name, DateUtil.offsetDay(parse, -1), parse);
|
|
|
+ } else {
|
|
|
+ qty = baseMapper.getOutMaterial(jobNo, name, parse, date);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- BigDecimal canTakeQtyBD = canTakeQty.subtract(userStockQty.multiply(width).divide(bigDecimal, 2, RoundingMode.HALF_UP))
|
|
|
- .multiply(bigDecimal).divide(width, 2, RoundingMode.HALF_UP);
|
|
|
+ material.put("userStockQty", BigDecimal.ZERO);
|
|
|
|
|
|
- material.put("canTakeQty", canTakeQtyBD.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : canTakeQtyBD);
|
|
|
+ if (width.intValue() == 0) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal canTakeQtyBD = canTakeQty
|
|
|
+// .subtract(userStockQty.multiply(width).divide(bigDecimal, 2, RoundingMode.HALF_UP))
|
|
|
+ .multiply(bigDecimal)
|
|
|
+ .divide(width, 2, RoundingMode.HALF_UP)
|
|
|
+ .subtract(qty);
|
|
|
+
|
|
|
+ material.put("canTakeQty", canTakeQtyBD.compareTo(BigDecimal.ZERO) < 0 ?
|
|
|
+ BigDecimal.ZERO : canTakeQtyBD.multiply(new BigDecimal("1.2"))
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -151,7 +173,6 @@ public class IndexServiceImpl extends ServiceImpl<IndexMapper, Object> implement
|
|
|
}
|
|
|
allMaterialList.addAll(inkList);
|
|
|
|
|
|
-
|
|
|
hashMap.put("list", allMaterialList);
|
|
|
result.put("allMaterialList", hashMap);
|
|
|
|