From a171e5b06985546be77da7517c0b1788525c76a9 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Wed, 28 Aug 2024 19:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=BA=BFyaml=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../duty/mapper/ImsDutyRecQRRecordMapper.java | 3 +- .../controller/StationVideoTypeController.java | 5 +- .../station/service/IStationVideoTypeService.java | 6 +- .../service/impl/StationVideoTypeServiceImpl.java | 12 +- .../controller/DistributeWorkOrderController.java | 15 +- .../service/IDistributeWorkOrderService.java | 13 +- .../impl/DistributeWorkOrderServiceImpl.java | 151 --------------------- 7 files changed, 6 insertions(+), 199 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyRecQRRecordMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyRecQRRecordMapper.java index 1699cc7..00c0f62 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyRecQRRecordMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyRecQRRecordMapper.java @@ -25,7 +25,6 @@ public interface ImsDutyRecQRRecordMapper extends UserDataScopeBaseMapper selectPageList(IPage page,@Param(value = "vo") ImsDutyRecQRRecordVo vo); + List selectPageList(@Param(value = "page")IPage page,@Param(value = "vo") ImsDutyRecQRRecordVo vo); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java index 8b73cb7..b750e71 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java @@ -225,10 +225,7 @@ public class StationVideoTypeController extends BladeController { } - @RequestMapping(value = "/getVideoReviewerToken", method = {RequestMethod.GET, RequestMethod.POST}) - public R getVideoReviewerToken() { - return R.data(stationVideoTypeService.getVideoReviewerToken()); - } + @GetMapping("/getVideoMonitorByAgency") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java index 619386a..cb79a30 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java @@ -48,11 +48,7 @@ public interface IStationVideoTypeService extends IService getVideoByIds(String ids,String randomCode); - /** - * 获取视频查看人员Token - * @return 视频查看人员Token - */ - String getVideoReviewerToken(); + /** * 获取海康威视各站点列表 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java index 61749bc..c2227e9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java @@ -58,8 +58,6 @@ public class StationVideoTypeServiceImpl extends ServiceImpl getHikVisionStations() { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/controller/DistributeWorkOrderController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/controller/DistributeWorkOrderController.java index 545f392..6e1b7a7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/controller/DistributeWorkOrderController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/controller/DistributeWorkOrderController.java @@ -32,21 +32,8 @@ public class DistributeWorkOrderController { private final IOperAccessTaskService operAccessTaskService; private final IOperDefectService operDefectService; - @GetMapping("/testDistributeWorkOrder") - @ApiOperation(value = "检修工单派发",notes = "检修工单派发") - @ApiImplicitParam(name = "operAccessTaskEntity", value = "检修任务", paramType = "body", dataType = "OperAccessTaskEntity") - @ApiOperationSupport(order = 1) - public R distributeWorkOrder(@RequestBody OperAccessTaskEntity operAccessTaskEntity){ - return distributeWorkOrderService.distributeAccessTask(operAccessTaskEntity); - } - @GetMapping("/testDistributeDefect") - @ApiOperation(value = "消缺工单派发",notes = "消缺工单派发") - @ApiImplicitParam(name = "operAccessTaskEntity", value = "消缺对象", paramType = "query", dataType = "operDefectEntity") - @ApiOperationSupport(order = 2) - public R testDistributeDefect(@RequestBody OperDefectEntity operDefectEntity){ - return distributeWorkOrderService.distributeDefectTask(operDefectEntity); - } + @GetMapping("/getAccessWorkOrderList") @ApiOperation(value = "获取检修工单列表",notes = "获取检修工单列表") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/IDistributeWorkOrderService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/IDistributeWorkOrderService.java index 77e7955..07a2702 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/IDistributeWorkOrderService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/IDistributeWorkOrderService.java @@ -5,19 +5,8 @@ import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import org.springblade.core.tool.api.R; @Deprecated public interface IDistributeWorkOrderService { - /** - * 派发检修任务 - * @param operAccessTaskEntity - * @return - */ - R distributeAccessTask(OperAccessTaskEntity operAccessTaskEntity); - /** - * 派发消缺任务 - * @param operDefectEntity - * @return - */ - R distributeDefectTask(OperDefectEntity operDefectEntity); + /** * 获取检修工单列表 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java index 98f7dc6..7b2b594 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java @@ -51,11 +51,6 @@ public class DistributeWorkOrderServiceImpl implements IDistributeWorkOrderServi private final IOperPhenomenonService operPhenomenonService; private final RedisTemplate redisTemplate; - @Value("${url.water-out.orderCrtPackage}") - private String orderCrtPackageUrl; - - @Value("${url.water-out.orderCrtGrabPackage}") - private String orderCrtGrabPackageUrl; @Value("${hzims.operation.workOrder.access}") private String accessWorkOrderKey; @@ -63,152 +58,6 @@ public class DistributeWorkOrderServiceImpl implements IDistributeWorkOrderServi @Value("${hzims.operation.workOrder.defect}") private String defectWorkOrderKey; - @Override - public R distributeAccessTask(OperAccessTaskEntity operAccessTaskEntity){ - if(ObjectUtil.isEmpty(operAccessTaskEntity)){ - return R.fail("暂无检修记录!"); - } - OrderPackageDto orderPackageDto = new OrderPackageDto(); - orderPackageDto.setCreater(AuthUtil.getUser().getUserName()); - orderPackageDto.setFloatRange("1"); - orderPackageDto.setProjectCost(0); - /*结束时间需大于当前时间*/ - orderPackageDto.setFinishTime(DateUtil.format(LocalDateTime.now().plusHours(5),DateUtil.PATTERN_DATETIME)); - orderPackageDto.setProjectCode(operAccessTaskEntity.getId().toString()); - orderPackageDto.setProjectName(operAccessTaskEntity.getName()); - Publisher publisher = new Publisher(); - publisher.setId(operAccessTaskEntity.getCreateUser().toString()); - User user = UserCache.getUser(operAccessTaskEntity.getCreateUser()); - publisher.setContactAddress("123123"); - publisher.setContactName("123123"); - publisher.setContactPhone(user.getPhone()); - publisher.setPublisher(user.getRealName()); - publisher.setPublisherScale("123123"); - orderPackageDto.setPublisher(publisher); - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - orderPackageDto.setStartTime(fmt.format(operAccessTaskEntity.getPlanStartTime())); - orderPackageDto.setWaterId(operAccessTaskEntity.getCreateDept().toString()); - //完善招标信息 - List tenderList = new ArrayList<>(); - TenderDto tenderDto = new TenderDto(); - //采用大修工单 - tenderDto.setOrderType("6"); - ZoneId zoneId = ZoneId.systemDefault(); - LocalDateTime planStartTime = LocalDateTime.ofInstant(operAccessTaskEntity.getPlanStartTime().toInstant(),zoneId); - LocalDateTime planEndTime = LocalDateTime.ofInstant(operAccessTaskEntity.getPlanEndTime().toInstant(),zoneId); - Long workHours = Duration.between(planStartTime,planEndTime).toHours(); - tenderDto.setWorkHours(workHours.intValue()); - tenderDto.setWorkPrice("0"); - //大修工单内容 - List overhaulOrderList = new ArrayList<>(); - OtherOrderDTO overHaulOrder = new OtherOrderDTO(); - overHaulOrder.setOrderType("6"); - overHaulOrder.setWorkCode(operAccessTaskEntity.getCode()); - overHaulOrder.setTenantId(operAccessTaskEntity.getTenantId()); - overHaulOrder.setWorkHour(workHours.intValue()); - overHaulOrder.setWorkName(operAccessTaskEntity.getName()); - EmInfoEntity emInfoEntity = emInfoClient.getByCode(operAccessTaskEntity.getEmCode()); - overHaulOrder.setWorkPos(Optional.ofNullable(emInfoEntity).map(EmInfoEntity::getName).orElse(null)); - overHaulOrder.setWorkTime(DateUtil.format(operAccessTaskEntity.getPlanStartTime(),DateUtil.PATTERN_DATETIME)); - overhaulOrderList.add(overHaulOrder); - tenderDto.setOverhaulOrderList(overhaulOrderList); - tenderList.add(tenderDto); - orderPackageDto.setTenderList(tenderList); - - log.info("-------------------------------------派发工单对象为-------------------------------------"); - log.info(JSON.toJSONString(orderPackageDto)); - HttpResponse httpResponse = HttpClientUtils.post(orderCrtPackageUrl, JSONObject.toJSONString(orderPackageDto)); - if(httpResponse.getCode() == 200){ - JSONObject jsonObject = JSONObject.parseObject(httpResponse.getData()); - try{ - String id = JSONObject.parseObject(jsonObject.getString("data")).getString("id"); - //将工单处理结果暂存入redis中 -// long maxSize = redisTemplate.opsForZSet().zCard(accessWorkOrderKey); -// redisTemplate.opsForZSet().add(accessWorkOrderKey,id, maxSize > 0 ? (maxSize - 1) : 0L); - } - catch (Exception e){ - e.printStackTrace(); - } - } - return R.data("调用成功!"); - } - - @Override - public R distributeDefectTask(OperDefectEntity operDefectEntity){ - if(ObjectUtil.isEmpty(operDefectEntity)){ - return R.fail("暂无消缺单记录!"); - } - GrabPackageDTO grabPackageDTO = new GrabPackageDTO(); - grabPackageDTO.setCreateUser(AuthUtil.getUser().getUserName()); - grabPackageDTO.setFinishTime(DateUtil.format(LocalDateTime.now().plusHours(8),DateUtil.PATTERN_DATETIME)); - List repairOrderAcptDtos = new ArrayList<>(); - RepairOrderAcptDto repairOrderAcptDto = new RepairOrderAcptDto(); - //完善工单内容 - if(StringUtil.isNotBlank(operDefectEntity.getDefectCode())){ - //根据现象、缺陷编码获取现象 - OperPhenomenonEntity operPhenomenonEntity = operPhenomenonService.getOne(new LambdaQueryWrapper(){{ - eq(OperPhenomenonEntity::getDefectCode,operDefectEntity.getDefectCode()); - }}.last("limit 1")); - if(ObjectUtil.isNotEmpty(operPhenomenonEntity)){ - if(StringUtil.isNotBlank(operPhenomenonEntity.getEmCode())){ - repairOrderAcptDto.setEquCode(operPhenomenonEntity.getEmCode()); - EmInfoEntity emInfoEntity = emInfoClient.getByCode(operPhenomenonEntity.getEmCode()); - repairOrderAcptDto.setEquName(Optional.ofNullable(emInfoEntity).map(EmInfoEntity::getName).orElse(null)); - } - if(StringUtil.isNotBlank(operPhenomenonEntity.getFaultCode())){ - List contentDTOList = new ArrayList<>(); - RepairOrderContentDTO repairOrderContentDTO = new RepairOrderContentDTO(); - repairOrderContentDTO.setFaultCode(operPhenomenonEntity.getFaultCode()); - repairOrderContentDTO.setFaultName(operPhenomenonEntity.getFaultName()); - contentDTOList.add(repairOrderContentDTO); - repairOrderAcptDto.setContentList(contentDTOList); - } - } - } - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String startTime = Optional.ofNullable(operDefectEntity.getActStartTime()).map(time->fmt.format(time)).orElse(null); - repairOrderAcptDto.setStartTime(startTime); - R deptR = sysClient.getDept(operDefectEntity.getCreateDept()); - repairOrderAcptDto.setEquType("010101"); - repairOrderAcptDto.setOrgName("长沙敢胜院"); - repairOrderAcptDto.setCreateUser(operDefectEntity.getCreateUser().toString()); - repairOrderAcptDto.setTenantId(operDefectEntity.getTenantId()); - repairOrderAcptDto.setWorkTime(DateUtil.format(operDefectEntity.getActStartTime(),DateUtil.PATTERN_DATETIME)); - repairOrderAcptDto.setFaultDisp("捞渣、清渣装置故障"); - repairOrderAcptDto.setInstallPos("粗格栅间"); - repairOrderAcptDto.setIsBallot(0); - repairOrderAcptDto.setUserName(UserCache.getUser(operDefectEntity.getCreateUser()).getName()); - repairOrderAcptDto.setIsMajorRepairs("一般维修"); - repairOrderAcptDto.setRepairType("general_repair"); - repairOrderAcptDto.setSeverity("严重"); - repairOrderAcptDto.setSpecModel("GL1400"); - repairOrderAcptDto.setTimeLimit("6.00"); - repairOrderAcptDto.setWorkCode(operDefectEntity.getId().toString()); - repairOrderAcptDto.setWorkPrice(0); - repairOrderAcptDto.setWorkRatio(1); - repairOrderAcptDto.setWorkHour(4); - - List repairOrderPrognosisDTOS = new ArrayList<>(); - RepairOrderPrognosisDTO repairOrderPrognosisDTO = new RepairOrderPrognosisDTO(); - repairOrderPrognosisDTO.setCause("测试..."); - repairOrderPrognosisDTO.setDescribeContent("测试..."); - repairOrderPrognosisDTO.setProjectCode("test0000001"); - repairOrderPrognosisDTO.setProjectContent("测试...."); - repairOrderPrognosisDTO.setProjectName("测试..."); - repairOrderPrognosisDTO.setWorkHour("4.00"); - repairOrderPrognosisDTOS.add(repairOrderPrognosisDTO); - repairOrderAcptDto.setPrognosisList(repairOrderPrognosisDTOS); - - repairOrderAcptDtos.add(repairOrderAcptDto); - grabPackageDTO.setRepairOrderAcptDtos(repairOrderAcptDtos); - log.info("-------------------------------------派发消缺单对象为-------------------------------------"); - log.info(JSON.toJSONString(grabPackageDTO)); - HttpResponse httpResponse = HttpClientUtils.post(orderCrtGrabPackageUrl, JSONObject.toJSONString(grabPackageDTO)); - //将工单处理结果暂存入redis中 - long maxSize = redisTemplate.opsForZSet().zCard(defectWorkOrderKey); - //redisTemplate.opsForZSet().add(defectWorkOrderKey,"", maxSize > 0 ? (maxSize - 1) : 0L); - return R.data("调用成功!"); - } @Override public R getAccessWorkOrderList(){