Browse Source

修改水力机械工作票

zhongwei
段飞宇 1 year ago
parent
commit
d2e7412333
  1. 6
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
  2. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java
  3. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java
  4. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java
  5. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
  6. 69
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java
  7. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java
  8. 74
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  9. BIN
      hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx
  10. BIN
      hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx

6
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java

@ -480,6 +480,10 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
*/ */
@ApiModelProperty("有限空间监测记录单 (true,展示附件,false,不展示附件)") @ApiModelProperty("有限空间监测记录单 (true,展示附件,false,不展示附件)")
private Boolean isLimited; private Boolean isLimited;
/**
*每日开工和收工时间附页
*/
@ApiModelProperty("每日开工和收工时间附页")
private Boolean isStart;
} }

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

@ -102,6 +102,8 @@ public class MessagePushRecordController extends BladeController {
@GetMapping("/getPersonalUnreadMessage") @GetMapping("/getPersonalUnreadMessage")
@ApiOperation("获取当前登录人待办消息") @ApiOperation("获取当前登录人待办消息")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@OperationAnnotation(moduleName = "视频集中监控", title = "视频集中监控", action = "获取当前登录人待办消息",
operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE)
public R<List<UnreadMessageVO>> getPersonalUnreadMessage() { public R<List<UnreadMessageVO>> getPersonalUnreadMessage() {
List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage(); List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage();
return R.data(personalUnreadMessage); return R.data(personalUnreadMessage);

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java

@ -77,7 +77,7 @@ public class StAlamRecordController {
@GetMapping("/listPage") @GetMapping("/listPage")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入vo") @ApiOperation(value = "分页", notes = "传入vo")
@OperationAnnotation(title = "系统预警处理", operatorType = OperatorType.MOBILE, @OperationAnnotation(moduleName = "数据查询",title = "系统预警处理", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "分页查询") businessType = BusinessType.GENCODE,action = "分页查询")
public R<IPage<StAlarmRecordVo>> list(StAlarmRecordVo vo, Query query) { public R<IPage<StAlarmRecordVo>> list(StAlarmRecordVo vo, Query query) {
return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo)); return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo));

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

@ -4,6 +4,8 @@ import com.hnac.hzims.ticket.constants.TicketConstants;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.cloud.feign.EnableBladeFeign; import org.springblade.core.cloud.feign.EnableBladeFeign;
import org.springblade.core.launch.BladeApplication; import org.springblade.core.launch.BladeApplication;
import org.springblade.core.mp.plugins.SqlLogInterceptor;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.cloud.client.SpringCloudApplication;

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java

@ -20,4 +20,9 @@ public class TicketProcessConstant {
* 操作票 * 操作票
*/ */
public static final String OPERATION_TICKET_KEY = "moreActionBankDirect"; public static final String OPERATION_TICKET_KEY = "moreActionBankDirect";
/**
* 水力机械工作票
*/
public static final String MACHINERY_TICKET_KEY = "machinery";
} }

69
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java

@ -0,0 +1,69 @@
package com.hnac.hzims.ticket.processflow.strategy.serviceimpl;
import com.hnac.hzims.ticket.processflow.service.ProcessDictService;
import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY;
import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
/**
* 水力机械工作票实现类
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/28 8:47
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class MachineryTicketProcessServiceImpl extends ProcessAbstractService {
private final TicketProcessService ticketProcessService;
private final ProcessDictService processDictService;
/**
* 设置执行那种实现类
*
* @param flowQueue
* @return
*/
@Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
log.info("是否执行水力机械工作票流程环节操作~~~~,流程ticket: {}", flowQueue);
String dictValue = processDictService.selectDictValueByKey(MACHINERY_TICKET_KEY);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行水力机械工作票流程环节操作~~~~");
return true;
}
log.error("未是否执行水力机械工作票流程环节操作,请联系管理员~~~~");
return false;
}
/**
* 两票管理业务方法
*
* @param response
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
ticketProcessService.findPending(response);
}
}

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java

@ -55,4 +55,9 @@ public class TicketConstant {
*/ */
public static final String SPACE_PAGE = "/secondary/有限空间监测记录单.docx"; public static final String SPACE_PAGE = "/secondary/有限空间监测记录单.docx";
/**
* 每日开工和收工时间附页
*/
public static final String START_PAGE = "/secondary/每日开工和收工时间附页.docx";
} }

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

