This commit is contained in:
张江玮
2023-11-16 14:24:28 +08:00
parent d99febf9c7
commit 1a075dd83c
13 changed files with 25 additions and 31 deletions

View File

@@ -1305,16 +1305,17 @@ public class DashboardService {
JSONArray mixProduction = new JSONArray();
result.put("mixProduction", mixProduction);
List<JSONObject> mixTodayProduction = todayWorkOrderProduction.stream().filter(o -> Region.HL.value().equals(((JSONObject) o).getString("region_code"))).map(o -> (JSONObject) o).collect(Collectors.toList());
HashMap<String, Double> mixMaterialYield = new HashMap<>();
HashMap<String, JSONObject> mixMaterialYield = new HashMap<>();
for (JSONObject row : mixTodayProduction) {
mixMaterialYield.merge(row.getString("material_name"), row.getDoubleValue("weight"), Double::sum);
}
for (Map.Entry<String, Double> entry : mixMaterialYield.entrySet()) {
JSONObject row = new JSONObject();
row.put("name", entry.getKey());
row.put("value", entry.getValue());
mixProduction.add(row);
JSONObject temp = new JSONObject();
temp.put("name", row.getString("material_name"));
temp.put("value", row.getDoubleValue("weight"));
mixMaterialYield.merge(row.getString("material_id"), temp, (o1, o2) -> {
o1.put("value", o1.getDoubleValue("value") + o2.getDoubleValue("value"));
return o1;
});
}
mixProduction.addAll(mixMaterialYield.values());
// 在制品设备生产量------------------------------------------------------------------------------------------------
JSONObject pressProduction = new JSONObject();
@@ -1787,8 +1788,8 @@ public class DashboardService {
private int agvStatusToDictStatus(int status) {
switch (status) {
case 2:
return 1;
case 4:
return 1;
case 7:
return 2;
case 0:

View File

@@ -65,6 +65,7 @@
wo.plan_qty,
wo.plan_weight,
mb.material_name,
mb.material_id,
d.device_name
FROM
pdm_bd_work_order_daily wod
@@ -230,7 +231,7 @@
LEFT JOIN pdm_bd_work_order_daily wod ON wo.workorder_id = wod.workorder_id
WHERE
wo.is_delete = '0'
AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DATE(wo.create_time)
AND wo.order_status <> '5'
GROUP BY
wo.workorder_id
ENDSELECT

View File

@@ -42,7 +42,7 @@ public class HLCallEmptyTask extends AbstractAcsTask {
JSONObject work_order = form.getJSONObject("workorder");
int priority = 1;
if (ObjectUtil.isNotEmpty(work_order)) {
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 100 : 1;
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 4 : 1;
}
JSONObject task = TaskUtils.buildTask(

View File

@@ -43,7 +43,7 @@ public class YZCallEmptyTask extends AbstractAcsTask {
int priority = 1;
String materialId = null;
if (ObjectUtil.isNotEmpty(workOrder)) {
priority = TrueOrFalse.trueOrFalse(workOrder.getString("is_urgent")) ? 100 : 1;
priority = TrueOrFalse.trueOrFalse(workOrder.getString("is_urgent")) ? 4 : 1;
materialId = workOrder.getString("material_id");
}

View File

@@ -53,7 +53,7 @@ public class FJCallMaterialTask extends AbstractAcsTask {
workorder.getString("material_id"),
VehicleType.STEEL_TRAY.value(),
null,
TrueOrFalse.trueOrFalse(workorder.getString("is_urgent")) ? 100 : 1,
TrueOrFalse.trueOrFalse(workorder.getString("is_urgent")) ? 4 : 1,
FJCallMaterialTask.class.getName(),
form.getString("create_mode"),
form.getString("request_param"),

View File

@@ -77,7 +77,7 @@ public class GZCallMaterialTask extends AbstractAcsTask {
task.put("group_id", point1.getString("vd_id"));
task.put("remark", "");
if (TrueOrFalse.TRUE.value().equals(point1.getString("is_urgent"))) {
task.put("priority", 100);
task.put("priority", 4);
}
JSONObject point_update = new JSONObject();

View File

@@ -52,7 +52,7 @@ public class YZCallMaterialTask extends AbstractAcsTask {
workorder.getString("material_id"),
VehicleType.CUP.value(),
null,
TrueOrFalse.trueOrFalse(workorder.getString("is_urgent")) ? 100 : 1,
TrueOrFalse.trueOrFalse(workorder.getString("is_urgent")) ? 4 : 1,
YZCallMaterialTask.class.getName(),
form.getString("create_mode"),
form.getString("request_param"),
@@ -67,14 +67,6 @@ public class YZCallMaterialTask extends AbstractAcsTask {
.addParam("device_code", workorder.getString("device_code"))
.process()
.uniqueResult(0);
if (ObjectUtil.isEmpty(point1)) {
point1 = WQL
.getWO("CALL_MATERIAL_TASK")
.addParam("flag", "4")
.addParam("material_id", task.getString("material_id"))
.process()
.uniqueResult(0);
}
if (ObjectUtil.isNotEmpty(point1)) {
point.put("lock_type", LockType.TASK_LOCKED.value());

View File

@@ -101,9 +101,9 @@
p.is_used = '1'
AND p.lock_type = '1'
AND p.region_code = 'KLHJ'
AND p.point_type = '3'
AND p.point_type IN ('1', '3')
AND p.point_status = '3'
AND p.device_code = 输入.device_code
AND (p.device_code = 输入.device_code OR p.point_type = '1')
AND p.vehicle_type = '1'
AND vd.material_id = 输入.material_id
AND vd.stand_status IN ('2', '3')

View File

@@ -42,7 +42,7 @@ public class FJSendEmptyTask extends AbstractAcsTask {
JSONObject work_order = form.getJSONObject("workorder");
int priority = 1;
if (ObjectUtil.isNotEmpty(work_order)) {
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 100 : 1;
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 4 : 1;
}
JSONObject task = TaskUtils.buildTask(

View File

@@ -42,7 +42,7 @@ public class YZSendEmptyTask extends AbstractAcsTask {
JSONObject work_order = form.getJSONObject("workorder");
int priority = 1;
if (ObjectUtil.isNotEmpty(work_order)) {
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 100 : 1;
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 4 : 1;
}
String vehicleCode = TaskUtils.formatVehicleCode(point.getString("vehicle_code"));

View File

@@ -54,7 +54,7 @@ public class GZSendMaterialTask extends AbstractAcsTask {
vd.getString("material_id"),
vd.getString("vehicle_type"),
vd.getString("vehicle_code"),
TrueOrFalse.trueOrFalse(workOrder.getString("is_urgent")) ? 100 : 1,
TrueOrFalse.trueOrFalse(workOrder.getString("is_urgent")) ? 4 : 1,
GZSendMaterialTask.class.getName(),
form.getString("create_mode"),
form.getString("request_param"),

View File

@@ -44,7 +44,7 @@ public class HLSendMaterialTask extends AbstractAcsTask {
public String createTask(JSONObject form) {
JSONObject point = form.getJSONObject("point");
JSONObject work_order = form.getJSONObject("workorder");
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 100 : 1;
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 4 : 1;
JSONObject vd = form.getJSONObject("vd");
JSONObject task = TaskUtils.buildTask(

View File

@@ -42,7 +42,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
public String createTask(JSONObject form) {
JSONObject point = form.getJSONObject("point");
JSONObject work_order = form.getJSONObject("workorder");
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 100 : 1;
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 4 : 1;
JSONObject vd = form.getJSONObject("vd");
JSONObject task = TaskUtils.buildTask(
@@ -89,7 +89,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
JSONObject task = tasks.getJSONObject(i);
JSONObject point = null;
if (100 == task.getIntValue("priority")) {
if (task.getIntValue("priority") > 1) {
point = WQL
.getWO("SEND_MATERIAL_TASK")
.addParam("flag", "7")