Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -45,21 +45,21 @@
|
|||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.8.0</version>
|
<version>2.8.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>org.apache.poi</groupId>-->
|
<groupId>org.apache.poi</groupId>
|
||||||
<!-- <artifactId>poi</artifactId>-->
|
<artifactId>poi</artifactId>
|
||||||
<!-- <version>4.0.0</version>-->
|
<version>4.1.2</version>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>org.apache.poi</groupId>-->
|
<groupId>org.apache.poi</groupId>
|
||||||
<!-- <artifactId>poi-ooxml</artifactId>-->
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<!-- <version>4.0.0</version>-->
|
<version>4.1.2</version>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>org.apache.poi</groupId>-->
|
<groupId>org.apache.poi</groupId>
|
||||||
<!-- <artifactId>poi-ooxml-schemas</artifactId>-->
|
<artifactId>poi-ooxml-schemas</artifactId>
|
||||||
<!-- <version>4.0.0</version>-->
|
<version>4.1.2</version>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openscada.jinterop</groupId>
|
<groupId>org.openscada.jinterop</groupId>
|
||||||
<artifactId>org.openscada.jinterop.core</artifactId>
|
<artifactId>org.openscada.jinterop.core</artifactId>
|
||||||
@@ -341,16 +341,16 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- excel工具 -->
|
<!-- excel工具 -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.apache.poi</groupId>
|
<!-- <groupId>org.apache.poi</groupId>-->
|
||||||
<artifactId>poi</artifactId>
|
<!-- <artifactId>poi</artifactId>-->
|
||||||
<version>3.17</version>
|
<!-- <version>3.17</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.apache.poi</groupId>
|
<!-- <groupId>org.apache.poi</groupId>-->
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<!-- <artifactId>poi-ooxml</artifactId>-->
|
||||||
<version>3.17</version>
|
<!-- <version>3.17</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xerces</groupId>
|
<groupId>xerces</groupId>
|
||||||
<artifactId>xercesImpl</artifactId>
|
<artifactId>xercesImpl</artifactId>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public class TwoNDC2SocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
log.info("未找到指令号{}对应的指令", ikey);
|
log.info("未找到指令号{}对应的指令", ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
instructionService.cancel(inst.getInstruction_id());
|
instructionService.cancelNOSendAgv(inst.getInstruction_id());
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
//上报异常信息
|
//上报异常信息
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
log.info("未找到指令号{}对应的指令", ikey);
|
log.info("未找到指令号{}对应的指令", ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
instructionService.cancel(inst.getInstruction_id());
|
instructionService.cancelNOSendAgv(inst.getInstruction_id());
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
//上报异常信息
|
//上报异常信息
|
||||||
|
|||||||
@@ -1590,16 +1590,23 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
Integer deviceCode = device_code + i;
|
Integer deviceCode = device_code + i;
|
||||||
for (int j = 0; j <= rss.size(); j++) {
|
for (int j = 0; j <= rss.size(); j++) {
|
||||||
Map<String,Object> map = new ListOrderedMap<>();
|
Map<String,Object> map = new ListOrderedMap<>();
|
||||||
if (j == rss.size()){
|
if (wss.size() > rss.size()){
|
||||||
map.put("设备编码","");
|
if (j == rss.size()){
|
||||||
map.put("读取地址","");
|
continue;
|
||||||
map.put("读取意义","");
|
}
|
||||||
map.put("","");
|
} else {
|
||||||
map.put("写入地址","");
|
if (j == rss.size()){
|
||||||
map.put("写入意义","");
|
map.put("设备编码","");
|
||||||
list.add(map);
|
map.put("读取地址","");
|
||||||
continue;
|
map.put("读取意义","");
|
||||||
|
map.put("","");
|
||||||
|
map.put("写入地址","");
|
||||||
|
map.put("写入意义","");
|
||||||
|
list.add(map);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0 && j ==0){
|
if (i == 0 && j ==0){
|
||||||
map.put("设备编码","");
|
map.put("设备编码","");
|
||||||
}else {
|
}else {
|
||||||
@@ -1627,6 +1634,28 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
list.add(map);
|
list.add(map);
|
||||||
System.out.println(map);
|
System.out.println(map);
|
||||||
}
|
}
|
||||||
|
if (wss.size() > rss.size()){
|
||||||
|
int s = wss.size() - rss.size();
|
||||||
|
for (int l = 0; l <= s + 1; l++) {
|
||||||
|
Map<String,Object> map = new ListOrderedMap<>();
|
||||||
|
if (l == s + 1){
|
||||||
|
map.put("设备编码","");
|
||||||
|
map.put("读取地址","");
|
||||||
|
map.put("读取意义","");
|
||||||
|
map.put("","");
|
||||||
|
map.put("写入地址","");
|
||||||
|
map.put("写入意义","");
|
||||||
|
list.add(map);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
map.put("设备编码",deviceCode);
|
||||||
|
map.put("读取地址","");
|
||||||
|
map.put("读取意义","");
|
||||||
|
Map<String, Object> value = getValue(wss, rss.size() + l, dbInterval,i);
|
||||||
|
map.putAll(value);
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else if (type.equals("v")){
|
}else if (type.equals("v")){
|
||||||
for (int i = 0; i < numberSize; i++) {
|
for (int i = 0; i < numberSize; i++) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
|
|||||||
import org.nl.acs.route.service.RouteLineService;
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.openscada.opc.lib.da.Server;
|
import org.openscada.opc.lib.da.Server;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -54,7 +55,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
@Autowired
|
@Autowired
|
||||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
|
|
||||||
//工作模式
|
//工作模式
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
@@ -168,7 +169,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (ObjectUtil.isNotEmpty(inst2)) {
|
if (ObjectUtil.isNotEmpty(inst2)) {
|
||||||
String start_device_code = inst2.getStart_device_code();
|
String start_device_code = inst2.getStart_device_code();
|
||||||
Device device = appService.findDeviceByCode(start_device_code);
|
Device device = deviceAppService.findDeviceByCode(start_device_code);
|
||||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||||
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
|
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -186,7 +187,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
if (mode == 3 && action == 3 && move == 1 && task > 0) {
|
if (mode == 3 && action == 3 && move == 1 && task > 0) {
|
||||||
Instruction instructionDto = instructionService.findByCode(String.valueOf(task));
|
Instruction instructionDto = instructionService.findByCode(String.valueOf(task));
|
||||||
String next_device_code = instructionDto.getNext_device_code();
|
String next_device_code = instructionDto.getNext_device_code();
|
||||||
Device nextDevice = appService.findDeviceByCode(next_device_code);
|
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||||
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
|
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
|
||||||
@@ -218,8 +219,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
acsToWmsService.feedbackTaskStatusToWms(array);
|
acsToWmsService.feedbackTaskStatusToWms(array);
|
||||||
String next_device_code = taskDto.getNext_device_code();
|
String next_device_code = taskDto.getNext_device_code();
|
||||||
String start_device_code = taskDto.getStart_device_code();
|
String start_device_code = taskDto.getStart_device_code();
|
||||||
Device startDevice = appService.findDeviceByCode(start_device_code);
|
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||||
Device nextDevice = appService.findDeviceByCode(next_device_code);
|
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||||
if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver();
|
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver();
|
||||||
@@ -314,12 +315,24 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
instruction.setInstruction_status("1");
|
instruction.setInstruction_status("1");
|
||||||
instruction.setUpdate_time(DateUtil.now());
|
instruction.setUpdate_time(DateUtil.now());
|
||||||
instructionService.update(instruction);
|
instructionService.update(instruction);
|
||||||
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
// int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
||||||
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
// int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
||||||
writing("to_onset", String.valueOf(start_addrIndex + 1));
|
// writing("to_onset", String.valueOf(start_addrIndex + 1));
|
||||||
writing("to_target", String.valueOf(next_addrIndex + 1));
|
// writing("to_target", String.valueOf(next_addrIndex + 1));
|
||||||
writing("to_task", instruction.getInstruction_code());
|
Device startDevice = deviceAppService.findDeviceByCode(instruction.getStart_device_code());
|
||||||
writing("to_command", "1");
|
Device nextDevice = deviceAppService.findDeviceByCode(instruction.getNext_device_code());
|
||||||
|
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))){
|
||||||
|
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))){
|
||||||
|
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
this.writing("to_onset", start_addr);
|
||||||
|
this.writing("to_target", next_addr);
|
||||||
|
this.writing("to_task", instruction.getInstruction_code());
|
||||||
|
this.writing("to_command", "1");
|
||||||
this.setRequireSucess(true);
|
this.setRequireSucess(true);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -371,12 +384,24 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
task.setUpdate_time(DateUtil.now());
|
task.setUpdate_time(DateUtil.now());
|
||||||
taskserver.update(task);
|
taskserver.update(task);
|
||||||
//根据获取托盘信息返回的结果 得到对应抓取工位/放货工位设备编码所在的索引位置
|
//根据获取托盘信息返回的结果 得到对应抓取工位/放货工位设备编码所在的索引位置
|
||||||
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
|
// int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
|
||||||
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
|
// int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
|
||||||
writing("to_onset", String.valueOf(start_addrIndex + 1));
|
// writing("to_onset", String.valueOf(start_addrIndex + 1));
|
||||||
writing("to_target", String.valueOf(next_addrIndex + 1));
|
// writing("to_target", String.valueOf(next_addrIndex + 1));
|
||||||
writing("to_task", instdto.getInstruction_code());
|
Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code());
|
||||||
writing("to_command", "1");
|
Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code());
|
||||||
|
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))){
|
||||||
|
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))){
|
||||||
|
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
this.writing("to_onset", start_addr);
|
||||||
|
this.writing("to_target", next_addr);
|
||||||
|
this.writing("to_task", instdto.getInstruction_code());
|
||||||
|
this.writing("to_command", "1");
|
||||||
this.setRequireSucess(true);
|
this.setRequireSucess(true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -27,6 +28,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
|
|||||||
import org.nl.acs.route.service.RouteLineService;
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.openscada.opc.lib.da.Server;
|
import org.openscada.opc.lib.da.Server;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -54,11 +56,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
@Autowired
|
@Autowired
|
||||||
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
|
|
||||||
//当前指令1
|
|
||||||
Instruction inst1 = null;
|
|
||||||
//当前指令2
|
|
||||||
Instruction inst2 = null;
|
|
||||||
|
|
||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
|
|
||||||
//工作模式
|
//工作模式
|
||||||
@@ -138,6 +135,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
task2 = this.itemProtocol.getTask2();
|
task2 = this.itemProtocol.getTask2();
|
||||||
|
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
|
if (mode == 2) {
|
||||||
|
this.setRequireHeadSucess(false);
|
||||||
|
this.setRequireBackSucess(false);
|
||||||
|
}
|
||||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||||
}
|
}
|
||||||
@@ -245,11 +246,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
|
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
|
||||||
finish_instruction(inst2);
|
finish_instruction(inst2);
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code());
|
TaskDto taskDto = taskserver.findByCode(inst2.getTask_code());
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_id", taskDto.getExt_task_id());
|
map.put("task_id", taskDto.getExt_task_id());
|
||||||
map.put("task_status", "2");
|
map.put("task_status", "2");
|
||||||
map.put("finished_type", "1");
|
|
||||||
array.add(map);
|
array.add(map);
|
||||||
acsToWmsService.feedbackTaskStatusToWms(array);
|
acsToWmsService.feedbackTaskStatusToWms(array);
|
||||||
writing("to_command2", "0");
|
writing("to_command2", "0");
|
||||||
@@ -260,9 +260,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//双任务 - 前工位取货时判断取货位光电信号
|
//双任务 - 后工位取货时判断取货位光电信号
|
||||||
if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0 && task2 > 0) {
|
if (mode == 3 && action2 == 1 && move2 == 0 && task1 > 0 && task2 > 0) {
|
||||||
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
|
||||||
String start_device_code = inst1.getStart_device_code();
|
String start_device_code = inst1.getStart_device_code();
|
||||||
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
|
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
|
||||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||||
@@ -278,24 +278,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//单任务 - 前工位直接允许取货
|
//单任务 - 后工位直接允许取货
|
||||||
if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0 && task2 == 0) {
|
if (mode == 3 && action2 == 1 && move2 == 0 && task2 > 0 && task1 == 0) {
|
||||||
this.writing("to_command1", "2");
|
this.writing("to_command1", "2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//后工位允许放货
|
||||||
|
if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) {
|
||||||
|
this.writing("to_command1", "3");
|
||||||
|
}
|
||||||
|
|
||||||
|
//前工位允许放货
|
||||||
|
if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0) {
|
||||||
|
this.writing("to_command2", "2");
|
||||||
|
}
|
||||||
|
|
||||||
//前工位放货时判断放货位光电信号
|
//前工位放货时判断放货位光电信号
|
||||||
if (mode == 3 && action1 == 3 && move1 == 1 && task1 > 0) {
|
if (mode == 3 && action1 == 3 && move1 == 1 && task1 > 0) {
|
||||||
this.writing("to_command1", "3");
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
|
||||||
}
|
|
||||||
|
|
||||||
//后工位取货时判断取货位光电信号
|
|
||||||
if (mode == 3 && action2 == 2 && move2 == 0 && task2 > 0) {
|
|
||||||
this.writing("to_command2", "2");
|
|
||||||
}
|
|
||||||
|
|
||||||
//后工位放货时判断放货位光电信号
|
|
||||||
if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) {
|
|
||||||
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
|
|
||||||
String next_device_code = inst1.getNext_device_code();
|
String next_device_code = inst1.getNext_device_code();
|
||||||
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
|
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
|
||||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||||
@@ -306,7 +306,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
if (move == 0 && mode == 2) {
|
if (move == 0 && mode == 2) {
|
||||||
this.writing("to_command2", "3");
|
this.writing("to_command2", "3");
|
||||||
} else {
|
} else {
|
||||||
log.warn("后工位放货位有货,放货位:{},mode:{},moce:{}", next_device_code, mode, move);
|
log.warn("后工位放货位有货,放货位:{},mode:{},move:{}", next_device_code, mode, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -342,22 +342,26 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
return;
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
//后工位申请任务 取空放空
|
//后工位申请任务 取空放空
|
||||||
if (move2 == 0 && action2 == 0 && task2 == 0 && !requireHeadSucess) {
|
//mode == 2 && move2 == 0 && action2 == 0 && !requireBackSucess
|
||||||
|
if (move2 == 0 && action2 == 0 && !requireBackSucess) {
|
||||||
instruction_require2();
|
instruction_require2();
|
||||||
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move1:" + move1 + ",action1:" + action1 + ",move2:" + move2 + ",task1:" + task1 + ",requireHeadSucess:" + requireHeadSucess);
|
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move1:" + move1 + ",action1:" + action1 + ",move2:" + move2 + ",task1:" + task1 + ",requireHeadSucess:" + requireHeadSucess);
|
||||||
}
|
}
|
||||||
//前工位申请任务 取满放满
|
//前工位申请任务 取满放满
|
||||||
if (move1 == 0 && action1 == 0 && task1 == 0 && move2 == 0 && task2 > 0 && !requireBackSucess) {
|
//mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && !requireHeadSucess
|
||||||
|
if (move1 == 0 && action1 == 0 && !requireHeadSucess) {
|
||||||
instruction_require();
|
instruction_require();
|
||||||
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
|
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//前工位申请任务 取满放满
|
//前工位申请任务 取满放满
|
||||||
if (task2 > 0 && move2 == 1 && action2 == 1 && move1 == 0 && action1 == 0 && !requireBackSucess) {
|
//mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && !requireHeadSucess
|
||||||
instruction_require();
|
// if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && !requireHeadSucess) {
|
||||||
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
|
// instruction_require();
|
||||||
}
|
// logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
|
||||||
|
// }
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -395,10 +399,18 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
instruction.setInstruction_status("1");
|
instruction.setInstruction_status("1");
|
||||||
instruction.setUpdate_time(DateUtil.now());
|
instruction.setUpdate_time(DateUtil.now());
|
||||||
instructionService.update(instruction);
|
instructionService.update(instruction);
|
||||||
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
Device startDevice = deviceAppservice.findDeviceByCode(instruction.getStart_device_code());
|
||||||
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
Device nextDevice = deviceAppservice.findDeviceByCode(instruction.getNext_device_code());
|
||||||
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
|
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||||
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
|
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
|
||||||
|
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
this.writing("to_onset1", start_addr);
|
||||||
|
this.writing("to_target1", next_addr);
|
||||||
this.writing("to_task1", instruction.getInstruction_code());
|
this.writing("to_task1", instruction.getInstruction_code());
|
||||||
this.writing("to_command1", "1");
|
this.writing("to_command1", "1");
|
||||||
requireHeadSucess = true;
|
requireHeadSucess = true;
|
||||||
@@ -454,11 +466,19 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
task.setUpdate_time(DateUtil.now());
|
task.setUpdate_time(DateUtil.now());
|
||||||
taskserver.update(task);
|
taskserver.update(task);
|
||||||
|
|
||||||
//根据查询的任务起始点位 得出取放工位的索引值 写入后工位电气中
|
//根据查询的任务起始点位 得出取放工位的电气值 写入后工位电气中
|
||||||
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
|
Device startDevice = deviceAppservice.findDeviceByCode(instdto.getStart_device_code());
|
||||||
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
|
Device nextDevice = deviceAppservice.findDeviceByCode(instdto.getNext_device_code());
|
||||||
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
|
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||||
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
|
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
|
||||||
|
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
this.writing("to_onset1", start_addr);
|
||||||
|
this.writing("to_target1", next_addr);
|
||||||
this.writing("to_task1", instdto.getInstruction_code());
|
this.writing("to_task1", instdto.getInstruction_code());
|
||||||
this.writing("to_command1", "1");
|
this.writing("to_command1", "1");
|
||||||
requireHeadSucess = true;
|
requireHeadSucess = true;
|
||||||
@@ -491,10 +511,18 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
instruction.setInstruction_status("1");
|
instruction.setInstruction_status("1");
|
||||||
instruction.setUpdate_time(DateUtil.now());
|
instruction.setUpdate_time(DateUtil.now());
|
||||||
instructionService.update(instruction);
|
instructionService.update(instruction);
|
||||||
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
|
Device startDevice = deviceAppservice.findDeviceByCode(instruction.getStart_device_code());
|
||||||
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
|
Device nextDevice = deviceAppservice.findDeviceByCode(instruction.getNext_device_code());
|
||||||
this.writing("to_onset2", String.valueOf(start_addrIndex + 1));
|
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||||
this.writing("to_target2", String.valueOf(next_addrIndex + 1));
|
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
|
||||||
|
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
this.writing("to_onset2", start_addr);
|
||||||
|
this.writing("to_target2", next_addr);
|
||||||
this.writing("to_task2", instruction.getInstruction_code());
|
this.writing("to_task2", instruction.getInstruction_code());
|
||||||
this.writing("to_command2", "1");
|
this.writing("to_command2", "1");
|
||||||
requireBackSucess = true;
|
requireBackSucess = true;
|
||||||
@@ -549,11 +577,19 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
task.setTask_status("1");
|
task.setTask_status("1");
|
||||||
taskserver.update(task);
|
taskserver.update(task);
|
||||||
|
|
||||||
//根据查询的任务起始点位 得出取放工位的索引值 写入后工位电气中
|
//根据查询的任务起始点位 得出取放工位的电气值 写入后工位电气中
|
||||||
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
|
Device startDevice = deviceAppservice.findDeviceByCode(instdto.getStart_device_code());
|
||||||
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
|
Device nextDevice = deviceAppservice.findDeviceByCode(instdto.getNext_device_code());
|
||||||
this.writing("to_onset2", String.valueOf(start_addrIndex + 1));
|
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||||
this.writing("to_target2", String.valueOf(next_addrIndex + 1));
|
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
|
||||||
|
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||||
|
}
|
||||||
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
this.writing("to_onset2", start_addr);
|
||||||
|
this.writing("to_target2", next_addr);
|
||||||
this.writing("to_task2", instdto.getInstruction_code());
|
this.writing("to_task2", instdto.getInstruction_code());
|
||||||
this.writing("to_command2", "1");
|
this.writing("to_command2", "1");
|
||||||
requireBackSucess = true;
|
requireBackSucess = true;
|
||||||
|
|||||||
@@ -366,8 +366,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String start_device_code = task.getStart_device_code();
|
String start_device_code = dto.getStart_device_code();
|
||||||
String next_device_code = task.getNext_device_code();
|
String next_device_code = dto.getNext_device_code();
|
||||||
String route_plan_code = task.getRoute_plan_code();
|
String route_plan_code = task.getRoute_plan_code();
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||||
RouteLineDto route = null;
|
RouteLineDto route = null;
|
||||||
@@ -383,12 +383,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
if (ObjectUtil.isEmpty(route)) {
|
if (ObjectUtil.isEmpty(route)) {
|
||||||
throw new BadRequestException("未查询到相关路由!");
|
throw new BadRequestException("未查询到相关路由!");
|
||||||
}
|
}
|
||||||
String agvType = paramService.findByCode("agvType").getValue();
|
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")){
|
||||||
if (StrUtil.equals(agvType, "2")) {
|
String agvType = paramService.findByCode("agvType").getValue();
|
||||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
if (StrUtil.equals(agvType, "2")) {
|
||||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(),dto);
|
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
}
|
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(),dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
dto.setSend_status("2");
|
dto.setSend_status("2");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -85,10 +85,11 @@ public class SectattrServiceImpl implements SectattrService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(SectattrDto dto) {
|
public void create(SectattrDto dto) {
|
||||||
String sect_code = dto.getSect_code();
|
String sect_code = dto.getSect_code();
|
||||||
SectattrDto sectattrDto = this.findByCode(sect_code);
|
|
||||||
if (sectattrDto != null && sectattrDto.getIs_delete().equals("0")) {
|
WQLObject tab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
throw new BadRequestException("存在相同的库区编号");
|
JSONObject json2 = tab.query("sect_code = '" + sect_code + "' and stor_id = '" + dto.getStor_id() + "'").uniqueResult(0);
|
||||||
}
|
if (ObjectUtil.isNotEmpty(json2)) throw new BadRequestException("存在相同仓库的库区编号");
|
||||||
|
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -116,11 +117,14 @@ public class SectattrServiceImpl implements SectattrService {
|
|||||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
String sect_code = dto.getSect_code();
|
/* String sect_code = dto.getSect_code();
|
||||||
SectattrDto sectattrDto = this.findByCode(sect_code);
|
SectattrDto sectattrDto = this.findByCode(sect_code);
|
||||||
if (sectattrDto != null && !dto.getSect_id().equals(sectattrDto.getSect_id()) && sectattrDto.getIs_delete().equals("0")) {
|
if (sectattrDto != null && !dto.getSect_id().equals(sectattrDto.getSect_id()) && sectattrDto.getIs_delete().equals("0")) {
|
||||||
throw new BadRequestException("存在相同的库区编号");
|
throw new BadRequestException("存在相同的库区编号");
|
||||||
}
|
}*/
|
||||||
|
String sect_code = dto.getSect_code();
|
||||||
|
|
||||||
|
WQLObject tab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
|
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
@@ -135,6 +139,9 @@ public class SectattrServiceImpl implements SectattrService {
|
|||||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_sectattr");
|
WQLObject wo = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
|
||||||
|
JSONArray resultJSONArray = tab.query("sect_code = '" + sect_code + "' and stor_id = '" + dto.getStor_id() + "'").getResultJSONArray(0);
|
||||||
|
if (resultJSONArray.size() > 1) throw new BadRequestException("存在相同仓库的库区编号");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
String struct = MapUtil.getStr(whereJson, "struct");
|
String struct = MapUtil.getStr(whereJson, "struct");
|
||||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||||
|
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("flag", "1");
|
map.put("flag", "1");
|
||||||
map.put("stor_id", stor_id);
|
map.put("stor_id", stor_id);
|
||||||
@@ -56,6 +57,9 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
if (StrUtil.isNotEmpty(pcsn)) {
|
if (StrUtil.isNotEmpty(pcsn)) {
|
||||||
map.put("pcsn", "%" + pcsn + "%");
|
map.put("pcsn", "%" + pcsn + "%");
|
||||||
}
|
}
|
||||||
|
if (StrUtil.isNotEmpty(sap_pcsn)) {
|
||||||
|
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||||
|
}
|
||||||
JSONObject jsonObject = WQL.getWO("QST_STRUCTIVT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt.instorage_time desc");
|
JSONObject jsonObject = WQL.getWO("QST_STRUCTIVT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt.instorage_time desc");
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
输入.material TYPEAS s_string
|
输入.material TYPEAS s_string
|
||||||
输入.stor_id TYPEAS s_string
|
输入.stor_id TYPEAS s_string
|
||||||
输入.pcsn TYPEAS s_string
|
输入.pcsn TYPEAS s_string
|
||||||
|
输入.sap_pcsn TYPEAS s_string
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
@@ -82,6 +83,10 @@
|
|||||||
ivt.pcsn like 输入.pcsn
|
ivt.pcsn like 输入.pcsn
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.sap_pcsn <> ""
|
||||||
|
sub.sap_pcsn like 输入.sap_pcsn
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.stor_id <> ""
|
OPTION 输入.stor_id <> ""
|
||||||
attr.stor_id = 输入.stor_id
|
attr.stor_id = 输入.stor_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ import org.nl.wms.st.inbill.service.CheckOutBillService;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
import java.io.*;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author liuxy
|
* @author liuxy
|
||||||
@@ -107,7 +105,8 @@ public class PrintServiceImpl implements PrintService {
|
|||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
}
|
}
|
||||||
fw = new FileWriter(filePath);
|
fw = new FileWriter(filePath);
|
||||||
BufferedWriter bw = new BufferedWriter(fw);
|
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||||
|
BufferedWriter bw = new BufferedWriter(write);
|
||||||
bw.write("package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight\n");
|
bw.write("package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight\n");
|
||||||
|
|
||||||
bw.write(package_box_sn1 + ","
|
bw.write(package_box_sn1 + ","
|
||||||
@@ -128,6 +127,7 @@ public class PrintServiceImpl implements PrintService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
bw.close();
|
bw.close();
|
||||||
|
jo.put("message", "打印成功!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
jo.put("message", "打印失败!"+e.getMessage());
|
jo.put("message", "打印失败!"+e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
@@ -137,7 +137,6 @@ public class PrintServiceImpl implements PrintService {
|
|||||||
jo.put("message", "打印失败!"+e.getMessage());
|
jo.put("message", "打印失败!"+e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jo.put("message", "打印成功!");
|
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
map.put("flag", "7");
|
map.put("flag", "7");
|
||||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||||
|
map.put("sap_pcsn", MapUtil.getStr(whereJson, "sap_pcsn"));
|
||||||
map.put("canuse_qty", "0");
|
map.put("canuse_qty", "0");
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||||
@@ -96,6 +97,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||||
}
|
}
|
||||||
|
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
|
||||||
|
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||||
|
}
|
||||||
JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt.struct_code ASC");
|
JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt.struct_code ASC");
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
@@ -1838,7 +1842,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//判断是否存在未确认状态的分配记录
|
//判断是否存在未确认状态的分配记录
|
||||||
JSONObject task = wo_dis.query("work_status <>'99' and iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
/* JSONObject task = wo_dis.query("work_status <>'99' and iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(task)) {
|
if (ObjectUtil.isNotEmpty(task)) {
|
||||||
JSONArray ja00 = wo_dis.query("work_status ='00' and iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
JSONArray ja00 = wo_dis.query("work_status ='00' and iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||||
JSONArray jatotal = wo_dis.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
JSONArray jatotal = wo_dis.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||||
@@ -1847,7 +1851,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
throw new BadRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//查询生成和未分配完的明细
|
//查询生成和未分配完的明细
|
||||||
JSONArray dtls = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
JSONArray dtls = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||||
@@ -2450,7 +2454,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
// 订单号
|
// 订单号
|
||||||
String source_bill_code = jsonDtl.getString("source_bill_code");
|
String source_bill_code = jsonDtl.getString("source_bill_code");
|
||||||
if (ObjectUtil.isNotEmpty(source_bill_code)) {
|
if (ObjectUtil.isNotEmpty(source_bill_code)) {
|
||||||
oneMap.put("order_no",source_bill_code.substring(0,source_bill_code.indexOf("-")));
|
try {
|
||||||
|
oneMap.put("order_no",source_bill_code.substring(0,source_bill_code.indexOf("-")));
|
||||||
|
} catch (Exception e) {
|
||||||
|
oneMap.put("order_no",source_bill_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String pageNow = String.valueOf(j + 1); // 页码
|
String pageNow = String.valueOf(j + 1); // 页码
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
输入.sale_order_name TYPEAS s_string
|
输入.sale_order_name TYPEAS s_string
|
||||||
输入.box_no TYPEAS s_string
|
输入.box_no TYPEAS s_string
|
||||||
输入.canuse_qty TYPEAS s_string
|
输入.canuse_qty TYPEAS s_string
|
||||||
|
输入.sap_pcsn TYPEAS s_string
|
||||||
[临时表]
|
[临时表]
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
@@ -456,7 +457,8 @@
|
|||||||
mater.material_name,
|
mater.material_name,
|
||||||
mater.material_code,
|
mater.material_code,
|
||||||
unit.unit_name AS qty_unit_name,
|
unit.unit_name AS qty_unit_name,
|
||||||
attr.storagevehicle_code AS box_no
|
attr.storagevehicle_code AS box_no,
|
||||||
|
sub.sap_pcsn
|
||||||
FROM
|
FROM
|
||||||
ST_IVT_StructIvt ivt
|
ST_IVT_StructIvt ivt
|
||||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id
|
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id
|
||||||
@@ -472,6 +474,10 @@
|
|||||||
mater.material_name like 输入.material_code)
|
mater.material_name like 输入.material_code)
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.sap_pcsn <> ""
|
||||||
|
sub.sap_pcsn like 输入.sap_pcsn
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.pcsn <> ""
|
OPTION 输入.pcsn <> ""
|
||||||
ivt.pcsn like 输入.pcsn
|
ivt.pcsn like 输入.pcsn
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|||||||
@@ -57,6 +57,16 @@
|
|||||||
class="filter-item"
|
class="filter-item"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="sap批次">
|
||||||
|
<el-input
|
||||||
|
v-model="query.sap_pcsn"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="sap批次"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<rrOperation :crud="crud" />
|
<rrOperation :crud="crud" />
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,6 +31,15 @@
|
|||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
|
<el-input
|
||||||
|
v-model="query.sap_pcsn"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="sap批次"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
<rrOperation />
|
<rrOperation />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,6 +59,7 @@
|
|||||||
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位" />
|
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位" />
|
||||||
<el-table-column show-overflow-tooltip prop="box_no" label="箱号" />
|
<el-table-column show-overflow-tooltip prop="box_no" label="箱号" />
|
||||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" />
|
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="sap批次" />
|
||||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" />
|
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" />
|
||||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" />
|
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.work_flag = true
|
this.work_flag = true
|
||||||
}
|
}
|
||||||
if (current.bill_status === '50' || current.bill_status === '40') {
|
if (current.bill_status === '50' || current.bill_status === '40' || current.bill_status === '30') {
|
||||||
this.confirm_flag = false
|
this.confirm_flag = false
|
||||||
} else {
|
} else {
|
||||||
this.confirm_flag = true
|
this.confirm_flag = true
|
||||||
@@ -375,6 +375,7 @@ export default {
|
|||||||
confirm() {
|
confirm() {
|
||||||
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||||
this.querytable()
|
this.querytable()
|
||||||
|
this.crud.notify('出库成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
|
|||||||
Reference in New Issue
Block a user