更新
This commit is contained in:
@@ -937,6 +937,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
obj.setHasgoods(hasGoodStatus);
|
||||
obj.setMaterial_type(material_type);
|
||||
obj.setBatch(batch);
|
||||
obj.setIslock(islock);
|
||||
hailiangEngravingCacheDeviceDriver.setMaterial(material_type);
|
||||
if (hailiangEngravingCacheDeviceDriver.getMove() != Integer.parseInt(hasGoodStatus)){
|
||||
hailiangEngravingCacheDeviceDriver.writing("to_cache_write",hasGoodStatus);
|
||||
|
||||
Binary file not shown.
@@ -250,31 +250,22 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
|
||||
instructionService.update(inst);
|
||||
// TODO 指令中根据起始点位驱动类型判断空满
|
||||
String start_device_code = inst.getStart_device_code();
|
||||
log.warn("起点设备为:{}",start_device_code);
|
||||
String next_device_code = inst.getNext_device_code();
|
||||
log.warn("终点设备为:{}",next_device_code);
|
||||
Device start_device = deviceAppservice.findDeviceByCode(start_device_code);
|
||||
Device next_device = deviceAppservice.findDeviceByCode(next_device_code);
|
||||
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
|
||||
if (start_device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){
|
||||
writing("to_cache_write", "2");
|
||||
this.setMaterial(inst.getMaterial());
|
||||
next_device.setMaterial_type(inst.getMaterial());
|
||||
JSONObject updatejson = new JSONObject();
|
||||
updatejson.put("hasgoods","2");
|
||||
updatejson.put("islock","0");
|
||||
updatejson.put("material_type",inst.getMaterial());
|
||||
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位锁定成功");
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位解锁成功");
|
||||
}
|
||||
if (start_device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){
|
||||
writing("to_cache_write", "1");
|
||||
this.setMaterial("");
|
||||
next_device.setMaterial_type("");
|
||||
JSONObject updatejson = new JSONObject();
|
||||
updatejson.put("hasgoods","1");
|
||||
updatejson.put("islock","0");
|
||||
updatejson.put("material_type","");
|
||||
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置包装机,缓存位锁定成功");
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置包装机,缓存位解锁成功");
|
||||
}
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
|
||||
@@ -364,6 +364,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
if ( move == 1 && mode == 1 && full_req == 1 ) {
|
||||
// if ( full_req == 1 ) {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务");
|
||||
|
||||
apply_task();
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","不满足下发满框请求任务条件,mode:"+mode+"move:"+move+"full_req:"+full_req);
|
||||
@@ -589,6 +590,10 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
|
||||
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
|
||||
}
|
||||
if (order.getIs_needmove().equals("0")){
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单,不需要agv搬运");
|
||||
return false;
|
||||
}
|
||||
//查找当前工单对应的物料编号
|
||||
String cpbh = order.getMaterial_code();
|
||||
|
||||
|
||||
@@ -179,69 +179,69 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
await_time = this.itemProtocol.getItem_await_time(); //待机时间(S)
|
||||
order = this.itemProtocol.getItem_order(); //工单号
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
|
||||
logServer.deviceLog(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (move != last_move) {
|
||||
logServer.deviceLog(this.device_code,"move" ,String.valueOf(move));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号move(取反):" + last_move + "->" + move);
|
||||
logServer.deviceLog(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号move(取反):" + last_move + "->" + move);
|
||||
}
|
||||
if (packer_ready != last_packer_ready) {
|
||||
logServer.deviceLog(this.device_code,"packer_ready" ,String.valueOf(packer_ready));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号packer_ready:" + last_packer_ready + "->" + packer_ready);
|
||||
logServer.deviceLog(this.device_code, "packer_ready", String.valueOf(packer_ready));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号packer_ready:" + last_packer_ready + "->" + packer_ready);
|
||||
}
|
||||
if (lack_req != last_lack_req) {
|
||||
if(lack_req == 0){
|
||||
if (lack_req == 0) {
|
||||
this.setRequireSucess(false);
|
||||
}
|
||||
logServer.deviceLog(this.device_code,"lack_req" ,String.valueOf(lack_req));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号lack_req:" + last_lack_req + "->" + lack_req);
|
||||
logServer.deviceLog(this.device_code, "lack_req", String.valueOf(lack_req));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号lack_req:" + last_lack_req + "->" + lack_req);
|
||||
}
|
||||
if (hopper_already != last_hopper_already) {
|
||||
logServer.deviceLog(this.device_code,"hopper_already" ,String.valueOf(hopper_already));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号hopper_already:" + last_hopper_already + "->" + hopper_already);
|
||||
logServer.deviceLog(this.device_code, "hopper_already", String.valueOf(hopper_already));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号hopper_already:" + last_hopper_already + "->" + hopper_already);
|
||||
}
|
||||
if (req_task_empty != last_req_task_empty) {
|
||||
if(req_task_empty==0){
|
||||
if (req_task_empty == 0) {
|
||||
this.setRequireSucess(false);
|
||||
}
|
||||
logServer.deviceLog(this.device_code,"req_task_empty" ,String.valueOf(req_task_empty));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号req_task_empty:" + last_req_task_empty + "->" + req_task_empty);
|
||||
logServer.deviceLog(this.device_code, "req_task_empty", String.valueOf(req_task_empty));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号req_task_empty:" + last_req_task_empty + "->" + req_task_empty);
|
||||
}
|
||||
if (hopper_removed != last_hopper_removed) {
|
||||
logServer.deviceLog(this.device_code,"hopper_removed" ,String.valueOf(hopper_removed));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号hopper_removed:" + last_hopper_removed + "->" + hopper_removed);
|
||||
logServer.deviceLog(this.device_code, "hopper_removed", String.valueOf(hopper_removed));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号hopper_removed:" + last_hopper_removed + "->" + hopper_removed);
|
||||
}
|
||||
|
||||
if (order_finish != last_order_finish) {
|
||||
logServer.deviceLog(this.device_code,"order_finish" ,String.valueOf(order_finish));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_finish:" + last_order_finish + "->" + order_finish);
|
||||
logServer.deviceLog(this.device_code, "order_finish", String.valueOf(order_finish));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号order_finish:" + last_order_finish + "->" + order_finish);
|
||||
}
|
||||
|
||||
if (error != last_error) {
|
||||
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
logServer.deviceLog(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (order_now != last_order_now) {
|
||||
logServer.deviceLog(this.device_code,"order_now" ,String.valueOf(order_now));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_now:" + last_order_now + "->" + order_now);
|
||||
logServer.deviceLog(this.device_code, "order_now", String.valueOf(order_now));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号order_now:" + last_order_now + "->" + order_now);
|
||||
}
|
||||
|
||||
if (open_ready_time != last_open_ready_time) {
|
||||
logServer.deviceLog(this.device_code,"open_ready_time" ,String.valueOf(open_ready_time));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time);
|
||||
logServer.deviceLog(this.device_code, "open_ready_time", String.valueOf(open_ready_time));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time);
|
||||
}
|
||||
if (device_running_time != last_device_running_time) {
|
||||
logServer.deviceLog(this.device_code,"device_running_time" ,String.valueOf(device_running_time));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号device_running_time:" + last_device_running_time + "->" + device_running_time);
|
||||
logServer.deviceLog(this.device_code, "device_running_time", String.valueOf(device_running_time));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号device_running_time:" + last_device_running_time + "->" + device_running_time);
|
||||
}
|
||||
if (await_time != last_await_time) {
|
||||
logServer.deviceLog(this.device_code,"await_time" ,String.valueOf(await_time));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号await_time:" + last_await_time + "->" + await_time);
|
||||
logServer.deviceLog(this.device_code, "await_time", String.valueOf(await_time));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号await_time:" + last_await_time + "->" + await_time);
|
||||
}
|
||||
if (order != last_order) {
|
||||
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
|
||||
logServer.deviceLog(this.device_code, "order", String.valueOf(order));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号order:" + last_order + "->" + order);
|
||||
}
|
||||
|
||||
/* if (mode == 2 && move != 0 && task > 0) {
|
||||
@@ -273,90 +273,89 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
if ( mode == 1 && order_finish != last_order_finish && order_finish == 1 && order > 0){
|
||||
if (mode == 1 && order_finish != last_order_finish && order_finish == 1 && order > 0) {
|
||||
ProduceshiftorderDto dto = new ProduceshiftorderDto();
|
||||
dto.setOrder_code(order + "");
|
||||
dto.setOrder_status("2");
|
||||
ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code);
|
||||
if(deviceInfo != null){
|
||||
if (deviceInfo != null) {
|
||||
if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) {
|
||||
String ext_order_id = deviceInfo.getExt_order_id();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("ext_order_id",ext_order_id);
|
||||
param.put("ext_order_id", ext_order_id);
|
||||
acsToWmsService.feedbackOrderStatus(param);
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的外部标识:"+ext_order_id);
|
||||
}else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的没有外部标识");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,对应的工单的外部标识:" + ext_order_id);
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,对应的工单的没有外部标识");
|
||||
}
|
||||
}else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单信息为空");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,对应的工单信息为空");
|
||||
}
|
||||
produceshiftorderService.updateByOrderCode(dto);
|
||||
this.writing("to_confirm_finished","1");
|
||||
this.writing("to_clear","1");
|
||||
this.writing("to_pause","1");
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,任务确认完成,电器信号写入成功");
|
||||
this.writing("to_confirm_finished", "1");
|
||||
this.writing("to_clear", "1");
|
||||
this.writing("to_pause", "1");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,任务确认完成,电器信号写入成功");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",order_finish>" + order_finish + ",last_order_finish>" + last_order_finish);
|
||||
}
|
||||
|
||||
if(ObjectUtil.isEmpty(inst)){
|
||||
if(!requireSucess){
|
||||
if (lack_req == 1 && move == 0) {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请缺料请求任务");
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
if (!requireSucess) {
|
||||
if (mode == 1 && lack_req == 1 && move == 0) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请缺料请求任务");
|
||||
apply_task();
|
||||
}
|
||||
|
||||
if (req_task_empty == 1 && move == 1){
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务");
|
||||
if (mode == 1 && req_task_empty == 1 && move == 1) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务");
|
||||
apply_take_empty_task();
|
||||
}
|
||||
logServer.deviceLogToacs(this.device_code,"","","lack_req:"+lack_req+"move:"+move+"req_task_empty:"+req_task_empty);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "lack_req:" + lack_req + "move:" + move + "req_task_empty:" + req_task_empty);
|
||||
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "是否请求成功:requireSucess:" + requireSucess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(agvphase == 0x03)
|
||||
{
|
||||
if (agvphase == 0x03) {
|
||||
//&& lack_req =1 缺料请求 先不判断
|
||||
/*if( move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)){*/
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
//writing("to_agv_ready", "1");
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功");
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
//writing("to_agv_ready", "1");
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
/* } else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst);
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
if(agvphase == 0x05){
|
||||
if(move ==0 && error == 0 && ObjectUtil.isNotEmpty(inst)){
|
||||
if (agvphase == 0x05) {
|
||||
if (move == 0 && error == 0 && ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("2");
|
||||
instructionService.update(inst);
|
||||
//writing("to_agv_ready", "1");
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
writing("to_agv_take_finish","1");
|
||||
writing("to_agv_take_finish", "1");
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,原因move:" + move + ",error:" + error + ",inst" + inst);
|
||||
}
|
||||
}
|
||||
|
||||
if(agvphase == 0x07){
|
||||
if(move ==0 && error == 0 && ObjectUtil.isNotEmpty(inst)){
|
||||
if (agvphase == 0x07) {
|
||||
if (move == 0 && error == 0 && ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("5");
|
||||
instructionService.update(inst);
|
||||
//writing("to_agv_ready", "1");
|
||||
@@ -365,15 +364,15 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,原因move:" + move + ",error:" + error + ",inst" + inst);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(agvphase == 0x09){
|
||||
if(move ==1 && error == 0 && ObjectUtil.isNotEmpty(inst)){
|
||||
if (agvphase == 0x09) {
|
||||
if (move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("6");
|
||||
instructionService.update(inst);
|
||||
writing("to_agv_release_finish", "1");
|
||||
@@ -385,27 +384,27 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,move:"+move+",error:"+error+",inst:"+inst);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,move:" + move + ",error:" + error + ",inst:" + inst);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
last_packer_ready = packer_ready;//包装机就绪
|
||||
last_lack_req = lack_req;//缺料请求
|
||||
last_hopper_already = hopper_already;//料斗已就位
|
||||
last_req_task_empty = req_task_empty;//请求取空料斗
|
||||
last_hopper_removed = hopper_removed;//料斗已取走
|
||||
last_move = move;//有货
|
||||
last_order_finish = order_finish;//订单完成
|
||||
last_mode = mode;//模式 所有设备就绪
|
||||
last_error = error; //报警信号
|
||||
last_order_now = order_now; //订单实时
|
||||
last_open_ready_time = open_ready_time; //开机准备时间(S)
|
||||
last_device_running_time = device_running_time; //设备运转时间(S)
|
||||
last_await_time = await_time; //待机时间(S)
|
||||
last_order = order; //工单号
|
||||
last_packer_ready = packer_ready;//包装机就绪
|
||||
last_lack_req = lack_req;//缺料请求
|
||||
last_hopper_already = hopper_already;//料斗已就位
|
||||
last_req_task_empty = req_task_empty;//请求取空料斗
|
||||
last_hopper_removed = hopper_removed;//料斗已取走
|
||||
last_move = move;//有货
|
||||
last_order_finish = order_finish;//订单完成
|
||||
last_mode = mode;//模式 所有设备就绪
|
||||
last_error = error; //报警信号
|
||||
last_order_now = order_now; //订单实时
|
||||
last_open_ready_time = open_ready_time; //开机准备时间(S)
|
||||
last_device_running_time = device_running_time; //设备运转时间(S)
|
||||
last_await_time = await_time; //待机时间(S)
|
||||
last_order = order; //工单号
|
||||
}
|
||||
|
||||
public boolean exe_error() {
|
||||
@@ -435,6 +434,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
public void set_last_container_type_desc(String type) {
|
||||
}
|
||||
|
||||
public synchronized boolean apply_take_empty_task() throws Exception {
|
||||
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
|
||||
|
||||
@@ -466,13 +466,13 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
continue;
|
||||
}
|
||||
int num = taskserver.querySameDestinationTask(next_device_code);
|
||||
if(num != 0){
|
||||
if (num != 0) {
|
||||
continue;
|
||||
}
|
||||
//判断缓存位是否锁定
|
||||
JSONObject jsonObject = runpointwo.query("device_code = '" + next_device_code + "' and islock = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)){
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "对应路由设备,"+next_device_code+"已锁定");
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "对应路由设备," + next_device_code + "已锁定");
|
||||
continue;
|
||||
}
|
||||
TaskDto onedto = new TaskDto();
|
||||
@@ -497,10 +497,10 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
taskserver.create(onedto);
|
||||
//任务创建成功 锁定
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("islock","1");
|
||||
map.put("update_by","auto");
|
||||
map.put("islock", "1");
|
||||
map.put("update_by", "auto");
|
||||
map.put("update_time", DateUtil.now());
|
||||
runpointwo.update(map,"device_code = '" + next_device_code + "'");
|
||||
runpointwo.update(map, "device_code = '" + next_device_code + "'");
|
||||
flag = true;
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
@@ -522,6 +522,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized boolean apply_task() throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
@@ -540,6 +541,10 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
|
||||
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
|
||||
}
|
||||
if (order.getIs_needmove().equals("0")) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单,不需要agv搬运");
|
||||
return false;
|
||||
}
|
||||
//查找当前工单对应的物料编号
|
||||
String cpbh = order.getMaterial_code();
|
||||
|
||||
@@ -550,18 +555,18 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Device route_link_device = deviceAppservice.findDeviceByCode(start_device_code);
|
||||
if (route_link_device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) {
|
||||
hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) route_link_device.getDeviceDriver();
|
||||
if (hailiangEngravingCacheDeviceDriver.getMove() == 0 || hailiangEngravingCacheDeviceDriver.getMove() == 1 ) {
|
||||
if (hailiangEngravingCacheDeviceDriver.getMove() == 0 || hailiangEngravingCacheDeviceDriver.getMove() == 1) {
|
||||
continue;
|
||||
}
|
||||
int num = taskserver.querySameOriginTask(start_device_code);
|
||||
if(num != 0){
|
||||
if (num != 0) {
|
||||
continue;
|
||||
}
|
||||
String material = hailiangEngravingCacheDeviceDriver.getMaterial();
|
||||
if(StrUtil.isEmpty(material)){
|
||||
if (StrUtil.isEmpty(material)) {
|
||||
continue;
|
||||
}
|
||||
if (material.equals(cpbh)){
|
||||
if (material.equals(cpbh)) {
|
||||
TaskDto onedto = new TaskDto();
|
||||
String now = DateUtil.now();
|
||||
onedto.setTask_id(IdUtil.simpleUUID());
|
||||
@@ -659,7 +664,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_command, value);
|
||||
logServer.deviceLogToacs(this.device_code,"","","下发信号:" + key + ",value:"+value);
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "下发信号:" + key + ",value:" + value);
|
||||
ReadUtil.write(itemMap, server);
|
||||
}
|
||||
|
||||
@@ -707,7 +712,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
|
||||
wo.insert(json);
|
||||
requireSucess = false;
|
||||
|
||||
@@ -4,16 +4,19 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.nl.acs.agv.server.AgvService;
|
||||
import org.nl.acs.config.server.AcsConfigService;
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line.HailiangCleaningFeedingLineDefination;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver;
|
||||
@@ -394,27 +397,27 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
String empty_device = this.getDevice().getExtraValue().get("empty_device_code").toString();
|
||||
//通过满料位设备关联的设备tw查找订单
|
||||
ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device);
|
||||
//判断是否需要agv搬运
|
||||
if (order.getIs_needmove().equals("0")){
|
||||
requireSucess = true;
|
||||
logServer.deviceLogToacs(this.device_code,"","","不需要agv搬运,工单号:"+order.getOrder_code());
|
||||
return true;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(order)) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
|
||||
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
|
||||
}
|
||||
//判断是否需要agv搬运
|
||||
if (order.getIs_needmove().equals("0")){
|
||||
requireSucess = true;
|
||||
logServer.deviceLogToacs(this.device_code,"","","不需要agv搬运,工单号:"+order.getOrder_code());
|
||||
return true;
|
||||
}
|
||||
//查找当前工单对应的物料编号
|
||||
String cpbh = order.getMaterial_code();
|
||||
HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver;
|
||||
HailiangCleaningMachineStorageStationDeviceDriver hailiangCleaningMachineStorageStationDeviceDriver;
|
||||
HailiangAutoCacheLineDeviceDriver hailiangAutoCacheLineDeviceDriver;
|
||||
String clear_storage_device =null;
|
||||
//遍历路由,找到对应所有的物料进行匹配
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
RouteLineDto dto = list.get(i);
|
||||
//找到路由对应工位 清洗机设备编号
|
||||
String route_device_code = dto.getNext_device_code();
|
||||
//根据清洗机设备编号获取清洗剂设备信息
|
||||
Device route_link_device = deviceAppservice.findDeviceByCode(route_device_code);
|
||||
//找到路由工位对应设备
|
||||
String route_link_device_code = (String)route_link_device.getExtraValue().get("link_device_code");
|
||||
@@ -480,6 +483,51 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
}
|
||||
|
||||
}
|
||||
else if (route_link_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver){
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("device_code",device_code);
|
||||
json.put("type","1");
|
||||
HttpResponse httpResponse = acsToWmsService.applyInCacheLineTask(json);
|
||||
JSONObject jsonObject = JSONObject.parseObject(httpResponse.body());
|
||||
String ext_task_id = jsonObject.getString("ext_task_id");
|
||||
String task_code = jsonObject.getString("task_code");
|
||||
String start_device_code = jsonObject.getString("start_device_code");
|
||||
String put_device_code = jsonObject.getString("put_device_code");
|
||||
String next_device_code = jsonObject.getString("next_device_code");
|
||||
String task_type = jsonObject.getString("task_type");
|
||||
String barcodeArr = jsonObject.getString("barcodeArr");
|
||||
String[] barcodeArrs = barcodeArr.split("\\,");
|
||||
TaskDto onedto = new TaskDto();
|
||||
String now = DateUtil.now();
|
||||
onedto.setTask_id(IdUtil.simpleUUID());
|
||||
onedto.setQuantity(String.valueOf(full_number));
|
||||
onedto.setCreate_by(this.getDevice().getDevice_code());
|
||||
onedto.setUpdate_by(this.getDevice().getDevice_code());
|
||||
onedto.setExt_task_id(ext_task_id);
|
||||
onedto.setRoute_plan_code("normal");
|
||||
String taskcode = CodeUtil.getNewCode("TASK_NO");
|
||||
onedto.setTask_code("-" + taskcode);
|
||||
onedto.setTask_status("0");
|
||||
onedto.setPriority("101");
|
||||
onedto.setAgv_system_type("1");
|
||||
onedto.setTask_type(task_type);
|
||||
onedto.setTask_id(IdUtil.simpleUUID());
|
||||
onedto.setTask_code(task_code);
|
||||
onedto.setStart_device_code(start_device_code);
|
||||
onedto.setStart_point_code(start_device_code);
|
||||
onedto.setPut_device_code(put_device_code);
|
||||
onedto.setPut_point_code(put_device_code);
|
||||
onedto.setNext_point_code(next_device_code);
|
||||
onedto.setNext_device_code(next_device_code);
|
||||
onedto.setUpdate_time(now);
|
||||
onedto.setCreate_time(now);
|
||||
try {
|
||||
taskserver.create(onedto);
|
||||
flag = true;
|
||||
} catch (Exception e) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//清洗倒料位是没有工单的
|
||||
if (route_link_device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
||||
@@ -580,7 +628,6 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
hailiangCleaningMachineStorageStationDeviceDriver.setMaterial("");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage()));
|
||||
}
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -601,6 +648,23 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized boolean applyInCacheLineTask() throws Exception {
|
||||
Boolean flag = false;
|
||||
|
||||
//生成任务成功
|
||||
if (flag) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功");
|
||||
requireSucess = true;
|
||||
} else {
|
||||
//如果都没有则调用mes接口申请入缓存线
|
||||
//生成任务
|
||||
//前往缓存线
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public synchronized boolean finish_instruction() throws Exception {
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -243,6 +244,21 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
if(!requireSucess){
|
||||
Device device = deviceAppservice.findDeviceByCode(device_code);
|
||||
Integer min_num = Integer.parseInt(device.getExtraValue().get("min_num")+"");
|
||||
// TODO 是否需要手自动状态开启判断条件
|
||||
if ( mode == 1 && storage_stock_num < min_num ) {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "开始申请任务");
|
||||
applyOutCacheLineTask();
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "倒料位数量:"+storage_stock_num+"最小数量:"+min_num+ "申请任务失败,不符合条件");
|
||||
}
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess);
|
||||
|
||||
}
|
||||
|
||||
if(agvphase == 0x0B || agvphase == 0x0F )
|
||||
{
|
||||
if(error == 0 && ObjectUtil.isNotEmpty(inst)){
|
||||
@@ -295,6 +311,64 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized boolean applyOutCacheLineTask() throws Exception {
|
||||
Boolean flag = false;
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("device_code",device_code);
|
||||
json.put("type","2");
|
||||
HttpResponse httpResponse = acsToWmsService.applyOutCacheLineTask(json);
|
||||
String body = httpResponse.body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
String ext_task_id = jsonObject.getString("ext_task_id");
|
||||
String task_code = jsonObject.getString("task_code");
|
||||
String start_device_code = jsonObject.getString("start_device_code");
|
||||
String put_device_code = jsonObject.getString("put_device_code");
|
||||
String next_device_code = jsonObject.getString("next_device_code");
|
||||
String task_type = jsonObject.getString("task_type");
|
||||
TaskDto onedto = new TaskDto();
|
||||
String now = DateUtil.now();
|
||||
onedto.setTask_id(IdUtil.simpleUUID());
|
||||
onedto.setQuantity(String.valueOf(full_number));
|
||||
onedto.setCreate_by(this.getDevice().getDevice_code());
|
||||
onedto.setUpdate_by(this.getDevice().getDevice_code());
|
||||
onedto.setRoute_plan_code("normal");
|
||||
String taskcode = CodeUtil.getNewCode("TASK_NO");
|
||||
onedto.setTask_code("-" + taskcode);
|
||||
onedto.setTask_status("0");
|
||||
onedto.setPriority("101");
|
||||
onedto.setAgv_system_type("1");
|
||||
onedto.setTask_type(task_type);
|
||||
onedto.setExt_task_id(ext_task_id);
|
||||
onedto.setTask_id(IdUtil.simpleUUID());
|
||||
onedto.setTask_code(task_code);
|
||||
onedto.setStart_device_code(start_device_code);
|
||||
onedto.setStart_point_code(start_device_code);
|
||||
onedto.setPut_device_code(put_device_code);
|
||||
onedto.setPut_point_code(put_device_code);
|
||||
onedto.setNext_point_code(next_device_code);
|
||||
onedto.setNext_device_code(next_device_code);
|
||||
onedto.setUpdate_time(now);
|
||||
onedto.setCreate_time(now);
|
||||
|
||||
try {
|
||||
taskserver.create(onedto);
|
||||
flag = true;
|
||||
} catch (Exception e) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage()));
|
||||
}
|
||||
//生成任务成功
|
||||
if (flag) {
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功");
|
||||
requireSucess = true;
|
||||
} else {
|
||||
//如果都没有则调用mes接口申请入缓存线
|
||||
//生成任务
|
||||
//前往缓存线
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void thingToNothing() {
|
||||
log.debug("从有货到无货 清理数据");
|
||||
this.setRequireSucess(false);
|
||||
|
||||
@@ -80,4 +80,19 @@ public class AcsToWmsController {
|
||||
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/applyInCacheLineTask")
|
||||
@Log("ACS申请缓存线入库任务")
|
||||
@ApiOperation("ACS申请缓存线入库任务")
|
||||
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/applyOutCacheLineTask")
|
||||
@Log("ACS系统申请出库任务")
|
||||
@ApiOperation("ACS系统申请出库任务")
|
||||
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,4 +100,20 @@ public interface AcsToWmsService {
|
||||
* @return
|
||||
*/
|
||||
HttpResponse feedbackOrderStatus(JSONObject param);
|
||||
|
||||
/**
|
||||
* ACS申请缓存线入库任务
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
HttpResponse applyInCacheLineTask(JSONObject param);
|
||||
|
||||
/**
|
||||
* ACS系统申请出库任务
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
HttpResponse applyOutCacheLineTask(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -439,7 +439,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public HttpResponse feedbackOrderStatus(JSONObject param) {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
|
||||
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
|
||||
@@ -466,7 +465,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
type = "error";
|
||||
}
|
||||
|
||||
logServer.log(ext_order_id, "feedbackOrderStatus", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, status);
|
||||
logServer.log(ext_order_id, "feedbackOrderStatus", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
|
||||
log.info("feedbackOrderStatus----返回参数{}", result);
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
@@ -479,4 +478,70 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse applyInCacheLineTask(JSONObject param) {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
|
||||
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
|
||||
// TODO 还没向地址表中添加 applyInCacheLineTask地址
|
||||
AddressDto addressDto = addressService.findByCode("applyInCacheLineTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
HttpResponse result = null;
|
||||
log.info("feedbackOrderStatus----请求参数{}", param);
|
||||
try {
|
||||
result = HttpRequest.post(url)
|
||||
.body(String.valueOf(param))
|
||||
.execute();
|
||||
String type = "";
|
||||
if (result.getStatus() == 200) {
|
||||
type = "info";
|
||||
} else {
|
||||
type = "error";
|
||||
}
|
||||
|
||||
logServer.log("", "applyInCacheLineTask", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
|
||||
log.info("applyInCacheLineTask----返回参数{}", result);
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse applyOutCacheLineTask(JSONObject param) {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
|
||||
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
|
||||
// TODO 还没向地址表中添加 applyOutCacheLineTask
|
||||
AddressDto addressDto = addressService.findByCode("applyOutCacheLineTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
HttpResponse result = null;
|
||||
log.info("feedbackOrderStatus----请求参数{}", param);
|
||||
try {
|
||||
result = HttpRequest.post(url)
|
||||
.body(String.valueOf(param))
|
||||
.execute();
|
||||
String type = "";
|
||||
if (result.getStatus() == 200) {
|
||||
type = "info";
|
||||
} else {
|
||||
type = "error";
|
||||
}
|
||||
|
||||
logServer.log("", "applyOutCacheLineTask", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
|
||||
log.info("applyOutCacheLineTask----返回参数{}", result);
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.acs.config.server.AcsConfigService;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver;
|
||||
@@ -753,15 +754,19 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
if(deviceByCode.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){
|
||||
jo1.put("hasGoodStatus", "2");
|
||||
jo1.put("material_type",startdevice.getMaterial_type());
|
||||
} else if (deviceByCode.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){
|
||||
jo1.put("hasGoodStatus", "1");
|
||||
jo1.put("material_type", "");
|
||||
} else {
|
||||
jo1.put("hasGoodStatus", "1");
|
||||
jo1.put("material_type",startdevice.getMaterial_type());
|
||||
}
|
||||
jo1.put("material_type", startdevice.getMaterial_type());
|
||||
jo1.put("quantity", startdevice.getQuantity());
|
||||
jo1.put("remark", startdevice.getRemark());
|
||||
jo1.put("batch", startdevice.getBatch());
|
||||
jo1.put("vehicle_code", entity.getVehicle_code());
|
||||
jo1.put("islock", "false");
|
||||
jo1.put("islock", "0");
|
||||
jo1.put("barrels_code", startdevice.getBarrels_code());
|
||||
jo1.put("cooperate_code", startdevice.getCooperate_code());
|
||||
jo1.put("powder_name", startdevice.getPowder_name());
|
||||
@@ -775,7 +780,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
jo.put("quantity", "");
|
||||
jo.put("remark", "");
|
||||
jo.put("batch", "");
|
||||
jo.put("islock", "false");
|
||||
jo.put("islock", "0");
|
||||
deviceService.changeDeviceStatus(jo);
|
||||
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||
|
||||
@@ -18,6 +18,11 @@ public class TaskDto implements Serializable {
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 任务外部标识
|
||||
*/
|
||||
private String ext_task_id;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@ public class AutoCleanUpLogs {
|
||||
public void run() throws Exception {
|
||||
try {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device");
|
||||
JSONArray array = wo.query().getResultJSONArray(0);
|
||||
JSONArray array = wo.query("1=1","device_code").getResultJSONArray(0);
|
||||
Date now = DateUtil.parse(DateUtil.now());
|
||||
DateTime dateTime = DateUtil.offsetDay(now, -15);
|
||||
String formatDateTime = DateUtil.formatDateTime(dateTime);
|
||||
@@ -39,8 +39,8 @@ public class AutoCleanUpLogs {
|
||||
JSONObject jsonObject = array.getJSONObject(i);
|
||||
String device_code = jsonObject.getString("device_code");
|
||||
mongoTemplate.remove(query,device_code);
|
||||
System.out.println(device_code+"设备日志清除成功---------------------");
|
||||
}
|
||||
System.out.println("设备日志清除成功---------------------");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user