add 当前码垛位上报lms

This commit is contained in:
USER-20220102CG\noblelift
2023-06-01 17:16:14 +08:00
parent 563ccaf102
commit 2c4820fff7
13 changed files with 219 additions and 7 deletions

View File

@@ -94,6 +94,7 @@ public class ItemProtocol {
public static String item_one_qty = "one_qty";
public static String item_two_qty = "two_qty";
public static String item_tool_coordinate = "tool_coordinate";
public static String item_present_palleting_station = "present_palleting_station";
public static String item_to_feedback = "to_feedback";
public static String item_to_error = "to_error";
@@ -495,6 +496,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_tool_coordinate);
}
public int getPresent_palleting_station() {
return this.getOpcIntegerValue(item_present_palleting_station);
}
public int getTo_feedback() {
return this.getOpcIntegerValue(item_to_feedback);
}

View File

@@ -138,6 +138,8 @@ public class LnshPackagePalletManipulatorDefination implements OpcDeviceDriverDe
list.add(new ItemDto(ItemProtocol.item_getY_offset, "1#抓取Y偏移", "DB56.W1180"));
list.add(new ItemDto(ItemProtocol.item_tool_coordinate, "工具坐标", "DB56.W1182"));
list.add(new ItemDto(ItemProtocol.item_order_qty, "工单码垛数量", "DB56.W1184"));
list.add(new ItemDto(ItemProtocol.item_present_palleting_station, "当前码垛工位", "DB56.W1186"));
return list;
}

View File

@@ -59,6 +59,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
int last_error = 0;
Boolean isonline = true;
int hasGoods = 0;
int present_palleting_station =0;
int last_present_palleting_station = 0;
String message = null;
Boolean iserror = false;
@@ -341,7 +343,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
one_qty = this.itemProtocol.getOne_qty();
two_qty = this.itemProtocol.getTwo_qty();
tool_coordinate = this.itemProtocol.getTool_coordinate();
present_palleting_station = this.itemProtocol.getPresent_palleting_station();
if (mode != last_mode) {
this.setRequireSucess(false);
this.setResultSucess(false);
@@ -351,6 +353,25 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code,"","","信号mode" + last_mode + "->" + mode);
}
if(present_palleting_station != last_present_palleting_station){
logServer.deviceExecuteLog(this.device_code,"","","信号present_palleting_station" + last_present_palleting_station + "->" + present_palleting_station);
if(present_palleting_station > 0){
String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
JSONObject json = new JSONObject();
json.put("device_code",this.device_code);
if(last_present_palleting_station ==0 ){
json.put("last_palleting_station","0");
} else {
json.put("last_palleting_station",demoList.get(last_present_palleting_station-1).replace("\"",""));
}
json.put("present_palleting_station",demoList.get(present_palleting_station-1).replace("\"",""));
logServer.deviceExecuteLog(this.device_code,"","","feedBackSplitPalletStation 请求LMS:" + json);
acsToWmsService.feedBackSplitPalletStation(json);
}
}
if (status != last_status) {
logServer.deviceItemValue(this.device_code,"status" ,String.valueOf(status));
logServer.deviceExecuteLog(this.device_code,"","","信号status" + last_status + "->" + status);
@@ -850,6 +871,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
last_container_getQty = container_getQty;
last_getX_offset = getX_offset;
last_getY_offset = getY_offset;
last_present_palleting_station = present_palleting_station;
}

View File

@@ -383,6 +383,7 @@ public class LnshPackagePalletizingManipulatorSiteDeviceDriver extends AbstractO
if (mode != last_mode) {
this.setRequireSucess(false);
this.setResultSucess(false);
logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code,"","","信号mode" + last_mode + "->" + mode);
}

View File

@@ -89,6 +89,7 @@ public class ItemProtocol {
public static String item_tool_coordinate = "tool_coordinate";
public static String item_order_No = "order_No";
public static String item_order_qty = "order_qty";
public static String item_present_stripping_station = "present_stripping_station";
public static String item_to_feedback = "to_feedback";
public static String item_to_error = "to_error";
@@ -453,6 +454,12 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_tool_coordinate);
}
public int getPresent_stripping_station() {
return this.getOpcIntegerValue(item_present_stripping_station);
}
public int getTo_command() {
return this.getOpcIntegerValue(item_to_feedback);
}

View File

@@ -133,6 +133,8 @@ public class LnshSplitManipulatorDefination implements OpcDeviceDriverDefination
list.add(new ItemDto(ItemProtocol.item_tool_coordinate, "工具坐标", "DB50.D918"));
list.add(new ItemDto(ItemProtocol.item_order_qty, "工单数量", "DB50.W920"));
list.add(new ItemDto(ItemProtocol.item_order_No, "工单号", "DB50.STRING924.50"));
list.add(new ItemDto(ItemProtocol.item_present_stripping_station, "当前拆垛位", "DB50.W1178"));
return list;
}

View File

