Browse Source

完善日常维护计划巡检任务

zhongwei
段飞宇 2 years ago
parent
commit
9df9761fc8
  1. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java
  2. 2
      hzims-service/hzims-middle/src/main/resources/application.yml
  3. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java
  4. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java
  5. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
  6. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java
  7. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  8. 18
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java

@ -26,7 +26,7 @@ public interface SafeEquipmentTrialFeignClient {
/**
* 分页
*/
@GetMapping("/list")
@GetMapping("/safeEquimentTrial/list")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime")
public R<BladePage<SafeEquipmentTrialVO>> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) ;

2
hzims-service/hzims-middle/src/main/resources/application.yml

@ -20,6 +20,8 @@ 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:

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java

@ -1,8 +1,6 @@
package com.hnac.hzims.operational.main.controller.web;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
@ -33,9 +31,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.SpringQueryMap;
@ -132,10 +128,10 @@ public class AreaMonthlyDetailsController {
/**
* 根据区域和月份分页查询日维护列表
* 根据区域和月份分页查询日维护列表
*/
@ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域和月份分页查询日维护列表")
@ApiOperation(value = "根据区域和月份分页查询日维护列表")
@GetMapping("/queryLogMaintenancePageList/{page}/{size}")
public R<IPage<MaintenanceTaskVo>> queryLogMaintenancePageList(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ -148,11 +144,11 @@ public class AreaMonthlyDetailsController {
/**
* 根据区域和月份分页查询日维护 根据id获取详情
* 根据区域和月份分页查询日维护 根据id获取详情
*/
@GetMapping("/queryLogMaintenancePageList/detail/{id}")
@ApiOperationSupport(order = 40)
@ApiOperation(value = "根据区域和月份分页查询日维护 根据id获取详情")
@ApiOperation(value = "根据区域和月份分页查询日维护 根据id获取详情")
public R<OperMaintenanceTaskEntity> detail(@PathVariable Long id) {
return taskService.detail(id);
}
@ -163,8 +159,14 @@ public class AreaMonthlyDetailsController {
*/
@ApiOperationSupport(order = 50)
@ApiOperation(value = "根据区域和月份分页查询巡检任务")
@GetMapping("/queryCheckTaskPageList")
public R<BladePage<TaskVo>> queryCheckTaskPageList(TaskListQuery task, Query query) {
@GetMapping("/queryCheckTaskPageList/{page}/{size}")
public R<BladePage<TaskVo>> queryCheckTaskPageList(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size,
TaskListQuery task) {
Query query = new Query();
query.setCurrent(page.intValue());
query.setSize(size.intValue());
BladePage<TaskVo> taskVoIPage = areaMonthlyDetailsService.queryCheckTaskPageList(task, query);
return R.data(taskVoIPage);
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java

@ -162,6 +162,7 @@ public class MaintenanceTaskCreateTask {
return;
}
}
BeanUtil.copyProperties(planEntity, taskEntity);
taskService.save(taskEntity);
//生成工作流实例
String processInstanceId = this.startProcessInstance(planEntity.getProcDefId(), taskEntity);
@ -169,6 +170,9 @@ public class MaintenanceTaskCreateTask {
taskService.updateById(taskEntity);
planEntity.setCreateTaskTime(DateUtil.now());
planMapper.updateById(planEntity);
taskEntity = taskService.getById(taskEntity.getId());
//taskEntity.setMessageTemplateId(1646694238095732738L);
this.pushTaskMessage(taskEntity);
}
@ -207,7 +211,7 @@ public class MaintenanceTaskCreateTask {
XxlJobLogger.log("开始保存{}的日常维护消息推送记录",taskEntity.getDisposer());
R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId());
if(templateR.isSuccess() && ObjectUtil.isNotEmpty(templateR.getData())) {
Func.toLongList("",taskEntity.getDisposer()).forEach(userId -> {
Func.toLongList(",",taskEntity.getDisposer()).forEach(userId -> {
// MessagePushRecordDto recordDto = BeanUtil.copy(templateR.getData(),MessagePushRecordDto.class);
// recordDto.setTypes(Arrays.asList(Func.split(recordDto.getType(),",")));
// recordDto.setDeptId(taskEntity.getCreateDept());

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java

@ -341,7 +341,8 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl<OperMaintena
* @return
*/
@Override
public IPage<MaintenanceTaskVo> queryLogMaintenancePageList(Page<OperMaintenanceTaskEntity> pageParam, MaintenanceTaskWithAreaVo areaMonthlyVo) {
public IPage<MaintenanceTaskVo>
queryLogMaintenancePageList(Page<OperMaintenanceTaskEntity> pageParam, MaintenanceTaskWithAreaVo areaMonthlyVo) {
//1.根据区域查询
QueryWrapper<OperMaintenanceTaskEntity> queryWrapper = new QueryWrapper<>();
//维护内容

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java

@ -5,6 +5,8 @@ import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.safeproduct.template.abstracts.TemplateAbstractService;
import com.qiniu.util.Json;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.stereotype.Service;
@ -16,6 +18,7 @@ import java.util.Optional;
/**
* 日常维护计划
*
* @Author WL
* @Version v1.0
* @Serial 1.0
@ -25,7 +28,6 @@ import java.util.Optional;
public class MaintenanceTempleServiceImpl extends TemplateAbstractService {
/**
* 执行具体的业务场景,推送消息
*
@ -33,23 +35,23 @@ public class MaintenanceTempleServiceImpl extends TemplateAbstractService {
*/
@Override
public PlanMsgRecordDto executeTemplateMessage(PlanMsgRecordDto planMsgRecord) {
Map<String,Object> map = new HashMap<>();
map.put("one",
Optional.ofNullable(UserCache.getUser(planMsgRecord.getReceiver())).map(User::getName).orElse(""));
Map<String, Object> map = new HashMap<>();
map.put("one", Optional.ofNullable(UserCache.getUser(planMsgRecord.getReceiver())).map(User::getName).orElse(""));
map.put("two", planMsgRecord.getPlanTime());
planMsgRecord.setContent(JSON.toJSONString(map));
planMsgRecord.setResourceCode("aliyun-safeTool-push");
return planMsgRecord;
}
/**
* 模板状态
*
* @param status
*/
@Override
public Boolean isTemplateStatus(int status) {
return Objects.equals(status,1);
return Objects.equals(status, 1);
}
}

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java

@ -123,6 +123,7 @@ public class StandardTicketInfoController extends BladeController {
@SpringQueryMap StandardTicketWithAreaVo areaMonthlyVo) {
Page<StandardTicketInfoEntity> searchPage = new Page<>(page, size);
BladePage<StandardTicketVo> standardTicketInfoEntity =
standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage);
return R.data(standardTicketInfoEntity);

18
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -56,7 +56,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
Map<String,Object> params = new HashMap<String, Object>(2) {{
put("taskId", "1644624168666353665");
put("signUserIds", AuthUtil.getUserId());
put("signUserIds", "1377143375838359553");
}};
flowClient.startProcessInstanceContainNameByKey(
@ -64,12 +64,16 @@ public class TicketProcessServiceImpl implements TicketProcessService {
"开启工作的任务",
params);
R<List<TaskList>> listR = flowClient.todoList(processDefinitionKey);
listR.getData().forEach(taskList -> {
System.out.println("任务名称:"+taskList);
System.out.println(taskList.getTaskName());
System.out.println(taskList.getStatus());
});
// R<List<TaskList>> listR = flowClient.todoList(processDefinitionKey);
// listR.getData().forEach(taskList -> {
// System.out.println("任务名称:"+taskList);
// System.out.println(taskList.getTaskName());
// System.out.println(taskList.getStatus());
// });
// flowClient.completeTask()
}
}

Loading…
Cancel
Save