Commit 51867d39 authored by KeYong's avatar KeYong

修改接口

parent 8e6ae18a
...@@ -185,6 +185,19 @@ public class PlanVisual3dController extends BaseController { ...@@ -185,6 +185,19 @@ public class PlanVisual3dController extends BaseController {
} }
@Permission @Permission
@ApiOperation(value = "根据批次号获取预案状态", notes = "根据批次号获取预案状态")
@GetMapping(value = "/plan/getPlaneIfDataMock")
public ResponseModel getPlaneRecord(@RequestParam("batchNo") String batchNo) {
if (StringUtils.isBlank(batchNo)) {
batchNo = planVisual3dService.getLastBatchNo();
}
if (StringUtils.isBlank(batchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.judgeIfPlanDataMock(batchNo));
}
@Permission
@ApiOperation(value = "预案智能辅助", notes = "预案智能辅助") @ApiOperation(value = "预案智能辅助", notes = "预案智能辅助")
@GetMapping(value = "/plan/getPlaneRecordOne") @GetMapping(value = "/plan/getPlaneRecordOne")
public ResponseModel getPlaneRecordOne() { public ResponseModel getPlaneRecordOne() {
......
...@@ -22,6 +22,7 @@ import com.yeejoin.amos.fas.business.vo.*; ...@@ -22,6 +22,7 @@ import com.yeejoin.amos.fas.business.vo.*;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
...@@ -72,6 +73,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -72,6 +73,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
private IPlanOperationRecordDao planOperationRecordDao; private IPlanOperationRecordDao planOperationRecordDao;
@Autowired @Autowired
private IPlanDetailDao planDetailDao;
@Autowired
private ContingencyInstanceInfoMapper contingencyInstanceInfoMapper; private ContingencyInstanceInfoMapper contingencyInstanceInfoMapper;
@Autowired @Autowired
...@@ -284,6 +288,20 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -284,6 +288,20 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
} }
@Override @Override
public boolean judgeIfPlanDataMock(String batchNo) {
PlanOperationRecord planOperationRecord = planOperationRecordDao.findByBatchNo(batchNo);
if (planOperationRecord == null) {
throw new YeeException("执行记录不存在");
} else {
PlanDetail planDetail = planDetailDao.getOne(planOperationRecord.getPlanId());
if (planDetail == null) {
throw new YeeException("数字预案模型被删除");
}
return planDetail.getStatus() == 4 ? true : false;
}
}
@Override
public ToipResponse getPlaneRecordOneByBatchNo(String batchNo) { public ToipResponse getPlaneRecordOneByBatchNo(String batchNo) {
// 根据批次号获取预案记录 // 根据批次号获取预案记录
String instances = contingencyPlanInstanceRepository.queryRecordOne(batchNo, "HELPAREA"); String instances = contingencyPlanInstanceRepository.queryRecordOne(batchNo, "HELPAREA");
......
...@@ -74,6 +74,14 @@ public interface IPlanVisual3dService { ...@@ -74,6 +74,14 @@ public interface IPlanVisual3dService {
ToipResponse getPlaneRecordByBatchNo(String batchNo); ToipResponse getPlaneRecordByBatchNo(String batchNo);
/** /**
* 根据批次号获取预案状态
*
* @param batchNo 批次号
* @return 预案记录
*/
boolean judgeIfPlanDataMock(String batchNo);
/**
* 根据批次号获取预案记录 * 根据批次号获取预案记录
* *
* @param batchNo 批次号 * @param batchNo 批次号
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment