Browse Source

代码更新

master
李永德 2 years ago
parent
commit
452ff75beb
  1. 58
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pda/sendvehicle/service/impl/SendVehicleServiceImpl.java
  3. 33
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionEnum.java
  4. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionTypeEnum.java
  5. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callEmpty/HnCallEmptyVehicleTask.java
  6. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendEmpty/HtSendEmpVehicleTask.java
  7. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendEmpty/YqxSendEmpVehicleTask.java

58
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -18,6 +18,7 @@ import org.nl.wms.basedata.service.dto.VehicleDto;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.log.LokiLog;
import org.nl.wms.log.LokiLogType;
import org.nl.wms.sch.manage.RegionEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.manage.WorkOrderEnum;
import org.nl.wms.sch.service.TaskService;
@ -188,6 +189,59 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
// 类型映射
String regionId = WQLObject
.getWQLObject("sch_base_point")
.query("point_code = '" + point_code + "'")
.uniqueResult(0)
.getString("region_id");
switch (type) {
case "1":
// 设备送料入库
if (StrUtil.equals(regionId, RegionEnum.HNQ.getId())) {
type = "1";
} else if (StrUtil.equals(regionId, RegionEnum.YZQ.getId())) {
type = "5";
} else if (StrUtil.equals(regionId, RegionEnum.YQ.getId())) {
type = "8";
} else if (StrUtil.equals(regionId, RegionEnum.ZDCDX.getId())) {
type = "11";
}
break;
case "2":
// 设备叫料出库
if (StrUtil.equals(regionId, RegionEnum.YZQ.getId())) {
type = "3";
} else if (StrUtil.equals(regionId, RegionEnum.YQ.getId())) {
type = "7";
} else if (StrUtil.equals(regionId, RegionEnum.ZDCDX.getId())) {
type = "9";
}
break;
case "3":
// 设备送空托盘
if (StrUtil.equals(regionId, RegionEnum.YZQ.getId())) {
type = "4";
} else if (StrUtil.equals(regionId, RegionEnum.ZDCDX.getId())) {
type = "10";
} else if (StrUtil.equals(regionId, RegionEnum.KGTDPQ.getId())) {
type = "13";
}
break;
case "4":
// 设备叫空托盘
if (StrUtil.equals(regionId, RegionEnum.HNQ.getId())) {
type = "2";
} else if (StrUtil.equals(regionId, RegionEnum.YZQ.getId())) {
type = "6";
} else if (StrUtil.equals(regionId, RegionEnum.ZDCDX.getId())) {
type = "12";
}
break;
default:
throw new BadRequestException("ACS任务类型错误");
}
// 参数统一获取
JSONObject param = new JSONObject();
param.put("vehicle_code", vehicle_code);
@ -395,6 +449,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jsonObject.put("type", "5");
}
this.apply(jsonObject);
jsonObject.put("type", "1");
this.apply((JSONObject) jsonObject);
}
/**
@ -464,7 +520,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//将起点终点确定不下发的任务查出来,将木托盘点位解锁,起点改为扫描点,is_auto_issue 改为1,
String device_code = (String) jsonObject.get("device_code");
WQLObject task_Table = WQLObject.getWQLObject("SCH_BASE_Task");
JSONObject taskObj = task_Table.query("task_status='" + TaskStatusEnum.START_AND_POINT.getCode() +"' and is_auto_issue='0'", "create_time desc").uniqueResult(0);
JSONObject taskObj = task_Table.query("task_status='" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_auto_issue='0'", "create_time desc").uniqueResult(0);
String start_point_code = taskObj.getString("point_code1");
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
JSONObject startObj = pointTable.query("point_code ='" + start_point_code + "'").uniqueResult(0);

2
lms/nladmin-system/src/main/java/org/nl/wms/pda/sendvehicle/service/impl/SendVehicleServiceImpl.java

@ -9,7 +9,7 @@ import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.pda.sendvehicle.service.SendVehicleService;
import org.nl.wms.sch.tasks.RegionTypeEnum;
import org.nl.wms.sch.manage.RegionTypeEnum;
import org.springframework.stereotype.Service;

33
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionEnum.java

@ -0,0 +1,33 @@
package org.nl.wms.sch.manage;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 区域枚举类
*
* @author 张江玮
* @date 2022/11/22 16:16
*/
@AllArgsConstructor
@Getter
public enum RegionEnum {
KLHJ("1590223405414748160", "KLHJ", "困料货架"),
RYZCQ("1590223672247980032", "RYZCQ", "入窑暂存区"),
CYZCQ("1590223771673956352", "CYZCQ", "出窑暂存区"),
BZZCQ("1590223846013800448", "BZZCQ", "包装暂存区"),
HNQ("1590223931246252032", "HNQ", "混碾区"),
YZQ("1590223991732310016", "YZQ", "压制区"),
YYJLZJ("1590224119046213632", "YYJLZJ", "液压机料盅架"),
YQ("1590224197186097152", "YQ", "窑区域"),
KGTCPQ("1590224331051503616", "KGTCPQ", "空钢托拆盘区"),
ZDCDX("1590224431970652160", "ZDCDX", "自动拆垛线"),
RGCPQ("1590224498601365504", "RGCPQ", "人工拆盘区域"),
BZQ("1590224549646045184", "BZQ", "包装区"),
KGTDPQ("1590224679409422336", "KGTDPQ", "空钢托叠盘区");
private String id;
private String code;
private String name;
}

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/RegionTypeEnum.java → lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionTypeEnum.java

@ -1,4 +1,4 @@
package org.nl.wms.sch.tasks;
package org.nl.wms.sch.manage;
/**
* 任务状态枚举

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callEmpty/HnCallEmptyVehicleTask.java

@ -1,7 +1,6 @@
package org.nl.wms.sch.tasks.callEmpty;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
@ -21,7 +20,6 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.manage.UpdateTaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto;
import org.nl.wms.sch.tasks.PointUpdateUtil;
import org.nl.wms.sch.tasks.RegionTypeEnum;
import org.springframework.stereotype.Service;
import java.util.ArrayList;

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendEmpty/HtSendEmpVehicleTask.java

@ -16,7 +16,7 @@ import org.nl.wms.sch.SchTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto;
import org.nl.wms.sch.tasks.RegionTypeEnum;
import org.nl.wms.sch.manage.RegionTypeEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendEmpty/YqxSendEmpVehicleTask.java

@ -16,7 +16,7 @@ import org.nl.wms.sch.SchTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto;
import org.nl.wms.sch.tasks.RegionTypeEnum;
import org.nl.wms.sch.manage.RegionTypeEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Loading…
Cancel
Save