Merge branch 'master' into master_merge

This commit is contained in:
2024-06-21 10:26:03 +08:00
40 changed files with 1197 additions and 462 deletions

View File

@@ -839,6 +839,7 @@ public class SiemensWeightConveyorDeviceDriver extends AbstractOpcDeviceDriver i
}
//创建指令后修改任务状态
taskdto.setTask_status("1");
taskdto.setWeight(String.valueOf(this.weight));
taskserver.update(taskdto);
requireSucess = true;
String next_addr = nextdevice.getExtraValue().get("address").toString();

View File

@@ -53,6 +53,7 @@ public class AgvWaitUtil {
if(manipulatorAgvStationDeviceDriver.getAction() != 1){
throw new BadRequestException("上位系统不允许取货");
}
}
//agv叉车对接位安全信号交互
if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver){

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
@@ -23,6 +24,9 @@ import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.InteractionJsonDTO;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.device.enums.DeviceType;
import org.nl.acs.task.enums.ActionTypeEnum;
import org.nl.acs.task.enums.AgvActionTypeEnum;
import org.nl.acs.task.enums.AgvSystemTypeEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
@@ -32,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author 20220102CG\noblelift
@@ -251,7 +252,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject();
jo.put("id", inst.getInstruction_code());
//运单封口,true=创建运单之后不可添加动作块;false=创建运单可以添加动作块
jo.put("complete", true);
if (AgvActionTypeEnum.ORDINARY.getCode().equals(inst.getAgv_action_type())) {
jo.put("complete", true);
} else {
jo.put("complete", false);
}
//动作块
jo.put("blocks", createBlocksData(inst));
//运单优先级
@@ -262,7 +267,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo);
log.info("任务号:{},指令号{},下发诺宝运单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo);
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
@@ -304,22 +309,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
String start_point_code = inst.getStart_point_code();
String next_device_code = inst.getNext_device_code();
String next_point_code = inst.getNext_point_code();
String start_device_code2 = inst.getStart_device_code2();
String start_point_code2 = inst.getStart_point_code2();
String next_device_code2 = inst.getNext_device_code2();
String next_point_code2 = inst.getNext_point_code2();
Integer agv_action_type = inst.getAgv_action_type();
//起点1
sendStartDeviceOrder(ja, start_device_code, start_point_code, instruction_code);
sendStartDeviceOrder(ja, start_device_code, start_point_code, instruction_code, agv_action_type);
//终点1
sendEndDeviceOrder(ja, start_device_code, instruction_code, next_point_code, next_device_code);
//起点2
if (StrUtil.isNotEmpty(start_device_code2)) {
sendStartDeviceOrder(ja, start_device_code2, start_point_code2, instruction_code);
}
//终点2
if (StrUtil.isNotEmpty(next_device_code2)) {
sendEndDeviceOrder(ja, start_device_code2, instruction_code, next_device_code2, next_point_code2);
}
sendEndDeviceOrder(ja, start_device_code, instruction_code, next_point_code, next_device_code, agv_action_type);
return ja;
}
@@ -327,11 +324,12 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
* 下发取货信号
*
* @param ja
* @param pointCode 起始点位
* @param device_code 起始设备
* @param instCode 指令号
* @param pointCode 起始点位
* @param device_code 起始设备
* @param instCode 指令号
* @param agv_action_type
*/
public void sendStartDeviceOrder(JSONArray ja, String pointCode, String device_code, String instCode) {
public void sendStartDeviceOrder(JSONArray ja, String pointCode, String device_code, String instCode, Integer agv_action_type) {
Device startDevice = deviceAppService.findDeviceByCode(device_code);
//取货前等待
JSONObject jo = new JSONObject();
@@ -357,110 +355,99 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo.put("script_args", script_args);
ja.add(jo);
//将货物顶起来,机器识别提升高度
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", pointCode);
jo1.put("operation", "JackLoad");
jo1.put("operationArgs", new JSONObject() {{
put("recognize", true);
}});
ja.add(jo1);
if (AgvActionTypeEnum.ORDINARY.getCode().equals(agv_action_type) || AgvActionTypeEnum.OUT_STOCK.getCode().equals(agv_action_type)) {
//将货物顶起来,机器识别提升高度
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", pointCode);
jo1.put("operation", "JackLoad");
jo1.put("operationArgs", new JSONObject() {{
put("recognize", true);
}});
ja.add(jo1);
JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", pointCode + "OUTGET");
jo2.put("operation", "script");
jo2.put("id", pointCode + "OUTGET");
jo2.put("script_name", "userpy/interact.py");
JSONObject script_args2 = new JSONObject();
script_args2.put("addr", addr);
JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject();
reach2.put("task_code", instCode);
reach2.put("address", pointCode + "OUTGET");
data2.put("reach", reach2);
script_args2.put("data", data2);
script_args2.put("protocol", "HTTP");
jo2.put("script_args", script_args2);
ja.add(jo2);
JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", pointCode + "OUTGET");
jo2.put("operation", "script");
jo2.put("id", pointCode + "OUTGET");
jo2.put("script_name", "userpy/interact.py");
JSONObject script_args2 = new JSONObject();
script_args2.put("addr", addr);
JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject();
reach2.put("task_code", instCode);
reach2.put("address", pointCode + "OUTGET");
data2.put("reach", reach2);
script_args2.put("data", data2);
script_args2.put("protocol", "HTTP");
jo2.put("script_args", script_args2);
ja.add(jo2);
}
}
/**
* 下发放货信号
*
* @param ja
* @param device_code 起始设备
* @param instCode 指令号
* @param pointCode 终点点位
* @param nextDeviceCode 终点设备
* @param device_code 起始设备
* @param instCode 指令号
* @param pointCode 终点点位
* @param nextDeviceCode 终点设备
* @param agv_action_type
*/
public void sendEndDeviceOrder(JSONArray ja, String device_code, String instCode, String pointCode, String nextDeviceCode) {
public void sendEndDeviceOrder(JSONArray ja, String device_code, String instCode, String pointCode, String nextDeviceCode, Integer agv_action_type) {
Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode);
if (!AgvActionTypeEnum.IN_STOCK.getCode().equals(agv_action_type)) {
//放货前等待
JSONObject jo3 = new JSONObject();
jo3.put("blockId", IdUtil.simpleUUID());
jo3.put("location", pointCode + "INPUT");
jo3.put("operation", "script");
jo3.put("id", pointCode + "INPUT");
jo3.put("script_name", "userpy/interact.py");
JSONObject script_args3 = new JSONObject();
script_args3.put("addr", addr);
JSONObject data3 = new JSONObject();
JSONObject reach3 = new JSONObject();
reach3.put("task_code", instCode);
reach3.put("address", pointCode + "INPUT");
data3.put("reach", reach3);
script_args3.put("data", data3);
script_args3.put("protocol", "HTTP");
jo3.put("script_args", script_args3);
ja.add(jo3);
//放货前等待
JSONObject jo3 = new JSONObject();
jo3.put("blockId", IdUtil.simpleUUID());
jo3.put("location", pointCode + "INPUT");
jo3.put("operation", "script");
jo3.put("id", pointCode + "INPUT");
jo3.put("script_name", "userpy/interact.py");
JSONObject script_args3 = new JSONObject();
script_args3.put("addr", addr);
JSONObject data3 = new JSONObject();
JSONObject reach3 = new JSONObject();
reach3.put("task_code", instCode);
reach3.put("address", pointCode + "INPUT");
data3.put("reach", reach3);
script_args3.put("data", data3);
script_args3.put("protocol", "HTTP");
jo3.put("script_args", script_args3);
ja.add(jo3);
if (AgvActionTypeEnum.ORDINARY.getCode().equals(agv_action_type)) {
//将货物放下
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject();
jo4.put("blockId", IdUtil.simpleUUID());
jo4.put("location", pointCode);
jo4.put("operation", "JackUnload");
ja.add(jo4);
//放货前下发旋转角度
/*JSONObject json1 = new JSONObject();
AcsPointAngle acsPointAngleDto = acsPointAngleService.findByCode(device_code, nextDeviceCode);
if (ObjectUtil.isNotEmpty(acsPointAngleDto)) {
log.info("acsPointAngleDto----參數,{}", acsPointAngleDto.toString());
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject();
BigDecimal next_point_angle = acsPointAngleDto.getNext_point_angle();
operation_args.put("increase_spin_angle", next_point_angle);//弧度值如3.14
operation_args.put("skill_name", "GoByOdometer");
json1.put("blockId", IdUtil.simpleUUID());
json1.put("location", pointCode + "INPUT");
json1.put("operation_args", operation_args);
ja.add(json1);
}*/
//将货物放下
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject();
jo4.put("blockId", IdUtil.simpleUUID());
jo4.put("location", pointCode);
jo4.put("operation", "JackUnload");
ja.add(jo4);
//放货完成等待
com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject();
jo5.put("blockId", IdUtil.simpleUUID());
jo5.put("location", pointCode + "OUTPUT");
jo5.put("operation", "script");
jo5.put("id", pointCode + "OUTPUT");
jo5.put("script_name", "userpy/interact.py");
com.alibaba.fastjson.JSONObject script_args5 = new com.alibaba.fastjson.JSONObject();
script_args5.put("addr", addr);
com.alibaba.fastjson.JSONObject data5 = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reach5 = new com.alibaba.fastjson.JSONObject();
reach5.put("task_code", instCode);
reach5.put("address", pointCode + "OUTPUT");
data5.put("reach", reach5);
script_args5.put("data", data5);
script_args5.put("protocol", "HTTP");
jo5.put("script_args", script_args5);
ja.add(jo5);
//放货完成等待
com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject();
jo5.put("blockId", IdUtil.simpleUUID());
jo5.put("location", pointCode + "OUTPUT");
jo5.put("operation", "script");
jo5.put("id", pointCode + "OUTPUT");
jo5.put("script_name", "userpy/interact.py");
com.alibaba.fastjson.JSONObject script_args5 = new com.alibaba.fastjson.JSONObject();
script_args5.put("addr", addr);
com.alibaba.fastjson.JSONObject data5 = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reach5 = new com.alibaba.fastjson.JSONObject();
reach5.put("task_code", instCode);
reach5.put("address", pointCode + "OUTPUT");
data5.put("reach", reach5);
script_args5.put("data", data5);
script_args5.put("protocol", "HTTP");
jo5.put("script_args", script_args5);
ja.add(jo5);
}
}
}
@@ -709,14 +696,33 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
throw new BadRequestException("请求失败,地址为空!");
}
if (address.contains("IN")) {
String instructionCode = instructionDto.getInstruction_code();
String deviceCodeNow = address.substring(0, address.length() - 5);
if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) {
throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!");
}
if (address.contains("GET")) {
if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
//如果是取货二次分配,取放货二次分配需要重新追加动作块
if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) {
Integer actionType = ActionTypeEnum.IN_STOCK.getCode();
deviceCodeNow = applyXGAgvTask(instructionCode, actionType, instructionDto);
}
} else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
}
return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto);
} else if (address.contains("PUT")) {
if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
//如果是放货二次分配,取放货二次分配需要重新追加动作块
if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) {
Integer actionType = ActionTypeEnum.OUT_STOCK.getCode();
deviceCodeNow = applyXGAgvTask(instructionCode, actionType, instructionDto);
}
} else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
Integer actionType = ActionTypeEnum.OUT_STOCK.getCode();
deviceCodeNow = applyCCAgvTask(instructionCode, actionType, instructionDto);
}
return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto);
}
}
@@ -736,6 +742,102 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
throw new BadRequestException("请求失败IN OUT 站点错误!");
}
private String applyCCAgvTask(String instructionCode, Integer actionType, Instruction instructionDto) {
try {
JSONObject param = new JSONObject();
param.put("taskCode", instructionCode);
param.put("actionType", actionType.toString());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("追加动叉车作块:")
.content("追加动叉车作块,参数:" + instructionCode + "--" + actionType)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.secondaryAllocationPoint(param);
JSONObject jo = JSON.parseObject(response);
if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code("追加动叉车作块:")
.content("追加动叉车作块,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
//请求成功调用叉车追加动作块
sendAddSequencesToCCAgv(instructionCode, jo.getString("data"), instructionDto);
return jo.getString("data");
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code("追加动叉车作块:")
.content("追加动叉车作块失败,返回参数:" + jo.getString("body"))
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
throw new BadRequestException("追加动叉车作块返回失败");
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private void sendAddSequencesToCCAgv(String instructionCode, String nextPoint, Instruction instructionDto) {
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject();
jo.put("id", instructionCode);
//动作块
jo.put("blocks", createBlocksDataTowCCStart(nextPoint));
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("追加诺宝运单")
.content("指令号:" + instructionCode + ",追加诺宝运单参数:" + jo)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
log.info("任务号:{},指令号{},追加诺宝运单:{}", instructionCode, instructionCode, jo);
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/addBlocks";
log.info(agvurl);
HttpResponse result = HttpRequest.post(agvurl)
//表单内容
.body(String.valueOf(jo))
//超时,毫秒
.timeout(20000)
.execute();
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("叉车运单响应")
.content("指令号:" + instructionCode + ",下发追加诺宝运单反馈参数:" + jo)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
log.info("指令号{},状态{},下发追加诺宝运单序列反馈:{}", instructionCode, result.getStatus(), result.body());
}
}
private Object createBlocksDataTowCCStart(String nextPoint) {
JSONArray ja = new JSONArray();
JSONObject jo9 = new JSONObject();
jo9.put("blockId", IdUtil.simpleUUID());
jo9.put("location", nextPoint);
jo9.put("binTask", "ForkUnload");
ja.add(jo9);
JSONObject jo10 = new JSONObject();
jo10.put("blockId", IdUtil.simpleUUID());
jo10.put("location", nextPoint + "OUTPUT");
jo10.put("binTask", "OutForkHeight");
ja.add(jo10);
return ja;
}
@Override
public HttpResponse getRobotInfo(String robotCode) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
@@ -754,14 +856,61 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
}
}
private String applyXGAgvTask(String instructionCode, Integer actionType, Instruction instructionDto) {
try {
JSONObject param = new JSONObject();
param.put("taskCode", instructionCode);
param.put("actionType", actionType.toString());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("追加动诺宝作块:")
.content("追加动诺宝作块,参数:" + instructionCode + "--" + actionType)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.secondaryAllocationPoint(param);
JSONObject jo = JSON.parseObject(response);
if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code("追加动诺宝作块:")
.content("追加动诺宝作块,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
if (!ActionTypeEnum.IN_FINISHING.getCode().equals(actionType)) {
//请求成功调用诺宝追加动作块
sendAddSequencesToNBAgv(instructionCode, jo.getString("data"), instructionDto);
}
return jo.getString("data");
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code("追加动诺宝作块:")
.content("追加动诺宝作块失败,返回参数:" + jo.getString("body"))
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
throw new BadRequestException("追加动诺宝作块返回失败");
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public HttpResponse sendOrderSequencesToForklift(Instruction inst, InteractionJsonDTO interactionJsonDTO) {
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject();
jo.put("id", inst.getInstruction_code());
//运单封口,true=创建运单之后不可添加动作块;false=创建运单可以添加动作块
jo.put("complete", true);
//动作块
jo.put("blocks", createBlocksForklift(inst,interactionJsonDTO));
//运单封口,true=创建运单之后不可添加动作块;false=创建运单可以添加动作块
if (AgvActionTypeEnum.ORDINARY.getCode().equals(inst.getAgv_action_type())) {
jo.put("complete", true);
} else {
jo.put("complete", false);
} //动作块
jo.put("blocks", createBlocksForklift(inst, interactionJsonDTO));
//运单优先级
jo.put("priority", inst.getPriority());
LuceneLogDto logDto = LuceneLogDto.builder()
@@ -799,6 +948,184 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
}
}
/**
* 追加动作块
*
* @param
* @param instructionCode
* @param instructionDto
* @return
*/
private void sendAddSequencesToNBAgv(String instructionCode, String point, Instruction instructionDto) {
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject();
jo.put("id", instructionCode);
//动作块
if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) {
jo.put("blocks", createBlocksDataTowStart(instructionCode, point, instructionDto));
}
if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) {
jo.put("blocks", createBlocksDataTowEnd(instructionCode, point, instructionDto));
}
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("追加诺宝运单")
.content("指令号:" + instructionCode + ",追加诺宝运单参数:" + jo)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
log.info("任务号:{},指令号{},追加诺宝运单:{}", instructionCode, point, jo);
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/addBlocks";
log.info(agvurl);
HttpResponse result = HttpRequest.post(agvurl)
//表单内容
.body(String.valueOf(jo))
//超时,毫秒
.timeout(20000)
.execute();
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("叉车运单响应")
.content("指令号:" + instructionCode + ",下发追加诺宝运单反馈参数:" + jo)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
log.info("指令号{},状态{},下发追加诺宝运单序列反馈:{}", instructionCode, result.getStatus(), result.body());
}
}
private Object createBlocksDataTowEnd(String instructionCode, String point, Instruction instructionDto) {
JSONArray ja = new JSONArray();
String nextDeviceCode = instructionDto.getNext_device_code();
//终点2
sendEndDeviceOrder3(ja, nextDeviceCode, instructionCode, instructionDto);
return ja;
}
private void sendEndDeviceOrder3(JSONArray ja, String nextDeviceCode, String instructionCode, Instruction instructionDto) {
//将货物放下
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject();
jo4.put("blockId", IdUtil.simpleUUID());
jo4.put("location", nextDeviceCode);
jo4.put("operation", "JackUnload");
ja.add(jo4);
//放货完成等待
com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject();
jo5.put("blockId", IdUtil.simpleUUID());
jo5.put("location", nextDeviceCode + "OUTPUT");
jo5.put("operation", "script");
jo5.put("id", nextDeviceCode + "OUTPUT");
jo5.put("script_name", "userpy/interact.py");
com.alibaba.fastjson.JSONObject script_args5 = new com.alibaba.fastjson.JSONObject();
script_args5.put("addr", addr);
com.alibaba.fastjson.JSONObject data5 = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reach5 = new com.alibaba.fastjson.JSONObject();
reach5.put("task_code", instructionCode);
reach5.put("address", nextDeviceCode + "OUTPUT");
data5.put("reach", reach5);
script_args5.put("data", data5);
script_args5.put("protocol", "HTTP");
jo5.put("script_args", script_args5);
ja.add(jo5);
}
private Object createBlocksDataTowStart(String instructionCode, String startPoint, Instruction instructionDto) {
JSONArray ja = new JSONArray();
String nextDeviceCode = instructionDto.getNext_device_code();
//起点2
sendStartDeviceOrder2(ja, startPoint, instructionCode);
//终点2
sendEndDeviceOrder2(ja, nextDeviceCode, instructionCode, instructionDto);
return ja;
}
private void sendEndDeviceOrder2(JSONArray ja, String nextDeviceCode, String instructionCode, Instruction instructionDto) {
//放货前等待
JSONObject jo3 = new JSONObject();
jo3.put("blockId", IdUtil.simpleUUID());
jo3.put("location", nextDeviceCode + "INPUT");
jo3.put("operation", "script");
jo3.put("id", nextDeviceCode + "INPUT");
jo3.put("script_name", "userpy/interact.py");
JSONObject script_args3 = new JSONObject();
script_args3.put("addr", addr);
JSONObject data3 = new JSONObject();
JSONObject reach3 = new JSONObject();
reach3.put("task_code", instructionCode);
reach3.put("address", nextDeviceCode + "INPUT");
data3.put("reach", reach3);
script_args3.put("data", data3);
script_args3.put("protocol", "HTTP");
jo3.put("script_args", script_args3);
ja.add(jo3);
if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type())) {
//将货物放下
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject();
jo4.put("blockId", IdUtil.simpleUUID());
jo4.put("location", nextDeviceCode);
jo4.put("operation", "JackUnload");
ja.add(jo4);
//放货完成等待
com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject();
jo5.put("blockId", IdUtil.simpleUUID());
jo5.put("location", nextDeviceCode + "OUTPUT");
jo5.put("operation", "script");
jo5.put("id", nextDeviceCode + "OUTPUT");
jo5.put("script_name", "userpy/interact.py");
com.alibaba.fastjson.JSONObject script_args5 = new com.alibaba.fastjson.JSONObject();
script_args5.put("addr", addr);
com.alibaba.fastjson.JSONObject data5 = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reach5 = new com.alibaba.fastjson.JSONObject();
reach5.put("task_code", instructionCode);
reach5.put("address", nextDeviceCode + "OUTPUT");
data5.put("reach", reach5);
script_args5.put("data", data5);
script_args5.put("protocol", "HTTP");
jo5.put("script_args", script_args5);
ja.add(jo5);
}
}
private void sendStartDeviceOrder2(JSONArray ja, String startPoint, String instructionCode) {
//将货物顶起来,机器识别提升高度
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", startPoint);
jo1.put("operation", "JackLoad");
jo1.put("operationArgs", new JSONObject() {{
put("recognize", true);
}});
ja.add(jo1);
JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", startPoint + "OUTGET");
jo2.put("operation", "script");
jo2.put("id", startPoint + "OUTGET");
jo2.put("script_name", "userpy/interact.py");
JSONObject script_args2 = new JSONObject();
script_args2.put("addr", addr);
JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject();
reach2.put("task_code", instructionCode);
reach2.put("address", startPoint + "OUTGET");
data2.put("reach", reach2);
script_args2.put("data", data2);
script_args2.put("protocol", "HTTP");
jo2.put("script_args", script_args2);
ja.add(jo2);
}
/**
* 叉车运单动作块
*
@@ -813,7 +1140,6 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
String pointCode = inst.getStart_point_code();
//取货前等待
JSONObject jo = new JSONObject();
//动作块id
@@ -838,100 +1164,208 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo.put("script_args", script_args);
ja.add(jo);
if (AgvActionTypeEnum.ORDINARY.getCode().equals(inst.getAgv_action_type())) {
// to do
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", inst.getStart_point_code() + "INGET");
jo1.put("binTask", "InForkHeight");
ja.add(jo1);
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", inst.getStart_point_code()+ "INGET");
jo1.put("binTask", "InForkHeight");
ja.add(jo1);
JSONObject jo3 = new JSONObject();
//动作块id
jo3.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo3.put("location", pointCode + "INGET");
jo3.put("id", pointCode + "INGET");
//执行脚本
jo3.put("operation", "expand");
//通信脚本,动作前后与现场设备交互的场景
jo3.put("script_name", "Fork-expand.py");
JSONObject script_args2 = new JSONObject();
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getExpandWidthLength())) {
script_args2.put("expandWidth", interactionJsonDTO.getExpandWidthLength());
}
script_args2.put("operation", "expand");
jo3.put("script_args", script_args2);
ja.add(jo3);
JSONObject jo4 = new JSONObject();
//动作块id
jo4.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo4.put("location", pointCode + "INGET");
jo4.put("id", pointCode + "INGET");
//执行脚本
jo4.put("operation", "stretch");
//通信脚本,动作前后与现场设备交互的场景
jo4.put("script_name", "Fork-expand.py");
JSONObject script_args1 = new JSONObject();
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getExpandWidthLength())) {
script_args1.put("stretchLength", interactionJsonDTO.getExpandWidthLength());
}
script_args1.put("operation", "stretch");
jo4.put("script_args", script_args1);
ja.add(jo4);
JSONObject jo6 = new JSONObject();
jo6.put("blockId", IdUtil.simpleUUID());
jo6.put("location", inst.getStart_point_code());
jo6.put("binTask", "Script");
ja.add(jo6);
JSONObject jo7 = new JSONObject();
jo7.put("blockId", IdUtil.simpleUUID());
jo7.put("location", inst.getStart_point_code());
jo7.put("binTask", "ForkLoad");
ja.add(jo7);
//取货完成
JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", pointCode + "OUTGET");
jo2.put("operation", "script");
jo2.put("id", pointCode + "OUTGET");
jo2.put("script_name", "userpy/interact.py");
JSONObject script_args4 = new JSONObject();
script_args4.put("addr", addr);
JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject();
reach2.put("task_code", inst.getInstruction_code());
reach2.put("address", pointCode + "OUTGET");
data2.put("reach", reach2);
script_args4.put("data", data2);
script_args4.put("protocol", "HTTP");
jo2.put("script_args", script_args4);
ja.add(jo2);
//ForkUnload(货叉卸载货物,会将叉车的状态变成非载货中)
JSONObject jo8 = new JSONObject();
jo8.put("blockId", IdUtil.simpleUUID());
jo8.put("location", inst.getStart_point_code() + "OUTGET");
jo8.put("binTask", "OutForkHeight");
ja.add(jo8);
JSONObject jo9 = new JSONObject();
jo9.put("blockId", IdUtil.simpleUUID());
jo9.put("location", inst.getNext_point_code());
jo9.put("binTask", "ForkUnload");
ja.add(jo9);
JSONObject jo10 = new JSONObject();
jo10.put("blockId", IdUtil.simpleUUID());
jo10.put("location", inst.getNext_point_code() + "OUTPUT");
jo10.put("binTask", "OutForkHeight");
ja.add(jo10);
} else if (AgvActionTypeEnum.IN_STOCK.getCode().equals(inst.getAgv_action_type())) {
} else if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(inst.getAgv_action_type())) {
// to do
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", inst.getStart_point_code() + "INGET");
jo1.put("binTask", "InForkHeight");
ja.add(jo1);
JSONObject jo3 = new JSONObject();
//动作块id
jo3.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo3.put("location", pointCode + "INGET");
jo3.put("id", pointCode + "INGET");
//执行脚本
jo3.put("operation", "expand");
//通信脚本,动作前后与现场设备交互的场景
jo3.put("script_name", "Fork-expand.py");
JSONObject script_args2 = new JSONObject();
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getExpandWidthLength())) {
script_args2.put("expandWidth", interactionJsonDTO.getExpandWidthLength());
}
script_args2.put("operation", "expand");
jo3.put("script_args", script_args2);
ja.add(jo3);
JSONObject jo4 = new JSONObject();
//动作块id
jo4.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo4.put("location", pointCode + "INGET");
jo4.put("id", pointCode + "INGET");
//执行脚本
jo4.put("operation", "stretch");
//通信脚本,动作前后与现场设备交互的场景
jo4.put("script_name", "Fork-expand.py");
JSONObject script_args1 = new JSONObject();
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getExpandWidthLength())) {
script_args1.put("stretchLength", interactionJsonDTO.getExpandWidthLength());
}
script_args1.put("operation", "stretch");
jo4.put("script_args", script_args1);
ja.add(jo4);
JSONObject jo6 = new JSONObject();
jo6.put("blockId", IdUtil.simpleUUID());
jo6.put("location", inst.getStart_point_code());
jo6.put("binTask", "Script");
ja.add(jo6);
JSONObject jo7 = new JSONObject();
jo7.put("blockId", IdUtil.simpleUUID());
jo7.put("location", inst.getStart_point_code());
jo7.put("binTask", "ForkLoad");
ja.add(jo7);
//取货完成
JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", pointCode + "OUTGET");
jo2.put("operation", "script");
jo2.put("id", pointCode + "OUTGET");
jo2.put("script_name", "userpy/interact.py");
JSONObject script_args4 = new JSONObject();
script_args4.put("addr", addr);
JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject();
reach2.put("task_code", inst.getInstruction_code());
reach2.put("address", pointCode + "OUTGET");
data2.put("reach", reach2);
script_args4.put("data", data2);
script_args4.put("protocol", "HTTP");
jo2.put("script_args", script_args4);
ja.add(jo2);
//ForkUnload(货叉卸载货物,会将叉车的状态变成非载货中)
JSONObject jo8 = new JSONObject();
jo8.put("blockId", IdUtil.simpleUUID());
jo8.put("location", inst.getStart_point_code() + "OUTGET");
jo8.put("binTask", "OutForkHeight");
ja.add(jo8);
JSONObject jo9 = new JSONObject();
jo9.put("blockId", IdUtil.simpleUUID());
jo9.put("location", pointCode + "INPUT");
jo9.put("operation", "script");
jo9.put("id", pointCode + "INPUT");
jo9.put("script_name", "userpy/interact.py");
JSONObject script_args5 = new JSONObject();
script_args5.put("addr", addr);
JSONObject data3 = new JSONObject();
JSONObject reach3 = new JSONObject();
reach3.put("task_code", inst.getInstruction_code());
reach3.put("address", pointCode + "INPUT");
data3.put("reach", reach3);
script_args5.put("data", data3);
script_args5.put("protocol", "HTTP");
jo9.put("script_args", script_args5);
ja.add(jo9);
} else if (AgvActionTypeEnum.IN_STOCK.getCode().equals(inst.getAgv_action_type())) {
JSONObject jo3 = new JSONObject();
//动作块id
jo3.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo3.put("location", pointCode + "INGET");
jo3.put("id", pointCode + "INGET");
//执行脚本
jo3.put("operation", "expand");
//通信脚本,动作前后与现场设备交互的场景
jo3.put("script_name", "Fork-expand.py");
JSONObject script_args2 = new JSONObject();
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getExpandWidthLength())) {
script_args2.put("expandWidth",interactionJsonDTO.getExpandWidthLength());
}
script_args2.put("operation", "expand");
jo3.put("script_args", script_args2);
ja.add(jo3);
JSONObject jo4 = new JSONObject();
//动作块id
jo4.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo4.put("location", pointCode + "INGET");
jo4.put("id", pointCode + "INGET");
//执行脚本
jo4.put("operation", "stretch");
//通信脚本,动作前后与现场设备交互的场景
jo4.put("script_name", "Fork-expand.py");
JSONObject script_args1 = new JSONObject();
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getExpandWidthLength())) {
script_args2.put("stretchLength",interactionJsonDTO.getExpandWidthLength());
}
script_args1.put("operation", "stretch");
jo4.put("script_args", script_args1);
ja.add(jo4);
JSONObject jo6 = new JSONObject();
jo6.put("blockId", IdUtil.simpleUUID());
jo6.put("location", inst.getStart_point_code());
jo6.put("binTask", "Script");
ja.add(jo6);
JSONObject jo7 = new JSONObject();
jo7.put("blockId", IdUtil.simpleUUID());
jo7.put("location", inst.getStart_point_code());
jo7.put("binTask", "ForkLoad");
ja.add(jo7);
//取货完成
JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", pointCode + "OUTGET");
jo2.put("operation", "script");
jo2.put("id", pointCode + "OUTGET");
jo2.put("script_name", "userpy/interact.py");
JSONObject script_args4 = new JSONObject();
script_args4.put("addr", addr);
JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject();
reach2.put("task_code", inst.getInstruction_code());
reach2.put("address", pointCode + "OUTGET");
data2.put("reach", reach2);
script_args4.put("data", data2);
script_args4.put("protocol", "HTTP");
jo2.put("script_args", script_args4);
ja.add(jo2);
//ForkUnload(货叉卸载货物,会将叉车的状态变成非载货中)
JSONObject jo8 = new JSONObject();
jo8.put("blockId", IdUtil.simpleUUID());
jo8.put("location", inst.getStart_point_code()+"OUTGET");
jo8.put("binTask", "OutForkHeight");
ja.add(jo8);
JSONObject jo9 = new JSONObject();
jo9.put("blockId", IdUtil.simpleUUID());
jo9.put("location", inst.getNext_point_code());
jo9.put("binTask", "ForkUnload");
ja.add(jo9);
JSONObject jo10 = new JSONObject();
jo10.put("blockId", IdUtil.simpleUUID());
jo10.put("location", inst.getNext_point_code()+"OUTPUT");
jo10.put("binTask", "OutForkHeight");
ja.add(jo10);
return ja;
}

View File

@@ -230,6 +230,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank((String) whereJson.get("device_type")), Device::getDevice_type, whereJson.get("device_type"));
wrapper.eq(StringUtils.isNotBlank((String) whereJson.get("region")), Device::getRegion, whereJson.get("region"));
wrapper.eq(StringUtils.isNotBlank((String) whereJson.get("is_config")), Device::getIs_config, whereJson.get("is_config"));
wrapper.nested(StringUtils.isNotBlank((String) whereJson.get("blurry")), i -> i.like(Device::getDevice_code, whereJson.get("blurry")).or().like(Device::getDevice_name, whereJson.get("blurry")));
wrapper.orderByAsc(Device::getIs_config).orderByDesc(Device::getSeq_num).orderByDesc(Device::getUpdate_time);
wrapper.orderByDesc(Device::getCreate_time);
@@ -926,6 +927,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
String vehicle_code = form.getString("vehicle_code");
String islock = form.getString("islock");
String requireSucess = form.getString("requireSucess");
String requireActionSucess = form.getString("requireActionSucess");
String fullrequireSucess = form.getString("fullrequireSucess");
if (device_code.indexOf(".") != -1) {
device_code = device_code.substring(0, device_code.indexOf("."));

View File

@@ -263,9 +263,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (mode == 8 && !requireSucess) {
if (container_type == 0) {
message = "托盘类型为空";
}
}else {
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
}
}
@@ -606,8 +606,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
Boolean ignorePickupCheck = (Boolean) beltConveyorDeviceDriver.getExtraValue().get("ignore_pickup_check");
if (!ignorePickupCheck) {
String ignorePickupCheck = (String) beltConveyorDeviceDriver.getExtraValue().get("ignore_pickup_check");
if ("false".equals(ignorePickupCheck)) {
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) {
log.error("输送机,{}未联机或执行中", next_device_code);
this.setNotCreateInstMessage("universal_notCreateInstMessage4");
@@ -755,7 +755,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
public void writing(String key, String param) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + param;
+ "." + key;
//String opcservcerid = this.getDevice().getOpc_server_id();
//Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();

View File

@@ -262,11 +262,11 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
case 25:
if ( StrUtil.isEmpty(material_barcode)) {
message = "子卷码为空";
}
//二楼到一楼输送线申请行架任务
if (move == 1 && !requireSucess) {
applyManipulatorTask();
}else {
//二楼到一楼输送线申请行架任务
if (move == 1 && !requireSucess) {
applyManipulatorTask();
}
}
break;
}

View File

@@ -234,8 +234,9 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
if (move == 1 && !requireSucess) {
if (StrUtil.isEmpty(material_barcode)) {
message = "条码为空";
}else {
applyAgvTask();
}
applyAgvTask();
}
break;

View File

@@ -210,7 +210,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
}
if (move != last_move && move==0 && last_move==1) {
if (move != last_move && move == 0 && last_move == 1) {
requireSucess = false;
clearWrite();
}
@@ -244,21 +244,21 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
//申请空托盘入库
if (mode == 9 && move == 1 && !requireSucess) {
if (container_type==0){
if (container_type == 0) {
message = "托盘类型为空";
} else {
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
}
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
}
//申请空托盘出库
if (mode == 8 && !requireSucess) {
if (container_type==0){
if (container_type == 0) {
message = "托盘类型为空";
} else {
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
}
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
}
@@ -315,21 +315,21 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
List list = new ArrayList<>();
Map map = new HashMap<>();
map.put("code","to_target");
map.put("value","0");
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");
map2.put("code", "to_task");
map2.put("value", "0");
list.add(map2);
Map map4 = new HashMap<>();
map4.put("code","to_container_type");
map4.put("value","0");
map4.put("code", "to_container_type");
map4.put("value", "0");
list.add(map4);
this.writing(list);
message=null;
vehicle_code=null;
message = null;
vehicle_code = null;
}

View File

@@ -316,7 +316,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
//申请空托盘入库
if (mode == 9 && move == 1 && !requireSucess) {
if (container_type == 0) {
if (container_type == 0 || StrUtil.isEmpty(barcode)) {
message = "托盘类型为空";
}else {
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
@@ -580,6 +580,12 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
JSONObject param = new JSONObject();
param.put("device_code", device_code);
param.put("container_type", container_type);
if (StrUtil.isNotEmpty(hand_barcode)) {
param.put("vehicle_code", hand_barcode);
}
if (StrUtil.isNotEmpty(barcode)&&(barcode.startsWith("A")||barcode.startsWith("B"))) {
param.put("vehicle_code", barcode);
}
param.put("type", type);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)

View File

@@ -360,9 +360,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}*/
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -375,9 +377,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -503,9 +507,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}*/
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!";
return false;
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!";
return false;
}
}
}
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -525,9 +531,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!";
return false;
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!";
return false;
}
}
}
@@ -1117,11 +1125,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
action = LangProcess.msg("universal_releasing_completed");
}
if (error == 0 && iserror) {
this.setMessage("universal_message11");
this.setMessage("信号连接异常!");
}
String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4");
String requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage4");
if(this.requireActionSucess){
requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage5");
requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5");
}
map.put("device_name", this.getDevice().getDevice_name());
map.put("mode", mode);
@@ -1148,11 +1156,17 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
@Override
public void setDeviceStatus(JSONObject data) {
String requestSucess = data.getString("requireSucess");
String requireActionSucess = data.getString("requireActionSucess");
if (StrUtil.equals(requestSucess, "0")) {
this.requireSucess = false;
} else if (StrUtil.equals(requestSucess, "1")) {
this.requireSucess = true;
}
if (StrUtil.equals(requireActionSucess, "0")) {
this.requireActionSucess = false;
} else if (StrUtil.equals(requireActionSucess, "1")) {
this.requireActionSucess = true;
}
}
public void writing(String param, String value) {

View File

@@ -224,7 +224,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (inst != null) {
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
try {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
Map<String, Object> map = new LinkedHashMap<>();
/*if (ObjectUtil.isNotEmpty(dto)){
String interaction_json = dto.getInteraction_json();
@@ -257,11 +256,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (mode == 0) {
this.setIsonline(false);
message = LangProcess.msg("universal_off-line");
message = "universal_off-line";
//有报警
} else if (error != 0) {
this.setIserror(true);
message = LangProcess.msg("universal_message3");
message = "universal_message3";
//无报警
} else {
this.setIsonline(true);
@@ -337,6 +336,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//放货工位
List<String> putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
TaskDto task = null;
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
@@ -344,6 +344,22 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//按照优先级排序 优先级相等按照创建时间排序
taskDtos = this.sortTask(taskDtos);
TaskDto taskDto = taskDtos.get(0);
String startPoint = task.getStart_device_code();
Device startPointDevice = deviceAppService.findDeviceByCode(startPoint);
if (startPointDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startPointDevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
String nextDeviceCode = taskDto.getNext_device_code();
Device device = deviceAppService.findDeviceByCode(nextDeviceCode);
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
String startCode = instruction.getStart_device_code();
String nextCode = instruction.getNext_device_code();
@@ -380,12 +396,20 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
}
}
if (!ObjectUtil.isEmpty(task)) {
String startDeviceCode = task.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(startDeviceCode);
if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
String nextDeviceCode = task.getNext_device_code();
Device device = deviceAppService.findDeviceByCode(nextDeviceCode);
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0 && plugPullDeviceSiteDeviceDriver.getAction() != 1)
Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode);
if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
String taskId = task.getTask_id();
@@ -393,11 +417,9 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String vehicleCode = task.getVehicle_code();
String priority = task.getPriority();
String startPointCode = task.getStart_point_code();
String startDeviceCode = task.getStart_device_code();
String routePlanCode = task.getRoute_plan_code();
String nextPointCode = task.getNext_point_code();
Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(routePlanCode);
@@ -679,9 +701,9 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("driver_type", "siemens_conveyor");
map.put("is_click", true);
map.put("message", message);
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
map.put("notCreateTaskMessage", notCreateTaskMessage);
map.put("notCreateInstMessage", notCreateInstMessage);
map.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage));
map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
map.put("error", ErrorUtil.getDictDetail("bqhj_error_type", String.valueOf(this.getError())));
/*jo.put("x", xPosition);
jo.put("y", yPosition);*/
JSONObject jo = new JSONObject(map);

View File

@@ -627,7 +627,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("move", move);
map.put("action", action);
map.put("isOnline", this.getIsonline());
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
map.put("error", ErrorUtil.getDictDetail("bhhj_error_type", String.valueOf(this.getError())));
map.put("isError", this.getIserror());
map.put("message", message);
map.put("feedMessage", feedMessage);

View File

@@ -199,4 +199,6 @@ public interface AcsToWmsService {
* @return
*/
HttpResponse feedbackDies(JSONObject param);
String secondaryAllocationPoint(JSONObject param);
}

View File

@@ -637,6 +637,46 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
}
@Override
public String secondaryAllocationPoint(JSONObject param) {
try {
MDC.put(log_file_type, log_type);
log.info("applyTaskToWms-----输入参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("secondaryAllocationPoint");
String url = wmsurl + addressDto.getMethods_url();
HttpResponse result2 = null;
try {
result2 = HttpRequest.post(url)
.header("Authorization", token)
.body(String.valueOf(param))
.execute();
} catch (Exception e) {
String msg = e.getMessage();
log.info("applyTaskToWms-----输出参数{}", msg);
//网络不通
}
if(ObjectUtil.isEmpty(result2)){
log.info("applyTaskToWms-----输出参数{}", "返回结果为空");
return null;
}
String type = "";
if (result2.getStatus() == 200) {
type = "info";
} else {
type = "error";
}
log.info("applyTaskToWms-----输出参数{}", result2.body());
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()),
JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请捆扎、贴标");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return result2.body();
} finally {
MDC.remove(log_file_type);
}
}
@Override
public HttpResponse feedbackDies(JSONObject param) {
HttpResponse result2 = null;

View File

@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver;
@@ -94,6 +95,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
try {
MDC.put(log_file_type, log_type);
log.info("crateTask-----输入参数{}", param);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, param, "acs接收lms任务");
luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONArray datas = JSONArray.parseArray(param);
CreateTaskResponse response = new CreateTaskResponse();
// ParamService paramService = SpringContextHolder.getBean(ParamService.class);
@@ -492,7 +495,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
public PutActionResponse putAction(String jsonObject) throws Exception {
log.info("putAction--------------:输入参数" + jsonObject);
String date = new Date().toString();
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date+"LMS反馈ACS动作信号");
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "LMS反馈ACS动作信号");
luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
PutActionResponse response = new PutActionResponse();
@@ -504,51 +507,51 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String code = request.getCode();
String value = request.getValue();
Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) {
throw new Exception("未找到对应设备:" + device_code);
}
InflatableShaftLibraryDeviceDriver inflatableShaftLibraryDeviceDriver;
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
hongXiangStationDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
lampThreecolorDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
siemensConveyorDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
inflatableShaftLibraryDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code",code);
map.put("value",value);
list.add(map);
foldDiscSiteDeviceDriver.writing(list);
}
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
wasteFoilWeighingStationDriver.writing(code, value);
try {
Thread.sleep(1000); //休眠1秒
} catch (InterruptedException e) {
e.printStackTrace();
}
if (ObjectUtil.isEmpty(device)) {
throw new Exception("未找到对应设备:" + device_code);
}
InflatableShaftLibraryDeviceDriver inflatableShaftLibraryDeviceDriver;
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
BeltConveyorDeviceDriver beltConveyorDeviceDriver ;
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
hongXiangStationDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
lampThreecolorDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver=(BeltConveyorDeviceDriver) device.getDeviceDriver();
beltConveyorDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
inflatableShaftLibraryDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code", code);
map.put("value", value);
list.add(map);
foldDiscSiteDeviceDriver.writing(list);
}
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
wasteFoilWeighingStationDriver.writing(code, value);
try {
Thread.sleep(1000); //休眠1秒
} catch (InterruptedException e) {
e.printStackTrace();
}
}
response.setStatus(200);
}
response.setStatus(200);
response.setMessage("success");
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "putAction", String.valueOf(response.getCode()),
jsonObject, String.valueOf(response), "LMS下发动作");
@@ -561,7 +564,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
public Map<String, Object> putWeightAction(String jsonObject) throws Exception {
log.info("putWeightAction--------------:输入参数" + jsonObject);
String date = new Date().toString();
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date+"LMS反馈ACS废箔重量");
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "LMS反馈ACS废箔重量");
luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
JSONObject jo = new JSONObject();
@@ -622,7 +625,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
log.info("getTubeMes--------------:输入参数" + jsonObject);
String date = new Date().toString();
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date+"获取管芯信息");
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "获取管芯信息");
luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
JSONObject jo = new JSONObject();
@@ -721,7 +724,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("action", Math.min(3, blankManipulatorDeviceDriver.getAction()));
jo.put("task", Math.min(3, blankManipulatorDeviceDriver.getTask()));
jo.put("error", blankManipulatorDeviceDriver.getError());
}else if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
} else if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", parent_device_code);
jo.put("mode", hongXiangConveyorDeviceDriver.getMode());
@@ -831,7 +834,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("action", subvolumeWeighingStationDriver.getAction());
jo.put("weight", subvolumeWeighingStationDriver.getWeight());
jo.put("error", subvolumeWeighingStationDriver.getError());
}else if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
} else if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver();
jo.put("device_code", parent_device_code);
jo.put("move", foldDiscSiteDeviceDriver.getMove());
@@ -848,7 +851,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
resultJson.put("status", HttpStatus.OK.value());
resultJson.put("message", "操作成功");
resultJson.put("data", backja);
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"queryDevice", String.valueOf(resultJson.get("status")),
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "queryDevice", String.valueOf(resultJson.get("status")),
jsonObject, String.valueOf(resultJson), "LMS查询设备状态");
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
return resultJson;
@@ -878,5 +881,4 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
}
}

