yang_shj
2 years ago
18 changed files with 161 additions and 23 deletions
@ -0,0 +1,56 @@
|
||||
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.access.feign.IAccessPlanV4Client; |
||||
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; |
||||
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OVERHAUL_PLAN; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
public class OverhaulPlanServiceImpl extends ProcessAbstractService { |
||||
|
||||
|
||||
private final IAccessPlanV4Client accessPlanV4Client; |
||||
|
||||
|
||||
private final ProcessDictService processDictService; |
||||
|
||||
|
||||
/** |
||||
* 消息确认 |
||||
* @param flowQueue |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { |
||||
String dictValue = processDictService.selectDictValueByKey(OVERHAUL_PLAN); |
||||
return dictValue.equals(flowQueue.getProcessDefinitionKey()); |
||||
} |
||||
|
||||
/** |
||||
* 两票管理业务方法 |
||||
* |
||||
* @param response |
||||
*/ |
||||
@Override |
||||
public void calculate(ProcessWorkFlowResponse response) { |
||||
R defect = accessPlanV4Client.listener(response); |
||||
if (!defect.isSuccess()) { |
||||
throw new ServiceException("检修计划业务执行异常!"); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,56 @@
|
||||
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.access.feign.IAccessPlanV4Client; |
||||
import com.hnac.hzims.operational.access.feign.IAccessTaskV4Client; |
||||
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.*; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
public class OverhaulTaskServiceImpl extends ProcessAbstractService { |
||||
|
||||
|
||||
private final IAccessTaskV4Client accessTaskV4Client; |
||||
|
||||
|
||||
private final ProcessDictService processDictService; |
||||
|
||||
|
||||
/** |
||||
* 消息确认 |
||||
* @param flowQueue |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { |
||||
String dictValue = processDictService.selectDictValueByKey(OVERHAUL_TASK); |
||||
return dictValue.equals(flowQueue.getProcessDefinitionKey()); |
||||
} |
||||
|
||||
/** |
||||
* 调用检修业务处理 |
||||
* @param response |
||||
*/ |
||||
@Override |
||||
public void calculate(ProcessWorkFlowResponse response) { |
||||
R defect = accessTaskV4Client.listener(response); |
||||
if (!defect.isSuccess()) { |
||||
throw new ServiceException("检修任务业务执行异常!"); |
||||
|
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue