rev:增加报警信息
This commit is contained in:
@@ -550,6 +550,30 @@
|
||||
<version>3.0.13</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
|
||||
<!-- itext7 pdf核心 -->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>kernel</artifactId>
|
||||
<version>7.2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>layout</artifactId>
|
||||
<version>7.2.5</version>
|
||||
</dependency>
|
||||
<!-- 解决中文!必须引入中文字体 -->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>font-asian</artifactId>
|
||||
<version>7.2.5</version>
|
||||
</dependency>
|
||||
<!-- hutool继续保留 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.22</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
@@ -91,6 +91,8 @@ public class HkToAcsServiceImpl implements HkToAcsService {
|
||||
instruction.setExecute_device_code(instruction.getStart_point_code());
|
||||
instruction.setUpdate_time(now);
|
||||
instructionService.update(instruction);
|
||||
taskDto.setCar_no(robotCode);
|
||||
taskService.update(taskDto);
|
||||
}
|
||||
//method 回调2、任务完成/结束end
|
||||
else if (StrUtil.equals(method, "end")) {
|
||||
|
||||
@@ -301,6 +301,9 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
//(不需要WCS反馈)
|
||||
if (phase == 0x67) {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));
|
||||
} else if (phase == 0x73 || phase == 0x74) {
|
||||
// 电量上报、异常信息上报
|
||||
device = deviceAppService.findDeviceByCode(String.valueOf(agvaddr));
|
||||
} else {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.device_driver.basedriver.agv.ndcone;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -22,6 +23,12 @@ import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDr
|
||||
import org.nl.acs.ext.wms.data.one.feedBackTaskStatus.FeedBackTaskStatusRequest;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.acs.history.AgvFaultEnum;
|
||||
import org.nl.acs.history.domain.AcsDeviceErrorLog;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.history.service.mapper.AcsDeviceErrorLogMapper;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.impl.InstructionServiceImpl;
|
||||
@@ -32,6 +39,7 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.system.service.lucene.LuceneExecuteLogService;
|
||||
@@ -39,9 +47,7 @@ import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
@@ -64,11 +70,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll();
|
||||
int agvaddr = 0;
|
||||
int agvaddr_copy = 0;
|
||||
int weight = 0;
|
||||
String device_code = "";
|
||||
String errorCode = "7,8,9,10,11,12";
|
||||
int phase = 0;
|
||||
boolean flag = false;
|
||||
int x = 0; //x坐标
|
||||
@@ -147,6 +155,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
transportOrder = inst.getTask_code();
|
||||
//车辆分配任务时 状态为1 执行中
|
||||
task.setTask_status("1");
|
||||
task.setCar_no(String.valueOf(carno));
|
||||
taskserver.update(task);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data);
|
||||
//车辆状态归零
|
||||
@@ -585,6 +594,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
// isCharge = true;
|
||||
// }
|
||||
} else if (phase == 0x74) {
|
||||
Set<String> codeSet = new HashSet<>(Arrays.asList(errorCode.split(",")));
|
||||
if (codeSet.contains(String.valueOf(ikey)) && status != ikey) {
|
||||
DeviceErrorLogDto acsDeviceErrorLog = new DeviceErrorLogDto();
|
||||
acsDeviceErrorLog.setError_log_uuid(IdUtil.getStringId());
|
||||
acsDeviceErrorLog.setDevice_code(String.valueOf(agvaddr));
|
||||
acsDeviceErrorLog.setError_code(String.valueOf(ikey));
|
||||
acsDeviceErrorLog.setError_info(AgvFaultEnum.getDescByCode(ikey));
|
||||
acsDeviceErrorLog.setError_time(DateUtil.now());
|
||||
deviceErrorLogService.create(acsDeviceErrorLog);
|
||||
}
|
||||
status = ikey;
|
||||
} else if (phase == 0x75) {
|
||||
is_have = ikey;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package org.nl.acs.history;
|
||||
|
||||
public enum AgvFaultEnum {
|
||||
|
||||
FAULT_7(7, "急停触发"),
|
||||
FAULT_8(8, "避障触发"),
|
||||
FAULT_9(9, "货叉防撞开关触发"),
|
||||
FAULT_10(10, "触边触发"),
|
||||
FAULT_11(11, "手动模式"),
|
||||
FAULT_12(12, "导航丢失");
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
AgvFaultEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取描述,找不到返回空或者自定义文本
|
||||
*/
|
||||
public static String getDescByCode(Integer code) {
|
||||
for (AgvFaultEnum value : AgvFaultEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getDesc();
|
||||
}
|
||||
}
|
||||
return "未知故障";
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,23 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.itextpdf.kernel.font.PdfFont;
|
||||
import com.itextpdf.kernel.font.PdfFontFactory;
|
||||
import com.itextpdf.kernel.geom.PageSize;
|
||||
import com.itextpdf.kernel.pdf.PdfDocument;
|
||||
import com.itextpdf.kernel.pdf.PdfWriter;
|
||||
import com.itextpdf.layout.Document;
|
||||
import com.itextpdf.layout.element.Cell;
|
||||
import com.itextpdf.layout.element.Paragraph;
|
||||
import com.itextpdf.layout.element.Table;
|
||||
import com.itextpdf.layout.properties.TextAlignment;
|
||||
import com.itextpdf.layout.properties.UnitValue;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -18,6 +31,7 @@ import org.nl.acs.history.domain.AcsDeviceErrorLog;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.mapper.AcsDeviceErrorLogMapper;
|
||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
@@ -64,7 +78,7 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl<AcsDeviceErrorL
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String error_code = MapUtil.getStr(whereJson, "error_code");
|
||||
String error_info = MapUtil.getStr(whereJson, "error_info");
|
||||
String start_time = MapUtil.getStr(whereJson, "start_time");
|
||||
String start_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
LambdaQueryWrapper<AcsDeviceErrorLog> wrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
@@ -134,7 +148,7 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl<AcsDeviceErrorL
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/* @Override
|
||||
public void download(List<DeviceErrorLogDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (DeviceErrorLogDto acsDeviceErrorLog : all) {
|
||||
@@ -146,5 +160,62 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl<AcsDeviceErrorL
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void download(List<DeviceErrorLogDto> all, HttpServletResponse response) throws IOException {
|
||||
// 设置响应头【前端文件下载】
|
||||
response.setContentType("application/pdf");
|
||||
String fileName = "AGV报警记录.pdf";
|
||||
fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
// 构建PDF,设置【A4横向】核心改动
|
||||
PdfWriter writer = new PdfWriter(response.getOutputStream());
|
||||
PdfDocument pdfDoc = new PdfDocument(writer);
|
||||
// A4横向旋转
|
||||
pdfDoc.setDefaultPageSize(PageSize.A4.rotate());
|
||||
Document document = new Document(pdfDoc);
|
||||
|
||||
// 中文字体
|
||||
PdfFont font = PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H", PdfFontFactory.EmbeddingStrategy.PREFER_EMBEDDED);
|
||||
|
||||
// 标题
|
||||
Paragraph title = new Paragraph("AGV报警记录列表")
|
||||
.setFont(font)
|
||||
.setFontSize(14)
|
||||
.setTextAlignment(TextAlignment.CENTER);
|
||||
document.add(title);
|
||||
document.add(new Paragraph("\n"));
|
||||
// 表头
|
||||
String[] headers = {"设备编码", "报警编码", "报警信息", "报警时间"};
|
||||
// 等分列宽,不再使用固定宽度
|
||||
float[] columnWidths = new float[headers.length];
|
||||
Arrays.fill(columnWidths, 1);
|
||||
Table table = new Table(UnitValue.createPercentArray(columnWidths))
|
||||
.useAllAvailableWidth();
|
||||
// 渲染表头
|
||||
for (String header : headers) {
|
||||
Cell cell = new Cell()
|
||||
.add(new Paragraph(header)
|
||||
.setFont(font)
|
||||
.setFontSize(9)
|
||||
.setTextAlignment(TextAlignment.CENTER));
|
||||
table.addCell(cell);
|
||||
}
|
||||
// 渲染数据(空值兜底 + 字体9号)
|
||||
for (DeviceErrorLogDto dto : all) {
|
||||
// 设备编码
|
||||
table.addCell(new Cell().add(new Paragraph(dto.getDevice_code()).setFont(font)));
|
||||
// 报警编码
|
||||
table.addCell(new Cell().add(new Paragraph(dto.getError_code()).setFont(font)));
|
||||
// 报警信息
|
||||
table.addCell(new Cell().add(new Paragraph(dto.getError_info()).setFont(font)));
|
||||
// 报警时间
|
||||
table.addCell(new Cell().add(new Paragraph(dto.getError_time()).setFont(font)));
|
||||
}
|
||||
document.add(table);
|
||||
document.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +226,9 @@ public class Task extends CommonModel<Task> implements Serializable {
|
||||
/** 时间 */
|
||||
private String oven_time;
|
||||
|
||||
/** 车号 */
|
||||
private String car_no;
|
||||
|
||||
/** 交互字段 */
|
||||
private String interaction_json;
|
||||
|
||||
|
||||
@@ -68,5 +68,16 @@ public enum TaskStatusEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static TaskStatusEnum getByIndex(String index) {
|
||||
if (index == null || index.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (TaskStatusEnum status : TaskStatusEnum.values()) {
|
||||
if (status.getIndex().equals(index)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -311,4 +311,9 @@ public class TaskDto implements Serializable {
|
||||
* 行架任务类型
|
||||
*/
|
||||
private String truss_type;
|
||||
|
||||
/**
|
||||
* 车号
|
||||
*/
|
||||
private String car_no;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -14,6 +15,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.itextpdf.kernel.font.PdfFont;
|
||||
import com.itextpdf.kernel.font.PdfFontFactory;
|
||||
import com.itextpdf.kernel.geom.PageSize;
|
||||
import com.itextpdf.kernel.pdf.PdfDocument;
|
||||
import com.itextpdf.kernel.pdf.PdfWriter;
|
||||
import com.itextpdf.layout.Document;
|
||||
import com.itextpdf.layout.element.Cell;
|
||||
import com.itextpdf.layout.element.Paragraph;
|
||||
import com.itextpdf.layout.element.Table;
|
||||
import com.itextpdf.layout.properties.TextAlignment;
|
||||
import com.itextpdf.layout.properties.UnitValue;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.acs.AcsConfig;
|
||||
@@ -309,6 +321,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
String point_code = (String) whereJson.get("point_code");
|
||||
String create_time = (String) whereJson.get("createTime");
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
String car_no = (String) whereJson.get("car_no");
|
||||
|
||||
IPage<Task> queryPage = PageUtil.toMybatisPage(page);
|
||||
LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -321,6 +334,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
wrapper.eq(Task::getMaterial, material_type);
|
||||
}
|
||||
if (!StrUtil.isEmpty(car_no)) {
|
||||
wrapper.eq(Task::getCar_no, car_no);
|
||||
}
|
||||
if (!StrUtil.isEmpty(status)) {
|
||||
wrapper.eq(Task::getTask_status, status);
|
||||
}
|
||||
@@ -1275,6 +1291,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
String point_code = (String) whereJson.get("point_code");
|
||||
String create_time = (String) whereJson.get("createTime");
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
String car_no = (String) whereJson.get("car_no");
|
||||
|
||||
LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
|
||||
if (!StrUtil.isEmpty(task_code)) {
|
||||
@@ -1283,6 +1300,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
wrapper.like(Task::getVehicle_code, vehicle_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(car_no)) {
|
||||
wrapper.like(Task::getCar_no, car_no);
|
||||
}
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
wrapper.eq(Task::getMaterial, material_type);
|
||||
}
|
||||
@@ -1322,7 +1342,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
/* @Override
|
||||
public void downloadTaskLogging(List<JSONObject> taskAndInst, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (JSONObject jsonObject : taskAndInst) {
|
||||
@@ -1342,6 +1362,83 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void downloadTaskLogging(List<JSONObject> dataList, HttpServletResponse response) throws IOException {
|
||||
// 设置响应头【前端文件下载】
|
||||
response.setContentType("application/pdf");
|
||||
String fileName = "任务历史记录.pdf";
|
||||
fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
// 构建PDF,设置【A4横向】核心改动
|
||||
PdfWriter writer = new PdfWriter(response.getOutputStream());
|
||||
PdfDocument pdfDoc = new PdfDocument(writer);
|
||||
// A4横向旋转
|
||||
pdfDoc.setDefaultPageSize(PageSize.A4.rotate());
|
||||
Document document = new Document(pdfDoc);
|
||||
|
||||
// 中文字体
|
||||
PdfFont font = PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H", PdfFontFactory.EmbeddingStrategy.PREFER_EMBEDDED);
|
||||
|
||||
// 标题
|
||||
Paragraph title = new Paragraph("任务历史记录列表")
|
||||
.setFont(font)
|
||||
.setFontSize(14)
|
||||
.setTextAlignment(TextAlignment.CENTER);
|
||||
document.add(title);
|
||||
document.add(new Paragraph("\n"));
|
||||
// 表头
|
||||
String[] headers = {"任务号", "载具号", "任务状态", "任务优先级", "起点", "终点", "车号","备注",
|
||||
"创建人","创建时间","完成时间"
|
||||
};
|
||||
// 等分列宽,不再使用固定宽度
|
||||
float[] columnWidths = new float[headers.length];
|
||||
Arrays.fill(columnWidths, 1);
|
||||
Table table = new Table(UnitValue.createPercentArray(columnWidths))
|
||||
.useAllAvailableWidth();
|
||||
// 渲染表头
|
||||
for (String header : headers) {
|
||||
Cell cell = new Cell()
|
||||
.add(new Paragraph(header)
|
||||
.setFont(font)
|
||||
.setFontSize(9)
|
||||
.setTextAlignment(TextAlignment.CENTER));
|
||||
table.addCell(cell);
|
||||
}
|
||||
// 渲染数据(空值兜底 + 字体9号)
|
||||
for (JSONObject json : dataList) {
|
||||
// 任务号
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("task_code")).setFont(font)));
|
||||
// 载具号
|
||||
String vehicleCode = json.getString("vehicle_code");
|
||||
table.addCell(new Cell().add(new Paragraph(ObjectUtil.isNotEmpty(vehicleCode) ? vehicleCode : "-").setFont(font)));
|
||||
// 任务状态
|
||||
TaskStatusEnum taskStatus = TaskStatusEnum.getByIndex(json.getString("task_status"));
|
||||
table.addCell(new Cell().add(new Paragraph(taskStatus.getName()).setFont(font)));
|
||||
// 任务优先级
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("priority")).setFont(font)));
|
||||
// 起点
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("start_point_code")).setFont(font)));
|
||||
// 终点
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("next_point_code")).setFont(font)));
|
||||
// 车号
|
||||
String car_no = json.getString("car_no");
|
||||
table.addCell(new Cell().add(new Paragraph(ObjectUtil.isNotEmpty(car_no) ? car_no : "-").setFont(font)));
|
||||
// 备注
|
||||
String remark = json.getString("remark");
|
||||
table.addCell(new Cell().add(new Paragraph(ObjectUtil.isNotEmpty(remark) ? remark : "-").setFont(font)));
|
||||
// 创建人
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("create_by")).setFont(font)));
|
||||
// 创建时间
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("create_time")).setFont(font)));
|
||||
// 完成时间
|
||||
table.addCell(new Cell().add(new Paragraph(json.getString("update_time")).setFont(font)));
|
||||
}
|
||||
document.add(table);
|
||||
document.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1360,8 +1457,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
ins.put("priority", task.getPriority());
|
||||
ins.put("start_point_code", task.getStart_point_code());
|
||||
ins.put("next_point_code", task.getNext_point_code());
|
||||
ins.put("matarial", task.getMaterial());
|
||||
ins.put("quantity", task.getQuantity());
|
||||
ins.put("car_no", task.getCar_no());
|
||||
ins.put("remark", task.getRemark());
|
||||
ins.put("create_by", task.getCreate_by());
|
||||
ins.put("create_time", task.getCreate_time());
|
||||
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
'alarm_message': '报警信息',
|
||||
'start_time': '开始日期',
|
||||
'end_time': '结束日期',
|
||||
'error_time': '错误时间'
|
||||
'error_time': '报警时间'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export const constantRouterMap = [
|
||||
children: [
|
||||
{
|
||||
path: 'dashboard',
|
||||
component: (resolve) => require(['@/views/track/showTrack'], resolve),
|
||||
component: (resolve) => require(['@/views/monitor/server/index'], resolve),
|
||||
// component: (resolve) => require(['@/views/monitor/server/index'], resolve),
|
||||
name: 'Dashboard',
|
||||
meta: { title: i18n.t('auto.common.home'), icon: 'index', affix: true, noCache: true }
|
||||
|
||||
@@ -4,42 +4,35 @@
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">{{ $t('errorLog.table.device_code') }}</label>
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
:placeholder="$t('errorLog.table.device_code')"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.error_code"
|
||||
clearable
|
||||
:placeholder="$t('errorLog.table.alarm_code')"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.error_info"
|
||||
clearable
|
||||
:placeholder="$t('errorLog.table.alarm_message')"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="value"
|
||||
type="datetimerange"
|
||||
style="height: 30.5px; display: inline-block; vertical-align: middle; margin: 0 3px 10px 0; line-height: 30.5px;"
|
||||
:end-placeholder="$t('errorLog.table.end_time')"
|
||||
:start-placeholder="$t('errorLog.table.start_time')"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
:picker-options="pickerOptions"
|
||||
@change="pickerChange"
|
||||
/>
|
||||
<rrOperation :crud="crud" />
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="车号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
@@ -137,6 +130,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
downLoadDeviceErrorLogging: false,
|
||||
permission: {
|
||||
add: ['admin', 'deviceErrorLog:add'],
|
||||
edit: ['admin', 'deviceErrorLog:edit'],
|
||||
@@ -195,20 +189,18 @@ export default {
|
||||
}
|
||||
},
|
||||
doExportDeviceErrorLogging() {
|
||||
this.downLoadTaskLogging = true
|
||||
const params = {
|
||||
device_code: this.query.device_code,
|
||||
error_code: this.query.error_code,
|
||||
error_info: this.query.error_info,
|
||||
start_time: this.query.start_time,
|
||||
end_time: this.query.end_time
|
||||
this.downLoadDeviceErrorLogging = true
|
||||
const params = this.crud.query
|
||||
if (this.crud.query.createTime !== undefined) {
|
||||
params.begin_time = this.crud.query.createTime[0]
|
||||
params.end_time = this.crud.query.createTime[1]
|
||||
}
|
||||
const url = '/api/deviceErrorLog/download'
|
||||
download(url, params).then(result => {
|
||||
downloadFile(result, this.crud.title + '数据', 'csv')
|
||||
this.downLoadTaskTreeLogging = false
|
||||
downloadFile(result, '设备报警记录', 'pdf')
|
||||
this.downLoadDeviceErrorLogging = false
|
||||
}).catch(() => {
|
||||
this.downLoadTaskTreeLogging = false
|
||||
this.downLoadDeviceErrorLogging = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,20 +32,6 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Material_type')">
|
||||
<el-select
|
||||
v-model="query.material_type"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
:placeholder="$t('task.txt_box.Material_type')"
|
||||
class="filter-item"
|
||||
style="width: 190px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in materialList" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Task_status')">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
@@ -60,20 +46,6 @@
|
||||
<el-option v-for="item in dict.task_status" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Task_type')">
|
||||
<el-select
|
||||
v-model="query.task_type"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
:placeholder="$t('task.txt_box.Task_type')"
|
||||
class="filter-item"
|
||||
style="width: 190px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in dict.task_type" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Origin_or_destination')">
|
||||
<el-input
|
||||
v-model="query.point_code"
|
||||
@@ -85,21 +57,29 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.time')">
|
||||
<Search />
|
||||
<el-form-item label="车号">
|
||||
<el-input
|
||||
v-model="query.car_no"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="车号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
<!-- <el-input-->
|
||||
<!-- v-if="false"-->
|
||||
<!-- v-model="query.is_over"-->
|
||||
<!-- value="1"-->
|
||||
<!-- size="small"-->
|
||||
<!-- clearable-->
|
||||
<!-- :placeholder="$t('TaskRecord.table.Task_code')"-->
|
||||
<!-- style="width: 200px;"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- @keyup.enter.native="crud.toQuery"-->
|
||||
<!-- />-->
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
@@ -293,11 +273,10 @@
|
||||
<el-table-column prop="priority" :label="$t('TaskRecord.table.Priority')" :min-width="flexWidth('priority',crud.data,$t('TaskRecord.table.Priority'))" />
|
||||
<el-table-column prop="start_point_code" :label="$t('task.select.Start_point')" :min-width="flexWidth('start_point_code',crud.data,$t('task.select.Start_point'))" />
|
||||
<el-table-column prop="next_point_code" :label="$t('task.select.Destination')" :min-width="flexWidth('next_point_code',crud.data,$t('task.select.Destination'))" />
|
||||
<el-table-column prop="start_point_code2" :label="$t('TaskRecord.table.Starting_point_two')" :min-width="flexWidth('start_point_code2',crud.data,$t('TaskRecord.table.Starting_point_two'))" />
|
||||
<el-table-column prop="next_point_code2" :label="$t('TaskRecord.table.Endpoint_two')" :min-width="flexWidth('next_point_code2',crud.data,$t('TaskRecord.table.Endpoint_two'))" />
|
||||
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" :show-overflow-tooltip="true" width="150px" />
|
||||
<el-table-column prop="matarial" :label="$t('TaskRecord.table.Material')" />
|
||||
<el-table-column prop="quantity" :label="$t('TaskRecord.table.Quantity')" />
|
||||
<!-- <el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" :show-overflow-tooltip="true" width="150px" />-->
|
||||
<!-- <el-table-column prop="matarial" :label="$t('TaskRecord.table.Material')" />-->
|
||||
<!-- <el-table-column prop="quantity" :label="$t('TaskRecord.table.Quantity')" />-->
|
||||
<el-table-column prop="car_no" label="车号" />
|
||||
<el-table-column prop="remark" :label="$t('task.select.Remark')" />
|
||||
<el-table-column prop="create_by" :label="$t('task.select.Creator')" />
|
||||
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" width="135" />
|
||||
@@ -315,6 +294,7 @@ import Search from '@/views/lucene/time'
|
||||
import crudTask from '@/api/acs/task/task'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import routeCurd from '@/api/acs/route/routePlan'
|
||||
@@ -344,7 +324,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Task',
|
||||
components: { pagination, crudOperation, Search },
|
||||
components: { pagination, crudOperation, Search, rrOperation },
|
||||
dicts: ['task_status', 'task_type'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
@@ -413,6 +393,7 @@ export default {
|
||||
toYList: [],
|
||||
toZList: [],
|
||||
start_flag: false,
|
||||
downLoadTaskLogging: false,
|
||||
end_flag: false,
|
||||
permission: {
|
||||
add: ['admin', 'task:add'],
|
||||
@@ -486,22 +467,18 @@ export default {
|
||||
})
|
||||
},
|
||||
doExportTaskLogging() {
|
||||
this.downLoadTaskLogging = true
|
||||
const params = {
|
||||
task_code: this.query.task_code,
|
||||
vehicle_code: this.query.vehicle_code,
|
||||
material_type: this.query.material_type,
|
||||
status: this.query.status,
|
||||
point_code: this.crud.pointCode,
|
||||
createTime: this.crud.createTime,
|
||||
end_time: this.crud.endTime // 假设 this.crud.endTime 是你的结束时间
|
||||
const params = this.crud.query
|
||||
if (this.crud.query.createTime !== undefined) {
|
||||
params.begin_time = this.crud.query.createTime[0]
|
||||
params.end_time = this.crud.query.createTime[1]
|
||||
}
|
||||
const url = 'api/task/downloadTaskLogging'
|
||||
this.downLoadTaskLogging = true
|
||||
download(url, params).then(result => {
|
||||
downloadFile(result, this.crud.title + '数据', 'csv')
|
||||
this.downLoadTaskTreeLogging = false
|
||||
downloadFile(result, '任务历史数据', 'pdf')
|
||||
this.downLoadTaskLogging = false
|
||||
}).catch(() => {
|
||||
this.downLoadTaskTreeLogging = false
|
||||
this.downLoadTaskLogging = false
|
||||
})
|
||||
},
|
||||
beforeHandleCommand(index, row, command) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div style="color: #666;font-size: 13px;">
|
||||
<svg-icon icon-class="system" style="margin-right: 5px" />
|
||||
<span>
|
||||
{{ $t('auto.monitor.sys') }}:{{ data.sys.os }}
|
||||
{{ $t('auto.monitor.sys') }}:{{ "Windows Server 2022 Standard" }}
|
||||
</span>
|
||||
<span>
|
||||
IP:{{ data.sys.ip }}
|
||||
@@ -13,6 +13,9 @@
|
||||
<span>
|
||||
{{ $t('auto.monitor.day') }}:{{ data.sys.day }}
|
||||
</span>
|
||||
<span>
|
||||
系统版本:{{ "V1.0"}}
|
||||
</span>
|
||||
<i class="el-icon-refresh" style="margin-left: 40px" @click="init" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
Reference in New Issue
Block a user