更新
This commit is contained in:
@@ -142,6 +142,26 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info("未找到指令号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
if(ObjectUtil.isNotEmpty(this.device.getExtraValue().get("wait"))
|
||||
&& StrUtil.equals("true",this.device.getExtraValue().get("wait").toString())){
|
||||
//
|
||||
if(standardOrdinarySiteDeviceDriver.getOption() == 1 ){
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
} else {
|
||||
log.info("等待LMS系统进行确认允许取货,设备号{}", device_code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
}
|
||||
|
||||
@@ -158,6 +158,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
requireEmptyOutSuccess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
if(mode == 6){
|
||||
requireEmptyInSuccess = false;
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
@@ -211,15 +214,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
finish_instruction();
|
||||
logServer.deviceExecuteLog(device_code, "", "", "入库输送线任务开始反馈完成状态,反馈成功,指令号:" + task);
|
||||
} else {
|
||||
// if (!StrUtil.equals(inst.getExecute_code(), this.device_code)) {
|
||||
// inst.setExecute_device_code(this.device_code);
|
||||
// instructionService.update(inst);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task);
|
||||
message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成";
|
||||
inst_message = null;
|
||||
}
|
||||
@@ -230,21 +230,11 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||
}
|
||||
|
||||
// if (!this.itemProtocol.getIsonline()) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
// message = "信号量同步异常";
|
||||
// //未联机
|
||||
// } else
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
// } else if (error != 0) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
// message = "有报警";
|
||||
// //无报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -257,21 +247,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
List toInstructions;
|
||||
|
||||
|
||||
// if (mode == 2 && move != 0 && task > 0) {
|
||||
// //inst_message
|
||||
// inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
// if (inst != null) {
|
||||
// inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||
// if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
// finish_instruction();
|
||||
// }
|
||||
// if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||
// inst.setInstruction_status("1");
|
||||
// instructionService.update(inst);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
@@ -881,13 +856,11 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
message = "申请空盘入库接口不通";
|
||||
requireEmptyInSuccess = true;
|
||||
} else {
|
||||
if (jo.getInteger("status") == 200) {
|
||||
message = "申请空盘入库成功";
|
||||
requireEmptyInSuccess = true;
|
||||
} else {
|
||||
requireEmptyInSuccess = true;
|
||||
message = "申请空盘入库失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
||||
String message;
|
||||
|
||||
// 1 上位系统允许进入 2 上位系统允许离开
|
||||
int status = 0;
|
||||
int option = 0;
|
||||
|
||||
int agvphase = 0;
|
||||
int index = 0;
|
||||
|
||||
@@ -94,4 +94,11 @@ public class WmsToAcsController {
|
||||
return new ResponseEntity<>(wmstoacsService.putPlusPullAction(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateTask")
|
||||
@Log(value = "WMS更新任务点位状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS更新任务点位状态")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> updateTask(@RequestBody String whereJson){
|
||||
return new ResponseEntity<>(wmstoacsService.updateTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,4 +84,12 @@ public interface WmsToAcsService {
|
||||
Map<String, Object> putPlusPullAction(String whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 更新任务点位状态
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> updateTask(String whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.common.IDriverService;
|
||||
import org.nl.acs.common.StandardOrdinarySiteDevice;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver;
|
||||
@@ -16,6 +17,8 @@ import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDe
|
||||
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDefination;
|
||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.ext.wms.data.*;
|
||||
import org.nl.acs.ext.wms.liKuData.Resp;
|
||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||
@@ -728,9 +731,41 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> updateTask(String whereJson) {
|
||||
JSONArray datas = JSONArray.parseArray(whereJson);
|
||||
log.info("updateTask--------------:输入参数" + datas.toString());
|
||||
JSONObject map = new JSONObject();
|
||||
if (datas.size() > 0) {
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject jsonObject = datas.getJSONObject(i);
|
||||
String device_code = jsonObject.getString("device_code");
|
||||
String task_code = jsonObject.getString("task_code");
|
||||
//1-允许取放; 2-允许离开
|
||||
String option = jsonObject.getString("option");
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
Device device_k = deviceAppService.findDeviceByCode(device_code+"_K");
|
||||
Device device_m = deviceAppService.findDeviceByCode(device_code+"_M");
|
||||
|
||||
if(device_k.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_k.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
|
||||
}
|
||||
if(device_m.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK);
|
||||
resultJson.put("message", "操作成功");
|
||||
resultJson.put("data", map);
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user