Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
zhongwei
yang_shj 2 years ago
parent
commit
85902f0701
  1. 5
      hf.fo
  2. 9
      hzims-service-api/hzims-operational-api/pom.xml
  3. 1
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java
  4. 169
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java
  5. 102
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
  6. 59
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java
  7. 111
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java
  8. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/Fallback/IOperDefectClientFallback.java
  9. 10
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/IOperDefectClient.java
  10. 34
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperAppearanceVO.java
  11. 18
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java
  12. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java
  13. 1
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerDeviceVo.java
  14. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java
  15. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java
  16. 3
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
  17. 66
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/BusinessMessageDTO.java
  18. 15
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
  19. 10
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java
  20. 42
      hzims-service-api/middle-api/pom.xml
  21. 8
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
  22. 4
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/fallback/ProcessDictFeignServiceFallback.java
  23. 4
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java
  24. 2
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/to/ProcessWorkFlowResponse.java
  25. 1
      hzims-service-api/pom.xml
  26. 6
      hzims-service-api/ticket-api/pom.xml
  27. 2
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java
  28. 2
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java
  29. 2
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java
  30. 2
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java
  31. 5
      hzims-service/hzims-middle/pom.xml
  32. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java
  33. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java
  34. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java
  35. 67
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java
  36. 12
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java
  37. 4
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java
  38. 4
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java
  39. 12
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java
  40. 67
      hzims-service/hzims-middle/src/main/resources/db/newsql.sql
  41. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DataServiceImpl.java
  42. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java
  43. 49
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
  44. 6
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java
  45. 42
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
  46. 40
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java
  47. 1
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java
  48. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  49. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/DefectCheckController.java
  50. 88
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java
  51. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/feign/OperDefectClient.java
  52. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.java
  53. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.xml
  54. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IDefectCheckService.java
  55. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java
  56. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java
  57. 1327
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  58. 61
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java
  59. 67
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  60. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
  61. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
  62. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
  63. 87
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java
  64. 575
      hzims-service/operational/src/main/resources/db/2.0.0.sql
  65. 8
      hzims-service/pom.xml
  66. 5
      hzims-service/ticket/pom.xml
  67. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java
  68. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java
  69. 51
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
  70. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  71. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
  72. 130
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  73. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
  74. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java
  75. 323
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  76. 180
      hzims-service/ticket/src/main/resources/db/newsql.sql
  77. BIN
      hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx
  78. BIN
      hzims-service/ticket/src/main/resources/template/电气操作票.docx

5
hf.fo

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><ns2:layout-master-set xmlns:ns2="http://www.w3.org/1999/XSL/Format" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"><ns2:simple-page-master margin-bottom="17mm" margin-left="1.25in" margin-right="1.25in" margin-top="15mm" master-name="s1-simple" page-height="297mm" page-width="210mm"><ns2:region-body column-count="1" column-gap="0.3in" margin-bottom="420.0pt" margin-left="0mm" margin-right="0mm" margin-top="420.0pt"/><ns2:region-before extent="420.0pt" region-name="xsl-region-before-simple"/><ns2:region-after extent="420.0pt" region-name="xsl-region-after-simple"/></ns2:simple-page-master><ns2:page-sequence-master master-name="s1"><ns2:repeatable-page-master-alternatives><ns2:conditional-page-master-reference master-reference="s1-simple"/></ns2:repeatable-page-master-alternatives></ns2:page-sequence-master></ns2:layout-master-set><fo:page-sequence force-page-count="no-force" id="section_s1" format="" master-reference="s1"><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader rule-thickness="0.5pt" rule-style="solid" leader-length="100%" leader-pattern="rule"/></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block break-before="auto" line-height="107%" space-after="14mm" space-before="14mm"><inline xmlns="http://www.w3.org/1999/XSL/Format" font-size="48.0pt"><inline font-family="等线">BODY CONTENT</inline></inline></fo:block><fo:block break-before="auto" line-height="107%" space-after="14mm" space-before="14mm"><inline xmlns="http://www.w3.org/1999/XSL/Format" font-size="48.0pt"><inline font-family="等线">BODY CONTENT</inline></inline></fo:block><fo:block break-before="auto" line-height="107%" space-after="14mm" space-before="14mm"><inline xmlns="http://www.w3.org/1999/XSL/Format" font-size="48.0pt"><inline font-family="等线">BODY CONTENT</inline></inline></fo:block><fo:block break-before="auto" line-height="107%" space-after="14mm" space-before="14mm"><inline xmlns="http://www.w3.org/1999/XSL/Format" font-size="48.0pt"><inline font-family="等线">BODY CONTENT</inline></inline></fo:block>
</fo:flow></fo:page-sequence></fo:root>

9
hzims-service-api/hzims-operational-api/pom.xml

@ -57,10 +57,19 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId> <artifactId>blade-system-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>hzims-biz-common</artifactId> <artifactId>hzims-biz-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

1
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java

@ -10,6 +10,7 @@ public interface TreatMethodConstant {
* 流程主键 * 流程主键
*/ */
String DEFECT_CHECK_PRIMARY_KEY = "defect_check"; String DEFECT_CHECK_PRIMARY_KEY = "defect_check";
String DEFECT_CHECK = "defectCheck";
/** /**
* 1-应急抢修处理 2 - 检修任务处理 3- 检修计划处理 * 1-应急抢修处理 2 - 检修任务处理 3- 检修计划处理

169
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java

@ -0,0 +1,169 @@
package com.hnac.hzims.operational.defect.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
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;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
*
* @author Chill
*/
@Data
@TableName("hzims_oper_appearance")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "现象表", description = "现象表")
public class OperAppearanceEntity extends TenantEntity {
private static final long serialVersionUID = 8353403086998937117L;
/**
* 缺陷编码
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "缺陷编码")
private String defectCode;
/**
* 问题来源:ZB:值班管理,RCWH:日常维护,XJ:巡检管理,JX:检修管理,ZNZD:智能诊断
*/
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "问题来源: 数据字典:defectSource")
private String sourceCode;
/**
* 问题发现人
*/
@QueryField(condition = SqlCondition.EQUAL)
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "问题发现人")
private Long finder;
/**
* 问题类型
*
*/
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "问题类型:字典key : defectType")
private String typeCode;
/**
* 发现时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "发现时间")
private Date findTime;
/**
* 名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "名称,如果是设备则是设备名称。")
private String name;
/**
* 设备编号
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "设备编号")
private String emCode;
/**
* 故障缺陷名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "故障缺陷名称")
private String faultName;
/**
* 现象描述
*/
@ApiModelProperty(value = "现象描述")
private String descripiton;
/**
* 故障文件附件多个文件url通过,隔开
*/
@ApiModelProperty(value = "现象文件附件,多个文件url通过,隔开")
private String fileUrls;
/**
* 初步分析结果
*/
@ApiModelProperty(value = "初步分析结果")
private String initResult;
/**
* 甄别人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "甄别人")
private Long discriminator;
/**
* 甄别时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "甄别时间")
private Date discriminateTime;
/**
* 甄别状态已甄别 1 和未甄别 0 默认0
*/
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "甄别状态:已甄别 1 和未甄别 0 ,默认0")
private String discriminateStatus;
/**
* 是否为缺陷
*/
@QueryField(condition = SqlCondition.EQUAL)
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否为缺陷,0 否,1是")
private Integer isDefect;
/**
* 甄别描述
*/
@ApiModelProperty(value = "甄别描述")
private String discriminateDesc;
/**
* 备注冗余
*/
@ApiModelProperty(value = "备注(冗余)")
private String remark;
/**
* 是否使用智能诊断
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否使用智能诊断")
private Integer isDiagnosis;
/**
* 智能诊断任务ID
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "智能诊断任务ID")
private Long diagnosisId;
/**
* 已有缺陷编码
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private Long existDefectId;
}

102
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java

@ -4,17 +4,18 @@ import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springblade.core.mp.support.QueryField; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springblade.core.tenant.mp.TenantEntity; import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.YearMonth; import java.time.YearMonth;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
@ -80,7 +81,7 @@ public class OperDefectEntity extends TenantEntity {
* 实际工时多个处理人工时逗号隔开 * 实际工时多个处理人工时逗号隔开
*/ */
@ApiModelProperty(value = "实际工时,多个处理人工时逗号隔开") @ApiModelProperty(value = "实际工时,多个处理人工时逗号隔开")
private String actHours; private Integer actHours;
/** /**
* 最后处理人处理描述 * 最后处理人处理描述
@ -89,16 +90,17 @@ public class OperDefectEntity extends TenantEntity {
private String disposeDesc; private String disposeDesc;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "缺陷创建时间-开始时间")
private String startTime; private String startTime;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "缺陷创建时间-结束时间")
private String endTime; private String endTime;
@TableField(exist = false) // 20230612弃用该字段,无地方引用
@ApiModelProperty(value = "机构编号集合") // @TableField(exist = false)
private List<Long> deptIds; // @ApiModelProperty(value = "机构编号集合")
// private List<Long> deptIds;
/** /**
@ -113,4 +115,82 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "年月") @ApiModelProperty(value = "年月")
@TableField(exist = false) @TableField(exist = false)
private YearMonth yearMonth; private YearMonth yearMonth;
/**
* 计划处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "计划处理人")
private String planHandler;
/**
* 处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "处理人")
private Long handler;
/**
* 缺陷等级
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "缺陷等级")
private String defectGrading;
/**
* 定论词条
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "定论词条")
private String conclusionLabel;
/**
* 备注冗余
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "备注(冗余)")
private String remark;
/**
* 是否使用智能诊断
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否使用智能诊断")
private Integer isDiagnosis;
/**
* 智能诊断任务ID
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "智能诊断任务ID")
private Long diagnosisId;
/**
* 已有缺陷编码
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private Long existDefectId;
/**
* 定论人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "定论人")
private Long conclusionPeople;
/**
* 定论时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "定论时间")
private Date conclusionTime;
/**
* 定论描述
*/
@ApiModelProperty(value = "定论描述")
private String conclusion;
/**
* 计划工时
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "计划工时")
private Integer planHours;
} }

59
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java

@ -5,16 +5,15 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer; import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.time.LocalDateTime;
/** /**
@ -227,4 +226,54 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "定论时间") @ApiModelProperty(value = "定论时间")
private Date conclusionTime; private Date conclusionTime;
/**
* 计划处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "计划处理人")
private String planHandler;
/**
* 是否入库
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否入库")
private Integer isWarehousing;
/**
* 当前处理环节
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "当前处理环节")
private String currentOperator;
/**
* 当前环节处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "当前环节处理人")
private String currentLinkHandler;
/**
* 备注冗余
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "备注(冗余)")
private String remark;
/**
* 是否使用智能诊断
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否使用智能诊断")
private Integer isDiagnosis;
/**
* 智能诊断任务ID
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "智能诊断任务ID")
private Long diagnosisId;
/**
* 已有缺陷编码
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private Long existDefectId;
} }

111
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java

@ -1,23 +1,19 @@
package com.hnac.hzims.operational.defect.entity; package com.hnac.hzims.operational.defect.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition; import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer; import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.YearMonth;
import java.util.Date; import java.util.Date;
import java.time.LocalDateTime;
/** /**
@ -28,7 +24,7 @@ import java.time.LocalDateTime;
@Data @Data
@TableName("hzims_oper_phenomenon") @TableName("hzims_oper_phenomenon")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "问题现象表", description = "问题现象表") @ApiModel(value = "问题现象表", description = "问题现象表")
public class OperPhenomenonEntity extends TenantEntity { public class OperPhenomenonEntity extends TenantEntity {
private static final long serialVersionUID = 8353403086998937117L; private static final long serialVersionUID = 8353403086998937117L;
@ -54,7 +50,7 @@ public class OperPhenomenonEntity extends TenantEntity {
/** /**
* 甄别流程实例 * 甄别流程实例
*/ */
@ApiModelProperty(value = "甄别流程实例") @ApiModelProperty(value = "流程实例")
private String checkProcessInstanceId; private String checkProcessInstanceId;
/** /**
* 问题发现人 * 问题发现人
@ -64,7 +60,7 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "问题发现人") @ApiModelProperty(value = "问题发现人")
private Long finder; private Long finder;
/** /**
* 问题类型 * 问题类型0-设备和1-非设备
* *
*/ */
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
@ -214,10 +210,10 @@ public class OperPhenomenonEntity extends TenantEntity {
private Long handleTaskId; private Long handleTaskId;
/** /**
* 处理人处理工作流的第一个处理人 * 处理人
*/ */
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "处理人,处理工作流的第一个处理人,第一个处理节点人key 必须是 problemUser") @ApiModelProperty(value = "处理人")
private Long handler; private Long handler;
/** /**
* 处理状态已处理1未处理0默认0 * 处理状态已处理1未处理0默认0
@ -287,4 +283,93 @@ public class OperPhenomenonEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "核算工时") @ApiModelProperty(value = "核算工时")
private Integer checkHours; private Integer checkHours;
/**
* 计划处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "计划处理人")
private String planHandler;
/**
* 实际开始时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "实际开始时间")
private Date actStartTime;
/**
* 实际结束时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "实际结束时间")
private Date actEndTime;
/**
* 最后处理人处理描述
*/
@ApiModelProperty(value = "最后处理人处理描述")
private String disposeDesc;
/**
* 是否入库
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否入库")
private Integer isWarehousing;
/**
* 缺陷等级
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "缺陷等级")
private String defectGrading;
/**
* 定论词条
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "定论词条")
private String conclusionLabel;
/**
* 当前处理环节
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "当前处理环节")
private String currentOperator;
/**
* 当前环节处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "当前环节处理人")
private String currentLinkHandler;
/**
* 备注冗余
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "备注(冗余)")
private String remark;
/**
* 是否使用智能诊断
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否使用智能诊断")
private Integer isDiagnosis;
/**
* 智能诊断任务ID
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "智能诊断任务ID")
private Long diagnosisId;
/**
* 已有缺陷编码
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private Long existDefectId;
} }

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/Fallback/IOperDefectClientFallback.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.defect.feign.Fallback; package com.hnac.hzims.operational.defect.feign.Fallback;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.feign.IOperDefectClient; import com.hnac.hzims.operational.defect.feign.IOperDefectClient;
@ -34,4 +35,9 @@ public class IOperDefectClientFallback implements IOperDefectClient {
log.error("远程调用失败,接口:" + CREATE_DEFECT); log.error("远程调用失败,接口:" + CREATE_DEFECT);
return null; return null;
} }
@Override
public R saveDefect(ProcessWorkFlowResponse processWorkFlowResponse) {
log.error("远程调用失败,接口:" + SAVE_DEFECT);
return null;
}
} }

10
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/IOperDefectClient.java

@ -1,6 +1,6 @@
package com.hnac.hzims.operational.defect.feign; package com.hnac.hzims.operational.defect.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
@ -26,6 +26,8 @@ public interface IOperDefectClient {
String UPDATE_DEFECT_HANDLER_STATE = API_PREFIX + "/updateDefectHandlerState"; String UPDATE_DEFECT_HANDLER_STATE = API_PREFIX + "/updateDefectHandlerState";
String CREATE_DEFECT = API_PREFIX + "/createDefect"; String CREATE_DEFECT = API_PREFIX + "/createDefect";
String SAVE_DEFECT = API_PREFIX + "/saveDefect";
/** /**
* 修改缺陷信息 * 修改缺陷信息
* @param entity * @param entity
@ -39,4 +41,10 @@ public interface IOperDefectClient {
@PostMapping(CREATE_DEFECT) @PostMapping(CREATE_DEFECT)
R createDefect(@RequestBody OperPhenomenonEntity phenomenon); R createDefect(@RequestBody OperPhenomenonEntity phenomenon);
@PostMapping(SAVE_DEFECT)
R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse);
} }

34
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperAppearanceVO.java

@ -0,0 +1,34 @@
package com.hnac.hzims.operational.defect.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "现象表vo", description = "现象表vo")
public class OperAppearanceVO extends OperAppearanceEntity {
/**
* 发现结束时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "发现结束时间")
private Date findEndTime;
}

18
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java

@ -1,15 +1,15 @@
package com.hnac.hzims.operational.defect.vo; package com.hnac.hzims.operational.defect.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer; import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
/** /**
@ -60,4 +60,16 @@ public class OperDefectVO extends OperDefectEntity {
@ApiModelProperty(value = "定论描述") @ApiModelProperty(value = "定论描述")
private String conclusion; private String conclusion;
private String typeCode;
/**
* 定论时间范围-最晚
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "定论时间范围-最晚")
private Date conclusionEndTime;
} }

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java

@ -19,6 +19,8 @@ public class EcologyFlowStationEntity extends TenantEntity {
private String stationName; private String stationName;
private String city;
private Long isOnLine; private Long isOnLine;
private Long isDemonstrate; private Long isDemonstrate;

1
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerDeviceVo.java

@ -2,6 +2,7 @@ package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
/** /**

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java

@ -1,6 +1,6 @@
package com.hnac.hzims.operational.maintenance.feign; package com.hnac.hzims.operational.maintenance.feign;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.maintenance.feign.fallback.MaintenanceFeignClientFallback; import com.hnac.hzims.operational.maintenance.feign.fallback.MaintenanceFeignClientFallback;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java

@ -1,6 +1,6 @@
package com.hnac.hzims.operational.maintenance.feign.fallback; package com.hnac.hzims.operational.maintenance.feign.fallback;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient; import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

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

@ -1,7 +1,6 @@
package com.hnac.hzims.message; package com.hnac.hzims.message;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -55,6 +54,8 @@ public class MessageConstants {
ACCESS("access","检修消息"), ACCESS("access","检修消息"),
TICKETMESSAGE("ticket-message","工作票消息"), TICKETMESSAGE("ticket-message","工作票消息"),
OPERATIONTICKETMESSAGE("operation-ticket-message","操作票消息"), OPERATIONTICKETMESSAGE("operation-ticket-message","操作票消息"),
ROUTINEMAINTENANCE("operation-maintenance-message","日常维护消息"),
OPERATIONDEFECTMESSAGE("operation-defect-message","消缺消息"),
; ;
@Getter @Getter
private String key; private String key;

66
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/BusinessMessageDTO.java

@ -0,0 +1,66 @@
package com.hnac.hzims.message.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.mp.support.SqlCondition;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @ClassName BusinessMessageDTO
* @description:
* @author: hx
* @create: 2023-06-15 19:10
* @Version 4.0
**/
@Data
@ApiModel("事务消息")
@EqualsAndHashCode
public class BusinessMessageDTO implements Serializable {
@ApiModelProperty(value = "机构ID",required = true)
@NotNull(message = "机构ID不能为空")
private Long deptId;
@ApiModelProperty("机构名称")
private String deptName;
@ApiModelProperty(value = "业务关键字",required = true)
@NotNull(message = "业务关键字不能为空")
private String businessKey;
@ApiModelProperty(value = "业务分类。系统通知:system,事务消息:business,日常提醒:dailyRemind,巡检消息:inspect",required = true)
@NotNull(message = "业务分类不能为空")
private String businessClassify;
@ApiModelProperty("业务任务ID")
@QueryField(condition = SqlCondition.EQUAL)
private Long taskId;
@NotNull
@ApiModelProperty(value = "内容")
private String content;
@NotNull
@ApiModelProperty(value = "主题")
private String subject;
@NotNull
@ApiModelProperty(value = "推送用户")
private String userIds;
@ApiModelProperty(value = "创建用户")
private Long createUser;
@ApiModelProperty(value = "租户ID")
private String tenantId;
}