@ -74,6 +74,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY; import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY;
import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
/** /**
@ -191,7 +192,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
workTicketVo.getWorkTicket().setSignage(signage); workTicketVo.getWorkTicket().setSignage(station.getSignage());
workTicketVo.getWorkTicket().setSignageCode(station.getCode()); workTicketVo.getWorkTicket().setSignageCode(station.getCode());
//2. 获取编码 //2. 获取编码
String code = processIdWorker.getTicketByCode(workTicketVo.getWorkTicket().getSignage(), this.getTicketWichCode(workTicketVo.getWorkTicket().getType()), String code = processIdWorker.getTicketByCode(workTicketVo.getWorkTicket().getSignage(), this.getTicketWichCode(workTicketVo.getWorkTicket().getType()),
@ -204,7 +205,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//5. 保存工作任务 //5. 保存工作任务
this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket());
//6. 查询第一种工作票值 //6. 查询第一种工作票值
String dictValue = processDictService.selectDictValueByKey(FIRST_TICKET_KEY); String dictValue = getDictValue(workTicketVo);
//7. 开启动作流 //7. 开启动作流
this.dealProcess(dictValue, workTicketVo); this.dealProcess(dictValue, workTicketVo);
//8. 处理任务 //8. 处理任务
@ -213,6 +214,23 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
/** /**
* 验证是走那种工作票流程默认走第一种工作票
*
* @param workTicketVo
* @return
*/
private String getDictValue(WorkTicketVo workTicketVo) {
String key = FIRST_TICKET_KEY;
if ("6".equals(workTicketVo.getWorkTicket().getType()) || "7".equals(workTicketVo.getWorkTicket().getType())) {
key = FIRST_TICKET_KEY;
} else if ("8".equals(workTicketVo.getWorkTicket().getType())) {
key = MACHINERY_TICKET_KEY;
}
String dictValue = processDictService.selectDictValueByKey(key);
return dictValue;
}
/**
* 待处理 * 待处理
* *
* @param response * @param response
@ -438,7 +456,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
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);
@ -476,18 +493,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
//如果response.getHandleType() 是1使角色 //如果response.getHandleType() 是1使角色
if ("1".equals(response.getHandleType())) { if ("1".equals(response.getHandleType())) {
//根据角色别名获取用户信息
// try {
// R<List<User>> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator());
// String collect = roleAlias.getData().stream().map(item -> item.getName()).collect(Collectors.joining(","));
// flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(collect).concat("审批");
// workTicket.setNextStepOperator(collect);
// } catch (Exception e) {
// e.printStackTrace();
// log.error("R<List<User>> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())");
// log.error("获取用户信息失败");
// workTicket.setNextStepOperator(null);
// }
workTicket.setFlowUserId(response.getUserId()); workTicket.setFlowUserId(response.getUserId());
workTicket.setNextStepOperator(response.getNextStepOperator()); workTicket.setNextStepOperator(response.getNextStepOperator());
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批");
@ -497,7 +502,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
String taskId = response.getTaskId(); String taskId = response.getTaskId();
if (StringUtils.isEmpty(taskId)) { if (StringUtils.isEmpty(taskId)) {
workTicket.setFlowDescription("结束"); workTicket.setFlowDescription("结束");
// workTicket.setFlowTaskId(" ");
workTicket.setFlowTaskName("结束"); workTicket.setFlowTaskName("结束");
workTicket.setNextStepOperator(" "); workTicket.setNextStepOperator(" ");
workTicket.setStepOperator(" "); workTicket.setStepOperator(" ");
@ -507,6 +511,27 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicket.setFlowTaskName(response.getTaskName()); workTicket.setFlowTaskName(response.getTaskName());
workTicket.setFlowDescription(flowDescription); workTicket.setFlowDescription(flowDescription);
} }
//如果签发人为false
if (workTicket.getSignFlag() != null) {
if (!workTicket.getSignFlag()) {
workTicket.setFlowDescription("作废");
workTicket.setFlowTaskName("作废");
workTicket.setNextStepOperator(" ");
workTicket.setStepOperator(" ");
}
}
//运行人员false
if (workTicket.getRecieveFlag() != null) {
if (!workTicket.getRecieveFlag()) {
workTicket.setFlowDescription("作废");
workTicket.setFlowTaskName("作废");
workTicket.setNextStepOperator(" ");
workTicket.setStepOperator(" ");
}
}
} }
@ -606,6 +631,9 @@ public class TicketProcessServiceImpl implements TicketProcessService {
// } // }
Map<String, Object> params = new HashMap<>(4); Map<String, Object> params = new HashMap<>(4);
params.put("workTicketVo", workTicketVo); params.put("workTicketVo", workTicketVo);
if ("8".equals(workTicketVo.getWorkTicket().getType())) {
params.put("principal", "taskUser_" + workTicketVo.getWorkTicket().getPrincipal());
}
//已开启流程 //已开启流程
R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey, String.valueOf(workTicketVo.getWorkTicket().getId()), workTicketVo.getWorkTicket().getWorkContent(), params); R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey, String.valueOf(workTicketVo.getWorkTicket().getId()), workTicketVo.getWorkTicket().getWorkContent(), params);
log.info("processInstanceContainNameByKey.isSuccess() : {}", processInstanceContainNameByKey.isSuccess()); log.info("processInstanceContainNameByKey.isSuccess() : {}", processInstanceContainNameByKey.isSuccess());
@ -771,14 +799,14 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
if ((workTicket.getIsSafety() == null && workTicket.getIsHazard() == null && workTicket.getIsLimited() == null && workTicket.getIsRailway() == null) 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)) { && workTicket.getIsStart() == null) {
extractedWithWord(response, resultMap, status); extractedWithWord(response, resultMap, status);
return; return;
} }
//如果4个多为false 或为空 附件不展示附件 //如果4个多为false 或为空 附件不展示附件
if (!workTicket.getIsSafety() && !workTicket.getIsHazard() && !workTicket.getIsLimited() && !workTicket.getIsRailway()) { if (!workTicket.getIsSafety() && !workTicket.getIsHazard() && !workTicket.getIsLimited() && !workTicket.getIsRailway() && !workTicket.getIsStart()) {
extractedWithWord(response, resultMap, status); extractedWithWord(response, resultMap, status);
return; return;
} }
@ -801,22 +829,22 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//安全隔离措施附页 (true,展示附件,false,不展示附件) //安全隔离措施附页 (true,展示附件,false,不展示附件)
if (workTicket.getIsSafety()) { if (workTicket.getIsSafety()) {
addFile(prefix, TicketConstant.SECURE_PAGE, docFileList); addFile(prefix, TicketConstant.SECURE_PAGE, docFileList);
// setWorkTicketPrincipalChange(docFileList);
} }
//危险点分析与预控措施票 (true,展示附件,false,不展示附件) //危险点分析与预控措施票 (true,展示附件,false,不展示附件)
if (workTicket.getIsSafety()) { if (workTicket.getIsSafety()) {
addFile(prefix, TicketConstant.SAFETY_PAGE, docFileList); addFile(prefix, TicketConstant.SAFETY_PAGE, docFileList);
// setWorkTicketHazardPointChange(docFileList);
} }
//动火工作票 (true,展示附件,false,不展示附件) //动火工作票 (true,展示附件,false,不展示附件)
if (workTicket.getIsRailway()) { if (workTicket.getIsRailway()) {
addFile(prefix, TicketConstant.FLIGHT_PAGE, docFileList); addFile(prefix, TicketConstant.FLIGHT_PAGE, docFileList);
// setWorkTicketRailwayChange(docFileList);
} }
//有限空间监测记录单(true,展示附件,false,不展示附件) //有限空间监测记录单(true,展示附件,false,不展示附件)
if (workTicket.getIsLimited()) { if (workTicket.getIsLimited()) {
addFile(prefix, TicketConstant.SPACE_PAGE, docFileList); addFile(prefix, TicketConstant.SPACE_PAGE, docFileList);
// setWorkTicketLimitedChange(docFileList); }
//每日开工和收工时间附页
if (workTicket.getIsStart()) {
addFile(prefix, TicketConstant.START_PAGE, docFileList);
} }
String name = LocalDate.now() + "-" + UUID.randomUUID().toString().replaceAll("-", ""); String name = LocalDate.now() + "-" + UUID.randomUUID().toString().replaceAll("-", "");

BIN
hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx

Binary file not shown.

BIN
hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx

Binary file not shown.
Loading…
Cancel
Save