rev:修改

This commit is contained in:
2026-01-13 19:43:18 +08:00
parent 513a5466c3
commit a47541f302
10 changed files with 139 additions and 57 deletions

View File

@@ -91,6 +91,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
param.put("blurry", "%" + whereJson.get("blurry") + "%");
}
param.put("device_type", whereJson.get("device_type"));
param.put("region", whereJson.get("region"));
JSONObject json = WQL.getWO("Qdevice_query_002").addParamMap(param).pageQuery(WqlUtil.getHttpContext(page), "is_config asc,seq_num desc,update_time desc");
return json;
}

View File

@@ -23,6 +23,7 @@
输入.methods_code TYPEAS s_string
输入.methods_id TYPEAS s_string
输入.blurry TYPEAS s_string
输入.region TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@@ -63,6 +64,9 @@
OPTION 输入.device_type <> ""
d.device_type = 输入.device_type
ENDOPTION
OPTION 输入.region <> ""
d.region = 输入.region
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF

View File

@@ -172,7 +172,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
jo.put("carId", carno);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyTake");
log.info("请求wms取货完成参数:{}", jo);
log.info("请求wms取货参数:{}", jo);
HttpResponse result = acsToZDWmsService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
@@ -203,7 +203,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.error("请求焊接线失败,申请区货 错误信息{}", response);
}
//MES不需对接
}else if (ext_system.equals("2")){
} else if (ext_system.equals("2")) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
}
} else {
@@ -242,8 +242,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if ((StrUtil.startWith(task.getTask_code(), "-"))) {
log.info("定点任务下发agv允许取货信号");
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else
{
} else {
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
@@ -256,7 +255,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
jo.put("carId", carno);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "takeFinish");
log.info("请求wms取货完参数:{}", jo);
log.info("请求wms取货完参数:{}", jo);
HttpResponse result = acsToZDWmsService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
@@ -443,7 +442,26 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else {
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
if ("1".equals(task.getCreate_by())){
JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code());
jo.put("carId", carno);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "putFinish");
log.info("请求wms放货完成参数:{}", jo);
HttpResponse result = acsToZDWmsService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else {
log.error("请求wms放货失败参数:{}", response);
return;
}
} else {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
}
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
Object ext_system = device.getExtraValue().get("ext_system");
//检测站点,安全交互类型为中鼎的
@@ -455,7 +473,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "putFinish");
log.info("请求wms放货完成参数:{}", jo);
HttpResponse result = acsToMesService.taskFeedback(jo);
HttpResponse result = acsToZDWmsService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
@@ -512,7 +530,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
}else {
} else {
log.info("请求MES放货货完成失败 错误信息{}", responseCode);
return;
}
@@ -912,10 +930,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
//agv电量
electric_qty = ikey;
} else if (phase == 0x74) {
//三色灯状态
status = ikey;
//将小车状态写入DeviceManageDto
deviceManageDto.setStatus(status);
// //三色灯状态
// status = ikey;
// //将小车状态写入DeviceManageDto
// deviceManageDto.setStatus(status);
}
if (!ObjectUtil.isEmpty(data)) {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data));

View File

