Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzhiqiang
2023-01-04 11:49:00 +08:00
16 changed files with 227 additions and 68 deletions

View File

@@ -15,6 +15,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
@@ -81,12 +82,12 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
public int error1 = 0; public int error1 = 0;
public int material = 0; public int material = 0;
public int consumption = 0; public int consumption = 0;
public int voltageA = 0; public float voltageA = 0;
public int voltageB = 0; public float voltageB = 0;
public int voltageC = 0; public float voltageC = 0;
public int currentA = 0; public float currentA = 0;
public int currentB = 0; public float currentB = 0;
public int currentC = 0; public float currentC = 0;
public int last_heartbeat = 0; public int last_heartbeat = 0;
public int last_mode = 0; public int last_mode = 0;
@@ -103,12 +104,12 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
public int last_error1 = 0; public int last_error1 = 0;
public int last_material = 0; public int last_material = 0;
public int last_consumption = 0; public int last_consumption = 0;
public int last_voltageA = 0; public float last_voltageA = 0;
public int last_voltageB = 0; public float last_voltageB = 0;
public int last_voltageC = 0; public float last_voltageC = 0;
public int last_currentA = 0; public float last_currentA = 0;
public int last_currentB = 0; public float last_currentB = 0;
public int last_currentC = 0; public float last_currentC = 0;
Boolean isonline = true; Boolean isonline = true;
@@ -132,6 +133,9 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
String message = null; String message = null;
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
if (device_code.equals("A1_HK_05_1")){
System.out.println("1");
}
heartbeat = this.itemProtocol.getItem_heartbeat(); heartbeat = this.itemProtocol.getItem_heartbeat();
mode = this.itemProtocol.getItem_mode(); mode = this.itemProtocol.getItem_mode();
move = this.itemProtocol.getItem_move(); move = this.itemProtocol.getItem_move();
@@ -155,14 +159,20 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
currentC = this.itemProtocol.getItem_currentC(); currentC = this.itemProtocol.getItem_currentC();
if (mode != last_mode) { if (mode != last_mode) {
this.setRequireSucess(false); //this.setRequireSucess(false);
} }
if (move != last_move) { if (move != last_move) {
if (move == 0) { if (move == 0) {
thingToNothing(); thingToNothing();
} }
} }
if (error != last_error) { if (finish != last_finish) {
if (finish == 1) {
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess);
requireSucess = false;
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireSucess:" + requireSucess);
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_finish + "->" + finish);
} }
@@ -174,10 +184,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
} else { } else {
if (move == 0 && last_move == 1) { if (move == 0 && last_move == 1) {
requireSucess = false; //requireSucess = false;
} }
if (finish == 1 && last_finish == 0 && !requireSucess) { if (finish == 1 && !requireSucess) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "开始烘箱完成反馈lms~");
//烘箱完成反馈LMS //烘箱完成反馈LMS
apply_finish(); apply_finish();
} }
@@ -207,7 +218,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
protected void thingToNothing() { protected void thingToNothing() {
this.setRequireSucess(false); //this.setRequireSucess(false);
} }
public void writing(int command) { public void writing(int command) {
@@ -333,8 +344,13 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
} }
applyLabelingAndBindingRequest.setDevice_code(start_point_code); applyLabelingAndBindingRequest.setDevice_code(start_point_code);
applyLabelingAndBindingRequest.setType("3"); applyLabelingAndBindingRequest.setType("3");
acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
requireSucess = true; if (applyLabelingAndBindingResponse.getstatus() == 200) {
requireSucess = true;
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "烘箱完成反馈lms响应消息:" + String.valueOf(applyLabelingAndBindingResponse));
} else {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "烘箱完成反馈lms响应消息:" + String.valueOf(applyLabelingAndBindingResponse));
}
return true; return true;
} }
} }

View File