15
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java

@ -1,10 +1,7 @@
package com.hnac.hzims.message.fegin; package com.hnac.hzims.message.fegin;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.*;
import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.dto.PushDto;
import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.entity.MessagePushRecordEntity; import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -29,6 +26,7 @@ public interface IMessageClient {
String SEND_MESSAGE = API_PREFIX + "/sendMessage"; String SEND_MESSAGE = API_PREFIX + "/sendMessage";
String GET_TEMPLATE_BY_ID = API_PREFIX + "/getMsgTemplateById"; String GET_TEMPLATE_BY_ID = API_PREFIX + "/getMsgTemplateById";
String PLAN_SEND_MESSAGE = API_PREFIX + "/planSendMessage"; String PLAN_SEND_MESSAGE = API_PREFIX + "/planSendMessage";
String SEND_APP_AND_WS_MSG = API_PREFIX + "/sendAppAndWsMsgByUsers";
/** /**
* 推送消息短信 * 推送消息短信
@ -54,4 +52,13 @@ public interface IMessageClient {
**/ **/
@PostMapping(PLAN_SEND_MESSAGE) @PostMapping(PLAN_SEND_MESSAGE)
R<PlanMsgRecordDto> planSendMessage(@RequestBody PlanMsgRecordDto request); R<PlanMsgRecordDto> planSendMessage(@RequestBody PlanMsgRecordDto request);
/**
* 发送多人APPWEB消息
* @Author hx
* @param request
* @return
*/
@PostMapping(value = SEND_APP_AND_WS_MSG,consumes = "application/json; charset=UTF-8")
R<Boolean> sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request);
} }

10
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java

@ -1,9 +1,6 @@
package com.hnac.hzims.message.fegin; package com.hnac.hzims.message.fegin;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.*;
import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.dto.PushDto;
import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.entity.MessagePushRecordEntity; import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -34,4 +31,9 @@ public class MessageClientFallback implements IMessageClient {
public R<PlanMsgRecordDto> planSendMessage(PlanMsgRecordDto request) { public R<PlanMsgRecordDto> planSendMessage(PlanMsgRecordDto request) {
return R.fail("调用失败!"); return R.fail("调用失败!");
} }
@Override
public R<Boolean> sendAppAndWsMsgByUsers(BusinessMessageDTO request) {
return R.fail("调用失败!");
}
} }

42
hzims-service-api/middle-api/pom.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-service-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>middle-api</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>${project.name}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

8
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/constant/TicketProcessConstant.java → hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java

@ -1,4 +1,4 @@
package com.hnac.hzims.common.logs.constant; package com.hnac.hzims.middle.process.constant;
/** /**
* 开票常量类 * 开票常量类
@ -29,4 +29,10 @@ public class TicketProcessConstant {
* 日常维护 * 日常维护
*/ */
public static final String MAINTENANCE_KEY = "maintenance"; public static final String MAINTENANCE_KEY = "maintenance";
/**
* 消缺流程
*/
public static final String DEFECT_KEY = "defectDealty";
} }

4
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/ProcessDictFeignServiceFallback.java → hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/fallback/ProcessDictFeignServiceFallback.java

@ -1,6 +1,6 @@
package com.hnac.hzims.common.logs.fegin.fallback; package com.hnac.hzims.middle.process.fallback;
import com.hnac.hzims.common.logs.fegin.ProcessDictFeignService; import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

4
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/ProcessDictFeignService.java → hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java

@ -1,6 +1,6 @@
package com.hnac.hzims.common.logs.fegin; package com.hnac.hzims.middle.process.feign;
import com.hnac.hzims.common.logs.fegin.fallback.ProcessDictFeignServiceFallback; import com.hnac.hzims.middle.process.fallback.ProcessDictFeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

2
hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java → hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/to/ProcessWorkFlowResponse.java

@ -1,4 +1,4 @@
package com.hnac.hzims.common.to.process; package com.hnac.hzims.middle.process.to;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

1
hzims-service-api/pom.xml

@ -26,6 +26,7 @@
<module>ticket-api</module> <module>ticket-api</module>
<module>weather-api</module> <module>weather-api</module>
<module>common-api</module> <module>common-api</module>
<module>middle-api</module>
</modules> </modules>
<dependencies> <dependencies>

6
hzims-service-api/ticket-api/pom.xml

@ -21,5 +21,11 @@
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>hzims-operational-api</artifactId> <artifactId>hzims-operational-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

2
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java

@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.fallback; package com.hnac.hzims.ticket.ticketprocess.fallback;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient; import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

2
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java

@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.fallback; package com.hnac.hzims.ticket.ticketprocess.fallback;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient; import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

2
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java

@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.feign; package com.hnac.hzims.ticket.ticketprocess.feign;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.ticketprocess.fallback.OperationTicketFeignClientFallback; import com.hnac.hzims.ticket.ticketprocess.fallback.OperationTicketFeignClientFallback;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

2
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java

@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.feign; package com.hnac.hzims.ticket.ticketprocess.feign;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.ticketprocess.fallback.TicketProcessFeignClientFallback; import com.hnac.hzims.ticket.ticketprocess.fallback.TicketProcessFeignClientFallback;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

5
hzims-service/hzims-middle/pom.xml

@ -113,6 +113,11 @@
<artifactId>ticket-api</artifactId> <artifactId>ticket-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java

@ -2,11 +2,11 @@ package com.hnac.hzims.middle.processflow.consumer;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.entity.WorkflowOperationLog; import com.hnac.hzims.middle.processflow.entity.WorkflowOperationLog;
import com.hnac.hzims.middle.processflow.service.WorkflowOperationLogService; import com.hnac.hzims.middle.processflow.service.WorkflowOperationLogService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService; import com.hnac.hzims.middle.processflow.strategy.service.ProcessService;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.queue.annotation.RedisQueue; import org.springblade.queue.annotation.RedisQueue;
import org.springblade.queue.consume.IQueueConsume; import org.springblade.queue.consume.IQueueConsume;

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java

@ -5,13 +5,13 @@ import com.alibaba.fastjson.JSON;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.entity.ProcessType; import com.hnac.hzims.middle.processflow.entity.ProcessType;
import com.hnac.hzims.middle.processflow.properties.TicketProperties; import com.hnac.hzims.middle.processflow.properties.TicketProperties;
import com.hnac.hzims.middle.processflow.properties.WorkTicketProperties; import com.hnac.hzims.middle.processflow.properties.WorkTicketProperties;
import com.hnac.hzims.middle.processflow.service.ProcessTypeService; import com.hnac.hzims.middle.processflow.service.ProcessTypeService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService; import com.hnac.hzims.middle.processflow.strategy.service.ProcessService;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.jackson.JsonUtil; import org.springblade.core.tool.jackson.JsonUtil;

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java

@ -1,7 +1,7 @@
package com.hnac.hzims.middle.processflow.strategy.service; package com.hnac.hzims.middle.processflow.strategy.service;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
/** /**
* @Author dfy * @Author dfy

67
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java

@ -0,0 +1,67 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.operational.defect.feign.IOperDefectClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.DEFECT_KEY;
/**
* 消缺工作流实现类
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/28 8:47
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class DefectProcessServiceImpl extends ProcessAbstractService {
private final IOperDefectClient defectClient;
private final ProcessDictService processDictService;
/**
* 设置执行那种实现类
*
* @param flowQueue
* @return
*/
@Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
log.info("是否执行消缺工作流实流程环节操作~~~~,流程ticket: {}", flowQueue);
String dictValue = processDictService.selectDictValueByKey(DEFECT_KEY);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行消缺工作流程环节操作~~~~");
return true;
}
log.error("未是否执行消缺工作流流程环节操作,请联系管理员~~~~");
return false;
}
/**
* 两票管理业务方法
*
* @param response
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
R defect = defectClient.saveDefect(response);
if (!defect.isSuccess()) {
throw new ServiceException("消缺工作流程出现异常呢");
}
}
}

12
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java

@ -1,16 +1,16 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService; import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient; import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
/** /**
@ -28,7 +28,7 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService {
private final OperationTicketFeignClient ticketProcessService; private final TicketProcessFeignClient ticketProcessService;
@ -36,10 +36,6 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService {
/** /**
* 设置执行那种实现类 * 设置执行那种实现类
* *

4
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java

@ -1,16 +1,16 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService; import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient; import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MAINTENANCE_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.MAINTENANCE_KEY;
/** /**

4
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java

@ -1,17 +1,17 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService; import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient; import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.FIRST_TICKET_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.FIRST_TICKET_KEY;
/** /**

12
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java

@ -1,16 +1,17 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService; import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient; import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.OPERATION_TICKET_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
/** /**
@ -28,7 +29,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
private final TicketProcessFeignClient operationTicketService; private final OperationTicketFeignClient operationTicketFeignClient;
@ -44,7 +45,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
*/ */
@Override @Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
log.info("是否执行操作票流程环节操作~~~~,流程flowQueue: {}", flowQueue); log.info("是否执行操作票流程环节操作~~~~,流程flowQueue: {}", flowQueue);
String dictValue = processDictService.selectDictValueByKey(OPERATION_TICKET_KEY); String dictValue = processDictService.selectDictValueByKey(OPERATION_TICKET_KEY);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) { if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行操作票流程环节操作~~~~"); log.info("已执行操作票流程环节操作~~~~");
@ -61,10 +62,9 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
*/ */
@Override @Override
public void calculate(ProcessWorkFlowResponse response) { public void calculate(ProcessWorkFlowResponse response) {
Boolean pending = operationTicketService.findPending(response); Boolean pending = operationTicketFeignClient.findPending(response);
if (!pending) { if (!pending) {
throw new ServiceException("操作票流程出现异常呢"); throw new ServiceException("操作票流程出现异常呢");
} }
} }
} }

67
hzims-service/hzims-middle/src/main/resources/db/newsql.sql

