Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
zhongwei
yang_shj 2 years ago
parent
commit
77c7a77bfe
  1. 6
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/entity/PlanEntity.java
  2. 5
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java
  3. 3
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/MessagePushRecordDto.java
  4. 7
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java
  5. 3
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java
  6. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java
  7. 2
      hzims-service/hzims-middle/src/main/resources/application.yml
  8. 7
      hzims-service/inspect/pom.xml
  9. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
  10. 126
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/aspect/TaskGenerateAspect.java
  11. 5
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java
  12. 4
      hzims-service/inspect/src/main/resources/db/1.0.0.sql
  13. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java
  14. 11
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
  15. 9
      hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java
  16. 1
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
  17. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java
  18. 2
      hzims-service/message/src/main/resources/db/1.0.0.sql
  19. 2
      hzims-service/message/src/main/resources/db/1.0.1.sql
  20. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/scheduled/DutyRecCreateTask.java
  21. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyMainPersonService.java
  22. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java
  23. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java
  24. 58
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainPersonServiceImpl.java
  25. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  26. 1865
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  27. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java
  28. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainStatisticsServiceImpl.java
  29. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java
  30. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
  31. 6
      hzims-service/operational/src/main/resources/db/1.0.1.sql
  32. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java
  33. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  34. 18
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

6
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/entity/PlanEntity.java

@ -3,6 +3,8 @@ package com.hnac.hzinfo.inspect.plan.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jdk.nashorn.internal.ir.annotations.Ignore;
@ -195,4 +197,8 @@ public class PlanEntity extends TenantEntity {
@ApiModelProperty(value = "值班id")
private Long dutyId;
@ApiModelProperty(value = "消息模板ID")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long messageTemplateId;
}

5
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java

@ -3,6 +3,8 @@ package com.hnac.hzinfo.inspect.task.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -165,5 +167,8 @@ public class TaskEntity extends TenantEntity {
@ApiModelProperty(value = "值班id")
private Long dutyId;
@ApiModelProperty(value = "消息模板ID")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long messageTemplateId;
}

3
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/MessagePushRecordDto.java

@ -22,4 +22,7 @@ public class MessagePushRecordDto extends MessagePushRecordEntity implements Ser
@NotNull
private List<String> types;
@ApiModelProperty("创建人")
private Long createUser;
}

7
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java

