psh 11 months ago
parent
commit
56d88b9c70
  1. 4
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
  2. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java
  3. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/TBXBKJTask.java
  4. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java
  5. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java
  6. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java

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

@ -196,7 +196,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} //进入区域 } //进入区域
else if (phase == 0x50) { else if (phase == 0x50) {
//开门 //开门
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (device!=null&&device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
standardAutodoorDeviceDriver.OpenOrClose("1"); standardAutodoorDeviceDriver.OpenOrClose("1");
if (standardAutodoorDeviceDriver.getAction() == 1) { if (standardAutodoorDeviceDriver.getAction() == 1) {
@ -208,7 +208,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//离开区域 //离开区域
else if (phase == 0x51) { else if (phase == 0x51) {
//关门 //关门
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (device!=null&&device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
standardAutodoorDeviceDriver.OpenOrClose("2"); standardAutodoorDeviceDriver.OpenOrClose("2");
if (standardAutodoorDeviceDriver.getAction() == 2) { if (standardAutodoorDeviceDriver.getAction() == 2) {

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java

@ -210,10 +210,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
map.put("next_height",schBaseTask.getPoint_code2_height()); map.put("next_height",schBaseTask.getPoint_code2_height());
result.setParameters(map); result.setParameters(map);
} catch (Exception e) { } catch (Exception e) {
String message = ObjectUtil.isEmpty(e.getMessage()) String message = e.getMessage();
? ((InvocationTargetException) e).getTargetException().getMessage() log.error("ACS请求LMS出现错误: {}{}", e.getMessage(),e);
: e.getMessage();
log.error("ACS请求LMS出现错误: {}", message);
result.setCode(HttpStatus.HTTP_BAD_REQUEST); result.setCode(HttpStatus.HTTP_BAD_REQUEST);
result.setMessage(message); result.setMessage(message);
result.setRequestNo(requestNo); result.setRequestNo(requestNo);

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/TBXBKJTask.java

@ -110,7 +110,7 @@ public class TBXBKJTask extends AbstractTask {
String regionCode = null; String regionCode = null;
if ("TBX1".equals(startPoint.getRegion_code())) { if ("TBX1".equals(startPoint.getRegion_code())) {
//TBX1找A区 //TBX1找A区
regionCode = "HCQ1"; regionCode = "HCQ3";
} else if ("TBX2".equals(startPoint.getRegion_code())) { } else if ("TBX2".equals(startPoint.getRegion_code())) {
//TBX2找B区 //TBX2找B区
@ -158,6 +158,11 @@ public class TBXBKJTask extends AbstractTask {
taskObj.setRemark("任务完成"); taskObj.setRemark("任务完成");
} }
if (status.equals(TaskStatus.CANCELED)) { // 取消 if (status.equals(TaskStatus.CANCELED)) { // 取消
// 起点解锁
if (ObjectUtil.isNotEmpty(startPointObj)) {
startPointObj.setIng_task_code("");
pointService.update(endPointObj);
}
// 终点解锁 // 终点解锁
if (ObjectUtil.isNotEmpty(endPointObj)) { if (ObjectUtil.isNotEmpty(endPointObj)) {
endPointObj.setIng_task_code(""); endPointObj.setIng_task_code("");
@ -186,10 +191,10 @@ public class TBXBKJTask extends AbstractTask {
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code2())); .eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code2()));
SchBasePoint point = this.findNextPoint(startPoint); SchBasePoint point = this.findNextPoint(startPoint);
schBaseTask.setPoint_code1(point.getPoint_code()); schBaseTask.setPoint_code1(point.getPoint_code());
//重算点位时把点位占用,防止发起重复任务 // //重算点位时把点位占用,防止发起重复任务
point.setIng_task_code(schBaseTask.getTask_code()); // point.setIng_task_code(schBaseTask.getTask_code());
//空固化架区别于组盘,任务完成后再扣除库存 // //空固化架区别于组盘,任务完成后再扣除库存
// point.setVehicle_qty(point.getVehicle_qty() - 1); //// point.setVehicle_qty(point.getVehicle_qty() - 1);
pointService.update(point); // pointService.update(point);
} }
} }

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java

@ -120,8 +120,12 @@ public class XSCKTask extends AbstractTask {
String regionCode = null; String regionCode = null;
String materialType = extGroupData.getString("material_type"); String materialType = extGroupData.getString("material_type");
if ("XSQ1".equals(nextPoint.getRegion_code())) { if ("XSQ1".equals(nextPoint.getRegion_code())) {
//XSQ1找A区 //XSQ1找A区 边负极板HCQ01 负极板HCQ02
if("3".equals(materialType)) {
regionCode = "HCQ1"; regionCode = "HCQ1";
}else if("2".equals(materialType)){
regionCode = "HCQ2";
}
} else if ("XSQ2".equals(nextPoint.getRegion_code())) { } else if ("XSQ2".equals(nextPoint.getRegion_code())) {
//XSQ2找B区 //XSQ2找B区

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java

@ -162,7 +162,7 @@ public class GHSQHTask extends AbstractTask {
/** /**
* 1.根据当前固化室所处区域判断到哪个区的缓存位 * 1.根据当前固化室所处区域判断到哪个区的缓存位
* 正极板到HCQ4,负极板到HCQ2边负极板到HCQ3 * 正极板到HCQ4,负极板到HCQ2边负极板到HCQ1
* 2.从1010列到0101列倒叙判断当前列物料类型是否与起点一致且存在空位 * 2.从1010列到0101列倒叙判断当前列物料类型是否与起点一致且存在空位
* 3.将当前点位设置为目标点 * 3.将当前点位设置为目标点
* 4.如果没有符合条件的点位跳过执行暂时等待 * 4.如果没有符合条件的点位跳过执行暂时等待
@ -178,8 +178,8 @@ public class GHSQHTask extends AbstractTask {
//负极板到缓存区2 //负极板到缓存区2
regionCode = "HCQ2"; regionCode = "HCQ2";
} else if ("3".equals(startPoint.getVehicle_type())) { } else if ("3".equals(startPoint.getVehicle_type())) {
//边负极板到缓存区3 //边负极板到缓存区1
regionCode = "HCQ3"; regionCode = "HCQ1";
} }
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1");
for (int i = schBasePointList.size() - 1; i >= 0; i--) { for (int i = schBasePointList.size() - 1; i >= 0; i--) {

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java

@ -10,6 +10,7 @@ import org.nl.wms.sch.task.service.impl.SchBaseTaskServiceImpl;
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum; import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
@ -21,6 +22,7 @@ import java.util.function.Consumer;
* @Date: 2023/6/13 * @Date: 2023/6/13
*/ */
@Component @Component
@Lazy
public class TaskUtils { public class TaskUtils {
@Autowired @Autowired
private ISchBaseTaskService taskService; private ISchBaseTaskService taskService;

Loading…
Cancel
Save