@ -0,0 +1,67 @@
SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE `hzims-middle`.`hzims_process_type` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`sequence` int(11) NOT NULL COMMENT '序号',
`deployment_id` varchar(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前环节流程key',
`deployment_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前流程名称',
`segment` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一个流程图的名称',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流审批类型' ROW_FORMAT = Dynamic;
ALTER TABLE `hzims-middle`.`hzims_statistics` MODIFY COLUMN `module_name_num` int(11) NULL DEFAULT 0 COMMENT '功能模块统计' AFTER `module_name`;
ALTER TABLE `hzims-middle`.`hzims_statistics` MODIFY COLUMN `date_calculated` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '统计日期' AFTER `module_name_num`;
ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `title`;
ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `title_num`;
ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `path`;
ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `path_num`;
ALTER TABLE `hzims-middle`.`hzims_sys_log` ENGINE = MyISAM;
ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_operation_time_index`(`operation_time`) USING BTREE;
ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_module_name_index`(`module_name`) USING BTREE;
ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_title_index`(`title`) USING BTREE;
CREATE TABLE `hzims-middle`.`hzims_workflow_operation_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`take_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务ID',
`take_name` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称',
`process_definition_key` char(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前环节流程ID',
`process_instance_key` char(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '实例key',
`next_step_operator` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一环节处理人',
`variables` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '表单',
`user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id',
`handleType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 根据handleType区分是用户还是候选组角色 标识 0是用户 1是角色',
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`is_deleted` tinyint(4) NULL DEFAULT NULL COMMENT '是否逻辑删除,0 可用,1. 不可用',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流操作日志' ROW_FORMAT = Dynamic;
CREATE TABLE `hzims-middle`.`process_dict` (
`dict_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '票据编码',
`dict_sort` int(4) NULL DEFAULT 0 COMMENT '票据排序',
`dict_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据字典码',
`dict_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据流程标识',
`dict_label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据标签',
`dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据类型',
`is_default` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)',
`status` tinyint(1) NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
`create_dept` bigint(20) NULL DEFAULT NULL COMMENT '所属机构',
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '票据备注',
PRIMARY KEY (`dict_code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流字典表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS=1;

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DataServiceImpl.java

@ -11,7 +11,6 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.sun.org.apache.regexp.internal.RE;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java

@ -1186,7 +1186,7 @@ public class RealTargetServiceImpl implements RealTargetService {
*/ */
private int getPhotovoltaicState(EminfoAndEmParamVo device, Map<String, String> map) { private int getPhotovoltaicState(EminfoAndEmParamVo device, Map<String, String> map) {
// 获取开关机监测点实时数据 // 获取开关机监测点实时数据
Double value = this.getSignageValue(device, map, HomePageConstant.PV_JOINT_RELAY); double value = this.getSignageValue(device, map, HomePageConstant.PV_JOINT_RELAY);
// 开机状态 // 开机状态
if (Math.abs(value) <= 0) { if (Math.abs(value) <= 0) {
return 0; return 0;

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

@ -2,28 +2,26 @@ package com.hnac.hzims.message.fegin;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.*;
import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.dto.PushDto;
import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.entity.MessagePushRecordEntity; import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import com.hnac.hzims.message.service.IMessagePushRecordService; import com.hnac.hzims.message.service.IMessagePushRecordService;
import com.hnac.hzims.message.service.IMessageService; import com.hnac.hzims.message.service.IMessageService;
import com.hnac.hzims.message.service.IMessageTemplateService; import com.hnac.hzims.message.service.IMessageTemplateService;
import com.hnac.hzims.message.service.impl.PushMessageServiceImpl;
import com.hnac.hzims.message.service.impl.SmsMessageServiceImpl; import com.hnac.hzims.message.service.impl.SmsMessageServiceImpl;
import com.xxl.job.core.log.XxlJobLogger; import com.xxl.job.core.log.XxlJobLogger;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.*;
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.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -33,7 +31,9 @@ import javax.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* @author hx * @author hx
@ -115,4 +115,37 @@ public class MessageClient extends BladeController implements IMessageClient{
return R.success("推送成功!"); return R.success("推送成功!");
} }
@Override
@PostMapping(value = SEND_APP_AND_WS_MSG , produces="application/json; charset=UTF-8")
public R<Boolean> sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request) {
// 保存消息记录
List<MessagePushRecordEntity> pushRecords = Func.toLongList(request.getUserIds()).stream().flatMap(userId -> {
long messageId = IdWorker.getId();
return Lists.newArrayList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH).stream().map(messageType -> {
MessagePushRecordEntity record = BeanUtil.copy(request, MessagePushRecordEntity.class);
record.setMessageId(messageId);
record.setPusher(userId.toString());
record.setPusherName(Optional.ofNullable(UserCache.getUser(userId)).map(User::getName).orElse(null));
record.setPushType(MessageConstants.IMMEDIATELY);
record.setAccount(userId.toString());
record.setPlanTime(LocalDateTime.now());
record.setType(messageType);
record.setCreateDept(record.getDeptId());
return record;
});
}).collect(Collectors.toList());
boolean saveResult = recordService.saveBatch(pushRecords);
if(saveResult) {
List<MessagePushRecordEntity> appRecords = pushRecords.stream().filter(record -> MessageConstants.APP_PUSH.equals(record.getType())).collect(Collectors.toList());
// 推送消息 - app
Boolean appFlag = recordService.sendAppMsgByUsers(request, appRecords);
// 推送消息 - web
Boolean wsFlag = recordService.sendWsMsgByUsers(CollectionUtils.subtract(pushRecords, appRecords).stream().collect(Collectors.toList()));
return R.data(appFlag && wsFlag);
}
else {
return R.data(false);
}
}
} }

6
hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java

@ -1,11 +1,14 @@
package com.hnac.hzims.message.service; package com.hnac.hzims.message.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.entity.MessagePushRecordEntity; import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.vo.UnreadMessageVO; import com.hnac.hzims.message.vo.UnreadMessageVO;
import com.hnac.hzims.message.vo.msgpushrecord.*; import com.hnac.hzims.message.vo.msgpushrecord.*;
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 org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
@ -84,4 +87,7 @@ public interface IMessagePushRecordService extends BaseService<MessagePushRecord
**/ **/
List<UnreadMessageVO> getPersonalAppUnreadMessage(); List<UnreadMessageVO> getPersonalAppUnreadMessage();
Boolean sendAppMsgByUsers(BusinessMessageDTO request,List<MessagePushRecordEntity> records);
Boolean sendWsMsgByUsers(List<MessagePushRecordEntity> request);
} }

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

@ -14,6 +14,7 @@ import com.google.common.collect.Lists;
import com.hnac.hzims.common.utils.CacheUtil; import com.hnac.hzims.common.utils.CacheUtil;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.config.MessageFactory; import com.hnac.hzims.message.config.MessageFactory;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.entity.MessagePushRecordEntity; import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.enums.PushStatEnum; import com.hnac.hzims.message.enums.PushStatEnum;
import com.hnac.hzims.message.mapper.MessagePushRecordMapper; import com.hnac.hzims.message.mapper.MessagePushRecordMapper;
@ -30,6 +31,7 @@ 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.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictCache; import org.springblade.system.cache.DictCache;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -41,10 +43,7 @@ import java.time.LocalDateTime;
import java.time.Year; import java.time.Year;
import java.time.YearMonth; import java.time.YearMonth;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.*;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@ -321,6 +320,41 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public Boolean sendAppMsgByUsers(BusinessMessageDTO request,List<MessagePushRecordEntity> records) {
PushMessageServiceImpl service = SpringUtil.getBean(PushMessageServiceImpl.class);
try {
boolean sendFlag = service.sendByUsers(request.getSubject(), request.getContent(), Arrays.asList(request.getUserIds().split(",")), request.getTenantId());
if(sendFlag) {
return this.update(Wrappers.<MessagePushRecordEntity>lambdaUpdate()
.set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
.set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
.in(MessagePushRecordEntity::getId, records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList()))
);
}
return false;
}
catch(Exception e) {
throw new ServiceException(e.getMessage());
}
}
@Override
public Boolean sendWsMsgByUsers(List<MessagePushRecordEntity> request) {
WebsocketServiceImpl service = SpringUtil.getBean(WebsocketServiceImpl.class);
request.forEach(record -> {
boolean sendFlag = service.send(record);
if(sendFlag) {
this.update(Wrappers.<MessagePushRecordEntity>lambdaUpdate()
.set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
.set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
.in(MessagePushRecordEntity::getId, record.getId())
);
}
});
return true;
}
/** /**
* 状态 ===> 状态名称 * 状态 ===> 状态名称

40
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java

@ -29,6 +29,8 @@ import org.springframework.util.Assert;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
/** /**
@ -117,4 +119,42 @@ public class PushMessageServiceImpl implements IMessageService {
}); });
return true; return true;
} }
/**
* 发送APP消息(多人)
* @param subject 消息主题
* @param content 消息内容
* @param userIds 用户ID列表
* @param tenantId 推送成功标识
* @return
*/
public boolean sendByUsers(String subject, String content, List<String> userIds,String tenantId) throws Exception {
// 安卓推送
FutureTask<Boolean> androidPush = new FutureTask<>(() -> {
PushInfoVO pushInfoVO = new PushInfoVO();
PushPlatform pushPlatform = PushPlatform.newBuilder().addPlatformType(PlatformType.Android).build();
PushAudience pushAudience = PushAudience.newBuilder().addPushAudienceType(PushAudienceType.TAG, userIds).build();
PushInfo pushInfo = new PushInfo("ops-push-android", subject, content,"", null, pushPlatform, pushAudience);
pushInfoVO.setPushInfo(pushInfo);
pushInfoVO.setTenantId(tenantId);
R<PushResponse> pushResult = pushClient.tenantPush(pushInfoVO);
return pushResult.isSuccess();
});
new Thread(androidPush,"安卓推送").start();
// IOS推送
FutureTask<Boolean> iosPush = new FutureTask<>(() -> {
PushInfoVO pushInfoVO = new PushInfoVO();
PushPlatform pushPlatform = PushPlatform.newBuilder().addPlatformType(PlatformType.IOS).build();
PushAudience pushAudience = PushAudience.newBuilder().addPushAudienceType(PushAudienceType.TAG, userIds).build();
PushInfo pushInfo = new PushInfo("ops-push-ios", subject, content,"", null, pushPlatform, pushAudience);
pushInfoVO.setPushInfo(pushInfo);
pushInfoVO.setTenantId(tenantId);
R<PushResponse> pushResult = pushClient.tenantPush(pushInfoVO);
return pushResult.isSuccess();
});
new Thread(iosPush,"ios推送").start();
return androidPush.get() && iosPush.get();
}
} }

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