@@ -120,7 +120,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
String last_specifications = "";
int qty = 0;
int last_qty = 0;
int present_stripping_station = 0;
//垛型参数
int product_code = 0;
int AlongSide = 0;
@@ -240,6 +240,8 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
int last_one_qty = 0;
int last_two_qty = 0;
int last_tool_coordinate = 0;
int last_present_stripping_station =0;
@Override
public Device getDevice() {
@@ -327,12 +329,34 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
one_qty = this.itemProtocol.getOne_qty();
two_qty = this.itemProtocol.getTwo_qty();
tool_coordinate = this.itemProtocol.getTool_coordinate();
present_stripping_station = this.itemProtocol.getPresent_stripping_station();
to_command = this.itemProtocol.getTo_command();
if (mode != last_mode) {
this.setRequireSucess(false);
logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code,"","","信号mode" + last_mode + "->" + mode);
}
if(present_stripping_station != last_present_stripping_station){
logServer.deviceExecuteLog(this.device_code,"","","信号present_stripping_station" + last_present_stripping_station + "->" + present_stripping_station);
if(present_stripping_station > 0){
String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
JSONObject json = new JSONObject();
json.put("device_code",this.device_code);
if(last_present_stripping_station ==0 ){
json.put("last_stripping_station","0");
} else {
json.put("last_stripping_station",demoList.get(last_present_stripping_station-1).replace("\"",""));
}
json.put("present_stripping_station",demoList.get(present_stripping_station-1).replace("\"",""));
logServer.deviceExecuteLog(this.device_code,"","","feedBackSplitPalletStation 请求LMS:" + json);
acsToWmsService.feedBackSplitPalletStation(json);
}
}
if (getStation != last_getStation) {
logServer.deviceItemValue(this.device_code,"getStation" ,String.valueOf(getStation));
logServer.deviceExecuteLog(this.device_code,"","","信号getStation" + last_getStation + "->" + getStation);
@@ -792,6 +816,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
last_one_qty = one_qty;
last_two_qty = two_qty;
last_tool_coordinate = tool_coordinate;
last_present_stripping_station = present_stripping_station;
}

View File

@@ -96,6 +96,9 @@ public class ItemProtocol {
public static String item_one_qty = "one_qty";
public static String item_two_qty = "two_qty";
public static String item_tool_coordinate = "tool_coordinate";
public static String item_present_stripping_station = "present_stripping_station";
public static String item_present_palleting_station = "present_palleting_station";
public static String item_to_feedback = "to_feedback";
public static String item_to_error = "to_error";
@@ -505,6 +508,17 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_tool_coordinate);
}
public int getPresent_stripping_station() {
return this.getOpcIntegerValue(item_present_stripping_station);
}
public int getPresent_palleting_station() {
return this.getOpcIntegerValue(item_present_palleting_station);
}
public int getTo_feedback() {
return this.getOpcIntegerValue(item_to_feedback);
}
@@ -905,6 +919,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_getY_offset, "1#抓取Y偏移", "DB62.W1188"));
list.add(new ItemDto(item_tool_coordinate, "工具坐标", "DB62.W1190"));
list.add(new ItemDto(item_order_qty, "工单数量", "DB62.W1192"));
return list;
}

View File

@@ -140,6 +140,9 @@ public class RljnPackagePalletSplitManipulatorDefination implements OpcDeviceDri
list.add(new ItemDto(ItemProtocol.item_getY_offset, "1#抓取Y偏移", "DB62.W1188"));
list.add(new ItemDto(ItemProtocol.item_tool_coordinate, "工具坐标", "DB62.W1190"));
list.add(new ItemDto(ItemProtocol.item_order_qty, "工单数量", "DB62.W1192"));
list.add(new ItemDto(ItemProtocol.item_present_stripping_station, "当前拆垛工位", "DB62.W1194"));
list.add(new ItemDto(ItemProtocol.item_present_palleting_station, "当前码垛工位", "DB62.W1196"));
return list;
}

View File