@ -52,13 +52,20 @@ public class PlanMsgRecordDto implements Serializable {
@NotNull
private LocalDateTime planTime;
@ApiModelProperty("短信推送资源编码")
private String resourceCode;
@ApiModelProperty("消息创建人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long createUser;
@ApiModelProperty("阿里云短信模板参数")
private String smsParam;
@ApiModelProperty("消息推送耳机")
@NotNull
private String content;
@ApiModelProperty("租户ID")
private String tenantId;

3
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java

@ -68,6 +68,9 @@ public class MessagePushRecordEntity extends MessageTemplateEntity {
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty("阿里云短信模板参数")
private String smsParam;
@ApiModelProperty(value = "计划推送时间")
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)

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:

7
hzims-service/inspect/pom.xml

@ -13,6 +13,7 @@
<groupId>com.hnac.hzinfo.inspect</groupId>
<artifactId>hzinfo-inspect</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
@ -134,7 +135,11 @@
<artifactId>blade-starter-oss-minio</artifactId>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>message-api</artifactId>
<version>${hzims.project.version}</version>
</dependency>
<!--短信发送平台 Start 引用后有druid版本冲突-->
<!--<dependency>-->

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java

@ -137,7 +137,7 @@ public class PlanController extends BladeController {
@ApiImplicitParam(name="status",value="0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交")
})
public R<Boolean> modifyPlanStatus(@RequestParam(value = "id") @ApiParam(value = "主键ID",required = true) Long id,
@RequestParam @DictInvalid(dictKey = PlanContants.PLAN_STATUS) Integer status) {
@RequestParam Integer status) {
return R.status(planService.modifyPlanStatus(id, status));
}

126
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/aspect/TaskGenerateAspect.java

@ -0,0 +1,126 @@
package com.hnac.hzinfo.inspect.task.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.entity.TaskUserEntity;
import com.hnac.hzinfo.inspect.task.job.service.TaskRemindManager;
import com.hnac.hzinfo.inspect.task.service.ITaskService;
import com.hnac.hzinfo.inspect.task.service.ITaskUserService;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName TaskGenerateAspect
* @description: 消息生成后业务操作
* @author: hx
* @create: 2023-04-17 11:21
* @Version 4.0
**/
@Aspect
@Component
@RequiredArgsConstructor
@Slf4j
public class TaskGenerateAspect {
private final IMessageClient messageClient;
private final ITaskService taskService;
private final ITaskUserService taskUserService;
/**
* 巡检任务开始前发送短信信息阿里云模板
**/
@Value("${hzims.inspect.task.templateCode.taskBegin}")
private String taskBeginTemplateCode;
/**
* 巡检任务结束前发送短信信息阿里云模板
**/
@Value("${hzims.inspect.task.templateCode.taskEnd}")
private String taskEndTemplateCode;
@Pointcut("execution(* com.hnac.hzinfo.inspect.task.job.service.ITaskJobService.sendTask(..))")
public void taskSaveCut() {
}
@AfterReturning(value = "taskSaveCut()")
private void saveTask(JoinPoint joinPoint) {
Object[] args = joinPoint.getArgs();
new Thread(() -> {
if(ObjectUtil.isNotEmpty(args[0]) && args[0] instanceof PlanEntity) {
PlanEntity plan = (PlanEntity) args[0];
List<TaskEntity> list = taskService.list(
Wrappers.<TaskEntity>lambdaQuery().eq(TaskEntity::getPlanId,plan.getId())
);
if(CollectionUtil.isNotEmpty(list)) {
list.forEach(this::pushMessageByTask);
}
TaskEntity task = JSONObject.parseObject(JSON.toJSONString(args[0]),TaskEntity.class);
this.pushMessageByTask(task);
}
},"巡检任务消息推送").start();
}
/**
* 根据巡检任务生成消息推送记录
* @param taskEntity 巡检任务
*/
private void pushMessageByTask(TaskEntity taskEntity) {
PlanMsgRecordDto recordDto = new PlanMsgRecordDto();
recordDto.setDeptId(taskEntity.getCreateDept());
recordDto.setTemplateId(taskEntity.getMessageTemplateId());
recordDto.setTaskId(taskEntity.getId());
if(Func.isEmpty(AuthUtil.getUserId())) {
recordDto.setTenantId(taskEntity.getTenantId());
}
// 获取巡检任务的消息推送人
LambdaQueryWrapper<TaskUserEntity> eq = Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId, taskEntity.getId());
List<TaskUserEntity> taskUserList = taskUserService.list(eq);
if(CollectionUtil.isNotEmpty(taskUserList)) {
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
taskUserList.stream().map(TaskUserEntity::getUserId).filter(Func::isNotEmpty).forEach(userId -> {
recordDto.setReceiver(userId);
recordDto.setCreateUser(userId);
Map<String,String> smsMap = new HashMap<>(2);
// 消息开始前提醒
recordDto.setResourceCode(taskBeginTemplateCode);
smsMap.put("one",taskEntity.getPlanName());
smsMap.put("two",df.format(taskEntity.getPlanStartTime()));
recordDto.setPlanTime(taskEntity.getPlanStartTime());
recordDto.setSmsParam(JSON.toJSONString(smsMap));
recordDto.setContent("任务“"+ taskEntity.getPlanName() + "”的计划执行时间是:" + df.format(taskEntity.getPlanStartTime())+ " —— " + df.format(taskEntity.getPlanEndTime()));
messageClient.planSendMessage(recordDto);
// 消息结束前提醒
/* smsMap.put("two",df.format(taskEntity.getPlanEndTime()));
recordDto.setPlanTime(taskEntity.getPlanEndTime());
recordDto.setSmsParam(JSON.toJSONString(smsMap));
messageClient.planSendMessage(recordDto);*/
});
}
}
}

5
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java

