Commit c21a77b1 authored by KeYong's avatar KeYong

预案重置功能

parent 0e1545c7
......@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@RestController
@RequestMapping("/api/contingencyPlan")
......@@ -224,4 +225,11 @@ public class ContingencyPlanController extends BaseController {
return CommonResponseUtil2.success(List);
}
@ApiOperation(value = "预案重置")
@RequestMapping(value = "/reset", method = RequestMethod.GET)
public ResponseModel planReset() {
AtomicBoolean bool = contingencyPlanService.planReset();
return CommonResponseUtil2.success(bool);
}
}
......@@ -49,4 +49,6 @@ public interface PlanDetailMapper {
PlanDetailVo getPlanDetailByEquipmentId(@Param("fireEquipmentId") Long fireEquipmentId);
Integer planReset();
}
......@@ -36,6 +36,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* @program: YeeAmosFireAutoSysRoot
......@@ -673,4 +674,16 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
@Override
public AtomicBoolean planReset() {
AtomicBoolean bool = new AtomicBoolean(true);
try {
planDetailMapper.planReset();
} catch (Exception e) {
bool.set(false);
e.printStackTrace();
}
return bool;
}
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* @author wjk
......@@ -130,4 +131,6 @@ public interface IContingencyPlanService {
Page recordListByPage(Page page, Long planId, String planName, List<Long> classifyId, Date startTimeLeft, Date startTimeRight, Integer executionType, Integer planPattern);
AtomicBoolean planReset();
}
......@@ -133,4 +133,9 @@
and d.is_delete = false
limit 1
</select>
<update id="planReset">
UPDATE c_plan_detail SET `status` = 2;
UPDATE c_plan_operation_record SET `status`=1;
</update>
</mapper>
\ 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