diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 06f6478..c0ddcd3 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -329,14 +329,8 @@ public class DeviceServiceImpl extends CommonServiceImpl i @Override @Transactional(rollbackFor = Exception.class) public void deleteAll(String[] ids) { -// WQLObject wo = WQLObject.getWQLObject("acs_device"); -// WQLObject storageTab = WQLObject.getWQLObject("acs_storage_cell"); -// //路由路线表【acs_route_line】 -// WQLObject routeLineTab = WQLObject.getWQLObject("acs_route_line"); -// //路由路线表【stage_actor】 -// WQLObject stageActorTab = WQLObject.getWQLObject("stage_actor"); + for (String device_id : ids) { -// JSONObject deviceJson = wo.query("device_id = '" + device_id + "'").uniqueResult(0); Device deviceJson = new LambdaQueryChainWrapper<>(deviceMapper) .eq(Device::getDevice_id, device_id) .one(); @@ -345,7 +339,6 @@ public class DeviceServiceImpl extends CommonServiceImpl i } String device_code = deviceJson.getDevice_code(); log.debug("删除设备时候判断路由是否存在,如果存在,则不允许删除设备!"); -// JSONObject json = routeLineTab.query("device_code = '" + device_code + "' or next_device_code = '" + device_code + "'").uniqueResult(0); RouteLine json = new LambdaQueryChainWrapper<>(routeLineMapper) .eq(RouteLine::getDevice_code, device_code) .or().eq(RouteLine::getNext_device_code,device_code) @@ -353,25 +346,6 @@ public class DeviceServiceImpl extends CommonServiceImpl i if (json != null) { throw new BadRequestException("设备:【" + device_code + "】在路由已存在,无法删除!"); } - log.debug("删除舞台里面的设备!"); -// Map map = new HashMap<>(); -// map.put("device_id", ""); -// map.put("device_code", ""); -// map.put("device_name", ""); -// stageActorTab.update(map, "device_code = '" + device_code + "'"); -// stageActorMapper.lambdaUpdate().eq(StageActor::getDevice_code,device_code) -// .set(StageActor::getDevice_code,"") -// .set(StageActor::getDevice_name,"") -// .update(); - log.debug("根据设备编码查询在缓存里面的舞台数据,并删除掉!"); -// JSONArray jsonArr = WQL.getWO("QStage_01").addParam("flag", "1").addParam("device_code", device_code).process().getResultJSONArray(0); - -// List stageList = stageMapper.selectByDeviceCode(device_code); -// for (int i = 0; i < stageList.size(); i++) { -// String stage_code = stageList.get(i).getStage_code(); -// redisUtils.del("stage:mst:" + stage_code); -// redisUtils.del("stage:dtl:" + stage_code); -// } log.debug("删除缓存里面的设备!"); Device deviceByCode = deviceAppService.findDeviceByCode(device_code); List allDevice = deviceAppService.findAllDevice(); @@ -382,29 +356,21 @@ public class DeviceServiceImpl extends CommonServiceImpl i iterator.remove(); } } - - -// allDevice.remove(deviceByCode); - log.info("设备删除成功!"); if (deviceByCode != null) { if (StrUtil.equals("storage", deviceByCode.getDeviceDriverDefination().getFitDeviceTypes().get(0).name())) { -// storageTab.delete("substring_index( storage_code,'-',1)= '" + device_code + "'"); - storageCellMapper.deleteByStorageCode(device_code); + storageCellMapper.deleteByStorageCode(device_code); } else { -// JSONObject data = storageTab.query("storage_code ='" + device_code + "'").uniqueResult(0); - StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper) + StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper) .eq(StorageCell::getStorage_code, device_code) .one(); if (storageCell != null) { -// storageTab.delete("storage_code = '" + device_code + "'"); Map map = new HashMap<>(); map.put("storage_code",device_code); storageCellMapper.deleteByMap(map); } } } -// wo.delete("device_id = '" + device_id + "'"); Map map = new HashMap<>(); map.put("device_id",device_id); deviceMapper.deleteByMap(map); diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java index fb6c258..02ff5b5 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java @@ -169,8 +169,7 @@ public class CwSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devic acsToWmsService.notify(request); resultSucess=true; }else if (move ==1 && - (this.getDeviceCode().startsWith("ZJBDJW")|| - this.getDeviceCode().startsWith("FJBKJDJW"))&&!resultSucess) { + (this.getDeviceCode().startsWith("ZJBDJW"))&&!resultSucess) { //点位数量变更后通知lms FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); request.setState("3"); @@ -178,6 +177,14 @@ public class CwSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devic request.setType("2"); acsToWmsService.notify(request); resultSucess=true; + }else if (move ==1 &&this.getDeviceCode().startsWith("FJBKJDJW")&&!resultSucess) { + //点位数量变更后通知lms + FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); + request.setState("1"); + request.setDevice_code(this.getDeviceCode()); + request.setType("2"); + acsToWmsService.notify(request); + resultSucess=true; }else if(move ==0 && this.getDeviceCode().startsWith("HCQ06") &&!resultSucess){ //点位数量变更后通知lms FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();