Browse Source

rev:更新

master
gengby 7 months ago
parent
commit
ffce40df0e
  1. 4
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device/service/dto/DeviceAssignedQueryParam.java
  2. 7
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device/service/impl/DeviceAssignedServiceImpl.java
  3. 19
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java
  4. 5
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java
  5. 12
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/station/with_station/WithStationDeviceDriver.java
  6. 7
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/utils/ArrayComparisonUtil.java
  7. 18
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/req/CommonRequest.java
  8. 8
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java
  9. 24
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java
  10. 10
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java
  11. 19
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/dto/InteracteDto.java
  12. 83
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  13. 4
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/enums/InstructionStatusEnum.java
  14. 21
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  15. 32
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/enums/WmsTaskStatusEnum.java
  16. 17
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  17. 47
      nladmin-ui/src/views/acs/config/assigned/index.vue
  18. 4
      nladmin-ui/src/views/acs/task/index.vue
  19. 14
      nladmin-ui/src/views/monitor/lucene/index.vue
  20. 10
      nladmin-ui/src/views/system/monitor/device/index.vue
  21. 8
      nladmin-ui/src/views/system/param/index.vue
  22. 2
      nladmin-ui/src/views/system/timing/index.vue

4
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device/service/dto/DeviceAssignedQueryParam.java

@ -11,4 +11,8 @@ import lombok.Setter;
@Setter
public class DeviceAssignedQueryParam {
private String device_code;
private String inst_nextDevice_code;
private String task_nextDevice_code;
}

7
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device/service/impl/DeviceAssignedServiceImpl.java

@ -2,6 +2,7 @@ package org.nl.acs.device.device.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -44,7 +45,11 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
@Override
public PageInfo<DeviceAssignedDto> queryAll(DeviceAssignedQueryParam query, Pageable pageable) {
IPage<DeviceAssigned> queryPage = PageUtil.toMybatisPage(pageable);
IPage<DeviceAssigned> page = deviceAssignedMapper.selectPage(queryPage, QueryHelpMybatisPlus.getPredicate(query));
LambdaQueryWrapper<DeviceAssigned> lqw = new LambdaQueryWrapper<>();
lqw.like(StrUtil.isNotBlank(query.getDevice_code()), DeviceAssigned::getDevice_code, query.getDevice_code())
.and(StrUtil.isNotBlank(query.getTask_nextDevice_code()), s -> s.like(DeviceAssigned::getTask_nextDevice_code, query.getTask_nextDevice_code()))
.and(StrUtil.isNotBlank(query.getInst_nextDevice_code()), s -> s.like(DeviceAssigned::getInst_nextDevice_code, query.getInst_nextDevice_code()));
IPage<DeviceAssigned> page = deviceAssignedMapper.selectPage(queryPage, lqw);
return ConvertUtil.convertPage(page, DeviceAssignedDto.class);
}

19
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java

