diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java
index 928605a..de3b0bd 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java
@@ -102,6 +102,7 @@ public interface TicketConstants {
MECHANICAL_WORK("8","大隆水电站水力机械工作票模板"),
EMERGENCY_REPAIR("9","大隆水电站事故应急抢修单模板"),
NEW_FIRST_WORK("10","新电气第一种工作票模板"),
+ NEW_FIRST_WORK1("11","第一种工作票"),
;
@Getter
private String type;
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
index 82f0992..b0f4153 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
@@ -403,14 +403,14 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
* 下一个审批人
*/
@ApiModelProperty("下一个审批人")
- private Long nextStepOperator;
+ private String nextStepOperator;
/**
* 当前审批人
*/
@ApiModelProperty("当前审批人")
- private Long stepOperator;
+ private String stepOperator;
/**
@@ -427,4 +427,50 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
private String flowTaskId;
+ /**
+ * 项目名称
+ */
+ @ApiModelProperty("项目名称")
+ private String projectName;
+
+
+ /**
+ * 工作接收人
+ */
+ @ApiModelProperty("工作接收人")
+ private String jobReceiver;
+
+
+
+ /**
+ * 工作接收人时间
+ */
+ @ApiModelProperty("工作接收人时间")
+ private String jobReceiverDateTime;
+
+
+ /**
+ * 安全隔离措施附页 (true,展示附件,false,不展示附件)
+ */
+ @ApiModelProperty("安全隔离措施附页 (true,展示附件,false,不展示附件)")
+ private Boolean isSafety;
+
+ /**
+ * 危险点分析与预控措施票 (true,展示附件,false,不展示附件)
+ */
+ @ApiModelProperty("危险点分析与预控措施票 (true,展示附件,false,不展示附件)")
+ private Boolean isHazard;
+
+ /**
+ * 动火工作票 (true,展示附件,false,不展示附件)
+ */
+ @ApiModelProperty("动火工作票 (true,展示附件,false,不展示附件)")
+ private Boolean isRailway;
+ /**
+ *有限空间监测记录单(true,展示附件,false,不展示附件)
+ */
+ @ApiModelProperty("有限空间监测记录单 (true,展示附件,false,不展示附件)")
+ private Boolean isLimited;
+
+
}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java
index d2772ca..63fb110 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java
@@ -18,7 +18,7 @@ import javax.annotation.Resource;
@EnableBladeFeign
@SpringCloudApplication
@MapperScan("com.hnac.hzims.scheduled.**.mapper.**")
-@ComponentScan(basePackages = {"com.hnac.*","org.springblade.core.*"})
+@ComponentScan(basePackages = {"com.hnac.*","org.springblade.core"})
@Resource
public class ScheduledApplication {
public static void main(String[] args) {
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
index b587329..6b473a9 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
@@ -1,59 +1,59 @@
-package com.hnac.hzims.scheduled.config;
-
-import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @Author WL
- * @Version v1.0
- * @Serial 1.0
- * @Date 2022/1/8 10:23
- */
-@Slf4j
-@Configuration
-//指定任务Handler所在包路径
-public class XxlJobConfig {
-
-
- @Value("${xxl.job.admin.addresses}")
- private String adminAddresses;
-
- @Value("${xxl.job.executor.appname}")
- private String appName;
-
- @Value("${xxl.job.executor.ip}")
- private String ip;
-
- @Value("${xxl.job.executor.port}")
- private int port;
-
- @Value("${xxl.job.accessToken}")
- private String accessToken;
-
- @Value("${xxl.job.executor.logpath}")
- private String logPath;
-
- @Value("${xxl.job.executor.logretentiondays}")
- private int logRetentionDays;
-
-
- @Bean(initMethod = "start", destroyMethod = "destroy")
- public XxlJobSpringExecutor xxlJobExecutor() {
- log.info("====xxl-job config init====");
- XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
- xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
- xxlJobSpringExecutor.setAppName(appName);
- xxlJobSpringExecutor.setIp(ip);
- xxlJobSpringExecutor.setPort(port);
- xxlJobSpringExecutor.setAccessToken(accessToken);
- xxlJobSpringExecutor.setLogPath(logPath);
- xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
- return xxlJobSpringExecutor;
- }
-
-}
-
+// package com.hnac.hzims.scheduled.config;
+//
+// import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
+// import lombok.extern.slf4j.Slf4j;
+// import org.springframework.beans.factory.annotation.Value;
+// import org.springframework.context.annotation.Bean;
+// import org.springframework.context.annotation.ComponentScan;
+// import org.springframework.context.annotation.Configuration;
+//
+// /**
+// * @Author WL
+// * @Version v1.0
+// * @Serial 1.0
+// * @Date 2022/1/8 10:23
+// */
+// @Slf4j
+// @Configuration
+// //指定任务Handler所在包路径
+// public class XxlJobConfig {
+//
+//
+// @Value("${xxl.job.admin.addresses}")
+// private String adminAddresses;
+//
+// @Value("${xxl.job.executor.appname}")
+// private String appName;
+//
+// @Value("${xxl.job.executor.ip}")
+// private String ip;
+//
+// @Value("${xxl.job.executor.port}")
+// private int port;
+//
+// @Value("${xxl.job.accessToken}")
+// private String accessToken;
+//
+// @Value("${xxl.job.executor.logpath}")
+// private String logPath;
+//
+// @Value("${xxl.job.executor.logretentiondays}")
+// private int logRetentionDays;
+//
+//
+// @Bean(initMethod = "start", destroyMethod = "destroy")
+// public XxlJobSpringExecutor xxlJobExecutor() {
+// log.info("====xxl-job config init====");
+// XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+// xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
+// xxlJobSpringExecutor.setAppName(appName);
+// xxlJobSpringExecutor.setIp(ip);
+// xxlJobSpringExecutor.setPort(port);
+// xxlJobSpringExecutor.setAccessToken(accessToken);
+// xxlJobSpringExecutor.setLogPath(logPath);
+// xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
+// return xxlJobSpringExecutor;
+// }
+//
+// }
+//
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml
deleted file mode 100644
index fdbd02b..0000000
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml
deleted file mode 100644
index e5e9daf..0000000
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
index 280ab7e..81cb979 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
@@ -31,7 +31,6 @@ public class ScheduledCreateTask {
* @return ReturnT
*/
@XxlJob(LOAD_WATER_LEVEL)
- //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT loadWaterLevel(String param) throws Exception {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
@@ -42,5 +41,14 @@ public class ScheduledCreateTask {
+ /**
+ * 水利-站点水位数据
+ * @return ReturnT
+ */
+ @XxlJob("cheshi")
+ public ReturnT cheshi(String param) throws Exception {
+ System.out.println("执行呢方法");
+ return new ReturnT<>("SUCCESS");
+ }
}
diff --git a/hzims-service/hzims-scheduled/src/main/resources/application.yml b/hzims-service/hzims-scheduled/src/main/resources/application.yml
index 2f8c38f..e738d56 100644
--- a/hzims-service/hzims-scheduled/src/main/resources/application.yml
+++ b/hzims-service/hzims-scheduled/src/main/resources/application.yml
@@ -36,23 +36,38 @@ spring:
# redis访问密码(默认为空)
password: 1qaz2WSX@redis
+#xxl:
+# job:
+# accessToken: ''
+# admin:
+# addresses: http://192.168.1.3:7009/xxl-job-admin
+# executor:
+# appname: hzims-operational
+# ip: 192.168.1.3
+# logpath: /data/applogs/xxl-job/jobhandler
+# logretentiondays: -1
+# port: 28501
+
xxl:
job:
accessToken: ''
admin:
- addresses: http://192.168.1.3:7009/xxl-job-admin
+ addresses: http://192.168.5.128:9080/xxl-job-admin
executor:
appname: hzims-operational
- ip: 192.168.1.3
+ ip: 192.168.18.232
logpath: /data/applogs/xxl-job/jobhandler
logretentiondays: -1
port: 28501
+
#mybatis-plus配置
mybatis-plus:
- mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml
+ mapper-locations: classpath*:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
- typeAliasesPackage: com.hnac.hzims.**.entity
+# typeAliasesPackage: com.hnac.hzims.**.entity
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#swagger扫描路径配置
swagger:
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/AbnormalAlarmMapper.xml
similarity index 100%
rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml
rename to hzims-service/hzims-scheduled/src/main/resources/mapper/operation/AbnormalAlarmMapper.xml
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/StAlarmRecordMapper.xml
similarity index 100%
rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml
rename to hzims-service/hzims-scheduled/src/main/resources/mapper/operation/StAlarmRecordMapper.xml
diff --git a/hzims-service/ticket/pom.xml b/hzims-service/ticket/pom.xml
index 53a5ec8..cf9ac58 100644
--- a/hzims-service/ticket/pom.xml
+++ b/hzims-service/ticket/pom.xml
@@ -275,11 +275,11 @@
-
- com.github.xiaoymin
- swagger-bootstrap-ui
- ${swagger-bootstrap-ui.version}
-
+
+
+
+
+
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java
index be96d3c..2071db4 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java
@@ -50,4 +50,9 @@ public class ProcessWorkFlowResponse implements Serializable {
/**票据表单**/
private Object variables;
+ /**
+ * 根据handleType区分是用户还是候选组角色 标识 0是用户 1是角色
+ */
+ private String handleType;
+
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
index b84c076..719404b 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
@@ -16,12 +16,15 @@ import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 工作票
+ *
* @Author WL
* @Version v1.0
* @Serial 1.0
@@ -35,11 +38,12 @@ import java.util.Map;
public class TicketProcessController {
- private final TicketProcessService ticketProcessService;
+ private final TicketProcessService ticketProcessService;
/**
* 启动流程
+ *
* @return
*/
@ApiOperation("启动流程")
@@ -52,6 +56,7 @@ public class TicketProcessController {
/**
* 预览
+ *
* @param ticketType
* @param ticketId
*/
@@ -64,4 +69,15 @@ public class TicketProcessController {
}
+ /**
+ * 预览
+ */
+ @GetMapping("/newPreview")
+ @ApiOperation(value = "新预览")
+ @ApiOperationSupport(order = 11)
+ public void preview(@RequestParam(value = "ticketId", required = true) Long ticketId,
+ HttpServletResponse response) {
+ ticketProcessService.newPreview(ticketId, response);
+ }
+
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
index 46c86ed..145b692 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
@@ -26,7 +26,7 @@ import java.time.LocalDateTime;
@TableName("hzims_work_ticket_finish")
public class WorkTicketFinish implements Serializable {
- private static final long serialVersionUID=1L;
+ private static final long serialVersionUID = 1L;
/**
* 编号
@@ -99,7 +99,6 @@ public class WorkTicketFinish implements Serializable {
private Long principal;
-
/**
* 许可人
*/
@@ -108,7 +107,6 @@ public class WorkTicketFinish implements Serializable {
private Long licensor;
-
/**
* 负责人工作结束时间
*/
@@ -126,8 +124,7 @@ public class WorkTicketFinish implements Serializable {
/**
* 结束时间
*/
- private LocalDateTime workEndTime;
-
+ private LocalDateTime workEndTime;
/**
@@ -140,7 +137,30 @@ public class WorkTicketFinish implements Serializable {
* 交底内容
*/
@ApiModelProperty("交底内容")
- private String tellContent;
+ private String tellContent;
+
+
+ /**
+ * 刀闸编号
+ */
+ private String brakeNumber;
+
+
+ /**
+ * 监护人
+ */
+ private Long guardian;
+
+ /**
+ * 监护人地点
+ */
+ private String guardianPlace;
+
+
+ /**
+ * 其他事项
+ */
+ private String otherItems;
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java
index 23920a2..6429eda 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java
@@ -3,6 +3,8 @@ package com.hnac.hzims.ticket.twoTicket.service;
import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
+import javax.servlet.http.HttpServletResponse;
+
/**
* 开票处理流程接口
* @Author dfy
@@ -31,4 +33,12 @@ public interface TicketProcessService {
* @param ticketId
*/
String preview(String ticketType, Long ticketId);
+
+
+ /**
+ * 新预览
+ * @param response
+ * @return
+ */
+ void newPreview(Long ticketId, HttpServletResponse response);
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
index af14806..f34a2f0 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient;
@@ -26,16 +28,20 @@ import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService;
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import com.hnac.hzims.ticket.twoTicket.vo.process.FristWorkTicketVo;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
+import com.hnac.hzims.ticket.utils.MergeDocUtils;
import com.hnac.hzims.ticket.utils.PdfUtils;
import com.hnac.hzims.ticket.workTicket.entity.*;
import com.hnac.hzims.ticket.workTicket.service.*;
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl;
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl;
+import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@@ -51,6 +57,10 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.time.LocalDateTime;
import java.util.*;
@@ -100,7 +110,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final IAccessTaskClient accessTaskClient;
- private String newFirstWorkTicketFlowKey = "workTicket";
+ private String newFirstWorkTicketFlowKey = "workTicketFlow";
private final IStationClient stationClient;
@@ -193,6 +203,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
log.info("获取taskId: {}", response.getTaskId());
log.info("获取下一个审批人是: {}", response.getNextStepOperator());
log.info("获取当前任务名称是: {}", response.getTaskName());
+ log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType());
//json转换表单
String formData = JSON.toJSONString(response.getVariables());
log.info("获取表单的数据:{}", formData);
@@ -342,16 +353,20 @@ public class TicketProcessServiceImpl implements TicketProcessService {
String description = getWorkTicketDescription(flowStatus);
String flowDescription = "";
//当前审批人
- User user = UserCache.getUser(workTicket.getStepOperator());
+ String stepOperator = workTicket.getStepOperator();
- if (StringUtils.isNotEmpty(nextStepOperator)) {
+ if ("0".equals(response.getHandleType())) {
Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null);
//下一个审批人
User stepUser = UserCache.getUser(taskUser);
- flowDescription = "审批中,当前环节是".concat(description).concat(",当前审批人是").concat(user.getName()).concat(",下一个审批人是").concat(stepUser.getName()).concat("待审批");
- workTicket.setNextStepOperator(taskUser);
- } else {
- flowDescription = "审批中,当前环节是".concat(description).concat(",审批人是").concat(user.getName());
+ flowDescription =
+ "审批中,当前环节是".concat(description).concat(",待").concat(stepUser.getName()).concat("审批");
+ workTicket.setNextStepOperator(stepUser.getName());
+ }
+
+ if ("1".equals(response.getHandleType())) {
+ System.out.println("获取角色信息" + response.getNextStepOperator());
+ flowDescription = "审批中,当前环节是".concat(description).concat(",当前操作人是").concat(stepOperator);
}
//如果taskId为空 或 flowStatus = 99
if (StringUtils.isEmpty(taskId) || 99 == flowStatus) {
@@ -359,8 +374,8 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicket.setFlowDescription(flowDescription);
workTicket.setFlowTaskId("");
workTicket.setFlowTaskName("结束");
- workTicket.setNextStepOperator(-1L);
- workTicket.setStepOperator(-1L);
+ workTicket.setNextStepOperator(null);
+ workTicket.setStepOperator(null);
} else {
workTicket.setFlowDescription(flowDescription);
workTicket.setFlowTaskId(taskId);
@@ -368,7 +383,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
}
//如果下一个审批人【nextStepOperator】是null设为-1
if (StringUtils.isEmpty(nextStepOperator)) {
- workTicket.setNextStepOperator(-1L);
+ workTicket.setNextStepOperator(null);
}
}
@@ -424,7 +439,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
*
* @param workTicketVo
*/
- private void returnTicket(WorkTicketVo workTicketVo) {
+ public void returnTicket(WorkTicketVo workTicketVo) {
WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
if (TicketConstants.TaskTypeEnum.JXRW.getType().equals(workTicket.getTaskType())) {
OperAccessTaskEntity taskEntity = new OperAccessTaskEntity();
@@ -451,7 +466,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
* @param newFirstWorkTicketFlowKey
* @param workTicketVo
*/
- private void dealProcess(String newFirstWorkTicketFlowKey, WorkTicketVo workTicketVo) {
+ public void dealProcess(String newFirstWorkTicketFlowKey, WorkTicketVo workTicketVo) {
//若为线下工作票 则无需开启工作流
Integer status = WorkTicketConstants.FirstWorkTicketStatusEnum.SIGN.getStatus();
if (status.intValue() != workTicketVo.getWorkTicket().getFlowStatus().intValue()) {
@@ -465,7 +480,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
if (!listR.isSuccess() || CollectionUtil.isEmpty(listR.getData())) {
throw new ServiceException("工作票签发人角色下未查询到相关人员");
}
-
log.info("获取签发人角色下的人员: {}", listR.getData());
Map params = new HashMap<>(4);
params.put("workTicketVo", workTicketVo);
@@ -473,7 +487,10 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicketVo.setIsState(true);
log.info("获取表单的数据: {}", workTicketVo);
R processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey, String.valueOf(workTicketVo.getWorkTicket().getId()), workTicketVo.getWorkTicket().getWorkContent(), params);
- if (!processInstanceContainNameByKey.isSuccess() && processInstanceContainNameByKey.getData() == null) {
+ log.info("processInstanceContainNameByKey.isSuccess() : {}", processInstanceContainNameByKey.isSuccess());
+ log.info("processInstanceContainNameByKey.getData() : {}", processInstanceContainNameByKey.getData());
+ log.info("BladeFlow processInstanceContainNameByKey:{}", processInstanceContainNameByKey);
+ if (!processInstanceContainNameByKey.isSuccess() && processInstanceContainNameByKey.getCode() == 500) {
throw new ServiceException("启动流程失败...");
}
}
@@ -485,7 +502,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
* @param workTicketContentDtoList
* @param workTicketInfoEntity
*/
- private void saveWorkTicketContentDto(List workTicketContentDtoList, WorkTicketInfoEntity workTicketInfoEntity) {
+ public void saveWorkTicketContentDto(List workTicketContentDtoList, WorkTicketInfoEntity workTicketInfoEntity) {
if (CollectionUtils.isEmpty(workTicketContentDtoList)) {
return;
}
@@ -508,7 +525,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
* @param safetyMeasuresList
* @param workTicketInfoEntity
*/
- private void saveSafetyMeasures(List safetyMeasuresList, WorkTicketInfoEntity workTicketInfoEntity) {
+ public void saveSafetyMeasures(List safetyMeasuresList, WorkTicketInfoEntity workTicketInfoEntity) {
if (CollectionUtil.isEmpty(safetyMeasuresList)) {
return;
}
@@ -533,7 +550,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
* @param workTicket
* @return
*/
- private WorkTicketInfoEntity saveWorkTicketInfo(WorkTicketInfoEntity workTicket) {
+ public WorkTicketInfoEntity saveWorkTicketInfo(WorkTicketInfoEntity workTicket) {
workTicket.setStatus(Func.isEmpty(workTicket.getPrincipal()) || Func.isEmpty(workTicket.getClassGroupMembers()) ? WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_OPERATE.getStatus() : WorkTicketConstants.FirstWorkTicketStatusEnum.SIGN.getStatus());
//班组成员名称
String byclassGroupMembers = getByClassGroupMembers(workTicket);
@@ -542,7 +559,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
String principalName = getByPrincipal(workTicket);
workTicket.setPrincipalName(principalName);
workTicket.setFlowStatus(1);
- workTicket.setStepOperator(AuthUtil.getUserId());
+ workTicket.setStepOperator(UserCache.getUser(AuthUtil.getUserId()).getName());
//唯一
workTicket.setCreateUser(AuthUtil.getUserId());
boolean isSave = firstWorkTicketService.save(workTicket);
@@ -631,15 +648,120 @@ public class TicketProcessServiceImpl implements TicketProcessService {
}
+ /**
+ * 新预览
+ *
+ * @param ticketId
+ * @param response
+ * @return
+ */
+ @SneakyThrows
+ @Override
+ public void newPreview(Long ticketId, HttpServletResponse response) {
+ String fileName = IdWorker.get32UUID() + ".docx";
+ // response.setContentType("application/octet-stream;charset=ISO8859-1");
+ response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
+ response.setContentType("application/vnd.ms-excel;charset=utf-8");
+ // response.addHeader("Pargam", "no-cache");
+ // response.addHeader("Cache-Control", "no-cache");
+ WorkTicketVo workTicketVo = ticketInfoService.selectDetailsById(ticketId);
+ log.info("新工作票 {}", workTicketVo);
+ //将查询的数据转换为map
+ Map workTicketInfoMap = this.convertMap(workTicketVo);
+ //创建新的map
+ Map objectObjectHashMap = new HashMap<>();
+ for (Map.Entry stringObjectEntry : workTicketInfoMap.entrySet()) {
+ System.out.println("获取map : " + stringObjectEntry.getKey() + "=====>" + stringObjectEntry.getValue());
+ }
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+
+ if ((workTicket.getIsSafety() == null && workTicket.getIsHazard() == null && workTicket.getIsLimited() == null && workTicket.getIsRailway() == null)
+ || (workTicket.getIsSafety() == null || workTicket.getIsHazard() == null || workTicket.getIsLimited() == null || workTicket.getIsRailway() == null)) {
+ extractedWithWord(response, workTicketInfoMap);
+ return;
+ }
+
+ //如果4个多为false 或为空 附件不展示附件
+ if (!workTicket.getIsSafety() && !workTicket.getIsHazard() && !workTicket.getIsLimited() && !workTicket.getIsRailway()) {
+ extractedWithWord(response, workTicketInfoMap);
+ return;
+ }
+ List docFileList = new ArrayList<>();
+ docFileList.add(new File("template/电气第一种工作票模版.docx"));
+ //安全隔离措施附页 (true,展示附件,false,不展示附件)
+ if (workTicket.getIsSafety()) {
+ setWorkTicketPrincipalChange(docFileList);
+ }
+ //危险点分析与预控措施票 (true,展示附件,false,不展示附件)
+ if (workTicket.getIsSafety()) {
+ setWorkTicketHazardPointChange(docFileList);
+ }
+ //动火工作票 (true,展示附件,false,不展示附件)
+ if (workTicket.getIsRailway()) {
+ setWorkTicketRailwayChange(docFileList);
+ }
+ //有限空间监测记录单(true,展示附件,false,不展示附件)
+ if (workTicket.getIsLimited()) {
+ setWorkTicketLimitedChange(docFileList);
+ }
+ MergeDocUtils.mergeDoc(docFileList, response);
+ }
+
+
+ /**
+ * 预览
+ *
+ * @param response
+ * @param workTicketInfoMap
+ * @throws Exception
+ */
+ private static void extractedWithWord(HttpServletResponse response, Map workTicketInfoMap) throws Exception {
+ XWPFDocument doc = WordExportUtil.exportWord07("template/电气第一种工作票模版.docx", workTicketInfoMap);
+ String os = System.getProperty("os.name");
+ //Windows操作系统
+ if (os != null && os.toLowerCase().startsWith("windows")) {
+ log.info("当前系统版本是:{}", os);
+ String name = "D:/导出excel/电气第一种工作票模版.docx";
+ FileOutputStream fos = new FileOutputStream(name);
+ doc.write(fos);
+ } else {
+ //其它操作系统
+ log.info("当前系统版本是:{}", os);
+ ServletOutputStream outputStream = response.getOutputStream();
+ doc.write(outputStream);
+ }
+ }
+
//封装map 转换 excel导出
private Map convertMap(WorkTicketVo workTicketVo) {
Map result = new HashMap<>();
WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+
+ Map map1 = JSONObject.parseObject(JSONObject.toJSONString(workTicket), Map.class);
+ for (Map.Entry stringObjectEntry : map1.entrySet()) {
+ System.out.println("stringObjectEntry : " + stringObjectEntry.getKey() + "=====>" + stringObjectEntry.getValue());
+ }
+
+
//1. 工作对象
+ // log.info("工作对象: {}", workTicket);
+
Map workTicketInfoMap = PdfUtils.objectToMap(workTicket, true);
+ //安全隔离措施附页 (true,展示附件,false,不展示附件
+ getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety"));
+ //危险点分析与预控措施票 (true,展示附件,false,不展示附件)
+ getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard"));
+ //危险点分析与预控措施票 (true,展示附件,false,不展示附件)
+ getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway"));
+ //有限空间监测记录单(true,展示附件,false,不展示附件)
+ getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited"));
+
+
+ result.putAll(workTicketInfoMap);
//2. 安全措施
List safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
+ log.info("安全措施: {}", safetyMeasuresList);
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
Map> measureMap = safetyMeasuresList.stream().collect(Collectors.groupingBy(WorkTicketSafetyMeasureEntity::getType));
Arrays.stream(WorkTicketConstants.WorkTicketMeasureTypeEnum.class.getEnumConstants()).forEach(measureEnum -> {
@@ -654,10 +776,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
index = 1;
tempIndex++;
}
+ log.info("获取安全措施的信息: {}", measureVO);
Map map = PdfUtils.objectToMap(measureVO, true);
map.put("index", index);
map.put("safetyMeasure", ObjectUtil.isNotEmpty(map.get("measure")) ? map.get("measure") : null);
- String status = TicketConstants.SafetyMeasureStatusEnum.FINISH.getStatus().equals(measureVO.getStatus()) ? "√" : "×";
+ String status = TicketConstants.SafetyMeasureStatusEnum.FINISH.getStatus().equals(measureVO.getStatus()) ? "√" : "";
map.put("status", status);
mapList.add(map);
index++;
@@ -668,8 +791,14 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicketInfoMap.put(measureEnum.getConvertAttributes(), new ArrayList