@@ -99,23 +99,23 @@ public class ItemProtocol {
public int getItem_consumption(){ public int getItem_consumption(){
return this.getOpcIntegerValue(item_consumption); return this.getOpcIntegerValue(item_consumption);
} ; } ;
public int getItem_voltageA(){ public float getItem_voltageA(){
return this.getOpcIntegerValue(item_voltageA); return this.getOpcFloatValue(item_voltageA);
} ; } ;
public int getItem_voltageB(){ public float getItem_voltageB(){
return this.getOpcIntegerValue(item_voltageB); return this.getOpcFloatValue(item_voltageB);
} ; } ;
public int getItem_voltageC(){ public float getItem_voltageC(){
return this.getOpcIntegerValue(item_voltageC); return this.getOpcFloatValue(item_voltageC);
} ; } ;
public int getItem_currentA(){ public float getItem_currentA(){
return this.getOpcIntegerValue(item_currentA); return this.getOpcFloatValue(item_currentA);
} ; } ;
public int getItem_currentB(){ public float getItem_currentB(){
return this.getOpcIntegerValue(item_currentB); return this.getOpcFloatValue(item_currentB);
} ; } ;
public int getItem_currentC(){ public float getItem_currentC(){
return this.getOpcIntegerValue(item_currentC); return this.getOpcFloatValue(item_currentC);
} ; } ;
Boolean isonline; Boolean isonline;
@@ -132,6 +132,18 @@ public class ItemProtocol {
} }
public float getOpcFloatValue(String protocol) {
Float value = this.driver.getDoubleValue(protocol);
if (value == null) {
setIsonline(false);
} else {
setIsonline(true);
return value;
}
return 0;
}
public static List<ItemDto> getReadableItemDtos() { public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "251")); list.add(new ItemDto(item_heartbeat, "心跳", "251"));

View File

@@ -184,7 +184,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); //hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
if (hongXiangConveyorDeviceDriver.getMode() == 1 && hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) { if (hongXiangConveyorDeviceDriver.getMode() == 1 && hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
this.writing("to_command", "2"); this.writing("to_command", "2");
this.setNow_steps_type(3); this.setNow_steps_type(3);
@@ -232,7 +232,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); //hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
if (hongXiangConveyorDeviceDriver.getMode() == 1 && hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) { if (hongXiangConveyorDeviceDriver.getMode() == 1 && hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
this.writing("to_command", "4"); this.writing("to_command", "4");
this.setNow_steps_type(5); this.setNow_steps_type(5);
@@ -499,11 +499,17 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
this.writing("to_target", next_addr); this.writing("to_target", next_addr);
this.writing("to_task", instdto.getInstruction_code()); this.writing("to_task", instdto.getInstruction_code());
this.writing("to_command", "1"); this.writing("to_command", "1");
// HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
// if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
// hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
// hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
// } hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
}
if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver){
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
}
this.setNow_steps_type(2); this.setNow_steps_type(2);
this.setRequireSucess(true); this.setRequireSucess(true);
notCreateInstMessage = ""; notCreateInstMessage = "";

View File

@@ -61,6 +61,10 @@ public interface OpcDeviceDriver extends DeviceDriver {
return (Integer) this.getValue(protocol); return (Integer) this.getValue(protocol);
} }
default Float getDoubleValue(String protocol) {
return (Float) this.getValue(protocol);
}
default int[] getIntegeregerArrayValue(String protocol) { default int[] getIntegeregerArrayValue(String protocol) {
return (int[]) this.getOpcValueAccessor().getValue(this.getItem(protocol)); return (int[]) this.getOpcValueAccessor().getValue(this.getItem(protocol));
} }

View File

@@ -336,9 +336,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public JSONObject deviceApply(JSONObject whereJson) { public JSONObject deviceApply(JSONObject whereJson) {
String vehicle_code = whereJson.getString("vehicle_code"); String vehicle_code = whereJson.getString("vehicle_code");
String type = whereJson.getString("type"); String type = whereJson.getString("type");
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("木箱码不能为空!");
}
if (StrUtil.isEmpty(type)) { if (StrUtil.isEmpty(type)) {
throw new BadRequestException("任务类型不能为空!"); throw new BadRequestException("任务类型不能为空!");
} }
@@ -347,11 +344,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("status", HttpStatus.OK.value()); result.put("status", HttpStatus.OK.value());
result.put("message", "反馈成功!"); result.put("message", "反馈成功!");
JSONObject sub_jo = WQLObject.getWQLObject("").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到该木箱对应的包装关系!");
}
if (type.equals("1")) { if (type.equals("1")) {
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("木箱码不能为空!");
}
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到该木箱对应的包装关系!");
}
//贴标申请 //贴标申请
String print_type = sub_jo.getString("print_type"); String print_type = sub_jo.getString("print_type");
if (StrUtil.isEmpty(print_type)) { if (StrUtil.isEmpty(print_type)) {
@@ -375,6 +375,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
print_jo.put("print_type", print_info.getString("print_id")); print_jo.put("print_type", print_info.getString("print_id"));
printService.customerPrint(print_jo); printService.customerPrint(print_jo);
} else if (type.equals("2")) { } else if (type.equals("2")) {
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("木箱码不能为空!");
}
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到该木箱对应的包装关系!");
}
//捆扎申请 //捆扎申请
String box_length = sub_jo.getString("box_length"); String box_length = sub_jo.getString("box_length");
String box_width = sub_jo.getString("box_width"); String box_width = sub_jo.getString("box_width");

