Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -84,6 +84,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
dos = new DataOutputStream(s.getOutputStream());
|
||||
dis = new DataInputStream(s.getInputStream());
|
||||
System.out.println("1楼NDCAgv链接成功");
|
||||
log.info("1楼NDCAgv链接成功");
|
||||
while (bConnected) {
|
||||
int count = dis.read(b);
|
||||
|
||||
@@ -187,10 +188,13 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
} else {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
|
||||
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
|
||||
agvNdcOneDeviceDriver.processSocket(arr);
|
||||
if(ObjectUtil.isNotEmpty(device)){
|
||||
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
|
||||
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
|
||||
agvNdcOneDeviceDriver.processSocket(arr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(data)) {
|
||||
write(data);
|
||||
@@ -203,6 +207,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("OneAgv链接异常");
|
||||
log.info("OneAgv链接异常");
|
||||
if(ObjectUtil.isNotEmpty(s)){
|
||||
s.close();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ public enum DriverTypeEnum {
|
||||
|
||||
HONGXIANG_CONVEYOR(13, "hongxiang_conveyor", "烘箱对接位", "conveyor"),
|
||||
|
||||
INSPECT_CONVEYOR_CONTROL_WITH_SCANNER(14, "standard_conveyor_control_with_scanner", "标准版-输送机-控制点-关联扫码", "conveyor");
|
||||
INSPECT_CONVEYOR_CONTROL_WITH_SCANNER(14, "standard_conveyor_control_with_scanner", "标准版-输送机-控制点-关联扫码", "conveyor"),
|
||||
|
||||
PLUG_PULL_DEVICE_SITE(15, "plug_pull_device_site", "插拔轴站点", "conveyor");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -79,13 +79,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
int carno = arr[20];
|
||||
Instruction link_inst = null;
|
||||
List<Instruction> insts = null;
|
||||
Instruction inst = null;
|
||||
boolean link_flag = false;
|
||||
Device agv_device = null;
|
||||
if (carno != 0) {
|
||||
agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno));
|
||||
}
|
||||
if (ikey != 0) {
|
||||
insts = instructionService.findByLinkNum(String.valueOf(ikey));
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(link_inst)) {
|
||||
link_flag = true;
|
||||
@@ -114,10 +115,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
//分配 车id
|
||||
//(不需要WCS反馈)
|
||||
if (phase == 0x02) {
|
||||
for (Instruction inst : insts) {
|
||||
inst.setCarno(String.valueOf(carno));
|
||||
instructionService.update(inst);
|
||||
}
|
||||
inst.setCarno(String.valueOf(carno));
|
||||
instructionService.update(inst);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data);
|
||||
|
||||
//到达取货点
|
||||
@@ -151,33 +150,34 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", agvaddr + "对应设备号为空");
|
||||
return;
|
||||
}
|
||||
for (Instruction inst : insts) {
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
break;
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
if(siemensConveyorDeviceDriver.getMove() == 1 && siemensConveyorDeviceDriver.getMode() == 2 ){
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
if(siemensConveyorDeviceDriver.getMove() == 1 ){
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
log.info("请求取货条件不满足待机有货");
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
//取货完毕
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x05) {
|
||||
@@ -208,34 +208,33 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code);
|
||||
return;
|
||||
}
|
||||
for (Instruction inst : insts) {
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
break;
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.equals(inst.getStart_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
if (StrUtil.equals(inst.getStart_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
siemensConveyorDeviceDriver.writing(2);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
siemensConveyorDeviceDriver.writing(2);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
@@ -267,27 +266,26 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
for (Instruction inst : insts) {
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
break;
|
||||
}
|
||||
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
// standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
// standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
// standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
@@ -320,27 +318,26 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
for (Instruction inst : insts) {
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
break;
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
// standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
// standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
// standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
package org.nl.acs.device_driver.basedriver.plug_pull_device_site;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Data
|
||||
public class ItemProtocol {
|
||||
|
||||
//1/0 手动/自动
|
||||
public static String item_mode = "mode";
|
||||
//0/1 半自动/全自动
|
||||
public static String item_action = "action";
|
||||
//0/1 远程/本地控制
|
||||
public static String item_control = "control";
|
||||
//2 运行中
|
||||
//1 急停/故障
|
||||
//0 待机中
|
||||
public static String item_status = "status";
|
||||
//1 机头上有轴
|
||||
public static String item_move = "move";
|
||||
//1/0 穿轴中/穿轴完成
|
||||
public static String item_plug_finish = "plug_finish";
|
||||
//1/0 把轴中/拔轴完成
|
||||
public static String item_pull_finish = "pull_finish";
|
||||
//3寸轴穿轴次数
|
||||
public static String item_3plug_times = "3plug_times";
|
||||
//6寸轴穿轴次数
|
||||
public static String item_6plug_times = "6plug_times";
|
||||
//3寸轴拔轴次数
|
||||
public static String item_3pull_times = "3pull_times";
|
||||
//6寸轴拔轴次数
|
||||
public static String item_6pull_times = "6pull_times";
|
||||
//穿轴总次数
|
||||
public static String item_plug_alltimes = "plug_alltimes";
|
||||
//拔轴总次数
|
||||
public static String item_pull_alltimes = "pull_alltimes";
|
||||
|
||||
|
||||
//1 全自动启动
|
||||
public static String item_to_command = "to_command";
|
||||
//0/1 穿轴/拔轴
|
||||
public static String item_to_type = "to_type";
|
||||
//3/6 轴尺寸
|
||||
public static String item_to_size = "to_size";
|
||||
|
||||
|
||||
private PlugPullDeviceSiteDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(PlugPullDeviceSiteDeviceDriver driver) {
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
public int getItem_mode(){
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
} ;
|
||||
public int getItem_move(){
|
||||
return this.getOpcIntegerValue(item_move);
|
||||
} ;
|
||||
public int getItem_action(){
|
||||
return this.getOpcIntegerValue(item_action);
|
||||
};
|
||||
public int getItem_control(){
|
||||
return this.getOpcIntegerValue(item_control);
|
||||
} ;
|
||||
public int getItem_status(){
|
||||
return this.getOpcIntegerValue(item_status);
|
||||
} ;
|
||||
public int getItem_plug_finish(){
|
||||
return this.getOpcIntegerValue(item_plug_finish);
|
||||
} ;
|
||||
public int getItem_pull_finish(){
|
||||
return this.getOpcIntegerValue(item_pull_finish);
|
||||
} ;
|
||||
public int getItem_3plug_times(){
|
||||
return this.getOpcIntegerValue(item_3plug_times);
|
||||
} ;
|
||||
public int getItem_6plug_times(){
|
||||
return this.getOpcIntegerValue(item_6plug_times);
|
||||
} ;
|
||||
public int getItem_3pull_times(){
|
||||
return this.getOpcIntegerValue(item_3pull_times);
|
||||
} ;
|
||||
public int getItem_6pull_times(){
|
||||
return this.getOpcIntegerValue(item_6pull_times);
|
||||
} ;
|
||||
public int getItem_plug_alltimes(){
|
||||
return this.getOpcIntegerValue(item_plug_alltimes);
|
||||
} ;
|
||||
public int getItem_pull_alltimes(){
|
||||
return this.getOpcIntegerValue(item_pull_alltimes);
|
||||
} ;
|
||||
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
Integer value = this.driver.getIntegeregerValue(protocol);
|
||||
if (value == null) {
|
||||
setIsonline(false);
|
||||
} else {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public float getOpcFloatValue(String protocol) {
|
||||
Float value = this.driver.getDoubleValue(protocol);
|
||||
if (value == null) {
|
||||
setIsonline(false);
|
||||
} else {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_mode, "工作模式", "30243"));
|
||||
list.add(new ItemDto(item_action, "半自动/全自动", "30245"));
|
||||
list.add(new ItemDto(item_control, "远程控制", "30254"));
|
||||
list.add(new ItemDto(item_status, "状态", "30181"));
|
||||
list.add(new ItemDto(item_move, "机头上有轴", "30252"));
|
||||
list.add(new ItemDto(item_plug_finish, "穿轴完成", "30249"));
|
||||
list.add(new ItemDto(item_pull_finish, "拔轴完成", "30250"));
|
||||
list.add(new ItemDto(item_3plug_times, "3寸轴穿轴次数", "30231"));
|
||||
list.add(new ItemDto(item_6plug_times, "6寸轴穿轴次数", "30235"));
|
||||
list.add(new ItemDto(item_3pull_times, "3寸轴拔轴次数", "30233"));
|
||||
list.add(new ItemDto(item_6pull_times, "6寸轴拔轴次数", "30237"));
|
||||
list.add(new ItemDto(item_plug_alltimes, "穿轴总次数", "30239"));
|
||||
list.add(new ItemDto(item_pull_alltimes, "拔轴总次数", "30241"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "40246"));
|
||||
list.add(new ItemDto(item_to_type, "类型", "40244"));
|
||||
list.add(new ItemDto(item_to_size, "尺寸", "40247"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.nl.acs.device_driver.basedriver.plug_pull_device_site;
|
||||
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceType;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 插拔轴工位
|
||||
*/
|
||||
@Service
|
||||
public class PlugPullDeviceSiteDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "plug_pull_device_site";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "插拔轴工位";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "插拔轴工位";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new PlugPullDeviceSiteDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return PlugPullDeviceSiteDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
return types;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getReadableItemDtos() {
|
||||
return ItemProtocol.getReadableItemDtos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getWriteableItemDtos() {
|
||||
return ItemProtocol.getWriteableItemDtos();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
package org.nl.acs.device_driver.basedriver.plug_pull_device_site;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.agv.server.AgvService;
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
||||
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 插拔轴工位
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
@Autowired
|
||||
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
|
||||
@Autowired
|
||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||
@Autowired
|
||||
DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class);
|
||||
@Autowired
|
||||
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
|
||||
@Autowired
|
||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||
@Autowired
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
@Autowired
|
||||
AgvService agvService = SpringContextHolder.getBean(AgvService.class);
|
||||
|
||||
private Date instruction_require_time = new Date();
|
||||
private Date instruction_finished_time = new Date();
|
||||
private Date instruction_apply_time = new Date();
|
||||
private int instruction_require_time_out = 3000;
|
||||
|
||||
public int mode = 0;
|
||||
public int move = 0;
|
||||
public int action = 0;
|
||||
public int status = 0;
|
||||
public int control = 0;
|
||||
public int plug_finish = 0;
|
||||
public int pull_finish = 0;
|
||||
public int plug3_times = 0;
|
||||
public int plug6_times = 0;
|
||||
public int pull3_times = 0;
|
||||
public int pull6_times = 0;
|
||||
public int plug_alltimes = 0;
|
||||
public int pull_alltimes = 0;
|
||||
|
||||
public int last_mode = 0;
|
||||
public int last_move = 0;
|
||||
public int last_action = 0;
|
||||
public int last_status = 0;
|
||||
public int last_control = 0;
|
||||
public int last_plug_finish = 0;
|
||||
public int last_pull_finish = 0;
|
||||
|
||||
|
||||
Boolean isonline = true;
|
||||
|
||||
Boolean iserror = false;
|
||||
|
||||
//1-执行任务;2-取货完成;3-放货完成;
|
||||
int flag;
|
||||
|
||||
String device_code;
|
||||
|
||||
@Override
|
||||
public Device getDevice() {
|
||||
return this.device;
|
||||
}
|
||||
|
||||
//请求成功标记
|
||||
Boolean requireSucess = false;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
move = this.itemProtocol.getItem_move();
|
||||
action = this.itemProtocol.getItem_action();
|
||||
status = this.itemProtocol.getItem_status();
|
||||
control = this.itemProtocol.getItem_control();
|
||||
plug_finish = this.itemProtocol.getItem_plug_finish();
|
||||
pull_finish = this.itemProtocol.getItem_pull_finish();
|
||||
plug3_times = this.itemProtocol.getItem_3plug_times();
|
||||
plug6_times = this.itemProtocol.getItem_6plug_times();
|
||||
pull3_times = this.itemProtocol.getItem_3pull_times();
|
||||
pull6_times = this.itemProtocol.getItem_6pull_times();
|
||||
plug_alltimes = this.itemProtocol.getItem_plug_alltimes();
|
||||
pull_alltimes = this.itemProtocol.getItem_pull_alltimes();
|
||||
|
||||
|
||||
|
||||
|
||||
if (status != 1) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
}
|
||||
|
||||
|
||||
protected void thingToNothing() {
|
||||
//this.setRequireSucess(false);
|
||||
}
|
||||
|
||||
public void writing(List list) {
|
||||
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object ob = list.get(i);
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(ob);
|
||||
if (!StrUtil.isEmpty(json.getString("value"))) {
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + json.getString("code");
|
||||
itemMap.put(to_param, json.getString("value"));
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
ReadUtil.write(itemMap, server);
|
||||
}
|
||||
|
||||
//将扩展表中的字符串数据转换成集合
|
||||
public List<String> getExtraDeviceCodes(String extraName) {
|
||||
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
||||
if (StrUtil.isEmpty(extraValue)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
String devicesString = extraValue.substring(1, extraValue.length() - 1);
|
||||
List<String> devicesList = new ArrayList<>();
|
||||
String[] devices = devicesString.split(",");
|
||||
for (int i = 0; i < devices.length; i++) {
|
||||
String s = devices[i].replace("\"", "").replace("\"", "");
|
||||
devicesList.add(s);
|
||||
}
|
||||
return devicesList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
String mode = "";
|
||||
String action = "";
|
||||
String move = "";
|
||||
if (this.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
} else if (this.getMode() == 1) {
|
||||
mode = "单机";
|
||||
} else if (this.getMode() == 2) {
|
||||
mode = "联机";
|
||||
} else if (this.getMode() == 3) {
|
||||
mode = "运行中";
|
||||
}
|
||||
|
||||
if (this.getMove() == 0) {
|
||||
move = "无货";
|
||||
jo.put("hasGoods", false);
|
||||
} else if (this.getMove() == 1) {
|
||||
move = "有货";
|
||||
jo.put("hasGoods", true);
|
||||
} else if (this.getMove() == 2) {
|
||||
move = "有托盘有货";
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
jo.put("action", action);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", this.getIserror());
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -134,45 +134,43 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
move = this.itemProtocol.getMove();
|
||||
mode = this.itemProtocol.getMode();move = this.itemProtocol.getMove();
|
||||
carrier_direction = this.itemProtocol.getCarrier_direction();
|
||||
error = this.itemProtocol.getError();
|
||||
task = this.itemProtocol.getTask();
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
requireApplyLabelingSuccess = false;
|
||||
requireApplyLaStrangulationSuccess =false;
|
||||
requireEmptyInSuccess =false;
|
||||
requireEmptyOutSuccess =false;
|
||||
if (mode == 2) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess);
|
||||
requireSucess = false;
|
||||
requireApplyLabelingSuccess = false;
|
||||
requireApplyLaStrangulationSuccess =false;
|
||||
requireEmptyInSuccess =false;
|
||||
requireEmptyOutSuccess =false;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireSucess:" + requireSucess);
|
||||
}
|
||||
if (mode == 4) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess);
|
||||
requireApplyLaStrangulationSuccess = false;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess);
|
||||
}
|
||||
if (mode == 5) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess);
|
||||
requireApplyLabelingSuccess = false;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess);
|
||||
}
|
||||
if (mode == 6) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireEmptyInSuccess:" + requireEmptyInSuccess);
|
||||
requireEmptyInSuccess = false;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireEmptyInSuccess:" + requireEmptyInSuccess);
|
||||
}
|
||||
if (mode == 7) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireEmptyOutSuccess:" + requireEmptyOutSuccess);
|
||||
requireEmptyOutSuccess = false;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireEmptyOutSuccess:" + requireEmptyOutSuccess);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (move != last_move) {
|
||||
if(move == 0 ){
|
||||
this.clearWrite();
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||
}
|
||||
@@ -225,68 +223,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x03) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x05) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("2");
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
// OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x07) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("5");
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
// OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x09) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("6");
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
// OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
inst_message = var17.getMessage();
|
||||
@@ -366,8 +303,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
//空托盘满垛出库申请
|
||||
if (move > 0 && !requireEmptyOutSuccess) {
|
||||
//空盘出库申请
|
||||
if (move == 0 && !requireEmptyOutSuccess) {
|
||||
emptyOut();
|
||||
}
|
||||
break;
|
||||
@@ -392,13 +329,38 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
public void clearWrite() {
|
||||
this.writing("to_command", "0");
|
||||
this.writing("to_target", "0");
|
||||
this.writing("to_container_type", "0");
|
||||
this.writing("to_strap_times", "0");
|
||||
this.writing("to_length", "0");
|
||||
this.writing("to_weight", "0");
|
||||
this.writing("to_height", "0");
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value","0");
|
||||
list.add(map);
|
||||
// Map map2 = new HashMap();
|
||||
// map2.put("code","to_task");
|
||||
// map2.put("value","0");
|
||||
// list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","0");
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code","to_strap_times");
|
||||
map4.put("value","0");
|
||||
list.add(map4);
|
||||
Map map5 = new HashMap();
|
||||
map5.put("code","to_length");
|
||||
map5.put("value","0");
|
||||
list.add(map5);
|
||||
Map map6 = new HashMap();
|
||||
map6.put("code","to_weight");
|
||||
map6.put("value","0");
|
||||
list.add(map6);
|
||||
Map map7 = new HashMap();
|
||||
map7.put("code","to_height");
|
||||
map7.put("value","0");
|
||||
list.add(map7);
|
||||
this.writing(list);
|
||||
|
||||
}
|
||||
|
||||
public boolean exe_business() {
|
||||
@@ -813,7 +775,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "申请任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("type","2");
|
||||
apply.put("type","3");
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
|
||||
@@ -270,6 +270,37 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
this.setApplySucess(false);
|
||||
clearBarcode();
|
||||
this.set_last_container(container);
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value","0");
|
||||
list.add(map);
|
||||
// Map map2 = new HashMap();
|
||||
// map2.put("code","to_task");
|
||||
// map2.put("value","0");
|
||||
// list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","0");
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code","to_strap_times");
|
||||
map4.put("value","0");
|
||||
list.add(map4);
|
||||
Map map5 = new HashMap();
|
||||
map5.put("code","to_length");
|
||||
map5.put("value","0");
|
||||
list.add(map5);
|
||||
Map map6 = new HashMap();
|
||||
map6.put("code","to_weight");
|
||||
map6.put("value","0");
|
||||
list.add(map6);
|
||||
Map map7 = new HashMap();
|
||||
map7.put("code","to_height");
|
||||
map7.put("value","0");
|
||||
list.add(map7);
|
||||
this.writing(list);
|
||||
|
||||
}
|
||||
|
||||
public void set_last_container(String barcode) {
|
||||
@@ -617,6 +648,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("vehicle_code", container_code);
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("type","1");
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
@@ -716,6 +748,12 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
jo.put("message", this.getMessage());
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("barcode", this.getBarcode());
|
||||
String requireSucess = "0";
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
jo.put("requireSucess", requireSucess);
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -1138,9 +1138,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
while (var3.hasNext()) {
|
||||
TaskDto task = (TaskDto) var3.next();
|
||||
if (!StrUtil.equals(task.getTask_type(), "5")) {
|
||||
continue;
|
||||
}
|
||||
// if (!StrUtil.equals(task.getTask_type(), "5")) {
|
||||
// continue;
|
||||
// }
|
||||
if (StrUtil.equals(task.getStart_device_code(), device_code) && StrUtil.equals(task.getTask_status(), "0")) {
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:P@ssw0rd}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
@@ -131,7 +131,7 @@ file:
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: C:\log\wms
|
||||
path: C:\log\acs
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# Sa-Token配置
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
server:
|
||||
port: 8010
|
||||
port: 8011
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
multi-statement-allow: true
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:15}
|
||||
database: ${REDIS_DB:9}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
@@ -44,7 +44,7 @@ rsa:
|
||||
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
logging:
|
||||
file:
|
||||
path: C:\log\wms
|
||||
path: C:\log\acs
|
||||
config: classpath:logback-spring.xml
|
||||
# sa-token白名单配置
|
||||
security:
|
||||
|
||||
32
acs/nladmin-system/src/main/resources/log/AcsToLk.xml
Normal file
32
acs/nladmin-system/src/main/resources/log/AcsToLk.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<included>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE14" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/ACS请求立库/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.AcsToLiKuServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="FILE14"/>
|
||||
</logger>
|
||||
</included>
|
||||
@@ -3,7 +3,7 @@
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE8" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="FILE12" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/ACS请求WMS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
@@ -27,6 +27,6 @@
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="FILE8"/>
|
||||
<appender-ref ref="FILE12"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<included>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE11" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/AgvNdcOneDeviceDriver/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver" level="info" additivity="false">
|
||||
<appender-ref ref="FILE11"/>
|
||||
</logger>
|
||||
</included>
|
||||
32
acs/nladmin-system/src/main/resources/log/LkToAcs.xml
Normal file
32
acs/nladmin-system/src/main/resources/log/LkToAcs.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<included>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE15" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/立库请求ACS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.AcsToLiKuServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="FILE15"/>
|
||||
</logger>
|
||||
</included>
|
||||
@@ -3,7 +3,7 @@
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE9" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="FILE13" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/WMS下发ACS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
@@ -27,6 +27,6 @@
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.WmsToAcsServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="FILE9"/>
|
||||
<appender-ref ref="FILE13"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
@@ -31,7 +31,15 @@ https://juejin.cn/post/6844903775631572999
|
||||
<include resource="log/QueryXZAgvTaskStatus.xml"/>
|
||||
-->
|
||||
<!-- <include resource="log/QueryMagicAgvDeviceStatus.xml"/>-->
|
||||
<!--FILE 10开始+1-->
|
||||
<include resource="log/OneNDCSocketConnectionAutoRun.xml"/>
|
||||
<include resource="log/AgvNdcOneDeviceDriver.xml"/>
|
||||
<include resource="log/AcsToLk.xml"/>
|
||||
<include resource="log/LkToAcs.xml"/>
|
||||
<include resource="log/AcsToWms.xml"/>
|
||||
<include resource="log/WmsToAcs.xml"/>
|
||||
|
||||
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
@@ -138,9 +146,10 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
<root level="off">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</root>
|
||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
|
||||
@@ -92,7 +92,7 @@ import siemens_conveyor from '@/views/acs/device/driver/siemens_conveyor'
|
||||
import slit_two_manipulator from '@/views/acs/device/driver/slit_two_manipulator'
|
||||
import hongxiang_device from '@/views/acs/device/driver/hongxiang_device'
|
||||
import hongxiang_conveyor from '@/views/acs/device/driver/hongxiang_conveyor'
|
||||
|
||||
import plug_pull_device_site from '@/views/acs/device/driver/plug_pull_device_site'
|
||||
|
||||
export default {
|
||||
name: 'DeviceConfig',
|
||||
@@ -115,7 +115,8 @@ export default {
|
||||
box_palletizing_manipulator,
|
||||
oven_manipulator,
|
||||
siemens_conveyor,
|
||||
slit_two_manipulator
|
||||
slit_two_manipulator,
|
||||
plug_pull_device_site
|
||||
},
|
||||
dicts: ['device_type'],
|
||||
mixins: [crud],
|
||||
|
||||
@@ -0,0 +1,490 @@
|
||||
<template>
|
||||
<!--检测站点-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">设备协议:</span>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
OpcServer:
|
||||
<el-select
|
||||
v-model="opc_id"
|
||||
placeholder="无"
|
||||
clearable
|
||||
filterable
|
||||
@change="changeOpc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dataOpcservers"
|
||||
:key="item.opc_id"
|
||||
:label="item.opc_name"
|
||||
:value="item.opc_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
PLC:
|
||||
<el-select
|
||||
v-model="plc_id"
|
||||
placeholder="无"
|
||||
clearable
|
||||
filterable
|
||||
@change="changePlc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dataOpcPlcs"
|
||||
:key="item.plc_id"
|
||||
:label="item.plc_name"
|
||||
:value="item.plc_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">输送系统:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="电气调度号" label-width="150px">
|
||||
<el-input v-model="form.address" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">指令相关:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检验有货">
|
||||
<el-switch v-model="form.inspect_in_stocck" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="忽视取货校验" label-width="150px">
|
||||
<el-switch v-model="form.ignore_pickup_check" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="忽视放货校验" label-width="150px">
|
||||
<el-switch v-model="form.ignore_release_check" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="呼叫">
|
||||
<el-switch v-model="form.apply_task" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="响应" label-width="150px">
|
||||
<el-switch v-model="form.manual_create_task" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联设备" prop="device_code">
|
||||
<el-select
|
||||
v-model="form.link_device_code"
|
||||
filterable
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联三色灯" prop="device_code" label-width="100px">
|
||||
<el-select
|
||||
v-model="form.link_three_lamp"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否输入物料" label-width="150px">
|
||||
<el-switch v-model="form.input_material" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">AGV相关:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="取货">
|
||||
<el-switch v-model="form.is_pickup" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="放货">
|
||||
<el-switch v-model="form.is_release" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">PLC读取字段:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-table
|
||||
v-loading="false"
|
||||
:data="data1"
|
||||
:max-height="550"
|
||||
size="small"
|
||||
style="width: 100%;margin-bottom: 15px"
|
||||
>
|
||||
|
||||
<el-table-column prop="name" label="用途" />
|
||||
<el-table-column prop="code" label="别名要求" />
|
||||
<el-table-column prop="db" label="DB块">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="data1[scope.$index].db"
|
||||
size="mini"
|
||||
class="edit-input"
|
||||
@input="finishReadEdit(data1[scope.$index])"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">PLC写入字段:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-table
|
||||
v-loading="false"
|
||||
:data="data2"
|
||||
:max-height="550"
|
||||
size="small"
|
||||
style="width: 100%;margin-bottom: 15px"
|
||||
>
|
||||
|
||||
<el-table-column prop="name" label="用途" />
|
||||
<el-table-column prop="code" label="别名要求" />
|
||||
<el-table-column prop="db" label="DB块">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="data2[scope.$index].db"
|
||||
size="mini"
|
||||
class="edit-input"
|
||||
@input="finishWriteEdit(data2[scope.$index])"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
:loading="false"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
queryDriverConfig,
|
||||
updateConfig,
|
||||
testRead,
|
||||
testwrite
|
||||
} from '@/api/acs/device/driverConfig'
|
||||
import { selectOpcList } from '@/api/acs/device/opc'
|
||||
import { selectPlcList } from '@/api/acs/device/opcPlc'
|
||||
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
|
||||
|
||||
import crud from '@/mixins/crud'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
|
||||
export default {
|
||||
name: 'Plug_pull_device_site',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
parentForm: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
device_code: '',
|
||||
device_id: '',
|
||||
plc_id: '',
|
||||
plc_code: '',
|
||||
opc_id: '',
|
||||
opc_code: '',
|
||||
configLoading: false,
|
||||
dataOpcservers: [],
|
||||
dataOpcPlcs: [],
|
||||
deviceList: [],
|
||||
data1: [],
|
||||
data2: [],
|
||||
form: {
|
||||
inspect_in_stocck: true,
|
||||
ignore_pickup_check: true,
|
||||
ignore_release_check: true,
|
||||
apply_task: true,
|
||||
link_three_lamp: '',
|
||||
manual_create_task: true,
|
||||
is_pickup: true,
|
||||
is_release: true,
|
||||
link_device_code: [],
|
||||
address: ''
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
// 从父表单获取设备编码
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.parentForm) {
|
||||
const arr = Object.keys(data.parentForm)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.opc_code = data.parentForm.opc_code
|
||||
this.plc_code = data.parentForm.plc_code
|
||||
}
|
||||
}
|
||||
this.data1 = data.rs
|
||||
this.data2 = data.ws
|
||||
this.sliceItem()
|
||||
})
|
||||
selectPlcList().then(data => {
|
||||
this.dataOpcPlcs = data
|
||||
this.plc_id = this.$props.parentForm.opc_plc_id
|
||||
})
|
||||
selectOpcList().then(data => {
|
||||
this.dataOpcservers = data
|
||||
this.opc_id = this.$props.parentForm.opc_server_id
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
finishReadEdit(data) {
|
||||
// 编辑的是code列,并且值包含mode
|
||||
if (data.code.indexOf('mode') !== -1) {
|
||||
debugger
|
||||
const dbValue = data.db
|
||||
// .之前的字符串
|
||||
const beforeStr = dbValue.match(/(\S*)\./)[1]
|
||||
// .之后的字符串
|
||||
const afterStr = dbValue.match(/\.(\S*)/)[1]
|
||||
// 取最后数字
|
||||
const endNumber = afterStr.substring(1)
|
||||
// 最后为非数字
|
||||
if (isNaN(parseInt(endNumber))) {
|
||||
return
|
||||
}
|
||||
for (const val in this.data1) {
|
||||
if (this.data1[val].code.indexOf('move') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('error') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('task') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
finishWriteEdit(data) {
|
||||
// 编辑的是code列,并且值包含mode
|
||||
if (data.code.indexOf('to_command') !== -1) {
|
||||
const dbValue = data.db
|
||||
// .之前的字符串
|
||||
const beforeStr = dbValue.match(/(\S*)\./)[1]
|
||||
// .之后的字符串
|
||||
const afterStr = dbValue.match(/\.(\S*)/)[1]
|
||||
// 取最后数字
|
||||
const endNumber = afterStr.substring(1)
|
||||
// 最后为非数字
|
||||
if (isNaN(parseInt(endNumber))) {
|
||||
return
|
||||
}
|
||||
for (const val in this.data2) {
|
||||
if (this.data2[val].code.indexOf('to_target') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_task') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeOpc(val) {
|
||||
this.dataOpcservers.forEach(item => {
|
||||
if (item.opc_id === val) {
|
||||
this.opc_code = item.opc_code
|
||||
}
|
||||
})
|
||||
|
||||
selectListByOpcID(val).then(data => {
|
||||
this.dataOpcPlcs = data
|
||||
this.plc_id = ''
|
||||
this.plc_code = ''
|
||||
if (this.dataOpcPlcs && this.dataOpcPlcs.length > 0) {
|
||||
this.plc_id = this.dataOpcPlcs[0].plc_id
|
||||
this.plc_code = this.dataOpcPlcs[0].plc_code
|
||||
}
|
||||
this.sliceItem()
|
||||
})
|
||||
},
|
||||
changePlc(val) {
|
||||
this.dataOpcPlcs.forEach(item => {
|
||||
if (item.plc_id === val) {
|
||||
this.plc_code = item.plc_code
|
||||
this.sliceItem()
|
||||
return
|
||||
}
|
||||
})
|
||||
},
|
||||
test_read1() {
|
||||
testRead(this.data1, this.opc_id).then(data => {
|
||||
this.data1 = data
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
sliceItem() { // 拼接DB的Item值
|
||||
this.data1.forEach(item => {
|
||||
const str = item.code
|
||||
// 是否包含.
|
||||
if (str.search('.') !== -1) {
|
||||
// 截取最后一位
|
||||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
||||
} else {
|
||||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
||||
}
|
||||
})
|
||||
this.data2.forEach(item => {
|
||||
const str = item.code
|
||||
// 是否包含.
|
||||
if (str.search('.') !== -1) {
|
||||
// 截取最后一位
|
||||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
||||
} else {
|
||||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -331,21 +331,71 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String sale_order_name = sub_jo.getString("sale_order_name");
|
||||
|
||||
//查询是否存在可用的空位
|
||||
JSONObject jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "19").addParam("sale_order_name", sale_order_name).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
String point_code = "";
|
||||
JSONArray joArr = new JSONArray();
|
||||
|
||||
// 查找此订单号所在的所有排
|
||||
JSONArray joRow = WQL.getWO("QST_ACSTOLMSTYPE4").addParam("flag", "1").addParam("sale_order_name", sale_order_name).process().getResultJSONArray(0);
|
||||
for (int j = 0; j < joRow.size(); j++) {
|
||||
JSONObject json = joRow.getJSONObject(j);
|
||||
String row_num = json.getString("row_num");
|
||||
|
||||
// 查找此排下的所有空位
|
||||
JSONArray joEmpPoint = WQL.getWO("QST_ACSTOLMSTYPE4").addParam("flag", "2").addParam("row_num", row_num).process().getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(joEmpPoint)) {
|
||||
for (int n = 0; n < joEmpPoint.size(); n++) {
|
||||
joArr.add(joEmpPoint.getJSONObject(n));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(joArr)) {
|
||||
//查询新的一排
|
||||
JSONObject point_jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "20").process().uniqueResult(0);
|
||||
JSONObject point_jo = WQL.getWO("QST_ACSTOLMSTYPE4").addParam("flag", "3").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相同销售订单的放货区点位或空的一排!");
|
||||
} else {
|
||||
jo = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0'").uniqueResult(0);
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq ASC").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
}
|
||||
} else {
|
||||
// 校验此货位是否被堵住:1.如果被堵住则判断下一个是否被堵住 2.如果全部被堵住则新开一排
|
||||
for (int i = 0; i < joArr.size(); i++) {
|
||||
JSONObject json = joArr.getJSONObject(i);
|
||||
// 判断是否被挡住
|
||||
JSONArray jsonArray = WQL.getWO("QST_ACSTOLMSTYPE4")
|
||||
.addParam("flag", "4")
|
||||
.addParam("point_code", json.getString("point_code"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonArray)) {
|
||||
// 堵住则判断下一个
|
||||
continue;
|
||||
} else {
|
||||
// 未堵住: 跳出循环
|
||||
point_code = json.getString("point_code");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
// 为空则新开一排
|
||||
JSONObject point_jo = WQL.getWO("QST_ACSTOLMSTYPE4").addParam("flag", "3").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相同销售订单的放货区点位或空的一排!");
|
||||
} else {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq ASC").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
}
|
||||
}
|
||||
|
||||
//创建任务
|
||||
JSONObject task_jo = new JSONObject();
|
||||
task_jo.put("point_code1", device_code);
|
||||
task_jo.put("point_code2", jo.getString("point_cde"));
|
||||
task_jo.put("point_code2", point_code);
|
||||
task_jo.put("vehicle_code", vehicle_code);
|
||||
task_jo.put("task_type", "010506");
|
||||
SendOutTask sendOutTask = new SendOutTask();
|
||||
|
||||
@@ -158,10 +158,10 @@ public class InTask extends AbstractAcsTask {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void forceFinish(String taskdtl_id) {
|
||||
public void forceFinish(String task_id) {
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject task = wo_Task.query("task_status<>'99' and taskdtl_id='" + taskdtl_id + "'").uniqueResult(0);
|
||||
JSONObject task = wo_Task.query("task_status<>'07' and task_id='" + task_id + "'").uniqueResult(0);
|
||||
if (task == null) {
|
||||
throw new BadRequestException("查询不到操作的任务记录!");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
@@ -46,7 +47,10 @@ public class OutTask extends AbstractAcsTask {
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject dis_tab = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("handle_class", THIS_CLASS);
|
||||
JSONArray arr = WQL.getWO("TASK01").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class SendOutTask extends AbstractAcsTask {
|
||||
|
||||
// 更新暂存区点位状态
|
||||
JSONObject jsonPoint2 = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("point_status", "02");
|
||||
jsonPoint2.put("point_status", "2");
|
||||
jsonPoint2.put("vehicle_code", jsonTask.getString("vehicle_code"));
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
[交易说明]
|
||||
交易名: 出库任务
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.handle_class TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
max(task_group_id) AS task_group_id,
|
||||
max(task_type) AS task_type
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
task_status = '04'
|
||||
AND is_delete = '0'
|
||||
|
||||
OPTION 输入.handle_class <> ""
|
||||
handle_class = 输入.handle_class
|
||||
ENDOPTION
|
||||
|
||||
group by task_group_id
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -565,8 +565,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
transfer = false;
|
||||
}
|
||||
|
||||
//创建任务
|
||||
AbstractAcsTask task = new InTask();
|
||||
//创建任务并下发
|
||||
InTask task = new InTask();
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "010501");
|
||||
task_form.put("start_device_code", map.get("point_code"));
|
||||
@@ -574,21 +574,10 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
task_form.put("vehicle_code", map.get("box_no"));
|
||||
task_form.put("storagevehicle_type", map.get("storagevehicle_type"));
|
||||
String task_id = task.createTask(task_form);
|
||||
if (whereJson.containsKey("auto_issue")) {
|
||||
AbstractAcsTask intask = new InTask();
|
||||
//调用ACS接受任务接口
|
||||
JSONObject result = null;
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
String status = result.getString("status");
|
||||
if ("200".equals(status)) {
|
||||
HashMap<String, String> mapnow = new HashMap<>();
|
||||
mapnow.put("task_status", "02");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapnow, "taskdtl_id = '" + task_id + "'");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 下发
|
||||
task.immediateNotifyAcs(task_id);
|
||||
/* if (whereJson.containsKey("auto_issue")) {
|
||||
}*/
|
||||
dis_map.put("task_id", task_id);
|
||||
dis_map.put("work_status", "01");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
[交易说明]
|
||||
交易名: ACS请求WMS
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.sale_order_name TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.row_num TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
max(po.row_num) AS row_num
|
||||
FROM
|
||||
sch_base_point po
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = po.vehicle_code
|
||||
WHERE
|
||||
po.point_type = '9'
|
||||
AND sub.sale_order_name = 输入.sale_order_name
|
||||
|
||||
GROUP BY po.row_num
|
||||
|
||||
ORDER BY po.row_num ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
po.point_code
|
||||
FROM
|
||||
sch_base_point po
|
||||
WHERE
|
||||
IFNULL( po.vehicle_code, '' ) = ''
|
||||
AND
|
||||
po.point_type = '9'
|
||||
OPTION 输入.row_num <> ""
|
||||
po.row_num = 输入.row_num
|
||||
ENDOPTION
|
||||
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = po.point_code OR point_code2 = po.point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
ORDER BY po.out_order_seq
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
po.row_num
|
||||
FROM
|
||||
sch_base_point po
|
||||
WHERE
|
||||
po.is_delete = '0'
|
||||
AND is_used = '1'
|
||||
AND po.point_type = '9'
|
||||
GROUP BY
|
||||
po.row_num
|
||||
) a
|
||||
WHERE
|
||||
NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
row_num
|
||||
FROM
|
||||
sch_base_point po2
|
||||
WHERE
|
||||
IFNULL( po2.vehicle_code, '' ) <> ''
|
||||
AND po2.point_type = '9'
|
||||
GROUP BY
|
||||
po2.row_num
|
||||
) b
|
||||
WHERE
|
||||
b.row_num = a.row_num
|
||||
)
|
||||
|
||||
ORDER BY row_num ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
point2.*
|
||||
FROM
|
||||
sch_base_point point1
|
||||
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
|
||||
WHERE
|
||||
IFNULL( point2.vehicle_code, '' ) <> ''
|
||||
AND point1.out_order_seq < point2.out_order_seq
|
||||
AND point2.point_type = '9'
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
point1.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
point2.*
|
||||
FROM
|
||||
sch_base_point point1
|
||||
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
|
||||
WHERE
|
||||
IFNULL( point2.vehicle_code, '' ) = ''
|
||||
AND point1.out_order_seq < point2.out_order_seq
|
||||
AND point2.point_type = '9'
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
point1.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
AND EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = point2.point_code OR point_code2 = point2.point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -32,6 +32,8 @@
|
||||
输入.sale_order_name TYPEAS s_string
|
||||
输入.material_code TYPEAS s_string
|
||||
输入.sect_id TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.row_num TYPEAS s_string
|
||||
输入.sql_str TYPEAS f_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
|
||||
@@ -722,7 +724,7 @@
|
||||
AND is_delete = '0'
|
||||
)
|
||||
ORDER BY po2.out_order_seq
|
||||
LIMIT 1
|
||||
|
||||
ENDSELECT
|
||||
ENDIF
|
||||
|
||||
@@ -762,6 +764,9 @@
|
||||
WHERE
|
||||
b.row_num = a.row_num
|
||||
)
|
||||
|
||||
ORDER BY row_num ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -812,7 +817,101 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
IF 输入.flag = "23"
|
||||
QUERY
|
||||
SELECT
|
||||
point2.*
|
||||
FROM
|
||||
sch_base_point point1
|
||||
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
|
||||
WHERE
|
||||
IFNULL( point2.vehicle_code, '' ) <> ''
|
||||
AND point1.out_order_seq < point2.out_order_seq
|
||||
AND point2.point_type = '9'
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
point1.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
point2.*
|
||||
FROM
|
||||
sch_base_point point1
|
||||
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
|
||||
WHERE
|
||||
IFNULL( point2.vehicle_code, '' ) = ''
|
||||
AND point1.out_order_seq < point2.out_order_seq
|
||||
AND point2.point_type = '9'
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
point1.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
AND EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = point2.point_code OR point_code2 = point2.point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "24"
|
||||
SELECT
|
||||
max(po.row_num) AS row_num
|
||||
FROM
|
||||
sch_base_point po
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = po.vehicle_code
|
||||
WHERE
|
||||
po.point_type = '9'
|
||||
|
||||
OPTION 输入.sale_order_name <> ""
|
||||
sub.sale_order_name = 输入.sale_order_name
|
||||
ENDOPTION
|
||||
|
||||
GROUP BY po.row_num
|
||||
|
||||
ORDER BY po.row_num ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "25"
|
||||
SELECT
|
||||
po.point_code
|
||||
FROM
|
||||
sch_base_point po
|
||||
WHERE
|
||||
IFNULL( po.vehicle_code, '' ) = ''
|
||||
AND
|
||||
po.point_type = '9'
|
||||
OPTION 输入.row_num <> ""
|
||||
po.row_num = 输入.row_num
|
||||
ENDOPTION
|
||||
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = po.point_code OR point_code2 = po.point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
ORDER BY po.out_order_seq
|
||||
|
||||
ENDSELECT
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2499,7 +2499,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
jsonRow.put("point_id", jsonPoint2.getString("point_id"));
|
||||
this.rowDispose(jsonRow);
|
||||
}
|
||||
outTask.immediateNotifyAcs(null);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
Reference in New Issue
Block a user