Browse Source

fix: 修复路线锁定逻辑,添加校验物料信息逻辑

master
yanps 2 months ago
parent
commit
638633f456
  1. 25
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
  2. 4
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  3. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/controller/ConnectorToWmsController.java
  4. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java
  5. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  6. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/sorting/service/impl/SortingServiceImpl.java
  7. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java
  8. 7
      lms/nladmin-ui/src/views/wms/sch/task/index.vue

25
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java

@ -155,8 +155,21 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno);
Device device = null; Device device = null;
String device_code = null; String device_code = null;
String old_device_code = null;
if (agvaddr != 0) {
old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
if (StrUtil.contains(old_device_code, "-")) {
String[] point = old_device_code.split("-");
device_code = point[0];
} else if (StrUtil.contains(old_device_code, ".")) {
String[] point = old_device_code.split("\\.");
device_code = point[0];
} else {
device_code = old_device_code;
}
device = deviceAppService.findDeviceByCode(device_code);
}
// //
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver; AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver; StandardAutodoorDeviceDriver standardAutodoorDeviceDriver;
@ -243,8 +256,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
String is_enter = standardAutodoorDeviceDriver.getExtraValue().get("is_enter").toString(); String is_enter = standardAutodoorDeviceDriver.getExtraValue().get("is_enter").toString();
if (StrUtil.isNotBlank(is_enter) && !"true".equals(is_enter)) { if (StrUtil.isNotBlank(is_enter) && "false".equals(is_enter)) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
} else {
log.info("区域已锁定,请释放后在进入");
} }
} }
} else { } else {
@ -260,8 +275,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
String is_enter = standardAutodoorDeviceDriver.getExtraValue().get("is_enter").toString(); String is_enter = standardAutodoorDeviceDriver.getExtraValue().get("is_enter").toString();
if (StrUtil.isNotBlank(is_enter) && !"true".equals(is_enter)) { if (StrUtil.isNotBlank(is_enter) && "false".equals(is_enter)) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
} else {
log.info("区域已锁定,请释放后在进入");
} }
} }
} else { } else {

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

@ -685,6 +685,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
.set("0".equals(param.getString("status")),DeviceExtra::getExtra_value, "false") .set("0".equals(param.getString("status")),DeviceExtra::getExtra_value, "false")
.set("1".equals(param.getString("status")),DeviceExtra::getExtra_value, "true") .set("1".equals(param.getString("status")),DeviceExtra::getExtra_value, "true")
); );
Device deviceByCode = deviceAppService.findDeviceByCode(point);
deviceByCode.getExtraValue().put("is_enter", "1".equals(param.getString("status"))?"true":"false");
}); });
} else { } else {
deviceExtraService.update(Wrappers.lambdaUpdate(DeviceExtra.class) deviceExtraService.update(Wrappers.lambdaUpdate(DeviceExtra.class)
@ -694,6 +696,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
.set("0".equals(param.getString("status")),DeviceExtra::getExtra_value, "false") .set("0".equals(param.getString("status")),DeviceExtra::getExtra_value, "false")
.set("1".equals(param.getString("status")),DeviceExtra::getExtra_value, "true") .set("1".equals(param.getString("status")),DeviceExtra::getExtra_value, "true")
); );
Device deviceByCode = deviceAppService.findDeviceByCode(pointCode);
deviceByCode.getExtraValue().put("is_enter", "1".equals(param.getString("status"))?"true":"false");
} }
return null; return null;
} }

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/controller/ConnectorToWmsController.java