View File

@@ -651,7 +651,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public JSONObject childRollCutStartComp(JSONArray param) { public JSONObject childRollCutStartComp(JSONArray param) {
log.info("childRollCutStartComp接口输入参数为-------------------" + param.toString()); log.info("childRollCutStartComp接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
@@ -734,13 +733,15 @@ public class MesToLmsServiceImpl implements MesToLmsService {
String point_code = ""; String point_code = "";
//分切机上只存在一个气涨轴,下一分切组存在两个气涨轴,执行一个进站 //分切机上只存在一个气涨轴,下一分切组存在两个气涨轴,执行一个进站
if (ObjectUtil.isEmpty(up_rows)) { if (ObjectUtil.isEmpty(up_rows)) {
point_code = down_point_code; point_code = up_point_code;
} }
if (ObjectUtil.isEmpty(down_rows)) { if (ObjectUtil.isEmpty(down_rows)) {
point_code = up_point_code; point_code = down_point_code;
} }
//查询当前输送线上可用的气涨轴 //查询当前输送线上可用的气涨轴
JSONObject del_row = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("resource_name = '"+ResourceName+"' AND split_group = '"+group_jo.getString("split_group")+"' AND (parent_container_name = '"+group_jo.getString("source_container_name")+"' OR parent_container_name = '"+group_jo.getString("source_container_name")+"') AND status = '03'").uniqueResult(0); JSONObject del_row = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("resource_name = '"+ResourceName+"' AND split_group = '"+group_jo.getString("split_group")+"' AND (parent_container_name = '"+group_jo.getString("source_container_name")+"' OR parent_container_name = '"+group_jo.getString("source_container_name")+"') AND status = '03'").uniqueResult(0);
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("qzzno = '"+del_row.getString("qzzno")+"'").uniqueResult(0);
del_row.put("delivery_code",del_jo.getString("point_code"));
JSONObject whereJson = new JSONObject(); JSONObject whereJson = new JSONObject();
whereJson.put("point_code",point_code); whereJson.put("point_code",point_code);
whereJson.put("cut_rows",del_row); whereJson.put("cut_rows",del_row);

View File

@@ -183,7 +183,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
jsonDtl.put("source_bill_code", json.getString("VGBEL-VGPOS")); jsonDtl.put("source_bill_code", json.getString("VGBEL-VGPOS"));
jsonDtl.put("vbeln", json.getString("VBELN")); // 来源交货单 jsonDtl.put("vbeln", json.getString("VBELN")); // 来源交货单
jsonDtl.put("posnr", json.getString("POSNR")); // 来源交货单行 jsonDtl.put("posnr", json.getString("POSNR")); // 来源交货单行
jsonDtl.put("posnr", json.getString("POSNR")); // 幅宽 jsonDtl.put("width", json.getString("HL02")); // 幅宽
tableData.add(jsonDtl); tableData.add(jsonDtl);
} }
if (StrUtil.equals(lfart, "ZLR")) { if (StrUtil.equals(lfart, "ZLR")) {
@@ -258,6 +258,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
map.put("product_name", sub_jo.getString("product_name")); map.put("product_name", sub_jo.getString("product_name"));
map.put("vbeln", json.getString("VBELN")); map.put("vbeln", json.getString("VBELN"));
map.put("posnr", json.getString("POSNR")); map.put("posnr", json.getString("POSNR"));
map.put("width", json.getString("HL02"));
box_rows.add(map); box_rows.add(map);
} }
} }

View File

@@ -89,8 +89,8 @@ public class BakingServiceImpl implements BakingService {
jsonMap.put("flag", "1"); jsonMap.put("flag", "1");
jsonMap.put("product_area", jsonPointZc.getString("product_area")); jsonMap.put("product_area", jsonPointZc.getString("product_area"));
//获取温度幅度 //获取温度幅度
jsonMap.put("min_temperature", NumberUtil.sub(temperature, temperature_lose)); jsonMap.put("min_temperature", (NumberUtil.sub(temperature, temperature_lose)).toString());
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose)); jsonMap.put("max_temperature", (NumberUtil.add(temperature, temperature_lose)).toString());
jsonMap.put("point_location", jsonPointZc.getString("point_location")); jsonMap.put("point_location", jsonPointZc.getString("point_location"));
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0); JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有合适温度的空位!"); if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有合适温度的空位!");

