|
|
@@ -9,6 +9,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; |
|
|
|
import com.wflow.exception.BusinessException; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.messaging.Message; |
|
|
@@ -41,37 +42,34 @@ public class StateMachineUtils { |
|
|
|
@Resource(name = "projectDeclareStateMachinePersister") |
|
|
|
private StateMachinePersister projectDeclareStateMachinePersister; |
|
|
|
|
|
|
|
/** |
|
|
|
* 审核通过 |
|
|
|
* @param project |
|
|
|
* @return void |
|
|
|
* @author CMM |
|
|
|
* @since 2023/03/10 13:40 |
|
|
|
*/ |
|
|
|
public void pass(Project project) throws Exception { |
|
|
|
execute(project,getProjectStatusPassEvent(project.getStatus())); |
|
|
|
//通过审核 |
|
|
|
public void pass(Project project) { |
|
|
|
try{ |
|
|
|
execute(project,getProjectStatusPassEvent(project.getStatus())); |
|
|
|
}catch (Exception e){ |
|
|
|
log.info("状态机 通过失败 :{}",e.getMessage()); |
|
|
|
throw new BusinessException("状态机 通过失败: " + e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 审核驳回 |
|
|
|
* @param project |
|
|
|
* @return void |
|
|
|
* @author CMM |
|
|
|
* @since 2023/03/10 13:40 |
|
|
|
*/ |
|
|
|
public void reject(Project project) throws Exception { |
|
|
|
execute(project,getProjectStatusRejectEvent(project.getStatus())); |
|
|
|
//拒绝 |
|
|
|
public void reject(Project project) { |
|
|
|
try{ |
|
|
|
execute(project,getProjectStatusRejectEvent(project.getStatus())); |
|
|
|
}catch (Exception e){ |
|
|
|
log.info("状态机 拒绝失败 :{}",e.getMessage()); |
|
|
|
throw new BusinessException("状态机 拒绝失败: " + e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 审核撤回 |
|
|
|
* @param project |
|
|
|
* @return void |
|
|
|
* @author CMM |
|
|
|
* @since 2023/03/10 13:40 |
|
|
|
*/ |
|
|
|
public void withDraw(Project project) throws Exception { |
|
|
|
execute(project,getProjectStatusWithdrawEvent(project.getStatus())); |
|
|
|
//撤回 |
|
|
|
public void withDraw(Project project) { |
|
|
|
try{ |
|
|
|
execute(project,getProjectStatusWithdrawEvent(project.getStatus())); |
|
|
|
}catch (Exception e){ |
|
|
|
log.info("状态机 撤回失败 :{}",e.getMessage()); |
|
|
|
throw new BusinessException("状态机 撤回失败: " + e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void execute(Project project, ProjectStatusChangeEvent event) throws Exception { |
|
|
|