View File

@@ -41,7 +41,7 @@ public class ErrorUtil {
String en_label = dictDetailDto.getEn_label();
String in_label = dictDetailDto.getIn_label();
String zh_label = dictDetailDto.getZh_label();
if (StrUtil.equals(value, error_code)) {
if (StrUtil.equals(value, error_code) && ObjectUtil.isNotEmpty(language)) {
if (language.contains("zh")){
detail = zh_label;
break;
@@ -54,7 +54,10 @@ public class ErrorUtil {
detail = en_label;
break;
}
if(StrUtil.isEmpty(language)){
detail = en_label;
break;
}
}
}
}

View File

@@ -34,211 +34,215 @@ import java.io.Serializable;
public class InstructionMybatis extends CommonModel<InstructionMybatis> implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String instruction_id;
private String task_id;
@NotBlank
private String instruction_code;
private String link_num;
private String execute_device_code;
private String execute_status;
private String execute_status_description;
private String follow_device_code;
@NotBlank
private String compound_inst;
private String compound_inst_data;
private String material;
@NotNull
private BigDecimal quantity;
private String instruction_type;
private String instruction_status;
private String create_type;
private String finish_type;
private String priority;
private String execute_code;
private String execute_message;
private String start_point_code;
private String start_device_code;
private String start_point_code2;
private String start_device_code2;
private String next_point_code;
private String next_device_code;
private String next_point_code2;
private String next_device_code2;
private String put_point_code;
private String put_device_code;
private String task_code;
private String vehicle_code;
private String vehicle_type;
private String from_x;
private String from_y;
private String from_z;
private String from_x2;
private String from_y2;
private String from_z2;
private String put_x;
private String put_y;
private String put_z;
private String to_x;
private String to_y;
private String to_z;
private String to_x2;
private String to_y2;
private String to_z2;
private String last_instruction_id;
@NotBlank
private String can_modify;
private String remark;
@NotBlank
private String is_active;
@NotBlank
private String is_delete;
@NotBlank
@TableField(fill = FieldFill.INSERT)
private String create_by;
@NotBlank
@TableField(fill = FieldFill.INSERT)
private String create_time;
@TableField(fill = FieldFill.INSERT_UPDATE)
private String update_by;
@TableField(fill = FieldFill.INSERT_UPDATE)
private String update_time;
private String carno;
private String agv_jobno;
private String send_status;
private String weight;
private String route_plan_code;
private String emptypallet_num;
private String agv_inst_type;
private String agv_system_type;
private Integer agv_action_type;
public void copyFrom(Instruction source) {
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@@ -365,6 +365,12 @@ public class InstructionDto implements Serializable {
private String to_device_code;
/**
* agv二次分配类型1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配
*/
private Integer agv_action_type;
/**
*
*/

View File

@@ -516,7 +516,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
// } else
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
String interactionJson = task.getInteraction_json();
if (StrUtil.isNotEmpty(interactionJson)){
if (StrUtil.isEmpty(interactionJson)){
throw new BadRequestException("agv叉车调整长宽参数为空");
}
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
@@ -562,6 +562,16 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (regional(dto.getStart_device_code(), dto.getNext_device_code())) {
throw new BadRequestException(LangProcess.msg("error_regional_max"));
}
String start_device_code = dto.getStart_device_code();
if (StrUtil.isNotEmpty(dto.getTask_code())) {
List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class)
.eq(InstructionMybatis::getTask_code, dto.getTask_code()));
if (CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code()
.equals(start_device_code))) {
return;
}
}
String currentUsername = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
if (StrUtil.isEmpty(dto.getRoute_plan_code())) {
@@ -582,14 +592,22 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (StrUtil.isEmpty(dto.getLink_num())) {
dto.setIs_send(task.getLink_num());
}
if (task.getTask_type().equals(CommonFinalParam.ONE) || "2".equals(task.getTask_type())) {
dto.setInstruction_type(task.getTask_type());
} else if (false) {
} else {
dto.setInstruction_type("3");
}
// if (task.getTask_type().equals(CommonFinalParam.ONE) || task.getTask_type().equals("2")) {
dto.setInstruction_type(task.getTask_type());
// } else if (false) {
//
// } else {
// dto.setInstruction_type("3");
// }
// 查询是否存在相同指令号
// if (!StrUtil.isEmpty(dto.getVehicle_code() )) {
// Instruction inst_dto = findByContainer(dto.getVehicle_code());
// if (inst_dto != null) {
// log.error("存在相同载具号任务,载具号"+dto.getVehicle_code());
// throw new BadRequestException("存在相同载具号任务!");
// }
// }
// 起点设备与终点设备相同则为初始指令
if (StrUtil.equals(task.getStart_device_code(), dto.getStart_device_code())) {
if (!StrUtil.equals(dto.getCompound_inst(), "0")
@@ -598,12 +616,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
dto.setCompound_inst_data(task.getCompound_task_data());
}
}
if (StringUtils.isNotBlank(currentUsername)) {
dto.setCreate_by(currentUsername);
}
if (StringUtils.isNotBlank(currentUsername)) {
dto.setUpdate_by(currentUsername);
}
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setUpdate_time(now);
dto.setCreate_time(now);
dto.setStart_parent_code(task.getStart_parent_code());
@@ -615,7 +629,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device startdevice = appService.findDeviceByCode(dto.getStart_device_code());
Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code());
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
@@ -626,7 +639,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
}
try {
String start_device_code = dto.getStart_device_code();
/*String start_device_code = dto.getStart_device_code();*/
String next_device_code = dto.getNext_device_code();
String route_plan_code = task.getRoute_plan_code();
List<RouteLineDto> shortPathsList =
@@ -645,26 +658,44 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (ObjectUtil.isEmpty(route) && !(start_device_code.equals(next_device_code))) {
throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
}
if (StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
if (!StrUtil.equals(task.getAgv_system_type(), "0")
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
} else {
Resp resp = acsToLiKuService.sendInst(task.getStorage_task_type(), dto);
if (StrUtil.equals(resp.result, "true")) {
dto.setSend_status("1");
} else {
//判断是否是仙工AGV
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
String interactionJson = task.getInteraction_json();
if (StrUtil.isEmpty(interactionJson)){
throw new BadRequestException("agv叉车调整长宽参数为空");
}
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
//仙工叉车
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto,interactionJsonDTO);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
} else if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
//一楼agv任务创建运单序列
HttpResponse response = xiangGongAgvService.sendOrderSequencesToXZ(dto);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
}
}
} catch (Exception e) {
dto.setSend_status("2");
e.printStackTrace();
log.error(e.getMessage());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("创建指令报错")
.content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build();
logDto.setLog_level(2);
luceneExecuteLogService.deviceExecuteLog(logDto);
throw e;
}
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class);
instructionMapper.insert(entity);
instructions.add(dto);

View File

@@ -240,6 +240,10 @@ public class Task extends CommonModel<Task> implements Serializable {
private String interaction_json;
private Integer agv_action_type;
public void copyFrom(Task source) {
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@@ -0,0 +1,35 @@
package org.nl.acs.task.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ActionTypeEnum {
/**
* 取货二次分配
*/
IN_STOCK(1, "取货二次分配"),
/**
* 防货二次分配
*/
OUT_STOCK(2, "防货二次分配"),
/**
* 取货完成
*/
IN_FINISHING(3, "取货完成");
Integer code;
String status;
public static String getStatus(Integer code) {
for (ActionTypeEnum value : values()) {
if (value.code.equals(code)) {
return value.status;
}
}
return null;
}
}

View File

@@ -0,0 +1,39 @@
package org.nl.acs.task.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum AgvActionTypeEnum {
/**
* 普通任务
*/
ORDINARY(1, "普通任务"),
/**
* 取货二次分配
*/
IN_STOCK(2, "取货二次分配"),
/**
* 防货二次分配
*/
OUT_STOCK(3, "防货二次分配"),
/**
* 取放货二次分配
*/
IN_OUT_STOCK(4, "取放货二次分配");
Integer code;
String status;
public static String getStatus(Integer code) {
for (AgvActionTypeEnum value : values()) {
if (value.code.equals(code)) {
return value.status;
}
}
return null;
}
}

View File

@@ -349,4 +349,10 @@ public class TaskDto implements Serializable {
* 是否拔轴 0/1
*/
private String is_pulling;
/**
* agv二次分配类型1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配
*/
private Integer agv_action_type;
}

View File

@@ -42,6 +42,7 @@ import org.nl.acs.route.domain.RoutePlan;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.route.service.mapper.RoutePlanMapper;
import org.nl.acs.task.enums.AgvSystemTypeEnum;
import org.nl.acs.task.enums.TaskStatusEnum;
import org.nl.acs.task.enums.TaskTypeEnum;
import org.nl.acs.task.service.TaskFeedbackService;
@@ -839,7 +840,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
//反馈上位系统任务状态
this.feedWmsTaskStatus(entity);
//关闭仙工运单序列
this.markComplete(entity);
if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
this.markComplete(entity);
}
}
@Override
@@ -868,7 +871,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
//反馈上位系统任务状态
this.feedWmsTaskStatus(entity);
//关闭仙工运单序列
this.markComplete(entity);
if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
this.markComplete(entity);
}
}
@@ -901,6 +906,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
String next_point_code2 = acsTask.getNext_point_code2();
String agv_system_type = acsTask.getAgv_system_type();
String task_type = acsTask.getTask_type();
String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height();
/** 开始平均分解校验 */
String this_device_code =
this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
@@ -962,31 +969,37 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
instdto.setNext_device_code2(next_point_code2);
instdto.setNext_point_code2(next_point_code2);
instdto.setAgv_system_type(agv_system_type);
instdto.setAgv_inst_type(CommonFinalParam.ONE);
instdto.setStart_height(start_height);
instdto.setNext_height(next_height);
if (!StrUtil.equals(agv_system_type, "1")) {
//判断agv系统
//1、1楼叉车系统
//2、2楼1区域AGV系统
//3、2楼2区域AGV系统 -已废弃
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
// task_type
// 1、生箔 Itype=1:取空,取满,放空,放满;
// 2、分切 Itype=3取满、取空、放满、放空
// 3、普通任务 Itype=2:取货、放货;
// 4、叉车任务
// 5、输送任务
// 6、行架
// 7、立库
if (StrUtil.equals(task_type, "1")) {
instdto.setAgv_inst_type("1");
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type());
}
} else {
instdto.setAgv_inst_type("4");
}
instructionservice.create2(instdto);
acsTask.setTask_status(CommonFinalParam.ONE);
this.update(acsTask);
return instdto;
@@ -1634,23 +1647,10 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
*/
private void markComplete(TaskDto taskDto) {
// 如果属于先知AGV关闭运单序列
List<RouteLineDto> shortPathsList =
routeLineService.getShortPathLines(
taskDto.getStart_device_code(),
taskDto.getNext_device_code(),
taskDto.getRoute_plan_code());
if (ObjectUtil.isNotEmpty(shortPathsList)) {
String type = shortPathsList.get(0).getType();
// != 0 为agv任务
if (!StrUtil.equals(type, "0")) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) {
try {
agvService.markComplete(taskDto.getTask_code());
} catch (Exception e) {
log.error("关闭运单异常,原因:{}", e.getMessage());
}
}
}
try {
agvService.markComplete(taskDto.getTask_code());
} catch (Exception e) {
log.error("关闭运单异常,原因:{}", e.getMessage());
}
}

View File

@@ -19,7 +19,6 @@ public class InitLocaleResolver implements LocaleResolver {
if (StringUtils.isNotEmpty(header)){
String lang = Language_Country.get(header);
language = lang;
System.out.println("lang的值为"+lang);
if (StringUtils.isNotEmpty(lang)){
String[] l = lang.split("-");
//印尼的ISO标准国家代码为id-ID

View File

@@ -153,6 +153,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
dic.setPara1(dict.getPara1());
dic.setPara2(dict.getPara2());
dic.setPara3(dict.getPara3());
dic.setZh_label(dict.getZh_label());
dic.setEn_label(dict.getEn_label());
dic.setIn_label(dict.getIn_label());
sysDictMapper.updateById(dic);
return;
}

View File

@@ -86,6 +86,7 @@ public class AutoCreateInst {
String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height();
Integer agvActionType = acsTask.getAgv_action_type();
if (StrUtil.equals(is_send, "0")) {
@@ -158,6 +159,7 @@ public class AutoCreateInst {
instdto.setAgv_system_type(agv_system_type);
instdto.setStart_height(start_height);
instdto.setNext_height(next_height);
instdto.setAgv_action_type(agvActionType);
//判断agv系统
//1、1楼叉车系统
//2、2楼1区域AGV系统

View File

@@ -57,11 +57,13 @@ universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307
universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4!
universal_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\u4E3A\u7A7A!
universal_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A!
universal_notCreateInstMessage9=\u63D2\u62D4\u8F74\u5DE5\u4F4D\u6761\u4EF6\u4E0D\u6EE1\u8DB3\uFF0C\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E
universal_actionMessage2=\u5141\u8BB8\u53D6\u653E
universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00
universal_actionMessage4=\u8BF7\u6C42\u52A8\u4F5C\u5DF2\u590D\u4F4D
universal_actionMessage5=\u8BF7\u6C42\u52A8\u4F5C\u672A\u590D\u4F4D
universal_directives=\u6307\u4EE4

View File

@@ -54,6 +54,7 @@ universal_notCreateInstMessage3=The device is in standby mode or is not allowed
universal_notCreateInstMessage4=ddj interface bit is in stock, cannot generate command!
universal_notCreateInstMessage5=Instructions with the same route exist!
universal_notCreateInstMessage6=The next device is not a conveyor line directive!
universal_notCreateInstMessage9=The plugging and unplugging shaft station conditions are not met, and the instruction cannot be generated!
universal_actionMessage1=Pick-and-place is not permitted
universal_actionMessage2=Pick-and-place is allowed
universal_actionMessage3=Permission to leave
@@ -61,5 +62,6 @@ universal_actionMessage4=The request action has been reset
universal_actionMessage5=The request action is not reset
universal_notCreateInstMessage7=ray type is empty!
universal_notCreateInstMessage8=The barcode is blank\uFF01
universal_directives=Directives

View File

@@ -54,6 +54,7 @@ universal_notCreateInstMessage3=Siaga perangkat atau tidak diizinkan masuk
universal_notCreateInstMessage4=DDJ mendarat di dok, tidak ada perintah yang diberikan!
universal_notCreateInstMessage5=Ada instruksi tentang rute yang sama!
universal_notCreateInstMessage6=Perangkat berikutnya bukan arahan jalur konveyor!
universal_notCreateInstMessage9=Kondisi stasiun poros penyumbatan dan pencabutan tidak terpenuhi, dan instruksi tidak dapat dibuat!
universal_actionMessage1=Pick-and-place tidak diizinkan
universal_actionMessage2=Pick-and-place diperbolehkan
universal_actionMessage3=Izin untuk pergi
@@ -61,3 +62,4 @@ universal_actionMessage4=Tindakan permintaan telah disetel ulang
universal_actionMessage5=Tindakan permintaan tidak disetel ulang
universal_notCreateInstMessage7=ponypianmereka yang kosong!
universal_notCreateInstMessage8=Kode batang kosong!
universal_directives=Arahan

View File

@@ -59,8 +59,9 @@ universal_notCreateInstMessage3=\u8BBE\u5907\u5F85\u673A\u6216\u4E0D\u5141\u8BB8
universal_notCreateInstMessage4=ddj\u5BF9\u63A5\u4F4D\u6709\u8D27,\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307\u4EE4!
universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4!
universal_notCreateInstMessage9=\u63D2\u62D4\u8F74\u5DE5\u4F4D\u6761\u4EF6\u4E0D\u6EE1\u8DB3\uFF0C\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\u4E3A\u7A7A!
universal_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A!
universal_directives=\u6307\u4EE4

View File

@@ -66,6 +66,9 @@ export default {
'photoelectric_signal': 'photoelectric signal',
'mode': 'mode',
'alarm': 'alarm',
'last_mission_number': 'Last Mission Number',
'the_subvolume_number': 'The Subvolume Number',
'pallet_type': 'Pallet Type',
'ip_address': 'IP',
'pallet_quantity': 'Pallet quantity',
'instruction_information': 'instruction information',

View File

@@ -64,6 +64,9 @@ export default {
'device_name': 'nama divais',
'exception_message': 'pesan yang tidak biasa',
'photoelectric_signal': 'Sinyal fotolistrik',
'last_mission_number': 'Nomor misi terakhir',
'the_subvolume_number': 'Nomor Subvolume',
'pallet_type': 'Jenis Palet',
'mode': 'pola',
'alarm': 'polisi',
'ip_address': 'IP',

View File

@@ -98,6 +98,9 @@ export default {
'task_number': '任务号',
'command': '动作',
'disable': '是否禁用',
'last_mission_number': '上次任务号',
'the_subvolume_number': '子卷编号',
'pallet_type': '托盘类型',
'current_temperature': '当前温度',
'oven_finish': '烘箱完成',
'house': '恒温倒计时-时',

View File

@@ -1,5 +1,5 @@
<template>
<!--检测站点-->
<!--纸管抓取位-->
<div>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
@@ -30,6 +30,7 @@
v-model="plc_id"
placeholder="无"
clearable
filterable
@change="changePlc"
>
<el-option
@@ -131,8 +132,8 @@
</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 label="是否需要光电" label-width="150px">
<el-switch v-model="form.input_move" />
</el-form-item>
</el-col>
</el-row>
@@ -221,6 +222,14 @@
/>
</template>
</el-table-column>
<el-table-column prop="dbr_value2">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
</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>
@@ -432,6 +441,15 @@ export default {
console.log(err.response.data.message)
})
},
test_read2() {
testRead(this.data2, this.opc_id).then(data => {
this.data2 = data
console.log(this.data2)
this.notify('操作成功!', 'success')
}).catch(err => {
console.log(err.response.data.message)
})
},
test_write1() {
testwrite(this.data2, this.opc_id).then(data => {
this.notify('操作成功!', 'success')

View File

@@ -50,6 +50,20 @@
<el-option v-for="item in regions" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="是否配置">
<el-select
v-model="query.is_config"
clearable
filterable
size="small"
placeholder="是否配置"
class="filter-item"
style="width: 200px"
@change="crud.toQuery"
>
<el-option v-for="item in is_configs" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
@@ -259,6 +273,7 @@ export default {
device_types: [],
uploadShow: false,
regions: [],
is_configs: [],
rules: {
device_code: [
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
@@ -282,6 +297,10 @@ export default {
get('region_type').then(data => {
this.regions = data.content
})
// 是否
get('TrueOrFalse').then(data => {
this.is_configs = data.content
})
})
},
methods: {

View File

@@ -209,6 +209,7 @@
v-model="form.start_point_code"
style="width: 370px;"
filterable
clearable
:placeholder="$t('task.select.Placeholder')"
@change="showStartStorage"
>
@@ -257,6 +258,7 @@
v-model="form.next_point_code"
style="width: 370px;"
filterable
clearable
:placeholder="$t('task.select.Placeholder')"
@change="showEndStorage"
>
@@ -312,6 +314,7 @@
v-model="form.start_point_code2"
style="width: 370px;"
filterable
clearable
:placeholder="$t('task.select.Placeholder')"
>
<el-option
@@ -359,6 +362,7 @@
v-model="form.next_point_code2"
style="width: 370px;"
filterable
clearable
:placeholder="$t('task.select.Placeholder')"
>
<el-option
@@ -502,7 +506,7 @@
<el-table-column prop="next_point_code" :label="$t('task.select.Delivery_point')" :min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point'))" />
<el-table-column prop="start_point_code2" :label="$t('task.select.Start_point2')" :min-width="flexWidth('start_point_code2',crud.data,$t('task.select.Start_point2'))" />
<el-table-column prop="next_point_code2" :label="$t('task.select.Destination2')" :min-width="flexWidth('next_point_code2',crud.data,$t('task.select.Destination2'))" />
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" show-overflow-tooltip="true":show-overflow-tooltip="true" width="150px" />
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" show-overflow-tooltip="true" width="150px" />
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))" />
<el-table-column prop="remark" :label="$t('task.select.Remark')" :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))" />
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />

View File

@@ -21,6 +21,16 @@
</div>
</div>
<!--表单组件-->
<!-- <el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-upload2"
size="mini"
@click="uploadShow = true"
>
{{ $t('auto.common.import') }}
</el-button> -->
<el-dialog
append-to-body
:close-on-click-modal="false"
@@ -33,13 +43,13 @@
<el-form-item :label="$t('dict.other.Department_label')" prop="label">
<el-input v-model="form.label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Department_label_zh')" prop="label">
<el-form-item :label="$t('dict.other.Department_label_zh')" prop="zh_label">
<el-input v-model="form.zh_label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Department_label_en')" prop="label">
<el-form-item :label="$t('dict.other.Department_label_en')" prop="en_label">
<el-input v-model="form.en_label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Department_label_in')" prop="label">
<el-form-item :label="$t('dict.other.Department_label_in')" prop="in_label">
<el-input v-model="form.in_label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Dictionary_value')" prop="value">
@@ -116,7 +126,9 @@ import rrOperation from '@crud/RR.operation'
import udOperation from '@crud/UD.operation'
import i18n from '@/i18n'
const defaultForm = { dict_id: null, name: null, label: null, value: null, dict_sort: null, dictType: null, para1: null, para2: null, para3: null, createId: null, createName: null, createTime: null, updateId: null, updateName: null, updateTime: null }
const defaultForm = { dict_id: null, name: null, label: null, value: null, dict_sort: null, dictType: null, para1: null,
para2: null, para3: null, createId: null, createName: null, createTime: null, updateId: null, updateName: null,
updateTime: null, zh_label: null, in_label: null, en_label: null }
export default {
components: { pagination, rrOperation, udOperation },

View File

@@ -138,6 +138,12 @@
<el-radio-button :label="1">{{ $t('auto.common.true') }}</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="申请指令标记" prop="requireActionSucess" label-width="120px">
<el-radio-group v-model="form.requireActionSucess">
<el-radio-button :label="0"> {{ $t('auto.common.false') }}</el-radio-button>
<el-radio-button :label="1">{{ $t('auto.common.true') }}</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible7 = false">{{ $t('auto.common.Cancel') }}</el-button>
@@ -406,13 +412,18 @@ export default {
}
this.Stages.push(tempObject)
}
if (this.language === 'in') {
if (i18n.locale === 'in') {
const tempObject = {
'stage_name': data[i].in_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
/* const tempObject = {
'stage_name': data[i].in_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject) */
}
console.log(this.Stages)
})
@@ -459,11 +470,6 @@ export default {
} else if (clickObj.data.driver_type === 'slit_two_manipulator') {
this.dialogFormVisible4 = true
} else if (clickObj.data.driver_type === 'siemens_conveyor') {
// if (clickObj.data.device_name.includes('1016')) {
// this.dialogFormVisible7 = true
// } else {
// this.dialogFormVisible5 = true
// }
this.dialogFormVisible7 = true
} else if (clickObj.data.driver_type === 'siemens_conveyor_ckk') {
this.dialogFormVisible7 = true
@@ -563,7 +569,7 @@ export default {
const obj = { name: i18n.t('monitor.click.last_instruction_message'), value: data[val] }
this.arr.push(obj)
} else if (val === 'container_type') {
const obj = { name: '托盘类型', value: data[val] }
const obj = { name: i18n.t('monitor.click.pallet_type'), value: data[val] }
this.arr.push(obj)
} else if (val === 'barcode') {
const obj = { name: i18n.t('monitor.click.barcode'), value: data[val] }
@@ -656,7 +662,7 @@ export default {
const obj = { name: i18n.t('monitor.click.task_number'), value: data[val] }
this.arr.push(obj)
} else if (val === 'last_task') {
const obj = { name: '上次任务号', value: data[val] }
const obj = { name: i18n.t('monitor.click.last_mission_number'), value: data[val] }
this.arr.push(obj)
} else if (val === 'is_disable') {
const obj = { name: i18n.t('monitor.click.disable'), value: data[val] }
@@ -706,6 +712,9 @@ export default {
} else if (val === 'hand_barcode') {
const obj = { name: '补码信息', value: data[val] }
this.arr.push(obj)
} else if (val === 'hand_barcode1') {
const obj = { name: i18n.t('monitor.click.the_subvolume_number'), value: data[val] }
this.arr.push(obj)
} else if (val === 'x') {
const obj = { name: 'X', value: data[val] }
this.arr.push(obj)

View File

@@ -5683,9 +5683,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
//如果为返检出库或者改切出库删除对应的包装关系
JSONArray dis_rows = new JSONArray();
if (jo_mst.getString("is_overdue").equals("1")) {
dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0);
dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0' and box_no = '"+jsonSub.getString("package_box_sn")+"'").getResultJSONArray(0);
} else {
dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and box_no = '"+jsonSub.getString("package_box_sn")+"'").getResultJSONArray(0);
}
for (int j = 0; j < dis_rows.size(); j++) {