opt: 优化创建任务的扩展字段

This commit is contained in:
yanps
2024-01-22 09:44:08 +08:00
parent f06dec27bf
commit cfeabb4c04
2 changed files with 7 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.acs.task.service.dto; package org.nl.acs.task.service.dto;
import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.common.base.CommonFinalParam;
@@ -306,6 +307,7 @@ public class TaskDto implements Serializable {
* 交互字段 * 交互字段
*/ */
private String interaction_json; private String interaction_json;
private JSONObject interactionJson;
/** /**
* 行架任务类型 * 行架任务类型

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@@ -71,6 +72,7 @@ import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@@ -473,6 +475,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
public void create(TaskDto dto) throws Exception { public void create(TaskDto dto) throws Exception {
dto = foramte(dto); dto = foramte(dto);
dto.setInteraction_json(ObjectUtil.isNotEmpty(dto.getInteractionJson()) ? dto.getInteractionJson().toJSONString() : "");
if (!StrUtil.isEmpty(dto.getVehicle_code())) { if (!StrUtil.isEmpty(dto.getVehicle_code())) {
TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code()); TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code());
if (vehicle_dto != null) { if (vehicle_dto != null) {
@@ -555,8 +558,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) { if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
// if (nextdevice.getDeviceDriver() instanceof // if (nextdevice.getDeviceDriver() instanceof
// StandardOrdinarySiteDeviceDriver) { // XgAgvCarDeviceDriver) {
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) // standardOrdinarySiteDeviceDriver = (XgAgvCarDeviceDriver)
// nextdevice.getDeviceDriver(); // nextdevice.getDeviceDriver();
// if (nextdevice.getHas_goods() != 0) { // if (nextdevice.getHas_goods() != 0) {
// throw new Exception("任务终点需满足无货!"); // throw new Exception("任务终点需满足无货!");