diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java index d0b79d3..b7ce6c8 100644 --- a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java +++ b/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 OFFLINE_OPERATION_TICKET = "OperationTicketOffline"; } diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java index ade487d..3e49fef 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java +++ b/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) @ApiModelProperty("监护人确认结果:approved-确认,rejected-作废") private String verifyResult; + + @ApiModelProperty("是否线下 : 1-线下,0-线上") + @QueryField(condition = SqlCondition.EQUAL) + private Boolean isOffline; + + @ApiModelProperty("是否审核通过,0为通过,1为未通过") + private Boolean isApproved; + + @ApiModelProperty("图片附件") + private String picture; } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineOperationTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineOperationTicketProcessServiceImpl.java new file mode 100644 index 0000000..f0a346e --- /dev/null +++ b/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); + } +} diff --git a/hzims-service/hzims-middle/src/main/resources/db/3.0.0.sql b/hzims-service/hzims-middle/src/main/resources/db/3.0.0.sql new file mode 100644 index 0000000..c1ebcf4 --- /dev/null +++ b/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', '线下操作票流程'); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java index 56cc07f..3c79c22 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java +++ b/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 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 @@ -45,7 +48,19 @@ public class OperationTicketController { @ApiOperation("启动流程") @PostMapping("/startUp") 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("申请开票成功"); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java index 925f8c5..b45f40f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java @@ -19,7 +19,7 @@ public interface OperationTicketService { * 启动流程 * @param standardTicketInfoVo */ - void startUp(StandardTicketInfoVo standardTicketInfoVo); + void startUp(StandardTicketInfoVo standardTicketInfoVo,String dictValueKey); /** @@ -39,5 +39,4 @@ public interface OperationTicketService { - } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index d0fbf33..5ca66c0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/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 */ @Override - public void startUp(StandardTicketInfoVo standardTicketInfoVo) { + public void startUp(StandardTicketInfoVo standardTicketInfoVo,String dictValueKey) { log.info("执行 com.hnac.hzims.ticket.standardTicket.service.impl【startUp】 。。。方法"); if (standardTicketInfoVo.getSignage() == null) { throw new ServiceException("票据抬头未配置,请您到站点管理配置"); @@ -134,6 +134,7 @@ public class OperationTicketServiceImpl implements OperationTicketService { String code = processDictFeignService.getTicketByCode(standardTicketInfoVo.getSignage(), this.getTicketWichCode(standardTicketInfoVo.getTicketType())); log.info("获取编码: {}", code); if (StringUtils.isBlank(code)) { + log.error("获取操作票编码异常:"+code); throw new ServiceException("服务器异常,请联系管理员"); } standardTicketInfoVo.setCode(code); @@ -143,9 +144,10 @@ public class OperationTicketServiceImpl implements OperationTicketService { List standardTicketInfoVos = this.saveStandardTicketMeasure(this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo)); standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos); //6. 查询第操作票值 - String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY); + String dictValue = processDictFeignService.selectDictValueByKey(dictValueKey); log.info("查询第操作票值: {}", dictValue); if (StringUtils.isBlank(dictValue)) { + log.error("查询不到操作票值"); throw new ServiceException("服务器异常,请联系管理员"); } // 7.启动流程 @@ -337,7 +339,9 @@ public class OperationTicketServiceImpl implements OperationTicketService { Map params = new HashMap<>(4); params.put("standardTicketInfoVo", standardTicketInfoVo); 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 processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params); if (!processInstanceContainNameByKey.isSuccess()) { @@ -434,6 +438,7 @@ public class OperationTicketServiceImpl implements OperationTicketService { boolean save = standardTicketInfoService.save(standardTicketInfo); if (!save) { + log.error("saveStandardTicketInfo failed"); throw new ServiceException("Save failed"); } BeanUtils.copyProperties(standardTicketInfo, standardTicketInfoVo); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index e777e6e..cf8e741 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/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.EqualsAndHashCode; 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.springframework.format.annotation.DateTimeFormat; @@ -152,4 +154,14 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("安全措施") private List standardTicketMeasureVos; + + @ApiModelProperty("是否线下 : 1-线下,0-线上") + @QueryField(condition = SqlCondition.EQUAL) + private Boolean isOffline; + + @ApiModelProperty("是否审核通过 : 1-通过,0-未通过") + private Boolean isApproved; + + @ApiModelProperty("图片附件") + private String picture; } diff --git a/hzims-service/ticket/src/main/resources/db/2.0.3.sql b/hzims-service/ticket/src/main/resources/db/2.0.3.sql new file mode 100644 index 0000000..755f8ce --- /dev/null +++ b/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`; \ No newline at end of file