@ -23,6 +23,7 @@ import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession; import org.springframework.web.socket.WebSocketSession;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -459,7 +459,7 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
OperDefectEntity operDefectEntity = defectService.getOne(Wrappers.<OperDefectEntity>lambdaQuery().eq(OperDefectEntity::getDefectCode, operPhenomenonEntity.getDefectCode()).last("limit 1;")); OperDefectEntity operDefectEntity = defectService.getOne(Wrappers.<OperDefectEntity>lambdaQuery().eq(OperDefectEntity::getDefectCode, operPhenomenonEntity.getDefectCode()).last("limit 1;"));
if (ObjectUtil.isNotEmpty(operDefectEntity)) { if (ObjectUtil.isNotEmpty(operDefectEntity)) {
operDefectEntity.setActEndTime(new Date()); operDefectEntity.setActEndTime(new Date());
operDefectEntity.setActHours(ObjectUtil.isNotEmpty(accessTaskEntity.getActHours()) ? accessTaskEntity.getActHours().toString() : null); operDefectEntity.setActHours(ObjectUtil.isNotEmpty(accessTaskEntity.getActHours()) ? accessTaskEntity.getActHours() : null);
operDefectEntity.setHandleStatus(RepairConstant.CONCLUSION_PROBLEM); operDefectEntity.setHandleStatus(RepairConstant.CONCLUSION_PROBLEM);
operDefectEntity.setDisposeDesc(accessTaskEntity.getDescripiton()); operDefectEntity.setDisposeDesc(accessTaskEntity.getDescripiton());
defectService.updateById(operDefectEntity); defectService.updateById(operDefectEntity);

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/DefectCheckController.java

@ -5,17 +5,16 @@ import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IDefectCheckService; import com.hnac.hzims.operational.defect.service.IDefectCheckService;
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 lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask; import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid; import org.springframework.web.bind.annotation.RequestMapping;
import javax.validation.constraints.NotNull; import org.springframework.web.bind.annotation.RestController;
/** /**
* @author ysj * @author ysj

88
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java

@ -3,17 +3,15 @@ package com.hnac.hzims.operational.defect.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Lists;
import com.hnac.hzims.common.invalid.DictInvalid;
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; import com.hnac.hzims.common.invalid.ObjectRequiredInvalid;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.fdp.entity.FdpTaskEntity; import com.hnac.hzims.fdp.entity.FdpTaskEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -25,14 +23,10 @@ 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.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.entity.BladeFlow;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
/** /**
* 控制器 * 控制器
* *
@ -45,6 +39,7 @@ import java.util.Date;
@Validated @Validated
public class OperPhenomenonController extends BladeController { public class OperPhenomenonController extends BladeController {
private final IOperAppearanceService operAppearanceService;
private final IOperPhenomenonService phenomenonService; private final IOperPhenomenonService phenomenonService;
/** /**
@ -54,10 +49,9 @@ public class OperPhenomenonController extends BladeController {
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入phenomenon") @ApiOperation(value = "详情", notes = "传入phenomenon")
public R<OperPhenomenonVO> detail(OperPhenomenonEntity phenomenon) { public R<OperAppearanceEntity> detail(OperAppearanceEntity phenomenon) {
OperPhenomenonEntity detail = phenomenonService.getOne(Condition.getQueryWrapper(phenomenon)); OperAppearanceEntity appearanceEntity = operAppearanceService.getOne(Condition.getQueryWrapper(phenomenon));
OperPhenomenonVO vo = OperPhenomenonWrapper.build().entityVO(detail); return R.data(appearanceEntity);
return R.data(vo);
} }
/** /**
@ -72,58 +66,24 @@ public class OperPhenomenonController extends BladeController {
@OperationAnnotation(moduleName = "缺陷管理", title = "现象库", operatorType = OperatorType.MOBILE, businessType = @OperationAnnotation(moduleName = "缺陷管理", title = "现象库", operatorType = OperatorType.MOBILE, businessType =
BusinessType.GENCODE, action BusinessType.GENCODE, action
= "分页") = "分页")
public R<IPage<OperPhenomenonVO>> list(OperPhenomenonEntity entity, String taskIds, Query query, Date findTimeEnd) { public R<IPage<OperAppearanceEntity>> list(OperAppearanceVO phenomenon, Query query) {
LambdaQueryWrapper<OperPhenomenonEntity> queryWrapper = Condition.getQueryWrapper(new OperPhenomenonEntity(), entity); LambdaQueryWrapper<OperAppearanceEntity> queryWrapper = operAppearanceService.getQueryWrapper(phenomenon);
if (StringUtil.isNotBlank(taskIds)) { IPage<OperAppearanceEntity> pages = operAppearanceService.page(Condition.getPage(query), queryWrapper);
queryWrapper.in(OperPhenomenonEntity::getId, Lists.newArrayList(taskIds.split(","))); // IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages);
} return R.data(pages);
if (Func.isNotEmpty(entity.getFindTime())) {
queryWrapper.ge(OperPhenomenonEntity::getFindTime, entity.getFindTime());
}
if (Func.isNotEmpty(findTimeEnd)) {
queryWrapper.le(OperPhenomenonEntity::getFindTime, findTimeEnd);
}
if (Func.isNotEmpty(entity.getDiscriminateStatus())) {
queryWrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, entity.getDiscriminateStatus());
}
if (Func.isNotEmpty(entity.getCreateDept())) {
queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getCreateDept());
}
// // 区域Id
// if (Func.isNotEmpty(entity.getAreaId())) {
// queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getAreaId());
// }
//
// // 年份
// if (Func.isNotEmpty(entity.getYearMonth())) {
// queryWrapper.apply("date_format(t.CREATE_TIME, '%Y-%m') = '"
// + (entity.getYearMonth() + "'"));
// }
//
//
// // 是否为缺陷 已定论1
// if (Func.isNotEmpty(entity.getDefect()) && Func.isNotEmpty(entity.getConclusionStatusNum())) {
// queryWrapper.eq(OperPhenomenonEntity::getIsDefect, entity.getDefect());
// queryWrapper.or().eq(OperPhenomenonEntity::getConclusionStatus, entity.getConclusionStatusNum());
// }
queryWrapper.orderByDesc(OperPhenomenonEntity::getUpdateTime);
IPage<OperPhenomenonEntity> pages = phenomenonService.page(Condition.getPage(query), queryWrapper);
IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages);
return R.data(vos);
} }
/**
* 新增 代码自定义代号 //此端口弃用20230621
*/ // /**
@PostMapping("/save") // * 新增 代码自定义代号
@ApiOperationSupport(order = 4) // */
@ApiOperation(value = "提交现象,现象提交后不能修改", notes = "传入phenomenon") // @PostMapping("/save")
public R save(@Valid @RequestBody OperPhenomenonEntity phenomenon) { // @ApiOperationSupport(order = 4)
return R.data(phenomenonService.submit(phenomenon)); // @ApiOperation(value = "提交现象,现象提交后不能修改", notes = "传入phenomenon")
} // public R save(@Valid @RequestBody OperPhenomenonEntity phenomenon) {
// return R.data(phenomenonService.submit(phenomenon));
// }
/* */ /** /* */ /**
* 修改 代码自定义代号 * 修改 代码自定义代号
@ -153,7 +113,7 @@ public class OperPhenomenonController extends BladeController {
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids") @ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(phenomenonService.deleteLogic(Func.toLongList(ids))); return R.status(operAppearanceService.deleteLogic(Func.toLongList(ids)));
} }

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/feign/OperDefectClient.java

@ -1,12 +1,13 @@
package com.hnac.hzims.operational.defect.feign; package com.hnac.hzims.operational.defect.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IDefectCheckService; import com.hnac.hzims.operational.defect.service.IDefectCheckService;
import com.hnac.hzims.operational.defect.service.IOperDefectService; import com.hnac.hzims.operational.defect.service.IOperDefectService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -32,8 +33,15 @@ public class OperDefectClient implements IOperDefectClient {
return R.data(service.updateDefectHanderState(entity)); return R.data(service.updateDefectHanderState(entity));
} }
@PostMapping(CREATE_DEFECT)
@Override @Override
public R createDefect(@RequestBody OperPhenomenonEntity entity) { public R createDefect(@RequestBody OperPhenomenonEntity entity) {
return R.data(defectCheckService.startCheck(entity)); return R.data(defectCheckService.startCheck(entity));
} }
@PostMapping(SAVE_DEFECT)
@Override
public R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) {
return defectCheckService.listenAndUpdateDefect(processWorkFlowResponse);
}
} }

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.java

@ -0,0 +1,14 @@
package com.hnac.hzims.operational.defect.mapper;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* Mapper 接口
*
* @author Chill
*/
public interface OperAppearanceMapper extends UserDataScopeBaseMapper<OperAppearanceEntity> {
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.defect.mapper.OperAppearanceMapper">
</mapper>

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IDefectCheckService.java

@ -1,7 +1,9 @@
package com.hnac.hzims.operational.defect.service; package com.hnac.hzims.operational.defect.service;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask; import org.springblade.flow.core.vo.ComleteTask;
@ -42,6 +44,7 @@ public interface IDefectCheckService extends BaseService<OperPhenomenonEntity> {
* @param task * @param task
*/ */
void conclusion(ComleteTask task); void conclusion(ComleteTask task);
R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse);
} }

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.operational.defect.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
import org.springblade.core.mp.base.BaseService;
/**
* 服务类
*
* @author Chill
*/
public interface IOperAppearanceService extends BaseService<OperAppearanceEntity> {
LambdaQueryWrapper<OperAppearanceEntity> getQueryWrapper(OperAppearanceVO operAppearanceVO);
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.defect.service; package com.hnac.hzims.operational.defect.service;
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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
@ -99,4 +100,6 @@ public interface IOperDefectService extends BaseService<OperDefectEntity> {
* @return * @return
*/ */
IPage<OperDefectEntity> selectPage(Page<OperDefectEntity> operDefectEntityPage, OperDefectEntity defect); IPage<OperDefectEntity> selectPage(Page<OperDefectEntity> operDefectEntityPage, OperDefectEntity defect);
LambdaQueryWrapper<OperDefectEntity> getQueryWrapper(OperDefectVO defectVO);
} }

1327
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

File diff suppressed because it is too large Load Diff

61
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java

@ -0,0 +1,61 @@
package com.hnac.hzims.operational.defect.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.mapper.OperAppearanceMapper;
import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
/**
* 服务实现类
*
* @author Chill
*/
@Service
public class OperAppearanceServiceImpl extends BaseServiceImpl<OperAppearanceMapper, OperAppearanceEntity> implements IOperAppearanceService {
@Override
public LambdaQueryWrapper<OperAppearanceEntity> getQueryWrapper(OperAppearanceVO operAppearanceVO) {
LambdaQueryWrapper<OperAppearanceEntity> queryWrapper = Condition.getQueryWrapper(new OperAppearanceEntity(), operAppearanceVO);
if (ObjectUtils.isEmpty(operAppearanceVO)) {
if (StringUtil.isNotBlank(operAppearanceVO.getDefectCode())) {
queryWrapper.eq(OperAppearanceEntity::getId, operAppearanceVO.getDefectCode());
}
if (StringUtil.isNotBlank(operAppearanceVO.getEmCode())) {
queryWrapper.eq(OperAppearanceEntity::getEmCode, operAppearanceVO.getEmCode());
}
if (Func.isNotEmpty(operAppearanceVO.getFindTime())) {
queryWrapper.ge(OperAppearanceEntity::getFindTime, operAppearanceVO.getFindTime());
}
if (Func.isNotEmpty(operAppearanceVO.getFindEndTime())) {
queryWrapper.le(OperAppearanceEntity::getFindTime, operAppearanceVO.getFindEndTime());
}
if (Func.isNotEmpty(operAppearanceVO.getFinder())) {
queryWrapper.eq(OperAppearanceEntity::getFinder, operAppearanceVO.getFinder());
}
if (Func.isNotEmpty(operAppearanceVO.getName())) {
queryWrapper.like(OperAppearanceEntity::getName, operAppearanceVO.getName());
}
if (Func.isNotEmpty(operAppearanceVO.getDiscriminator())) {
queryWrapper.eq(OperAppearanceEntity::getDiscriminator, operAppearanceVO.getDiscriminator());
}
if (Func.isNotEmpty(operAppearanceVO.getIsDefect())) {
queryWrapper.eq(OperAppearanceEntity::getIsDefect, operAppearanceVO.getIsDefect());
}
if (Func.isNotEmpty(operAppearanceVO.getCreateDept())) {
queryWrapper.eq(OperAppearanceEntity::getCreateDept, operAppearanceVO.getCreateDept());
}
if (Func.isNotEmpty(operAppearanceVO.getIsDiagnosis())) {
queryWrapper.eq(OperAppearanceEntity::getIsDiagnosis, operAppearanceVO.getIsDiagnosis());
}
queryWrapper.orderByDesc(OperAppearanceEntity::getUpdateTime);
}
return queryWrapper;
}
}

67
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -13,7 +13,6 @@ import com.hnac.hzims.operational.access.service.IOperAccessPlanService;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.access.service.impl.OperAccessPlanServiceImpl; import com.hnac.hzims.operational.access.service.impl.OperAccessPlanServiceImpl;
import com.hnac.hzims.operational.defect.constants.DefectConstant; import com.hnac.hzims.operational.defect.constants.DefectConstant;
import com.hnac.hzims.operational.defect.constants.RepairConstant;
import com.hnac.hzims.operational.defect.dto.*; import com.hnac.hzims.operational.defect.dto.*;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
@ -24,10 +23,9 @@ import com.hnac.hzims.operational.defect.vo.OperDefectVO;
import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper; import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper;
import com.hnac.hzims.operational.report.vo.DefectReportsVO; import com.hnac.hzims.operational.report.vo.DefectReportsVO;
import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.ticket.repair.entity.RepairEntity;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import com.sun.javafx.binding.StringFormatter;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.hssf.util.HSSFColor;
@ -55,7 +53,6 @@ import org.springblade.system.cache.DictCache;
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.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
@ -69,7 +66,6 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -122,8 +118,65 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
} }
} }
@Override
public LambdaQueryWrapper<OperDefectEntity> getQueryWrapper(OperDefectVO defectVO) {
LambdaQueryWrapper<OperDefectEntity> queryWrapper = Condition.getQueryWrapper(new OperDefectEntity(), defectVO);
if (ObjectUtils.isEmpty(defectVO)) {
if (defectVO.getActStartTime() != null) {
queryWrapper.ge(OperDefectEntity::getActStartTime, defectVO.getActStartTime());
}
if (defectVO.getActEndTime() != null) {
queryWrapper.le(OperDefectEntity::getActEndTime, defectVO.getActEndTime());
}
if (defectVO.getStartTime() != null) {
queryWrapper.ge(OperDefectEntity::getCreateTime, defectVO.getStartTime());
}
if (defectVO.getEndTime() != null) {
queryWrapper.le(OperDefectEntity::getCreateTime, defectVO.getEndTime());
}
if (defectVO.getCreateDept() != null) {
queryWrapper.eq(OperDefectEntity::getCreateDept, defectVO.getCreateDept());
}
if (StringUtil.isNotBlank(defectVO.getDefectCode())) {
queryWrapper.eq(OperDefectEntity::getId, defectVO.getDefectCode());
}
if (ObjectUtils.isNotEmpty(defectVO.getIsDiagnosis())) {
queryWrapper.eq(OperDefectEntity::getIsDiagnosis, defectVO.getIsDiagnosis());
}
if (Func.isNotEmpty(defectVO.getDefectGrading())) {
queryWrapper.like(OperDefectEntity::getDefectGrading, defectVO.getDefectGrading());
}
if (Func.isNotEmpty(defectVO.getConclusionLabel())) {
queryWrapper.like(OperDefectEntity::getConclusionLabel, defectVO.getConclusionLabel());
}
if (Func.isNotEmpty(defectVO.getDiagnosisId())) {
queryWrapper.eq(OperDefectEntity::getDiagnosisId, defectVO.getDiagnosisId());
}
if (Func.isNotEmpty(defectVO.getConclusionPeople())) {
queryWrapper.like(OperDefectEntity::getConclusionPeople, defectVO.getConclusionPeople());
}
if (Func.isNotEmpty(defectVO.getExistDefectId())) {
queryWrapper.eq(OperDefectEntity::getExistDefectId, defectVO.getExistDefectId());
}
if (Func.isNotEmpty(defectVO.getConclusionTime())) {
queryWrapper.le(OperDefectEntity::getConclusionTime, defectVO.getConclusionTime());
}
if (Func.isNotEmpty(defectVO.getConclusionEndTime())) {
queryWrapper.ge(OperDefectEntity::getConclusionTime, defectVO.getConclusionEndTime());
}
if (Func.isNotEmpty(defectVO.getConclusion())) {
queryWrapper.like(OperDefectEntity::getConclusion, defectVO.getConclusion());
}
if (Func.isNotEmpty(defectVO.getCreateDept())) {
queryWrapper.eq(OperDefectEntity::getCreateDept, defectVO.getCreateDept());
}
if (Func.isNotEmpty(defectVO.getIsDiagnosis())) {
queryWrapper.eq(OperDefectEntity::getIsDiagnosis, defectVO.getIsDiagnosis());
}
queryWrapper.orderByDesc(OperDefectEntity::getUpdateTime);
}
return queryWrapper;
}
/** /**
* 处理问题 * 处理问题
* *

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java

@ -246,7 +246,7 @@ public class HomeServiceImpl implements HomeService {
double plan = list.stream().mapToDouble(PowerEntity::getPlannedPowerMon).sum(); double plan = list.stream().mapToDouble(PowerEntity::getPlannedPowerMon).sum();
double pass = list.stream().mapToDouble(power -> Double.parseDouble(power.getDoubleQualifyRate())).sum(); double pass = list.stream().mapToDouble(power -> Double.parseDouble(power.getDoubleQualifyRate())).sum();
// 装机容量 // 装机容量
target.setTaget_one(list.stream().map(PowerEntity::getInstalledCapacity).collect(Collectors.toSet()).stream().mapToDouble(Double::valueOf).sum()); target.setTaget_one(list.get(0).getInstalledCapacity());
// 发电量 // 发电量
target.setTaget_two(list.stream().mapToDouble(PowerEntity::getPowerMon).sum()); target.setTaget_two(list.stream().mapToDouble(PowerEntity::getPowerMon).sum());
if(Math.abs(plan) > 0){ if(Math.abs(plan) > 0){
@ -254,7 +254,7 @@ public class HomeServiceImpl implements HomeService {
target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
} }
// 双票合格率 // 双票合格率
target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); target.setTaget_four(BigDecimal.valueOf(pass / list.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
return target; return target;
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java

@ -1,8 +1,8 @@
package com.hnac.hzims.operational.maintenance.controller; package com.hnac.hzims.operational.maintenance.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.maintenance.service.MaintenanceService; import com.hnac.hzims.operational.maintenance.service.MaintenanceService;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -58,6 +58,7 @@ public class MaintenanceController {
maintenanceService.findPending(response); maintenanceService.findPending(response);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new ServiceException("日常维护待处理:" + e.getMessage()); throw new ServiceException("日常维护待处理:" + e.getMessage());
} }
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java

@ -2,7 +2,7 @@ package com.hnac.hzims.operational.maintenance.service;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import java.util.List; import java.util.List;

87
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java

@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.utils.DateUtil; import com.hnac.hzims.common.utils.DateUtil;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.dto.PlanMsgRecordDto; import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService; import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity; import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity;
@ -21,7 +23,6 @@ import com.hnac.hzims.operational.maintenance.service.MaintenanceService;
import com.hnac.hzims.operational.maintenance.template.service.TemplateService; import com.hnac.hzims.operational.maintenance.template.service.TemplateService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskEntityVo; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskEntityVo;
import com.hnac.hzims.operational.util.StringObjUtils; import com.hnac.hzims.operational.util.StringObjUtils;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -113,6 +114,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
* @param response * @param response
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class)
public void findPending(ProcessWorkFlowResponse response) { public void findPending(ProcessWorkFlowResponse response) {
log.info("获取businessKey: {}", response.getBusinessKey()); log.info("获取businessKey: {}", response.getBusinessKey());
log.info("获取taskId: {} ", response.getTaskId()); log.info("获取taskId: {} ", response.getTaskId());
@ -148,41 +150,70 @@ public class MaintenanceServiceImpl implements MaintenanceService {
//推送消息 //推送消息
if (response.getTaskId() != null) { if (response.getTaskId() != null) {
MessagePushRecordDto message = new MessagePushRecordDto(); // MessagePushRecordDto message = new MessagePushRecordDto();
message.setBusinessClassify("business"); // message.setBusinessClassify("business");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey()); // message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription()); // message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
message.setTaskId(entity.getId()); // message.setTaskId(entity.getId());
message.setTenantId("200000"); // message.setTenantId("200000");
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); // message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY); // message.setPushType(MessageConstants.IMMEDIATELY);
// //您有一张工作票待审批,工作内容:*****,审批环节:*****;
// String countent =
// "您有一条日常维护任务待审批,工作内容:".concat(entity.getTitle())
// .concat(",审批环节:")
// .concat(response.getTaskName());
// message.setContent(countent);
// message.setDeptId(entity.getCreateDept());
// R<String> deptName = sysClient.getDeptName(entity.getCreateDept());
// if (deptName.isSuccess()) {
// message.setDeptName(deptName.getData());
// }
// String userIds = response.getUserId();
// if (com.hnac.hzims.common.logs.utils.StringUtils.isBlank(userIds)) {
// log.error("推送的消息不能为空哦,{}", userIds);
// return;
// }
// String[] split = userIds.split(",");
// for (String userId : split) {
// message.setPusher(userId);
// User user = UserCache.getUser(NumberUtils.toLong(userId));
// if (ObjectUtils.isNotEmpty(user)) {
// message.setPusherName(user.getName());
// }
// message.setAccount(userId);
// message.setCreateUser(NumberUtils.toLong(userId));
// messageClient.sendMessage(message);
// }
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
businessMessageDTO.setBusinessClassify("business");
businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.ROUTINEMAINTENANCE.getKey());
businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.ROUTINEMAINTENANCE.getDescription());
businessMessageDTO.setTaskId(dbOperMaintenanceTaskEntity.getId());
businessMessageDTO.setTenantId("200000");
//您有一张工作票待审批,工作内容:*****,审批环节:*****; //您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent = String countent =
"您有一条日常维护任务待审批,工作内容:".concat(entity.getTitle()) "您有一条日常维护任务待审批,工作内容:".concat(dbOperMaintenanceTaskEntity.getTitle())
.concat(",审批环节:") .concat(",审批环节:")
.concat(response.getTaskName()); .concat(response.getTaskName());
message.setContent(countent); businessMessageDTO.setContent(countent);
message.setDeptId(entity.getCreateDept()); businessMessageDTO.setDeptId(dbOperMaintenanceTaskEntity.getCreateDept());
R<String> deptName = sysClient.getDeptName(entity.getCreateDept()); R<String> deptName = sysClient.getDeptName(dbOperMaintenanceTaskEntity.getCreateDept());
if (deptName.isSuccess()) { if (deptName.isSuccess()) {
message.setDeptName(deptName.getData()); businessMessageDTO.setDeptName(deptName.getData());
} }
String userIds = response.getUserId(); String userIds = response.getUserId();
if (com.hnac.hzims.common.logs.utils.StringUtils.isBlank(userIds)) { businessMessageDTO.setUserIds(userIds);
log.error("推送的消息不能为空哦,{}", userIds); businessMessageDTO.setCreateUser(dbOperMaintenanceTaskEntity.getCreateUser());
return;
} log.info("================================================");
String[] split = userIds.split(","); log.info("businessMessageDTO = " + businessMessageDTO);
for (String userId : split) { log.info("================================================");
message.setPusher(userId); R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
User user = UserCache.getUser(NumberUtils.toLong(userId)); if (!booleanR.isSuccess()) {
if (ObjectUtils.isNotEmpty(user)) { throw new ServiceException("消息推送失败");
message.setPusherName(user.getName());
}
message.setAccount(userId);
message.setCreateUser(NumberUtils.toLong(userId));
messageClient.sendMessage(message);
} }
log.info("推送成功~");
} }
} }

575
hzims-service/operational/src/main/resources/db/2.0.0.sql

@ -0,0 +1,575 @@
SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE `hzims_operation`.`ecology_flow_data` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`STATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '站点编号',
`STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`MON` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '月份',
`ON_LINE` decimal(15, 2) NULL DEFAULT NULL COMMENT '在线率',
`DEMONSTRATE` decimal(15, 2) NULL DEFAULT NULL COMMENT '达标率',
`TIMELY` decimal(15, 2) NULL DEFAULT NULL COMMENT '及时率',
`COMPLETE` decimal(15, 2) NULL DEFAULT NULL COMMENT '完整率',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
`STATUS` tinyint(4) NOT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`ecology_flow_station` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`STATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '站点编号',
`STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`IS_ON_LINE` bigint(1) NULL DEFAULT NULL COMMENT '是否在线:0-离线 1-在线',
`IS_DEMONSTRATE` bigint(1) NULL DEFAULT NULL COMMENT '是否达标:0-不达标 1-达标',
`IS_TIMELY` bigint(1) NULL DEFAULT NULL COMMENT '是否及时:0-不及时 1-及时',
`IS_COMPLETE` bigint(1) NULL DEFAULT NULL COMMENT '是否完整:0-不完整 1-完整',
`CITY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '城市: 0-黔东南 1-广宁',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
`STATUS` tinyint(4) NOT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `hzims_operation`.`hz_ims_duty_main_template` MODIFY COLUMN `DUTY_ORDER_IDS` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组值班周期id' AFTER `TYPE`;
ALTER TABLE `hzims_operation`.`hzims_fill_over` MODIFY COLUMN `ENCL_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称' AFTER `ENCL_PATH`;
ALTER TABLE `hzims_operation`.`hzims_fill_over_config` MODIFY COLUMN `SORT` tinyint(4) NOT NULL COMMENT '排序' AFTER `UNIT_PRICE`;
ALTER TABLE `hzims_operation`.`hzims_fill_over_config` ADD UNIQUE INDEX `OVER_NAME`(`OVER_NAME`) USING BTREE;
ALTER TABLE `hzims_operation`.`hzims_fill_power` MODIFY COLUMN `POWER_MON` double(20, 2) NULL DEFAULT 0.00 COMMENT '月发电量' AFTER `PLANNED_POWER_MON`;
CREATE TABLE `hzims_operation`.`hzims_fill_wind` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号',
`STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`FILL_DATE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期',
`PLAN` decimal(15, 2) NULL DEFAULT NULL COMMENT '计划发电量',
`POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量',
`SPEED` decimal(15, 2) NULL DEFAULT NULL COMMENT '平均风速',
`SURF_POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '上网电量',
`BELOW_POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '下网电量',
`AVAILABLE` decimal(15, 2) NULL DEFAULT NULL COMMENT '可用时长',
`COMPREHENSIVE_POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '综合用电量',
`PEAK` decimal(15, 2) NULL DEFAULT NULL COMMENT '峰值功率',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位' AFTER `SOE_EXPLAIN`;
ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人' AFTER `CREATE_DEPT`;
ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态' AFTER `TENANT_ID`;
ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间' AFTER `UPDATE_USER`;
ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除' AFTER `UPDATE_TIME`;
ALTER TABLE `hzims_operation`.`hzims_main_work_bench` MODIFY COLUMN `ORD` int(11) NULL DEFAULT NULL COMMENT '排序' AFTER `ENABLE_FLAG`;
ALTER TABLE `hzims_operation`.`hzims_main_work_bench` MODIFY COLUMN `REF_DEPT` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属机构' AFTER `ORD`;
ALTER TABLE `hzims_operation`.`hzims_month_report` MODIFY COLUMN `OBJECT` blob NULL COMMENT '报表保存对象' AFTER `TYPE`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_plan` MODIFY COLUMN `phenomenon_id` bigint(20) NULL DEFAULT NULL COMMENT '现象ID' AFTER `DESCRIPITON`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_plan` DROP COLUMN `TASK_NAME`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_plan` DROP COLUMN `NEXT_STEP_OPERATOR`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_task` ADD COLUMN `MESSAGE_TEMPLATE_ID` bigint(20) NULL DEFAULT NULL COMMENT '模板id' AFTER `phenomenon_id`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `PROCESS_INSTANCE_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '工作流实例' AFTER `EM_CODE`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `ticket_id` bigint(20) NULL DEFAULT NULL AFTER `UPDATE_TIME`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `delay_date` datetime(0) NULL DEFAULT NULL AFTER `ticket_id`;
ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `DELAY_STATUS` tinyint(4) NULL DEFAULT NULL AFTER `delay_date`;
ALTER TABLE `hzims_operation`.`hzims_oper_fault` MODIFY COLUMN `FAULT_TYPE` tinyint(4) NULL DEFAULT NULL COMMENT '0- 标准;1 - 非标准' AFTER `FAULT_NAME`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_library` MODIFY COLUMN `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码' AFTER `PROC_DEF_ID`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_plan` MODIFY COLUMN `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码' AFTER `ID`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_plan` MODIFY COLUMN `TASK_TYPE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '0:系统生成任务,1:临时任务' AFTER `UPDATE_TIME`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码' AFTER `ID`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `TASK_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `TYPE_CODE`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DISPOSER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行人(按,分隔)' AFTER `PROCESS_INSTANCE_ID`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DISPOSE_TIME` datetime(0) NOT NULL COMMENT '任务按周期生成计划开始时间' AFTER `DISPOSER`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `EXECUTE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '任务执行日期' AFTER `DISPOSE_TIME`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `PUSH_MSG_STATUS` tinyint(4) NULL DEFAULT 0 COMMENT '消息推送状态 0=未推送 1=已推送' AFTER `DESCRIPTION`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `TASK_TYPE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '0:系统生成任务,1:临时任务' AFTER `UPDATE_TIME`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DELAY_STATUS` tinyint(4) NULL DEFAULT NULL AFTER `TASK_TYPE`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DELAY_DATE` datetime(0) NULL DEFAULT NULL AFTER `DELAY_STATUS`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `ticket_id` bigint(20) NULL DEFAULT NULL AFTER `DELAY_DATE`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `PLAN_END_TIME` datetime(0) NULL DEFAULT NULL AFTER `ticket_id`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_status` int(11) NULL DEFAULT NULL COMMENT '流程状态' AFTER `MESSAGE_TEMPLATE_ID`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_description` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `next_step_operator` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `flow_description`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_task_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名' AFTER `flow_user_id`;
ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_task_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名' AFTER `flow_task_name`;
ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `EM_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编号' AFTER `NAME`;
ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `HANDLE_TASK_ID` bigint(20) NULL DEFAULT NULL COMMENT '处理任务ID' AFTER `HANDLE_TYPE`;
ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `HANDLER` bigint(20) NULL DEFAULT NULL COMMENT '处理人,处理工作流的第一个处理人' AFTER `HANDLE_TASK_ID`;
ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人' AFTER `UPDATE_TIME`;
CREATE TABLE `hzims_operation`.`hzims_oper_repair` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备code',
`NUMBER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号',
`COMPANY` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
`HANDLE_STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '处理状态',
`CHARGE` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修负责人',
`REPAIR_TEAM` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修班组',
`REPAIR_PERSONNEL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应急抢修人员',
`REPAIR_TASK` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应急抢修任务描述',
`ORIGINATOR` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修发起人',
`SAFETY_MEASURES` varchar(2080) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '安全措施',
`POINTS_ATTENTION` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '注意事项',
`LICENSOR` bigint(20) NULL DEFAULT NULL COMMENT '许可人',
`LICENSOR_TIME` datetime(0) NULL DEFAULT NULL COMMENT '许可时间',
`LICENSOR_MEASURES` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '许可建议安全措施',
`LICENSOR_MEMO` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修完成许可描述',
`LICENSOR_COMPLETE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修完成许可时间',
`IMPLEMENT_HOURS` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修工时',
`IMPLEMENT_START_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修开始时间',
`IMPLEMENT_END_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修结束时间',
`IMPLEMENT_DESC` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修描述',
`PROCESS_INSTANCE_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程实例ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`hzims_review_standard` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`review_id` bigint(20) NOT NULL COMMENT '评审ID',
`standard_id` tinyint(4) NOT NULL COMMENT '标准ID',
`standard_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标准名称',
`score` tinyint(4) NULL DEFAULT NULL COMMENT '分数',
`status` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`IS_DELETED` tinyint(4) NULL DEFAULT NULL,
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `hzims_operation`.`hzims_station` DROP INDEX `hzims_station_pk`;
ALTER TABLE `hzims_operation`.`hzims_station_user` MODIFY COLUMN `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人' AFTER `UPDATE_TIME`;
ALTER TABLE `hzims_operation`.`hzims_station_video_type` MODIFY COLUMN `video_type` tinyint(4) NULL DEFAULT NULL COMMENT '视频类型;默认为1:清污机类型' AFTER `SORT`;
ALTER TABLE `hzims_operation`.`hzims_unit_running_time` MODIFY COLUMN `DATE_TIME` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '年月' AFTER `EM_CODE`;
CREATE TABLE `hzims_operation`.`temp` (
`db_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`tablename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`LieName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`temp_dept_sync` (
`id` bigint(20) NOT NULL,
`old_dept_id` bigint(20) NULL DEFAULT NULL COMMENT '旧机构ID',
`new_dept_id` bigint(20) NULL DEFAULT NULL COMMENT '新机构ID',
`is_sync` tinyint(255) NULL DEFAULT NULL COMMENT '是否同步',
`dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机构名称',
`execute_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '机构同步表' ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`temp_sync_info` (
`sync_id` bigint(20) NOT NULL COMMENT '同步ID',
`db_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据库',
`table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '',
`column_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '',
`be_replaced` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被替换值',
`replaced` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '替换值',
`replaced_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '替换sql',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间',
`bak_replaced_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '还原sql',
`status` tinyint(4) NULL DEFAULT NULL COMMENT '执行状态'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_allocation` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
`RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
`IN_WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '入库仓库',
`OUT_WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '出库仓库',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_basic` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`MANAGEMENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '分类ID',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
`CODE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码',
`SPECIFICATIONS` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格',
`BRAND` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '品牌',
`UNIT` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
`WEIGHT` decimal(10, 2) NULL DEFAULT NULL COMMENT '重量',
`PRICE` decimal(10, 2) NULL DEFAULT NULL COMMENT '单价',
`UPPER_LIMIT` int(10) NULL DEFAULT NULL COMMENT '库存上限',
`LOWER_LIMIT` int(10) NULL DEFAULT NULL COMMENT '库存下限',
`IS_WASTE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否回收废品',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`PARAMETER` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '主要参数',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`CODE_NUMBER` bigint(20) NULL DEFAULT NULL COMMENT '序列号',
`WATER_PLANT_ID` bigint(16) NULL DEFAULT NULL COMMENT '水厂ID',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_management` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
`PARENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属父级',
`ANCESTORS` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '祖级节点',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类编码',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件:1,工具:2',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`CODE_NUMBER` bigint(20) NULL DEFAULT NULL COMMENT '序列号',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_provider` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`ORGANIZATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '机构ID',
`ORGANIZATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构编码',
`SCOPE_OF_SUPPLY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供货范围',
`SUPPLY_CYCLE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供货周期',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
`LOGOGRAM` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称缩写',
`SALESMAN` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务联系人',
`LEGAL_PERSON` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人代表',
`PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电话',
`MOBILE_PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机',
`WEBSITE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '网址',
`ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
`QUALIFIED_FLAG` int(11) NULL DEFAULT 1 COMMENT '是否合格(0:否,1:是)',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态',
`REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_receive` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
`TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单ID',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
`RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
`STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_receives` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
`TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单ID',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
`RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
`STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`VECEIVE_ID` bigint(20) NULL DEFAULT NULL COMMENT '工具领用单ID',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_record` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`BUSINESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '业务表ID',
`AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量AMOUNT',
`SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备品备件ID',
`WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库',
`TYPE` int(11) NULL DEFAULT NULL COMMENT '类型1:入库,2:出库,3:调拨,4:领用',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态',
`IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_revert` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
`RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
`STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
`AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量',
`SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID',
`NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件名称',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`CURRENT_OPERATOR` bigint(20) NULL DEFAULT NULL COMMENT '当前处理人',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_ticket_relation` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`ORDER_ID` bigint(20) NULL DEFAULT NULL COMMENT '出库单ID',
`AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量',
`TICKET` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单号',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备件ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态',
`IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_tool_basic` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID',
`QUALITY_GUARANTEE_PERIOD` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保质期',
`PRODUCTION_PERIOD` datetime(0) NULL DEFAULT NULL COMMENT '生产日期',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '领用时间',
`CREATE_USER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '领用人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`ATACHMENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '类型(文件类型)',
`QUANTITY_RECEIVED` bigint(20) NULL DEFAULT NULL COMMENT '领用数量',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_total` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID',
`MIN_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '最低储备量',
`MAX_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '最高储备量',
`STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存',
`IN_PRICE` decimal(12, 2) NULL DEFAULT NULL COMMENT '最新入库单价',
`OUT_PRICE` decimal(12, 2) NULL DEFAULT NULL COMMENT '最新出库单价',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`OUT_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '出库暂存',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`WARNING_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '警戒百分比',
`WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库ID',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_type_dictionaries` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
`CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码',
`P_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上级编码',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_warehouse` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
`CODE` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
`MANAGER` bigint(20) NULL DEFAULT NULL COMMENT '负责人',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`STOCK` bigint(20) NULL DEFAULT NULL COMMENT '当前存量',
`MAX_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存上限',
`MIN_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存下限',
`WARNING_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '警戒百分比',
`REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`AFFILIATED_UNIT` bigint(20) NULL DEFAULT NULL COMMENT '所属单位',
`AFFILIATED_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属单位名称',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_warehouse_in` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`TYPE` bigint(20) NULL DEFAULT NULL COMMENT '入库类型',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
`STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
`CURRENT_OPERATOR` bigint(20) NULL DEFAULT NULL COMMENT '当前处理人',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单编号',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_warehouse_in_record` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '出入库编号',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
`TITLE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题',
`STORAGE_ROOM` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仓库库房',
`TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型,用枚举来判断是工具还是备品备件',
`OPERATION` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作:用枚举来判断是出库还是入库',
`AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量',
`SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备品备件ID',
`NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件名称',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_operation`.`wt_sp_warehouse_out` (
`ID` bigint(20) NOT NULL COMMENT '主键',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
`CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
`RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
`STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
`REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
`TYPE` bigint(20) NULL DEFAULT NULL COMMENT '出库类型',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS=1;

8
hzims-service/pom.xml

@ -55,6 +55,14 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-starter-datascope</artifactId> <artifactId>blade-starter-datascope</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

5
hzims-service/ticket/pom.xml

@ -280,6 +280,11 @@
<!-- <artifactId>swagger-bootstrap-ui</artifactId>--> <!-- <artifactId>swagger-bootstrap-ui</artifactId>-->
<!-- <version>${swagger-bootstrap-ui.version}</version>--> <!-- <version>${swagger-bootstrap-ui.version}</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java

@ -2,10 +2,10 @@ package com.hnac.hzims.ticket.redisConsume;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.common.config.RedisMessageListener; import com.hnac.hzims.common.config.RedisMessageListener;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java

@ -355,7 +355,7 @@ public class OperRepairServiceImpl extends BaseServiceImpl<OperRepairMapper, Rep
// 更新缺陷实际信息 // 更新缺陷实际信息
OperDefectEntity defect = new OperDefectEntity(); OperDefectEntity defect = new OperDefectEntity();
SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATETIME); SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATETIME);
defect.setActHours(String.valueOf(variables.get("implementHours"))); defect.setActHours((Integer) variables.get("implementHours"));
defect.setDisposeDesc(String.valueOf(variables.get("implementDesc"))); defect.setDisposeDesc(String.valueOf(variables.get("implementDesc")));
String actStartTime = String.valueOf(variables.get("implementStartTime")); String actStartTime = String.valueOf(variables.get("implementStartTime"));
String actEndTime = String.valueOf(variables.get("implementEndTime")); String actEndTime = String.valueOf(variables.get("implementEndTime"));

51
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java

@ -1,14 +1,18 @@
package com.hnac.hzims.ticket.standardTicket.controller; package com.hnac.hzims.ticket.standardTicket.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
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;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.system.feign.ISysClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -30,6 +34,9 @@ public class OperationTicketController {
private final OperationTicketService operationTicketService; private final OperationTicketService operationTicketService;
private final IMessageClient messageClient;
/** /**
* 启动流程 * 启动流程
* *
@ -54,6 +61,7 @@ public class OperationTicketController {
operationTicketService.findPending(response); operationTicketService.findPending(response);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new ServiceException("操作票待处理:" + e.getMessage()); throw new ServiceException("操作票待处理:" + e.getMessage());
} }
} }
@ -75,4 +83,45 @@ public class OperationTicketController {
} }
private final ISysClient sysClient;
@GetMapping("/test")
public void test(){
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
businessMessageDTO.setBusinessClassify("business");
businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
businessMessageDTO.setTaskId(1671058860039106562L);
businessMessageDTO.setTenantId("200000");
//您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent =
"您有一张工作票待审批,工作内容:".concat("11")
.concat(",审批环节:")
.concat("监护人确认");
businessMessageDTO.setContent(countent);
businessMessageDTO.setDeptId(2000000115L);
R<String> deptName = sysClient.getDeptName(2000000115L);
if (deptName.isSuccess()) {
businessMessageDTO.setDeptName(deptName.getData());
}
String userIds = "1522897714092781569";
businessMessageDTO.setUserIds(userIds);
businessMessageDTO.setCreateUser(1522897714092781569L);
System.out.println("businessMessageDTO = " + businessMessageDTO);
R<Boolean> booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败");
}else {
System.out.println("推送成功");
}
}
} }

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

@ -113,7 +113,6 @@ public class StandardTicketInfoController extends BladeController {
/** /**
* 根据月份区域 获取操作详情数据 * 根据月份区域 获取操作详情数据
*
* @return * @return
*/ */
@GetMapping("/areaMonthlyWithOperation/{page}/{size}") @GetMapping("/areaMonthlyWithOperation/{page}/{size}")

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java

