嘉耐更新
This commit is contained in:
@@ -29,6 +29,7 @@ public class ItemProtocol {
|
||||
public static String item_production_time = "production_time";
|
||||
public static String item_error_time = "error_time";
|
||||
public static String item_order_No = "order_No";
|
||||
public static String item_order_qty = "order_qty";
|
||||
|
||||
public static String item_product_code = "product_code";
|
||||
public static String item_AlongSide = "AlongSide";
|
||||
@@ -155,6 +156,7 @@ public class ItemProtocol {
|
||||
public static String item_to_one_qty = "to_one_qty";
|
||||
public static String item_to_two_qty = "to_two_qty";
|
||||
public static String item_to_tool_coordinate = "to_tool_coordinate";
|
||||
public static String item_to_order_qty = "to_order_qty";
|
||||
|
||||
|
||||
private LnshPackagePalletManipulatorDeviceDriver driver;
|
||||
@@ -227,6 +229,10 @@ public class ItemProtocol {
|
||||
return this.getOpcStringValue(item_order_No);
|
||||
}
|
||||
|
||||
public int getOrder_qty() {
|
||||
return this.getOpcIntegerValue(item_order_qty);
|
||||
}
|
||||
|
||||
public int getProduct_code() {
|
||||
return this.getOpcIntegerValue(item_product_code);
|
||||
}
|
||||
@@ -719,6 +725,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_tool_coordinate);
|
||||
}
|
||||
|
||||
public int getToOrder_qty() {
|
||||
return this.getOpcIntegerValue(item_to_order_qty);
|
||||
}
|
||||
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
return move;
|
||||
@@ -835,7 +845,8 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_two_cribTotal, "2#垛总数", "DB1.W1166"));
|
||||
list.add(new ItemDto(item_one_qty, "1#垛当前数", "DB1.W1168"));
|
||||
list.add(new ItemDto(item_two_qty, "2#垛当前数", "DB1.W1170"));
|
||||
list.add(new ItemDto(item_tool_coordinate, "工具坐标", "DB1.D1172"));
|
||||
list.add(new ItemDto(item_tool_coordinate, "工具坐标", "DB1.W1172"));
|
||||
list.add(new ItemDto(item_order_qty, "工单码垛数量", "DB1.D1174"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -907,6 +918,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_one_qty, "1#垛当前数", "DB2.W380"));
|
||||
list.add(new ItemDto(item_to_two_qty, "2#垛当前数", "DB2.W382"));
|
||||
list.add(new ItemDto(item_to_tool_coordinate, "工具坐标", "DB2.W384"));
|
||||
list.add(new ItemDto(item_to_order_qty, "工单数量", "DB2.D386"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ public class LnshPackagePalletManipulatorDefination implements OpcDeviceDriverDe
|
||||
list.add(new ItemDto(ItemProtocol.item_one_qty, "1#垛当前数", "DB1.W1168"));
|
||||
list.add(new ItemDto(ItemProtocol.item_two_qty, "2#垛当前数", "DB1.W1170"));
|
||||
list.add(new ItemDto(ItemProtocol.item_tool_coordinate, "工具坐标", "DB1.D1172"));
|
||||
list.add(new ItemDto(ItemProtocol.item_order_qty, "工单码垛数量", "DB1.D1174"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
String last_order_No = "0";
|
||||
int qty = 0;
|
||||
int last_qty = 0;
|
||||
int order_qty = 0;
|
||||
int last_order_qty = 0;
|
||||
|
||||
//垛型参数
|
||||
int product_code = 0;
|
||||
@@ -269,6 +271,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
onoff_status = this.itemProtocol.getOnoff_status();
|
||||
specifications = this.itemProtocol.getSpecifications();
|
||||
batch = this.itemProtocol.getBatch();
|
||||
order_qty = this.itemProtocol.getOrder_qty();
|
||||
|
||||
product_code = this.itemProtocol.getProduct_code();
|
||||
AlongSide = this.itemProtocol.getAlongSide();
|
||||
@@ -390,6 +393,10 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
}
|
||||
if (order_qty != last_order_qty) {
|
||||
logServer.deviceLog(this.device_code,"order_qty" ,String.valueOf(order_qty));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_qty:" + last_order_qty + "->" + order_qty);
|
||||
}
|
||||
if (product_code != last_product_code) {
|
||||
logServer.deviceLog(this.device_code,"product_code" ,String.valueOf(product_code));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号product_code:" + last_product_code + "->" + product_code);
|
||||
@@ -729,6 +736,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
last_production_time = production_time;
|
||||
last_error_time = error_time;
|
||||
last_order_No = order_No;
|
||||
last_order_qty = order_qty;
|
||||
|
||||
last_product_code = product_code;
|
||||
last_AlongSide = AlongSide;
|
||||
|
||||
@@ -23,9 +23,17 @@ public class ItemProtocol {
|
||||
public static String item_encoder_qty = "encoder_qty";
|
||||
public static String item_batch = "batch";
|
||||
public static String item_specifications = "specifications";
|
||||
public static String item_order_No = "order_No";
|
||||
public static String item_order_qty = "order_qty";
|
||||
|
||||
public static String item_to_feedback = "to_feedback";
|
||||
public static String item_to_error = "to_error";
|
||||
public static String item_to_allow_pallet_qty = "to_allow_pallet_qty";
|
||||
public static String item_to_material_type = "to_material_type";
|
||||
public static String item_to_material_code = "to_material_code";
|
||||
public static String item_to_order_No = "to_order_No";
|
||||
public static String item_to_product_code = "to_product_code";
|
||||
public static String item_to_order_qty = "to_order_qty";
|
||||
|
||||
private LnshPalletizingManipulatorDeviceDriver driver;
|
||||
|
||||
@@ -69,10 +77,18 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_batch);
|
||||
}
|
||||
|
||||
public int getOrder_qty() {
|
||||
return this.getOpcIntegerValue(item_order_qty);
|
||||
}
|
||||
|
||||
public String getSpecifications() {
|
||||
return this.getOpcStringValue(item_specifications);
|
||||
}
|
||||
|
||||
public String getOrder_No() {
|
||||
return this.getOpcStringValue(item_order_No);
|
||||
}
|
||||
|
||||
public int getTo_feedback() {
|
||||
return this.getOpcIntegerValue(item_to_feedback);
|
||||
}
|
||||
@@ -81,6 +97,30 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_error);
|
||||
}
|
||||
|
||||
public int getTo_allow_pallet_qty() {
|
||||
return this.getOpcIntegerValue(item_to_allow_pallet_qty);
|
||||
}
|
||||
|
||||
public int getTo_material_type() {
|
||||
return this.getOpcIntegerValue(item_to_material_type);
|
||||
}
|
||||
|
||||
public int getTo_material_code() {
|
||||
return this.getOpcIntegerValue(item_to_material_code);
|
||||
}
|
||||
|
||||
public String getTo_order_No() {
|
||||
return this.getOpcStringValue(item_to_order_No);
|
||||
}
|
||||
|
||||
public int getTo_Product_code() {
|
||||
return this.getOpcIntegerValue(item_to_product_code);
|
||||
}
|
||||
|
||||
public int getTo_order_qty() {
|
||||
return this.getOpcIntegerValue(item_to_order_qty);
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
@@ -128,6 +168,8 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_specifications, "规格", "DB1.S262"));
|
||||
list.add(new ItemDto(item_encoder_qty, "码盘位当前码盘数量", "DB1.D518"));
|
||||
list.add(new ItemDto(item_batch, "批次", "DB1.D522"));
|
||||
list.add(new ItemDto(item_order_qty, "当前工单数量", "DB1.D526"));
|
||||
list.add(new ItemDto(item_order_No, "工单号", "DB1.S530"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -135,6 +177,12 @@ public class ItemProtocol {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_feedback, "机器人动作反馈", "DB2.B0"));
|
||||
list.add(new ItemDto(item_to_error, "故障代码", "DB2.B1"));
|
||||
list.add(new ItemDto(item_to_allow_pallet_qty, "允许码垛数量", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_material_type, "托盘类型", "DB2.D4"));
|
||||
list.add(new ItemDto(item_to_material_code, "下发物料编号", "DB2.D8"));
|
||||
list.add(new ItemDto(item_to_order_qty, "下发工单数量", "DB2.D12"));
|
||||
list.add(new ItemDto(item_to_product_code, "产品编号", "DB2.D16"));
|
||||
list.add(new ItemDto(item_to_order_No, "工单号", "DB2.S20"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ public class LnshPalletizingManipulatorDefination implements OpcDeviceDriverDefi
|
||||
list.add(new ItemDto(ItemProtocol.item_specifications, "规格", "DB1.S262"));
|
||||
list.add(new ItemDto(ItemProtocol.item_encoder_qty, "码盘位当前码盘数量", "DB1.D518"));
|
||||
list.add(new ItemDto(ItemProtocol.item_batch, "批次", "DB1.D522"));
|
||||
list.add(new ItemDto(ItemProtocol.item_order_qty, "当前工单数量", "DB1.D526"));
|
||||
list.add(new ItemDto(ItemProtocol.item_order_No, "工单号", "DB1.S530"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.LogServer;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.WcsConfig;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
@@ -56,6 +58,8 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
LogServer logServer = SpringContextHolder.getBean("logServerImpl");
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||
@Autowired
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean("produceshiftorderServiceImpl");
|
||||
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
@@ -95,6 +99,12 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
//批次
|
||||
int batch = 0;
|
||||
int last_batch = 0;
|
||||
|
||||
int order_qty = 0;
|
||||
int last_order_qty = 0;
|
||||
|
||||
String order_No = "";
|
||||
String last_order_No = "";
|
||||
//规格
|
||||
String specifications = "";
|
||||
String last_specifications = "";
|
||||
@@ -123,6 +133,8 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
encoder_qty = this.itemProtocol.getEncoder_qty();
|
||||
batch = this.itemProtocol.getBatch();
|
||||
specifications = this.itemProtocol.getSpecifications();
|
||||
order_qty = this.itemProtocol.getOrder_qty();
|
||||
order_No = this.itemProtocol.getOrder_No();
|
||||
|
||||
if (mode != last_mode) {
|
||||
this.setRequireSucess(false);
|
||||
@@ -161,6 +173,14 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
logServer.deviceLog(this.device_code,"material", material);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号material:" + last_material + "->" + material);
|
||||
}
|
||||
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||
logServer.deviceLog(this.device_code,"order_No", order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
}
|
||||
if (order_qty != last_order_qty) {
|
||||
logServer.deviceLog(this.device_code,"order_qty" ,String.valueOf(order_qty));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_qty:" + last_order_qty + "->" + order_qty);
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
return;
|
||||
@@ -196,33 +216,27 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
//人工排产确认
|
||||
// if (!requireSucess && !order_No.equals("0")) {
|
||||
// JSONObject json = new JSONObject();
|
||||
// json.put("producetask_code",order_No);
|
||||
// json.put("device_code",this.device_code);
|
||||
// json.put("material_code",material);
|
||||
// json.put("weight",weight);
|
||||
// json.put("type","1");
|
||||
// enterProduction(json);
|
||||
// }
|
||||
break;
|
||||
case 5:
|
||||
//获取托盘信息(需提供抓取工位或放置工位)
|
||||
if (!requireSucess) {
|
||||
getVehicle();
|
||||
//排产单确认
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("material_code",material);
|
||||
json.put("qty",encoder_qty);
|
||||
json.put("type","1");
|
||||
enterProduction(json);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
//码垛完成
|
||||
if (!requireSucess) {
|
||||
mandatoryPalletizing();
|
||||
palletizing();
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
//码垛强制完成
|
||||
if (!requireSucess) {
|
||||
applyEmpty();
|
||||
mandatoryPalletizing();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
@@ -233,8 +247,14 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
break;
|
||||
case 9:
|
||||
//工单完成
|
||||
if (!requireSucess) {
|
||||
applyEmpty();
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("material_code",material);
|
||||
json.put("qty",encoder_qty);
|
||||
json.put("type","3");
|
||||
enterProduction(json);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -261,6 +281,8 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
last_encoder_qty = encoder_qty;
|
||||
last_batch = batch;
|
||||
last_specifications = specifications;
|
||||
last_order_No = order_No;
|
||||
last_order_qty = order_qty;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -294,6 +316,38 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 排产单确认
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public synchronized boolean enterProduction(JSONObject json) {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) {
|
||||
this.writing(this.mode);
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||
if (this.mode == 4) {
|
||||
dto.setOrder_status("0");
|
||||
} else if (this.mode == 9) {
|
||||
dto.setOrder_status("2");
|
||||
}
|
||||
produceshiftorderService.update(dto);
|
||||
}
|
||||
}
|
||||
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 码垛完成
|
||||
*
|
||||
|
||||
@@ -30,6 +30,7 @@ public class ItemProtocol {
|
||||
public static String item_production_time = "production_time";
|
||||
public static String item_error_time = "error_time";
|
||||
public static String item_order_No = "order_No";
|
||||
public static String item_order_qty = "order_qty";
|
||||
public static String item_total_split = "total_split";
|
||||
|
||||
public static String item_product_code = "product_code";
|
||||
@@ -98,6 +99,7 @@ public class ItemProtocol {
|
||||
public static String item_to_material_type = "to_material_type";
|
||||
public static String item_to_material_code = "to_material_code";
|
||||
public static String item_to_order_No = "to_order_No";
|
||||
public static String item_to_order_qty = "to_order_qty";
|
||||
|
||||
public static String item_to_product_code = "to_product_code";
|
||||
public static String item_to_AlongSide = "to_AlongSide";
|
||||
@@ -237,6 +239,9 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_total_split);
|
||||
}
|
||||
|
||||
public int getOrder_qty() {
|
||||
return this.getOpcIntegerValue(item_order_qty);
|
||||
}
|
||||
|
||||
public int getProduct_code() {
|
||||
return this.getOpcIntegerValue(item_product_code);
|
||||
@@ -730,6 +735,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_tool_coordinate);
|
||||
}
|
||||
|
||||
public int getTo_order_qty() {
|
||||
return this.getOpcIntegerValue(item_to_order_qty);
|
||||
}
|
||||
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
return move;
|
||||
@@ -840,6 +849,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_one_qty, "1#垛当前数", "DB1.W1176"));
|
||||
list.add(new ItemDto(item_two_qty, "2#垛当前数", "DB1.W1178"));
|
||||
list.add(new ItemDto(item_tool_coordinate, "工具坐标", "DB1.W1180"));
|
||||
list.add(new ItemDto(item_order_qty, "工单数量", "DB1.D1182"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -911,6 +921,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_one_qty, "1#垛当前数", "DB2.W382"));
|
||||
list.add(new ItemDto(item_to_two_qty, "2#垛当前数", "DB2.W384"));
|
||||
list.add(new ItemDto(item_to_tool_coordinate, "工具坐标", "DB2.W386"));
|
||||
list.add(new ItemDto(item_to_order_qty, "工单数量", "DB2.D388"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ public class RljnPackagePalletSplitManipulatorDefination implements OpcDeviceDri
|
||||
list.add(new ItemDto(ItemProtocol.item_one_qty, "1#垛当前数", "DB1.W1176"));
|
||||
list.add(new ItemDto(ItemProtocol.item_two_qty, "2#垛当前数", "DB1.W1178"));
|
||||
list.add(new ItemDto(ItemProtocol.item_tool_coordinate, "工具坐标", "DB1.W1180"));
|
||||
list.add(new ItemDto(ItemProtocol.item_order_qty, "工单数量", "DB1.D1182"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,9 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
int total_split = 0;
|
||||
int last_total_split = 0;
|
||||
|
||||
int order_qty = 0;
|
||||
int last_order_qty = 0;
|
||||
|
||||
//垛型参数
|
||||
int product_code = 0;
|
||||
int AlongSide = 0;
|
||||
@@ -270,6 +273,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
specifications = this.itemProtocol.getSpecifications();
|
||||
batch = this.itemProtocol.getBatch();
|
||||
total_split = this.itemProtocol.getTotal_split();
|
||||
order_qty = this.itemProtocol.getOrder_qty();
|
||||
|
||||
product_code = this.itemProtocol.getProduct_code();
|
||||
AlongSide = this.itemProtocol.getAlongSide();
|
||||
@@ -391,6 +395,10 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
logServer.deviceLog(this.device_code,"batch" ,String.valueOf(batch));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号batch:" + last_batch + "->" + batch);
|
||||
}
|
||||
if (order_qty != last_order_qty) {
|
||||
logServer.deviceLog(this.device_code,"order_qty" ,String.valueOf(order_qty));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_qty:" + last_order_qty + "->" + order_qty);
|
||||
}
|
||||
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
@@ -740,6 +748,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
last_error_time = error_time;
|
||||
last_order_No = order_No;
|
||||
last_total_split = total_split;
|
||||
last_order_qty = order_qty;
|
||||
|
||||
last_product_code = product_code;
|
||||
last_AlongSide = AlongSide;
|
||||
|
||||
Reference in New Issue
Block a user