From 16a26e9d150bdae65ddc3de499f225b54fa13354 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 12 Jan 2024 16:06:38 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=B7=A5=E4=BD=9C=E4=BB=BB=E5=8A=A1=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alarm/config/constants/AlarmConstants.java | 2 +- .../hzims/alarm/tabulate/vo/TabulateEarlyVo.java | 3 ++ .../service/impl/AlarmTabulateServiceImpl.java | 10 ++++-- .../hzims-alarm/src/main/resources/application.yml | 41 ---------------------- .../hzims-alarm/src/main/resources/bootstrap.yml | 7 ---- .../repair/controller/WorkTaskController.java | 15 ++++++-- .../ticket/repair/service/IWorkTaskService.java | 5 +++ .../repair/service/impl/WorkTaskServiceImpl.java | 20 +++++++++++ 8 files changed, 49 insertions(+), 54 deletions(-) delete mode 100644 hzims-service/hzims-alarm/src/main/resources/application.yml delete mode 100644 hzims-service/hzims-alarm/src/main/resources/bootstrap.yml diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java index 8d08441..2f800d9 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java @@ -8,7 +8,7 @@ import java.util.List; */ public interface AlarmConstants { - String APP_NAME = "hzims-alarm-ysj"; + String APP_NAME = "hzims-alarm"; // 1-集中监控右侧列表 Integer IS_RIGHT_TABULATION = 1; diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateEarlyVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateEarlyVo.java index d58684b..9c77c28 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateEarlyVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateEarlyVo.java @@ -17,4 +17,7 @@ public class TabulateEarlyVo { @ApiModelProperty(value = "结束时间") private String endTime; + + @ApiModelProperty(value = "站点") + private String stationCode; } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java index b14ed6a..0a83591 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java @@ -1,7 +1,6 @@ package com.hnac.hzims.alarm.tabulate.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.hnac.hzims.alarm.config.vo.AlarmHandleVo; import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; import com.hnac.hzinfo.sdk.core.response.HzPage; @@ -11,7 +10,6 @@ import com.hnac.hzinfo.sdk.v5.soe.dto.StbAnalysisDTO; import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springblade.core.mp.support.Query; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.StringUtil; @@ -19,7 +17,6 @@ import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Collections; /** * @author ysj @@ -31,6 +28,12 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { private final SoeDataClient soeDataClient; + /** + * 智能预警 + * @param page + * @param tabulateEarly + * @return + */ @Override public IPage early(IPage page, TabulateEarlyVo tabulateEarly) { StbAnalysisDTO param = new StbAnalysisDTO(); @@ -41,6 +44,7 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); } param.setPage((int) page.getCurrent()); + param.setStation(tabulateEarly.getStationCode()); param.setPageSize((int) page.getSize()); Result> result = soeDataClient.pageStbAnalysis(param); if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){ diff --git a/hzims-service/hzims-alarm/src/main/resources/application.yml b/hzims-service/hzims-alarm/src/main/resources/application.yml deleted file mode 100644 index 180d5d3..0000000 --- a/hzims-service/hzims-alarm/src/main/resources/application.yml +++ /dev/null @@ -1,41 +0,0 @@ -#服务器端口 -server: - port: 8400 - - -#数据源配置 -spring: - main: - allow-bean-definition-overriding: true - #排除DruidDataSourceAutoConfigure - autoconfigure: - exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure - datasource: - url: jdbc:mysql://192.168.1.20:3576/dev_hzims_middle?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true - username: root - password: 123 - - -#mybatis-plus配置 -mybatis-plus: - mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.hnac.hzims.**.entity - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - -#swagger扫描路径配置 -swagger: - base-packages: - - org.springbalde - - com.hnac - -blade: - data-scope: - enabled: false - lock: - enabled: true - address: redis://192.168.1.20:3577 - password: 1qaz2WSX@redis - database: 0 - ssl: false diff --git a/hzims-service/hzims-alarm/src/main/resources/bootstrap.yml b/hzims-service/hzims-alarm/src/main/resources/bootstrap.yml deleted file mode 100644 index 0abf99a..0000000 --- a/hzims-service/hzims-alarm/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,7 +0,0 @@ -spring: - cloud: - nacos: - discovery: - server-addr: 175.6.40.67:10042 - - diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java index 062489b..c860542 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java @@ -13,6 +13,7 @@ import com.hnac.hzims.ticket.repair.service.IWorkTaskService; import com.hnac.hzims.ticket.repair.service.impl.WorkTaskServiceImpl; import com.hnac.hzims.ticket.repair.vo.RepairVO; import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -28,6 +29,8 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; +import java.util.List; + import static com.alibaba.nacos.api.cmdb.pojo.PreservedEntityTypes.service; /** @@ -43,19 +46,27 @@ public class WorkTaskController extends BladeController { private final IWorkTaskService workTaskService; @GetMapping("/list") - @ApiOperationSupport(order = 2) + @ApiOperationSupport(order = 1) @ApiOperation(value = "分页") public R> list(WorkTaskVO workTask, Query query) { return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask)); } + @GetMapping("/workTicketList") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页") + public R> workTicketList(@RequestParam(value = "ticketCode",required = false) String ticketCode) { + return R.data(workTaskService.workTicketList(ticketCode)); + } + + /** * 工作任务单-开启流程 * @param workTask * @return */ @PostMapping("/startProcess") - @ApiOperationSupport(order = 1) + @ApiOperationSupport(order = 3) @ApiOperation(value = "工作任务单") public R startV4(@RequestBody WorkTaskVO workTask) { return R.status(workTaskService.start(workTask)); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java index fce0901..9595912 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java @@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; +import java.util.List; + /** * @author ysj */ @@ -17,4 +20,6 @@ public interface IWorkTaskService extends BaseService { boolean listener(ProcessWorkFlowResponse processWorkFlowResponse); IPage workTaskService(IPage page, WorkTaskVO workTask); + + List workTicketList(String ticketName); } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java index f75f160..26e35ba 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java @@ -4,11 +4,14 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper; import com.hnac.hzims.ticket.repair.service.IWorkTaskService; import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; @@ -28,6 +31,7 @@ import org.springblade.system.feign.ISysClient; import org.springframework.stereotype.Service; import java.util.Date; +import java.util.List; import java.util.Map; /** @@ -38,6 +42,8 @@ import java.util.Map; @RequiredArgsConstructor public class WorkTaskServiceImpl extends BaseServiceImpl implements IWorkTaskService { + private final IWorkTicketInfoService workTicketInfoService; + private final IFlowClient flowClient; private final ISysClient sysClient; @@ -67,6 +73,20 @@ public class WorkTaskServiceImpl extends BaseServiceImpl workTicketList(String ticketCode) { + if(StringUtil.isEmpty(ticketCode)){ + return workTicketInfoService.list(); + } + return workTicketInfoService.list(Wrappers.lambdaQuery() + .like(WorkTicketInfoEntity::getCode,ticketCode)); + } + + /** * 工作任务单-开启流程 * @param workTask * @return