Browse Source

新增:线下操作票流程

zhongwei
ty 6 months ago
parent
commit
ced0ef7867
  1. 4
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
  2. 10
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java
  3. 72
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineOperationTicketProcessServiceImpl.java
  4. 1
      hzims-service/hzims-middle/src/main/resources/db/3.0.0.sql
  5. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
  6. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
  7. 11
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  8. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java
  9. 6
      hzims-service/ticket/src/main/resources/db/2.0.3.sql

4
hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java

@ -74,4 +74,8 @@ public class TicketProcessConstant {
* 风险排查标识 * 风险排查标识
*/ */
public static final String HAZARD_RISK = "hazard_risk"; public static final String HAZARD_RISK = "hazard_risk";
/**
* 线下操作票标识
*/
public static final String OFFLINE_OPERATION_TICKET = "OperationTicketOffline";
} }

10
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java

@ -162,4 +162,14 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty("监护人确认结果:approved-确认,rejected-作废") @ApiModelProperty("监护人确认结果:approved-确认,rejected-作废")
private String verifyResult; private String verifyResult;
@ApiModelProperty("是否线下 : 1-线下,0-线上")
@QueryField(condition = SqlCondition.EQUAL)
private Boolean isOffline;
@ApiModelProperty("是否审核通过,0为通过,1为未通过")
private Boolean isApproved;
@ApiModelProperty("图片附件")
private String picture;
} }

72
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineOperationTicketProcessServiceImpl.java

@ -0,0 +1,72 @@
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.ticket.ticketprocess.feign.OperationTicketFeignClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OFFLINE_OPERATION_TICKET;
/**
* 操作票流程实现类
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/28 8:47
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class OfflineOperationTicketProcessServiceImpl extends ProcessAbstractService {
private final OperationTicketFeignClient operationTicketFeignClient;
private final ProcessDictService processDictService;
/**
* 设置执行那种实现类
*
* @param flowQueue
* @return
*/
@Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
log.info("是否执行操作票流程环节操作~~~~,流程flowQueue: {}", flowQueue);
String dictValue = processDictService.selectDictValueByKey(OFFLINE_OPERATION_TICKET);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行操作票流程环节操作~~~~");
return true;
}
log.error("未执行操作票流程环节操作,请联系管理员~~~~");
return false;
}
/**
* 两票管理业务方法
*
* @param response
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
log.info("操作票流程消费调用fein接口开始---param",response);
Boolean pending = operationTicketFeignClient.findPending(response);
if (!pending) {
log.info("操作票流程调用fein接口异常---param",response);
throw new ServiceException("操作票流程出现异常呢");
}
log.info("操作票流程消费调用fein接口结束---param",response);
}
}

1
hzims-service/hzims-middle/src/main/resources/db/3.0.0.sql

@ -0,0 +1 @@
INSERT INTO `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) VALUES (15, 15, 'OperationTicketOffline', 'OperationTicketOffline', '线下操作票', '线下操作票', 'Y', 0, NULL, '2023-07-25 18:35:01', '2024-05-24 11:22:14', '线下操作票流程');

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

@ -17,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OFFLINE_OPERATION_TICKET;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
/** /**
* 操作票 * 操作票
* @Author WL * @Author WL
@ -45,7 +48,19 @@ public class OperationTicketController {
@ApiOperation("启动流程") @ApiOperation("启动流程")
@PostMapping("/startUp") @PostMapping("/startUp")
public R start(@RequestBody StandardTicketInfoVo StandardTicketInfoVo) { public R start(@RequestBody StandardTicketInfoVo StandardTicketInfoVo) {
operationTicketService.startUp(StandardTicketInfoVo); operationTicketService.startUp(StandardTicketInfoVo,OPERATION_TICKET_KEY);
return R.success("申请开票成功");
}
/**
* 启动流程
*
* @return
*/
@ApiOperation("启动线下流程")
@PostMapping("/startOffineOperation")
public R startOffineOperation(@RequestBody StandardTicketInfoVo StandardTicketInfoVo) {
operationTicketService.startUp(StandardTicketInfoVo,OFFLINE_OPERATION_TICKET);
return R.success("申请开票成功"); return R.success("申请开票成功");
} }

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