@@ -61,7 +61,10 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
int hasGoods = 0;
String message = null;
Boolean iserror = false;
int present_stripping_station = 0;
int last_present_stripping_station = 0;
int present_palleting_station = 0;
int last_present_palleting_station = 0;
private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date();
@@ -349,6 +352,8 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
one_qty = this.itemProtocol.getOne_qty();
two_qty = this.itemProtocol.getTwo_qty();
tool_coordinate = this.itemProtocol.getTool_coordinate();
present_stripping_station = this.itemProtocol.getPresent_stripping_station();
present_palleting_station = this.itemProtocol.getPresent_palleting_station();
if (mode != last_mode) {
this.setRequireSucess(false);
@@ -359,6 +364,94 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code,"","","信号mode" + last_mode + "->" + mode);
}
if(present_stripping_station != last_present_stripping_station){
logServer.deviceExecuteLog(this.device_code,"","","信号present_stripping_station" + last_present_stripping_station + "->" + present_stripping_station);
if(present_stripping_station > 0 && present_palleting_station > 0){
String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
String link_palletingobj = (String)this.getDevice().getExtraValue().get("link_palleting_device_code");
String demo_palletsub = link_palletingobj.substring(1,link_palletingobj.length()-1);
String demo_palletArray[] = demo_palletsub.split(",");
List<String> demo_palletList = Arrays.asList(demo_palletArray);
JSONObject json = new JSONObject();
json.put("device_code",this.device_code);
if(last_present_stripping_station ==0 ){
json.put("last_stripping_station","0");
} else {
json.put("last_stripping_station",demoList.get(last_present_stripping_station-1).replace("\"",""));
}
if(present_stripping_station ==0 ){
json.put("present_stripping_station","0");
} else {
json.put("present_stripping_station",demoList.get(present_stripping_station-1).replace("\"",""));
}
if(last_present_palleting_station ==0 ){
json.put("last_palleting_station","0");
} else {
json.put("last_palleting_station",demo_palletList.get(last_present_palleting_station-1).replace("\"",""));
}
if(present_palleting_station ==0 ){
json.put("present_palleting_station","0");
} else {
json.put("present_palleting_station",demo_palletList.get(present_palleting_station-1).replace("\"",""));
}
logServer.deviceExecuteLog(this.device_code,"","","feedBackSplitPalletStation 请求LMS:" + json);
acsToWmsService.feedBackSplitPalletStation(json);
}
}
if(present_palleting_station != last_present_palleting_station){
logServer.deviceExecuteLog(this.device_code,"","","信号present_palleting_station" + last_present_palleting_station + "->" + present_palleting_station);
if(present_palleting_station > 0 && present_stripping_station > 0){
String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
String link_palletingobj = (String)this.getDevice().getExtraValue().get("link_palleting_device_code");
String demo_palletsub = link_palletingobj.substring(1,link_palletingobj.length()-1);
String demo_palletArray[] = demo_palletsub.split(",");
List<String> demo_palletList = Arrays.asList(demo_palletArray);
JSONObject json = new JSONObject();
json.put("device_code",this.device_code);
if(last_present_stripping_station ==0 ){
json.put("last_stripping_station","0");
} else {
json.put("last_stripping_station",demoList.get(last_present_stripping_station-1).replace("\"",""));
}
if(present_stripping_station ==0 ){
json.put("present_stripping_station","0");
} else {
json.put("present_stripping_station",demoList.get(present_stripping_station-1).replace("\"",""));
}
if(last_present_palleting_station ==0 ){
json.put("last_palleting_station","0");
} else {
json.put("last_palleting_station",demo_palletList.get(last_present_palleting_station-1).replace("\"",""));
}
if(present_palleting_station ==0 ){
json.put("present_palleting_station","0");
} else {
json.put("present_palleting_station",demo_palletList.get(present_palleting_station-1).replace("\"",""));
}
logServer.deviceExecuteLog(this.device_code,"","","feedBackSplitPalletStation 请求LMS:" + json);
acsToWmsService.feedBackSplitPalletStation(json);
}
}
if (status != last_status) {
logServer.deviceItemValue(this.device_code,"status" ,String.valueOf(status));
logServer.deviceExecuteLog(this.device_code,"","","信号status" + last_status + "->" + status);
@@ -882,6 +975,8 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
last_container_getQty = container_getQty;
last_getX_offset = getX_offset;
last_getY_offset = getY_offset;
last_present_stripping_station = present_stripping_station;
last_present_palleting_station = present_palleting_station;
}

View File

@@ -165,5 +165,10 @@ public interface AcsToWmsService {
*/
public HttpResponse feedbackActionStatusToWms(JSONArray arr);
/**
* 反馈当前拆码垛工位
*/
JSONObject feedBackSplitPalletStation(JSONObject jo);
}

View File

@@ -435,6 +435,36 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
@Override
public JSONObject feedBackSplitPalletStation(JSONObject json) {
try {
MDC.put(log_file_type, log_type);
} finally {
MDC.remove(log_file_type);
}
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
AddressDto addressDto = addressService.findByCode("feedBackSplitPalletStation");
String methods_url = addressDto.getMethods_url();
String url = wmsurl + methods_url;
log.info("feedBackSplitPalletStation----请求参数{}", json.toString());
HttpResponse result = null;
try {
result = HttpRequest.post(url)
.header("Authorization", token)
.body(String.valueOf(json))
.execute();
System.out.println(result);
} catch (Exception e) {
System.out.println(e.getMessage());
}
log.info("feedBackSplitPalletStation----返回参数{}", result.body());
return JSONObject.parseObject(result.body());
}
@Override
public JSONObject getVehicleCode(String device_code) {
try {

View File

@@ -114,11 +114,11 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联三色灯" prop="device_code" label-width="100px">
<el-form-item label="关联码垛设备" prop="device_code">
<el-select
v-model="form.link_three_lamp"
v-model="form.link_palleting_device_code"
filterable
clearable
multiple
placeholder="请选择"
>
<el-option
@@ -293,7 +293,7 @@ export default {
ignore_pickup_check: true,
ignore_release_check: true,
apply_task: true,
link_three_lamp: '',
link_palleting_device_code: [],
manual_create_task: true,
is_pickup: true,
is_release: true,