Browse Source

ACS TO LMS 任务类型映射

master
张江玮 2 years ago
parent
commit
79fe54e551
  1. 68
      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
  8. 1
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendEmpty/YzjSendEmpVehicleTask.java

68
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.ext.acs.service.AcsToWmsService;
import org.nl.wms.log.LokiLog; import org.nl.wms.log.LokiLog;
import org.nl.wms.log.LokiLogType; 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.TaskStatusEnum;
import org.nl.wms.sch.manage.WorkOrderEnum; import org.nl.wms.sch.manage.WorkOrderEnum;
import org.nl.wms.sch.service.TaskService; 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(type)) throw new BadRequestException("类型不能为空");
if (ObjectUtil.isEmpty(point_code)) 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(); JSONObject param = new JSONObject();
param.put("vehicle_code", vehicle_code); param.put("vehicle_code", vehicle_code);
@ -199,8 +253,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
* 根据type判断是什么业务类型 * 根据type判断是什么业务类型
* 1.混碾机送料入库-困料货架 * 1.混碾机送料入库-困料货架
* 2.混碾机呼叫空托盘 * 2.混碾机呼叫空托盘
* 3.压制机料位叫料出库 * 3.压制机料位叫料出库
* 4.压制机下料位送空托盘 * 4.压制机上料位送空盅
* 5.压制机满料入库 * 5.压制机满料入库
* 6.压制机呼叫空钢托盘 * 6.压制机呼叫空钢托盘
* 7.烧制叫料出库 * 7.烧制叫料出库
@ -386,12 +440,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
groubObj.put("create_name", SecurityUtils.getCurrentNickName()); groubObj.put("create_name", SecurityUtils.getCurrentNickName());
groubObj.put("create_time", DateUtil.now()); groubObj.put("create_time", DateUtil.now());
WQLObject.getWQLObject("st_buss_vehiclegroup").insert(groubObj); WQLObject.getWQLObject("st_buss_vehiclegroup").insert(groubObj);
// 判断是分拣还是压制的送料入库
if (device_code.startsWith("FJCD")) { jsonObject.put("type", "1");
jsonObject.put("type", "11");
} else {
jsonObject.put("type", "5");
}
this.apply((JSONObject) jsonObject); this.apply((JSONObject) jsonObject);
} }
@ -462,7 +512,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//将起点终点确定不下发的任务查出来,将木托盘点位解锁,起点改为扫描点,is_auto_issue 改为1, //将起点终点确定不下发的任务查出来,将木托盘点位解锁,起点改为扫描点,is_auto_issue 改为1,
String device_code = (String) jsonObject.get("device_code"); String device_code = (String) jsonObject.get("device_code");
WQLObject task_Table = WQLObject.getWQLObject("SCH_BASE_Task"); 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"); String start_point_code = taskObj.getString("point_code1");
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
JSONObject startObj = pointTable.query("point_code ='" + start_point_code + "'").uniqueResult(0); 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.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.pda.sendvehicle.service.SendVehicleService; 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; 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; package org.nl.wms.sch.tasks.callEmpty;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -18,7 +17,6 @@ import org.nl.wms.sch.SchTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto; import org.nl.wms.sch.tasks.AcsTaskDto;
import org.nl.wms.sch.tasks.RegionTypeEnum;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; 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.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;

1
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendEmpty/YzjSendEmpVehicleTask.java

@ -19,7 +19,6 @@ import org.nl.wms.sch.SchTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.AcsTaskDto; import org.nl.wms.sch.tasks.AcsTaskDto;
import org.nl.wms.sch.tasks.RegionTypeEnum;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;

Loading…
Cancel
Save