@ -19,7 +19,7 @@ public interface OperationTicketService {
* 启动流程 * 启动流程
* @param standardTicketInfoVo * @param standardTicketInfoVo
*/ */
void startUp(StandardTicketInfoVo standardTicketInfoVo); void startUp(StandardTicketInfoVo standardTicketInfoVo,String dictValueKey);
/** /**
@ -39,5 +39,4 @@ public interface OperationTicketService {
} }

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

@ -100,7 +100,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
* @param standardTicketInfoVo * @param standardTicketInfoVo
*/ */
@Override @Override
public void startUp(StandardTicketInfoVo standardTicketInfoVo) { public void startUp(StandardTicketInfoVo standardTicketInfoVo,String dictValueKey) {
log.info("执行 com.hnac.hzims.ticket.standardTicket.service.impl【startUp】 。。。方法"); log.info("执行 com.hnac.hzims.ticket.standardTicket.service.impl【startUp】 。。。方法");
if (standardTicketInfoVo.getSignage() == null) { if (standardTicketInfoVo.getSignage() == null) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置"); throw new ServiceException("票据抬头未配置,请您到站点管理配置");
@ -134,6 +134,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
String code = processDictFeignService.getTicketByCode(standardTicketInfoVo.getSignage(), this.getTicketWichCode(standardTicketInfoVo.getTicketType())); String code = processDictFeignService.getTicketByCode(standardTicketInfoVo.getSignage(), this.getTicketWichCode(standardTicketInfoVo.getTicketType()));
log.info("获取编码: {}", code); log.info("获取编码: {}", code);
if (StringUtils.isBlank(code)) { if (StringUtils.isBlank(code)) {
log.error("获取操作票编码异常:"+code);
throw new ServiceException("服务器异常,请联系管理员"); throw new ServiceException("服务器异常,请联系管理员");
} }
standardTicketInfoVo.setCode(code); standardTicketInfoVo.setCode(code);
@ -143,9 +144,10 @@ public class OperationTicketServiceImpl implements OperationTicketService {
List<StandardTicketMeasureVo> standardTicketInfoVos = this.saveStandardTicketMeasure(this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo)); List<StandardTicketMeasureVo> standardTicketInfoVos = this.saveStandardTicketMeasure(this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo));
standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos); standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos);
//6. 查询第操作票值 //6. 查询第操作票值
String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY); String dictValue = processDictFeignService.selectDictValueByKey(dictValueKey);
log.info("查询第操作票值: {}", dictValue); log.info("查询第操作票值: {}", dictValue);
if (StringUtils.isBlank(dictValue)) { if (StringUtils.isBlank(dictValue)) {
log.error("查询不到操作票值");
throw new ServiceException("服务器异常,请联系管理员"); throw new ServiceException("服务器异常,请联系管理员");
} }
// 7.启动流程 // 7.启动流程
@ -337,7 +339,9 @@ public class OperationTicketServiceImpl implements OperationTicketService {
Map<String, Object> params = new HashMap<>(4); Map<String, Object> params = new HashMap<>(4);
params.put("standardTicketInfoVo", standardTicketInfoVo); params.put("standardTicketInfoVo", standardTicketInfoVo);
params.put("taskId", standardTicketInfoVo.getId()); params.put("taskId", standardTicketInfoVo.getId());
params.put("guardianUserIds", "taskUser_".concat(standardTicketInfoVo.getGuardian().toString())); if(ObjectUtil.isNotEmpty(standardTicketInfoVo.getGuardian())){
params.put("guardianUserIds", "taskUser_".concat(standardTicketInfoVo.getGuardian().toString()));
}
//已开启流程 //已开启流程
R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params); R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params);
if (!processInstanceContainNameByKey.isSuccess()) { if (!processInstanceContainNameByKey.isSuccess()) {
@ -434,6 +438,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
boolean save = standardTicketInfoService.save(standardTicketInfo); boolean save = standardTicketInfoService.save(standardTicketInfo);
if (!save) { if (!save) {
log.error("saveStandardTicketInfo failed");
throw new ServiceException("Save failed"); throw new ServiceException("Save failed");
} }
BeanUtils.copyProperties(standardTicketInfo, standardTicketInfoVo); BeanUtils.copyProperties(standardTicketInfo, standardTicketInfoVo);

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java

@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.mp.support.SqlCondition;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -152,4 +154,14 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("安全措施") @ApiModelProperty("安全措施")
private List<StandardTicketMeasureVo> standardTicketMeasureVos; private List<StandardTicketMeasureVo> standardTicketMeasureVos;
@ApiModelProperty("是否线下 : 1-线下,0-线上")
@QueryField(condition = SqlCondition.EQUAL)
private Boolean isOffline;
@ApiModelProperty("是否审核通过 : 1-通过,0-未通过")
private Boolean isApproved;
@ApiModelProperty("图片附件")
private String picture;
} }

6
hzims-service/ticket/src/main/resources/db/2.0.3.sql

@ -0,0 +1,6 @@
alter table `hzims_standard_ticket_info` add column `is_offline` tinyint(2) default 0 comment '是否线下 : 1-线下,0-线上';
alter table `hzims_standard_ticket_info` add column `is_approved` tinyint(2) default NULL comment '是否审核通过 : 1-通过,0-未通过';
alter table `hzims_standard_ticket_info` ADD COLUMN `picture` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片附件' ;
ALTER TABLE `hzims_standard_ticket_info`
MODIFY COLUMN `issue_order_person` bigint(20) NULL COMMENT '发令人' AFTER `code`,
MODIFY COLUMN `access_order_person` bigint(20) NULL COMMENT '受令人' AFTER `issue_order_person`;
Loading…
Cancel
Save