소스 검색

规则预警初始生成内容

zhaoxian 4 년 전
부모
커밋
bd135b39f6

+ 256 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountRelController.java

@@ -0,0 +1,256 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleAccountRel;
+import cn.com.ctop.alarm.modules.service.IRuleAccountRelService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则-账户关联表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Slf4j
+@Api(tags = "规则-账户关联表")
+@RestController
+@RequestMapping("/alarm.modules/ruleAccountRel")
+public class RuleAccountRelController {
+    @Autowired
+    private IRuleAccountRelService ruleAccountRelService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleAccountRel
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则-账户关联表-分页列表查询")
+    @ApiOperation(value = "规则-账户关联表-分页列表查询", notes = "规则-账户关联表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleAccountRel>> queryPageList(RuleAccountRel ruleAccountRel,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<RuleAccountRel>> result = new Result<>();
+        QueryWrapper<RuleAccountRel> queryWrapper = QueryGenerator.initQueryWrapper(ruleAccountRel, req.getParameterMap());
+        Page<RuleAccountRel> page = new Page<RuleAccountRel>(pageNo, pageSize);
+        IPage<RuleAccountRel> pageList = ruleAccountRelService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleAccountRel
+     * @return
+     */
+    @AutoLog(value = "规则-账户关联表-添加")
+    @ApiOperation(value = "规则-账户关联表-添加", notes = "规则-账户关联表-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleAccountRel> add(@RequestBody RuleAccountRel ruleAccountRel) {
+        Result<RuleAccountRel> result = new Result<>();
+        try {
+            ruleAccountRelService.save(ruleAccountRel);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleAccountRel
+     * @return
+     */
+    @AutoLog(value = "规则-账户关联表-编辑")
+    @ApiOperation(value = "规则-账户关联表-编辑", notes = "规则-账户关联表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleAccountRel> edit(@RequestBody RuleAccountRel ruleAccountRel) {
+        Result<RuleAccountRel> result = new Result<RuleAccountRel>();
+        RuleAccountRel ruleAccountRelEntity = ruleAccountRelService.getById(ruleAccountRel.getId());
+        if (ruleAccountRelEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleAccountRelService.updateById(ruleAccountRel);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则-账户关联表-通过id删除")
+    @ApiOperation(value = "规则-账户关联表-通过id删除", notes = "规则-账户关联表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleAccountRelService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则-账户关联表-批量删除")
+    @ApiOperation(value = "规则-账户关联表-批量删除", notes = "规则-账户关联表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleAccountRel> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleAccountRel> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleAccountRelService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则-账户关联表-通过id查询")
+    @ApiOperation(value = "规则-账户关联表-通过id查询", notes = "规则-账户关联表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleAccountRel> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleAccountRel> result = new Result<>();
+        RuleAccountRel ruleAccountRel = ruleAccountRelService.getById(id);
+        if (ruleAccountRel == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleAccountRel);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleAccountRel> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleAccountRel ruleAccountRel = JSON.parseObject(deString, RuleAccountRel.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleAccountRel, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleAccountRel> pageList = ruleAccountRelService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则-账户关联表列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleAccountRel.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则-账户关联表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleAccountRel> listRuleAccountRels = ExcelImportUtil.importExcel(file.getInputStream(), RuleAccountRel.class, params);
+                ruleAccountRelService.saveBatch(listRuleAccountRels);
+                return Result.ok("文件导入成功!数据行数:" + listRuleAccountRels.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 256 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/RuleBaseController.java

@@ -0,0 +1,256 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleBase;
+import cn.com.ctop.alarm.modules.service.IRuleBaseService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 基础规则表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Slf4j
+@Api(tags = "基础规则表")
+@RestController
+@RequestMapping("/alarm.modules/ruleBase")
+public class RuleBaseController {
+    @Autowired
+    private IRuleBaseService ruleBaseService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleBase
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "基础规则表-分页列表查询")
+    @ApiOperation(value = "基础规则表-分页列表查询", notes = "基础规则表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleBase>> queryPageList(RuleBase ruleBase,
+                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                 HttpServletRequest req) {
+        Result<IPage<RuleBase>> result = new Result<>();
+        QueryWrapper<RuleBase> queryWrapper = QueryGenerator.initQueryWrapper(ruleBase, req.getParameterMap());
+        Page<RuleBase> page = new Page<RuleBase>(pageNo, pageSize);
+        IPage<RuleBase> pageList = ruleBaseService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleBase
+     * @return
+     */
+    @AutoLog(value = "基础规则表-添加")
+    @ApiOperation(value = "基础规则表-添加", notes = "基础规则表-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleBase> add(@RequestBody RuleBase ruleBase) {
+        Result<RuleBase> result = new Result<>();
+        try {
+            ruleBaseService.save(ruleBase);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleBase
+     * @return
+     */
+    @AutoLog(value = "基础规则表-编辑")
+    @ApiOperation(value = "基础规则表-编辑", notes = "基础规则表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleBase> edit(@RequestBody RuleBase ruleBase) {
+        Result<RuleBase> result = new Result<RuleBase>();
+        RuleBase ruleBaseEntity = ruleBaseService.getById(ruleBase.getId());
+        if (ruleBaseEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleBaseService.updateById(ruleBase);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "基础规则表-通过id删除")
+    @ApiOperation(value = "基础规则表-通过id删除", notes = "基础规则表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleBaseService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "基础规则表-批量删除")
+    @ApiOperation(value = "基础规则表-批量删除", notes = "基础规则表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleBase> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleBase> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleBaseService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "基础规则表-通过id查询")
+    @ApiOperation(value = "基础规则表-通过id查询", notes = "基础规则表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleBase> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleBase> result = new Result<>();
+        RuleBase ruleBase = ruleBaseService.getById(id);
+        if (ruleBase == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleBase);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleBase> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleBase ruleBase = JSON.parseObject(deString, RuleBase.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleBase, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleBase> pageList = ruleBaseService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "基础规则表列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleBase.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("基础规则表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleBase> listRuleBases = ExcelImportUtil.importExcel(file.getInputStream(), RuleBase.class, params);
+                ruleBaseService.saveBatch(listRuleBases);
+                return Result.ok("文件导入成功!数据行数:" + listRuleBases.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 256 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/RuleDetailController.java

@@ -0,0 +1,256 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleDetail;
+import cn.com.ctop.alarm.modules.service.IRuleDetailService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则详情表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Slf4j
+@Api(tags = "规则详情表")
+@RestController
+@RequestMapping("/alarm.modules/ruleDetail")
+public class RuleDetailController {
+    @Autowired
+    private IRuleDetailService ruleDetailService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleDetail
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则详情表-分页列表查询")
+    @ApiOperation(value = "规则详情表-分页列表查询", notes = "规则详情表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleDetail>> queryPageList(RuleDetail ruleDetail,
+                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                   HttpServletRequest req) {
+        Result<IPage<RuleDetail>> result = new Result<>();
+        QueryWrapper<RuleDetail> queryWrapper = QueryGenerator.initQueryWrapper(ruleDetail, req.getParameterMap());
+        Page<RuleDetail> page = new Page<RuleDetail>(pageNo, pageSize);
+        IPage<RuleDetail> pageList = ruleDetailService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleDetail
+     * @return
+     */
+    @AutoLog(value = "规则详情表-添加")
+    @ApiOperation(value = "规则详情表-添加", notes = "规则详情表-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleDetail> add(@RequestBody RuleDetail ruleDetail) {
+        Result<RuleDetail> result = new Result<>();
+        try {
+            ruleDetailService.save(ruleDetail);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleDetail
+     * @return
+     */
+    @AutoLog(value = "规则详情表-编辑")
+    @ApiOperation(value = "规则详情表-编辑", notes = "规则详情表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleDetail> edit(@RequestBody RuleDetail ruleDetail) {
+        Result<RuleDetail> result = new Result<RuleDetail>();
+        RuleDetail ruleDetailEntity = ruleDetailService.getById(ruleDetail.getId());
+        if (ruleDetailEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleDetailService.updateById(ruleDetail);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则详情表-通过id删除")
+    @ApiOperation(value = "规则详情表-通过id删除", notes = "规则详情表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleDetailService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则详情表-批量删除")
+    @ApiOperation(value = "规则详情表-批量删除", notes = "规则详情表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleDetail> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleDetail> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleDetailService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则详情表-通过id查询")
+    @ApiOperation(value = "规则详情表-通过id查询", notes = "规则详情表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleDetail> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleDetail> result = new Result<>();
+        RuleDetail ruleDetail = ruleDetailService.getById(id);
+        if (ruleDetail == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleDetail);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleDetail> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleDetail ruleDetail = JSON.parseObject(deString, RuleDetail.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleDetail, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleDetail> pageList = ruleDetailService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则详情表列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleDetail.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则详情表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleDetail> listRuleDetails = ExcelImportUtil.importExcel(file.getInputStream(), RuleDetail.class, params);
+                ruleDetailService.saveBatch(listRuleDetails);
+                return Result.ok("文件导入成功!数据行数:" + listRuleDetails.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 256 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/RuleIndicatorController.java

@@ -0,0 +1,256 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleIndicator;
+import cn.com.ctop.alarm.modules.service.IRuleIndicatorService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则指标信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Slf4j
+@Api(tags = "规则指标信息")
+@RestController
+@RequestMapping("/alarm.modules/ruleIndicator")
+public class RuleIndicatorController {
+    @Autowired
+    private IRuleIndicatorService ruleIndicatorService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleIndicator
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-分页列表查询")
+    @ApiOperation(value = "规则指标信息-分页列表查询", notes = "规则指标信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleIndicator>> queryPageList(RuleIndicator ruleIndicator,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<RuleIndicator>> result = new Result<>();
+        QueryWrapper<RuleIndicator> queryWrapper = QueryGenerator.initQueryWrapper(ruleIndicator, req.getParameterMap());
+        Page<RuleIndicator> page = new Page<RuleIndicator>(pageNo, pageSize);
+        IPage<RuleIndicator> pageList = ruleIndicatorService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleIndicator
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-添加")
+    @ApiOperation(value = "规则指标信息-添加", notes = "规则指标信息-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleIndicator> add(@RequestBody RuleIndicator ruleIndicator) {
+        Result<RuleIndicator> result = new Result<>();
+        try {
+            ruleIndicatorService.save(ruleIndicator);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleIndicator
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-编辑")
+    @ApiOperation(value = "规则指标信息-编辑", notes = "规则指标信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleIndicator> edit(@RequestBody RuleIndicator ruleIndicator) {
+        Result<RuleIndicator> result = new Result<RuleIndicator>();
+        RuleIndicator ruleIndicatorEntity = ruleIndicatorService.getById(ruleIndicator.getId());
+        if (ruleIndicatorEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleIndicatorService.updateById(ruleIndicator);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-通过id删除")
+    @ApiOperation(value = "规则指标信息-通过id删除", notes = "规则指标信息-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleIndicatorService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-批量删除")
+    @ApiOperation(value = "规则指标信息-批量删除", notes = "规则指标信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleIndicator> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleIndicator> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleIndicatorService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-通过id查询")
+    @ApiOperation(value = "规则指标信息-通过id查询", notes = "规则指标信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleIndicator> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleIndicator> result = new Result<>();
+        RuleIndicator ruleIndicator = ruleIndicatorService.getById(id);
+        if (ruleIndicator == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleIndicator);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleIndicator> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleIndicator ruleIndicator = JSON.parseObject(deString, RuleIndicator.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleIndicator, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleIndicator> pageList = ruleIndicatorService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则指标信息列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleIndicator.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则指标信息列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleIndicator> listRuleIndicators = ExcelImportUtil.importExcel(file.getInputStream(), RuleIndicator.class, params);
+                ruleIndicatorService.saveBatch(listRuleIndicators);
+                return Result.ok("文件导入成功!数据行数:" + listRuleIndicators.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 81 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/RuleAccountRel.java

@@ -0,0 +1,81 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则-账户关联表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Data
+@TableName("ctop_rule_account_rel")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_account_rel对象", description = "规则-账户关联表")
+public class RuleAccountRel {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Integer ruleId;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Integer accountId;
+    /**
+     * 规则类型  group 组合 base 单条
+     */
+    @Excel(name = "规则类型  group 组合 base 单条", width = 15)
+    @ApiModelProperty(value = "规则类型  group 组合 base 单条")
+    private String ruleType;
+    /**
+     * 规则关系 当rule_type 为group时必填 and同时命中  or 命中一条
+     */
+    @Excel(name = "规则关系 当rule_type 为group时必填 and同时命中  or 命中一条", width = 15)
+    @ApiModelProperty(value = "规则关系 当rule_type 为group时必填 and同时命中  or 命中一条")
+    private String ruleRelationship;
+    /**
+     * 规则维度,ACCOUNT:账户级、CAMPAIGN:计划级、UNIT:组级、CREATIVE:创意
+     */
+    @Excel(name = "规则维度,ACCOUNT:账户级、CAMPAIGN:计划级、UNIT:组级、CREATIVE:创意", width = 15)
+    @ApiModelProperty(value = "规则维度,ACCOUNT:账户级、CAMPAIGN:计划级、UNIT:组级、CREATIVE:创意")
+    private String ruleDimension;
+    /**
+     * 操作,SEND发送,PAUSE关停并发送
+     */
+    @Excel(name = "操作,SEND发送,PAUSE关停并发送", width = 15)
+    @ApiModelProperty(value = "操作,SEND发送,PAUSE关停并发送")
+    private String operation;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 75 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/RuleBase.java

@@ -0,0 +1,75 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 基础规则表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Data
+@TableName("ctop_rule_base")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_base对象", description = "基础规则表")
+public class RuleBase {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Integer ruleId;
+    /**
+     * 1:头条2:快手
+     */
+    @Excel(name = "1:头条2:快手", width = 15)
+    @ApiModelProperty(value = "1:头条2:快手")
+    private Integer mediaType;
+    /**
+     * 规则名称
+     */
+    @Excel(name = "规则名称", width = 15)
+    @ApiModelProperty(value = "规则名称")
+    private String ruleName;
+    /**
+     * 指标code
+     */
+    @Excel(name = "指标code", width = 15)
+    @ApiModelProperty(value = "指标code")
+    private String indicatorCode;
+    /**
+     * 规则维度,ACCOUNT:账户级、CAMPAIGN:计划级、UNIT:组级、CREATIVE:创意
+     */
+    @Excel(name = "规则维度,ACCOUNT:账户级、CAMPAIGN:计划级、UNIT:组级、CREATIVE:创意", width = 15)
+    @ApiModelProperty(value = "规则维度,ACCOUNT:账户级、CAMPAIGN:计划级、UNIT:组级、CREATIVE:创意")
+    private String ruleDimension;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 75 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/RuleDetail.java

@@ -0,0 +1,75 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则详情表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Data
+@TableName("ctop_rule_detail")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_detail对象", description = "规则详情表")
+public class RuleDetail {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Integer ruleId;
+    /**
+     * 账户规则关联id
+     */
+    @Excel(name = "账户规则关联id", width = 15)
+    @ApiModelProperty(value = "账户规则关联id")
+    private Integer ruleAccountId;
+    /**
+     * 条件: 大于 等于 小于
+     */
+    @Excel(name = "条件: 大于 等于 小于", width = 15)
+    @ApiModelProperty(value = "条件: 大于 等于 小于")
+    private String condition;
+    /**
+     * 阈值
+     */
+    @Excel(name = "阈值", width = 15)
+    @ApiModelProperty(value = "阈值")
+    private String threshold;
+    /**
+     * 排序,执行顺序
+     */
+    @Excel(name = "排序,执行顺序", width = 15)
+    @ApiModelProperty(value = "排序,执行顺序")
+    private Integer sort;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 105 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/RuleIndicator.java

@@ -0,0 +1,105 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则指标信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Data
+@TableName("ctop_rule_indicator")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_indicator对象", description = "规则指标信息")
+public class RuleIndicator {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * 1:头条2:快手
+     */
+    @Excel(name = "1:头条2:快手", width = 15)
+    @ApiModelProperty(value = "1:头条2:快手")
+    private Integer mediaType;
+    /**
+     * 指标名称
+     */
+    @Excel(name = "指标名称", width = 15)
+    @ApiModelProperty(value = "指标名称")
+    private String name;
+    /**
+     * 指标code(数据库字段名称)
+     */
+    @Excel(name = "指标code(数据库字段名称)", width = 15)
+    @ApiModelProperty(value = "指标code(数据库字段名称)")
+    private String code;
+    /**
+     * 数据类型
+     */
+    @Excel(name = "数据类型", width = 15)
+    @ApiModelProperty(value = "数据类型")
+    private String dataType;
+    /**
+     * 数据单位
+     */
+    @Excel(name = "数据单位", width = 15)
+    @ApiModelProperty(value = "数据单位")
+    private String dataUnit;
+    /**
+     * 数据维度
+     */
+    @Excel(name = "数据维度", width = 15)
+    @ApiModelProperty(value = "数据维度")
+    private String dimension;
+    /**
+     * 对应数据字典id
+     */
+    @Excel(name = "对应数据字典id", width = 15)
+    @ApiModelProperty(value = "对应数据字典id")
+    private String dictId;
+    /**
+     * 对应数据表名称
+     */
+    @Excel(name = "对应数据表名称", width = 15)
+    @ApiModelProperty(value = "对应数据表名称")
+    private String tableName;
+    /**
+     * status
+     */
+    @Excel(name = "status", width = 15)
+    @ApiModelProperty(value = "status")
+    private Integer status;
+    /**
+     * sort
+     */
+    @Excel(name = "sort", width = 15)
+    @ApiModelProperty(value = "sort")
+    private Integer sort;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 15 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/RuleAccountRelMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import cn.com.ctop.alarm.modules.entity.RuleAccountRel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 规则-账户关联表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-11-14
+ * @cersion: V1.0
+ */
+public interface RuleAccountRelMapper extends BaseMapper<RuleAccountRel> {
+
+}

+ 15 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/RuleBaseMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import cn.com.ctop.alarm.modules.entity.RuleBase;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 基础规则表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-11-14
+ * @cersion: V1.0
+ */
+public interface RuleBaseMapper extends BaseMapper<RuleBase> {
+
+}

+ 15 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/RuleDetailMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import cn.com.ctop.alarm.modules.entity.RuleDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 规则详情表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-11-14
+ * @cersion: V1.0
+ */
+public interface RuleDetailMapper extends BaseMapper<RuleDetail> {
+
+}

+ 15 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/RuleIndicatorMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import cn.com.ctop.alarm.modules.entity.RuleIndicator;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 规则指标信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-11-14
+ * @cersion: V1.0
+ */
+public interface RuleIndicatorMapper extends BaseMapper<RuleIndicator> {
+
+}