Browse Source

#工作任务单

zhongwei
yang_shj 11 months ago
parent
commit
16a26e9d15
  1. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java
  2. 3
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateEarlyVo.java
  3. 10
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java
  4. 41
      hzims-service/hzims-alarm/src/main/resources/application.yml
  5. 7
      hzims-service/hzims-alarm/src/main/resources/bootstrap.yml
  6. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java
  7. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java
  8. 20
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

2
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 { public interface AlarmConstants {
String APP_NAME = "hzims-alarm-ysj"; String APP_NAME = "hzims-alarm";
// 1-集中监控右侧列表 // 1-集中监控右侧列表
Integer IS_RIGHT_TABULATION = 1; Integer IS_RIGHT_TABULATION = 1;

3
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 = "结束时间") @ApiModelProperty(value = "结束时间")
private String endTime; private String endTime;
@ApiModelProperty(value = "站点")
private String stationCode;
} }

10
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; package com.hnac.hzims.alarm.tabulate.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.service.AlarmTabulateService;
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo;
import com.hnac.hzinfo.sdk.core.response.HzPage; 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 com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
@ -19,7 +17,6 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
/** /**
* @author ysj * @author ysj
@ -31,6 +28,12 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService {
private final SoeDataClient soeDataClient; private final SoeDataClient soeDataClient;
/**
* 智能预警
* @param page
* @param tabulateEarly
* @return
*/
@Override @Override
public IPage<StbAnalysisVO> early(IPage<StbAnalysisVO> page, TabulateEarlyVo tabulateEarly) { public IPage<StbAnalysisVO> early(IPage<StbAnalysisVO> page, TabulateEarlyVo tabulateEarly) {
StbAnalysisDTO param = new StbAnalysisDTO(); StbAnalysisDTO param = new StbAnalysisDTO();
@ -41,6 +44,7 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService {
param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER));
} }
param.setPage((int) page.getCurrent()); param.setPage((int) page.getCurrent());
param.setStation(tabulateEarly.getStationCode());
param.setPageSize((int) page.getSize()); param.setPageSize((int) page.getSize());
Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param); Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){ if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){

41
hzims-service/hzims-alarm/src/main/resources/application.yml

@ -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

7
hzims-service/hzims-alarm/src/main/resources/bootstrap.yml

@ -1,7 +0,0 @@
spring:
cloud:
nacos:
discovery:
server-addr: 175.6.40.67:10042

15
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.service.impl.WorkTaskServiceImpl;
import com.hnac.hzims.ticket.repair.vo.RepairVO; import com.hnac.hzims.ticket.repair.vo.RepairVO;
import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@ -28,6 +29,8 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List;
import static com.alibaba.nacos.api.cmdb.pojo.PreservedEntityTypes.service; import static com.alibaba.nacos.api.cmdb.pojo.PreservedEntityTypes.service;
/** /**
@ -43,19 +46,27 @@ public class WorkTaskController extends BladeController {
private final IWorkTaskService workTaskService; private final IWorkTaskService workTaskService;
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 1)
@ApiOperation(value = "分页") @ApiOperation(value = "分页")
public R<IPage<WorkTaskEntity>> list(WorkTaskVO workTask, Query query) { public R<IPage<WorkTaskEntity>> list(WorkTaskVO workTask, Query query) {
return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask)); return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask));
} }
@GetMapping("/workTicketList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页")
public R<List<WorkTicketInfoEntity>> workTicketList(@RequestParam(value = "ticketCode",required = false) String ticketCode) {
return R.data(workTaskService.workTicketList(ticketCode));
}
/** /**
* 工作任务单-开启流程 * 工作任务单-开启流程
* @param workTask * @param workTask
* @return * @return
*/ */
@PostMapping("/startProcess") @PostMapping("/startProcess")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 3)
@ApiOperation(value = "工作任务单") @ApiOperation(value = "工作任务单")
public R startV4(@RequestBody WorkTaskVO workTask) { public R startV4(@RequestBody WorkTaskVO workTask) {
return R.status(workTaskService.start(workTask)); return R.status(workTaskService.start(workTask));

5
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.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; 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.base.BaseService;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
@ -17,4 +20,6 @@ public interface IWorkTaskService extends BaseService<WorkTaskEntity> {
boolean listener(ProcessWorkFlowResponse processWorkFlowResponse); boolean listener(ProcessWorkFlowResponse processWorkFlowResponse);
IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask); IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask);
List<WorkTicketInfoEntity> workTicketList(String ticketName);
} }

20
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.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper; import com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper;
import com.hnac.hzims.ticket.repair.service.IWorkTaskService; import com.hnac.hzims.ticket.repair.service.IWorkTaskService;
import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; 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.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
@ -28,6 +31,7 @@ import org.springblade.system.feign.ISysClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -38,6 +42,8 @@ import java.util.Map;
@RequiredArgsConstructor @RequiredArgsConstructor
public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTaskEntity> implements IWorkTaskService { public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTaskEntity> implements IWorkTaskService {
private final IWorkTicketInfoService workTicketInfoService;
private final IFlowClient flowClient; private final IFlowClient flowClient;
private final ISysClient sysClient; private final ISysClient sysClient;
@ -67,6 +73,20 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
} }
/** /**
* 查询工作票数据
* @param ticketCode
* @return
*/
@Override
public List<WorkTicketInfoEntity> workTicketList(String ticketCode) {
if(StringUtil.isEmpty(ticketCode)){
return workTicketInfoService.list();
}
return workTicketInfoService.list(Wrappers.<WorkTicketInfoEntity>lambdaQuery()
.like(WorkTicketInfoEntity::getCode,ticketCode));
}
/**
* 工作任务单-开启流程 * 工作任务单-开启流程
* @param workTask * @param workTask
* @return * @return

Loading…
Cancel
Save