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) @ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime")
public R<BladePage<SafeEquipmentTrialVO>> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) ; 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 mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔 #实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity typeAliasesPackage: com.hnac.hzims.**.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#swagger扫描路径配置 #swagger扫描路径配置
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; 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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
@ -33,9 +31,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.cloud.openfeign.SpringQueryMap;
@ -132,10 +128,10 @@ public class AreaMonthlyDetailsController {
/** /**
* 根据区域和月份分页查询日维护列表 * 根据区域和月份分页查询日维护列表
*/ */
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域和月份分页查询日维护列表") @ApiOperation(value = "根据区域和月份分页查询日维护列表")
@GetMapping("/queryLogMaintenancePageList/{page}/{size}") @GetMapping("/queryLogMaintenancePageList/{page}/{size}")
public R<IPage<MaintenanceTaskVo>> queryLogMaintenancePageList( public R<IPage<MaintenanceTaskVo>> queryLogMaintenancePageList(
@ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page, @ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page,
@ -148,11 +144,11 @@ public class AreaMonthlyDetailsController {
/** /**
* 根据区域和月份分页查询日维护 根据id获取详情 * 根据区域和月份分页查询日维护 根据id获取详情
*/ */
@GetMapping("/queryLogMaintenancePageList/detail/{id}") @GetMapping("/queryLogMaintenancePageList/detail/{id}")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "根据区域和月份分页查询日维护 根据id获取详情") @ApiOperation(value = "根据区域和月份分页查询日维护 根据id获取详情")
public R<OperMaintenanceTaskEntity> detail(@PathVariable Long id) { public R<OperMaintenanceTaskEntity> detail(@PathVariable Long id) {
return taskService.detail(id); return taskService.detail(id);
} }
@ -163,8 +159,14 @@ public class AreaMonthlyDetailsController {
*/ */
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "根据区域和月份分页查询巡检任务") @ApiOperation(value = "根据区域和月份分页查询巡检任务")
@GetMapping("/queryCheckTaskPageList") @GetMapping("/queryCheckTaskPageList/{page}/{size}")
public R<BladePage<TaskVo>> queryCheckTaskPageList(TaskListQuery task, Query query) { 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); BladePage<TaskVo> taskVoIPage = areaMonthlyDetailsService.queryCheckTaskPageList(task, query);
return R.data(taskVoIPage); 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; return;
} }
} }
BeanUtil.copyProperties(planEntity, taskEntity);
taskService.save(taskEntity); taskService.save(taskEntity);
//生成工作流实例 //生成工作流实例
String processInstanceId = this.startProcessInstance(planEntity.getProcDefId(), taskEntity); String processInstanceId = this.startProcessInstance(planEntity.getProcDefId(), taskEntity);
@ -169,6 +170,9 @@ public class MaintenanceTaskCreateTask {
taskService.updateById(taskEntity); taskService.updateById(taskEntity);
planEntity.setCreateTaskTime(DateUtil.now()); planEntity.setCreateTaskTime(DateUtil.now());
planMapper.updateById(planEntity); planMapper.updateById(planEntity);
taskEntity = taskService.getById(taskEntity.getId());
//taskEntity.setMessageTemplateId(1646694238095732738L);
this.pushTaskMessage(taskEntity); this.pushTaskMessage(taskEntity);
} }
@ -207,7 +211,7 @@ public class MaintenanceTaskCreateTask {
XxlJobLogger.log("开始保存{}的日常维护消息推送记录",taskEntity.getDisposer()); XxlJobLogger.log("开始保存{}的日常维护消息推送记录",taskEntity.getDisposer());
R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId()); R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId());
if(templateR.isSuccess() && ObjectUtil.isNotEmpty(templateR.getData())) { 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); // MessagePushRecordDto recordDto = BeanUtil.copy(templateR.getData(),MessagePushRecordDto.class);
// recordDto.setTypes(Arrays.asList(Func.split(recordDto.getType(),","))); // recordDto.setTypes(Arrays.asList(Func.split(recordDto.getType(),",")));
// recordDto.setDeptId(taskEntity.getCreateDept()); // 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 * @return
*/ */
@Override @Override
public IPage<MaintenanceTaskVo> queryLogMaintenancePageList(Page<OperMaintenanceTaskEntity> pageParam, MaintenanceTaskWithAreaVo areaMonthlyVo) { public IPage<MaintenanceTaskVo>
queryLogMaintenancePageList(Page<OperMaintenanceTaskEntity> pageParam, MaintenanceTaskWithAreaVo areaMonthlyVo) {
//1.根据区域查询 //1.根据区域查询
QueryWrapper<OperMaintenanceTaskEntity> queryWrapper = new QueryWrapper<>(); 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.message.fegin.IMessageClient;
import com.hnac.hzims.safeproduct.template.abstracts.TemplateAbstractService; import com.hnac.hzims.safeproduct.template.abstracts.TemplateAbstractService;
import com.qiniu.util.Json; 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.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -16,6 +18,7 @@ import java.util.Optional;
/** /**
* 日常维护计划 * 日常维护计划
*
* @Author WL * @Author WL
* @Version v1.0 * @Version v1.0
* @Serial 1.0 * @Serial 1.0
@ -25,7 +28,6 @@ import java.util.Optional;
public class MaintenanceTempleServiceImpl extends TemplateAbstractService { public class MaintenanceTempleServiceImpl extends TemplateAbstractService {
/** /**
* 执行具体的业务场景,推送消息 * 执行具体的业务场景,推送消息
* *
@ -33,23 +35,23 @@ public class MaintenanceTempleServiceImpl extends TemplateAbstractService {
*/ */
@Override @Override
public PlanMsgRecordDto executeTemplateMessage(PlanMsgRecordDto planMsgRecord) { public PlanMsgRecordDto executeTemplateMessage(PlanMsgRecordDto planMsgRecord) {
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("one", map.put("one", Optional.ofNullable(UserCache.getUser(planMsgRecord.getReceiver())).map(User::getName).orElse(""));
Optional.ofNullable(UserCache.getUser(planMsgRecord.getReceiver())).map(User::getName).orElse(""));
map.put("two", planMsgRecord.getPlanTime()); map.put("two", planMsgRecord.getPlanTime());
planMsgRecord.setContent(JSON.toJSONString(map)); planMsgRecord.setContent(JSON.toJSONString(map));
planMsgRecord.setResourceCode("aliyun-safeTool-push");
return planMsgRecord; return planMsgRecord;
} }
/** /**
* 模板状态 * 模板状态
*
* @param status * @param status
*/ */
@Override @Override
public Boolean isTemplateStatus(int status) { 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) { @SpringQueryMap StandardTicketWithAreaVo areaMonthlyVo) {
Page<StandardTicketInfoEntity> searchPage = new Page<>(page, size); Page<StandardTicketInfoEntity> searchPage = new Page<>(page, size);
BladePage<StandardTicketVo> standardTicketInfoEntity = BladePage<StandardTicketVo> standardTicketInfoEntity =
standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage); standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage);
return R.data(standardTicketInfoEntity); 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) {{ Map<String,Object> params = new HashMap<String, Object>(2) {{
put("taskId", "1644624168666353665"); put("taskId", "1644624168666353665");
put("signUserIds", AuthUtil.getUserId()); put("signUserIds", "1377143375838359553");
}}; }};
flowClient.startProcessInstanceContainNameByKey( flowClient.startProcessInstanceContainNameByKey(
@ -64,12 +64,16 @@ public class TicketProcessServiceImpl implements TicketProcessService {
"开启工作的任务", "开启工作的任务",
params); params);
R<List<TaskList>> listR = flowClient.todoList(processDefinitionKey); // R<List<TaskList>> listR = flowClient.todoList(processDefinitionKey);
listR.getData().forEach(taskList -> { // listR.getData().forEach(taskList -> {
System.out.println("任务名称:"+taskList); // System.out.println("任务名称:"+taskList);
System.out.println(taskList.getTaskName()); // System.out.println(taskList.getTaskName());
System.out.println(taskList.getStatus()); // System.out.println(taskList.getStatus());
}); // });
// flowClient.completeTask()
} }
} }

Loading…
Cancel
Save