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

item:沂南预案联调

parent 2f292c3f
......@@ -232,4 +232,10 @@ public class ContingencyPlanController extends BaseController {
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;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -152,13 +153,10 @@ public class PlanVisual3dController extends BaseController {
@Permission
@ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤")
@GetMapping(value = "/plan/getPlanStep")
public ResponseModel getPlanStep(@RequestParam("batchNo") String batchNo) {
if (!StringUtil.isNotEmpty(batchNo)) {
public ResponseModel getPlanStep(@RequestParam(value = "batchNo", required = false) String batchNo) {
if (StringUtils.isEmpty(batchNo)) {
batchNo = planVisual3dService.getNewestBatchNo();
}
if (!StringUtil.isNotEmpty(batchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(batchNo));
}
......
......@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -814,4 +815,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
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;
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.PlanVisual3dMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
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.dao.repository.*;
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.IPlanVisual3dService;
......@@ -62,6 +59,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired
private IPlanRuleDao planRuleDao;
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
@Override
public List<TreeSubjectVo> getPlanTree() {
......@@ -318,10 +318,15 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
@Transactional
public PlanRule updatePlanStep(PlanStepVo planStepVo) {
public PlanStepVo updatePlanStep(PlanStepVo planStepVo) {
// 运行中的设置为重置
List<PlanOperationRecord> planList = planOperationRecordDao.findByStatus(0);
if (!CollectionUtils.isEmpty(planList)) {
// 根据批次号查询预案步骤
PlanRule planRule = planOperationRecordMapper.getPlanRuleByBatchNo(planStepVo.getBatchNo());
planRule.setPlanStep(planStepVo.getPlanStep());
return planRuleDao.save(planRule);
planRuleDao.save(planRule);
}
return planStepVo;
}
}
......@@ -135,4 +135,5 @@ public interface IContingencyPlanService {
AtomicBoolean planReset();
Boolean getPlanStatus();
}
......@@ -71,5 +71,5 @@ public interface IPlanVisual3dService {
*/
ToipResponse getPlaneRecordOneByBatchNo(String batchNo);
PlanRule updatePlanStep(PlanStepVo planStepVo);
PlanStepVo updatePlanStep(PlanStepVo planStepVo);
}
......@@ -737,4 +737,13 @@
alter table `c_plan_rule` add column `plan_step` json DEFAULT NULL COMMENT '预案步骤';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="20220901-01">
<preConditions onFail="MARK_RAN">
<columnExists tableName="toip_rm_snapshot" columnName="method_param"/>
</preConditions>
<comment>修改属性字段 method_param</comment>
<sql>
ALTER TABLE `toip_rm_snapshot` MODIFY COLUMN `method_param` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '方法参数' AFTER `equipment_id`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
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