@ -144,6 +144,11 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
private boolean requireSuccess = false;
/**
* 关联站点申请任务请求标记
*/
private boolean withStationRequireSuccess = false;
/**
* 请求时间
*/
@ -200,6 +205,10 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
private void executeLogicBefore() {
if (this.move != this.lastMove) {
this.requireSuccess = false;
this.withStationRequireSuccess = false;
}
if (this.mode != this.lastMode) {
this.requireSuccess = false;
}
if (!StrUtil.equals(this.barcode, this.lastBarcode) && this.move == 1) {
this.requireInTaskTime = System.currentTimeMillis();
@ -327,6 +336,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
.build();
UnifiedResponse<JSONObject> response = acsToWmsService.apply(request);
if (response.isSuccess()) {
this.writing(ItemProtocol.TO_COMMAND.getKey(), CommandEnum.COMMAND_6.getValue());
this.requireSuccess = true;
}
}
@ -579,7 +589,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
Device device = deviceAppService.findDeviceByCode(next_device_code);
if (device != null) {
String pinkDeviceCode = Optional.ofNullable(device.getExtraValue().get("pinkDeviceCode")).map(Objects::toString).orElse("");
if (StrUtil.equals(taskDto.getNext_device_code(), pinkDeviceCode)) {
if (StrUtil.isNotEmpty(pinkDeviceCode)) {
Device pinkDevice = deviceAppService.findDeviceByCode(pinkDeviceCode);
if (pinkDevice != null && pinkDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) pinkDevice.getDeviceDriver();
@ -718,7 +728,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
@SneakyThrows
private void update_inst_status(Instruction instruction) {
if (InstructionStatusEnum.READY.getIndex().equals(instruction.getInstruction_status()) && this.currentDeviceCode.equals(instruction.getStart_device_code())) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "指令号:" + instruction.getInstruction_code() + ", 修改指令状态为 '" + InstructionStatusEnum.getName(instruction.getInstruction_status()) + "' -> " + InstructionStatusEnum.BUSY.getName()));
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "指令号:" + instruction.getInstruction_code() + ", 修改指令状态为 " + InstructionStatusEnum.getName(instruction.getInstruction_status()) + " -> " + InstructionStatusEnum.BUSY.getName()));
instruction.setInstruction_status(InstructionStatusEnum.BUSY.getIndex());
instruction.setExecute_device_code(this.currentDeviceCode);
instructionService.update(instruction);
@ -732,7 +742,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
}
this.unExecutedMessage = "";
}
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "指令号:" + instruction.getInstruction_code() + ", 修改指令状态为 '" + InstructionStatusEnum.getName(instruction.getInstruction_status()) + "' -> " + InstructionStatusEnum.FINISHED.getName()));
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "指令号:" + instruction.getInstruction_code() + ", 修改指令状态为 " + InstructionStatusEnum.getName(instruction.getInstruction_status()) + " -> " + InstructionStatusEnum.FINISHED.getName()));
instruction.setInstruction_status(InstructionStatusEnum.FINISHED.getIndex());
instruction.setExecute_device_code(this.currentDeviceCode);
instructionService.finish(instruction);
@ -751,6 +761,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
map.put("isError", this.isError);
map.put("unExecutedMessage", this.unExecutedMessage);
map.put("requireSuccess", this.requireSuccess);
map.put("requireSuccessLabel", this.requireSuccess ? "是" : "否");
map.put("mode", AppModeEnum.getLabelByCode(this.mode));
String belongToConveyor = Optional.ofNullable(this.getExtraValue().get("belongToConveyor")).map(Object::toString).orElse(null);
if (belongToConveyor != null) {
@ -763,7 +774,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
}
map.put("move", this.move == 0 ? "无货" : "有货");
map.put("hasGoods", this.move);
map.put("task", this.task);
map.put("task", this.task + " (" + (instructionService.findByCodeFromCache(String.valueOf(this.task)) == null ? "已结束" : "执行中") + ")");
map.put("action", this.action == 0 ? "不允许取放" : "允许取放");
map.put("error", ErrorEnum.getLabel(this.error));
map.put("barcode", this.barcode);

5
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java

@ -1256,10 +1256,15 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
map.put("message", this.message);
map.put("unExecutedMessage", this.unExecutedMessage);
map.put("prohibitInWarehouse", this.prohibitInWarehouse);
map.put("prohibitInWarehouseLabel", this.prohibitInWarehouse ? "是" : "否");
map.put("prohibitOutWarehouse", this.prohibitOutWarehouse);
map.put("prohibitOutWarehouseLabel", this.prohibitOutWarehouse ? "是" : "否");
map.put("stopReceiveTask", this.stopReceiveTask);
map.put("stopReceiveTaskLabel", this.stopReceiveTask ? "是" : "否");
map.put("requireSuccess", this.requireSuccess);
map.put("requireSuccessLabel", this.requireSuccess ? "是" : "否");
map.put("againRequireSuccess", this.againRequireSuccess);
map.put("againRequireSuccessLabel", this.againRequireSuccess ? "是" : "否");
map.put("mode", ModeEnum.getDescByNum(this.mode));
map.put("front_command", CommandEnum.getDesc(this.front_command));
map.put("front_task", this.front_task + " (" + (instructionService.findByCodeFromCache(String.valueOf(this.front_task)) == null ? "已结束" : "执行中") + ")");

12
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/station/with_station/WithStationDeviceDriver.java

