add:新增日志
This commit is contained in:
@@ -4,6 +4,8 @@ package org.nl.acs.agv.server;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 浙大AGV服务
|
||||
*/
|
||||
@@ -29,7 +31,7 @@ public interface ZheDaAgvService {
|
||||
HttpResponse queryZDAgvDeviceStatus();
|
||||
|
||||
|
||||
String process(String jobno, String type, String address, String action, String processingVehicle);
|
||||
String process(String jobno, String type, String address, String action, String processingVehicle) throws IOException;
|
||||
|
||||
public HttpResponse markComplete(String code);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -141,8 +142,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
||||
|
||||
@LokiLog(type = LokiLogType.AGV)
|
||||
@Override
|
||||
public synchronized String process(String jobno, String type, String address, String action, String processingVehicle)
|
||||
{
|
||||
public synchronized String process(String jobno, String type, String address, String action, String processingVehicle) throws IOException {
|
||||
{
|
||||
log.info("查询到AGV请求参数,jobno:{},address:{}", jobno + ",address:" + address + ",type:" + type + ",action:" + action);
|
||||
//释放AGV资源,继续后续动作
|
||||
|
||||
@@ -72,4 +72,10 @@ public class AddressController {
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
AddressService.download(AddressService.queryAll(whereJson), response);
|
||||
}
|
||||
|
||||
@GetMapping("/queryAddressCodeList")
|
||||
@Log("查询接口方法地址编码")
|
||||
public ResponseEntity<Object> queryAddressCodeList() {
|
||||
return new ResponseEntity<>(AddressService.queryAddressCodeList(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.acs.device.address.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.device.address.service.dto.AddressDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -79,4 +80,6 @@ public interface AddressService {
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<AddressDto> dtos, HttpServletResponse response) throws IOException;
|
||||
|
||||
JSONObject queryAddressCodeList();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.acs.device.address.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -22,10 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author ljfei
|
||||
@@ -146,4 +144,21 @@ public class AddressServiceImpl implements AddressService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryAddressCodeList() {
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
List<AddressDto> addressDtoList = this.queryAll(new HashMap());
|
||||
if (CollectionUtil.isNotEmpty(addressDtoList)){
|
||||
for (AddressDto addressDto : addressDtoList) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("label",addressDto.getMethods_name());
|
||||
jo.put("value",addressDto.getMethods_code());
|
||||
list.add(jo);
|
||||
}
|
||||
}
|
||||
JSONObject ja1 = new JSONObject();
|
||||
ja1.put("content",list);
|
||||
return ja1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.DeviceManageDto;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -57,6 +59,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
//外部系统交互
|
||||
AcsToZDWmsService acsToZDWmsService = SpringContextHolder.getBean(AcsToZDWmsService.class);
|
||||
AcsToHJXService acsToHJXService = SpringContextHolder.getBean(AcsToHJXService.class);
|
||||
@@ -113,20 +116,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
Device device = null;
|
||||
String device_code = null;
|
||||
|
||||
// if (phase == 0x67) {
|
||||
// //故障信息
|
||||
// if (arr[18] * 256 + arr[19] == 0) {
|
||||
//
|
||||
// }
|
||||
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// }
|
||||
|
||||
//将车号写入DeviceManageDto
|
||||
DeviceManageDto deviceManageDto = new DeviceManageDto();
|
||||
deviceManageDto.setCarno(carno);
|
||||
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
String hasMes = paramService.findByCode(AcsConfig.HASMES).getValue();
|
||||
//分配 车id
|
||||
//(不需要WCS反馈)
|
||||
if (phase == 0x02) {
|
||||
@@ -161,6 +154,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
//WMS MES普通站点不需对接
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
Object ext_system = device.getExtraValue().get("ext_system");
|
||||
@@ -180,6 +174,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
log.error("请求wms取货失败参数:{}", response);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("请求wms取货失败参数::"+ response)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
//焊接线
|
||||
} else if (ext_system.equals("3")) {
|
||||
@@ -190,6 +190,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
Object url = device.getExtraValue().get("address");
|
||||
if (StringUtil.isEmpty(ext_system)) {
|
||||
log.error("请求安全交互失败,未配置焊接线IP" + device_code);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("请求安全交互失败,未配置焊接线IP" + device_code)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
return;
|
||||
}
|
||||
jo1.put("url", url);
|
||||
@@ -198,16 +204,33 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
int code = response.getInteger("code");
|
||||
if (code == 200) {
|
||||
log.info("请求焊接线成功,申请取货 请求结果{}", code);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("请求焊接线成功,申请取货 请求结果:"+code)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
log.error("请求焊接线失败,申请区货 错误信息{}", response);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("请求焊接线失败,申请区货 错误信息:"+ response)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
//MES不需对接
|
||||
} else if (ext_system.equals("2")) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
} else {
|
||||
log.error("检测站点未配置检测系统");
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("检测站点未配置检测系统")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -244,6 +267,22 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
//MES下发需要上报取货完成
|
||||
if ("2".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", "takeFinish");
|
||||
log.info("请求MES取货完成参数:{}", jo);
|
||||
HttpResponse result = acsToMesService.taskFeedback(jo);
|
||||
JSONObject response = JSONObject.parseObject(result.body());
|
||||
int responseCode = response.getInteger("responseCode");
|
||||
if (responseCode != 0){
|
||||
log.error("请求MES取货完成失败参数:{}", response);
|
||||
return;
|
||||
}
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
Object ext_system = device.getExtraValue().get("ext_system");
|
||||
@@ -299,7 +338,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} else {
|
||||
log.info("请求MES取货完成失败,取货完成 错误码{}", responseCode);
|
||||
}
|
||||
//只跟MES交互的点
|
||||
} else if (ext_system.equals("2")) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("taskCode", task.getTask_code());
|
||||
@@ -390,7 +428,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.error("请求焊接线放货失败,申请区货 错误信息{}", response);
|
||||
return;
|
||||
}
|
||||
//MES不需要请求放货交互
|
||||
} else if (ext_system.equals("2")) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
@@ -442,26 +479,37 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if ("1".equals(task.getCreate_by())){
|
||||
//mes下发需要上报放货完成
|
||||
if ("2".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);
|
||||
log.info("请求MES放货完成参数:{}", jo);
|
||||
HttpResponse result = acsToMesService.taskFeedback(jo);
|
||||
JSONObject response = JSONObject.parseObject(result.body());
|
||||
int responseCode = response.getInteger("responseCode");
|
||||
if (responseCode != 0) {
|
||||
log.error("请求MES放货失败参数:{}", response);
|
||||
return;
|
||||
} //wms下发需要上报放货完成
|
||||
} else 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);
|
||||
if (responseCode != 0) {
|
||||
log.info("请求WMS放货货完成失败 错误信息{}", responseCode);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
Object ext_system = device.getExtraValue().get("ext_system");
|
||||
//检测站点,安全交互类型为中鼎的
|
||||
@@ -517,7 +565,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info("请求MES放货完成失败,错误码{}", responseCode);
|
||||
return;
|
||||
}
|
||||
//只跟MES交互的点
|
||||
} else if (ext_system.equals("2")) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("taskCode", task.getTask_code());
|
||||
@@ -543,350 +590,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
|
||||
}
|
||||
//到达取货点
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
else if (phase == 0x0B) {
|
||||
log.info("==================AGV请求取货==================");
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令:" + ikey);
|
||||
log.info("{},{}", device_code, "未找到指令 [" + ikey + "]");
|
||||
return;
|
||||
}
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
log.info("{},{}", device_code, "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
log.info("{},{}", device_code, "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
//mes的站点用检测站点 wms的站点用普通站点驱动
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//取货完毕
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x0D) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
// if (agvaddr != 0) {
|
||||
// old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
// if (StrUtil.contains(old_device_code, "-")) {
|
||||
// String[] point = old_device_code.split("-");
|
||||
// device_code = point[0];
|
||||
// } else if (StrUtil.contains(old_device_code, ".")) {
|
||||
// String[] point = old_device_code.split("\\.");
|
||||
// device_code = point[0];
|
||||
// emptyNum = point[1];
|
||||
// } else {
|
||||
// device_code = old_device_code;
|
||||
// }
|
||||
// }
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code);
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//到达放货点
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x0F) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
log.info("==================允许AGV放货==================");
|
||||
log.info("{},{}", device_code, "允许AGV放货。");
|
||||
}
|
||||
//放货完毕
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x11) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, inst);
|
||||
}
|
||||
//到达取货点
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
else if (phase == 0x13) {
|
||||
log.info("==================AGV请求取货==================");
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令:" + ikey);
|
||||
log.info("{},{}", device_code, "未找到指令 [" + ikey + "]");
|
||||
return;
|
||||
}
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
log.info("{},{}", device_code, "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
log.info("{},{}", device_code, "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//取货完毕
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x15) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code);
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//到达放货点
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x17) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
if (flag) {
|
||||
log.info("==================允许AGV放货==================");
|
||||
log.info("{},{}", device_code, "允许AGV放货。");
|
||||
}
|
||||
//放货完毕
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x19) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, inst);
|
||||
}
|
||||
//到达取货点
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
else if (phase == 0x1B) {
|
||||
log.info("==================AGV请求取货==================");
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令:" + ikey);
|
||||
log.info("{},{}", device_code, "未找到指令 [" + ikey + "]");
|
||||
return;
|
||||
}
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
log.info("{},{}", device_code, "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
log.info("{},{}", device_code, "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
//mes的站点用检测站点 wms的站点用普通站点驱动
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
|
||||
//取货完毕
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x1D) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code);
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, inst);
|
||||
//到达放货点
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x1F) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//mes的站点用检测站点 wms的站点用普通站点驱动
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
//放货完毕
|
||||
//(Itype=2/3,需要WCS反馈Phase)
|
||||
} else if (phase == 0x21) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase);
|
||||
return;
|
||||
}
|
||||
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
//mes的站点用检测站点 wms的站点用普通站点驱动
|
||||
}
|
||||
|
||||
//到达位置点
|
||||
//(需要WCS反馈)
|
||||
@@ -895,10 +598,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
agvaddr = arr[18] * 256 + arr[19];
|
||||
agvaddr_copy = agvaddr;
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else if (phase == 0x50) {//进入交通灯区域
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else if (phase == 0x51) {//离开交通灯区域
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else if (phase == 0x67) {//agv异常
|
||||
if (ikey == 0) {
|
||||
this.setErrorInfo(ikey, "0", "正常");
|
||||
@@ -917,23 +616,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
last_error = error;
|
||||
} else if (phase == 0x70) {
|
||||
//x坐标
|
||||
x = ikey;
|
||||
} else if (phase == 0x71) {
|
||||
//y坐标
|
||||
y = ikey;
|
||||
} else if (phase == 0x72) {
|
||||
//车辆角度
|
||||
angle = ikey;
|
||||
} else if (phase == 0x73) {
|
||||
//agv电量
|
||||
electric_qty = ikey;
|
||||
} else if (phase == 0x74) {
|
||||
// //三色灯状态
|
||||
// status = ikey;
|
||||
// //将小车状态写入DeviceManageDto
|
||||
// deviceManageDto.setStatus(status);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(data)) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data));
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "mes接口")
|
||||
@@ -31,7 +33,7 @@ public class MesToAcsController {
|
||||
@Log("任务接收")
|
||||
@ApiOperation("任务接收")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> taskCreate(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> taskCreate(@RequestBody JSONObject whereJson) throws IOException {
|
||||
return new ResponseEntity<>(mesToAcsService.taskCreate(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ public class MesToAcsController {
|
||||
@Log("任务操作")
|
||||
@ApiOperation("任务操作")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> taskOperation(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> taskOperation(@RequestBody JSONObject whereJson) throws IOException {
|
||||
return new ResponseEntity<>(mesToAcsService.taskOperation(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -47,7 +49,7 @@ public class MesToAcsController {
|
||||
@Log("任务状态查询")
|
||||
@ApiOperation("任务状态查询")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> taskStatus(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> taskStatus(@RequestBody JSONObject whereJson) throws IOException {
|
||||
return new ResponseEntity<>(mesToAcsService.taskStatus(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "wms接口")
|
||||
@@ -31,7 +33,7 @@ public class WmsZDToAcsController {
|
||||
@Log("任务接收")
|
||||
@ApiOperation("任务接收")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> taskCreate(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> taskCreate(@RequestBody JSONObject whereJson) throws IOException {
|
||||
return new ResponseEntity<>(wmsZDToAcsService.taskCreate(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ public class WmsZDToAcsController {
|
||||
@Log("任务操作")
|
||||
@ApiOperation("任务操作")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> taskOperation(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> taskOperation(@RequestBody JSONObject whereJson) throws IOException {
|
||||
return new ResponseEntity<>(wmsZDToAcsService.taskOperation(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -47,7 +49,7 @@ public class WmsZDToAcsController {
|
||||
@Log("任务状态查询")
|
||||
@ApiOperation("任务状态查询")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> taskStatus(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> taskStatus(@RequestBody JSONObject whereJson) throws IOException {
|
||||
return new ResponseEntity<>(wmsZDToAcsService.taskStatus(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.nl.acs.ext.wms.service;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface AcsToMesService {
|
||||
|
||||
|
||||
@@ -12,7 +14,7 @@ public interface AcsToMesService {
|
||||
*
|
||||
*
|
||||
*/
|
||||
HttpResponse taskFeedback(JSONObject whereJson);
|
||||
HttpResponse taskFeedback(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 任务取消
|
||||
@@ -20,7 +22,7 @@ public interface AcsToMesService {
|
||||
*
|
||||
*
|
||||
*/
|
||||
HttpResponse taskDeprecate(JSONObject whereJson);
|
||||
HttpResponse taskDeprecate(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 设备状态上传
|
||||
@@ -28,5 +30,5 @@ public interface AcsToMesService {
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
HttpResponse deviceStatusUpdate(JSONObject whereJson);
|
||||
HttpResponse deviceStatusUpdate(JSONObject whereJson) throws IOException;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.nl.acs.ext.wms.service;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface AcsToZDWmsService {
|
||||
|
||||
|
||||
@@ -12,7 +14,7 @@ public interface AcsToZDWmsService {
|
||||
*
|
||||
*
|
||||
*/
|
||||
HttpResponse taskFeedback(JSONObject whereJson);
|
||||
HttpResponse taskFeedback(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 任务取消
|
||||
@@ -20,7 +22,7 @@ public interface AcsToZDWmsService {
|
||||
*
|
||||
*
|
||||
*/
|
||||
HttpResponse taskDeprecate(JSONObject whereJson);
|
||||
HttpResponse taskDeprecate(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 设备状态上传
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.acs.ext.wms.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public interface MesToAcsService {
|
||||
@@ -10,19 +11,19 @@ public interface MesToAcsService {
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> taskCreate(JSONObject whereJson);
|
||||
Map<String, Object> taskCreate(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 任务处理
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> taskOperation(JSONObject whereJson);
|
||||
Map<String, Object> taskOperation(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> taskStatus(JSONObject whereJson);
|
||||
Map<String, Object> taskStatus(JSONObject whereJson) throws IOException;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.ext.wms.data.CreateTaskRequest;
|
||||
import org.nl.acs.ext.wms.data.CreateTaskResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -14,19 +15,19 @@ public interface WmsZDToAcsService {
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> taskCreate(JSONObject whereJson);
|
||||
Map<String, Object> taskCreate(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 任务处理
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> taskOperation(JSONObject whereJson);
|
||||
Map<String, Object> taskOperation(JSONObject whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> taskStatus(JSONObject whereJson);
|
||||
Map<String, Object> taskStatus(JSONObject whereJson) throws IOException;
|
||||
}
|
||||
|
||||
@@ -52,21 +52,18 @@ public class AcsToHJXServiceImpl implements AcsToHJXService {
|
||||
String msg = e.getMessage();
|
||||
log.info("actionRequest-----输出参数{}", msg);
|
||||
//网络不通
|
||||
// LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
||||
// String.valueOf(jsonObject),
|
||||
// String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位取货完成反馈失败");
|
||||
// luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
}
|
||||
log.info("actionRequest - 动作请求反馈{}", execute);
|
||||
// LuceneLogDto luceneLogDto = new LuceneLogDto(4, "actionRequest", "",
|
||||
// String.valueOf(jsonObject),
|
||||
// "", jsonObject.getString("task_code") + "动作请求反馈");
|
||||
// luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
||||
String.valueOf(jsonObject),
|
||||
String.valueOf(execute.body()), "向焊接线申请请求" + ("1".equals(jsonObject.getString("type")) ? "取货" : "放货"));
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
} catch (Exception e) {
|
||||
// LuceneLogDto luceneLogDto = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
||||
// JSON.toJSONString(execute.body()),
|
||||
// String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位动作请求反馈失败");
|
||||
// luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
log.info("actionRequest - 动作请求反馈{}", execute);
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
||||
String.valueOf(jsonObject),
|
||||
String.valueOf(execute.body()), "向焊接线申请请求" + ("1".equals(jsonObject.getString("type")) ? "取货" : "放货"));
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
}
|
||||
return execute;
|
||||
}
|
||||
|
||||
@@ -12,10 +12,14 @@ import org.nl.acs.ext.wms.service.AcsToMesService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.config.server.AcsConfigService;
|
||||
import org.nl.modules.logging.service.LogService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -33,6 +37,9 @@ public class AcsToMesServiceImpl implements AcsToMesService {
|
||||
@Autowired
|
||||
AcsConfigService acsConfigService;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneLogService;
|
||||
|
||||
@Autowired
|
||||
LogService logServer;
|
||||
|
||||
@@ -42,8 +49,7 @@ public class AcsToMesServiceImpl implements AcsToMesService {
|
||||
private String log_type="ACS请求LMS";
|
||||
|
||||
@Override
|
||||
public HttpResponse taskFeedback(JSONObject whereJson) {
|
||||
//TODO:改成中鼎
|
||||
public HttpResponse taskFeedback(JSONObject whereJson) throws IOException {
|
||||
String wmsUrl = paramService.findByCode("mes_url").getValue();
|
||||
AddressDto addressDto = addressService.findByCode("feedMesAgvTaskStatus");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
@@ -56,16 +62,21 @@ public class AcsToMesServiceImpl implements AcsToMesService {
|
||||
.execute();
|
||||
System.out.println(result);
|
||||
log.info("feedAgvTaskStatus----返回参数{}", result);
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
log.info("错误原因{}",msg);
|
||||
}
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "feedMesAgvTaskStatus", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse taskDeprecate(JSONObject whereJson) {
|
||||
public HttpResponse taskDeprecate(JSONObject whereJson) throws IOException {
|
||||
String wmsUrl = paramService.findByCode("mes_url").getValue();
|
||||
AddressDto addressDto = addressService.findByCode("acsCancelBack");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
@@ -83,11 +94,15 @@ public class AcsToMesServiceImpl implements AcsToMesService {
|
||||
//网络不通
|
||||
//System.out.println(msg);
|
||||
}
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "feedMesAgvTaskStatus", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse deviceStatusUpdate(JSONObject whereJson) {
|
||||
public HttpResponse deviceStatusUpdate(JSONObject whereJson) throws IOException {
|
||||
String wmsUrl = paramService.findByCode("mes_url").getValue();
|
||||
AddressDto addressDto = addressService.findByCode("deviceStatusUpdate");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
@@ -105,6 +120,10 @@ public class AcsToMesServiceImpl implements AcsToMesService {
|
||||
//网络不通
|
||||
//System.out.println(msg);
|
||||
}
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "deviceStatusUpdate", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,14 @@ import org.nl.acs.ext.wms.service.AcsToZDWmsService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.config.server.AcsConfigService;
|
||||
import org.nl.modules.logging.service.LogService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -33,6 +37,8 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
|
||||
AddressService addressService;
|
||||
@Autowired
|
||||
AcsConfigService acsConfigService;
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneLogService;
|
||||
|
||||
@Autowired
|
||||
LogService logServer;
|
||||
@@ -43,8 +49,7 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
|
||||
private String log_type="ACS请求LMS";
|
||||
|
||||
@Override
|
||||
public HttpResponse taskFeedback(JSONObject whereJson) {
|
||||
//TODO:改成中鼎
|
||||
public HttpResponse taskFeedback(JSONObject whereJson) throws IOException {
|
||||
//String wmsUrl = "172.30.15.32:30010";
|
||||
String wmsUrl = paramService.findByCode("wms_url").getValue();
|
||||
AddressDto addressDto = addressService.findByCode("feedZdAgvTaskStatus");
|
||||
@@ -58,16 +63,24 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
|
||||
.execute();
|
||||
System.out.println(result);
|
||||
log.info("feedAgvTaskStatus----返回参数{}", result);
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "feedZdAgvTaskStatus", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
log.info("错误原因{}",msg);
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "feedZdAgvTaskStatus", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse taskDeprecate(JSONObject whereJson) {
|
||||
public HttpResponse taskDeprecate(JSONObject whereJson) throws IOException{
|
||||
String wmsUrl = paramService.findByCode("wms_url").getValue();
|
||||
AddressDto addressDto = addressService.findByCode("acsCancelBack");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
@@ -80,10 +93,18 @@ public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
|
||||
.execute();
|
||||
System.out.println(result);
|
||||
log.info("deprecateWmsTask----返回参数{}", result);
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "acsCancelBack", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
//System.out.println(msg);
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "acsCancelBack", String.valueOf(result.getStatus()),
|
||||
String.valueOf(whereJson),
|
||||
String.valueOf(result.body()), addressDto.getMethods_name());
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -11,11 +11,14 @@ import org.nl.acs.route.service.RouteLineService;
|
||||
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.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
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;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -31,13 +34,19 @@ public class MesToAcsServiceImpl implements MesToAcsService {
|
||||
TaskService taskService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneLogService;
|
||||
@Autowired
|
||||
LogService logServer;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskCreate(JSONObject whereJson) {
|
||||
public Map<String, Object> taskCreate(JSONObject whereJson) throws IOException {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
log.info("taskCreate--------------:输入参数:" + whereJson.toString());
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "taskMESCreate", null,
|
||||
String.valueOf(whereJson),
|
||||
"", "接收mes任务");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
//获取甲方wcs传过来的参数
|
||||
JSONObject params = whereJson.getJSONObject("params");
|
||||
String locationFrom = whereJson.getString("locationFrom");
|
||||
@@ -259,9 +268,13 @@ public class MesToAcsServiceImpl implements MesToAcsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskOperation(JSONObject whereJson) {
|
||||
public Map<String, Object> taskOperation(JSONObject whereJson) throws IOException {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
log.info("taskOperation--------------:输入参数:" + whereJson.toString());
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "mesTaskOperation", null,
|
||||
String.valueOf(whereJson),
|
||||
"", "MES发起任务操作");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
String wmsTaskCode = whereJson.getString("wmsTaskCode");
|
||||
String operation = whereJson.getString("operation");
|
||||
if (ObjectUtil.isEmpty(wmsTaskCode)) {
|
||||
@@ -294,9 +307,13 @@ public class MesToAcsServiceImpl implements MesToAcsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskStatus(JSONObject whereJson) {
|
||||
public Map<String, Object> taskStatus(JSONObject whereJson) throws IOException {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
log.info("taskStatus--------------:输入参数:" + whereJson.toString());
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "mesTaskStatus", null,
|
||||
String.valueOf(whereJson),
|
||||
"", "MES查询任务状态");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
String taskCode = whereJson.getString("taskCode");
|
||||
if (ObjectUtil.isEmpty(taskCode)) {
|
||||
map.put("status", "400");
|
||||
|
||||
@@ -12,12 +12,15 @@ 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.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
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;
|
||||
import oshi.driver.mac.net.NetStat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -32,12 +35,18 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
|
||||
@Autowired
|
||||
TaskService taskService;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneLogService;
|
||||
|
||||
@Autowired
|
||||
LogService logServer;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskCreate(JSONObject whereJson) {
|
||||
public Map<String, Object> taskCreate(JSONObject whereJson) throws IOException {
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "taskWMSCreate", null,
|
||||
String.valueOf(whereJson),
|
||||
"", "接收wms任务");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
log.info("taskCreate--------------:输入参数:" + whereJson.toString());
|
||||
//获取甲方wcs传过来的参数
|
||||
@@ -262,9 +271,13 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskOperation(JSONObject whereJson) {
|
||||
public Map<String, Object> taskOperation(JSONObject whereJson) throws IOException {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
log.info("taskOperation--------------:输入参数:" + whereJson.toString());
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "wmsTaskOperation", null,
|
||||
String.valueOf(whereJson),
|
||||
"", "wms发起任务操作");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
String wmsTaskCode = whereJson.getString("wmsTaskCode");
|
||||
String operation = whereJson.getString("operation");
|
||||
if (ObjectUtil.isEmpty(wmsTaskCode)) {
|
||||
@@ -297,9 +310,13 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskStatus(JSONObject whereJson) {
|
||||
public Map<String, Object> taskStatus(JSONObject whereJson) throws IOException {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
log.info("taskStatus--------------:输入参数:" + whereJson.toString());
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "wmsTaskStatus", null,
|
||||
String.valueOf(whereJson),
|
||||
"", "wms查询任务状态");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
String taskCode = whereJson.getString("taskCode");
|
||||
if (ObjectUtil.isEmpty(taskCode)) {
|
||||
map.put("status", "400");
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
package org.nl.modules.lucene.rest;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.*;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.modules.lucene.service.LuceneService;
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -14,7 +27,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@@ -40,4 +54,11 @@ public class LuceneController {
|
||||
public ResponseEntity<Object> get(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(luceneService.getAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getAddressLog")
|
||||
@Log("接口日志检索")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public ResponseEntity<Object> getAddressLog(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(luceneService.getAddressLog(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ public interface LuceneService {
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> getAll(Map whereJson, Pageable page);
|
||||
|
||||
Map<String, Object> getAddressLog(Map whereJson, Pageable page);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,34 @@
|
||||
package org.nl.modules.lucene.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.*;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.nl.modules.lucene.common.LuceneIndexWriter;
|
||||
import org.nl.modules.lucene.common.Searcher;
|
||||
import org.nl.modules.lucene.service.LuceneService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@Service
|
||||
@@ -82,4 +98,30 @@ public class LuceneServiceImpl implements LuceneService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAddressLog(Map whereJson, Pageable page) {
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
try {
|
||||
JSONObject jsonObject = (JSONObject) Searcher.search(luceneUrl, "", whereJson);
|
||||
JSONArray array = jsonObject.getJSONArray("content");
|
||||
int totalElements = Integer.parseInt(jsonObject.get("totalElements").toString());
|
||||
jo.put("content", array);
|
||||
jo.put("totalElements", totalElements);
|
||||
} catch (Exception e) {
|
||||
log.error("索引查询为空", e);
|
||||
throw new NullPointerException("索引查询为空");
|
||||
}
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
public static String getDate(String timeString) throws ParseException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");//时间格式
|
||||
Date date = sdf.parse(timeString);
|
||||
timeString = DateUtil.format(date, "yyyy-MM-dd HH:mm:ss.SSS");//格式化后的时间
|
||||
return timeString;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<included>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE22" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/ACS请求焊接线/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
<charset>${log.charset}</charset>
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.AcsToHJXServiceImpl" level="info" additivity="true">
|
||||
<appender-ref ref="FILE22"/>
|
||||
</logger>
|
||||
</included>
|
||||
@@ -27,7 +27,7 @@
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org/nl/acs/ext/wms/service/impl/AcsToMesServiceImpl" level="info" additivity="false">
|
||||
<logger name="org/nl/acs/ext/wms/service/impl/AcsToMesServiceImpl" level="info" additivity="true">
|
||||
<appender-ref ref="FILE22"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org/nl/acs/ext/wms/service/impl/MesToAcsServiceImpl" level="info" additivity="false">
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.MesToAcsServiceImpl" level="info" additivity="true">
|
||||
<appender-ref ref="FILE22"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org/nl/acs/ext/wms/service/impl/WmsZDToAcsServiceImpl" level="info" additivity="false">
|
||||
<logger name="org/nl/acs/ext/wms/service/impl/WmsZDToAcsServiceImpl" level="info" additivity="true">
|
||||
<appender-ref ref="FILE22"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
@@ -8,6 +8,13 @@ export function add(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function queryAddressCodeList() {
|
||||
return request({
|
||||
url: 'api/Address/queryAddressCodeList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/Address/',
|
||||
@@ -24,4 +31,4 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export default { add, edit, del, queryAddressCodeList }
|
||||
|
||||
146
acs/nladmin-ui/src/views/monitor/logQuery/index.vue
Normal file
146
acs/nladmin-ui/src/views/monitor/logQuery/index.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<Search />
|
||||
<crudOperation />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55"/>-->
|
||||
<!-- <el-table-column v-if="false" prop="id" label="id"/>-->
|
||||
<!-- <el-table-column prop="trace_id" label="链路追踪" /> -->
|
||||
<el-table-column prop="method" label="方法" width="150px" />
|
||||
<el-table-column prop="requestparam" label="请求参数" class="text-wrapper">
|
||||
<template slot-scope="scope">
|
||||
<div @click="handleClick(scope.row.requestparam)">
|
||||
{{ truncateOrFullText(scope.row.requestparam) }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="responseparam" label="返回参数" class="text-wrapper">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<pre class="json-pre">{{ scope.row.responseparam }}</pre>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="logTime" label="记录时间" width="190px" />
|
||||
<el-table-column prop="content" label="内容详情" class="text-wrapper" />
|
||||
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Search from './search'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { delAll } from '@/api/acs/lucene/log'
|
||||
|
||||
export default {
|
||||
name: 'LuceneLog',
|
||||
components: { Search, pagination, crudOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds: function() {
|
||||
return CRUD({
|
||||
title: '系统参数', url: 'api/lucene/getAddressLog', idField: 'id', sort: 'id,desc',
|
||||
queryOnPresenterCreated: true,
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
},
|
||||
page: {
|
||||
size: 40,
|
||||
total: 0,
|
||||
page: 0
|
||||
},
|
||||
query: {
|
||||
createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))]
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: { blurry: '123' },
|
||||
permission: {
|
||||
add: ['admin', 'param:add'],
|
||||
edit: ['admin', 'param:edit'],
|
||||
del: ['admin', 'param:del']
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
truncateOrFullText(text) {
|
||||
if (text.length > 1000) {
|
||||
return text.slice(0, 1000) + '...'
|
||||
}
|
||||
return text
|
||||
},
|
||||
handleClick(content) {
|
||||
if (content.length > 1000) {
|
||||
this.$alert(content, '完整内容', {
|
||||
confirmButtonText: '关闭',
|
||||
dangerouslyUseHTMLString: true,
|
||||
customClass: 'full-content-alert'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
confirmDelAll() {
|
||||
this.$confirm(`确认清空所有操作日志吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.delAllLoading = true
|
||||
delAll('device_execute').then(res => {
|
||||
this.crud.delAllLoading = false
|
||||
this.crud.dleChangePage(1)
|
||||
this.crud.delSuccessNotify()
|
||||
this.crud.toQuery()
|
||||
}).catch(err => {
|
||||
this.crud.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.text-wrapper {
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.full-content-alert {
|
||||
max-width: none; /* 如果需要自定义 tooltip 的宽度可以在这里设置 */
|
||||
}
|
||||
.json-pre {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
max-height: 200px; /* 根据需要设置最大高度 */
|
||||
overflow: auto; /* 添加滚动条 */
|
||||
white-space: pre-wrap; /* 保留空格和换行 */
|
||||
}
|
||||
</style>
|
||||
125
acs/nladmin-ui/src/views/monitor/logQuery/search.vue
Normal file
125
acs/nladmin-ui/src/views/monitor/logQuery/search.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="query.method"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入你要搜索的方法名"-->
|
||||
<!-- style="width: 200px;"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- />-->
|
||||
<el-select
|
||||
v-model="query.method"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的方法名"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in methods" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.requestparam"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的请求参数"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.responseparam"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的返回参数"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的内容详情"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<!--
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
-->
|
||||
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="datetimerange"
|
||||
:picker-options="pickerOptions"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
class="date-item1"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import { queryAddressCodeList } from '@/api/acs/Address'
|
||||
|
||||
export default {
|
||||
components: { rrOperation },
|
||||
mixins: [header()],
|
||||
|
||||
data() {
|
||||
return {
|
||||
methods: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
|
||||
value2: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
queryAddressCodeList().then(data => {
|
||||
this.methods = data.content
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.date-item1 {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 10px;
|
||||
height: 30.5px !important;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user