update
This commit is contained in:
@@ -433,8 +433,8 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
|
||||
@Override
|
||||
public AgvDto findByCarNumber(String carNumber) {
|
||||
if (agv.containsKey(String.valueOf(carNumber)) && agv.get(carNumber) != null) {
|
||||
return agv.get(String.valueOf(carNumber));
|
||||
if (agv.containsKey(carNumber) && agv.get(carNumber) != null) {
|
||||
return agv.get(carNumber);
|
||||
} else {
|
||||
AgvDto dto = new AgvDto();
|
||||
dto.setName(carNumber);
|
||||
|
||||
@@ -6,8 +6,6 @@ import org.nl.acs.auto.run.AbstractAutoRunnable;
|
||||
import org.nl.acs.udw.UnifiedDataAccessor;
|
||||
import org.nl.acs.udw.UnifiedDataAccessorFactory;
|
||||
import org.nl.acs.udw.UnifiedDataAppService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.Group;
|
||||
import org.openscada.opc.lib.da.Item;
|
||||
@@ -15,8 +13,10 @@ import org.openscada.opc.lib.da.ItemState;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
@@ -30,8 +30,6 @@ public class DeviceOpcSynchronizeAutoRun extends AbstractAutoRunnable {
|
||||
private DeviceAppService deviceAppService;
|
||||
@Autowired
|
||||
private OpcServerManageService opcServerManageService;
|
||||
@Autowired
|
||||
LuceneExecuteLogService lucene;
|
||||
|
||||
static ExecutorService executorService;
|
||||
public static Map<String, OpcServerManageDto> opcServersConfig;
|
||||
@@ -208,13 +206,11 @@ public class DeviceOpcSynchronizeAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
if (!itemCode.endsWith("heartbeat") && !itemCode.endsWith("time")) {
|
||||
log.warn("{} 信号 {} 发生变更 {} -> {} 信号快照 {}", itemDto.getDevice_code(), itemCode, his, value, sb);
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), String.valueOf(his), String.valueOf(value)));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!itemCode.endsWith("heartbeat") && !itemCode.endsWith("time")) {
|
||||
log.warn("{} 信号 {} 发生变更 {} -> {}", itemDto.getDevice_code(), itemCode, his, value);
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), String.valueOf(his), String.valueOf(value)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package org.nl.start.auto.run;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,8 +37,10 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@@ -538,7 +538,6 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
acsToWmsService.feedbackTaskStatusToWms(ar);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "AGV取货完成离开后,反馈上位系统失败!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1242,7 +1242,7 @@ public class DashboardService {
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("equipment", datum.getString("name"));
|
||||
row.put("status", this.agvStatusToDictStatus(datum.getIntValue("state")));
|
||||
row.put("equipmentName", datum.getString("device_name"));
|
||||
row.put("equipmentName", datum.getString("name"));
|
||||
row.put("statusChinese", this.agvStatusToChinese(datum.getIntValue("state")));
|
||||
|
||||
JSONArray rowData = new JSONArray();
|
||||
@@ -1268,11 +1268,6 @@ public class DashboardService {
|
||||
rowDatum.put("value", datum.getIntValue("positionY"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "故障信息");
|
||||
rowDatum.put("value", datum.getJSONArray("faultInfo"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
agvArr.add(row);
|
||||
}
|
||||
|
||||
@@ -1792,36 +1787,55 @@ public class DashboardService {
|
||||
private int agvStatusToDictStatus(int status) {
|
||||
switch (status) {
|
||||
case 2:
|
||||
case 3:
|
||||
return 1;
|
||||
case 4:
|
||||
case 5:
|
||||
case 7:
|
||||
return 2;
|
||||
case 0:
|
||||
case 1:
|
||||
return 3;
|
||||
case 3:
|
||||
case 5:
|
||||
case 6:
|
||||
return 4;
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
private String agvStatusToChinese(int status) {
|
||||
switch (status) {
|
||||
case 2:
|
||||
case 3:
|
||||
return "运行";
|
||||
case 4:
|
||||
case 5:
|
||||
case 7:
|
||||
return "暂停";
|
||||
case 1:
|
||||
return "停机";
|
||||
return "关机";
|
||||
case 2:
|
||||
return "运行中";
|
||||
case 3:
|
||||
return "交通管制";
|
||||
case 4:
|
||||
return "任务等待";
|
||||
case 5:
|
||||
return "充电中";
|
||||
case 6:
|
||||
return "故障";
|
||||
return "故障中";
|
||||
case 7:
|
||||
return "低电量";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
private String toJoinString(JSONArray jsonArray) {
|
||||
if (ObjectUtil.isEmpty(jsonArray)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
sb.append(jsonArray.getString(i));
|
||||
if (i != jsonArray.size() - 1) {
|
||||
sb.append(",");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if ("0000".equals(vehicleCode)) {
|
||||
throw new BadRequestException("条码不能为空!");
|
||||
}
|
||||
JSONObject vd_update = new JSONObject();
|
||||
vd_update.put("is_delete", TrueOrFalse.TRUE.value());
|
||||
TaskUtils.addACSUpdateColum(vd_update);
|
||||
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(vd_update, "is_delete = '0' AND vehicle_type = '1' AND vehicle_code = '" + vehicleCode + "'");
|
||||
|
||||
String weight = param.getString("weight");
|
||||
if (StrUtil.isBlank(weight)) {
|
||||
throw new BadRequestException("重量不能为空!");
|
||||
@@ -652,7 +657,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
TaskUtils.addACSUpdateColum(workOrder);
|
||||
workOrderTable.update(workOrder);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("未知操作类型!");
|
||||
}
|
||||
|
||||
@@ -226,25 +226,6 @@ public class GZSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||
}
|
||||
|
||||
JSONObject detail = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "6").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
|
||||
String dd = detail.getString("dd");
|
||||
String extCode = detail.getString("ext_code");
|
||||
if (StrUtil.isNotBlank(dd) && StrUtil.isNotBlank(extCode)) {
|
||||
JSONObject regionIn = new JSONObject();
|
||||
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
|
||||
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||
regionIn.put("dDate", DateUtil.now());
|
||||
regionIn.put("cVouchType", RegionInType.BCPRK.label());
|
||||
regionIn.put("cMocode", dd);
|
||||
regionIn.put("cInvCode", detail.getString("material_number"));
|
||||
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("weight") / 1000));
|
||||
regionIn.put("iNum", detail.getIntValue("qty"));
|
||||
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("dz") / 1000));
|
||||
regionIn.put("cBatch", dd);
|
||||
regionIn.put("PLANSID", extCode);
|
||||
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.wms.sch.task.send.material;
|
||||
|
||||
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 com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.basedata.eum.TrueOrFalse;
|
||||
@@ -239,6 +242,25 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||
}
|
||||
|
||||
JSONObject detail = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "6").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
|
||||
String dd = detail.getString("dd");
|
||||
String extCode = detail.getString("ext_code");
|
||||
if (StrUtil.isNotBlank(dd) && StrUtil.isNotBlank(extCode)) {
|
||||
JSONObject regionIn = new JSONObject();
|
||||
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
|
||||
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||
regionIn.put("dDate", DateUtil.now());
|
||||
regionIn.put("cVouchType", RegionInType.BCPRK.label());
|
||||
regionIn.put("cMocode", dd);
|
||||
regionIn.put("cInvCode", detail.getString("material_number"));
|
||||
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("weight") / 1000));
|
||||
regionIn.put("iNum", detail.getIntValue("qty"));
|
||||
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("dz") / 1000));
|
||||
regionIn.put("cBatch", dd);
|
||||
regionIn.put("PLANSID", extCode);
|
||||
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user