@ -18,6 +18,7 @@ import com.hnac.hzinfo.inspect.plan.entity.*;
import com.hnac.hzinfo.inspect.plan.service.*;
import com.hnac.hzinfo.inspect.task.TaskContants;
import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum;
import com.hnac.hzinfo.inspect.task.aspect.TaskGenerateAspect;
import com.hnac.hzinfo.inspect.task.entity.*;
import com.hnac.hzinfo.inspect.task.service.ITaskObjectProjectContentService;
import com.hnac.hzinfo.inspect.task.service.ITaskObjectProjectService;
@ -89,6 +90,9 @@ public class TaskJobService {
@Autowired
private IDutyMainClient dutyMainClient;
@Autowired
private TaskGenerateAspect taskGenerateAspect;
private final String dateSplit = "_";
/**
@ -401,6 +405,7 @@ public class TaskJobService {
task.setCreateUser(plan.getCreateUser());
task.setCreateDept(plan.getCreateDept());
task.setAutoVideo(plan.getAutoVideo());
task.setMessageTemplateId(plan.getMessageTemplateId());
task.setMethod(plan.getMethod());
task.setEndRemindFlag(true);
task.setStartRemindFlag(true);

4
hzims-service/inspect/src/main/resources/db/1.0.0.sql

@ -0,0 +1,4 @@
-- 巡检计划添加消息模板字段
alter table `hz_st_re_plan` add column `message_template_id` bigint(20) comment '消息模板ID';
-- 巡检任务添加消息模板字段
alter table `hz_st_ex_task` add column `message_template_id` bigint(20) comment '消息模板ID';

2
hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java

@ -70,7 +70,7 @@ public class MessagePushRecordController extends BladeController {
@ApiOperationSupport(order = 6)
public R<Boolean> readMessage(@PathVariable @ApiParam("消息记录ID") String id) {
MessagePushRecordEntity record = messagePushRecordService.getById(id);
if(!record.getPusher().equals(AuthUtil.getUserId())) {
if(!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) {
return R.fail("当前登录人不是消息推送人,修改状态失败");
}
LambdaUpdateWrapper<MessagePushRecordEntity> eq = Wrappers.<MessagePushRecordEntity>lambdaUpdate()

11
hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

@ -18,12 +18,14 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
@ -31,6 +33,7 @@ import javax.validation.Valid;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Arrays;
import java.util.Optional;
/**
* @author hx
@ -58,6 +61,10 @@ public class MessageClient extends BladeController implements IMessageClient{
request.getTypes().forEach(type -> {
MessagePushRecordEntity entity = BeanUtil.copy(request,MessagePushRecordEntity.class);
entity.setType(type);
if(Func.isEmpty(AuthUtil.getUserId())) {
entity.setCreateUser(request.getCreateUser());
entity.setCreateDept(request.getCreateDept());
}
entity.setMessageId(messageId);
recordService.saveAndSend(entity);
});
@ -88,13 +95,15 @@ public class MessageClient extends BladeController implements IMessageClient{
entity.setTemplateId(request.getTemplateId());
entity.setDeptId(request.getDeptId());
entity.setCreateUser(request.getCreateUser());
entity.setResourceCode(request.getResourceCode());
entity.setCreateDept(request.getDeptId());
entity.setPlanTime(request.getPlanTime());
entity.setPushType(MessageConstants.PLAN);
entity.setPusher(request.getReceiver().toString());
entity.setPusherName(UserCache.getUser(request.getReceiver()).getName());
entity.setPusherName(Optional.ofNullable(UserCache.getUser(request.getReceiver())).map(User::getName).orElse(""));
entity.setAccount(request.getReceiver().toString());
entity.setContent(request.getContent());
entity.setSmsParam(request.getSmsParam());
if(Func.isNotEmpty(request.getTenantId())) {
entity.setTenantId(request.getTenantId());
}

9
hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java

@ -84,6 +84,9 @@ public class MessagePushSchedule {
MessagePushRecordEntity request = records.get(0);
// 完善推送内容
request.setContent(this.getPushContent(type,records));
if(MessageConstants.SMS_PUSH.equals(type)) {
request.setSmsParam(request.getContent());
}
request.setMessageId(IdWorker.getId());
Boolean flag = service.send(request);
if(!flag) {
@ -111,9 +114,9 @@ public class MessagePushSchedule {
}
else if(MessageConstants.SMS_PUSH.equals(type)) {
Map<String,String> params = new HashMap<>();
list.stream().map(MessagePushRecordEntity::getContent).forEachOrdered(record -> {
JSONObject param = JSONObject.parseObject(record);
param.forEach((k,v) -> {
list.stream().map(MessagePushRecordEntity::getSmsParam).forEachOrdered(param -> {
JSONObject paramJson = JSONObject.parseObject(param);
paramJson.forEach((k,v) -> {
params.put(k, params.containsKey(k) && Func.isNotEmpty(params.get(k)) ? params.get(k) + "," + v : (String) v);
});
});

1
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java

@ -97,6 +97,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
if (MessageConstants.IMMEDIATELY.equals(request.getPushType())) {
request.setPlanTime(now);
request.setPushTime(now);
request.setStatus(MessageConstants.NOT_PUSH);
// 立即推送消息
if (this.save(request) && Func.isNotEmpty(request.getId())) {
return this.send(request.getId());

2
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java

@ -51,7 +51,7 @@ public class SmsMessageServiceImpl implements IMessageService {
R<SmsResponse> response = smsClient.sendMessage(
Func.isNotEmpty(AuthUtil.getTenantId()) ? AuthUtil.getTenantId() : request.getTenantId(),
request.getResourceCode(),
request.getContent(),
request.getSmsParam(),
this.getAccountByPusher(Long.parseLong(request.getPusher()),request.getType())
);
Assert.isTrue(response.isSuccess(),() -> {

2
hzims-service/message/src/main/resources/db/1.0.0.sql

@ -25,7 +25,7 @@ SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE IF NOT EXISTS `hzims_message_push_record` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`TASK_ID` bigint(20) NOT NULL COMMENT '消息类型',
`TEMPLATE_ID` bigint(20) NOT NULL COMMENT '消息模板ID',
`TEMPLATE_ID` bigint(20) COMMENT '消息模板ID',
`PUSHER` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '推送人',
`PUSHER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '推送人名称',
`CONTENT` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内容',

2
hzims-service/message/src/main/resources/db/1.0.1.sql

@ -2,3 +2,5 @@
alter table hzims_message_push_record add COLUMN `MESSAGE_ID` bigint(20) DEFAULT NULL comment '消息ID';
-- 添加消息推送类型
alter table hzims_message_push_record add COLUMN `PUSH_TYPE` VARCHAR(2) DEFAULT NULL comment '推送类型,0:即时推送,1:计划推送';
-- 添加短信推送参数
alter table `hzims_message_push_record` add COLUMN `SMS_PARAM` VARCHAR(255) COMMENT '阿里云短信模板参数';

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/scheduled/DutyRecCreateTask.java

@ -5,8 +5,6 @@ import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import static com.hnac.hzims.operational.duty.constant.DutyScheduledConstant.TASK_VALUE_MESSAGE_REMINDING_CREATE;
@ -24,13 +22,17 @@ public class DutyRecCreateTask {
* @return
* @throws Exception
*/
// @XxlJob(TASK_VALUE_MESSAGE_REMINDING_CREATE)
// public ReturnT<String> messageRemonding(String param) throws Exception {
// recService.messageRemonding();
// return new ReturnT<>("SUCCESS");
// }
@XxlJob(TASK_VALUE_MESSAGE_REMINDING_CREATE)
public ReturnT<String> messageRemonding(String param) throws Exception {
recService.messageRemonding();
public ReturnT<String> messageRemondingV2(String param) throws Exception {
recService.messageRemondingV2();
return new ReturnT<>("SUCCESS");
}
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyMainPersonService.java

@ -14,4 +14,7 @@ public interface IImsDutyMainPersonService extends BaseService<ImsDutyMainPerson
void doSaveBasch(List<ImsDutyMainPersonEntity> list);
List<ImsDutyMainPersonEntity> selectByMainIds(List<Long> dutyMainIds);
List<ImsDutyMainPersonEntity> selectByMainId(Long dutyMainId);
}

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java

@ -6,10 +6,8 @@ import com.hnac.hzims.operational.duty.dto.ChangeShiftsRspDTO;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyRecEntity;
import com.hnac.hzims.operational.duty.vo.ImsDutyQrCodeVo;
import com.hnac.hzims.operational.duty.vo.ImsDutyRecVO;
import com.hnac.hzims.operational.duty.vo.ImsRecVo;
import com.hnac.hzims.operational.duty.vo.ImsSchedulingVo;
import com.hnac.hzinfo.inspect.plan.vo.PlanVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -62,9 +60,15 @@ public interface IImsDutyRecService extends BaseService<ImsDutyRecEntity> {
String getQRCode();
/**
* 消息提醒 20230414之后已弃用
* 根据黄兴的消息中心模板更新为新的V2的接口
*/
// void messageRemonding();
/**
* 消息提醒
*/
void messageRemonding();
void messageRemondingV2();
/**
* 消息提醒测试

35
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java

@ -3,12 +3,10 @@ package com.hnac.hzims.operational.duty.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupPEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyRecEntity;
import com.hnac.hzims.operational.duty.entity.*;
import com.hnac.hzims.operational.duty.mapper.ImsDutyGroupMapper;
import com.hnac.hzims.operational.duty.mapper.ImsDutyGroupPMapper;
import com.hnac.hzims.operational.duty.mapper.ImsDutyMainPersonMapper;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupPService;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
@ -48,7 +46,8 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
@Autowired
private ImsDutyGroupPMapper imsDutyGroupPMapper;
@Autowired
private ImsDutyMainPersonMapper imsDutyMainPersonMapper;
@Autowired
private IUserClient userClient;
@ -292,17 +291,33 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
if (CollectionUtil.isNotEmpty(list1)) {
ImsDutyMainEntity imsDutyMainEntity = list1.get(0);
ImsDutyGroupEntity groupEntity = this.baseMapper.selectById(imsDutyMainEntity.getDutyGroupId());
String userName = "";
if (null != groupEntity.getManagerId()) {
R<User> userR = userClient.userInfoById(groupEntity.getManagerId());
Long managerId = null;
String groupName = "";
if (imsDutyMainEntity.getDutyGroupId()!=null) {
ImsDutyGroupEntity groupEntity = this.baseMapper.selectById(imsDutyMainEntity.getDutyGroupId());
if (null != groupEntity.getManagerId()){
managerId=groupEntity.getManagerId();
}
groupName=groupEntity.getGroupName();
}else {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, imsDutyMainEntity.getId());
last(" limit 1");
}});
managerId=imsDutyMainPersonEntity.getDutyChargePerson();
groupName="灵活排班";
}
if (managerId!=null) {
R<User> userR = userClient.userInfoById(managerId);
if (userR.isSuccess() && ObjectUtil.isNotEmpty(userR.getData())) {
userName = userR.getData().getName();
}
}
return R.fail(groupEntity.getGroupName() + userName +
"是负责人,且存在排班不能直接删除,请先更换" + groupEntity.getGroupName() + "负责人,再进行删除操作!");
return R.fail(groupName +"-"+ userName +
"是负责人,且存在排班不能直接删除,请先更换" + groupName + "负责人,再进行删除操作!");
}
}
imsDutyGroupPService.deleteBatch(ids);

58
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainPersonServiceImpl.java

@ -1,47 +1,19 @@
package com.hnac.hzims.operational.duty.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.hnac.hzims.monitor.utils.DateUtils;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.mapper.OperPhenomenonMapper;
import com.hnac.hzims.operational.duty.entity.*;
import com.hnac.hzims.operational.duty.enume.DutyRecStatus;
import com.hnac.hzims.operational.duty.enume.JoinStatus;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainPersonEntity;
import com.hnac.hzims.operational.duty.mapper.*;
import com.hnac.hzims.operational.duty.scheduled.ThreadTask;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupPService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainPersonService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainTemplateService;
import com.hnac.hzims.operational.duty.vo.*;
import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO;
import com.hnac.hzims.operational.report.vo.DutyReportVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.List;
/**
* 服务实现类
@ -71,4 +43,28 @@ public class ImsDutyMainPersonServiceImpl extends BaseServiceImpl<ImsDutyMainPer
public void doSaveBasch(List<ImsDutyMainPersonEntity> list) {
this.saveBatch(list);
}
@Override
public List<ImsDutyMainPersonEntity> selectByMainIds(List<Long> dutyMainIds) {
List<ImsDutyMainPersonEntity> imsDutyMainPersonEntities = this.baseMapper.selectList(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
in(ImsDutyMainPersonEntity::getDutyMainId, dutyMainIds);
}});
if (CollectionUtils.isNotEmpty(imsDutyMainPersonEntities)){
return imsDutyMainPersonEntities;
}
return null;
}
@Override
public List<ImsDutyMainPersonEntity> selectByMainId(Long dutyMainId) {
List<ImsDutyMainPersonEntity> imsDutyMainPersonEntities = this.baseMapper.selectList(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainId);
}});
if (CollectionUtils.isNotEmpty(imsDutyMainPersonEntities)){
return imsDutyMainPersonEntities;
}
return null;
}
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -160,6 +160,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
imsSchedulingVo.setGroupName("临时班组");
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, id);
last(" limit 1");
}});
imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson());
} else {
@ -927,10 +928,13 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if (1 == vo.getPersonType()) {
String dutyOrderIds = JSONObject.toJSONString(vo.getDutyOrderIds(), SerializerFeature.WriteMapNullValue);
entity.setDutyOrderIds(dutyOrderIds);
entity.setFlexible(null);
entity.setType(1);
} else {
String flexible = JSONObject.toJSONString(vo.getFlexible(), SerializerFeature.WriteMapNullValue);
entity.setFlexible(flexible);
String dutyOrderIds = JSONObject.toJSONString(vo.getDutyOrderIds(), SerializerFeature.WriteMapNullValue);
entity.setDutyOrderIds(dutyOrderIds);
entity.setType(2);
}
String dutyArrIds = JSONObject.toJSONString(vo.getDutyArrIds(), SerializerFeature.WriteMapNullValue);
@ -1110,7 +1114,6 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
eq(DutyGroupGeneratingCapacityEntity::getEndTime, dutyMainInfoVo.getEndTime());
eq(DutyGroupGeneratingCapacityEntity::getDutyDept, dutyMainInfoVo.getCreateDept());
eq(DutyGroupGeneratingCapacityEntity::getDateTime, DateUtil.format(dutyMainInfoVo.getDutyDate(), DateUtil.PATTERN_DATE));
//eq(DutyGroupGeneratingCapacityEntity::getGroupId, dutyMainInfoVo.getDutyGroupId());
}});
if (CollectionUtil.isNotEmpty(generatingCapacityList)) {
double generatingCapacity = generatingCapacityList.stream().mapToDouble(DutyGroupGeneratingCapacityEntity::getGeneratingCapacity).sum();
@ -1310,6 +1313,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
List<String> personIdlist = new ArrayList<>(Arrays.asList(dutyMainPersonIds));
if (1 == changeDutyMainVo.getType()) {
personIdlist.addAll(personId);
} else {
personIdlist.removeAll(personId);
}
String resIds = StringUtils.join(personIdlist, "^");
@ -1375,7 +1379,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
*/
private NextDutyInfoVo getUpDutyInfo(DutyInfoVo item) {
DutyMainInfoVo dutyMainInfoVo = this.baseMapper.queryDutyInfoV2(item.getPreDutyId());
if (null == dutyMainInfoVo.getGroupName()) {
if (null == dutyMainInfoVo.getDutyGroupId()) {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
}});
@ -1633,7 +1637,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
public List<DutyMainInfoVo> getDutyDataV2(Long deptId) {
List<DutyMainInfoVo> dutyMainInfoVos = this.baseMapper.selectDutyMainInfoVoV2(deptId);
dutyMainInfoVos = dutyMainInfoVos.stream().map(s -> {
if (null == s.getGroupName()) {
if (null == s.getDutyGroupId()) {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, s.getId());
}});
@ -1657,7 +1661,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
@Override
public DutyMainInfoVo getNextDutyDataV2(Long parentId) {
DutyMainInfoVo dutyMainInfoVo = this.baseMapper.selectDutyMainInfoSignV2(parentId);
if (null == dutyMainInfoVo.getGroupName()) {
if (null == dutyMainInfoVo.getDutyGroupId()) {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
}});

1865
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

File diff suppressed because it is too large Load Diff

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);
}

35
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainStatisticsServiceImpl.java

@ -16,10 +16,8 @@ import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.service.IImsDutyClassService;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.duty.service.IImsDutyRecService;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainPersonEntity;
import com.hnac.hzims.operational.duty.service.*;
import com.hnac.hzims.operational.main.service.IMainStatisticsService;
import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
@ -30,21 +28,15 @@ import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.system.cache.DictCache;
import org.springblade.system.entity.Dict;
import org.springblade.system.feign.IDictClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -64,6 +56,7 @@ public class MainStatisticsServiceImpl implements IMainStatisticsService {
private final IOperDefectStatisticsService operDefectStatisticsService;
private final IImsDutyClassService iImsDutyClassService;
private final IDictClient dictClient;
private final IImsDutyMainPersonService imsDutyMainPersonService;
@Override
@ -85,13 +78,21 @@ public class MainStatisticsServiceImpl implements IMainStatisticsService {
DutyStatisticsVO dutyStatisticsVo = new DutyStatisticsVO();
if(imsDutyMainEntity != null){
dutyStatisticsVo = BeanUtil.copy(imsDutyMainEntity, DutyStatisticsVO.class);
//完善负责人信息
ImsDutyGroupEntity imsDutyGroupEntity = imsDutyGroupService.getById(dutyStatisticsVo.getDutyGroupId());
if(imsDutyGroupEntity != null){
dutyStatisticsVo.setGroupName(imsDutyGroupEntity.getGroupName());
User managerUser = UserCache.getUser(imsDutyGroupEntity.getManagerId());
dutyStatisticsVo.setManager(managerUser);
if (dutyStatisticsVo.getDutyGroupId()!=null) {
//完善负责人信息
ImsDutyGroupEntity imsDutyGroupEntity = imsDutyGroupService.getById(dutyStatisticsVo.getDutyGroupId());
if (imsDutyGroupEntity != null) {
dutyStatisticsVo.setGroupName(imsDutyGroupEntity.getGroupName());
User managerUser = UserCache.getUser(imsDutyGroupEntity.getManagerId());
dutyStatisticsVo.setManager(managerUser);
}
}else {
List<ImsDutyMainPersonEntity> imsDutyMainPersonEntities = imsDutyMainPersonService.selectByMainId(dutyStatisticsVo.getId());
dutyStatisticsVo.setGroupName("灵活排班");
if (CollectionUtil.isNotEmpty(imsDutyMainPersonEntities)) {
User managerUser = UserCache.getUser(imsDutyMainPersonEntities.get(0).getDutyChargePerson());
dutyStatisticsVo.setManager(managerUser);
}
}
String dutyPersonIds = dutyStatisticsVo.getDutyPersonIds();
int num = 0;

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<>();
//维护内容

6
hzims-service/operational/src/main/resources/db/1.0.1.sql

@ -4,3 +4,9 @@ alter table hzims_oper_maintenance_library add COLUMN `MESSAGE_TEMPLATE_ID` bigi
alter table hzims_oper_maintenance_plan add COLUMN `MESSAGE_TEMPLATE_ID` bigint(20) comment '消息推送模板ID';
-- 日常维护任务添加消息模板ID
alter table hzims_oper_maintenance_task add COLUMN `MESSAGE_TEMPLATE_ID` bigint(20) comment '消息推送模板ID';
-- 日常维护库设备库编码长度修改
alter table hzims_oper_maintenance_library MODIFY COLUMN `em_code` VARCHAR(50) comment '设备编码';
-- 日常维护库设备计划编码长度修改
alter table hzims_oper_maintenance_plan MODIFY COLUMN `em_code` VARCHAR(50) comment '设备编码';
-- 日常维护库设备任务编码长度修改
alter table hzims_oper_maintenance_task MODIFY COLUMN `em_code` VARCHAR(50) comment '设备编码';

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