GX
This commit is contained in:
@@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
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 cn.hutool.http.HttpResponse;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -118,7 +117,7 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
error = this.itemProtocol.getError();
|
error = this.itemProtocol.getError();
|
||||||
task = this.itemProtocol.getTask();
|
task = this.itemProtocol.getTask();
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
if (mode == 2){
|
if (mode == 2) {
|
||||||
this.setRequireSucess(false);
|
this.setRequireSucess(false);
|
||||||
}
|
}
|
||||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||||
@@ -156,8 +155,8 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code());
|
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code());
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id",taskDto.getExt_task_id());
|
map.put("task_id", taskDto.getExt_task_id());
|
||||||
map.put("task_status","1");
|
map.put("task_status", "1");
|
||||||
array.add(map);
|
array.add(map);
|
||||||
acsToWmsService.feedbackTaskStatusToWms(array);
|
acsToWmsService.feedbackTaskStatusToWms(array);
|
||||||
}
|
}
|
||||||
@@ -167,13 +166,13 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
//申请取货 判断取货位是否有货 有货就下发允许取货命令
|
//申请取货 判断取货位是否有货 有货就下发允许取货命令
|
||||||
if (mode == 3 && action == 1 && move == 0 && task > 0) {
|
if (mode == 3 && action == 1 && move == 0 && task > 0) {
|
||||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (ObjectUtil.isNotEmpty(inst2)){
|
if (ObjectUtil.isNotEmpty(inst2)) {
|
||||||
String start_device_code = inst2.getStart_device_code();
|
String start_device_code = inst2.getStart_device_code();
|
||||||
Device device = appService.findDeviceByCode(start_device_code);
|
Device device = appService.findDeviceByCode(start_device_code);
|
||||||
HfStationDeviceDriver hfStationDeviceDriver;
|
HfStationDeviceDriver hfStationDeviceDriver;
|
||||||
if (device.getDeviceDriver() instanceof HfStationDeviceDriver){
|
if (device.getDeviceDriver() instanceof HfStationDeviceDriver) {
|
||||||
hfStationDeviceDriver = (HfStationDeviceDriver) device.getDeviceDriver();
|
hfStationDeviceDriver = (HfStationDeviceDriver) device.getDeviceDriver();
|
||||||
if (hfStationDeviceDriver.getMove() == 1){
|
if (hfStationDeviceDriver.getMove() == 1) {
|
||||||
this.writing("to_command", "2");
|
this.writing("to_command", "2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,23 +181,8 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
|
|
||||||
//行架机械手取货时校验条码 校验失败,取消任务
|
//行架机械手取货时校验条码 校验失败,取消任务
|
||||||
if (mode == 4 && action == 1 && move == 0 && task > 0) {
|
if (mode == 4 && action == 1 && move == 0 && task > 0) {
|
||||||
try {
|
|
||||||
Instruction instructionDto = instructionService.findByCode(String.valueOf(task));
|
Instruction instructionDto = instructionService.findByCode(String.valueOf(task));
|
||||||
if (ObjectUtil.isNotEmpty(instructionDto)) {
|
|
||||||
// TODO 校验失败我是取消指令还是完成指令
|
|
||||||
instructionService.cancel(instructionDto.getInstruction_id());
|
instructionService.cancel(instructionDto.getInstruction_id());
|
||||||
//taskserver.cancel(instructionDto.getTask_id());
|
|
||||||
// TaskDto taskDto = taskserver.findByCode(instructionDto.getTask_code());
|
|
||||||
// JSONArray array = new JSONArray();
|
|
||||||
// JSONObject map = new JSONObject();
|
|
||||||
// map.put("task_id",taskDto.getExt_task_id());
|
|
||||||
// map.put("task_status","3");
|
|
||||||
// array.add(map);
|
|
||||||
// acsToWmsService.feedbackTaskStatusToWms(array);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
this.writing("to_command", "4");
|
this.writing("to_command", "4");
|
||||||
this.writing("to_onset", "0");
|
this.writing("to_onset", "0");
|
||||||
this.writing("to_target", "0");
|
this.writing("to_target", "0");
|
||||||
@@ -236,15 +220,15 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
Device device = appService.findDeviceByCode(next_device_code);
|
Device device = appService.findDeviceByCode(next_device_code);
|
||||||
HfStationDeviceDriver hfStationDeviceDriver;
|
HfStationDeviceDriver hfStationDeviceDriver;
|
||||||
String current_num = "";
|
String current_num = "";
|
||||||
if (device.getDeviceDriver() instanceof HfStationDeviceDriver){
|
if (device.getDeviceDriver() instanceof HfStationDeviceDriver) {
|
||||||
hfStationDeviceDriver = (HfStationDeviceDriver) device.getDeviceDriver();
|
hfStationDeviceDriver = (HfStationDeviceDriver) device.getDeviceDriver();
|
||||||
current_num = String.valueOf(hfStationDeviceDriver.getCurrent_order_num());
|
current_num = String.valueOf(hfStationDeviceDriver.getCurrent_order_num());
|
||||||
}
|
}
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id",taskDto.getExt_task_id());
|
map.put("task_id", taskDto.getExt_task_id());
|
||||||
map.put("task_status","2");
|
map.put("task_status", "2");
|
||||||
map.put("material_num",current_num);
|
map.put("material_num", current_num);
|
||||||
array.add(map);
|
array.add(map);
|
||||||
acsToWmsService.feedbackTaskStatusToWms(array);
|
acsToWmsService.feedbackTaskStatusToWms(array);
|
||||||
this.writing("to_command2", "0");
|
this.writing("to_command2", "0");
|
||||||
@@ -316,12 +300,29 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
TaskDto task = null;
|
TaskDto task = null;
|
||||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||||
String startDeviceCode = getDeviceCodeList.get(i);
|
String startDeviceCode = getDeviceCodeList.get(i);
|
||||||
|
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||||
|
if (ObjectUtil.isNotEmpty(taskDtos)){
|
||||||
|
TaskDto taskDto = taskDtos.get(0);
|
||||||
|
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
|
||||||
|
instruction.setInstruction_status("1");
|
||||||
|
instruction.setUpdate_time(DateUtil.now());
|
||||||
|
instructionService.update(instruction);
|
||||||
|
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
||||||
|
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
||||||
|
writing("to_onset", String.valueOf(start_addrIndex));
|
||||||
|
writing("to_target", String.valueOf(next_addrIndex));
|
||||||
|
writing("to_task", instruction.getInstruction_code());
|
||||||
|
writing("to_command", "1");
|
||||||
|
this.setRequireSucess(true);
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||||
task = taskDtoList.get(0);
|
task = taskDtoList.get(0);
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(task)) break;
|
if (ObjectUtil.isNotEmpty(task)) break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
String taskid = task.getTask_id();
|
String taskid = task.getTask_id();
|
||||||
String taskcode = task.getTask_code();
|
String taskcode = task.getTask_code();
|
||||||
@@ -350,7 +351,7 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
instdto.setStart_point_code(start_point_code);
|
instdto.setStart_point_code(start_point_code);
|
||||||
instdto.setNext_point_code(next_point_code);
|
instdto.setNext_point_code(next_point_code);
|
||||||
instdto.setPriority(priority);
|
instdto.setPriority(priority);
|
||||||
instdto.setInstruction_status("0");
|
instdto.setInstruction_status("1");
|
||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(start_point_code);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -99,22 +99,22 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos() {
|
public static List<ItemDto> getReadableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
list.add(new ItemDto(item_heartbeat, "心跳", "DB2.B0"));
|
||||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
list.add(new ItemDto(item_mode, "工作模式", "DB2.B1"));
|
||||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
|
list.add(new ItemDto(item_move, "光电信号", "DB2.B2"));
|
||||||
list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
|
list.add(new ItemDto(item_action, "动作信号", "DB2.B3"));
|
||||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
|
list.add(new ItemDto(item_walk_y, "行走列", "DB2.B4"));
|
||||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
list.add(new ItemDto(item_error, "报警信号", "DB2.B5"));
|
||||||
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
|
list.add(new ItemDto(item_task, "任务号", "DB2.D6"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getWriteableItemDtos() {
|
public static List<ItemDto> getWriteableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
list.add(new ItemDto(item_to_command, "下发命令", "DB3.W0"));
|
||||||
list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2"));
|
list.add(new ItemDto(item_to_onset, "下发起始站", "DB3.W2"));
|
||||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));
|
list.add(new ItemDto(item_to_target, "下发目标站", "DB3.W4"));
|
||||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6"));
|
list.add(new ItemDto(item_to_task, "下发任务号", "DB3.D6"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
//条码
|
//条码
|
||||||
String barcode = "0";
|
String barcode = "0";
|
||||||
String last_barcode = "0";
|
String last_barcode = "0";
|
||||||
|
//重量
|
||||||
|
int weight = 0;
|
||||||
|
int last_weight = 0;
|
||||||
|
|
||||||
|
|
||||||
Boolean isonline = true;
|
Boolean isonline = true;
|
||||||
@@ -178,6 +181,7 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
status = this.itemProtocol.getStatus();
|
status = this.itemProtocol.getStatus();
|
||||||
current_order_num = this.itemProtocol.getCurrent_order_num();
|
current_order_num = this.itemProtocol.getCurrent_order_num();
|
||||||
barcode = this.itemProtocol.getBarcode();
|
barcode = this.itemProtocol.getBarcode();
|
||||||
|
weight = this.itemProtocol.getWeight();
|
||||||
material_code = this.itemProtocol.getMaterial_code();
|
material_code = this.itemProtocol.getMaterial_code();
|
||||||
order = this.itemProtocol.getOrder();
|
order = this.itemProtocol.getOrder();
|
||||||
|
|
||||||
@@ -220,6 +224,10 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
logServer.deviceItemValue(this.device_code, "current_order_num", String.valueOf(current_order_num));
|
logServer.deviceItemValue(this.device_code, "current_order_num", String.valueOf(current_order_num));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号current_order_num: " + last_current_order_num + "->" + current_order_num);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号current_order_num: " + last_current_order_num + "->" + current_order_num);
|
||||||
}
|
}
|
||||||
|
if (weight != last_weight) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight: " + last_weight + "->" + weight);
|
||||||
|
}
|
||||||
if (!order.equals(last_order)) {
|
if (!order.equals(last_order)) {
|
||||||
logServer.deviceItemValue(this.device_code, "order", order);
|
logServer.deviceItemValue(this.device_code, "order", order);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号order:" + last_order + "->" + order);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号order:" + last_order + "->" + order);
|
||||||
@@ -324,7 +332,8 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
last_current_order_num = current_order_num;
|
last_current_order_num = current_order_num;
|
||||||
last_order = order;
|
last_order = order;
|
||||||
last_barcode = barcode;
|
last_barcode = barcode;
|
||||||
last_material_code = material_code;
|
last_weight = weight;
|
||||||
|
// last_material_code = material_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -343,7 +352,7 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order);
|
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order);
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("device_code", device_code);
|
json.put("device_code", device_code);
|
||||||
json.put("material_code", material_code);
|
json.put("material_code", dto.getMaterial_code());
|
||||||
json.put("ext_order_id", dto.getExt_order_id());
|
json.put("ext_order_id", dto.getExt_order_id());
|
||||||
json.put("order_code", order);
|
json.put("order_code", order);
|
||||||
HttpResponse result = acsToWmsService.orderConfirm(json);
|
HttpResponse result = acsToWmsService.orderConfirm(json);
|
||||||
@@ -438,7 +447,7 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("device_code", device_code);
|
json.put("device_code", device_code);
|
||||||
json.put("barcode", barcode);
|
json.put("barcode", barcode);
|
||||||
json.put("material_code", material_code);
|
json.put("weight", weight);
|
||||||
json.put("create_mode", "2");
|
json.put("create_mode", "2");
|
||||||
json.put("is_auto_issue", "0");
|
json.put("is_auto_issue", "0");
|
||||||
json.put("type", "2");
|
json.put("type", "2");
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public class ItemProtocol {
|
|||||||
public static String item_material_code = "material_code";
|
public static String item_material_code = "material_code";
|
||||||
//条码
|
//条码
|
||||||
public static String item_barcode = "barcode";
|
public static String item_barcode = "barcode";
|
||||||
|
//重量
|
||||||
|
public static String item_weight = "weight";
|
||||||
|
|
||||||
|
|
||||||
//下发命令
|
//下发命令
|
||||||
@@ -106,6 +108,10 @@ public class ItemProtocol {
|
|||||||
return this.getOpcStringValue(item_barcode);
|
return this.getOpcStringValue(item_barcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getWeight() {
|
||||||
|
return this.getOpcIntegerValue(item_weight);
|
||||||
|
}
|
||||||
|
|
||||||
public String getMaterial_code() {
|
public String getMaterial_code() {
|
||||||
return this.getOpcStringValue(item_material_code);
|
return this.getOpcStringValue(item_material_code);
|
||||||
}
|
}
|
||||||
@@ -140,30 +146,31 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos() {
|
public static List<ItemDto> getReadableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB4.B0"));
|
list.add(new ItemDto(item_heartbeat, "心跳", "DB2.B0"));
|
||||||
list.add(new ItemDto(item_mode, "工作模式", "DB4.B1"));
|
list.add(new ItemDto(item_mode, "工作模式", "DB2.B1"));
|
||||||
list.add(new ItemDto(item_move, "光电信号", "DB4.B2"));
|
list.add(new ItemDto(item_move, "光电信号", "DB2.B2"));
|
||||||
list.add(new ItemDto(item_action, "取放信号", "DB4.B3"));
|
list.add(new ItemDto(item_action, "取放信号", "DB2.B3"));
|
||||||
list.add(new ItemDto(item_ioaction, "进出信号", "DB4.B4"));
|
list.add(new ItemDto(item_ioaction, "进出信号", "DB2.B4"));
|
||||||
list.add(new ItemDto(item_error, "报警信号", "DB4.B5"));
|
list.add(new ItemDto(item_error, "报警信号", "DB2.B5"));
|
||||||
list.add(new ItemDto(item_task, "任务号", "DB4.D6"));
|
list.add(new ItemDto(item_task, "任务号", "DB2.D6"));
|
||||||
list.add(new ItemDto(item_status, "设备状态", "DB4.D7"));
|
list.add(new ItemDto(item_status, "设备状态", "DB2.B10"));
|
||||||
list.add(new ItemDto(item_current_order_num, "当前工单数量", "DB4.D8"));
|
list.add(new ItemDto(item_current_order_num, "当前工单数量", "DB2.D12"));
|
||||||
list.add(new ItemDto(item_material_code, "产品编号", "DB4.S6"));
|
list.add(new ItemDto(item_order, "工单号", "DB2.S16"));
|
||||||
list.add(new ItemDto(item_barcode, "条码", "DB4.S7"));
|
list.add(new ItemDto(item_weight, "重量", "DB2.D272"));
|
||||||
list.add(new ItemDto(item_order, "工单号", "DB4.S8"));
|
list.add(new ItemDto(item_barcode, "条码", "DB2.W276"));
|
||||||
|
list.add(new ItemDto(item_material_code, "产品编号", "DB2.S278"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getWriteableItemDtos() {
|
public static List<ItemDto> getWriteableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_to_command, "作业命令", "DB5.W0"));
|
list.add(new ItemDto(item_to_command, "作业命令", "DB3.W0"));
|
||||||
list.add(new ItemDto(item_to_target, "目标站", "DB5.W2"));
|
list.add(new ItemDto(item_to_target, "目标站", "DB3.W2"));
|
||||||
list.add(new ItemDto(item_to_task, "任务号", "DB5.D4"));
|
list.add(new ItemDto(item_to_task, "任务号", "DB3.D4"));
|
||||||
list.add(new ItemDto(item_to_error, "故障代码", "DB5.W6"));
|
list.add(new ItemDto(item_to_error, "故障代码", "DB3.B8"));
|
||||||
list.add(new ItemDto(item_to_order_num, "工单数量", "DB5.W8"));
|
list.add(new ItemDto(item_to_order_num, "工单数量", "DB3.D10"));
|
||||||
list.add(new ItemDto(item_to_product_number, "产品编号", "DB5.S10"));
|
list.add(new ItemDto(item_to_product_number, "产品编号", "DB3.S14"));
|
||||||
list.add(new ItemDto(item_to_order, "工单号", "DB5.S12"));
|
list.add(new ItemDto(item_to_order, "工单号", "DB3.S270"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -409,12 +409,29 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
TaskDto task = null;
|
TaskDto task = null;
|
||||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||||
String startDeviceCode = getDeviceCodeList.get(i);
|
String startDeviceCode = getDeviceCodeList.get(i);
|
||||||
|
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||||
|
if (ObjectUtil.isNotEmpty(taskDtos)){
|
||||||
|
TaskDto taskDto = taskDtos.get(0);
|
||||||
|
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
|
||||||
|
instruction.setInstruction_status("1");
|
||||||
|
instruction.setUpdate_time(DateUtil.now());
|
||||||
|
instructionService.update(instruction);
|
||||||
|
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
||||||
|
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
||||||
|
this.writing("to_onset1", String.valueOf(start_addrIndex));
|
||||||
|
this.writing("to_target1", String.valueOf(next_addrIndex));
|
||||||
|
this.writing("to_task1", instruction.getInstruction_code());
|
||||||
|
this.writing("to_command1", "1");
|
||||||
|
requireHeadSucess = true;
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||||
task = taskDtoList.get(0);
|
task = taskDtoList.get(0);
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(task)) break;
|
if (ObjectUtil.isNotEmpty(task)) break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
String taskid = task.getTask_id();
|
String taskid = task.getTask_id();
|
||||||
@@ -444,7 +461,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
instdto.setStart_point_code(start_point_code);
|
instdto.setStart_point_code(start_point_code);
|
||||||
instdto.setNext_point_code(next_point_code);
|
instdto.setNext_point_code(next_point_code);
|
||||||
instdto.setPriority(priority);
|
instdto.setPriority(priority);
|
||||||
instdto.setInstruction_status("0");
|
instdto.setInstruction_status("1");
|
||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(start_point_code);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -488,12 +505,29 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
TaskDto task = null;
|
TaskDto task = null;
|
||||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||||
String startDeviceCode = getDeviceCodeList.get(i);
|
String startDeviceCode = getDeviceCodeList.get(i);
|
||||||
|
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||||
|
if (ObjectUtil.isNotEmpty(taskDtos)){
|
||||||
|
TaskDto taskDto = taskDtos.get(0);
|
||||||
|
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
|
||||||
|
instruction.setInstruction_status("1");
|
||||||
|
instruction.setUpdate_time(DateUtil.now());
|
||||||
|
instructionService.update(instruction);
|
||||||
|
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
||||||
|
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
||||||
|
this.writing("to_onset1", String.valueOf(start_addrIndex));
|
||||||
|
this.writing("to_target1", String.valueOf(next_addrIndex));
|
||||||
|
this.writing("to_task1", instruction.getInstruction_code());
|
||||||
|
this.writing("to_command1", "1");
|
||||||
|
requireHeadSucess = true;
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||||
task = taskDtoList.get(0);
|
task = taskDtoList.get(0);
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(task)) break;
|
if (ObjectUtil.isNotEmpty(task)) break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
String taskid = task.getTask_id();
|
String taskid = task.getTask_id();
|
||||||
@@ -523,7 +557,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
instdto.setStart_point_code(start_point_code);
|
instdto.setStart_point_code(start_point_code);
|
||||||
instdto.setNext_point_code(next_point_code);
|
instdto.setNext_point_code(next_point_code);
|
||||||
instdto.setPriority(priority);
|
instdto.setPriority(priority);
|
||||||
instdto.setInstruction_status("0");
|
instdto.setInstruction_status("1");
|
||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(start_point_code);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -137,30 +137,30 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos() {
|
public static List<ItemDto> getReadableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
list.add(new ItemDto(item_heartbeat, "心跳", "DB2.B0"));
|
||||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
list.add(new ItemDto(item_mode, "工作模式", "DB2.B1"));
|
||||||
list.add(new ItemDto(item_status, "设备状态", "DB1.B2"));
|
list.add(new ItemDto(item_status, "设备状态", "DB2.B2"));
|
||||||
list.add(new ItemDto(item_move1, "前工位光电信号", "DB1.B3"));
|
list.add(new ItemDto(item_move1, "前工位光电信号", "DB2.B3"));
|
||||||
list.add(new ItemDto(item_move2, "后工位光电信号", "DB1.B4"));
|
list.add(new ItemDto(item_move2, "后工位光电信号", "DB2.B4"));
|
||||||
list.add(new ItemDto(item_action1, "前工位动作信号", "DB1.B5"));
|
list.add(new ItemDto(item_action1, "前工位动作信号", "DB2.B5"));
|
||||||
list.add(new ItemDto(item_action2, "后工位动作信号", "DB1.B6"));
|
list.add(new ItemDto(item_action2, "后工位动作信号", "DB2.B6"));
|
||||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B7"));
|
list.add(new ItemDto(item_walk_y, "行走列", "DB2.B7"));
|
||||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B8"));
|
list.add(new ItemDto(item_error, "报警信号", "DB2.B8"));
|
||||||
list.add(new ItemDto(item_task1, "前工位任务号", "DB1.D10"));
|
list.add(new ItemDto(item_task1, "前工位任务号", "DB2.D10"));
|
||||||
list.add(new ItemDto(item_task2, "后工位任务号", "DB1.D14"));
|
list.add(new ItemDto(item_task2, "后工位任务号", "DB2.D14"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getWriteableItemDtos() {
|
public static List<ItemDto> getWriteableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_to_command1, "前工位下发命令", "DB2.W0"));
|
list.add(new ItemDto(item_to_command1, "前工位下发命令", "DB3.W0"));
|
||||||
list.add(new ItemDto(item_to_onset1, "前工位下发起始站", "DB2.W2"));
|
list.add(new ItemDto(item_to_onset1, "前工位下发起始站", "DB3.W2"));
|
||||||
list.add(new ItemDto(item_to_target1, "前工位下发目标站", "DB2.W4"));
|
list.add(new ItemDto(item_to_target1, "前工位下发目标站", "DB3.W4"));
|
||||||
list.add(new ItemDto(item_to_task1, "前工位下发任务号", "DB2.D6"));
|
list.add(new ItemDto(item_to_task1, "前工位下发任务号", "DB3.D6"));
|
||||||
list.add(new ItemDto(item_to_command2, "后工位下发命令", "DB2.W10"));
|
list.add(new ItemDto(item_to_command2, "后工位下发命令", "DB3.W10"));
|
||||||
list.add(new ItemDto(item_to_onset2, "后工位下发起始站", "DB2.W12"));
|
list.add(new ItemDto(item_to_onset2, "后工位下发起始站", "DB3.W12"));
|
||||||
list.add(new ItemDto(item_to_target2, "后工位下发目标站", "DB2.W14"));
|
list.add(new ItemDto(item_to_target2, "后工位下发目标站", "DB3.W14"));
|
||||||
list.add(new ItemDto(item_to_task2, "后工位下发任务号", "DB2.D16"));
|
list.add(new ItemDto(item_to_task2, "后工位下发任务号", "DB3.D16"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ public interface InstructionService {
|
|||||||
*/
|
*/
|
||||||
Instruction findByTaskcode(String code);
|
Instruction findByTaskcode(String code);
|
||||||
|
|
||||||
|
Instruction findByTaskcodeAndStatus(String code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据任务id查询
|
* 根据任务id查询
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -228,6 +228,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Instruction findByTaskcodeAndStatus(String code) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||||
|
JSONObject json = wo.query("task_code ='" + code + "' and instruction_status = '0'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(json)){
|
||||||
|
final Instruction obj = json.toJavaObject(Instruction.class);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instruction findByTaskid(String id, String wherecaluse) {
|
public Instruction findByTaskid(String id, String wherecaluse) {
|
||||||
if (!StrUtil.isEmpty(wherecaluse)) {
|
if (!StrUtil.isEmpty(wherecaluse)) {
|
||||||
|
|||||||
@@ -104,6 +104,13 @@ public interface TaskService {
|
|||||||
*/
|
*/
|
||||||
List<TaskDto> queryTaskByDeviceCode(String device_code);
|
List<TaskDto> queryTaskByDeviceCode(String device_code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备号和任务状态查询
|
||||||
|
* @param device_code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TaskDto> queryTaskByDeviceCodeAndStatus(String device_code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据关联编号查询非立刻下发的关联任务
|
* 根据关联编号查询非立刻下发的关联任务
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -277,6 +277,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TaskDto> queryTaskByDeviceCodeAndStatus(String device_code) {
|
||||||
|
List<TaskDto> list = new ArrayList<>();
|
||||||
|
Iterator<TaskDto> iterator = tasks.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
TaskDto task = iterator.next();
|
||||||
|
if (task.getStart_device_code().equals(device_code) && StrUtil.equals(task.getTask_status(), "1")) {
|
||||||
|
Instruction instruction = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
||||||
|
if (ObjectUtil.isNotEmpty(instruction)){
|
||||||
|
list.add(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskDto queryTaskByLinkNum(String link_num) {
|
public TaskDto queryTaskByLinkNum(String link_num) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -34,63 +34,101 @@ public class TestServiceImpl implements TestService
|
|||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
|
||||||
// for (int i = 1; i <= 12; i++) {
|
for (int i = 1; i <= 12; i++) {
|
||||||
// String device_code = "KLZHC";
|
String device_code = "KLZHC";
|
||||||
// if (i < 10){
|
if (i < 10){
|
||||||
// device_code = device_code + "0" + i;
|
device_code = device_code + "0" + i;
|
||||||
// } else {
|
} else {
|
||||||
// device_code = device_code + i;
|
device_code = device_code + i;
|
||||||
// }
|
}
|
||||||
// DeviceDto dto = new DeviceDto();
|
DeviceDto dto = new DeviceDto();
|
||||||
// dto.setDevice_id(IdUtil.simpleUUID());
|
dto.setDevice_id(IdUtil.simpleUUID());
|
||||||
// dto.setDevice_code(device_code);
|
dto.setDevice_code(device_code);
|
||||||
// dto.setDevice_name(device_code);
|
dto.setDevice_name(device_code);
|
||||||
// dto.setDevice_type("conveyor");
|
dto.setDevice_type("conveyor");
|
||||||
// dto.setCreate_by(currentUsername);
|
dto.setCreate_by(currentUsername);
|
||||||
// dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
// dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
// dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
// wo.insert(json);
|
wo.insert(json);
|
||||||
// }
|
}
|
||||||
// for (int i = 1; i <= 25; i++) {
|
for (int i = 1; i <= 8; i++) {
|
||||||
// String device_code = "KLZC";
|
String device_code = "YLJ";
|
||||||
// if (i < 10){
|
if (i < 10){
|
||||||
// device_code = device_code + "0" + i;
|
device_code = device_code + "0" + i;
|
||||||
// } else {
|
} else {
|
||||||
// device_code = device_code + i;
|
device_code = device_code + i;
|
||||||
// }
|
}
|
||||||
// DeviceDto dto = new DeviceDto();
|
DeviceDto dto = new DeviceDto();
|
||||||
// dto.setDevice_id(IdUtil.simpleUUID());
|
dto.setDevice_id(IdUtil.simpleUUID());
|
||||||
// dto.setDevice_code(device_code);
|
dto.setDevice_code(device_code);
|
||||||
// dto.setDevice_name(device_code);
|
dto.setDevice_name(device_code);
|
||||||
// dto.setDevice_type("conveyor");
|
dto.setDevice_type("conveyor");
|
||||||
// dto.setCreate_by(currentUsername);
|
dto.setCreate_by(currentUsername);
|
||||||
// dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
// dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
// dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
// wo.insert(json);
|
wo.insert(json);
|
||||||
// }
|
}
|
||||||
// for (int i = 1; i <= 25; i++) {
|
for (int i = 1; i <= 2; i++) {
|
||||||
// String device_code = "MLZHC";
|
String device_code = "HNJ";
|
||||||
// if (i < 10){
|
if (i < 10){
|
||||||
// device_code = device_code + "0" + i;
|
device_code = device_code + "0" + i;
|
||||||
// } else {
|
} else {
|
||||||
// device_code = device_code + i;
|
device_code = device_code + i;
|
||||||
// }
|
}
|
||||||
// DeviceDto dto = new DeviceDto();
|
DeviceDto dto = new DeviceDto();
|
||||||
// dto.setDevice_id(IdUtil.simpleUUID());
|
dto.setDevice_id(IdUtil.simpleUUID());
|
||||||
// dto.setDevice_code(device_code);
|
dto.setDevice_code(device_code);
|
||||||
// dto.setDevice_name(device_code);
|
dto.setDevice_name(device_code);
|
||||||
// dto.setDevice_type("conveyor");
|
dto.setDevice_type("conveyor");
|
||||||
// dto.setCreate_by(currentUsername);
|
dto.setCreate_by(currentUsername);
|
||||||
// dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
// dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
// dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
// wo.insert(json);
|
wo.insert(json);
|
||||||
// }
|
}
|
||||||
|
for (int i = 1; i <= 26; i++) {
|
||||||
|
String device_code = "KLZC";
|
||||||
|
if (i < 10){
|
||||||
|
device_code = device_code + "0" + i;
|
||||||
|
} else {
|
||||||
|
device_code = device_code + i;
|
||||||
|
}
|
||||||
|
DeviceDto dto = new DeviceDto();
|
||||||
|
dto.setDevice_id(IdUtil.simpleUUID());
|
||||||
|
dto.setDevice_code(device_code);
|
||||||
|
dto.setDevice_name(device_code);
|
||||||
|
dto.setDevice_type("conveyor");
|
||||||
|
dto.setCreate_by(currentUsername);
|
||||||
|
dto.setUpdate_by(currentUsername);
|
||||||
|
dto.setUpdate_time(now);
|
||||||
|
dto.setCreate_time(now);
|
||||||
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
|
wo.insert(json);
|
||||||
|
}
|
||||||
|
for (int i = 1; i <= 26; i++) {
|
||||||
|
String device_code = "MLZHC";
|
||||||
|
if (i < 10){
|
||||||
|
device_code = device_code + "0" + i;
|
||||||
|
} else {
|
||||||
|
device_code = device_code + i;
|
||||||
|
}
|
||||||
|
DeviceDto dto = new DeviceDto();
|
||||||
|
dto.setDevice_id(IdUtil.simpleUUID());
|
||||||
|
dto.setDevice_code(device_code);
|
||||||
|
dto.setDevice_name(device_code);
|
||||||
|
dto.setDevice_type("conveyor");
|
||||||
|
dto.setCreate_by(currentUsername);
|
||||||
|
dto.setUpdate_by(currentUsername);
|
||||||
|
dto.setUpdate_time(now);
|
||||||
|
dto.setCreate_time(now);
|
||||||
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
|
wo.insert(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
package org.nl.hand.amb.rest;
|
package org.nl.hand.amb.rest;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -32,6 +33,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/area")
|
@PostMapping("/area")
|
||||||
@Log("查询区域")
|
@Log("查询区域")
|
||||||
@ApiOperation("查询区域")
|
@ApiOperation("查询区域")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> query() {
|
public ResponseEntity<Object> query() {
|
||||||
return new ResponseEntity<>(HandService.queryArea(null), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.queryArea(null), HttpStatus.OK);
|
||||||
@@ -40,6 +42,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/point")
|
@PostMapping("/point")
|
||||||
@Log("查询设备编号及状态")
|
@Log("查询设备编号及状态")
|
||||||
@ApiOperation("查询设备编号及状态")
|
@ApiOperation("查询设备编号及状态")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
//@RequestBody JSONObject json
|
//@RequestBody JSONObject json
|
||||||
public ResponseEntity<Object> queryPoint(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> queryPoint(@RequestBody Map<String, String> whereJson) {
|
||||||
@@ -50,6 +53,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/point/storage")
|
@PostMapping("/point/storage")
|
||||||
@Log("查询设备扩展属性")
|
@Log("查询设备扩展属性")
|
||||||
@ApiOperation("查询设备扩展属性")
|
@ApiOperation("查询设备扩展属性")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
//@RequestBody JSONObject json
|
//@RequestBody JSONObject json
|
||||||
public ResponseEntity<Object> queryDeviceAugmentabilityByCode(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> queryDeviceAugmentabilityByCode(@RequestBody Map<String, String> whereJson) {
|
||||||
@@ -59,6 +63,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/task_type")
|
@PostMapping("/task_type")
|
||||||
@Log("查询任务类型")
|
@Log("查询任务类型")
|
||||||
@ApiOperation("查询任务类型")
|
@ApiOperation("查询任务类型")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
//@RequestBody JSONObject json
|
//@RequestBody JSONObject json
|
||||||
public ResponseEntity<Object> queryTaskType() {
|
public ResponseEntity<Object> queryTaskType() {
|
||||||
@@ -68,15 +73,16 @@ public class HFHandController {
|
|||||||
@PostMapping("/tasks")
|
@PostMapping("/tasks")
|
||||||
@Log("查询任务")
|
@Log("查询任务")
|
||||||
@ApiOperation("查询任务")
|
@ApiOperation("查询任务")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> queryTask(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> queryTask(@RequestBody Map<String, String> whereJson) {
|
||||||
|
|
||||||
return new ResponseEntity<>(HandService.queryTask(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.queryTask(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/insts")
|
@PostMapping("/insts")
|
||||||
@Log("查询指令")
|
@Log("查询指令")
|
||||||
@ApiOperation("查询指令")
|
@ApiOperation("查询指令")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> queryInst(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> queryInst(@RequestBody Map<String, String> whereJson) {
|
||||||
|
|
||||||
@@ -86,6 +92,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/routeplan_type")
|
@PostMapping("/routeplan_type")
|
||||||
@Log("查询路由类型")
|
@Log("查询路由类型")
|
||||||
@ApiOperation("查询路由类型")
|
@ApiOperation("查询路由类型")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> queryRouteplanType() {
|
public ResponseEntity<Object> queryRouteplanType() {
|
||||||
return new ResponseEntity<>(HandService.queryRouteplanType(), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.queryRouteplanType(), HttpStatus.OK);
|
||||||
@@ -94,6 +101,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/task")
|
@PostMapping("/task")
|
||||||
@Log("创建任务")
|
@Log("创建任务")
|
||||||
@ApiOperation("创建任务")
|
@ApiOperation("创建任务")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> createTask(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> createTask(@RequestBody Map<String, String> whereJson) {
|
||||||
return new ResponseEntity<>(HandService.createTask(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.createTask(whereJson), HttpStatus.OK);
|
||||||
@@ -102,6 +110,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/inst")
|
@PostMapping("/inst")
|
||||||
@Log("指令操作")
|
@Log("指令操作")
|
||||||
@ApiOperation("指令操作")
|
@ApiOperation("指令操作")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> Instoperation(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> Instoperation(@RequestBody Map<String, String> whereJson) {
|
||||||
return new ResponseEntity<>(HandService.Instoperation(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.Instoperation(whereJson), HttpStatus.OK);
|
||||||
@@ -110,6 +119,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/taskoperation")
|
@PostMapping("/taskoperation")
|
||||||
@Log("任务操作")
|
@Log("任务操作")
|
||||||
@ApiOperation("任务操作")
|
@ApiOperation("任务操作")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> Taskoperation(@RequestBody Map<String, String> whereJson) throws Exception {
|
public ResponseEntity<Object> Taskoperation(@RequestBody Map<String, String> whereJson) throws Exception {
|
||||||
return new ResponseEntity<>(HandService.Taskoperation(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.Taskoperation(whereJson), HttpStatus.OK);
|
||||||
@@ -118,6 +128,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/deviceStatus")
|
@PostMapping("/deviceStatus")
|
||||||
@Log("修改设备状态")
|
@Log("修改设备状态")
|
||||||
@ApiOperation("修改设备状态")
|
@ApiOperation("修改设备状态")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> updateDeviceStatus(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> updateDeviceStatus(@RequestBody Map<String, String> whereJson) {
|
||||||
|
|
||||||
@@ -127,6 +138,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/handlogin")
|
@PostMapping("/handlogin")
|
||||||
@Log("手持登陆验证")
|
@Log("手持登陆验证")
|
||||||
@ApiOperation("手持登陆验证")
|
@ApiOperation("手持登陆验证")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> handlogin(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> handlogin(@RequestBody Map<String, String> whereJson) {
|
||||||
|
|
||||||
@@ -136,6 +148,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/matrial")
|
@PostMapping("/matrial")
|
||||||
@Log("查询物料信息")
|
@Log("查询物料信息")
|
||||||
@ApiOperation("查询物料信息")
|
@ApiOperation("查询物料信息")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> queryMaterial() {
|
public ResponseEntity<Object> queryMaterial() {
|
||||||
return new ResponseEntity<>(HandService.queryMaterial(), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.queryMaterial(), HttpStatus.OK);
|
||||||
@@ -144,6 +157,7 @@ public class HFHandController {
|
|||||||
@PostMapping("/task2")
|
@PostMapping("/task2")
|
||||||
@Log("创建任务")
|
@Log("创建任务")
|
||||||
@ApiOperation("创建任务")
|
@ApiOperation("创建任务")
|
||||||
|
@SaIgnore
|
||||||
//@PreAuthorize("@el.check('sect:list')")
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
public ResponseEntity<Object> createTask2(@RequestBody Map<String, String> whereJson) {
|
public ResponseEntity<Object> createTask2(@RequestBody Map<String, String> whereJson) {
|
||||||
return new ResponseEntity<>(HandService.createTask2(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.createTask2(whereJson), HttpStatus.OK);
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ public class HFHandServiceImpl implements HFHandService {
|
|||||||
instdto.setInstruction_status("0");
|
instdto.setInstruction_status("0");
|
||||||
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
||||||
WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
|
WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
|
||||||
JSONObject instcheckjson = instwo.query(" instruction_status <2 and next_point_code= '" + next_point_code + "'" + " and start_point_code = '" + start_point_code + "'" + " and task_id = '" + task_id + "'").uniqueResult(0);
|
JSONObject instcheckjson = instwo.query(" instruction_status < 2 and next_point_code= '" + next_point_code + "'" + " and start_point_code = '" + start_point_code + "'" + " and task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
if (instcheckjson != null) {
|
if (instcheckjson != null) {
|
||||||
jo.put("code", "2");
|
jo.put("code", "2");
|
||||||
jo.put("desc", "操作失败");
|
jo.put("desc", "操作失败");
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -302,9 +303,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (StrUtil.equals(is_first, "true")) {
|
if (StrUtil.equals(is_first, "true")) {
|
||||||
JSONObject ivtJson = wo_ivt.query("vehicle_code = '" + barcode + "'").uniqueResult(0);
|
JSONObject ivtJson = wo_ivt.query("vehicle_code = '" + barcode + "'").uniqueResult(0);
|
||||||
redisUtils.set(barcode,ivtJson.getString("material_id"));
|
redisUtils.set(barcode,ivtJson.getString("material_id"));
|
||||||
|
redisUtils.set(barcode+"-ivt_qty",ivtJson.getString("ivt_qty"));
|
||||||
materialbaseDto = materialbaseService.findById(ivtJson.getLong("material_id"));
|
materialbaseDto = materialbaseService.findById(ivtJson.getLong("material_id"));
|
||||||
}
|
}
|
||||||
String material_id = String.valueOf(redisUtils.get(barcode));
|
String material_id = String.valueOf(redisUtils.get(barcode));
|
||||||
|
String ivt_qty = String.valueOf(redisUtils.get(barcode+"-ivt_qty"));
|
||||||
Long materialId = null;
|
Long materialId = null;
|
||||||
String point_status = "2";
|
String point_status = "2";
|
||||||
if (StrUtil.equals("0",barcode)){
|
if (StrUtil.equals("0",barcode)){
|
||||||
@@ -319,6 +322,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
StructivtDto structivtDto = structivtService.findByCode(device_code);
|
StructivtDto structivtDto = structivtService.findByCode(device_code);
|
||||||
structivtDto.setMaterial_id(materialId);
|
structivtDto.setMaterial_id(materialId);
|
||||||
structivtDto.setVehicle_code(barcode);
|
structivtDto.setVehicle_code(barcode);
|
||||||
|
structivtDto.setIvt_qty(new BigDecimal(ivt_qty));
|
||||||
VehicleDto vehicleDto = vehicleService.findByCode(barcode);
|
VehicleDto vehicleDto = vehicleService.findByCode(barcode);
|
||||||
if (ObjectUtil.isNotEmpty(vehicleDto)) {
|
if (ObjectUtil.isNotEmpty(vehicleDto)) {
|
||||||
structivtDto.setVehicle_type(vehicleDto.getVehicle_type());
|
structivtDto.setVehicle_type(vehicleDto.getVehicle_type());
|
||||||
@@ -348,12 +352,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
if (ll.size() == (HcwNumEnum.KLZCQ.getNum() + HcwNumEnum.GT2.getNum()) && isHasGoods) {
|
if (ll.size() == (HcwNumEnum.KLZCQ.getNum() + HcwNumEnum.GT2.getNum()) && isHasGoods) {
|
||||||
ll.removeFirst();
|
ll.removeFirst();
|
||||||
|
materialbaseDto = materialbaseService.findById(ivtJsonObject.getLong("material_id"));
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("vehicle_type", ivtJsonObject.getString("vehicle_type"));
|
map.put("vehicle_type", ivtJsonObject.getString("vehicle_type"));
|
||||||
map.put("vehicle_code", ivtJsonObject.getString("vehicle_code"));
|
map.put("vehicle_code", ivtJsonObject.getString("vehicle_code"));
|
||||||
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
||||||
map.put("material_code", materialbaseDto.getMaterial_code());
|
map.put("material_code", materialbaseDto.getMaterial_code());
|
||||||
}
|
}
|
||||||
|
map.put("ivt_qty",ivtJsonObject.getString("ivt_qty"));
|
||||||
boolean flag = klzhcwUtil.judge(ll, map);
|
boolean flag = klzhcwUtil.judge(ll, map);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
jsonObject.put("lock_type", "1");
|
jsonObject.put("lock_type", "1");
|
||||||
@@ -365,6 +371,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
ivtJson.put("vehicle_type", "");
|
ivtJson.put("vehicle_type", "");
|
||||||
ivtJson.put("vehicle_code", "");
|
ivtJson.put("vehicle_code", "");
|
||||||
ivtJson.put("material_id", "");
|
ivtJson.put("material_id", "");
|
||||||
|
ivtJson.put("ivt_qty", "0");
|
||||||
wo_ivt.update(ivtJson);
|
wo_ivt.update(ivtJson);
|
||||||
}
|
}
|
||||||
} else if (ll.size() == (HcwNumEnum.KLZCQ.getNum() + HcwNumEnum.GT2.getNum()) && !isHasGoods) {
|
} else if (ll.size() == (HcwNumEnum.KLZCQ.getNum() + HcwNumEnum.GT2.getNum()) && !isHasGoods) {
|
||||||
@@ -374,6 +381,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
jsonGT2.put("vehicle_code", "");
|
jsonGT2.put("vehicle_code", "");
|
||||||
jsonGT2.put("vehicle_type", "");
|
jsonGT2.put("vehicle_type", "");
|
||||||
jsonGT2.put("material_id", "");
|
jsonGT2.put("material_id", "");
|
||||||
|
jsonGT2.put("ivt_qty", "0");
|
||||||
wo_ivt.update(jsonGT2);
|
wo_ivt.update(jsonGT2);
|
||||||
JSONObject jsonObject2 = wo.query("point_code = '" + jsonGT2.getString("point_code") + "'").uniqueResult(0);
|
JSONObject jsonObject2 = wo.query("point_code = '" + jsonGT2.getString("point_code") + "'").uniqueResult(0);
|
||||||
jsonObject2.put("point_status", "1");
|
jsonObject2.put("point_status", "1");
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
FROM
|
FROM
|
||||||
sch_base_region
|
sch_base_region
|
||||||
WHERE
|
WHERE
|
||||||
region_code = 'GT01'
|
region_code = 'GT1'
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ package org.nl.wms.pda.scanGroup;
|
|||||||
* 区域枚举
|
* 区域枚举
|
||||||
*/
|
*/
|
||||||
public enum HcwNumEnum {
|
public enum HcwNumEnum {
|
||||||
KLZHCQ(1, "KLZHCQ", 12),
|
KLZHCQ(1, "KLZHCQ", 10),
|
||||||
KLZCQ(2, "KLZCQ", 25),
|
KLZCQ(2, "KLZCQ", 26),
|
||||||
MLZZCQ(3, "MLZZCQ", 26),
|
MLZZCQ(3, "MLZZCQ", 26),
|
||||||
YLJQ(4, "YLJQ", 0),
|
YLJQ(4, "YLJQ", 8),
|
||||||
HNJQ(5, "HNJQ", 0),
|
HNJQ(5, "HNJQ", 2),
|
||||||
GT1(6, "GT1", 1),
|
GT1(6, "GT1", 1),
|
||||||
GT2(7, "GT2", 1),
|
GT2(7, "GT2", 1),
|
||||||
GT3(8, "GT3", 0),
|
GT3(8, "GT3", 1),
|
||||||
GT4(9, "GT4", 0);
|
GT4(9, "GT4", 1);
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
private String code;
|
private String code;
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public class KlzhcwUtil {
|
|||||||
if (ll.size() == 0) ll = structivtService.reload();
|
if (ll.size() == 0) ll = structivtService.reload();
|
||||||
String vehicle_code = param.getString("vehicle_code");
|
String vehicle_code = param.getString("vehicle_code");
|
||||||
String material_code = param.getString("material_code");
|
String material_code = param.getString("material_code");
|
||||||
|
String ivt_qty = param.getString("ivt_qty");
|
||||||
|
if (StrUtil.isEmpty(ivt_qty)){
|
||||||
|
ivt_qty = "0";
|
||||||
|
}
|
||||||
VehicleDto vehicle = vehicleService.findByCode(vehicle_code);
|
VehicleDto vehicle = vehicleService.findByCode(vehicle_code);
|
||||||
String vehicle_type = vehicle.getVehicle_type();
|
String vehicle_type = vehicle.getVehicle_type();
|
||||||
//判断原先缓存个数 如果小于缓存区的个数 就将当前入库的托盘信息添加到缓存中
|
//判断原先缓存个数 如果小于缓存区的个数 就将当前入库的托盘信息添加到缓存中
|
||||||
@@ -47,6 +51,7 @@ public class KlzhcwUtil {
|
|||||||
map.put("vehicle_code", vehicle_code);
|
map.put("vehicle_code", vehicle_code);
|
||||||
map.put("vehicle_type", vehicle_type);
|
map.put("vehicle_type", vehicle_type);
|
||||||
map.put("material_code", material_code);
|
map.put("material_code", material_code);
|
||||||
|
map.put("ivt_qty",ivt_qty);
|
||||||
ll.addLast(map);
|
ll.addLast(map);
|
||||||
//添加以后仍然小于或等于困料缓存区的个数 所以执行小于困料缓存区个数更新库存的逻辑-直接更新库存
|
//添加以后仍然小于或等于困料缓存区的个数 所以执行小于困料缓存区个数更新库存的逻辑-直接更新库存
|
||||||
flag = this.lessThan25(ll);
|
flag = this.lessThan25(ll);
|
||||||
@@ -58,6 +63,7 @@ public class KlzhcwUtil {
|
|||||||
map.put("vehicle_code", vehicle_code);
|
map.put("vehicle_code", vehicle_code);
|
||||||
map.put("vehicle_type", vehicle_type);
|
map.put("vehicle_type", vehicle_type);
|
||||||
map.put("material_code", material_code);
|
map.put("material_code", material_code);
|
||||||
|
map.put("ivt_qty",ivt_qty);
|
||||||
ll.addLast(map);
|
ll.addLast(map);
|
||||||
//如果说有手工出库的缓存信息
|
//如果说有手工出库的缓存信息
|
||||||
//将入库的信息添加到缓存中 此时缓存中的个数还是等于困料缓存区个数 所以执行直接更新库存
|
//将入库的信息添加到缓存中 此时缓存中的个数还是等于困料缓存区个数 所以执行直接更新库存
|
||||||
@@ -75,6 +81,7 @@ public class KlzhcwUtil {
|
|||||||
map.put("vehicle_code", vehicle_code);
|
map.put("vehicle_code", vehicle_code);
|
||||||
map.put("vehicle_type", vehicle_type);
|
map.put("vehicle_type", vehicle_type);
|
||||||
map.put("material_code", material_code);
|
map.put("material_code", material_code);
|
||||||
|
map.put("ivt_qty",ivt_qty);
|
||||||
ll.addLast(map);
|
ll.addLast(map);
|
||||||
flag = this.equle25(ll);
|
flag = this.equle25(ll);
|
||||||
} else if (ll.size() == HcwNumEnum.KLZCQ.getNum() + HcwNumEnum.GT2.getNum()) {
|
} else if (ll.size() == HcwNumEnum.KLZCQ.getNum() + HcwNumEnum.GT2.getNum()) {
|
||||||
@@ -111,9 +118,12 @@ public class KlzhcwUtil {
|
|||||||
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(ll.get(ll.size() - i - 1).getString("material_code"));
|
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(ll.get(ll.size() - i - 1).getString("material_code"));
|
||||||
jsonObject.put("vehicle_code", ll.get(ll.size() - i - 1).getString("vehicle_code"));
|
jsonObject.put("vehicle_code", ll.get(ll.size() - i - 1).getString("vehicle_code"));
|
||||||
jsonObject.put("vehicle_type", ll.get(ll.size() - i - 1).getString("vehicle_type"));
|
jsonObject.put("vehicle_type", ll.get(ll.size() - i - 1).getString("vehicle_type"));
|
||||||
|
jsonObject.put("ivt_qty", ll.get(ll.size() - i - 1).getString("ivt_qty"));
|
||||||
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
||||||
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
||||||
point_status = "3";
|
point_status = "3";
|
||||||
|
}else {
|
||||||
|
jsonObject.put("material_id", "");
|
||||||
}
|
}
|
||||||
jsonObject.put("instorage_time", DateUtil.now());
|
jsonObject.put("instorage_time", DateUtil.now());
|
||||||
wo.update(jsonObject);
|
wo.update(jsonObject);
|
||||||
@@ -137,9 +147,12 @@ public class KlzhcwUtil {
|
|||||||
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(ll.get(0).getString("material_code"));
|
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(ll.get(0).getString("material_code"));
|
||||||
jsonObject.put("vehicle_code", ll.get(0).getString("vehicle_code"));
|
jsonObject.put("vehicle_code", ll.get(0).getString("vehicle_code"));
|
||||||
jsonObject.put("vehicle_type", ll.get(0).getString("vehicle_type"));
|
jsonObject.put("vehicle_type", ll.get(0).getString("vehicle_type"));
|
||||||
|
jsonObject.put("ivt_qty", ll.get(0).getString("ivt_qty"));
|
||||||
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
||||||
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
||||||
point_status = "3";
|
point_status = "3";
|
||||||
|
}else {
|
||||||
|
jsonObject.put("material_id", "");
|
||||||
}
|
}
|
||||||
jsonObject.put("instorage_time", DateUtil.now());
|
jsonObject.put("instorage_time", DateUtil.now());
|
||||||
wo.update(jsonObject);
|
wo.update(jsonObject);
|
||||||
@@ -154,12 +167,16 @@ public class KlzhcwUtil {
|
|||||||
jsonObject = jsonArray.getJSONObject(i);
|
jsonObject = jsonArray.getJSONObject(i);
|
||||||
String vehicleCode = ll.get(ll.size() - i - 1).getString("vehicle_code");
|
String vehicleCode = ll.get(ll.size() - i - 1).getString("vehicle_code");
|
||||||
String vehicleType = ll.get(ll.size() - i - 1).getString("vehicle_type");
|
String vehicleType = ll.get(ll.size() - i - 1).getString("vehicle_type");
|
||||||
|
String ivt_qty = ll.get(ll.size() - i - 1).getString("ivt_qty");
|
||||||
//修改库存信息
|
//修改库存信息
|
||||||
jsonObject.put("vehicle_code", vehicleCode);
|
jsonObject.put("vehicle_code", vehicleCode);
|
||||||
jsonObject.put("vehicle_type", vehicleType);
|
jsonObject.put("vehicle_type", vehicleType);
|
||||||
|
jsonObject.put("ivt_qty", ivt_qty);
|
||||||
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
||||||
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
||||||
point_status = "3";
|
point_status = "3";
|
||||||
|
}else {
|
||||||
|
jsonObject.put("material_id", "");
|
||||||
}
|
}
|
||||||
jsonObject.put("instorage_time", DateUtil.now());
|
jsonObject.put("instorage_time", DateUtil.now());
|
||||||
wo.update(jsonObject);
|
wo.update(jsonObject);
|
||||||
@@ -175,18 +192,28 @@ public class KlzhcwUtil {
|
|||||||
public Boolean equles26(LinkedList<JSONObject> ll, JSONObject param) {
|
public Boolean equles26(LinkedList<JSONObject> ll, JSONObject param) {
|
||||||
String vehicle_code = param.getString("vehicle_code");
|
String vehicle_code = param.getString("vehicle_code");
|
||||||
String material_code = param.getString("material_code");
|
String material_code = param.getString("material_code");
|
||||||
|
String ivt_qty = param.getString("ivt_qty");
|
||||||
|
if (StrUtil.isEmpty(ivt_qty)){
|
||||||
|
ivt_qty = "0";
|
||||||
|
}
|
||||||
VehicleDto vehicle = vehicleService.findByCode(vehicle_code);
|
VehicleDto vehicle = vehicleService.findByCode(vehicle_code);
|
||||||
String vehicle_type = vehicle.getVehicle_type();
|
String vehicle_type = "";
|
||||||
|
if (ObjectUtil.isNotEmpty(vehicle)){
|
||||||
|
vehicle_type = vehicle.getVehicle_type();
|
||||||
|
}
|
||||||
WQLObject wo = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
WQLObject wo = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||||
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
||||||
String point_status = "2";
|
String point_status = "2";
|
||||||
JSONObject jsonObject = wo.query("region_code = '" + HcwNumEnum.GT1.getCode() + "'").uniqueResult(0);
|
JSONObject jsonObject = wo.query("region_code = '" + HcwNumEnum.GT1.getCode() + "'").uniqueResult(0);
|
||||||
jsonObject.put("vehicle_code", vehicle_code);
|
jsonObject.put("vehicle_code", vehicle_code);
|
||||||
jsonObject.put("vehicle_type", vehicle_type);
|
jsonObject.put("vehicle_type", vehicle_type);
|
||||||
|
jsonObject.put("ivt_qty", ivt_qty);
|
||||||
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(material_code);
|
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(material_code);
|
||||||
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
||||||
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
jsonObject.put("material_id", materialbaseDto.getMaterial_id());
|
||||||
point_status = "3";
|
point_status = "3";
|
||||||
|
}else {
|
||||||
|
jsonObject.put("material_id", "");
|
||||||
}
|
}
|
||||||
jsonObject.put("instorage_time", DateUtil.now());
|
jsonObject.put("instorage_time", DateUtil.now());
|
||||||
wo.update(jsonObject);
|
wo.update(jsonObject);
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ package org.nl.wms.sch.tasks;
|
|||||||
* 区域枚举
|
* 区域枚举
|
||||||
*/
|
*/
|
||||||
public enum RegionTypeEnum {
|
public enum RegionTypeEnum {
|
||||||
KLZHCQ(1, "KLZHCQ", "空料盅缓存区","1586240366032588800"),
|
KLZHCQ(1, "KLZHCQ", "空料盅缓存区", "1586240366032588800"),
|
||||||
KLZCQ(2, "KLZCQ", "困料暂存区","1586240455950077952"),
|
KLZCQ(2, "KLZCQ", "困料暂存区", "1586240455950077952"),
|
||||||
MLZZCQ(3, "MLZHCQ", "满料盅缓存区","1586240614075338752"),
|
MLZZCQ(3, "MLZHCQ", "满料盅缓存区", "1586240614075338752"),
|
||||||
YLJQ(4, "YLJQ", "压力机区","1586887408316715008"),
|
YLJQ(4, "YLJQ", "压力机区", "1586887408316715008"),
|
||||||
HNJQ(5, "HNJQ", "混碾机区","1586887462549065728"),
|
HNJQ(5, "HNJQ", "混碾机区", "1586887462549065728"),
|
||||||
GT1(6, "GT1", "1号接驳滚筒机区","1586888185684824064"),
|
GT1(6, "GT1", "1号接驳滚筒机区", "1586888185684824064"),
|
||||||
GT2(7, "GT2", "2号接驳滚筒机区","1586888795951861760"),
|
GT2(7, "GT2", "2号接驳滚筒机区", "1586888795951861760"),
|
||||||
GT3(8, "GT3", "3号接驳滚筒机区","1586888837689380864"),
|
GT3(8, "GT3", "3号接驳滚筒机区", "1586888837689380864"),
|
||||||
GT4(9, "GT4", "4号接驳滚筒机区","1586888946166665216");
|
GT4(9, "GT4", "4号接驳滚筒机区", "1586888946166665216");
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
private String code;
|
private String code;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public class HnjCallEmpVehicleTask extends AbstractAcsTask {
|
|||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_name("混碾机呼叫空料盅")
|
.task_name("混碾机呼叫空料盅")
|
||||||
.task_type("task_type")
|
.task_type("hnjcallempty")
|
||||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||||
.point_code2(point_code2)
|
.point_code2(point_code2)
|
||||||
.priority("1")
|
.priority("1")
|
||||||
@@ -227,6 +227,8 @@ public class HnjCallEmpVehicleTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
@@ -238,7 +240,9 @@ public class HnjCallEmpVehicleTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
@@ -250,18 +254,23 @@ public class HnjCallEmpVehicleTask extends AbstractAcsTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
map.put("task_code", taskObj.getString("task_code"));
|
map.put("task_code", taskObj.getString("task_code"));
|
||||||
array.add(map);
|
array.add(map);
|
||||||
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
||||||
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
|
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
|
||||||
this.updateTaskStatus(taskObj, "0");
|
this.updateTaskStatus(taskObj, "0");
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, "0");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_name("压力机叫料")
|
.task_name("压力机叫料")
|
||||||
.task_type("task_type")
|
.task_type("yljcallm")
|
||||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||||
.point_code2(point_code2)
|
.point_code2(point_code2)
|
||||||
.priority("1")
|
.priority("1")
|
||||||
@@ -261,6 +261,8 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
@@ -272,6 +274,9 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
@@ -285,17 +290,22 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
map.put("task_code", taskObj.getString("task_code"));
|
map.put("task_code", taskObj.getString("task_code"));
|
||||||
array.add(map);
|
array.add(map);
|
||||||
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
||||||
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
|
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
|
||||||
this.updateTaskStatus(taskObj, "0");
|
this.updateTaskStatus(taskObj, "0");
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, "0");
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ public class HandlingTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
SchTaskDto dto = SchTaskDto.builder().task_id(IdUtil.getLongId())
|
SchTaskDto dto = SchTaskDto.builder().task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_type("task_type")
|
.task_type("sc")
|
||||||
.task_name("手持创建搬运任务")
|
.task_name("手持创建搬运任务")
|
||||||
.task_status(TaskStatusEnum.START_AND_POINT.getCode())
|
.task_status(TaskStatusEnum.START_AND_POINT.getCode())
|
||||||
.point_code1(start_point_code)
|
.point_code1(start_point_code)
|
||||||
@@ -362,6 +362,8 @@ public class HandlingTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
@@ -373,6 +375,9 @@ public class HandlingTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
@@ -385,18 +390,23 @@ public class HandlingTask extends AbstractAcsTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
map.put("task_code", taskObj.getString("task_code"));
|
map.put("task_code", taskObj.getString("task_code"));
|
||||||
array.add(map);
|
array.add(map);
|
||||||
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
||||||
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
|
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
|
||||||
this.updateTaskStatus(taskObj, "0");
|
this.updateTaskStatus(taskObj, "0");
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, "0");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
SchTaskDto dto = SchTaskDto.builder()
|
SchTaskDto dto = SchTaskDto.builder()
|
||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_type("task_type")
|
.task_type("klzdjwsendempty")
|
||||||
.task_name("空料盅对接位呼叫送空盅")
|
.task_name("空料盅对接位呼叫送空盅")
|
||||||
.task_status(TaskStatusEnum.SURE_START.getCode())
|
.task_status(TaskStatusEnum.SURE_START.getCode())
|
||||||
.point_code1(point_code1)
|
.point_code1(point_code1)
|
||||||
@@ -217,6 +217,8 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
@@ -228,6 +230,9 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
@@ -240,17 +245,22 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
map.put("task_code", taskObj.getString("task_code"));
|
map.put("task_code", taskObj.getString("task_code"));
|
||||||
array.add(map);
|
array.add(map);
|
||||||
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
||||||
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
|
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
|
||||||
this.updateTaskStatus(taskObj, "0");
|
this.updateTaskStatus(taskObj, "0");
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, "0");
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
|
||||||
param.put("material_code", materialbaseDto.getMaterial_code());
|
param.put("material_code", materialbaseDto.getMaterial_code());
|
||||||
}
|
}
|
||||||
|
param.put("ivt_qty",taskObj.getString("qty"));
|
||||||
boolean flag = klzhcwUtil.judge(ll, param);
|
boolean flag = klzhcwUtil.judge(ll, param);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
jsonEnd.put("lock_type", "1");
|
jsonEnd.put("lock_type", "1");
|
||||||
@@ -189,6 +190,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
jsonObject.put("vehicle_type", taskObj.getString("vehicle_type"));
|
jsonObject.put("vehicle_type", taskObj.getString("vehicle_type"));
|
||||||
jsonObject.put("vehicle_code", taskObj.getString("vehicle_code"));
|
jsonObject.put("vehicle_code", taskObj.getString("vehicle_code"));
|
||||||
jsonObject.put("material_id", taskObj.getString("material_id"));
|
jsonObject.put("material_id", taskObj.getString("material_id"));
|
||||||
|
jsonObject.put("ivt_qty", taskObj.getString("qty"));
|
||||||
jsonObject.put("instorage_time", DateUtil.now());
|
jsonObject.put("instorage_time", DateUtil.now());
|
||||||
ivtTab.update(jsonObject);
|
ivtTab.update(jsonObject);
|
||||||
//解锁终点
|
//解锁终点
|
||||||
@@ -335,6 +337,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
String point_code1 = whereJson.getString("point_code1");
|
String point_code1 = whereJson.getString("point_code1");
|
||||||
String create_mode = whereJson.getString("create_mode");
|
String create_mode = whereJson.getString("create_mode");
|
||||||
String is_auto_issue = whereJson.getString("is_auto_issue");
|
String is_auto_issue = whereJson.getString("is_auto_issue");
|
||||||
|
String qty = whereJson.getString("weight");
|
||||||
|
|
||||||
//生产工单表【PDM_BD_WorkOrder】
|
//生产工单表【PDM_BD_WorkOrder】
|
||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||||
@@ -362,7 +365,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_name("混碾机满盅入库之取空")
|
.task_name("混碾机满盅入库之取空")
|
||||||
.task_type("task_type")
|
.task_type("hnjsendm")
|
||||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||||
.point_code2(point_code1)
|
.point_code2(point_code1)
|
||||||
.priority("1")
|
.priority("1")
|
||||||
@@ -381,7 +384,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_name("混碾机满盅入库之取满")
|
.task_name("混碾机满盅入库之取满")
|
||||||
.task_type("task_type")
|
.task_type("hnjsendm")
|
||||||
.task_status(TaskStatusEnum.SURE_START.getCode())
|
.task_status(TaskStatusEnum.SURE_START.getCode())
|
||||||
.point_code1(point_code1)
|
.point_code1(point_code1)
|
||||||
.priority("1")
|
.priority("1")
|
||||||
@@ -389,6 +392,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
.is_auto_issue(is_auto_issue)
|
.is_auto_issue(is_auto_issue)
|
||||||
.task_group_id(task_group_id)
|
.task_group_id(task_group_id)
|
||||||
.sort_seq(2)
|
.sort_seq(2)
|
||||||
|
.material_qty(qty)
|
||||||
.acs_task_type("1")
|
.acs_task_type("1")
|
||||||
.create_mode(create_mode)
|
.create_mode(create_mode)
|
||||||
.material_info_id(workOrderObj.getLong("workorder_id"))
|
.material_info_id(workOrderObj.getLong("workorder_id"))
|
||||||
@@ -413,6 +417,8 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
@@ -424,6 +430,9 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
@@ -438,17 +447,22 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
map.put("task_code", taskObj.getString("task_code"));
|
map.put("task_code", taskObj.getString("task_code"));
|
||||||
array.add(map);
|
array.add(map);
|
||||||
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
||||||
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
|
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
|
||||||
this.updateTaskStatus(taskObj, "0");
|
this.updateTaskStatus(taskObj, "0");
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, "0");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class TimingSendMaterialTask extends AbstractAcsTask {
|
|||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_name("定时任务生成空料盅区有料到困料区的任务")
|
.task_name("定时任务生成空料盅区有料到困料区的任务")
|
||||||
.task_type("task_type")
|
.task_type("timing")
|
||||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||||
.point_code1(point_code1)
|
.point_code1(point_code1)
|
||||||
.point_code2(point_code2)
|
.point_code2(point_code2)
|
||||||
@@ -226,6 +226,8 @@ public class TimingSendMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
WmsToAcsServiceImpl wmsToAcsService = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
@@ -237,7 +239,9 @@ public class TimingSendMaterialTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
@@ -249,18 +253,23 @@ public class TimingSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
|
Integer task_status = taskObj.getInteger("task_status");
|
||||||
|
if (task_status >= 5) {
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", task_id);
|
map.put("task_id", task_id);
|
||||||
map.put("task_code", taskObj.getString("task_code"));
|
map.put("task_code", taskObj.getString("task_code"));
|
||||||
array.add(map);
|
array.add(map);
|
||||||
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
Map<String, Object> resp = wmsToAcsService.cancelToAcs(array);
|
||||||
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
|
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
|
||||||
this.updateTaskStatus(taskObj, "0");
|
this.updateTaskStatus(taskObj, "0");
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException(String.valueOf(resp.get("message")));
|
throw new BadRequestException(String.valueOf(resp.get("message")));
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
this.updateTaskStatus(taskObj, "0");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
// ll.clear();
|
// ll.clear();
|
||||||
JSONObject jsonObject = wo.query("region_code = '" + HcwNumEnum.GT2.getCode() + "'").uniqueResult(0);
|
JSONObject jsonObject = wo.query("region_code = '" + HcwNumEnum.GT2.getCode() + "'").uniqueResult(0);
|
||||||
String material_id_gt = jsonObject.getString("material_id");
|
String material_id_gt = jsonObject.getString("material_id");
|
||||||
|
String ivt_qty = jsonObject.getString("ivt_qty");
|
||||||
JSONObject jsonMa_gt = new JSONObject();
|
JSONObject jsonMa_gt = new JSONObject();
|
||||||
String material_code_gt2 = "";
|
String material_code_gt2 = "";
|
||||||
if (StrUtil.isNotEmpty(material_id_gt)) {
|
if (StrUtil.isNotEmpty(material_id_gt)) {
|
||||||
@@ -336,6 +337,7 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
map.put("vehicle_code", jsonObject.getString("vehicle_code"));
|
map.put("vehicle_code", jsonObject.getString("vehicle_code"));
|
||||||
map.put("vehicle_type", jsonObject.getString("vehicle_type"));
|
map.put("vehicle_type", jsonObject.getString("vehicle_type"));
|
||||||
map.put("material_code", material_code_gt2);
|
map.put("material_code", material_code_gt2);
|
||||||
|
map.put("ivt_qty", ivt_qty);
|
||||||
ll.addLast(map);
|
ll.addLast(map);
|
||||||
}
|
}
|
||||||
JSONArray jsonArray = wo.query("region_code = '" + HcwNumEnum.KLZCQ.getCode() + "'", "point_code").getResultJSONArray(0);
|
JSONArray jsonArray = wo.query("region_code = '" + HcwNumEnum.KLZCQ.getCode() + "'", "point_code").getResultJSONArray(0);
|
||||||
@@ -363,6 +365,7 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
map.put("vehicle_code", jsonObject1.getString("vehicle_code"));
|
map.put("vehicle_code", jsonObject1.getString("vehicle_code"));
|
||||||
map.put("vehicle_type", jsonObject1.getString("vehicle_type"));
|
map.put("vehicle_type", jsonObject1.getString("vehicle_type"));
|
||||||
map.put("material_code", material_code);
|
map.put("material_code", material_code);
|
||||||
|
map.put("ivt_qty", jsonObject1.getString("ivt_qty"));
|
||||||
ll.addLast(map);
|
ll.addLast(map);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -370,11 +373,10 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
map.put("vehicle_code", jsonObject1.getString("vehicle_code"));
|
map.put("vehicle_code", jsonObject1.getString("vehicle_code"));
|
||||||
map.put("vehicle_type", jsonObject1.getString("vehicle_type"));
|
map.put("vehicle_type", jsonObject1.getString("vehicle_type"));
|
||||||
map.put("material_code", material_code);
|
map.put("material_code", material_code);
|
||||||
|
map.put("ivt_qty", jsonObject1.getString("ivt_qty"));
|
||||||
ll.addLast(map);
|
ll.addLast(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
redisUtils.set("ll", ll);
|
|
||||||
System.out.println(ll.size());
|
|
||||||
return ll;
|
return ll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user