段飞宇
1 year ago
7 changed files with 175 additions and 136 deletions
@ -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("消缺工作流程出现异常呢"); |
||||
|
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue