优化
This commit is contained in:
@@ -201,7 +201,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
this.setIsonline(false);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else if (error != 0 && error1 != 1) {
|
||||
} else if (error != 0 || error1 != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
@@ -463,7 +463,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
/*map.put("action", action);
|
||||
map.put("message", message);*/
|
||||
/*map.put("task", this.getTask());*/
|
||||
map.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError())));
|
||||
map.put("temperature", temperature);
|
||||
map.put("countdown_house", countdown_house);
|
||||
map.put("countdown_min", countdown_min);
|
||||
|
||||
@@ -478,7 +478,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
return false;
|
||||
}
|
||||
// 判断相邻烘箱是否有货有异常
|
||||
if (filterNeighbors(startdevice)) return false;
|
||||
// if (filterNeighbors(startdevice)) return false;
|
||||
}
|
||||
|
||||
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
@@ -488,7 +488,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
return false;
|
||||
}
|
||||
// 判断相邻烘箱是否有货有异常
|
||||
if (filterNeighbors(nextdevice)) return false;
|
||||
// if (filterNeighbors(nextdevice)) return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,6 +118,14 @@ public class WmsToAcsController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/writeTime")
|
||||
@Log("下发烘箱时间")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> writeTime(@RequestBody String whereJson) throws Exception {
|
||||
return new ResponseEntity<>(wmstoacsService.writeTime(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getCutpointivtType")
|
||||
@Log("分切下料缓存信息")
|
||||
@SaIgnore
|
||||
|
||||
@@ -120,4 +120,6 @@ public interface WmsToAcsService {
|
||||
Map<String, Object> getTubeMes(String whereJson) throws Exception;
|
||||
|
||||
Map<String, Object> getCutpointivtType(String whereJson)throws Exception;
|
||||
|
||||
Map<String, Object> writeTime(String whereJson) throws Exception;
|
||||
}
|
||||
|
||||
@@ -781,6 +781,46 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> writeTime(String whereJson) throws Exception {
|
||||
log.info("下发烘箱时间--------------:输入参数" + whereJson);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.content("下发烘箱时间-----输入参数:" + whereJson)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
JSONArray datas = JSONArray.parseArray(whereJson);
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject data = (JSONObject) datas.get(i);
|
||||
String device_code = data.getString("device_code");
|
||||
String time = data.getString("house");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
}
|
||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
hongXiangConveyorDeviceDriver.writing("to_time_house", time);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
resultJson.put("message", "操作成功");
|
||||
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
||||
.device_code("下发烘箱时间")
|
||||
.content("下发烘箱时间-----返回参数:" + resultJson)
|
||||
.build();
|
||||
logDto1.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryDevice(String jsonObject) throws Exception {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user