Commit afba4432 authored by 高建强's avatar 高建强

item:沂南预案联调

parent 2f292c3f
...@@ -232,4 +232,10 @@ public class ContingencyPlanController extends BaseController { ...@@ -232,4 +232,10 @@ public class ContingencyPlanController extends BaseController {
return CommonResponseUtil2.success(bool); return CommonResponseUtil2.success(bool);
} }
@ApiOperation(value = "获取预案状态")
@RequestMapping(value = "/getPlanStatus", method = RequestMethod.GET)
public ResponseModel getPlanStatus() {
return CommonResponseUtil2.success(contingencyPlanService.getPlanStatus());
}
} }
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.dao.entity.TextPlan; ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.dao.entity.TextPlan;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -152,13 +153,10 @@ public class PlanVisual3dController extends BaseController { ...@@ -152,13 +153,10 @@ public class PlanVisual3dController extends BaseController {
@Permission @Permission
@ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤") @ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤")
@GetMapping(value = "/plan/getPlanStep") @GetMapping(value = "/plan/getPlanStep")
public ResponseModel getPlanStep(@RequestParam("batchNo") String batchNo) { public ResponseModel getPlanStep(@RequestParam(value = "batchNo", required = false) String batchNo) {
if (!StringUtil.isNotEmpty(batchNo)) { if (StringUtils.isEmpty(batchNo)) {
batchNo = planVisual3dService.getNewestBatchNo(); batchNo = planVisual3dService.getNewestBatchNo();
} }
if (!StringUtil.isNotEmpty(batchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(batchNo)); return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(batchNo));
} }
......
...@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -814,4 +815,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -814,4 +815,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
return bool; return bool;
} }
@Override
public Boolean getPlanStatus() {
return CollectionUtils.isEmpty(planOperationRecordDao.findByStatus(0));
}
} }
\ No newline at end of file
...@@ -7,10 +7,7 @@ import com.yeejoin.amos.fas.business.constants.FasConstant; ...@@ -7,10 +7,7 @@ import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.DictMapper; import com.yeejoin.amos.fas.business.dao.mapper.DictMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper; import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper; import com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao; import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository;
import com.yeejoin.amos.fas.business.dao.repository.IPlanRuleDao;
import com.yeejoin.amos.fas.business.dao.repository.ITextPlanDao;
import com.yeejoin.amos.fas.business.feign.IMaasVisualServer; import com.yeejoin.amos.fas.business.feign.IMaasVisualServer;
import com.yeejoin.amos.fas.business.service.intfc.IDictService; import com.yeejoin.amos.fas.business.service.intfc.IDictService;
import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService; import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService;
...@@ -62,6 +59,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -62,6 +59,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired @Autowired
private IPlanRuleDao planRuleDao; private IPlanRuleDao planRuleDao;
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
@Override @Override
public List<TreeSubjectVo> getPlanTree() { public List<TreeSubjectVo> getPlanTree() {
...@@ -318,10 +318,15 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -318,10 +318,15 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override @Override
@Transactional @Transactional
public PlanRule updatePlanStep(PlanStepVo planStepVo) { public PlanStepVo updatePlanStep(PlanStepVo planStepVo) {
// 根据批次号查询预案步骤 // 运行中的设置为重置
PlanRule planRule = planOperationRecordMapper.getPlanRuleByBatchNo(planStepVo.getBatchNo()); List<PlanOperationRecord> planList = planOperationRecordDao.findByStatus(0);
planRule.setPlanStep(planStepVo.getPlanStep()); if (!CollectionUtils.isEmpty(planList)) {
return planRuleDao.save(planRule); // 根据批次号查询预案步骤
PlanRule planRule = planOperationRecordMapper.getPlanRuleByBatchNo(planStepVo.getBatchNo());
planRule.setPlanStep(planStepVo.getPlanStep());
planRuleDao.save(planRule);
}
return planStepVo;
} }
} }
...@@ -135,4 +135,5 @@ public interface IContingencyPlanService { ...@@ -135,4 +135,5 @@ public interface IContingencyPlanService {
AtomicBoolean planReset(); AtomicBoolean planReset();
Boolean getPlanStatus();
} }
...@@ -71,5 +71,5 @@ public interface IPlanVisual3dService { ...@@ -71,5 +71,5 @@ public interface IPlanVisual3dService {
*/ */
ToipResponse getPlaneRecordOneByBatchNo(String batchNo); ToipResponse getPlaneRecordOneByBatchNo(String batchNo);
PlanRule updatePlanStep(PlanStepVo planStepVo); PlanStepVo updatePlanStep(PlanStepVo planStepVo);
} }
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