fix 大屏手持窑后流程更新
This commit is contained in:
@@ -86,4 +86,14 @@ public class AgvDto implements Serializable {
|
||||
*/
|
||||
private String type = "AGV";
|
||||
|
||||
/**
|
||||
* 1号车当日完成任务数量
|
||||
*/
|
||||
private Integer finishnumber1 = 0;
|
||||
|
||||
/**
|
||||
* 2号车当日完成任务数量
|
||||
*/
|
||||
private Integer finishnumber2 = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package org.nl.acs.device_driver.basedriver.standard_inspect_site;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -14,6 +16,7 @@ import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -31,6 +34,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -57,6 +61,8 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
String last_container_type_desc;
|
||||
@@ -136,12 +142,10 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
|
||||
mode = this.itemProtocol.getMode();
|
||||
move = this.itemProtocol.getMove();
|
||||
error = this.itemProtocol.getError();
|
||||
task = this.itemProtocol.getTask();
|
||||
|
||||
if (mode != last_mode) {
|
||||
// this.setRequireSucess(false);
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
@@ -164,6 +168,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
return;
|
||||
}
|
||||
|
||||
//未在线无心跳
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
@@ -183,13 +188,15 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
return;
|
||||
case 2:
|
||||
break;
|
||||
case 5:
|
||||
// 优先出窑位任务
|
||||
if (!requireSucess && task != 0) {
|
||||
this.outKilnyx();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,6 +262,42 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
server.disconnect();
|
||||
|
||||
}
|
||||
/**
|
||||
* 优先出窑位申请任务
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public synchronized boolean outKilnyx() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code",device_code);
|
||||
param.put("vehicle_code", task);
|
||||
HttpResponse result = acsToWmsService.outKiln(param);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
if (result.getStatus() == HttpStatus.OK.value()) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) {
|
||||
Boolean isPackage = jsonObject.getBoolean("data");
|
||||
if (isPackage == null) {
|
||||
this.writing(24);
|
||||
} else {
|
||||
// this.writing(isPackage ? 22 : 23);
|
||||
//全部都是优先出窑
|
||||
this.writing(22);
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void executing(Server server, Map<String, Object> itemMap) {
|
||||
ReadUtil.write(itemMap, server, 0);
|
||||
|
||||
@@ -265,6 +265,7 @@ public class LnshOutKilnTrussDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
this.instruction_require_time = date;
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code",device_code);
|
||||
param.put("vehicle_code", outKiln_barcode);
|
||||
param.put("cool_number", cool_number);
|
||||
HttpResponse result = acsToWmsService.outKiln(param);
|
||||
@@ -276,7 +277,9 @@ public class LnshOutKilnTrussDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
if (isPackage == null) {
|
||||
this.writing(24);
|
||||
} else {
|
||||
this.writing(isPackage ? 22 : 23);
|
||||
// this.writing(isPackage ? 22 : 23);
|
||||
//全部都是优先出窑
|
||||
this.writing(22);
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
}
|
||||
|
||||
@@ -685,8 +685,8 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_unqualified_qty, "不合格数量", "DB3.W70"));
|
||||
|
||||
list.add(new ItemDto(item_product_code, "产品编号", "DB3.W72"));
|
||||
list.add(new ItemDto(item_AlongSide, "A长边", "DB3.W74"));
|
||||
list.add(new ItemDto(item_BshortSide, "B短边", "DB3.W76"));
|
||||
list.add(new ItemDto(item_AlongSide, "单重", "DB3.W74"));
|
||||
list.add(new ItemDto(item_BshortSide, "今天完成托数", "DB3.W76"));
|
||||
list.add(new ItemDto(item_Htrapezoidal, "H梯形高", "DB3.W78"));
|
||||
list.add(new ItemDto(item_Wthickness, "W厚度", "DB3.W80"));
|
||||
list.add(new ItemDto(item_tray_qty, "当前垛盘数", "DB3.W82"));
|
||||
|
||||
@@ -986,7 +986,8 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
json.put("type", "1");
|
||||
json.put("material_code", material);
|
||||
json.put("vehicle_code", barcode);
|
||||
json.put("qty", encoder_qty);
|
||||
int encoder_qty1=encoder_qty-1;
|
||||
json.put("qty", encoder_qty1);
|
||||
json.put("is_full", "1");
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
|
||||
@@ -498,8 +498,16 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
status.put("weight", driver.getWeight());
|
||||
status.put("material", driver.getMaterial());
|
||||
status.put("barcode", driver.getBarcode());
|
||||
status.put("unqualified_qty", driver.getUnqualified_qty());
|
||||
status.put("encoder_qty", driver.getEncoder_qty());
|
||||
status.put("qty", driver.getEncoder_qty()-1);
|
||||
if(driver.getAlongSide()!=0) {
|
||||
Integer dz=driver.getAlongSide();
|
||||
double weight=dz/1000.00;
|
||||
String weight1 = String.format("%.2f", weight);
|
||||
status.put("AlongSide", weight1);
|
||||
}else{
|
||||
status.put("AlongSide",0);
|
||||
}
|
||||
status.put("BshortSide", driver.getBshortSide());
|
||||
} else if (deviceDriver instanceof LnshKilnTrussDeviceDriver) {
|
||||
LnshKilnTrussDeviceDriver driver = (LnshKilnTrussDeviceDriver) deviceDriver;
|
||||
status.put("mode", driver.getMode());
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -984,8 +985,30 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
//电量
|
||||
else if (phase == 0x73) {
|
||||
AgvDto agv = ndcAGVService.findByCarNumber(String.valueOf(arr[18] * 256 + arr[19]));
|
||||
agv.setEnergyLevel(String.valueOf(ikey));
|
||||
try {
|
||||
int carno1 = 0;
|
||||
int carno2 = 0;
|
||||
JSONArray taskfinish = WQLObject.getWQLObject("acs_instruction").query("instruction_status = '2' AND TO_DAYS (create_time) = TO_DAYS (NOW())").getResultJSONArray(0);
|
||||
if(!taskfinish.isEmpty()) {
|
||||
for (int i = 0; i < taskfinish.size(); i++) {
|
||||
JSONObject instruction = taskfinish.getJSONObject(i);
|
||||
if (!StrUtil.isBlank(instruction.getString("carno"))) {
|
||||
String carnotoday = instruction.getString("carno");
|
||||
if (carnotoday.equals("1")) {
|
||||
carno1 = carno1 + 1;
|
||||
} else if (carnotoday.equals("2")) {
|
||||
carno2 = carno2 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
AgvDto agv = ndcAGVService.findByCarNumber(String.valueOf(arr[18] * 256 + arr[19]));
|
||||
agv.setEnergyLevel(String.valueOf(ikey));
|
||||
agv.setFinishnumber1(carno1);
|
||||
agv.setFinishnumber2(carno2);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("记录每日车辆工作量出错!", e);
|
||||
}
|
||||
} else if (phase == 0x74) {
|
||||
// 状态
|
||||
AgvDto agv = ndcAGVService.findByCarNumber(String.valueOf(arr[18] * 256 + arr[19]));
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.eum.StandStatus;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.manage.PointStatus;
|
||||
@@ -16,6 +17,7 @@ import org.nl.wms.sch.manage.Region;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.annotation.WebFilter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -36,72 +38,114 @@ public class DashboardService {
|
||||
public JSONObject homepageData() {
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
// 当前设备情况---------------------------------------------------------------------------------------------------
|
||||
JSONObject currentEquipmentCondition = new JSONObject();
|
||||
result.put("currentEquipmentCondition", currentEquipmentCondition);
|
||||
// 初始化 0
|
||||
currentEquipmentCondition.put("running", 0);
|
||||
currentEquipmentCondition.put("pausing", 0);
|
||||
currentEquipmentCondition.put("shutdown", 0);
|
||||
currentEquipmentCondition.put("inTrouble", 0);
|
||||
// 真实获取
|
||||
JSONObject acsResult = wmsToAcsService.getDeviceStatus(WQLObject.getWQLObject("pdm_bi_device").query().getResultJSONArray(0));
|
||||
if (acsResult.getIntValue("status") == HttpStatus.OK.value()) {
|
||||
JSONArray data = acsResult.getJSONArray("data");
|
||||
|
||||
currentEquipmentCondition.put("running", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 2).count());
|
||||
currentEquipmentCondition.put("pausing", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 1).count());
|
||||
currentEquipmentCondition.put("shutdown", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 0).count());
|
||||
currentEquipmentCondition.put("inTrouble", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 3).count());
|
||||
}
|
||||
|
||||
// 每月故障统计---------------------------------------------------------------------------------------------------
|
||||
JSONObject monthlyFailureStatistics = new JSONObject();
|
||||
result.put("monthlyFailureStatistics", monthlyFailureStatistics);
|
||||
|
||||
// 故障次数
|
||||
JSONObject currentMonth = new JSONObject();
|
||||
monthlyFailureStatistics.put("currentMonth", currentMonth);
|
||||
// 初始化 0
|
||||
currentMonth.put("mix", 0);
|
||||
currentMonth.put("press", 0);
|
||||
currentMonth.put("dry", 0);
|
||||
currentMonth.put("sort", 0);
|
||||
// // 当前设备情况---------------------------------------------------------------------------------------------------
|
||||
// JSONObject currentEquipmentCondition = new JSONObject();
|
||||
// result.put("currentEquipmentCondition", currentEquipmentCondition);
|
||||
// // 初始化 0
|
||||
// currentEquipmentCondition.put("running", 0);
|
||||
// currentEquipmentCondition.put("pausing", 0);
|
||||
// currentEquipmentCondition.put("shutdown", 0);
|
||||
// currentEquipmentCondition.put("inTrouble", 0);
|
||||
// // 真实获取
|
||||
// JSONObject acsResult = wmsToAcsService.getDeviceStatus(WQLObject.getWQLObject("pdm_bi_device").query().getResultJSONArray(0));
|
||||
// if (acsResult.getIntValue("status") == HttpStatus.OK.value()) {
|
||||
// JSONArray data = acsResult.getJSONArray("data");
|
||||
//
|
||||
// currentEquipmentCondition.put("running", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 2).count());
|
||||
// currentEquipmentCondition.put("pausing", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 1).count());
|
||||
// currentEquipmentCondition.put("shutdown", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 0).count());
|
||||
// currentEquipmentCondition.put("inTrouble", data.stream().filter(o -> ((JSONObject) o).getIntValue("status") == 3).count());
|
||||
// }
|
||||
//
|
||||
// // 每月故障统计---------------------------------------------------------------------------------------------------
|
||||
// JSONObject monthlyFailureStatistics = new JSONObject();
|
||||
// result.put("monthlyFailureStatistics", monthlyFailureStatistics);
|
||||
//
|
||||
// // 故障次数
|
||||
// JSONObject currentMonth = new JSONObject();
|
||||
// monthlyFailureStatistics.put("currentMonth", currentMonth);
|
||||
// // 初始化 0
|
||||
// currentMonth.put("mix", 0);
|
||||
// currentMonth.put("press", 0);
|
||||
// currentMonth.put("dry", 0);
|
||||
// currentMonth.put("sort", 0);
|
||||
// 真实获取
|
||||
JSONArray data = WQL.getWO("DASHBOARD").addParam("flag", "1").process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(data)) {
|
||||
data = new JSONArray();
|
||||
}
|
||||
List<Object> mixData = data.stream().filter(o -> "HL".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
List<Object> pressData = data.stream().filter(o -> "YZ".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
List<Object> dryData = data.stream().filter(o -> "GZ".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
List<Object> sortData = data.stream().filter(o -> "FJ".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
currentMonth.put("mix", mixData.stream().filter(o -> {
|
||||
JSONObject row = (JSONObject) o;
|
||||
return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
}).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
currentMonth.put("press", pressData.stream().filter(o -> {
|
||||
JSONObject row = (JSONObject) o;
|
||||
return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
}).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
currentMonth.put("dry", dryData.stream().filter(o -> {
|
||||
JSONObject row = (JSONObject) o;
|
||||
return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
}).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
currentMonth.put("sort", sortData.stream().filter(o -> {
|
||||
JSONObject row = (JSONObject) o;
|
||||
return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
}).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
// List<Object> mixData = data.stream().filter(o -> "HL".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
// List<Object> pressData = data.stream().filter(o -> "YZ".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
// List<Object> dryData = data.stream().filter(o -> "GZ".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
// List<Object> sortData = data.stream().filter(o -> "FJ".equals(((JSONObject) o).getString("region_code"))).collect(Collectors.toList());
|
||||
// currentMonth.put("mix", mixData.stream().filter(o -> {
|
||||
// JSONObject row = (JSONObject) o;
|
||||
// return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
// }).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
// currentMonth.put("press", pressData.stream().filter(o -> {
|
||||
// JSONObject row = (JSONObject) o;
|
||||
// return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
// }).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
// currentMonth.put("dry", dryData.stream().filter(o -> {
|
||||
// JSONObject row = (JSONObject) o;
|
||||
// return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
// }).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
// currentMonth.put("sort", sortData.stream().filter(o -> {
|
||||
// JSONObject row = (JSONObject) o;
|
||||
// return DateUtil.thisYear() == row.getIntValue("year") && (DateUtil.thisMonth() + 1) == row.getIntValue("month");
|
||||
// }).mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum());
|
||||
//
|
||||
// // 平均次数
|
||||
// JSONObject average = new JSONObject();
|
||||
// monthlyFailureStatistics.put("average", average);
|
||||
// // 真实获取
|
||||
// average.put("mix", mixData.isEmpty() ? 0 : mixData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / mixData.size());
|
||||
// average.put("press", pressData.isEmpty() ? 0 : pressData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / pressData.size());
|
||||
// average.put("dry", dryData.isEmpty() ? 0 : dryData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / dryData.size());
|
||||
// average.put("sort", sortData.isEmpty() ? 0 : sortData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / sortData.size());
|
||||
|
||||
// 平均次数
|
||||
JSONObject average = new JSONObject();
|
||||
monthlyFailureStatistics.put("average", average);
|
||||
// 真实获取
|
||||
average.put("mix", mixData.isEmpty() ? 0 : mixData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / mixData.size());
|
||||
average.put("press", pressData.isEmpty() ? 0 : pressData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / pressData.size());
|
||||
average.put("dry", dryData.isEmpty() ? 0 : dryData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / dryData.size());
|
||||
average.put("sort", sortData.isEmpty() ? 0 : sortData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("count")).sum() / sortData.size());
|
||||
//主要设备运行情况
|
||||
JSONArray mainEquipmentStatus = new JSONArray();
|
||||
JSONArray pointData = wmsToAcsService.getDeviceStatus(WQL.getWO("DASHBOARD").addParam("flag", "3").process().getResultJSONArray(0)).getJSONArray("data");
|
||||
if (ObjectUtil.isEmpty(pointData)) {
|
||||
pointData = new JSONArray();
|
||||
}
|
||||
|
||||
JSONArray deviceData = wmsToAcsService.getDeviceStatus(WQLObject.getWQLObject("pdm_bi_device").query().getResultJSONArray(0)).getJSONArray("data");
|
||||
if (ObjectUtil.isEmpty(deviceData)) {
|
||||
deviceData = new JSONArray();
|
||||
}
|
||||
//混碾机
|
||||
List<JSONObject> mixingMachineData = deviceData.stream().map(o -> (JSONObject) o).filter(o -> "1".equals(o.getString("device_model")) || "2".equals(o.getString("device_model"))).sorted(Comparator.comparingInt(o -> o.getIntValue("productivity"))).collect(Collectors.toList());
|
||||
for (JSONObject datum : mixingMachineData) {
|
||||
JSONObject row = new JSONObject();
|
||||
String device_code=datum.getString("device_code");
|
||||
row.put("devicename", datum.getString("device_name"));
|
||||
int status=datum.getInteger("status");
|
||||
row.put("status", deviceStatusToChinese(status));
|
||||
JSONObject gdxx = WQLObject.getWQLObject("pdm_bd_workorder").query("order_status = '3' AND device_code = '" + device_code + "'").uniqueResult(0);
|
||||
String material_id=gdxx.getString("material_id");
|
||||
JSONObject wlxx = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||
String material_name=wlxx.getString("material_name");
|
||||
row.put("material", material_name);
|
||||
mainEquipmentStatus.add(row);
|
||||
}
|
||||
//压机
|
||||
List<JSONObject> pressMachineData = deviceData.stream().map(o -> (JSONObject) o).filter(o -> "3".equals(o.getString("device_model")) || "4".equals(o.getString("device_model"))).sorted(Comparator.comparingInt(o -> o.getIntValue("productivity"))).collect(Collectors.toList());
|
||||
for (JSONObject datum : pressMachineData) {
|
||||
JSONObject row = new JSONObject();
|
||||
String device_code=datum.getString("device_code");
|
||||
row.put("devicename", datum.getString("device_name"));
|
||||
int status=datum.getInteger("status");
|
||||
row.put("status", deviceStatusToChinese(status));
|
||||
JSONObject gdxx = WQLObject.getWQLObject("pdm_bd_workorder").query("order_status = '3' AND device_code = '" + device_code + "'").uniqueResult(0);
|
||||
String material_id=gdxx.getString("material_id");
|
||||
JSONObject wlxx = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||
String material_name=wlxx.getString("material_name");
|
||||
row.put("material", material_name);
|
||||
mainEquipmentStatus.add(row);
|
||||
}
|
||||
result.put("mainEquipmentStatus",mainEquipmentStatus);
|
||||
// 当日工序生产统计------------------------------------------------------------------------------------------------
|
||||
JSONObject dailyProductionStatistics = new JSONObject();
|
||||
result.put("dailyProductionStatistics", dailyProductionStatistics);
|
||||
@@ -124,10 +168,23 @@ public class DashboardService {
|
||||
dailyProductionStatistics.put("stand", stand);
|
||||
// 当前所有存在的料盅数据
|
||||
JSONArray cupData = WQLObject.getWQLObject("st_ivt_vehicle_detail").query("is_delete = '0' AND vehicle_type = '1'").getResultJSONArray(0);
|
||||
// 处理
|
||||
stand.put("onStanding", String.format("%.2f", cupData.stream().filter(o -> "1".equals(((JSONObject) o).getString("stand_status"))).mapToDouble(o -> ((JSONObject) o).getDoubleValue("weight")).sum() / 1000));
|
||||
stand.put("completed", String.format("%.2f", cupData.stream().filter(o -> "23".contains(((JSONObject) o).getString("stand_status"))).mapToDouble(o -> ((JSONObject) o).getDoubleValue("weight")).sum() / 1000));
|
||||
|
||||
// // 处理
|
||||
// stand.put("onStanding", String.format("%.2f", cupData.stream().filter(o -> "1".equals(((JSONObject) o).getString("stand_status"))).mapToDouble(o -> ((JSONObject) o).getDoubleValue("weight")).sum() / 1000));
|
||||
// stand.put("completed", String.format("%.2f", cupData.stream().filter(o -> "23".contains(((JSONObject) o).getString("stand_status"))).mapToDouble(o -> ((JSONObject) o).getDoubleValue("weight")).sum() / 1000));
|
||||
JSONArray lzjzid= WQLObject.getWQLObject("sch_base_point").query("region_id = '1695713307387891712' AND vd_id !=' '").getResultJSONArray(0);
|
||||
JSONArray resultArray = new JSONArray();
|
||||
for (int i = 0; i < cupData.size(); i++) {
|
||||
JSONObject obj1 = cupData.getJSONObject(i);
|
||||
for (int j = 0; j < lzjzid.size(); j++) {
|
||||
JSONObject obj2 = lzjzid.getJSONObject(j);
|
||||
String value1 = obj1.getString("vd_id");
|
||||
String value2 = obj2.getString("vd_id");
|
||||
if (value1.equals(value2)) {
|
||||
resultArray.add(obj1);
|
||||
}
|
||||
}
|
||||
}
|
||||
stand.put("completed", String.format("%.2f", resultArray.stream().filter(o -> "2".equals(((JSONObject) o).getString("stand_status"))).mapToDouble(o -> ((JSONObject) o).getDoubleValue("weight")).sum() / 1000));
|
||||
// 压制
|
||||
JSONObject press = new JSONObject();
|
||||
dailyProductionStatistics.put("press", press);
|
||||
@@ -138,17 +195,20 @@ public class DashboardService {
|
||||
// 干燥
|
||||
JSONObject dry = new JSONObject();
|
||||
dailyProductionStatistics.put("dry", dry);
|
||||
// 入窑时间为今天的数据
|
||||
JSONArray inKilnData = WQLObject.getWQLObject("st_ivt_vehicle_detail").query("vehicle_type = '2' AND TO_DAYS (in_kiln_time) = TO_DAYS (NOW())").getResultJSONArray(0);
|
||||
// 出窑时间为今天的数据
|
||||
JSONArray outKilnData = WQLObject.getWQLObject("st_ivt_vehicle_detail").query("vehicle_type = '2' AND TO_DAYS (out_kiln_time) = TO_DAYS (NOW())").getResultJSONArray(0);
|
||||
// 处理
|
||||
dry.put("planned", 0);
|
||||
dry.put("planned", String.format("%.2f", inKilnData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("qty")).sum() / 10000.00));
|
||||
dry.put("completed", String.format("%.2f", outKilnData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("qty")).sum() / 10000.00));
|
||||
|
||||
// 分拣
|
||||
JSONObject sort = new JSONObject();
|
||||
dailyProductionStatistics.put("sort", sort);
|
||||
// 真实获取
|
||||
sort.put("planned", String.format("%.2f", data.stream().filter(o -> "FJ".equals(((JSONObject) o).getString("region_code"))).mapToInt(o -> ((JSONObject) o).getIntValue("plan_qty")).sum() / 10000.00));
|
||||
//计划量即为出窑量
|
||||
sort.put("planned", String.format("%.2f", outKilnData.stream().mapToInt(o -> ((JSONObject) o).getIntValue("qty")).sum() / 10000.00));
|
||||
sort.put("completed", String.format("%.2f", data.stream().filter(o -> "FJ".equals(((JSONObject) o).getString("region_code"))).mapToInt(o -> ((JSONObject) o).getIntValue("qty")).sum() / 10000.00));
|
||||
|
||||
// 设备生产统计---------------------------------------------------------------------------------------------------
|
||||
@@ -165,7 +225,10 @@ public class DashboardService {
|
||||
} else {
|
||||
row.put("completed", datum.getIntValue("qty") + "块");
|
||||
}
|
||||
equipmentProductionStatistics.add(row);
|
||||
String equipment=row.getString("equipment");
|
||||
if(ObjectUtil.isNotEmpty(equipment)) {
|
||||
equipmentProductionStatistics.add(row);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -210,13 +273,11 @@ public class DashboardService {
|
||||
String deviceCode = datum.getString("device_code");
|
||||
int deviceStatus = datum.getIntValue("status");
|
||||
List<JSONObject> todayProduction = allDeviceTodayProduction.stream().map(o -> (JSONObject) o).filter(o -> deviceCode.equals(o.getString("device_code"))).collect(Collectors.toList());
|
||||
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("equipment", deviceCode);
|
||||
row.put("status", this.deviceStatusToDictStatus(deviceStatus));
|
||||
row.put("equipmentName", datum.getString("device_name"));
|
||||
row.put("statusChinese", this.deviceStatusToChinese(deviceStatus));
|
||||
|
||||
JSONArray rowData = new JSONArray();
|
||||
row.put("data", rowData);
|
||||
|
||||
@@ -286,30 +347,32 @@ public class DashboardService {
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "物料号");
|
||||
rowDatum.put("value", datum.getString("material_number"));
|
||||
rowDatum.put("key", "点位状态");
|
||||
int move=datum.getIntValue("move");
|
||||
rowDatum.put("value", deviceMoveToChinese(move));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "物料名称");
|
||||
rowDatum.put("value", datum.getString("material_name"));
|
||||
rowData.add(rowDatum);
|
||||
// rowDatum = new JSONObject();
|
||||
// rowDatum.put("key", "物料号");
|
||||
// rowDatum.put("value", datum.getString("material_number"));
|
||||
// rowData.add(rowDatum);
|
||||
//
|
||||
// rowDatum = new JSONObject();
|
||||
// rowDatum.put("key", "物料名称");
|
||||
// rowDatum.put("value", datum.getString("material_name"));
|
||||
// rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "重量");
|
||||
rowDatum.put("value", String.format("%.0f", datum.getDoubleValue("weight")) + "千克");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
String createTime = datum.getString("create_time");
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "组盘时间");
|
||||
rowDatum.put("value", createTime);
|
||||
rowData.add(rowDatum);
|
||||
// String createTime = datum.getString("create_time");
|
||||
// rowDatum = new JSONObject();
|
||||
// rowDatum.put("key", "组盘时间");
|
||||
// rowDatum.put("value", createTime);
|
||||
// rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "已静置时间");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDate(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
unloadLocation.add(row);
|
||||
}
|
||||
@@ -372,7 +435,7 @@ public class DashboardService {
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "已静置时间");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDate(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDateTime(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
storageLocation.add(row);
|
||||
@@ -434,7 +497,7 @@ public class DashboardService {
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "已静置时间");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDate(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDateTime(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
loadLocation.add(row);
|
||||
@@ -561,30 +624,23 @@ public class DashboardService {
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "载具号");
|
||||
rowDatum.put("value", datum.getString("vehicle_code"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "物料号");
|
||||
rowDatum.put("value", datum.getString("material_number"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "物料名称");
|
||||
rowDatum.put("value", datum.getString("material_name"));
|
||||
rowDatum.put("key", "点位状态");
|
||||
int move=datum.getIntValue("move");
|
||||
rowDatum.put("value", deviceYZXLMoveToChinese(move));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "数量");
|
||||
rowDatum.put("value", datum.getIntValue("qty") + "块");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "组盘时间");
|
||||
rowDatum.put("value", datum.getString("create_time"));
|
||||
rowDatum.put("key", "单重");
|
||||
rowDatum.put("value", datum.getString("AlongSide")+"kg");
|
||||
rowData.add(rowDatum);
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "今日完成托数");
|
||||
rowDatum.put("value", datum.getIntValue("BshortSide")+"托");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
unloadLocation.add(row);
|
||||
}
|
||||
|
||||
@@ -709,7 +765,6 @@ public class DashboardService {
|
||||
for (JSONObject datum : gantryRobotData) {
|
||||
String deviceCode = datum.getString("device_code");
|
||||
int deviceStatus = datum.getIntValue("status");
|
||||
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("equipment", deviceCode);
|
||||
row.put("status", this.deviceStatusToDictStatus(deviceStatus));
|
||||
@@ -739,7 +794,13 @@ public class DashboardService {
|
||||
rowDatum.put("value", datum.getIntValue("error_time") / 3600 + "小时");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "条码");
|
||||
rowDatum.put("value", datum.getString("vehicle_code"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
gantryRobot.add(row);
|
||||
|
||||
}
|
||||
|
||||
// 窑
|
||||
@@ -1127,7 +1188,6 @@ public class DashboardService {
|
||||
for (JSONObject datum : laminatingMachineData) {
|
||||
String deviceCode = datum.getString("device_code");
|
||||
int deviceMode = datum.getIntValue("mode");
|
||||
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("equipment", deviceCode);
|
||||
if (datum.getIntValue("error") != 0) {
|
||||
@@ -1146,6 +1206,12 @@ public class DashboardService {
|
||||
rowDatum.put("value", datum.getIntValue("container_type"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "点位状态");
|
||||
int move=datum.getIntValue("move");
|
||||
rowDatum.put("value", deviceYZXLMoveToChinese(move));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
laminatingMachine.add(row);
|
||||
}
|
||||
|
||||
@@ -1253,21 +1319,18 @@ public class DashboardService {
|
||||
rowDatum.put("value", datum.getIntValue("energyLevel"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "角度");
|
||||
rowDatum.put("value", datum.getIntValue("positionAngle"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "X坐标");
|
||||
rowDatum.put("value", datum.getIntValue("positionX"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "Y坐标");
|
||||
rowDatum.put("value", datum.getIntValue("positionY"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
if(datum.getString("name").equals("1")){
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "当日完成任务数量");
|
||||
rowDatum.put("value", datum.getIntValue("finishnumber1"));
|
||||
rowData.add(rowDatum);
|
||||
}
|
||||
if(datum.getString("name").equals("2")){
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "当日完成任务数量");
|
||||
rowDatum.put("value", datum.getIntValue("finishnumber2"));
|
||||
rowData.add(rowDatum);
|
||||
}
|
||||
agvArr.add(row);
|
||||
}
|
||||
|
||||
@@ -1461,7 +1524,7 @@ public class DashboardService {
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "已静置时间");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDate(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowDatum.put("value", StrUtil.isBlank(createTime) ? "" : DateUtil.between(DateUtil.parseDateTime(createTime), new Date(), DateUnit.HOUR) + "小时");
|
||||
rowData.add(rowDatum);
|
||||
|
||||
standMonitor.add(row);
|
||||
@@ -1487,10 +1550,10 @@ public class DashboardService {
|
||||
rowDatum.put("value", pointName);
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "载具号");
|
||||
rowDatum.put("value", datum.getString("vehicle_code"));
|
||||
rowData.add(rowDatum);
|
||||
// rowDatum = new JSONObject();
|
||||
// rowDatum.put("key", "载具号");
|
||||
// rowDatum.put("value", datum.getString("vehicle_code"));
|
||||
// rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "物料号");
|
||||
@@ -1586,7 +1649,7 @@ public class DashboardService {
|
||||
row.put("materialCode", datum.getString("material_number"));
|
||||
row.put("materialName", datum.getString("material_name"));
|
||||
row.put("weight", String.format("%.0f", datum.getDoubleValue("weight")) + "千克");
|
||||
row.put("standTime", DateUtil.between(DateUtil.parseDate(datum.getString("create_time")), new Date(), DateUnit.HOUR) + "小时");
|
||||
row.put("standTime", DateUtil.between(DateUtil.parseDateTime(datum.getString("create_time")), new Date(), DateUnit.HOUR) + "小时");
|
||||
row.put("standStatus", StandStatus.get(datum.getString("stand_status")).value());
|
||||
standStock.add(row);
|
||||
}
|
||||
@@ -1600,8 +1663,7 @@ public class DashboardService {
|
||||
row.put("materialCode", datum.getString("material_number"));
|
||||
row.put("materialName", datum.getString("material_name"));
|
||||
row.put("qty", String.format("%.0f", datum.getDoubleValue("qty")) + "块");
|
||||
row.put("vehicleCode", datum.getString("vehicle_code"));
|
||||
row.put("warehousingTime", DateUtil.parseDate(datum.getString("update_time")));
|
||||
row.put("warehousingTime", datum.getString("update_time"));
|
||||
frontWarehouseStock.add(row);
|
||||
}
|
||||
|
||||
@@ -1615,7 +1677,7 @@ public class DashboardService {
|
||||
row.put("materialName", datum.getString("material_name"));
|
||||
row.put("qty", String.format("%.0f", datum.getDoubleValue("qty")) + "块");
|
||||
row.put("vehicleCode", datum.getString("vehicle_code"));
|
||||
row.put("warehousingTime", DateUtil.parseDate(datum.getString("update_time")));
|
||||
row.put("warehousingTime", datum.getString("update_time"));
|
||||
backWarehouseStock.add(row);
|
||||
}
|
||||
|
||||
@@ -1785,6 +1847,28 @@ public class DashboardService {
|
||||
}
|
||||
}
|
||||
|
||||
private String deviceMoveToChinese(int move) {
|
||||
switch (move) {
|
||||
case 0:
|
||||
return "无货";
|
||||
case 1:
|
||||
return "有货";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
private String deviceYZXLMoveToChinese(int move) {
|
||||
switch (move) {
|
||||
case 0:
|
||||
return "无货";
|
||||
case 2:
|
||||
return "有货";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
private int agvStatusToDictStatus(int status) {
|
||||
switch (status) {
|
||||
case 2:
|
||||
|
||||
@@ -844,20 +844,22 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if ("0000".equals(vehicle_code)) {
|
||||
throw new BadRequestException("载具号不能为空!");
|
||||
}
|
||||
String coolNumber = whereJson.getString("cool_number");
|
||||
if (StrUtil.isBlank(coolNumber)) {
|
||||
throw new BadRequestException("冷却道号不能为空!");
|
||||
}
|
||||
|
||||
Boolean to_package = null;
|
||||
String devicecode=whereJson.getString("device_code");
|
||||
// String coolNumber = whereJson.getString("cool_number");
|
||||
// if (StrUtil.isBlank(coolNumber)) {
|
||||
// throw new BadRequestException("冷却道号不能为空!");
|
||||
// }
|
||||
|
||||
// Boolean to_package = null;
|
||||
//全部都是优先出窑
|
||||
Boolean to_package = true;
|
||||
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
JSONObject vd = vd_table
|
||||
.query("is_delete = '0' AND vehicle_type = '2' AND vehicle_code = '" + vehicle_code + "'")
|
||||
.query("is_delete = '0' AND vehicle_type = '2' AND vehicle_code = '" + vehicle_code + "'","create_time DESC")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(vd)) {
|
||||
if (ObjectUtil.isNotEmpty(vd)&&devicecode.equals("YXCY01")) {
|
||||
JSONObject workorder = WQLObject.getWQLObject("pdm_bd_workorder").query("workorder_id = " + vd.getString("workorder_id")).uniqueResult(0);
|
||||
to_package = TrueOrFalse.trueOrFalse(workorder.getString("is_pri"));
|
||||
// to_package = TrueOrFalse.trueOrFalse(workorder.getString("is_pri"));
|
||||
|
||||
vd.put("out_kiln_time", DateUtil.now());
|
||||
if (to_package) {
|
||||
@@ -875,13 +877,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
gzSendMaterialTask.createTask(methodParam);
|
||||
}
|
||||
}
|
||||
if (!to_package) {
|
||||
vd.put("cool_number", "LQD0" + coolNumber);
|
||||
}
|
||||
TaskUtils.addACSUpdateColum(vd);
|
||||
vd_table.update(vd);
|
||||
}else {
|
||||
vd.put("out_kiln_time", DateUtil.now());
|
||||
TaskUtils.addACSUpdateColum(vd);
|
||||
vd_table.update(vd);
|
||||
}
|
||||
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "分配完成!");
|
||||
@@ -908,6 +912,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
TaskUtils.addACSUpdateColum(vd_update);
|
||||
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(vd_update, "is_delete = '0' AND vehicle_code = '" + vehicle_code + "'");
|
||||
}
|
||||
//出窑
|
||||
} else if ("2".equals(type)) {
|
||||
String coolNumber = param.getString("cool_number");
|
||||
if (StrUtil.isNotBlank(coolNumber) && !"0".equals(coolNumber)) {
|
||||
|
||||
@@ -455,7 +455,7 @@ public class PdaServiceImpl implements PdaService {
|
||||
// 空载具
|
||||
point_update.put("vd_id", "");
|
||||
// 如果存在就载具删除
|
||||
if (ObjectUtil.isEmpty(vd)) {
|
||||
if (ObjectUtil.isNotEmpty(vd)) {
|
||||
vd.put("is_delete", "1");
|
||||
TaskUtils.addCurrentUpdateColum(vd);
|
||||
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(vd);
|
||||
|
||||
@@ -68,15 +68,15 @@ public class AutoUpdateWorkOrder {
|
||||
TaskUtils.addAutoCreateColum(wod);
|
||||
wodTable.insert(wod);
|
||||
} else {
|
||||
if (TrueOrFalse.TRUE.value().equals(wod.getString("is_report"))) {
|
||||
wod.put("qty", datum.getIntValue("qty") + wod.getIntValue("qty"));
|
||||
wod.put("qualified_qty", datum.getIntValue("qualified_qty") + wod.getIntValue("qualified_qty"));
|
||||
wod.put("unqualified_qty", datum.getIntValue("unqualified_qty") + wod.getIntValue("unqualified_qty"));
|
||||
wod.put("weight", datum.getDoubleValue("weight") + wod.getDoubleValue("weight"));
|
||||
wod.put("avg_piece_weight", datum.getDoubleValue("avg_piece_weight") / 1000);
|
||||
TaskUtils.addAutoUpdateColum(wod);
|
||||
wodTable.update(wod);
|
||||
} else {
|
||||
// if (TrueOrFalse.TRUE.value().equals(wod.getString("is_report"))) {
|
||||
// wod.put("qty", datum.getIntValue("qty") + wod.getIntValue("qty"));
|
||||
// wod.put("qualified_qty", datum.getIntValue("qualified_qty") + wod.getIntValue("qualified_qty"));
|
||||
// wod.put("unqualified_qty", datum.getIntValue("unqualified_qty") + wod.getIntValue("unqualified_qty"));
|
||||
// wod.put("weight", datum.getDoubleValue("weight") + wod.getDoubleValue("weight"));
|
||||
// wod.put("avg_piece_weight", datum.getDoubleValue("avg_piece_weight") / 1000);
|
||||
// TaskUtils.addAutoUpdateColum(wod);
|
||||
// wodTable.update(wod);
|
||||
// } else {
|
||||
wod.put("qty", datum.getIntValue("qty"));
|
||||
wod.put("qualified_qty", datum.getIntValue("qualified_qty"));
|
||||
wod.put("unqualified_qty", datum.getIntValue("unqualified_qty"));
|
||||
@@ -84,7 +84,7 @@ public class AutoUpdateWorkOrder {
|
||||
wod.put("avg_piece_weight", datum.getDoubleValue("avg_piece_weight") / 1000);
|
||||
TaskUtils.addAutoUpdateColum(wod);
|
||||
wodTable.update(wod);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user