Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -291,6 +291,11 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
if (move > 0 && !requireSucess) {
|
if (move > 0 && !requireSucess) {
|
||||||
applyLaStrangulationAndLabeling(mode);
|
applyLaStrangulationAndLabeling(mode);
|
||||||
}
|
}
|
||||||
|
case 17:
|
||||||
|
//申请调试贴标
|
||||||
|
if(move > 0 && !requireSucess){
|
||||||
|
applyLaStrangulationAndLabeling(mode);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -413,6 +418,8 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
String bindingTemplate = jo.get("bindingTemplate").toString();
|
String bindingTemplate = jo.get("bindingTemplate").toString();
|
||||||
String printDevice = jo.get("printDevice").toString();
|
String printDevice = jo.get("printDevice").toString();
|
||||||
String bundleTimes = jo.get("bundleTimes").toString();
|
String bundleTimes = jo.get("bundleTimes").toString();
|
||||||
|
String case1 = jo.get("case").toString();
|
||||||
|
String direction = jo.get("direction").toString();
|
||||||
|
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
if (mode == 10 || mode == 16) {
|
if (mode == 10 || mode == 16) {
|
||||||
@@ -521,6 +528,41 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
map12.put("value", labelingTemplate);
|
map12.put("value", labelingTemplate);
|
||||||
list.add(map12);
|
list.add(map12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mode == 17){
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_length");
|
||||||
|
map.put("value", length);
|
||||||
|
list.add(map);
|
||||||
|
Map map2 = new HashMap();
|
||||||
|
map2.put("code", "to_weight");
|
||||||
|
map2.put("value", weight);
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code", "to_height");
|
||||||
|
map3.put("value", height);
|
||||||
|
list.add(map3);
|
||||||
|
Map map5 = new HashMap();
|
||||||
|
map5.put("code", "to_command");
|
||||||
|
map5.put("value", mode);
|
||||||
|
list.add(map5);
|
||||||
|
Map map11 = new HashMap();
|
||||||
|
map11.put("code", "to_binding_times");
|
||||||
|
map11.put("value", bundleTimes);
|
||||||
|
list.add(map11);
|
||||||
|
if(StrUtil.isNotEmpty(case1) && !" ".equals(case1)){
|
||||||
|
Map map12 = new HashMap();
|
||||||
|
map12.put("code", "to_binding_times");
|
||||||
|
map12.put("value", bundleTimes);
|
||||||
|
list.add(map12);
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotEmpty(direction) && !" ".equals(direction)){
|
||||||
|
Map map13 = new HashMap();
|
||||||
|
map13.put("code", "to_direction");
|
||||||
|
map13.put("value", direction);
|
||||||
|
list.add(map13);
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
|||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||||
|
import org.nl.acs.history.ErrorUtil;
|
||||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||||
import org.nl.acs.instruction.domain.Instruction;
|
import org.nl.acs.instruction.domain.Instruction;
|
||||||
|
import org.nl.acs.instruction.enums.InstructionStatusEnum;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||||
@@ -323,7 +325,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
storage_cache = this.itemProtocol.getItem_storage_cache();
|
storage_cache = this.itemProtocol.getItem_storage_cache();
|
||||||
|
|
||||||
if (!command.equals(last_command)){
|
if (!command.equals(last_command)){
|
||||||
requireSucess=true;
|
requireSucess=false;
|
||||||
if (command==0){
|
if (command==0){
|
||||||
clearWrite();
|
clearWrite();
|
||||||
}
|
}
|
||||||
@@ -362,59 +364,36 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mode != 3 && requireSucess) {
|
if (mode != 3 && requireSucess) {
|
||||||
message = "one_message7";
|
message = "one_message7";
|
||||||
|
|
||||||
} else if (error != 0) {
|
|
||||||
message = "universal_message3";
|
|
||||||
//指定库位满入
|
|
||||||
if (error == 5 && count< WcsConfig.stacker_error_in_count) {
|
|
||||||
//相同任务时限制加一
|
|
||||||
if (Objects.equals(task, last_task)){
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
applyUpdatePointCode(StandarStirageErroEnum.FILL.getType());
|
|
||||||
}
|
|
||||||
//空出
|
|
||||||
if (error == 6) {
|
|
||||||
applyUpdatePointCode(StandarStirageErroEnum.VOIDANCE.getType());
|
|
||||||
}
|
|
||||||
|
|
||||||
//浅货位有货
|
|
||||||
if (error == 16) {
|
|
||||||
//放货
|
|
||||||
if (cargoMove == 1 && count< WcsConfig.stacker_error_in_count) {
|
|
||||||
//相同任务时限制加一
|
|
||||||
if (Objects.equals(task, last_task)){
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType());
|
|
||||||
} else if (cargoMove == 0) {
|
|
||||||
//取货
|
|
||||||
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_IN.getType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
if (error != 0) {
|
||||||
|
//满入空出或者浅货位阻挡
|
||||||
|
erroBlock();
|
||||||
|
}
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 0:
|
case 0:
|
||||||
boolean b = applyTask();
|
boolean b = applyTask();
|
||||||
if (b) {
|
if (b) {
|
||||||
requireSucess = true;
|
if (updateCommand("0")) break;
|
||||||
|
requireSucess = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
message = "universal_delivery";
|
message = "universal_delivery";
|
||||||
|
if (updateCommand("1")) break;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
message = "universal_completed";
|
message = "universal_completed";
|
||||||
Instruction instruction = checkInst();
|
if (updateCommand("2")) break;
|
||||||
if (ObjectUtil.isEmpty(instruction)) {
|
Instruction instruction2 = checkInst();
|
||||||
|
if (ObjectUtil.isEmpty(instruction2)) {
|
||||||
message = "universal_message4";
|
message = "universal_message4";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String next_device_code = instruction.getNext_device_code();
|
String next_device_code = instruction2.getNext_device_code();
|
||||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||||
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) {
|
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) {
|
||||||
@@ -464,13 +443,15 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map4.put("code", "to_command");
|
map4.put("code", "to_command");
|
||||||
map4.put("value", 2);
|
map4.put("value", 2);
|
||||||
list.add(map4);
|
list.add(map4);
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
message = "universal_releasing";
|
message = "universal_releasing";
|
||||||
|
if (updateCommand("3")) break;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
message = "one_message1";
|
message = "one_message1";
|
||||||
|
if (updateCommand("4")) break;
|
||||||
Instruction instruction1 = checkInst();
|
Instruction instruction1 = checkInst();
|
||||||
String next_device_code1 = instruction1.getNext_device_code();
|
String next_device_code1 = instruction1.getNext_device_code();
|
||||||
Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1);
|
Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1);
|
||||||
@@ -490,10 +471,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map.put("value", 4);
|
map.put("value", 4);
|
||||||
list.add(map);
|
list.add(map);
|
||||||
}
|
}
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
message = "universal_releasing_completed";
|
message = "universal_releasing_completed";
|
||||||
|
if (updateCommand("5")) break;
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("code", "to_command");
|
map.put("code", "to_command");
|
||||||
map.put("value", 11);
|
map.put("value", 11);
|
||||||
@@ -504,7 +486,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
message = "one_message2";
|
message = "one_message2";
|
||||||
@@ -512,7 +494,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map1.put("code", "to_command");
|
map1.put("code", "to_command");
|
||||||
map1.put("value", 6);
|
map1.put("value", 6);
|
||||||
list.add(map1);
|
list.add(map1);
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
message = "one_message3";
|
message = "one_message3";
|
||||||
@@ -520,7 +502,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map2.put("code", "to_command");
|
map2.put("code", "to_command");
|
||||||
map2.put("value", 7);
|
map2.put("value", 7);
|
||||||
list.add(map2);
|
list.add(map2);
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
message = "one_message4";
|
message = "one_message4";
|
||||||
@@ -528,11 +510,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map3.put("code", "to_command");
|
map3.put("code", "to_command");
|
||||||
map3.put("value", 8);
|
map3.put("value", 8);
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
message = "one_message5";
|
message = "one_message5";
|
||||||
requireSucess = true;
|
requireSucess = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (list.size() != 0) {
|
if (list.size() != 0) {
|
||||||
@@ -576,6 +558,71 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
last_fork_runingTimes = fork_runingTimes;*/
|
last_fork_runingTimes = fork_runingTimes;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean updateCommand(String toCommand) {
|
||||||
|
Instruction instruction0 = checkInst();
|
||||||
|
if (ObjectUtil.isEmpty(instruction0)) {
|
||||||
|
message = "universal_message4";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
instruction0.setExecute_code(toCommand);
|
||||||
|
instructionService.update(instruction0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void erroBlock() {
|
||||||
|
|
||||||
|
message = "universal_message3";
|
||||||
|
//指定库位满入
|
||||||
|
if (error == 5 && count< WcsConfig.stacker_error_in_count) {
|
||||||
|
//清警
|
||||||
|
cleanErro();
|
||||||
|
//相同任务时限制加一
|
||||||
|
if (Objects.equals(task, last_task)){
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
applyUpdatePointCode(StandarStirageErroEnum.FILL.getType());
|
||||||
|
}
|
||||||
|
//空出直接完结指令
|
||||||
|
if (error == 6) {
|
||||||
|
//清警
|
||||||
|
cleanErro();
|
||||||
|
Instruction instruction = checkInst();
|
||||||
|
try {
|
||||||
|
finish_instruction(instruction);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//浅货位有货
|
||||||
|
if (error == 16) {
|
||||||
|
//清警
|
||||||
|
cleanErro();
|
||||||
|
//放货
|
||||||
|
if (cargoMove == 1 && count< WcsConfig.stacker_error_in_count) {
|
||||||
|
//相同任务时限制加一
|
||||||
|
if (Objects.equals(task, last_task)){
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType());
|
||||||
|
} else if (cargoMove == 0) {
|
||||||
|
//取货
|
||||||
|
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_IN.getType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cleanErro() {
|
||||||
|
|
||||||
|
List list = new ArrayList();
|
||||||
|
HashMap map = new HashMap();
|
||||||
|
map.put("code","to_command");
|
||||||
|
map.put("value","5");
|
||||||
|
list.add(map);
|
||||||
|
writing(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请更新点位
|
* 申请更新点位
|
||||||
*
|
*
|
||||||
@@ -612,15 +659,15 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (ObjectUtil.isEmpty(point)) {
|
if (ObjectUtil.isEmpty(point)) {
|
||||||
message = "one_message18";
|
message = "one_message18";
|
||||||
}
|
}
|
||||||
if (type.equals(StandarStirageErroEnum.VOIDANCE.getType())) {
|
|
||||||
updateData1(poinCode, instruction, point, split);
|
|
||||||
List list = new ArrayList();
|
|
||||||
pakageData(list, point, split);
|
|
||||||
}
|
|
||||||
if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) {
|
if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) {
|
||||||
updateData2(poinCode, instruction, point, split);
|
task = task*1000;
|
||||||
|
updateData2(poinCode, instruction, point, split,task);
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
pakageData(list, point, split);
|
String x = point.getExtraValue().get("x").toString();
|
||||||
|
String y = split[1];
|
||||||
|
String z = split[2];
|
||||||
|
pakagePLCData(list, x,y,z,"2",task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//取货潜货位阻挡做完移库任务
|
//取货潜货位阻挡做完移库任务
|
||||||
@@ -648,10 +695,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pakageData(List list, Device point, String[] split) {
|
private void pakagePLCData(List list, String x, String y, String z, String toCommand, Integer task) {
|
||||||
String x = point.getExtraValue().get("x").toString();
|
|
||||||
String y = split[1];
|
|
||||||
String z = split[2];
|
|
||||||
HashMap map1 = new HashMap();
|
HashMap map1 = new HashMap();
|
||||||
map1.put("code", "to_x");
|
map1.put("code", "to_x");
|
||||||
map1.put("value", y);
|
map1.put("value", y);
|
||||||
@@ -664,11 +708,20 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map3.put("code", "to_z");
|
map3.put("code", "to_z");
|
||||||
map3.put("value", x);
|
map3.put("value", x);
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
|
HashMap map4 = new HashMap();
|
||||||
|
map4.put("code", "to_task");
|
||||||
|
map4.put("value", task);
|
||||||
|
list.add(map4);
|
||||||
|
HashMap map5 = new HashMap();
|
||||||
|
map5.put("code", "to_command");
|
||||||
|
map5.put("value", toCommand);
|
||||||
|
list.add(map5);
|
||||||
if (ObjectUtil.isNotEmpty(list)) {
|
if (ObjectUtil.isNotEmpty(list)) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void clearWrite() {
|
public void clearWrite() {
|
||||||
List list = new ArrayList<>();
|
List list = new ArrayList<>();
|
||||||
Map map = new HashMap<>();
|
Map map = new HashMap<>();
|
||||||
@@ -696,11 +749,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
message=null;
|
message=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split) {
|
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split, Integer task) {
|
||||||
Instruction instructionUpdate = checkInst();
|
Instruction instructionUpdate = checkInst();
|
||||||
TaskDto taskUpdate = new TaskDto();
|
TaskDto taskUpdate = new TaskDto();
|
||||||
instructionUpdate.setNext_point_code(poinCode);
|
instructionUpdate.setNext_point_code(poinCode);
|
||||||
instructionUpdate.setNext_device_code(split[0]);
|
instructionUpdate.setNext_device_code(split[0]);
|
||||||
|
instructionUpdate.setInstruction_code(String.valueOf(task));
|
||||||
taskUpdate.setNext_point_code(poinCode);
|
taskUpdate.setNext_point_code(poinCode);
|
||||||
taskUpdate.setNext_device_code(split[0]);
|
taskUpdate.setNext_device_code(split[0]);
|
||||||
taskUpdate.setTask_id(instructionUpdate.getTask_id());
|
taskUpdate.setTask_id(instructionUpdate.getTask_id());
|
||||||
@@ -709,19 +763,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
taskserver.update(taskUpdate);
|
taskserver.update(taskUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateData1(String poinCode, Instruction instruction, Device point, String[] split) {
|
|
||||||
Instruction instructionUpdate = checkInst();
|
|
||||||
TaskDto taskUpdate = new TaskDto();
|
|
||||||
instructionUpdate.setStart_point_code(poinCode);
|
|
||||||
instructionUpdate.setStart_device_code(split[0]);
|
|
||||||
taskUpdate.setStart_point_code(poinCode);
|
|
||||||
taskUpdate.setStart_device_code(split[0]);
|
|
||||||
taskUpdate.setTask_id(instructionUpdate.getTask_id());
|
|
||||||
pakageData1(instruction, instructionUpdate, point, split, taskUpdate);
|
|
||||||
//更新缓存数据库
|
|
||||||
instructionService.update(instructionUpdate);
|
|
||||||
taskserver.update(taskUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void pakageData1(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) {
|
private void pakageData1(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) {
|
||||||
instructionUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString());
|
instructionUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString());
|
||||||
@@ -759,6 +801,14 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
//维修解警后重新向堆垛机下发指令
|
||||||
|
Instruction instructionErro = checkInst();
|
||||||
|
if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())){
|
||||||
|
List list = new ArrayList();
|
||||||
|
pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
//输入:指令类型多种\ 指令状态多种\
|
//输入:指令类型多种\ 指令状态多种\
|
||||||
Instruction instruction1 = new Instruction();
|
Instruction instruction1 = new Instruction();
|
||||||
@@ -813,7 +863,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
|
|
||||||
pakageCommand(list, inst.getInstruction_code());
|
pakageCommand(list,"1", inst.getInstruction_code());
|
||||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
|
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
|
||||||
HashMap map4 = new HashMap();
|
HashMap map4 = new HashMap();
|
||||||
@@ -869,14 +919,14 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
list.add(map7);
|
list.add(map7);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pakageCommand(List list, String inst) {
|
private void pakageCommand(List list, String toCommand,String inst) {
|
||||||
HashMap map1 = new HashMap();
|
HashMap map1 = new HashMap();
|
||||||
map1.put("code", "to_device_code");
|
map1.put("code", "to_device_code");
|
||||||
map1.put("value", this.getDevice().getAddress());
|
map1.put("value", this.getDevice().getAddress());
|
||||||
list.add(map1);
|
list.add(map1);
|
||||||
HashMap map2 = new HashMap();
|
HashMap map2 = new HashMap();
|
||||||
map2.put("code", "to_command");
|
map2.put("code", "to_command");
|
||||||
map2.put("value", 1);
|
map2.put("value", toCommand);
|
||||||
list.add(map2);
|
list.add(map2);
|
||||||
HashMap map3 = new HashMap();
|
HashMap map3 = new HashMap();
|
||||||
map3.put("code", "to_task");
|
map3.put("code", "to_task");
|
||||||
@@ -1036,7 +1086,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
jo.put("command", command);
|
jo.put("command", command);
|
||||||
jo.put("action", action);
|
jo.put("action", action);
|
||||||
jo.put("task", task);
|
jo.put("task", task);
|
||||||
jo.put("error", this.getError());
|
jo.put("error", ErrorUtil.getDictDetail("ddj_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("prohibitInWarehouse", this.prohibitInWarehouse);
|
jo.put("prohibitInWarehouse", this.prohibitInWarehouse);
|
||||||
jo.put("prohibitOutWarehouse", this.prohibitOutWarehouse);
|
jo.put("prohibitOutWarehouse", this.prohibitOutWarehouse);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ErrorUtil {
|
|||||||
List<Dict> dictDtos = dictDetailService.queryAll();
|
List<Dict> dictDtos = dictDetailService.queryAll();
|
||||||
for (int i = 0; i < dictDtos.size(); i++) {
|
for (int i = 0; i < dictDtos.size(); i++) {
|
||||||
Dict dictDto = dictDtos.get(i);
|
Dict dictDto = dictDtos.get(i);
|
||||||
dictMap.put(dictDto.getName(), getDict(dictDto.getName(), dictDetailService::getDictByName));
|
dictMap.put(dictDto.getCode(), getDict(dictDto.getCode(), dictDetailService::getDictByName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,4 +364,9 @@ public class InstructionDto implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String to_device_code;
|
private String to_device_code;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// private String to_device_code;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class CreateDDJInst {
|
|||||||
standardStackerDeviceDriver = (StandardStackerDeviceDriver) deviceByCode.getDeviceDriver();
|
standardStackerDeviceDriver = (StandardStackerDeviceDriver) deviceByCode.getDeviceDriver();
|
||||||
if (standardStackerDeviceDriver.getMode() != 3 || standardStackerDeviceDriver.getMove() == 1 || standardStackerDeviceDriver.getCommand() != 0) {
|
if (standardStackerDeviceDriver.getMode() != 3 || standardStackerDeviceDriver.getMove() == 1 || standardStackerDeviceDriver.getCommand() != 0) {
|
||||||
log.error("堆垛机,{}未联机或者在执行中", deviceByCode.getDevice_code());
|
log.error("堆垛机,{}未联机或者在执行中", deviceByCode.getDevice_code());
|
||||||
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("堆垛机,{}未联机或者在执行中" + deviceByCode.getDevice_code());
|
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("堆垛机,{}未联机或者在执行中");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,6 @@ public class CreateDDJInst {
|
|||||||
routeLineService.getShortPathLines(
|
routeLineService.getShortPathLines(
|
||||||
taskDto.getStart_device_code(), taskDto.getNext_device_code(), taskDto.getRoute_plan_code());
|
taskDto.getStart_device_code(), taskDto.getNext_device_code(), taskDto.getRoute_plan_code());
|
||||||
if (ObjectUtils.isEmpty(list)) {
|
if (ObjectUtils.isEmpty(list)) {
|
||||||
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("路由不通" + deviceByCode.getDevice_code());
|
|
||||||
throw new BadRequestException("路由不通");
|
throw new BadRequestException("路由不通");
|
||||||
}
|
}
|
||||||
RouteLineDto routeLineDto = list.get(0);
|
RouteLineDto routeLineDto = list.get(0);
|
||||||
@@ -150,7 +149,7 @@ public class CreateDDJInst {
|
|||||||
standardStackerDeviceDriver = (StandardStackerDeviceDriver) deviceByCode.getDeviceDriver();
|
standardStackerDeviceDriver = (StandardStackerDeviceDriver) deviceByCode.getDeviceDriver();
|
||||||
if (standardStackerDeviceDriver.getMode() != 3 || standardStackerDeviceDriver.getForkCargo() == 1 || standardStackerDeviceDriver.getCommand() != 0) {
|
if (standardStackerDeviceDriver.getMode() != 3 || standardStackerDeviceDriver.getForkCargo() == 1 || standardStackerDeviceDriver.getCommand() != 0) {
|
||||||
log.error("堆垛机,{}未联机或者在执行中", deviceByCode.getDevice_code());
|
log.error("堆垛机,{}未联机或者在执行中", deviceByCode.getDevice_code());
|
||||||
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("堆垛机,{}未联机或者在执行中" + deviceByCode.getDevice_code());
|
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("堆垛机,{}未联机或者在执行中");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,7 +161,7 @@ public class CreateDDJInst {
|
|||||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
|
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
|
||||||
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) {
|
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) {
|
||||||
log.error("输送机,{}未联机或执行中", next_device_code);
|
log.error("输送机,{}未联机或执行中", next_device_code);
|
||||||
((BeltConveyorDeviceDriver) nextDevice.getDeviceDriver()).setNotCreateInstMessage("输送机,{}未联机或执行中" + deviceByCode.getDevice_code());
|
((BeltConveyorDeviceDriver) nextDevice.getDeviceDriver()).setNotCreateInstMessage("one_message7");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,35 +48,32 @@ public class AutoQueryStructattrNum {
|
|||||||
List<JSONObject> haveList = WQL.getWO("AUTO002").addParam("flag", "2")
|
List<JSONObject> haveList = WQL.getWO("AUTO002").addParam("flag", "2")
|
||||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||||
|
|
||||||
// 获取系统参数
|
|
||||||
String download_attr_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("download_attr_num").getValue();
|
|
||||||
|
|
||||||
// 需要插入的集合
|
// 需要插入的集合
|
||||||
List<SysNotice> daoList = new ArrayList<>();
|
List<SysNotice> daoList = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < empList.size(); i++) {
|
for (int i = 0; i < empList.size(); i++) {
|
||||||
JSONObject json = empList.get(i);
|
JSONObject json = empList.get(i);
|
||||||
|
|
||||||
if (json.getDoubleValue("num") <= Double.parseDouble(download_attr_num)) {
|
// 已用仓位
|
||||||
|
double aDouble = haveList.stream()
|
||||||
// 已用仓位
|
.filter(row -> row.getString("layer_num").equals(json.getString("layer_num")))
|
||||||
double aDouble = haveList.stream()
|
.map(row -> row.getDoubleValue("num"))
|
||||||
.filter(row -> row.getString("layer_num").equals(json.getString("layer_num")))
|
.reduce(Double::sum).orElse(0.00);
|
||||||
.map(row -> row.getDoubleValue("num"))
|
|
||||||
.reduce(Double::sum).orElse(0.00);
|
|
||||||
|
|
||||||
|
|
||||||
// 计算主存区和
|
// 计算主存区和
|
||||||
double add = NumberUtil.add(json.getDoubleValue("num"), aDouble);
|
double add = NumberUtil.add(json.getDoubleValue("num"), aDouble);
|
||||||
|
|
||||||
// 空位占比
|
// 空位占比
|
||||||
double emp_pro = NumberUtil.round(NumberUtil.div(json.getDoubleValue("num"), add) * 100, 2).doubleValue();
|
double emp_pro = NumberUtil.round(NumberUtil.div(json.getDoubleValue("num"), add) * 100, 2).doubleValue();
|
||||||
// 有货占比
|
// 有货占比
|
||||||
double have_pro = NumberUtil.round(NumberUtil.div(aDouble, add) * 100, 2).doubleValue();
|
double have_pro = NumberUtil.round(NumberUtil.div(aDouble, add) * 100, 2).doubleValue();
|
||||||
|
|
||||||
|
// 有货占比大于70%则报警
|
||||||
|
if (have_pro >= 70) {
|
||||||
// 内容
|
// 内容
|
||||||
String notice_title = "立库"+json.getString("layer_num")+ "层主存区仓位不足"+download_attr_num+"个!可用仓位:"
|
String notice_title = "立库" + json.getString("layer_num") + "层主存区可用仓位不足30%!可用仓位:"
|
||||||
+json.getString("num")+ "个 占比:"+emp_pro+"% ,已用仓位:"+NumberUtil.round(aDouble, 0) +"个 占比:"+have_pro+"%";
|
+ json.getString("num") + "个 占比:" + emp_pro + "% ,已用仓位:" + NumberUtil.round(aDouble, 0) + "个 占比:" + have_pro + "%";
|
||||||
|
|
||||||
SysNotice dao = SysNotice.builder()
|
SysNotice dao = SysNotice.builder()
|
||||||
.notice_id(IdUtil.getStringId())
|
.notice_id(IdUtil.getStringId())
|
||||||
|
|||||||
Reference in New Issue
Block a user