@ -39,7 +39,7 @@ public class ConnectorToWmsController {
@Log("推送物料信息") @Log("推送物料信息")
@ApiOperation("推送物料信息") @ApiOperation("推送物料信息")
@SaIgnore @SaIgnore
@PostMapping("/createMaterial") @PostMapping("/addMaterial")
public ResponseEntity<Object> createMaterial(@RequestBody JSONArray jsonArray){ public ResponseEntity<Object> createMaterial(@RequestBody JSONArray jsonArray){
return new ResponseEntity(connectorService.createMaterial(jsonArray), HttpStatus.OK); return new ResponseEntity(connectorService.createMaterial(jsonArray), HttpStatus.OK);
} }

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java

@ -10,7 +10,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.dreamlu.mica.core.exception.ServiceException;
import nl.basjes.shaded.org.springframework.util.Assert; import nl.basjes.shaded.org.springframework.util.Assert;
import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.ext.acs.service.WmsToAcsService;
@ -130,6 +132,14 @@ public class ConnectorToWmsServiceImpl implements ConnectorToWmsService {
Assert.noNullElements(jsonArray, "请求参数为空!"); Assert.noNullElements(jsonArray, "请求参数为空!");
List<ConnectorDto> connectorDtos = BeanUtil.copyToList(jsonArray, ConnectorDto.class); List<ConnectorDto> connectorDtos = BeanUtil.copyToList(jsonArray, ConnectorDto.class);
for (ConnectorDto connectorDto : connectorDtos) { for (ConnectorDto connectorDto : connectorDtos) {
SchBaseVehiclematerialgroup one = iSchBaseVehiclematerialgroupService.getOne(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getJob_name, connectorDto.getJobname())
.eq(SchBaseVehiclematerialgroup::getMaterial_id, connectorDto.getProductID())
.eq(SchBaseVehiclematerialgroup::getOrder_code, connectorDto.getProductionOrder()));
if (ObjectUtil.isNotNull(one)) {
throw new BadRequestException("jobName:" + connectorDto.getJobname() + "orderCode:"
+ connectorDto.getProductionOrder() + "ProductID:" + connectorDto.getProductID() + "该物料信息已存在!");
}
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup(); SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
schBaseVehiclematerialgroup.setVehicle_code(connectorDto.getVehicle_code()); schBaseVehiclematerialgroup.setVehicle_code(connectorDto.getVehicle_code());
schBaseVehiclematerialgroup.setJob_name(connectorDto.getJobname()); schBaseVehiclematerialgroup.setJob_name(connectorDto.getJobname());

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java

@ -208,11 +208,28 @@ public class HandheldServiceImpl implements HandheldService {
case "3": case "3":
goWxOrNx(param, region_code, device_code, vehicle_code, connectorTask); goWxOrNx(param, region_code, device_code, vehicle_code, connectorTask);
break; break;
case "4":
connectorBlanking(schBasePoint, param, region_code, device_code, vehicle_code, connectorTask);
break;
default: default:
break; break;
} }
} }
/**
* connector下料入库
*
* @param schBasePoint
* @param param
* @param region_code
* @param device_code
* @param vehicle_code
* @param connectorTask
*/
private void connectorBlanking(SchBasePoint schBasePoint, JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) {
}
/** /**
* 物料下料去货架 * 物料下料去货架
* *

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/sorting/service/impl/SortingServiceImpl.java

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.gson.Gson; import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.enums.region.RegionEnum; import org.nl.common.enums.region.RegionEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.config.IdUtil; import org.nl.config.IdUtil;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.connector.service.dto.ConnectorDto; import org.nl.wms.ext.connector.service.dto.ConnectorDto;
@ -94,14 +95,23 @@ public class SortingServiceImpl implements SortingService {
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
//TODO:叫料 //TODO:叫料
} else if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) { } else if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) {
if (StrUtil.isEmpty(vehicle_code)) {
return MapOf.of("status", 400, "msg", "载具号未传递!");
}
taskParam.put("config_code", "SortingCMTTask"); taskParam.put("config_code", "SortingCMTTask");
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
//TODO:将空托盘放到线边库 //TODO:将空托盘放到线边库
} else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) { } else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) {
if (StrUtil.isEmpty(vehicle_code)) {
return MapOf.of("status", 400, "msg", "载具号未传递!");
}
taskParam.put("config_code", "SortingSNTTask"); taskParam.put("config_code", "SortingSNTTask");
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
//TODO:将满料放到线边库 //TODO:将满料放到线边库
} else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) { } else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) {
if (StrUtil.isEmpty(vehicle_code)) {
return MapOf.of("status", 400, "msg", "载具号未传递!");
}
taskParam.put("config_code", "SortingSMTTask"); taskParam.put("config_code", "SortingSMTTask");
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
} }

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.task_manage.task.tasks.sorting; package org.nl.wms.sch.task_manage.task.tasks.sorting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -70,9 +71,13 @@ public class SortingSMTTask extends AbstractTask {
String requestParam = task.getRequest_param(); String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam); JSONObject jsonObject = JSONObject.parseObject(requestParam);
JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail"); JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail");
String NextOperation = null;
if (CollUtil.isNotEmpty(pallet_detail) && pallet_detail.size() > 0) {
JSONObject jsonObject1 = JSONObject.parseObject(StrUtil.toString(pallet_detail.get(0))); JSONObject jsonObject1 = JSONObject.parseObject(StrUtil.toString(pallet_detail.get(0)));
String regionCode = StrUtil.isEmpty(jsonObject1.getString("NextOperation")) ? NextOperation = ObjectUtil.isNotEmpty(jsonObject1) && StrUtil.isNotEmpty(jsonObject1.getString("NextOperation")) ? jsonObject1.getString("NextOperation") : null;
RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code() : jsonObject1.getString("NextOperation"); }
String regionCode = StrUtil.isEmpty(NextOperation) ?
RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code() : NextOperation;
// 根据对接位查找对应的载具类型 // 根据对接位查找对应的载具类型
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(regionCode, task.getVehicle_code(), "1"); SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(regionCode, task.getVehicle_code(), "1");
if (ObjectUtil.isEmpty(schBasePoint)) { if (ObjectUtil.isEmpty(schBasePoint)) {

7
lms/nladmin-ui/src/views/wms/sch/task/index.vue

@ -167,11 +167,11 @@
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }} {{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')"> <!-- <el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }} {{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }}
</template> </template>
</el-table-column> </el-table-column> -->
<!-- <el-table-column prop="task_class_id" label="任务分类" :min-width="flexWidth('task_class_id',crud.data,'任务分类')" />--> <!-- <el-table-column prop="task_class_id" label="任务分类" :min-width="flexWidth('task_class_id',crud.data,'任务分类')" />-->
<el-table-column prop="task_status" label="任务状态" :min-width="flexWidth('task_status',crud.data,'任务状态')"> <el-table-column prop="task_status" label="任务状态" :min-width="flexWidth('task_status',crud.data,'任务状态')">
<template slot-scope="scope"> <template slot-scope="scope">
@ -182,8 +182,7 @@
<el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" /> <el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" />
<el-table-column prop="point_code1" label="点位1" :min-width="flexWidth('point_code1',crud.data,'点位1')" /> <el-table-column prop="point_code1" label="点位1" :min-width="flexWidth('point_code1',crud.data,'点位1')" />
<el-table-column prop="point_code2" label="点位2" :min-width="flexWidth('point_code2',crud.data,'点位2')" /> <el-table-column prop="point_code2" label="点位2" :min-width="flexWidth('point_code2',crud.data,'点位2')" />
<el-table-column prop="point_code3" label="点位3" :min-width="flexWidth('point_code3',crud.data,'点位3')" /> <el-table-column prop="request_param" label="请求参数" :min-width="flexWidth('request_param',crud.data,'请求参数')" />
<el-table-column prop="point_code4" label="点位4" :min-width="flexWidth('point_code4',crud.data,'点位4')" />
<!-- <el-table-column prop="start_wait_point" label="取货等待点" :min-width="flexWidth('start_wait_point',crud.data,'取货等待点')" />--> <!-- <el-table-column prop="start_wait_point" label="取货等待点" :min-width="flexWidth('start_wait_point',crud.data,'取货等待点')" />-->
<el-table-column v-if="false" prop="next_wait_point" label="放货等待点" :min-width="flexWidth('next_wait_point',crud.data,'放货等待点')" /> <el-table-column v-if="false" prop="next_wait_point" label="放货等待点" :min-width="flexWidth('next_wait_point',crud.data,'放货等待点')" />
<el-table-column v-if="false" prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"> <el-table-column v-if="false" prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)">

Loading…
Cancel
Save