@@ -45,7 +45,7 @@ public class AcsToMesServiceImpl implements AcsToMesService {
public HttpResponse taskFeedback(JSONObject whereJson) {
//TODO:改成中鼎
String wmsUrl = "10.10.188.151:8098";
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
AddressDto addressDto = addressService.findByCode("feedMesAgvTaskStatus");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
HttpResponse result = null;

View File

@@ -45,8 +45,8 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
@Override
public HttpResponse taskFeedback(JSONObject whereJson) {
//TODO:改成中鼎
String wmsUrl = null;
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
String wmsUrl = "172.30.15.32:30010";
AddressDto addressDto = addressService.findByCode("feedZdAgvTaskStatus");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
HttpResponse result = null;
@@ -67,7 +67,7 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
@Override
public HttpResponse taskDeprecate(JSONObject whereJson) {
String wmsUrl = "10.10.188.151:8098";
String wmsUrl = "172.30.15.32:30010";
AddressDto addressDto = addressService.findByCode("acsCancelBack");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
@@ -89,7 +89,7 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
@Override
public HttpResponse deviceStatusUpdate(JSONObject whereJson) {
String wmsUrl = "10.10.188.151:8098";
String wmsUrl = "172.30.15.32:30010";
AddressDto addressDto = addressService.findByCode("deviceStatusUpdate");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;

View File

@@ -12,6 +12,7 @@ import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.logging.service.LogService;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -136,23 +137,43 @@ public class MesToAcsServiceImpl implements MesToAcsService {
String next_device_code2 = "";
JSONObject start_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationFrom + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(start_device_json)) {
start_device_code = (String) start_device_json.get("parent_storage_code") == null ? start_device_code : (String) start_device_json.get("storage_code");
}
JSONObject next_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationTo + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(next_device_json)) {
next_device_code = (String) next_device_json.get("parent_storage_code") == null ? next_device_code : (String) next_device_json.get("storage_code");
}
JSONObject start_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationFrom2 + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(start_device_json2)) {
start_device_code2 = (String) start_device_json2.get("parent_storage_code") == null ? start_device_code2 : (String) start_device_json2.get("storage_code");
}
JSONObject next_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationTo2 + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(next_device_json2)) {
next_device_code2 = (String) next_device_json2.get("parent_storage_code") == null ? next_device_code2 : (String) next_device_json2.get("storage_code");
}
// if (start_point_code.indexOf("-") > 0) {
// String str[] = start_point_code.split("-");
// start_device_code = str[0];
// } else {
start_device_code = locationFrom;
// start_device_code = locationFrom;
// }
// if (next_point_code.indexOf("-") > 0) {
// String str[] = next_point_code.split("-");
// next_device_code = str[0];
// } else {
next_device_code = locationTo;
// next_device_code = locationTo;
// }
if (actionType.equals("2")) {
start_device_code2 = locationFrom2;
next_device_code2 = locationTo2;
// start_device_code2 = locationFrom2;
// next_device_code2 = locationTo2;
}
// //查询wcs传过来的起点终点路由
@@ -182,14 +203,14 @@ public class MesToAcsServiceImpl implements MesToAcsService {
}
//判断设备是否还有未完成的任务
int count1 = taskService.queryDeviceUnfinishTask(locationFrom);
int count1 = taskService.queryDeviceUnfinishTask(start_device_code);
if (count1 > 0) {
map.put("status", "400");
map.put("message", "设备"+locationFrom+"有未完成任务");
map.put("data", null);
return map;
}
int count2 = taskService.queryDeviceUnfinishTask(locationTo);
int count2 = taskService.queryDeviceUnfinishTask(next_device_code);
if (count2 > 0) {
map.put("status", "400");
map.put("message", "设备"+locationTo+"有未完成任务");
@@ -199,14 +220,14 @@ public class MesToAcsServiceImpl implements MesToAcsService {
JSONObject jo = new JSONObject();
jo.put("task_code", taskCode);
jo.put("start_point_code", locationFrom);
jo.put("next_point_code", locationTo);
jo.put("start_point_code", start_device_code);
jo.put("next_point_code", next_device_code);
jo.put("start_parent_code", locationFrom);
jo.put("next_parent_code", locationTo);
jo.put("start_device_code", start_device_code);
jo.put("next_device_code", next_device_code);
jo.put("start_point_code2", locationFrom2);
jo.put("next_point_code2", locationTo2);
jo.put("start_point_code2", start_device_code2);
jo.put("next_point_code2", next_device_code2);
jo.put("start_device_code2", start_device_code2);
jo.put("next_device_code2", next_device_code2);
jo.put("priority", priority);

View File

@@ -12,6 +12,7 @@ import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.logging.service.LogService;
import org.nl.modules.wql.core.bean.WQLObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@@ -140,24 +141,43 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
String start_device_code2 = "";
String next_device_code2 = "";
JSONObject start_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationFrom + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(start_device_json)) {
start_device_code = (String) start_device_json.get("parent_storage_code") == null ? start_device_code : (String) start_device_json.get("storage_code");
}
JSONObject next_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationTo + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(next_device_json)) {
next_device_code = (String) next_device_json.get("parent_storage_code") == null ? next_device_code : (String) next_device_json.get("storage_code");
}
JSONObject start_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationFrom2 + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(start_device_json2)) {
start_device_code2 = (String) start_device_json2.get("parent_storage_code") == null ? start_device_code2 : (String) start_device_json2.get("storage_code");
}
JSONObject next_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + locationTo2 + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(next_device_json2)) {
next_device_code2 = (String) next_device_json2.get("parent_storage_code") == null ? next_device_code2 : (String) next_device_json2.get("storage_code");
}
// if (start_point_code.indexOf("-") > 0) {
// String str[] = start_point_code.split("-");
// start_device_code = str[0];
// } else {
start_device_code = locationFrom;
//start_device_code = locationFrom;
// }
// if (next_point_code.indexOf("-") > 0) {
// String str[] = next_point_code.split("-");
// next_device_code = str[0];
// } else {
next_device_code = locationTo;
//next_device_code = locationTo;
// }
if (actionType.equals("2")) {
start_device_code2 = locationFrom2;
next_device_code2 = locationTo2;
//start_device_code2 = locationFrom2;
// next_device_code2 = locationTo2;
}
// //查询wcs传过来的起点终点路由
@@ -186,14 +206,14 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
}
}
//判断设备是否还有未完成的任务
int count1 = taskService.queryDeviceUnfinishTask(locationFrom);
int count1 = taskService.queryDeviceUnfinishTask(start_device_code);
if (count1 > 0) {
map.put("status", "400");
map.put("message", "设备"+locationFrom+"有未完成任务");
map.put("data", null);
return map;
}
int count2 = taskService.queryDeviceUnfinishTask(locationTo);
int count2 = taskService.queryDeviceUnfinishTask(next_device_code);
if (count2 > 0) {
map.put("status", "400");
map.put("message", "设备"+locationTo+"有未完成任务");
@@ -203,14 +223,14 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
JSONObject jo = new JSONObject();
jo.put("task_code", taskCode);
jo.put("start_point_code", locationFrom);
jo.put("next_point_code", locationTo);
jo.put("start_point_code", start_device_code);
jo.put("next_point_code", next_device_code);
jo.put("start_parent_code", locationFrom);
jo.put("next_parent_code", locationTo);
jo.put("start_device_code", start_device_code);
jo.put("next_device_code", next_device_code);
jo.put("start_point_code2", locationFrom2);
jo.put("next_point_code2", locationTo2);
jo.put("start_point_code2", start_device_code2);
jo.put("next_point_code2", next_device_code2);
jo.put("start_device_code2", start_device_code2);
jo.put("next_device_code2", next_device_code2);
jo.put("priority", priority);

View File

@@ -344,4 +344,7 @@ public interface TaskService {
*/
Integer queryDeviceUnfinishTask(String device_code);
List<TaskDto> queryAllByCache();
}

View File

@@ -303,7 +303,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
@Override
public TaskDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("acs_task");
JSONObject json = wo.query("task_code ='" + code + "'","create_time desc").uniqueResult(0);
JSONObject json = wo.query("task_code ='" + code + "'", "create_time desc").uniqueResult(0);
final TaskDto obj = json.toJavaObject(TaskDto.class);
return obj;
}
@@ -855,7 +855,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl");
InstructionDto instdto = instructionservice.findByTaskid(entity.getTask_id(), "instruction_status <2 ");
if (instdto != null) throw new BadRequestException("任务号为【"+entity.getTask_code()+"】有指令未完成!");
if (instdto != null) throw new BadRequestException("任务号为【" + entity.getTask_code() + "】有指令未完成!");
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
entity.setUpdate_time(now);
@@ -878,7 +878,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl");
InstructionDto instdto = instructionservice.findByTaskid(entity.getTask_id(), "instruction_status <2 ");
if (instdto != null) {
throw new BadRequestException("任务号为【"+entity.getTask_code()+"】有指令未完成!");
throw new BadRequestException("任务号为【" + entity.getTask_code() + "】有指令未完成!");
}
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
@@ -939,31 +939,31 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
// 判断是否为WMS下发的任务如果是反馈任务状态给WMS
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
String hasMes = paramService.findByCode(AcsConfig.HASMES).getCode();
String Type1=entity.getTask_type();
if(!StrUtil.startWith(entity.getTask_code(), "-") &&entity.getCreate_type().equals("2")&& StrUtil.equals(hasMes, "1")){
String Type1 = entity.getTask_type();
if (!StrUtil.startWith(entity.getTask_code(), "-") && entity.getCreate_type().equals("2") && StrUtil.equals(hasMes, "1")) {
JSONObject feed_jo = new JSONObject();
feed_jo.put("task_code", entity.getTask_code());
// JSONArray ja = new JSONArray();
// ja.add(feed_jo);
// acstowmsService.feedbackTaskStatusToWms(ja);
HttpResponse result=acsToMesService.taskDeprecate(feed_jo);
JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode");
if(responseCode == 0) {
log.info("请求Mes成功任务取消 请求结果{}",responseCode);
HttpResponse result = acsToMesService.taskDeprecate(feed_jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
log.info("请求Mes成功任务取消 请求结果{}", responseCode);
}
}
if (!StrUtil.startWith(entity.getTask_code(), "-") &&entity.getCreate_type().equals("1")&& StrUtil.equals(hasWms, "1")) {
if (!StrUtil.startWith(entity.getTask_code(), "-") && entity.getCreate_type().equals("1") && StrUtil.equals(hasWms, "1")) {
JSONObject feed_jo = new JSONObject();
feed_jo.put("task_code", entity.getTask_code());
// JSONArray ja = new JSONArray();
// ja.add(feed_jo);
// acstowmsService.feedbackTaskStatusToWms(ja);
HttpResponse result=acsToWmsZDService.taskDeprecate(feed_jo);
JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode");
if(responseCode == 0) {
log.info("请求ZDwcs成功任务取消 请求结果{}",responseCode);
HttpResponse result = acsToWmsZDService.taskDeprecate(feed_jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
log.info("请求ZDwcs成功任务取消 请求结果{}", responseCode);
}
}
// List<RouteLineDto> shortPathsList =
@@ -1268,13 +1268,13 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String priority = acsTask.getPriority();
String is_send = acsTask.getIs_send();
String start_device_code = acsTask.getStart_device_code();
String start_device_code = acsTask.getStart_point_code();
String start_point_code = acsTask.getStart_point_code();
String put_device_code = acsTask.getPut_device_code();
String put_point_code = acsTask.getPut_point_code();
String next_device_code = acsTask.getNext_device_code();
String next_device_code = acsTask.getNext_point_code();
String next_point_code = acsTask.getNext_point_code();
String start_point_code2 = acsTask.getStart_point_code2();
@@ -1295,8 +1295,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
}
Instruction instdto = new Instruction();
instdto.setInstruction_type(task_type);
instdto.setInstruction_id(IdUtil.simpleUUID());
@@ -1758,4 +1756,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
return num;
}
@Override
public List<TaskDto> queryAllByCache() {
return this.tasks;
}
}