@ -89,7 +89,7 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements
continue;
}
if (!requireSuccess && StrUtil.isNotEmpty(appearanceInspectionScannerConveyorDeviceDriver.getBarcode())
&& !appearanceInspectionScannerConveyorDeviceDriver.isRequireSuccess()) {
&& !appearanceInspectionScannerConveyorDeviceDriver.isWithStationRequireSuccess()) {
TaskDto taskDto = taskServer.findByContainer(appearanceInspectionScannerConveyorDeviceDriver.getBarcode());
if (ObjectUtil.isEmpty(taskDto)) {
String getLinkDeviceCode = Optional.ofNullable(device.getExtraValue().get("getLinkDeviceCode")).map(Object::toString).orElse(null);
@ -105,14 +105,14 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements
logServer.deviceExecuteLog(new LuceneLogDto(this.device_code, "申请任务...." + request.toString()));
UnifiedResponse<JSONObject> response = acsToWmsService.apply(request);
if (response.isSuccess()) {
appearanceInspectionScannerConveyorDeviceDriver.setRequireSuccess(true);
appearanceInspectionScannerConveyorDeviceDriver.setWithStationRequireSuccess(true);
this.requireSuccess = true;
}
} else {
Device linkDevice = deviceAppservice.findDeviceByCode(getLinkDeviceCode);
if (ObjectUtil.isNotEmpty(linkDevice) && linkDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver2 = (AppearanceInspectionScannerConveyorDeviceDriver) linkDevice.getDeviceDriver();
if (appearanceInspectionScannerConveyorDeviceDriver2.getMove() == 1 && !appearanceInspectionScannerConveyorDeviceDriver2.isRequireSuccess()) {
if (appearanceInspectionScannerConveyorDeviceDriver2.getMove() == 1 && !appearanceInspectionScannerConveyorDeviceDriver2.isWithStationRequireSuccess()) {
TaskDto taskDto2 = taskServer.findByContainer(appearanceInspectionScannerConveyorDeviceDriver2.getBarcode());
if (ObjectUtil.isEmpty(taskDto2)) {
JSONObject param = new JSONObject();
@ -128,8 +128,8 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements
UnifiedResponse<JSONObject> response = acsToWmsService.apply(request);
if (response.isSuccess()) {
this.requireSuccess = true;
appearanceInspectionScannerConveyorDeviceDriver.setRequireSuccess(true);
appearanceInspectionScannerConveyorDeviceDriver2.setRequireSuccess(true);
appearanceInspectionScannerConveyorDeviceDriver.setWithStationRequireSuccess(true);
appearanceInspectionScannerConveyorDeviceDriver2.setWithStationRequireSuccess(true);
}
}
} else {
@ -145,7 +145,7 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements
logServer.deviceExecuteLog(new LuceneLogDto(this.device_code, "申请任务...." + request.toString()));
UnifiedResponse<JSONObject> response = acsToWmsService.apply(request);
if (response.isSuccess()) {
appearanceInspectionScannerConveyorDeviceDriver.setRequireSuccess(true);
appearanceInspectionScannerConveyorDeviceDriver.setWithStationRequireSuccess(true);
this.requireSuccess = true;
}
}

7
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/utils/ArrayComparisonUtil.java

@ -12,8 +12,13 @@ import java.util.Objects;
*/
public class ArrayComparisonUtil {
public static boolean equals(Object oldValue, Object newValue) {
if ((oldValue instanceof String && newValue == null && "".equals(oldValue)) ||
(newValue instanceof String && oldValue == null && "".equals(newValue))) {
return true;
}
if (oldValue == null || newValue == null) {
return Objects.equals(oldValue, newValue);
return ObjectUtil.equals(oldValue, newValue);
}
Class<?> oldType = oldValue.getClass();
Class<?> newType = newValue.getClass();

18
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/req/CommonRequest.java

@ -1,9 +1,13 @@
package org.nl.acs.ext.wms.data.req;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.nl.acs.ext.wms.IpUtil;
import org.nl.config.IdUtil;
@ -14,12 +18,15 @@ import org.nl.config.IdUtil;
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CommonRequest {
private String service;
private String type;
@Builder.Default
private String ip = IpUtil.LOCAL_IP;
@Builder.Default
@ -28,5 +35,14 @@ public class CommonRequest {
@Builder.Default
private String trace_id = "trace_id_" + IdUtil.getStringId();
private JSONObject data;
private Object data;
public JSONArray handleArray() {
return JSONArray.parseArray(JSON.toJSONString(data));
}
public JSONObject handleObject() {
return (JSONObject) data;
}
}

8
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java

@ -5,10 +5,8 @@ package org.nl.acs.ext.wms.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.ext.wms.data.req.CommonRequest;
import org.nl.acs.ext.wms.service.GateWayService;
import org.nl.acs.ext.wms.service.WmsToAcsService;
import org.nl.acs.ext.wms.service.dto.InteracteDto;
import org.nl.common.base.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -33,8 +31,8 @@ public class WmsToAcsController {
@PostMapping("/apply")
@SaIgnore
public ResponseEntity<Object> apply(@RequestBody InteracteDto form) {
return new ResponseEntity<>(gateWayService.apply(form), HttpStatus.OK);
public ResponseEntity<Object> apply(@RequestBody CommonRequest request) {
return new ResponseEntity<>(gateWayService.apply(request), HttpStatus.OK);
}
}

24
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java

@ -1,7 +1,9 @@
package org.nl.acs.ext.wms.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.ext.wms.service.dto.InteracteDto;
import org.nl.acs.ext.wms.data.req.CommonRequest;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -15,16 +17,20 @@ public class GateWayService {
@Autowired
private WmsToAcsService wmsToAcsService;
@Autowired
private LuceneExecuteLogService logService;
public JSONObject apply(InteracteDto param) {
if ("crateTask".equals(param.getType())) {
return wmsToAcsService.crateTask(param.getData());
} else if ("switchInOut".equals(param.getType())) {
return wmsToAcsService.switchInOut(param.getData());
} else if ("pinkStartStop".equals(param.getType())) {
return wmsToAcsService.pinkStartStop(param.getData());
}
public JSONObject apply(CommonRequest request) {
JSONObject resp = new JSONObject();
if ("createTask".equals(request.getType())) {
return wmsToAcsService.crateTask(request.handleArray());
} else if ("switchInOut".equals(request.getType())) {
return wmsToAcsService.switchInOut(request.handleObject());
} else if ("pinkStartStop".equals(request.getType())) {
return wmsToAcsService.pinkStartStop(request.handleObject());
} else if ("toCommand".equals(request.getType())) {
return wmsToAcsService.toCommand(request.handleObject());
}
resp.put("code", "400");
resp.put("msg", "type有误");
return resp;

10
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java

@ -1,6 +1,7 @@
package org.nl.acs.ext.wms.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -12,7 +13,7 @@ public interface WmsToAcsService {
* @param req
* @return
*/
JSONObject crateTask(JSONObject req);
JSONObject crateTask(JSONArray req);
/**
* 出入库模式切换
@ -31,4 +32,11 @@ public interface WmsToAcsService {
*/
JSONObject pinkStartStop(JSONObject req);
/**
* 下发输送线转动命令
*
* @param req
* @return
*/
JSONObject toCommand(JSONObject req);
}

19
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/dto/InteracteDto.java

@ -1,19 +0,0 @@
package org.nl.acs.ext.wms.service.dto;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
/*
* @author ZZQ
* @Date 2024/5/29 16:26
*/
@Data
public class InteracteDto {
String service;
String type;
String ip;
String request_time;
String trace_id;
JSONObject data;
}

83
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -38,20 +38,20 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Autowired
private DeviceAppService deviceAppService;
@Autowired
private TaskService taskserver;
private TaskService taskService;
@Override
public JSONObject crateTask(JSONObject req) {
log.info("createFromWms--------------:输入参数:" + JSON.toJSONString(req));
public JSONObject crateTask(JSONArray req) {
log.info("crateTask--------------:输入参数:" + JSON.toJSONString(req));
try {
JSONArray datas = req.getJSONArray("tasks");
JSONArray errArr = new JSONArray();
for (int i = 0; i < datas.size(); i++) {
JSONObject task = datas.getJSONObject(i);
String ext_task_id = task.getString("ext_task_id");
for (int i = 0; i < req.size(); i++) {
JSONObject task = req.getJSONObject(i);
String ext_task_id = task.getString("id");
String task_code = task.getString("task_code");
String start_device_code = task.getString("start_device_code");
String next_device_code = task.getString("next_device_code");
String start_device_code = task.getString("point_code1");
String next_device_code = task.getString("point_code2");
String put_device_code = task.getString("put_device_code");
String priority = task.getString("priority");
String vehicle_code = task.getString("vehicle_code");
@ -61,7 +61,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String remark = task.getString("remark");
String storage_task_type = task.getString("storage_task_type");
String agv_system_type = task.getString("agv_system_type");
JSONObject param = task.getJSONObject("param");
JSONObject params = task.getJSONObject("params");
String start_point_code = "";
String next_point_code = "";
String put_point_code = "";
@ -136,7 +136,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
route_plan_code = "normal";
}
TaskDto taskDto = taskserver.findByCodeFromCache(task_code);
TaskDto taskDto = taskService.findByCodeFromCache(task_code);
if (taskDto != null) {
JSONObject json = new JSONObject();
json.put("task_code", task_code);
@ -146,7 +146,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
continue;
}
if (!StrUtil.isEmpty(vehicle_code)) {
TaskDto vehicle_dto = taskserver.findByContainer(vehicle_code);
TaskDto vehicle_dto = taskService.findByContainer(vehicle_code);
if (vehicle_dto != null) {
JSONObject json = new JSONObject();
json.put("task_code", task_code);
@ -191,7 +191,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("agv_system_type", agv_system_type);
jo.put("storage_task_type", storage_task_type);
jo.put("remark", remark);
jo.put("params", param);
jo.put("params", params);
jo.put("task_type", StrUtil.isEmpty(task_type) ? 1 : Integer.parseInt(task_type));
@ -201,7 +201,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
TaskDto task_dto = jo.toJavaObject(TaskDto.class);
try {
taskserver.create(task_dto);
taskService.create(task_dto);
} catch (Exception e) {
JSONObject json = new JSONObject();
json.put("task_code", task_code);
@ -224,7 +224,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
}
resp.put("errArr", errArr);
}
log.info("createFromWms--------------:输出参数:" + JSON.toJSONString(resp));
log.info("crateTask--------------:输出参数:" + JSON.toJSONString(resp));
return resp;
} finally {
}
@ -232,6 +232,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public JSONObject switchInOut(JSONObject reqs) {
log.info("switchInOut--------------:输入参数:" + JSON.toJSONString(reqs));
Assert.notNull(reqs);
String device_code = reqs.getString("device_code");
if (StrUtil.isBlank(device_code)) {
@ -247,13 +248,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
if (belongToConveyorDevice != null && belongToConveyorDevice.getDeviceDriver() instanceof StripConveyorDeviceDriver) {
StripConveyorDeviceDriver stripConveyorDeviceDriver = (StripConveyorDeviceDriver) belongToConveyorDevice.getDeviceDriver();
//切换为入库
if ("1".equals(type)) {
if ("0".equals(type)) {
String samePoint = Optional.ofNullable(device.getExtraValue().get("samePoint")).map(Object::toString).orElse(null);
TaskDto taskDto;
if (StrUtil.isNotEmpty(samePoint)) {
taskDto = taskserver.findByNextCode(samePoint);
taskDto = taskService.findByNextCode(samePoint);
} else {
taskDto = taskserver.findByNextCode(device_code);
taskDto = taskService.findByNextCode(device_code);
}
if (ObjectUtil.isNotEmpty(taskDto)) {
throw new BadRequestException("ACS存在出库任务,无法切换为入库模式");
@ -268,13 +269,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
stripConveyorDeviceDriver.writing("toCommand", 0);
}
//切换为出库
else if ("2".equals(type)) {
else if ("1".equals(type)) {
String samePoint = Optional.ofNullable(device.getExtraValue().get("samePoint")).map(Object::toString).orElse(null);
TaskDto taskDto;
if (StrUtil.isNotEmpty(samePoint)) {
taskDto = taskserver.findByStartCode(samePoint);
taskDto = taskService.findByStartCode(samePoint);
} else {
taskDto = taskserver.findByStartCode(device_code);
taskDto = taskService.findByStartCode(device_code);
}
if (ObjectUtil.isNotEmpty(taskDto)) {
throw new BadRequestException("ACS存在入库任务,无法切换为出库模式");
@ -290,22 +291,24 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
}
}
JSONObject resp = new JSONObject();
resp.put("status", 200);
resp.put("message", "切换出入库模式成功");
resp.put("code", "200");
resp.put("msg", "切换出入库模式成功");
log.info("switchInOut--------------:输出参数:" + JSON.toJSONString(resp));
return resp;
}
@Override
public JSONObject pinkStartStop(JSONObject reqs) {
log.info("pinkStartStop--------------:输入参数:" + JSON.toJSONString(reqs));
Assert.notNull(reqs);
JSONObject resp = new JSONObject();
String device_code = reqs.getString("device_code");
if (StrUtil.isBlank(device_code)) {
throw new BadRequestException("设备号不能为空!");
}
String type = reqs.getString("type");
String type = reqs.getString("status");
if (StrUtil.isEmpty(type)) {
throw new BadRequestException("启停类型不能为空!");
throw new BadRequestException("启停状态不能为空!");
}
Device device = deviceAppService.findDeviceByCode(device_code);
if (device != null && device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
@ -318,8 +321,34 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} else {
throw new BadRequestException("设备不存在");
}
resp.put("status", 200);
resp.put("message", "切换成功");
resp.put("code", "200");
resp.put("msg", "切换成功");
log.info("pinkStartStop--------------:输出参数:" + JSON.toJSONString(resp));
return resp;
}
@Override
public JSONObject toCommand(JSONObject req) {
log.info("toCommand--------------:输入参数:" + JSON.toJSONString(req));
Assert.notNull(req);
String device_code = req.getString("device_code");
if (StrUtil.isEmpty(device_code)) {
throw new BadRequestException("设备号不能为空");
}
Integer toCommand = req.getInteger("toCommand");
if (toCommand == null) {
throw new BadRequestException("下发参数不能为空");
}
Device device = deviceAppService.findDeviceByCode(device_code);
if (device != null && device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) device.getDeviceDriver();
appearanceInspectionScannerConveyorDeviceDriver.writing("toCommand", toCommand);
}
JSONObject resp = new JSONObject();
resp.put("code", "200");
resp.put("msg", "下发成功");
log.info("toCommand--------------:输出参数:" + JSON.toJSONString(resp));
return resp;
}

4
nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/enums/InstructionStatusEnum.java

@ -58,9 +58,9 @@ public enum InstructionStatusEnum {
return arr;
}
public static String getName(String code) {
public static String getName(String index) {
for (InstructionStatusEnum c : InstructionStatusEnum.values()) {
if (c.code == code) {
if (c.index.equals(index)) {
return c.name;
}
}

21
nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -1749,7 +1749,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public List<Instruction> findReadyInstByStartDeviceCode(List<String> start_device_code_list, String noY) {
String currentNoY = noY == null ? "" : noY;
// String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1763,7 +1764,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public List<Instruction> findReadyInstByNextDeviceCode(List<String> next_device_code_list, String noY) {
String currentNoY = noY == null ? "" : noY;
//String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1777,7 +1779,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public List<Instruction> findReadyInstByDeviceCode(List<String> device_code_list, String noY) {
String currentNoY = noY == null ? "" : noY;
//String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1790,7 +1793,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public Instruction findReadyInstByStartDeviceCode(Instruction frontInst, String link_device_code, String noY) {
String currentNoY = noY == null ? "" : noY;
//String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1807,7 +1811,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public Instruction findReadyInstByLinkDeviceCodeAndStartDeviceCode(String linkDeviceCode, String noY) {
String currentNoY = noY == null ? "" : noY;
// String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1822,7 +1827,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public Instruction findReadyInstByLinkDeviceCodeAndNextDeviceCode(String linkDeviceCode, String noY) {
String currentNoY = noY == null ? "" : noY;
//String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1837,7 +1843,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public Instruction findReadyInstByNextDeviceCode(Instruction frontInst, String link_device_code, String noY) {
String currentNoY = noY == null ? "" : noY;
//String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>())
.stream()

32
nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/enums/WmsTaskStatusEnum.java

@ -0,0 +1,32 @@
package org.nl.acs.task.service.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @Description TODO
* @Author Gengby
* @Date 2024/7/1
*/
@Getter
@AllArgsConstructor
public enum WmsTaskStatusEnum {
RUN("1", "20", "执行中"),
FINISH("2", "90", "完成"),
CANCEL("3", "100", "取消");
private String acsStatus;
private String wmsStatus;
private String desc;
public static String getWmsStatusByAcsStatus(String acsStatus) {
for (WmsTaskStatusEnum status : WmsTaskStatusEnum.values()) {
if (status.getAcsStatus().equals(acsStatus)) {
return status.getWmsStatus();
}
}
return null;
}
}

17
nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -46,6 +46,7 @@ import org.nl.acs.task.service.TaskFeedbackService;
import org.nl.acs.common.base.PageInfo;
import org.nl.acs.common.base.QueryHelpMybatisPlus;
import org.nl.acs.common.base.service.impl.CommonServiceImpl;
import org.nl.acs.task.service.enums.WmsTaskStatusEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.acs.utils.ConvertUtil;
import org.nl.common.utils.FileUtil;
@ -563,7 +564,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
//向缓存添加任务信息
this.addTaskToCache(dto);
//反馈上位系统任务状态
this.feedWmsTaskStatus(entity);
this.feedWmsTaskStatus(dto);
}
@Override
@ -1252,7 +1253,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
if (!StrUtil.startWith(taskDto.getTask_code(), CommonFinalParam.HYPHEN_) && StrUtil.equals(hasWms, CommonFinalParam.ONE)) {
JSONObject param = new JSONObject();
param.put("taskCode", entity.getTask_code());
param.put("status", "");
param.put("status", WmsTaskStatusEnum.getWmsStatusByAcsStatus(taskDto.getTask_status()));
CommonRequest request =
CommonRequest
.builder()
@ -1307,7 +1308,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
@Override
public List<TaskDto> findReadyTaskByXDeviceCode(List<String> xDeviceCodeList, String noY) {
String currentNoY = noY == null ? "" : noY;
// String currentNoY = noY == null ? "" : noY;
Set<String> currentNoY = noY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(noY.split(",")));
return Optional.ofNullable(this.tasks)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1330,7 +1333,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
String front_to_x = frontTask.getTo_x();
String front_to_y = frontTask.getTo_y();
String front_to_z = frontTask.getTo_z();
String currentBackNoY = backNoY == null ? "" : backNoY;
//String currentBackNoY = backNoY == null ? "" : backNoY;
Set<String> currentBackNoY = backNoY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(backNoY.split(",")));
return Optional.ofNullable(this.tasks)
.orElse(new CopyOnWriteArrayList<>())
.stream()
@ -1353,7 +1358,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
String front_from_x = frontTask.getFrom_x();
String front_from_y = frontTask.getFrom_y();
String front_from_z = frontTask.getFrom_z();
String currentBackNoY = backNoY == null ? "" : backNoY;
//String currentBackNoY = backNoY == null ? "" : backNoY;
Set<String> currentBackNoY = backNoY == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(backNoY.split(",")));
return Optional.ofNullable(this.tasks)
.orElse(new CopyOnWriteArrayList<>())
.stream()

47
nladmin-ui/src/views/acs/config/assigned/index.vue

@ -2,6 +2,47 @@
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-suffix=":"
>
<el-form-item label="设备编码">
<el-input
v-model="query.device_code"
size="small"
clearable
placeholder="请输入设备编码"
style="width: 200px;"
class="filter-item"
/>
</el-form-item>
<el-form-item label="任务终点">
<el-input
v-model="query.task_nextDevice_code"
size="small"
clearable
placeholder="请输入任务终点"
style="width: 200px;"
class="filter-item"
/>
</el-form-item>
<el-form-item label="指令终点">
<el-input
v-model="query.inst_nextDevice_code"
size="small"
clearable
placeholder="请输入指令终点"
style="width: 200px;"
class="filter-item"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
@ -144,6 +185,7 @@
import crudAcsDeviceAssigned from '@/api/acs/config/deviceAssigned'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import deviceCrud from '@/api/acs/device/device'
@ -159,7 +201,7 @@ const defaultForm = {
}
export default {
name: 'AcsDeviceAssigned',
components: { pagination, crudOperation, udOperation },
components: { pagination, crudOperation, udOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@ -170,7 +212,8 @@ export default {
optShow: {
add: true,
edit: true,
del: true
del: true,
reset: true
},
crudMethod: { ...crudAcsDeviceAssigned }
})

4
nladmin-ui/src/views/acs/task/index.vue

@ -475,7 +475,7 @@
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="25" />
<el-table-column type="selection" width="50" />
<el-table-column v-if="false" prop="task_id" label="任务标识" />
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" :min-width="flexWidth('task_code',crud.data,$t('task.txt_box.Task_code'))" />
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" :min-width="flexWidth('task_type',crud.data,$t('task.txt_box.Task_type'))">
@ -591,7 +591,7 @@ export default {
return CRUD({ title: i18n.t('task.txt_box.Task'), url: 'api/task', idField: 'task_id', sort: 'task_id,desc',
optShow: {
add: false,
edit: true,
edit: false,
del: true,
reset: false,
download: false

14
nladmin-ui/src/views/monitor/lucene/index.vue

@ -25,33 +25,33 @@
v-if="logType === '接口日志'"
prop="request_url"
label="请求路径"
:min-width="flexWidth('method',crud.data,'请求路径')"
show-overflow-tooltip
/>
<el-table-column
v-if="logType === '接口日志'"
prop="request_param"
label="请求参数"
:min-width="flexWidth('request_param',crud.data,'请求参数')"
show-overflow-tooltip
/>
<el-table-column
v-if="logType === '接口日志'"
prop="response_param"
label="返回参数"
:min-width="flexWidth('response_param',crud.data,'返回参数')"
show-overflow-tooltip
/>
<el-table-column
v-if="logType === '接口日志'"
prop="status_code"
label="状态码"
:min-width="flexWidth('status_code',crud.data,'状态码')"
show-overflow-tooltip
/>
<!-- <el-table-column v-if="logType === '接口日志'" prop="task_code" label="任务编号"-->
<!-- :min-width="flexWidth('task_code',crud.data,'任务编号')"/>-->
<!-- <el-table-column v-if="logType === '接口日志'" prop="instruct_code" label="指令编号"-->
<!-- :min-width="flexWidth('instruct_code',crud.data,'指令编号')"/>-->
<el-table-column prop="content" label="内容详情" :min-width="flexWidth('content',crud.data,'内容详情')" />
<el-table-column prop="logTime" label="记录时间" :min-width="flexWidth('logTime',crud.data,'记录时间')" />
<el-table-column prop="operate" label="操作" :min-width="flexWidth('operate',crud.data,'操作')" />
<el-table-column prop="content" show-overflow-tooltip label="内容详情" />
<el-table-column prop="logTime" show-overflow-tooltip label="记录时间" />
<!-- <el-table-column prop="operate" show-overflow-tooltip label="操作" :min-width="flexWidth('operate',crud.data,'操作')" />-->
</el-table>
<!--分页组件-->

10
nladmin-ui/src/views/system/monitor/device/index.vue

@ -361,19 +361,19 @@ export default {
} else if (val === 'height') {
const obj = { name: '高度', value: data[val] }
this.arr.push(obj)
} else if (val === 'prohibitInWarehouse') {
} else if (val === 'prohibitInWarehouseLabel') {
const obj = { name: '禁止入库', value: data[val] }
this.arr.push(obj)
} else if (val === 'prohibitOutWarehouse') {
} else if (val === 'prohibitOutWarehouseLabel') {
const obj = { name: '禁止出库', value: data[val] }
this.arr.push(obj)
} else if (val === 'stopReceiveTask') {
} else if (val === 'stopReceiveTaskLabel') {
const obj = { name: '停止接收任务', value: data[val] }
this.arr.push(obj)
} else if (val === 'requireSuccess') {
} else if (val === 'requireSuccessLabel') {
const obj = { name: '请求标记', value: data[val] }
this.arr.push(obj)
} else if (val === 'againRequireSuccess') {
} else if (val === 'againRequireSuccessLabel') {
const obj = { name: '异常请求标记', value: data[val] }
this.arr.push(obj)
} else if (val === 'front_command') {

8
nladmin-ui/src/views/system/param/index.vue

@ -42,10 +42,10 @@
>
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="id" label="id" />
<el-table-column prop="code" :label="$t('SysParam.table.code')" min-width="130" show-overflow-tooltip />
<el-table-column :prop="$langPre.computedProp('name')" :label="$t('SysParam.table.name')" min-width="120" show-overflow-tooltip />
<el-table-column prop="value" :label="$t('SysParam.table.values')" min-width="270" show-overflow-tooltip />
<el-table-column prop="remark" :label="$t('SysParam.table.description')" />
<el-table-column prop="code" :label="$t('SysParam.table.code')" show-overflow-tooltip />
<el-table-column :prop="$langPre.computedProp('name')" :label="$t('SysParam.table.name')" show-overflow-tooltip />
<el-table-column prop="value" :label="$t('SysParam.table.values')" show-overflow-tooltip />
<el-table-column prop="remark" :label="$t('SysParam.table.description')" show-overflow-tooltip />
<el-table-column v-permission="['admin','param:edit','param:del']" :label="$t('auto.common.Operate')" width="150px" align="center">
<template slot-scope="scope">
<udOperation

2
nladmin-ui/src/views/system/timing/index.vue

@ -139,7 +139,7 @@
<el-table-column
v-permission="['admin','timing:edit','timing:del']"
:label="$t('auto.common.Operate')"
width="170px"
width="220px"
align="center"
fixed="right"
>

Loading…
Cancel
Save