View File

@@ -109,7 +109,7 @@ public class OutServiceImpl implements OutService {
//查询该分切机邻近位置的空载具的输送线点位 //查询该分切机邻近位置的空载具的输送线点位
JSONObject empty_vehicle = WQL.getWO("PDA_02") JSONObject empty_vehicle = WQL.getWO("PDA_02")
.addParam("sort_seq", cut_ivt.getString("sort_seq")) .addParam("sort_seq", cut_ivt.getString("sort_seq"))
.addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code") .addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code desc")
.addParam("product_area", cut_ivt.getString("product_area")) .addParam("product_area", cut_ivt.getString("product_area"))
.addParam("point_location", cut_ivt.getString("point_location")) .addParam("point_location", cut_ivt.getString("point_location"))
.addParam("flag", "3").process().uniqueResult(0); .addParam("flag", "3").process().uniqueResult(0);
@@ -129,18 +129,9 @@ public class OutServiceImpl implements OutService {
String ext_code = cut_ivt.getString("ext_code"); String ext_code = cut_ivt.getString("ext_code");
//查询该机台编号已经配送完成,套轴完成但是未完成的分切计划 //查询该机台编号已经配送完成,套轴完成但是未完成的分切计划
JSONObject slitting = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("resource_name = '" + ext_code + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND status = '03'").uniqueResult(0); JSONObject delivery_point = WQL.getWO("PDA_02").addParam("ext_code",ext_code).addParam("flag","16").process().uniqueResult(0);
if (ObjectUtil.isEmpty(slitting)) {
throw new BadRequestException("该分切机没有下一分切组配送完成的气涨轴!");
}
String qzzno = slitting.getString("qzzno");
//查询该气涨轴所在输送线位置
JSONObject delivery_point = WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").query("qzzno = '" + qzzno + "' AND point_status = '03'").uniqueResult(0);
if (ObjectUtil.isEmpty(delivery_point)) { if (ObjectUtil.isEmpty(delivery_point)) {
throw new BadRequestException("未查询到对应的输送线点位"); throw new BadRequestException("输送线不存在该分切机已经配送完成的气涨轴");
} }
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();

View File

@@ -53,7 +53,7 @@ public class ShippingServiceImpl implements ShippingService {
//查询离该分切计划包含机台最近的一个空载具 //查询离该分切计划包含机台最近的一个空载具
JSONObject empty_vehicle = WQL.getWO("PDA_02") JSONObject empty_vehicle = WQL.getWO("PDA_02")
.addParam("sort_seq", cut_jo.getString("sort_seq")) .addParam("sort_seq", cut_jo.getString("sort_seq"))
.addParam("sql_str", " ORDER BY abs("+cut_jo.getString("sort_seq")+"-sort_seq),point_code") .addParam("sql_str", " ORDER BY abs("+cut_jo.getString("sort_seq")+"-sort_seq),point_code desc")
.addParam("product_area", cut_jo.getString("product_area")) .addParam("product_area", cut_jo.getString("product_area"))
.addParam("point_location", cut_jo.getString("point_location")) .addParam("point_location", cut_jo.getString("point_location"))
.addParam("flag", "3").process().uniqueResult(0); .addParam("flag", "3").process().uniqueResult(0);

View File

@@ -25,6 +25,8 @@
输入.container_name TYPEAS s_string 输入.container_name TYPEAS s_string
输入.source_container_name TYPEAS s_string 输入.source_container_name TYPEAS s_string
输入.resource_name TYPEAS s_string 输入.resource_name TYPEAS s_string
输入.ext_code TYPEAS s_string
输入.find_type TYPEAS s_string
[临时表] [临时表]
@@ -469,6 +471,62 @@
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "16"
QUERY
SELECT
del.*
FROM
pdm_bi_slittingproductionplan plan
LEFT JOIN st_ivt_deliverypointivt del ON del.qzzno = plan.qzzno
WHERE
is_child_tz_ok = '1'
AND
is_child_ps_ok = '1'
AND
`status` = '03'
AND
del.point_status = '03'
OPTION 输入.ext_code <> ""
plan.resource_name = 输入.ext_code
ENDOPTION
order by del.point_code desc
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "17"
QUERY
SELECT
*
FROM
st_ivt_deliverypointivt ivt
WHERE
sort_seq = 输入.sort_seq
AND
product_area = 输入.product_area
AND
point_location = 输入.point_location
AND
point_code <> 输入.point_code
OPTION 输入.find_type = "1"
point_status <> '01'
ENDOPTION
OPTION 输入.find_type = "2"
point_status = '01'
ENDOPTION
AND NOT EXISTS (
SELECT
*
FROM
sch_base_task
WHERE
( point_code1 = ivt.point_code OR point_code2 = ivt.point_code )
AND task_status < '07'
AND is_delete = '0'
)
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -96,13 +96,39 @@ public class CutConveyorTask extends AbstractAcsTask {
// 校验终点是否存在 // 校验终点是否存在
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0); JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) { if (ObjectUtil.isEmpty(jsonIvt)) {
throw new BadRequestException("未找到可用点位:" + point_code2); throw new BadRequestException("未找到可用点位:" + point_code1);
} }
// 更新分切输送库存状态 // 更新分切输送库存状态
jsonIvt.put("point_status", "01"); jsonIvt.put("point_status", "01");
jsonIvt.put("qzzno", ""); jsonIvt.put("qzzno", "");
ivtTab.update(jsonIvt); ivtTab.update(jsonIvt);
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
char dtl_type = point_code1.charAt(point_code1.length() - 1);
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
String point_location = jsonIvt.getString("point_location");
String product_area = jsonIvt.getString("product_area");
String sort_seq = jsonIvt.getString("sort_seq");
JSONObject right_point = WQL.getWO("PDA_02")
.addParam("point_location", point_location)
.addParam("product_area", product_area)
.addParam("sort_seq", sort_seq)
.addParam("find_type", "1")
.addParam("flag", "17").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(right_point)) {
//创建载具横移任务
String translate_code1 = right_point.getString("point_code");
String translate_code2 = point_code1;
JSONObject tran_jo = new JSONObject();
tran_jo.put("point_code1",translate_code1);
tran_jo.put("point_code2",translate_code2);
tran_jo.put("vehicle_code",jsonTask.getString("vehicle_code"));
tran_jo.put("task_type","010406");
this.createTask(tran_jo);
}
}
} }
if (jsonTask.getString("task_type").equals("010402")) { if (jsonTask.getString("task_type").equals("010402")) {
// 校验终点是否存在 // 校验终点是否存在
@@ -141,6 +167,44 @@ public class CutConveyorTask extends AbstractAcsTask {
} }
} }
//判断输送进去的任务终点是否远离分切机,如果远离分切机且靠近分切机的点位上不存在载具且不存在任务进行载具横移
char dtl_type = point_code2.charAt(point_code1.length() - 1);
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
String point_location = jsonIvt.getString("point_location");
String product_area = jsonIvt.getString("product_area");
String sort_seq = jsonIvt.getString("sort_seq");
JSONObject left_point = WQL.getWO("PDA_02")
.addParam("point_location", point_location)
.addParam("product_area", product_area)
.addParam("sort_seq", sort_seq)
.addParam("find_type", "2")
.addParam("flag", "17").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(left_point)) {
//创建载具横移任务
String translate_code1 = point_code2;
String translate_code2 = left_point.getString("point_code");
JSONObject tran_jo = new JSONObject();
tran_jo.put("point_code1",translate_code1);
tran_jo.put("point_code2",translate_code2);
tran_jo.put("vehicle_code",jsonTask.getString("vehicle_code"));
tran_jo.put("task_type","010406");
this.createTask(tran_jo);
}
}
}
if (jsonTask.getString("task_type").equals("010406")){
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
JSONObject jsonIvt2 = ivtTab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
String point_status = jsonIvt.getString("point_status");
String qzzno = jsonIvt.getString("qzzno");
jsonIvt2.put("point_status", point_status);
jsonIvt2.put("qzzno", qzzno);
ivtTab.update(jsonIvt2);
jsonIvt.put("point_status", "01");
jsonIvt.put("qzzno", "");
ivtTab.update(jsonIvt);
} }
} }
} }

View File

@@ -324,8 +324,7 @@ public class CutTrussTask extends AbstractAcsTask {
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row); WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
} }
} }
this.immediateNotifyAcs(null);
return json.getString("task_id"); return json.getString("task_id");
} }

View File

@@ -294,7 +294,7 @@ public class InHotTask extends AbstractAcsTask {
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId()); json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE")); json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_type", "010203"); json.put("task_type", "010203");
json.put("task_status", "01"); json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("point_code1", form.getString("point_code1")); json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2")); json.put("point_code2", form.getString("point_code2"));
json.put("product_area", form.getString("product_area")); json.put("product_area", form.getString("product_area"));