|
@@ -33,6 +33,37 @@ public class DisPlanLibraryController {
|
|
|
return AjaxResult.success(service.listAll());
|
|
return AjaxResult.success(service.listAll());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/save")
|
|
|
|
|
+ @ApiOperation("新增/编辑模板(按 id 判空)")
|
|
|
|
|
+ @Log(title = "预案模板保存", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ public AjaxResult save(@RequestBody com.zksy.dispatch.domain.DisPlanLibrary entity) {
|
|
|
|
|
+ if (entity == null || org.apache.commons.lang3.StringUtils.isBlank(entity.getPlanName())) {
|
|
|
|
|
+ return AjaxResult.error("请输入模板名称");
|
|
|
|
|
+ }
|
|
|
|
|
+ java.time.LocalDateTime now = java.time.LocalDateTime.now();
|
|
|
|
|
+ if (entity.getId() == null) {
|
|
|
|
|
+ entity.setCreateBy(currentUser());
|
|
|
|
|
+ try {
|
|
|
|
|
+ entity.setCreateUserId(com.zksy.common.utils.SecurityUtils.getUserId());
|
|
|
|
|
+ } catch (Exception ignored) {
|
|
|
|
|
+ // 匿名上下文无用户ID
|
|
|
|
|
+ }
|
|
|
|
|
+ entity.setCreateTime(now);
|
|
|
|
|
+ }
|
|
|
|
|
+ entity.setUpdateTime(now);
|
|
|
|
|
+ entity.setDelFlag("0");
|
|
|
|
|
+ service.saveOrUpdate(entity);
|
|
|
|
|
+ return AjaxResult.success(entity);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
|
|
+ @ApiOperation("删除模板")
|
|
|
|
|
+ @Log(title = "预案模板删除", businessType = BusinessType.DELETE)
|
|
|
|
|
+ public AjaxResult remove(@PathVariable Long id) {
|
|
|
|
|
+ service.removeById(id);
|
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@PostMapping("/match")
|
|
@PostMapping("/match")
|
|
|
@ApiOperation("按事件条件加权匹配预案")
|
|
@ApiOperation("按事件条件加权匹配预案")
|
|
|
@Log(title = "匹配应急预案", businessType = BusinessType.OTHER)
|
|
@Log(title = "匹配应急预案", businessType = BusinessType.OTHER)
|