Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_two
This commit is contained in:
@@ -443,6 +443,26 @@
|
||||
<version>${commons-csv.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -389,6 +389,19 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
//查找有没有对应的指令
|
||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||
if (ObjectUtil.isNotNull(inst) && "1".equals(inst.getInstruction_type())) {
|
||||
List<RouteLineDto> routeLineDtos = routeLineService.selectDeviceCodeList(this.device_code);
|
||||
if (routeLineDtos.size() < 1) {
|
||||
return false;
|
||||
}
|
||||
int i = 0;
|
||||
for (RouteLineDto routeLineDto : routeLineDtos) {
|
||||
if (routeLineDto.getNext_device_code().equals(inst.getNext_device_code())) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return false;
|
||||
}
|
||||
Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code());
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
|
||||
@@ -485,7 +498,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("指令创建失败!", e.getMessage());
|
||||
log.error("指令创建失败!,{}", e.getMessage());
|
||||
return false;
|
||||
}
|
||||
taskdto.setTask_status("1");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -201,12 +201,10 @@ public class ItemProtocol {
|
||||
public Integer getItem_heartbeat() {
|
||||
return this.getOpcIntegerValue(item_heartbeat);
|
||||
}
|
||||
|
||||
public Integer getItem_deviceCode() {
|
||||
public Integer getItem_device_Code(){
|
||||
return this.getOpcIntegerValue(item_deviceCode);
|
||||
}
|
||||
|
||||
public Integer getItem_mode() {
|
||||
public Integer getItem_mode(){
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
|
||||
@@ -217,103 +215,96 @@ public class ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
public Integer getItem_front_command() {
|
||||
public Integer getItem_front_command(){
|
||||
return this.getOpcIntegerValue(item_front_command);
|
||||
}
|
||||
|
||||
public Integer getItem_back_command() {
|
||||
public Integer getItem_back_command(){
|
||||
return this.getOpcIntegerValue(item_back_command);
|
||||
}
|
||||
|
||||
public Integer getItem_front_task() {
|
||||
public Integer getItem_front_task(){
|
||||
return this.getOpcIntegerValue(item_front_task);
|
||||
}
|
||||
|
||||
public Integer getItem_front_ZError() {
|
||||
public Integer getItem_front_ZError(){
|
||||
return this.getOpcIntegerValue(item_front_ZError);
|
||||
}
|
||||
|
||||
|
||||
public Integer getItem_back_ZError() {
|
||||
public Integer getItem_back_ZError(){
|
||||
return this.getOpcIntegerValue(item_back_ZError);
|
||||
}
|
||||
|
||||
|
||||
public Integer getItem_front_z() {
|
||||
|
||||
public Integer getItem_front_z(){
|
||||
return this.getOpcIntegerValue(item_front_z);
|
||||
}
|
||||
|
||||
|
||||
public Integer getItem_front_x() {
|
||||
public Integer getItem_front_x(){
|
||||
return this.getOpcIntegerValue(item_front_x);
|
||||
}
|
||||
|
||||
public Integer getItem_front_y() {
|
||||
public Integer getItem_front_y(){
|
||||
return this.getOpcIntegerValue(item_front_y);
|
||||
}
|
||||
|
||||
public Integer getItem_back_z() {
|
||||
public Integer getItem_back_z(){
|
||||
return this.getOpcIntegerValue(item_front_z);
|
||||
}
|
||||
|
||||
|
||||
public Integer getItem_back_x() {
|
||||
public Integer getItem_back_x(){
|
||||
return this.getOpcIntegerValue(item_front_x);
|
||||
}
|
||||
|
||||
public Integer getItem_back_y() {
|
||||
public Integer getItem_back_y(){
|
||||
return this.getOpcIntegerValue(item_front_y);
|
||||
}
|
||||
|
||||
public float getItem_special1() {
|
||||
public float getItem_special1(){
|
||||
return this.getOpcFloatValue(item_special1);
|
||||
}
|
||||
|
||||
public float getItem_front_forkCargo() {
|
||||
public float getItem_front_forkCargo(){
|
||||
return this.getOpcFloatValue(item_front_forkCargo);
|
||||
}
|
||||
|
||||
public float getItem_back_forkCargo() {
|
||||
public float getItem_back_forkCargo(){
|
||||
return this.getOpcFloatValue(item_back_forkCargo);
|
||||
}
|
||||
|
||||
public float getItem_front_forkLocation() {
|
||||
public float getItem_front_forkLocation(){
|
||||
return this.getOpcFloatValue(item_front_forkLocation);
|
||||
}
|
||||
|
||||
public float getItem_back_forkLocation() {
|
||||
public float getItem_back_forkLocation(){
|
||||
return this.getOpcFloatValue(item_back_forkLocation);
|
||||
}
|
||||
|
||||
public float getItem_front_forkAction() {
|
||||
public float getItem_front_forkAction(){
|
||||
return this.getOpcFloatValue(item_front_forkAction);
|
||||
}
|
||||
|
||||
public float getItem_back_forkAction() {
|
||||
public float getItem_back_forkAction(){
|
||||
return this.getOpcFloatValue(item_back_forkAction);
|
||||
}
|
||||
|
||||
public float getItem_special2() {
|
||||
public float getItem_special2(){
|
||||
return this.getOpcFloatValue(item_special2);
|
||||
}
|
||||
|
||||
public float getItem_storage_cache() {
|
||||
public float getItem_storage_cache(){
|
||||
return this.getOpcFloatValue(item_storage_cache);
|
||||
}
|
||||
|
||||
public Integer getItem_stacker_rpm() {
|
||||
return this.getOpcIntegerValue(item_stacker_rpm);
|
||||
public Integer getItem_stacker_rpm(){
|
||||
return this.getOpcIntegerValue(item_stacker_rpm);
|
||||
}
|
||||
|
||||
public Integer getItem_stacker_electricCurrent() {
|
||||
public Integer getItem_stacker_electricCurrent(){
|
||||
return this.getOpcIntegerValue(item_stacker_electricCurrent);
|
||||
}
|
||||
|
||||
public Integer getItem_stacker_workingHours() {
|
||||
public Integer getItem_stacker_workingHours(){
|
||||
return this.getOpcIntegerValue(item_stacker_workingHours);
|
||||
}
|
||||
|
||||
public Integer getItem_stacker_runingTime() {
|
||||
public Integer getItem_stacker_runingTime(){
|
||||
return this.getOpcIntegerValue(item_stacker_runingTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @author ls
|
||||
* @date 2023/12/4 13:42
|
||||
*/
|
||||
package org.nl.acs.device_driver.basedriver.double_station_stacker.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CommandEnum {
|
||||
STANDY(0,"待机"),
|
||||
PICKUP(1,"取货中"),
|
||||
PICKUP_COMPLETE(2,"取货完成"),
|
||||
RELEASE(3,"放货中"),
|
||||
UNLOAD(4,"请求卸货"),
|
||||
UNLOAD_COMPLETE(5,"卸货完成"),
|
||||
PICKUP_PREPARATION(6,"取货准备"),
|
||||
RECALL(7,"召回"),
|
||||
STOP(8,"急停");
|
||||
|
||||
private Integer status;
|
||||
private String desc;
|
||||
|
||||
public static String getDesc(Integer status) {
|
||||
for (CommandEnum c : CommandEnum.values()) {
|
||||
if (c.getStatus().equals(status)) {
|
||||
return c.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @author ls
|
||||
* @date 2023/12/4 17:43
|
||||
*/
|
||||
package org.nl.acs.device_driver.basedriver.double_station_stacker.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SortEnum {
|
||||
PRONT("1","正序"),
|
||||
BACK("2","倒序");
|
||||
|
||||
private String code;
|
||||
private String desc;
|
||||
}
|
||||
@@ -622,13 +622,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
map.put("to_task", inst.getInstruction_code());
|
||||
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x"))) {
|
||||
map.put("to_x", startDevice.getExtraValue().get("x"));
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z")) ) {
|
||||
map.put("to_x", startDevice.getExtraValue().get("z"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
|
||||
map.put("to_z", startDevice.getExtraValue().get("z"));
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x")) ) {
|
||||
map.put("to_z", startDevice.getExtraValue().get("x"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y"))) {
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y")) ) {
|
||||
map.put("to_y", startDevice.getExtraValue().get("y"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,4 +154,12 @@ public class InstructionController {
|
||||
instructionService.init(id);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/downloadInstLogging")
|
||||
@Log("导出指令记录")
|
||||
@ApiOperation("导出指令记录")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public void downloadInstLogging(HttpServletResponse response,@RequestParam Map whereJson) throws IOException {
|
||||
instructionService.downloadInstLogging(instructionService.getInstList(whereJson), response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.instruction.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.instruction.domain.InstructionMybatis;
|
||||
import org.nl.acs.instruction.service.dto.InstructionDto;
|
||||
import org.nl.acs.instruction.service.dto.InstructionQueryParam;
|
||||
@@ -327,5 +328,21 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
|
||||
* @param instruction1
|
||||
* @return
|
||||
*/
|
||||
|
||||
List<Instruction> findByDeviceCodes(Instruction instruction1, Boolean flay);
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件查询指令
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getInstList(Map whereJson);
|
||||
|
||||
/**
|
||||
* 导出指令记录
|
||||
* @param instList
|
||||
* @param response
|
||||
*/
|
||||
void downloadInstLogging(List<JSONObject> instList, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
@@ -1607,4 +1607,80 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
List<Instruction> instructions = ConvertUtil.convertList(instructionMybatis, Instruction.class);*/
|
||||
return instructionList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getInstList(Map whereJson) {
|
||||
String task_code = (String) whereJson.get("code");
|
||||
String vehicle_code = (String) whereJson.get("vehicle_code");
|
||||
String material_type = (String) whereJson.get("material_type");
|
||||
String status = (String) whereJson.get("status");
|
||||
String point_code = (String) whereJson.get("point_code");
|
||||
String create_time = (String) whereJson.get("createTime");
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
|
||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||
if (!StrUtil.isEmpty(task_code)) {
|
||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, task_code).or().like(InstructionMybatis::getTask_code, task_code));
|
||||
}
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
wrapper.like(InstructionMybatis::getVehicle_code, vehicle_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
wrapper.eq(InstructionMybatis::getMaterial, material_type);
|
||||
}
|
||||
if (!StrUtil.isEmpty(status)) {
|
||||
wrapper.eq(InstructionMybatis::getInstruction_status, status);
|
||||
}
|
||||
if (!StrUtil.isEmpty(point_code)) {
|
||||
wrapper.and(task -> task.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
|
||||
}
|
||||
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
||||
wrapper.between(InstructionMybatis::getCreate_time, create_time, end_time);
|
||||
}
|
||||
List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(wrapper);
|
||||
List<JSONObject> array = new ArrayList<>();
|
||||
if(instructionMybatis.size() > 0){
|
||||
for (InstructionMybatis inst : instructionMybatis) {
|
||||
JSONObject ins = new JSONObject();
|
||||
ins.put("instruction_code", inst.getInstruction_code());
|
||||
ins.put("task_code", inst.getTask_code());
|
||||
ins.put("vehicle_code", inst.getVehicle_code());
|
||||
ins.put("task_status", inst.getInstruction_status());
|
||||
ins.put("start_point_code", inst.getStart_point_code());
|
||||
ins.put("next_point_code", inst.getNext_point_code());
|
||||
ins.put("matarial", inst.getMaterial());
|
||||
ins.put("quantity", inst.getQuantity());
|
||||
ins.put("remark", inst.getRemark());
|
||||
ins.put("create_by", inst.getCreate_by());
|
||||
ins.put("create_time", inst.getCreate_time());
|
||||
ins.put("update_by", inst.getUpdate_by());
|
||||
ins.put("update_time", inst.getUpdate_time());
|
||||
array.add(ins);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadInstLogging(List<JSONObject> instList, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (JSONObject jsonObject : instList) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("指令编码", jsonObject.getString("instruction_code"));
|
||||
map.put("任务号", jsonObject.getString("task_code"));
|
||||
map.put("载具号", jsonObject.getString("vehicle_code"));
|
||||
map.put("指令状态", jsonObject.getString("task_status"));
|
||||
map.put("起点", jsonObject.getString("start_point_code"));
|
||||
map.put("终点", jsonObject.getString("next_point_code"));
|
||||
map.put("物料", jsonObject.getString("matarial"));
|
||||
map.put("数量", jsonObject.getString("quantity"));
|
||||
map.put("备注", jsonObject.getString("remark"));
|
||||
map.put("创建者", jsonObject.getString("create_by"));
|
||||
map.put("创建时间", jsonObject.getString("create_time"));
|
||||
map.put("修改者", jsonObject.getString("update_by"));
|
||||
map.put("修改时间", jsonObject.getString("update_time"));
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,4 +156,22 @@ public class TaskController {
|
||||
public ResponseEntity<Object> findAllTaskFromCache() {
|
||||
return new ResponseEntity<>(taskService.findAllTaskFromCache(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/downloadTaskTreeLogging")
|
||||
@Log("导出任务树形记录")
|
||||
@ApiOperation("导出任务树形记录")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public void downloadTaskTreeLogging(HttpServletResponse response,@RequestParam Map whereJson) throws IOException {
|
||||
taskService.downloadTaskTreeLogging(taskService.getTaskAndInst(whereJson), response);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/downloadTaskLogging")
|
||||
@Log("导出任务树形记录")
|
||||
@ApiOperation("导出任务树形记录")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public void downloadTaskLogging(HttpServletResponse response,@RequestParam Map whereJson) throws IOException {
|
||||
taskService.downloadTaskLogging(taskService.getTaskList(whereJson), response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -372,4 +372,36 @@ public interface TaskService extends CommonService<Task> {
|
||||
* @return
|
||||
*/
|
||||
Integer querySameDeviceReadyTask(String start_device, String next_device, String status);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 条件查询任务和指令
|
||||
* @param whereJson
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getTaskAndInst(Map whereJson);
|
||||
|
||||
/**
|
||||
* 导出任务树形记录
|
||||
* @param taskAndInst
|
||||
* @param response
|
||||
*/
|
||||
void downloadTaskTreeLogging(List<JSONObject> list, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 导出任务记录
|
||||
* @param all
|
||||
* @param response
|
||||
*/
|
||||
void downloadTaskLogging(List<JSONObject> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 查询任务
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getTaskList(Map whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.acs.task.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
@@ -11,6 +12,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
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.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
@@ -1677,6 +1679,176 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getTaskAndInst(Map whereJson) {
|
||||
String task_code = (String) whereJson.get("task_code");
|
||||
String vehicle_code = (String) whereJson.get("vehicle_code");
|
||||
String material_type = (String) whereJson.get("material_type");
|
||||
String status = (String) whereJson.get("status");
|
||||
String point_code = (String) whereJson.get("point_code");
|
||||
String create_time = (String) whereJson.get("createTime");
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
|
||||
LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
|
||||
if (!StrUtil.isEmpty(task_code)) {
|
||||
wrapper.eq(Task::getTask_code, task_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
wrapper.like(Task::getVehicle_code, vehicle_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
wrapper.eq(Task::getMaterial, material_type);
|
||||
}
|
||||
if (!StrUtil.isEmpty(status)) {
|
||||
wrapper.eq(Task::getTask_status, status);
|
||||
}
|
||||
if (!StrUtil.isEmpty(point_code)) {
|
||||
wrapper.and(task -> task.like(Task::getStart_point_code, point_code).or().like(Task::getNext_point_code, point_code));
|
||||
}
|
||||
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
||||
wrapper.between(Task::getCreate_time, create_time, end_time);
|
||||
}
|
||||
List<Task> taskList = taskMapper.selectList(wrapper);
|
||||
List<JSONObject> array = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(taskList) && taskList.size() > 0) {
|
||||
for (Task task : taskList) {
|
||||
JSONObject ins = new JSONObject();
|
||||
//ins.put("task_id", task.getTask_id());
|
||||
ins.put("task_code", task.getTask_code());
|
||||
ins.put("vehicle_code", task.getVehicle_code());
|
||||
ins.put("task_status", task.getTask_status());
|
||||
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("start_point_code2", task.getStart_point_code2());
|
||||
ins.put("next_point_code2", task.getNext_point_code2());
|
||||
ins.put("matarial", task.getMaterial());
|
||||
ins.put("quantity", task.getQuantity());
|
||||
ins.put("remark", task.getRemark());
|
||||
ins.put("create_by", task.getCreate_by());
|
||||
ins.put("create_time", task.getCreate_time());
|
||||
array.add(ins);
|
||||
List<InstructionMybatis> list = instructionService.list(Wrappers.lambdaQuery(InstructionMybatis.class));
|
||||
if (CollUtil.isNotEmpty(list) && list.size() > 0) {
|
||||
for (InstructionMybatis inst : list) {
|
||||
if(task.getTask_id().equals(inst.getTask_id())){
|
||||
JSONObject ins1 = new JSONObject();
|
||||
//ins1.put("task_id", inst.getInstruction_id());
|
||||
ins1.put("task_code", inst.getInstruction_code());
|
||||
ins1.put("vehicle_code", inst.getVehicle_code());
|
||||
ins1.put("task_status", inst.getInstruction_status());
|
||||
ins1.put("start_point_code", inst.getStart_point_code());
|
||||
ins1.put("next_point_code", inst.getNext_point_code());
|
||||
ins1.put("matarial", inst.getMaterial());
|
||||
ins1.put("remark", inst.getRemark());
|
||||
ins1.put("create_by", inst.getCreate_by());
|
||||
ins1.put("create_time", inst.getCreate_time());
|
||||
array.add(ins1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadTaskTreeLogging(List<JSONObject> taskAndInst, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (JSONObject jsonObject : taskAndInst) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("任务号(指令编码)", jsonObject.getString("task_code"));
|
||||
map.put("载具号", jsonObject.getString("vehicle_code"));
|
||||
map.put("状态", jsonObject.getString("task_status"));
|
||||
map.put("任务优先级", jsonObject.getString("priority"));
|
||||
map.put("起点", jsonObject.getString("start_point_code"));
|
||||
map.put("终点", jsonObject.getString("next_point_code"));
|
||||
map.put("起点2", jsonObject.getString("start_point_code2"));
|
||||
map.put("终点2", jsonObject.getString("next_point_code2"));
|
||||
map.put("物料", jsonObject.getString("matarial"));
|
||||
map.put("数量", jsonObject.getString("quantity"));
|
||||
map.put("备注", jsonObject.getString("remark"));
|
||||
map.put("创建者", jsonObject.getString("create_by"));
|
||||
map.put("创建时间", jsonObject.getString("create_time"));
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void downloadTaskLogging(List<JSONObject> taskAndInst, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (JSONObject jsonObject : taskAndInst) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("任务号", jsonObject.getString("task_code"));
|
||||
map.put("载具号", jsonObject.getString("vehicle_code"));
|
||||
map.put("任务状态", jsonObject.getString("task_status"));
|
||||
map.put("任务优先级", jsonObject.getString("priority"));
|
||||
map.put("起点", jsonObject.getString("start_point_code"));
|
||||
map.put("终点", jsonObject.getString("next_point_code"));
|
||||
map.put("物料", jsonObject.getString("matarial"));
|
||||
map.put("数量", jsonObject.getString("quantity"));
|
||||
map.put("备注", jsonObject.getString("remark"));
|
||||
map.put("创建者", jsonObject.getString("create_by"));
|
||||
map.put("创建时间", jsonObject.getString("create_time"));
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getTaskList(Map whereJson) {
|
||||
String task_code = (String) whereJson.get("task_code");
|
||||
String vehicle_code = (String) whereJson.get("vehicle_code");
|
||||
String material_type = (String) whereJson.get("material_type");
|
||||
String status = (String) whereJson.get("status");
|
||||
String point_code = (String) whereJson.get("point_code");
|
||||
String create_time = (String) whereJson.get("createTime");
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
|
||||
LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
|
||||
if (!StrUtil.isEmpty(task_code)) {
|
||||
wrapper.eq(Task::getTask_code, task_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
wrapper.like(Task::getVehicle_code, vehicle_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
wrapper.eq(Task::getMaterial, material_type);
|
||||
}
|
||||
if (!StrUtil.isEmpty(status)) {
|
||||
wrapper.eq(Task::getTask_status, status);
|
||||
}
|
||||
if (!StrUtil.isEmpty(point_code)) {
|
||||
wrapper.and(task -> task.like(Task::getStart_point_code, point_code).or().like(Task::getNext_point_code, point_code));
|
||||
}
|
||||
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
||||
wrapper.between(Task::getCreate_time, create_time, end_time);
|
||||
}
|
||||
List<Task> taskList = taskMapper.selectList(wrapper);
|
||||
List<JSONObject> array = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(taskList) && taskList.size() > 0) {
|
||||
for (Task task : taskList) {
|
||||
JSONObject ins = new JSONObject();
|
||||
//ins.put("task_id", task.getTask_id());
|
||||
ins.put("task_code", task.getTask_code());
|
||||
ins.put("vehicle_code", task.getVehicle_code());
|
||||
ins.put("task_status", task.getTask_status());
|
||||
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("remark", task.getRemark());
|
||||
ins.put("create_by", task.getCreate_by());
|
||||
ins.put("create_time", task.getCreate_time());
|
||||
array.add(ins);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer querySameTaskByType(String taskType) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
* linux: /temp
|
||||
* </pre>
|
||||
*/
|
||||
public static final String SYS_TEM_DIR = System.getProperty("java.io.tmpdir") + File.separator;
|
||||
public static final String SYS_TEM_DIR = System.getProperty("java.io.tmpdir");
|
||||
/**
|
||||
* 定义GB的计算常量
|
||||
*/
|
||||
@@ -210,7 +210,9 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
File file = new File(tempPath);
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
|
||||
// 一次性写出内容,使用默认样式,强制输出标题
|
||||
writer.write(list, true);
|
||||
for (Object item : list) {
|
||||
writer.writeRow(item, true);
|
||||
}
|
||||
SXSSFSheet sheet = (SXSSFSheet)writer.getSheet();
|
||||
//上面需要强转SXSSFSheet 不然没有trackAllColumnsForAutoSizing方法
|
||||
sheet.trackAllColumnsForAutoSizing();
|
||||
|
||||
Reference in New Issue
Block a user