@ -1,8 +1,8 @@
package com.hnac.hzims.ticket.standardTicket.service; package com.hnac.hzims.ticket.standardTicket.service;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;

130
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java

@ -5,12 +5,13 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.logs.fegin.ProcessDictFeignService;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
@ -42,6 +43,7 @@ import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -52,7 +54,7 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.OPERATION_TICKET_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
/** /**
@ -77,7 +79,6 @@ public class OperationTicketServiceImpl implements OperationTicketService {
private final ProcessDictFeignService processDictFeignService; private final ProcessDictFeignService processDictFeignService;
private final IFlowClient flowClient; private final IFlowClient flowClient;
@ -133,8 +134,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
//3. 保存操作对象 //3. 保存操作对象
this.saveStandardTicketInfo(standardTicketInfoVo); this.saveStandardTicketInfo(standardTicketInfoVo);
//5. 保存安全措施 //5. 保存安全措施
List<StandardTicketMeasureVo> standardTicketInfoVos = this.saveStandardTicketMeasure( List<StandardTicketMeasureVo> standardTicketInfoVos = this.saveStandardTicketMeasure(this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo));
this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo));
standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos); standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos);
//6. 查询第操作票值 //6. 查询第操作票值
String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY); String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY);
@ -152,6 +152,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
* @param response * @param response
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class)
public void findPending(ProcessWorkFlowResponse response) { public void findPending(ProcessWorkFlowResponse response) {
log.info("获取businessKey: {}", response.getBusinessKey()); log.info("获取businessKey: {}", response.getBusinessKey());
log.info("获取taskId: {} ", response.getTaskId()); log.info("获取taskId: {} ", response.getTaskId());
@ -168,9 +169,9 @@ public class OperationTicketServiceImpl implements OperationTicketService {
standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class); standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class);
} catch (Exception e) { } catch (Exception e) {
log.error("获取表单出现异常了~~~~"); log.error("获取表单出现异常了~~~~");
e.printStackTrace();
throw new IllegalArgumentException(e.getMessage()); throw new IllegalArgumentException(e.getMessage());
} }
//1.查询操作票信息 //1.查询操作票信息
Long id = NumberUtils.toLong(response.getBusinessKey()); Long id = NumberUtils.toLong(response.getBusinessKey());
StandardTicketInfoEntity standardTicketInfoEntity = standardTicketInfoService.getById(id); StandardTicketInfoEntity standardTicketInfoEntity = standardTicketInfoService.getById(id);
@ -178,15 +179,18 @@ public class OperationTicketServiceImpl implements OperationTicketService {
log.error("获取操作票不存在"); log.error("获取操作票不存在");
return; return;
} }
//设置id //设置id
StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity(); StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity();
BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity); BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity);
newStandardTicketInfoEntity.setId(id); newStandardTicketInfoEntity.setId(id);
newStandardTicketInfoEntity.setCreateUser(standardTicketInfoEntity.getCreateUser());
//填充操作票信息 //填充操作票信息
saveStandardTicketInfoEntity(newStandardTicketInfoEntity, response); saveStandardTicketInfoEntity(newStandardTicketInfoEntity, response);
newStandardTicketInfoEntity.setProcessInstanceId(response.getProcessInstanceId()); newStandardTicketInfoEntity.setProcessInstanceId(response.getProcessInstanceId());
standardTicketInfoService.updateById(newStandardTicketInfoEntity); standardTicketInfoService.updateById(newStandardTicketInfoEntity);
//更新安全措施 //更新安全措施
List<StandardTicketMeasureVo> standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos(); List<StandardTicketMeasureVo> standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos();
if (CollectionUtils.isNotEmpty(standardTicketMeasureVos)) { if (CollectionUtils.isNotEmpty(standardTicketMeasureVos)) {
@ -198,45 +202,70 @@ public class OperationTicketServiceImpl implements OperationTicketService {
standardTicketMeasureService.updateBatchById(standardTicketMeasureEntities); standardTicketMeasureService.updateBatchById(standardTicketMeasureEntities);
} }
//推送消息 //推送消息
if (response.getTaskId() != null) { if (response.getTaskId() != null) {
MessagePushRecordDto message = new MessagePushRecordDto(); // MessagePushRecordDto message = new MessagePushRecordDto();
message.setBusinessClassify("business"); // message.setBusinessClassify("business");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey()); // message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription()); // message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
message.setTaskId(standardTicketInfoEntity.getId()); // message.setTaskId(standardTicketInfoEntity.getId());
message.setTenantId("200000"); // message.setTenantId("200000");
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); // message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY); // message.setPushType(MessageConstants.IMMEDIATELY);
// //您有一张工作票待审批,工作内容:*****,审批环节:*****;
// String countent = "您有一张工作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle()).concat(",审批环节:").concat(response.getTaskName());
// message.setContent(countent);
// message.setDeptId(standardTicketInfoEntity.getCreateDept());
// R<String> deptName = sysClient.getDeptName(standardTicketInfoEntity.getCreateDept());
// if (deptName.isSuccess()) {
// message.setDeptName(deptName.getData());
// }
// String userIds = response.getUserId();
// if (StringUtils.isBlank(userIds)) {
// log.error("推送的消息不能为空哦,{}", userIds);
// return;
// }
// String[] split = userIds.split(",");
// for (String userId : split) {
// message.setPusher(userId);
// User user = UserCache.getUser(NumberUtils.toLong(userId));
// if (ObjectUtils.isNotEmpty(user)) {
// message.setPusherName(user.getName());
// }
// message.setAccount(userId);
//
// message.setCreateUser(NumberUtils.toLong(userId));
// messageClient.sendMessage(message);
// }
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
businessMessageDTO.setBusinessClassify("business");
businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
businessMessageDTO.setTaskId(standardTicketInfoEntity.getId());
businessMessageDTO.setTenantId("200000");
//您有一张工作票待审批,工作内容:*****,审批环节:*****; //您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent = String countent =
"您有一张工作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle()) "您有一张工作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle())
.concat(",审批环节:") .concat(",审批环节:")
.concat(response.getTaskName()); .concat(response.getTaskName());
message.setContent(countent); businessMessageDTO.setContent(countent);
message.setDeptId(standardTicketInfoEntity.getCreateDept()); businessMessageDTO.setDeptId(standardTicketInfoEntity.getCreateDept());
R<String> deptName = sysClient.getDeptName(standardTicketInfoEntity.getCreateDept()); R<String> deptName = sysClient.getDeptName(standardTicketInfoEntity.getCreateDept());
if (deptName.isSuccess()) { if (deptName.isSuccess()) {
message.setDeptName(deptName.getData()); businessMessageDTO.setDeptName(deptName.getData());
} }
String userIds = response.getUserId(); String userIds = response.getUserId();
if (StringUtils.isBlank(userIds)) { businessMessageDTO.setUserIds(userIds);
log.error("推送的消息不能为空哦,{}", userIds); businessMessageDTO.setCreateUser(newStandardTicketInfoEntity.getCreateUser());
return;
} System.out.println("================================================");
String[] split = userIds.split(","); System.out.println("businessMessageDTO = " + businessMessageDTO);
for (String userId : split) { System.out.println("================================================");
message.setPusher(userId); R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
User user = UserCache.getUser(NumberUtils.toLong(userId)); if (!booleanR.isSuccess()) {
if (ObjectUtils.isNotEmpty(user)) { throw new ServiceException("消息推送失败");
message.setPusherName(user.getName());
}
message.setAccount(userId);
message.setCreateUser(NumberUtils.toLong(userId));
messageClient.sendMessage(message);
} }
log.info("推送成功~");
} }
} }
@ -249,19 +278,23 @@ public class OperationTicketServiceImpl implements OperationTicketService {
*/ */
private void saveStandardTicketInfoEntity(StandardTicketInfoEntity newStandardTicketInfoEntity, ProcessWorkFlowResponse response) { private void saveStandardTicketInfoEntity(StandardTicketInfoEntity newStandardTicketInfoEntity, ProcessWorkFlowResponse response) {
String flowDescription = ""; String flowDescription = "";
//如果response.getHandleType() 是0使用户
newStandardTicketInfoEntity.setFlowUserId(response.getUserId()); if (response.getNextStepOperator() != null) {
newStandardTicketInfoEntity.setNextStepOperator(response.getNextStepOperator()); flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批");
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); }
//如果taskId为空 //如果taskId为空
String taskId = response.getTaskId(); String taskId = response.getTaskId();
if (StringUtils.isEmpty(taskId)) { log.info("StringUtils.isBlank(taskId) = " + StringUtils.isBlank(taskId));
if (StringUtils.isBlank(taskId)) {
newStandardTicketInfoEntity.setFlowDescription("结束"); newStandardTicketInfoEntity.setFlowDescription("结束");
newStandardTicketInfoEntity.setFlowTaskId(" "); newStandardTicketInfoEntity.setFlowTaskId(" ");
newStandardTicketInfoEntity.setFlowTaskName("结束"); newStandardTicketInfoEntity.setFlowTaskName("结束");
newStandardTicketInfoEntity.setNextStepOperator(" "); newStandardTicketInfoEntity.setNextStepOperator(" ");
newStandardTicketInfoEntity.setFlowStatus(999); newStandardTicketInfoEntity.setFlowStatus(999);
} else { } else {
//如果response.getHandleType() 是0使用户
newStandardTicketInfoEntity.setFlowUserId(response.getUserId());
newStandardTicketInfoEntity.setNextStepOperator(response.getNextStepOperator());
newStandardTicketInfoEntity.setFlowTaskId(taskId); newStandardTicketInfoEntity.setFlowTaskId(taskId);
newStandardTicketInfoEntity.setFlowTaskName(response.getTaskName()); newStandardTicketInfoEntity.setFlowTaskName(response.getTaskName());
newStandardTicketInfoEntity.setFlowDescription(flowDescription); newStandardTicketInfoEntity.setFlowDescription(flowDescription);
@ -281,8 +314,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
params.put("taskId", standardTicketInfoVo.getId()); params.put("taskId", standardTicketInfoVo.getId());
params.put("guardianUserIds", "taskUser_".concat(standardTicketInfoVo.getGuardian().toString())); params.put("guardianUserIds", "taskUser_".concat(standardTicketInfoVo.getGuardian().toString()));
//已开启流程 //已开启流程
R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params);
String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params);
if (!processInstanceContainNameByKey.isSuccess()) { if (!processInstanceContainNameByKey.isSuccess()) {
log.error("processInstanceContainNameByKey {}", processInstanceContainNameByKey.getMsg()); log.error("processInstanceContainNameByKey {}", processInstanceContainNameByKey.getMsg());
throw new ServiceException("不好意思,您暂无权限..."); throw new ServiceException("不好意思,您暂无权限...");
@ -304,8 +336,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
private List<StandardTicketMeasureEntity> saveStandardTicketMeasureWichTicket(StandardTicketInfoVo standardTicketInfoVo) { private List<StandardTicketMeasureEntity> saveStandardTicketMeasureWichTicket(StandardTicketInfoVo standardTicketInfoVo) {
List<StandardTicketMeasureVo> standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos(); List<StandardTicketMeasureVo> standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos();
if (CollectionUtils.isNotEmpty(standardTicketMeasureVos)) { if (CollectionUtils.isNotEmpty(standardTicketMeasureVos)) {
List<StandardTicketMeasureEntity> measureEntityList = BeanUtil.copyProperties(standardTicketMeasureVos, List<StandardTicketMeasureEntity> measureEntityList = BeanUtil.copyProperties(standardTicketMeasureVos, StandardTicketMeasureEntity.class);
StandardTicketMeasureEntity.class);
List<StandardTicketMeasureEntity> collect = measureEntityList.stream().map(item -> { List<StandardTicketMeasureEntity> collect = measureEntityList.stream().map(item -> {
item.setTicketId(standardTicketInfoVo.getId()); item.setTicketId(standardTicketInfoVo.getId());
return item; return item;
@ -379,8 +410,6 @@ public class OperationTicketServiceImpl implements OperationTicketService {
} }
/** /**
* 新预览 * 新预览
* *
@ -398,7 +427,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
StandardTicketInfoVo standardTicketInfoVo = standardTicketInfoService.selectDetailsById(ticketId); StandardTicketInfoVo standardTicketInfoVo = standardTicketInfoService.selectDetailsById(ticketId);
//将查询的数据转换为map //将查询的数据转换为map
Map<String, Object> workTicketInfoMap = this.convertMap(standardTicketInfoVo); Map<String, Object> workTicketInfoMap = this.convertMap(standardTicketInfoVo);
//导入下在word //导入下在word
Map<String, Object> resultMap = OperationWordHelper.resultMap(workTicketInfoMap); Map<String, Object> resultMap = OperationWordHelper.resultMap(workTicketInfoMap);
String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status); String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status);
String os = TicketConstant.OS_NAME; String os = TicketConstant.OS_NAME;
@ -421,6 +450,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
/** /**
* 将查询的数据转换为map * 将查询的数据转换为map
*
* @param standardTicketInfoVo * @param standardTicketInfoVo
* @return * @return
*/ */
@ -439,17 +469,17 @@ public class OperationTicketServiceImpl implements OperationTicketService {
map.put("index", index.get()); map.put("index", index.get());
map.put("status", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); map.put("status", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : "");
map.put("operationTime", measure.getOperationTime()); map.put("operationTime", measure.getOperationTime());
map.put("hello",""); map.put("hello", "");
map.put("hello1",""); map.put("hello1", "");
index.getAndIncrement(); index.getAndIncrement();
measureMapLists.add(map); measureMapLists.add(map);
} }
result.put("measureMapList", measureMapLists); result.put("measureMapList", measureMapLists);
}else { } else {
result.put("measureMapList", new ArrayList<>()); result.put("measureMapList", new ArrayList<>());
} }
WordMapUtils.newMapWithList("measureMapList",result,false,17,null); WordMapUtils.newMapWithList("measureMapList", result, false, 17, null);
return result; return result;
} }

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java

@ -1,9 +1,9 @@
package com.hnac.hzims.ticket.twoTicket.controller; package com.hnac.hzims.ticket.twoTicket.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -41,29 +41,29 @@ public class TicketProcessController {
@ApiOperation("启动流程") @ApiOperation("启动流程")
@PostMapping("/startUp") @PostMapping("/startUp")
public R start(@RequestBody WorkTicketVo workTicketVo) { public R start(@RequestBody WorkTicketVo workTicketVo) {
ticketProcessService.startUp(workTicketVo); Long ticketId = ticketProcessService.startUp(workTicketVo);
return R.success("申请开票成功"); return R.data(ticketId);
} }
/** /**
* 工作票待处理 * 工作票待处理
*
* @param response * @param response
*/ */
@PostMapping("/findPending") @PostMapping("/findPending")
@ApiOperation(value = "工作票待处理") @ApiOperation(value = "工作票待处理")
public Boolean findPending(@RequestBody ProcessWorkFlowResponse response){ public Boolean findPending(@RequestBody ProcessWorkFlowResponse response) {
try { try {
ticketProcessService.findPending(response); ticketProcessService.findPending(response);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new ServiceException("工作票待处理:" + e.getMessage()); throw new ServiceException("工作票待处理:" + e.getMessage());
} }
} }
/** /**
* 预览 * 预览
*/ */

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java

@ -1,7 +1,7 @@
package com.hnac.hzims.ticket.twoTicket.service; package com.hnac.hzims.ticket.twoTicket.service;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -17,7 +17,7 @@ public interface TicketProcessService {
/** /**
* 启动开票流程 * 启动开票流程
*/ */
void startUp(WorkTicketVo workTicketVo); Long startUp(WorkTicketVo workTicketVo);
/** /**

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

@ -7,11 +7,13 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.logs.fegin.ProcessDictFeignService;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient;
import com.hnac.hzims.operational.feign.IAccessTaskClient; import com.hnac.hzims.operational.feign.IAccessTaskClient;
@ -38,7 +40,6 @@ import com.hnac.hzims.ticket.workTicket.entity.*;
import com.hnac.hzims.ticket.workTicket.service.*; import com.hnac.hzims.ticket.workTicket.service.*;
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl;
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl;
import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -71,8 +72,8 @@ import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.FIRST_TICKET_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.FIRST_TICKET_KEY;
import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
/** /**
@ -159,7 +160,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
@SneakyThrows @SneakyThrows
@Override @Override
@Transactional @Transactional
public void startUp(WorkTicketVo workTicketVo) { public Long startUp(WorkTicketVo workTicketVo) {
log.info("执行 com.hnac.hzims.ticket.twoTicket.service.impl【startUp】 。。。方法"); log.info("执行 com.hnac.hzims.ticket.twoTicket.service.impl【startUp】 。。。方法");
if (workTicketVo.getWorkTicket().getSignage() == null) { if (workTicketVo.getWorkTicket().getSignage() == null) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置"); throw new ServiceException("票据抬头未配置,请您到站点管理配置");
@ -214,6 +215,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//8. 处理任务 //8. 处理任务
this.returnTicket(workTicketVo); this.returnTicket(workTicketVo);
return workTicketVo.getWorkTicket().getId();
} }
/** /**
@ -275,98 +277,79 @@ public class TicketProcessServiceImpl implements TicketProcessService {
log.error("获取工作票的数据为不存在"); log.error("获取工作票的数据为不存在");
return; return;
} }
try { //更新工作票
//更新工作票 workTicket.setId(workTicketInfo.getId());
workTicket.setId(workTicketInfo.getId()); //保存流程描述
//保存流程描述 workTicket.setCreateDept(workTicketInfo.getCreateDept());
workTicketInfo.setCreateDept(workTicketInfo.getCreateDept()); workTicket.setCreateUser(workTicketInfo.getCreateUser());
workTicket.setTenantId(workTicketInfo.getTenantId()); workTicket.setTenantId(workTicketInfo.getTenantId());
saveWorkTicket(workTicket, response); saveWorkTicket(workTicket, response);
//工作流ID //工作流ID
workTicket.setProcessInstanceId(response.getProcessInstanceId()); workTicket.setProcessInstanceId(response.getProcessInstanceId());
workTicketInfoService.updateById(workTicket); workTicketInfoService.updateById(workTicket);
} catch (Exception e) {
e.printStackTrace();
}
//更新安全措施 //更新安全措施
try { List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { log.info("获取安全措施的数据:{}", safetyMeasuresList);
log.info("获取安全措施的数据:{}", safetyMeasuresList); for (WorkTicketSafetyMeasureEntity item : safetyMeasuresList) {
for (WorkTicketSafetyMeasureEntity item : safetyMeasuresList) { if (ObjectUtils.isNotEmpty(item.getId())) {
if (ObjectUtils.isNotEmpty(item.getId())) { workTicketSafetyMeasureService.updateById(item);
workTicketSafetyMeasureService.updateById(item); } else {
} else { item.setTicketId(workTicketInfo.getId());
item.setTicketId(workTicketInfo.getId()); workTicketSafetyMeasureService.save(item);
workTicketSafetyMeasureService.save(item);
}
} }
} }
} catch (Exception e) {
e.printStackTrace();
} }
// 第二种 工作票工作任务组 // 第二种 工作票工作任务组
List<WorkTicketContentEntity> workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList(); List<WorkTicketContentEntity> workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList();
try { if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) {
if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) { log.info("获取工作票工作任务组:{}", workTicketContentDtoList);
log.info("获取工作票工作任务组:{}", workTicketContentDtoList); workTicketContentDtoList.forEach(item -> {
workTicketContentDtoList.forEach(item -> { if (ObjectUtils.isEmpty(item.getId())) {
if (ObjectUtils.isEmpty(item.getId())) { contentService.save(item);
contentService.save(item); } else {
} else { contentService.updateById(item);
contentService.updateById(item); }
} });
});
}
} catch (Exception e) {
e.printStackTrace();
} }
// 工作票延期 // 工作票延期
WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay(); WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay();
try { if (ObjectUtils.isNotEmpty(workTicketDelay) && "延期".equals(workTicket.getInput())) {
if (ObjectUtils.isNotEmpty(workTicketDelay) && "延期".equals(workTicket.getInput())) {
WorkTicketDelayEntity workTicketDelayEntity = workTicketDelayService.selectByTicketId(workTicketInfo.getId());
WorkTicketDelayEntity workTicketDelayEntity = workTicketDelayService.selectByTicketId(workTicketInfo.getId()); log.info("获取工作票延期:{}", workTicketDelay);
log.info("获取工作票延期:{}", workTicketDelay); workTicketDelay.setCreateDept(workTicketInfo.getCreateDept());
workTicketDelay.setCreateDept(workTicketInfo.getCreateDept()); workTicketDelay.setTicketId(workTicketInfo.getId());
workTicketDelay.setTicketId(workTicketInfo.getId()); workTicketDelay.setTenantId(workTicketInfo.getTenantId());
workTicketDelay.setTenantId(workTicketInfo.getTenantId()); if (ObjectUtils.isEmpty(workTicketDelayEntity)) {
if (ObjectUtils.isEmpty(workTicketDelayEntity)) { log.info("正在保存工作票延期");
log.info("正在保存工作票延期"); workTicketDelayService.save(workTicketDelay);
workTicketDelayService.save(workTicketDelay); } else {
} else { log.info("正在更新工作票延期");
log.info("正在更新工作票延期"); workTicketDelayService.updateByTicketId(workTicketDelay);
workTicketDelayService.updateByTicketId(workTicketDelay);
}
} }
} catch (Exception e) {
e.printStackTrace();
} }
//工作结束 //工作结束
WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish();
try { log.info("工作结束==============>" + (workTicket.getFlowStatus().intValue()));
log.info("工作结束==============>" + (workTicket.getFlowStatus().intValue())); if (ObjectUtils.isNotEmpty(workTicketFinish)) {
if (ObjectUtils.isNotEmpty(workTicketFinish)) { WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId());
WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId()); log.info("获取工作结束:{}", workTicketFinish);
log.info("获取工作结束:{}", workTicketFinish); if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) {
if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) { log.info("获取工作结束保存成功");
log.info("获取工作结束保存成功"); workTicketFinish.setTicketId(workTicketInfo.getId());
workTicketFinish.setTicketId(workTicketInfo.getId()); workTicketFinishService.save(workTicketFinish);
workTicketFinishService.save(workTicketFinish); } else {
} else { log.info("获取工作结束更新成功");
log.info("获取工作结束更新成功"); workTicketDelay.setInitialTime(LocalDateTime.now());
workTicketDelay.setInitialTime(LocalDateTime.now()); workTicketFinishService.updateByTicketId(workTicketFinish);
workTicketFinishService.updateByTicketId(workTicketFinish);
}
} }
} catch (Exception e) {
e.printStackTrace();
} }
// 工作开始时间和结束时间 // 工作开始时间和结束时间
// List<WorkTicketOperateTimeEntity> workTicketOperateTimeEntities = workTicketVo.getWorkTicketOperateTimeEntities(); // List<WorkTicketOperateTimeEntity> workTicketOperateTimeEntities = workTicketVo.getWorkTicketOperateTimeEntities();
// if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) { // if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) {
@ -375,104 +358,126 @@ public class TicketProcessServiceImpl implements TicketProcessService {
// } // }
//工作票负责人变更 //工作票负责人变更
WorkTicketPrincipalChangeEntity workTicketPrincipalChange = workTicketVo.getWorkTicketPrincipalChange(); WorkTicketPrincipalChangeEntity workTicketPrincipalChange = workTicketVo.getWorkTicketPrincipalChange();
try { if (ObjectUtils.isNotEmpty(workTicketPrincipalChange) && "转移".equals(workTicket.getInput())) {
if (ObjectUtils.isNotEmpty(workTicketPrincipalChange) && "转移".equals(workTicket.getInput())) { log.info("工作票负责人变更: {}", workTicketPrincipalChange);
log.info("工作票负责人变更: {}", workTicketPrincipalChange); //原来的负责人
//原来的负责人 User user = UserCache.getUser(workTicketPrincipalChange.getInitialPrincipal());
User user = UserCache.getUser(workTicketPrincipalChange.getInitialPrincipal()); //新的负责人
//新的负责人 User newUser = UserCache.getUser(workTicketPrincipalChange.getChangePrincipal());
User newUser = UserCache.getUser(workTicketPrincipalChange.getChangePrincipal()); workTicketPrincipalChange.setCreateDept(workTicketInfo.getCreateDept());
workTicketPrincipalChange.setCreateDept(workTicketInfo.getCreateDept()); workTicketPrincipalChange.setTicketId(workTicketInfo.getId());
workTicketPrincipalChange.setTicketId(workTicketInfo.getId()); workTicketPrincipalChange.setTenantId(workTicketInfo.getTenantId());
workTicketPrincipalChange.setTenantId(workTicketInfo.getTenantId()); if (workTicketPrincipalChange.getFlowCode() == null) {
if (workTicketPrincipalChange.getFlowCode() == null) { workTicketPrincipalChange.setFlowCode(IdWorker.getIdStr());
workTicketPrincipalChange.setFlowCode(IdWorker.getIdStr()); }
}
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId()); WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId());
if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) { if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) {
log.info("工作票负责人保存变更"); log.info("工作票负责人保存变更");
workTicketPrincipalChangeService.save(workTicketPrincipalChange); workTicketPrincipalChangeService.save(workTicketPrincipalChange);
} else { } else {
log.info("工作票负责人更新变更"); log.info("工作票负责人更新变更");
workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange); workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange);
}
log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName());
workTicket.setPrincipal(workTicketPrincipalChange.getChangePrincipal());
workTicket.setPrincipalName(newUser.getName());
//更新工作票
workTicketInfoService.updateById(workTicket);
} }
} catch (Exception e) { log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName());
e.printStackTrace(); workTicket.setPrincipal(workTicketPrincipalChange.getChangePrincipal());
workTicket.setPrincipalName(newUser.getName());
//更新工作票
workTicketInfoService.updateById(workTicket);
} }
//工作票危险点分析及控制措施票 //工作票危险点分析及控制措施票
try { if (workTicket.getIsHazard()) {
if (workTicket.getIsHazard()) { List<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers();
List<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers(); if (CollectionUtils.isNotEmpty(ticketInfoDangers)) {
if (CollectionUtils.isNotEmpty(ticketInfoDangers)) { List<TicketInfoDanger> collect = ticketInfoDangers.stream().map(item -> {
List<TicketInfoDanger> collect = ticketInfoDangers.stream().map(item -> { item.setTicketId(workTicketInfo.getId());
item.setTicketId(workTicketInfo.getId()); return item;
return item; }).collect(Collectors.toList());
}).collect(Collectors.toList());
System.out.println("工作票危险点分析及控制措施票 : " + collect); System.out.println("工作票危险点分析及控制措施票 : " + collect);
ticketInfoDangerService.saveBatch(collect); ticketInfoDangerService.saveBatch(collect);
}
} }
} catch (Exception e) {
e.printStackTrace();
} }
if (response.getTaskId() != null || response.getUserId() != null) { if (response.getTaskId() != null || response.getUserId() != null) {
//推送消息 //推送消息
try { // try {
MessagePushRecordDto message = new MessagePushRecordDto(); // MessagePushRecordDto message = new MessagePushRecordDto();
message.setBusinessClassify("business"); // message.setBusinessClassify("business");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey()); // message.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription()); // message.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription());
message.setTaskId(workTicketInfo.getId()); // message.setTaskId(workTicketInfo.getId());
message.setTenantId("200000"); // message.setTenantId("200000");
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); // message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY); // message.setPushType(MessageConstants.IMMEDIATELY);
//您有一张工作票待审批,工作内容:*****,审批环节:*****; // //您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent = // String countent =
"您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent()) // "您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent())
.concat(",审批环节: ") // .concat(",审批环节: ")
.concat(response.getTaskName()); // .concat(response.getTaskName());
message.setContent(countent); // message.setContent(countent);
message.setDeptId(workTicketInfo.getCreateDept()); // message.setDeptId(workTicketInfo.getCreateDept());
message.setCreateDept(workTicketInfo.getCreateDept()); // message.setCreateDept(workTicketInfo.getCreateDept());
R<String> deptName = sysClient.getDeptName(workTicketInfo.getCreateDept()); // R<String> deptName = sysClient.getDeptName(workTicketInfo.getCreateDept());
if (deptName.isSuccess()) { // if (deptName.isSuccess()) {
message.setDeptName(deptName.getData()); // message.setDeptName(deptName.getData());
} // }
String userIds = response.getUserId(); // String userIds = response.getUserId();
if (StringUtils.isBlank(userIds)) { // if (StringUtils.isBlank(userIds)) {
log.error("推送的消息不能为空哦,{}", userIds); // log.error("推送的消息不能为空哦,{}", userIds);
return; // return;
} // }
String[] split = userIds.split(","); // String[] split = userIds.split(",");
for (String userId : split) { // for (String userId : split) {
message.setPusher(userId); // message.setPusher(userId);
User user = UserCache.getUser(NumberUtils.toLong(userId)); // User user = UserCache.getUser(NumberUtils.toLong(userId));
if (ObjectUtils.isNotEmpty(user)) { // if (ObjectUtils.isNotEmpty(user)) {
message.setPusherName(user.getName()); // message.setPusherName(user.getName());
} // }
message.setAccount(userId); // message.setAccount(userId);
message.setCreateUser(NumberUtils.toLong(userId)); // message.setCreateUser(NumberUtils.toLong(userId));
messageClient.sendMessage(message); // messageClient.sendMessage(message);
log.info("推送消息成功,用户名称{},消息{}", user.getName(), message); // log.info("推送消息成功,用户名称{},消息{}", user.getName(), message);
} // }
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
// }
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
businessMessageDTO.setBusinessClassify("business");
businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey());
businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription());
businessMessageDTO.setTaskId(workTicketInfo.getId());
businessMessageDTO.setTenantId("200000");
//您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent =
"您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent())
.concat(",审批环节: ")
.concat(response.getTaskName());
businessMessageDTO.setContent(countent);
businessMessageDTO.setDeptId(workTicketInfo.getCreateDept());
R<String> deptName = sysClient.getDeptName(workTicketInfo.getCreateDept());
if (deptName.isSuccess()) {
businessMessageDTO.setDeptName(deptName.getData());
}
String userIds = response.getUserId();
businessMessageDTO.setUserIds(userIds);
businessMessageDTO.setCreateUser(workTicketInfo.getCreateUser());
System.out.println("======================================================");
System.out.println("businessMessageDTO = " + businessMessageDTO);
System.out.println("======================================================");
R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败");
} }
log.info("推送成功~");
} }
} }

180
hzims-service/ticket/src/main/resources/db/newsql.sql

@ -0,0 +1,180 @@
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点标识-两票编码' AFTER `ticket_type`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号(原站点ID)' AFTER `signage`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_user_id` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `signage_code`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务Id' AFTER `flow_user_id`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称' AFTER `flow_task_id`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `flow_task_name`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_status` int(11) NULL DEFAULT NULL COMMENT '流程状态' AFTER `next_step_operator`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_description`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `class_group_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组' AFTER `project_name`;
ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_measure` ADD COLUMN `operation_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间' AFTER `matter_group`;
CREATE TABLE `hzims-ticket`.`hzims_ticket_info_danger` (
`id` bigint(20) NULL DEFAULT NULL COMMENT '编号',
`ticket_id` bigint(20) NULL DEFAULT NULL,
`dangerous_point` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '危险点',
`maintenance` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '安全措施',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims-ticket`.`hzims_work_ticket_finish` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
`ticket_id` bigint(20) NULL DEFAULT NULL COMMENT '工作票编号',
`temp_ground_num` int(11) NULL DEFAULT NULL COMMENT '临时接地线',
`temp_dismantle_num` int(11) NULL DEFAULT NULL COMMENT '临时拆除几组',
`ground_num` int(11) NULL DEFAULT NULL COMMENT '接地线几组',
`dismantle_num` int(11) NULL DEFAULT NULL COMMENT '拆除几组',
`retain_num` int(11) NULL DEFAULT NULL COMMENT '保留几组',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人名称',
`licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人',
`licensor_end_time` datetime(0) NULL DEFAULT NULL COMMENT '工作票终结时间',
`principal_end_time` datetime(0) NULL DEFAULT NULL COMMENT '负责人工作结束时间',
`content` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`tell_content` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交底内容',
`work_end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
`brake_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '刀闸编号',
`guardian` bigint(20) NULL DEFAULT NULL COMMENT '监护人',
`guardian_place` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '监护人地址',
`other_items` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他事项',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作结束' ROW_FORMAT = Dynamic;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `power` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 工作条件( 停电或不停电)' AFTER `watch_principal_end_time`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `flow_user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `step_operator`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_task_name`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作接收人' AFTER `project_name`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver_time` datetime(0) NULL DEFAULT NULL COMMENT '工作接收人时间' AFTER `job_receiver`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_safety` tinyint(1) NULL DEFAULT 0 COMMENT '安全隔离措施附页 (true,展示附件,false,不展示附件)' AFTER `job_receiver_time`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_hazard` tinyint(1) NULL DEFAULT 0 COMMENT '危险点分析与预控措施票 (true,展示附件,false,不展示附件)' AFTER `is_safety`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_railway` tinyint(1) NULL DEFAULT 0 COMMENT '动火工作票 (true,展示附件,false,不展示附件)' AFTER `is_hazard`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_limited` tinyint(1) NULL DEFAULT 0 COMMENT ' 有限空间监测记录单(true,展示附件,false,不展示附件)' AFTER `is_railway`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_start` tinyint(1) NULL DEFAULT 0 COMMENT '每日开工和收工时间附页' AFTER `is_limited`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `follower_num` int(11) NULL DEFAULT 1 COMMENT '附页第几张' AFTER `flow_description`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `input`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `step_operator` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前审批人' AFTER `next_step_operator`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `is_power`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `start_date_time`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `end_date_time`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `content`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `work_ticket_end_time`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `tell_content`;
CREATE TABLE `hzims-ticket`.`hzims_work_ticket_info_copy1` (
`id` bigint(20) NOT NULL COMMENT '主键',
`em_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称',
`em_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称',
`process_instance_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流ID',
`type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工作票类型',
`company` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '单位',
`code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号',
`task_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联业务类型',
`task_id` bigint(20) NULL DEFAULT NULL COMMENT '关联业务ID',
`task_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联业务名称',
`class_group` bigint(20) NULL DEFAULT NULL COMMENT '班组',
`class_group_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组名称',
`class_group_members` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组成员',
`class_group_members_manual` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组成员手填',
`address_equ_name` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作地点及设备名称',
`work_content` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作任务及内容',
`plan_start_time` datetime(0) NULL DEFAULT NULL COMMENT '计划开始时间',
`plan_end_time` datetime(0) NULL DEFAULT NULL COMMENT '计划结束时间',
`signer` bigint(20) NULL DEFAULT NULL COMMENT '签发人',
`principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人',
`principal_manual` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人手填',
`licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人',
`license_time` datetime(0) NULL DEFAULT NULL COMMENT '许可时间',
`flow_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程进行code',
`license_end_time` datetime(0) NULL DEFAULT NULL COMMENT '许可人确认工作结束时间',
`is_evaluate` tinyint(4) NULL DEFAULT 0 COMMENT '是否评价',
`status` tinyint(4) NULL DEFAULT NULL COMMENT '1:未完成 2:执行中 3:已完成',
`tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
`create_user` bigint(20) NOT NULL COMMENT '创建人',
`create_time` datetime(0) NOT NULL COMMENT '创建时间',
`update_user` bigint(20) NULL DEFAULT NULL,
`update_time` datetime(0) NULL DEFAULT NULL,
`is_deleted` tinyint(4) NULL DEFAULT NULL,
`create_dept` bigint(20) NOT NULL COMMENT '创建部门',
`confirm_img_urls` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作负责人确认工作完成上传图片地址',
`confirm_img_filenames` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作负责人确认工作完成上传图片名称',
`sort` tinyint(4) NULL DEFAULT NULL COMMENT '排序',
`confirm_work_time` datetime(0) NULL DEFAULT NULL COMMENT '工作负责人确认工作完成时间',
`pattern` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型(1:值班人员添加2:许可人添加)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作票' ROW_FORMAT = Dynamic;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型(1:值班人员添加2:签发人添加3:许可人添加)' AFTER `measure`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `execute_img_url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拍照上传图片url' AFTER `execute_remark`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `completer` bigint(20) NULL DEFAULT NULL COMMENT '内容执行人' AFTER `status`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `complete_img_url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '完成内容上传图片地址' AFTER `complete_time`;
ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `pattern` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '类型(1:值班人员添加2:许可人添加)' AFTER `sort`;
CREATE TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure_copy1` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`ticket_id` bigint(20) NOT NULL COMMENT '工作票ID',
`measure_id` bigint(20) NULL DEFAULT NULL COMMENT '安全措施ID',
`matter_group` bigint(20) NULL DEFAULT NULL COMMENT '分组',
`measure` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '安全措施',
`type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型(1:值班人员添加2:签发人添加3:许可人添加)',
`executor` bigint(20) NULL DEFAULT NULL COMMENT '执行人',
`execute_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间',
`execute_remark` tinytext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行情况',
`execute_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拍照上传图片url',
`status` tinyint(20) NULL DEFAULT NULL,
`completer` bigint(20) NULL DEFAULT NULL COMMENT '内容执行人',
`complete_time` datetime(0) NULL DEFAULT NULL COMMENT '内容完成时间',
`complete_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '完成内容上传图片地址',
`create_user` bigint(20) NOT NULL COMMENT '创建人',
`create_time` datetime(0) NOT NULL COMMENT '创建时间',
`update_user` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`is_deleted` tinyint(4) NULL DEFAULT NULL,
`create_dept` bigint(20) NOT NULL COMMENT '创建机构',
`tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户id',
`sort` tinyint(4) NULL DEFAULT NULL COMMENT '排序',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作票安全措施列表' ROW_FORMAT = Dynamic;
DROP TABLE `hzims-ticket`.`hzims_workflow_operation_log`;
SET FOREIGN_KEY_CHECKS=1;

BIN
hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx

Binary file not shown.

BIN
hzims-service/ticket/src/main/resources/template/电气操作票.docx

Binary file not shown.
Loading…
Cancel
Save