+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.controller;
+
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
+import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
+import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
+import com.elink.esua.epdc.dto.KpiRuleDTO;
+import com.elink.esua.epdc.dto.form.KpiRuleSaveOrUpdateFormDTO;
+import com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO;
+import com.elink.esua.epdc.excel.KpiRuleExcel;
+import com.elink.esua.epdc.service.KpiRuleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 考核规则表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@RestController
+@RequestMapping("kpirule")
+public class KpiRuleController {
+
+ @Autowired
+ private KpiRuleService kpiRuleService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params) {
+ PageData page = kpiRuleService.page(params);
+ return new Result>().ok(page);
+ }
+
+ /*@GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ KpiRuleDTO data = kpiRuleService.get(id);
+ return new Result().ok(data);
+ }*/
+
+ @PostMapping
+ public Result save(@RequestBody KpiRuleDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ kpiRuleService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody KpiRuleDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ kpiRuleService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids) {
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ kpiRuleService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = kpiRuleService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, KpiRuleExcel.class);
+ }
+
+ /**
+ * @param params
+ * @return com.elink.esua.epdc.commons.tools.utils.Result>
+ * @Author yinzuomei
+ * @Description 列表查询
+ * @Date 2019/11/27 13:22
+ **/
+ @GetMapping("query")
+ public Result> query(@RequestParam Map params) {
+ PageData page = kpiRuleService.query(params);
+ return new Result>().ok(page);
+ }
+
+ /**
+ * @param id
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @Author yinzuomei
+ * @Description 查询详情
+ * @Date 2019/11/27 15:17
+ **/
+ @GetMapping("{id}")
+ public Result queryDetailInfo(@PathVariable("id") String id) {
+ KpiRuleQueryResultDTO data = kpiRuleService.queryDetailInfo(id);
+ return new Result().ok(data);
+ }
+
+ /**
+ * @param dto
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @Author yinzuomei
+ * @Description 新增
+ * @Date 2019/11/27 16:23
+ **/
+ @PostMapping("saveOrUpdate")
+ public Result add(@RequestBody KpiRuleSaveOrUpdateFormDTO dto) {
+ return kpiRuleService.add(dto);
+ }
+
+ /**
+ * @param dto
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @Author yinzuomei
+ * @Description 修改
+ * @Date 2019/11/27 16:20
+ **/
+ @PutMapping("saveOrUpdate")
+ public Result edit(@RequestBody KpiRuleSaveOrUpdateFormDTO dto) {
+ return kpiRuleService.edit(dto);
+ }
+}
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java
new file mode 100644
index 000000000..ce1c501e3
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.controller;
+
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
+import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
+import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
+import com.elink.esua.epdc.dto.KpiRuleParamDTO;
+import com.elink.esua.epdc.excel.KpiRuleParamExcel;
+import com.elink.esua.epdc.service.KpiRuleParamService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 公式参数表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@RestController
+@RequestMapping("kpiruleparam")
+public class KpiRuleParamController {
+
+ @Autowired
+ private KpiRuleParamService kpiRuleParamService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params) {
+ PageData page = kpiRuleParamService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id) {
+ KpiRuleParamDTO data = kpiRuleParamService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody KpiRuleParamDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ kpiRuleParamService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody KpiRuleParamDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ kpiRuleParamService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids) {
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ kpiRuleParamService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = kpiRuleParamService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, KpiRuleParamExcel.class);
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java
index 9aa5512f0..a08084cef 100644
--- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java
@@ -17,10 +17,13 @@
package com.elink.esua.epdc.dao;
+import com.elink.esua.epdc.dto.result.KpiFormulaDictResultDTO;
import com.elink.esua.epdc.entity.KpiFormulaEntity;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 绩效考核公式
*
@@ -30,4 +33,12 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface KpiFormulaDao extends BaseDao {
+ /**
+ * @param
+ * @return java.util.List
+ * @Author yinzuomei
+ * @Description 获取公式id、公式名称供下拉框使用
+ * @Date 2019/11/27 14:11
+ **/
+ List selectListKpiFormulaDictResultDTO();
}
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java
new file mode 100644
index 000000000..a100c7f48
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.dao;
+
+import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
+import com.elink.esua.epdc.dto.KpiRuleParamDTO;
+import com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO;
+import com.elink.esua.epdc.entity.KpiRuleEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 考核规则表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Mapper
+public interface KpiRuleDao extends BaseDao {
+
+ /**
+ * @param params
+ * @return java.util.List
+ * @Author yinzuomei
+ * @Description 列表查询
+ * @Date 2019/11/27 13:32
+ **/
+ List selectListKpiRuleQueryResultDTO(Map params);
+
+ /**
+ * @param ruleId
+ * @return java.util.List
+ * @Author yinzuomei
+ * @Description 根据规则id查询公式参数表
+ * @Date 2019/11/27 15:32
+ **/
+ List selectKpiRuleParamInfoDTO(String ruleId);
+
+ /**
+ * @param id 考核规则表主键
+ * @return com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO
+ * @Author yinzuomei
+ * @Description 查询详情
+ * @Date 2019/11/27 15:19
+ **/
+ KpiRuleQueryResultDTO queryDetailInfo(String id);
+}
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java
new file mode 100644
index 000000000..bd585ed2d
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.dao;
+
+import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
+import com.elink.esua.epdc.entity.KpiRuleParamEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 公式参数表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Mapper
+public interface KpiRuleParamDao extends BaseDao {
+
+ /**
+ * @param id 规则ID
+ * @return int
+ * @Author yinzuomei
+ * @Description 根据规则id删除公式参数表记录
+ * @Date 2019/11/27 16:36
+ **/
+ int deleteByRuleId(String id);
+}
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleEntity.java
new file mode 100644
index 000000000..ac74b1332
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleEntity.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 考核规则表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("epdc_kpi_rule")
+public class KpiRuleEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 考核规则名称
+ */
+ private String ruleName;
+
+ /**
+ * 考核规则编码
+ */
+ private String ruleCode;
+
+ /**
+ * 规则生成方式(0-元公式,1-手工打分,2-投票)
+ */
+ private String ruleMode;
+
+ /**
+ * 引用ID(公式id、投票等)
+ */
+ private String referenceId;
+
+ /**
+ * 考核周期(字典值)
+ */
+ private String kpiCycle;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleParamEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleParamEntity.java
new file mode 100644
index 000000000..697ab16c3
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleParamEntity.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 公式参数表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("epdc_kpi_rule_param")
+public class KpiRuleParamEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 规则ID
+ */
+ private String ruleId;
+
+ /**
+ * 元数据编码(数据字典值)
+ */
+ private String metaDataCode;
+
+ /**
+ * 参数顺序
+ */
+ private Integer sort;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleExcel.java
new file mode 100644
index 000000000..e27551cbc
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleExcel.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 考核规则表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Data
+public class KpiRuleExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "考核规则名称")
+ private String ruleName;
+
+ @Excel(name = "考核规则编码")
+ private String ruleCode;
+
+ @Excel(name = "规则生成方式(0-元公式,1-手工打分,2-投票)")
+ private String ruleMode;
+
+ @Excel(name = "引用ID(公式id、投票等)")
+ private String referenceId;
+
+ @Excel(name = "考核周期(字典值)")
+ private String kpiCycle;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+ @Excel(name = "删除标记")
+ private String delFlag;
+
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleParamExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleParamExcel.java
new file mode 100644
index 000000000..6d982ba47
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleParamExcel.java
@@ -0,0 +1,65 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 公式参数表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Data
+public class KpiRuleParamExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "规则ID")
+ private String ruleId;
+
+ @Excel(name = "元数据编码(数据字典值)")
+ private String metaDataCode;
+
+ @Excel(name = "参数顺序")
+ private Integer sort;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+ @Excel(name = "删除标记")
+ private String delFlag;
+
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleParamRedis.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleParamRedis.java
new file mode 100644
index 000000000..bfe4f8e47
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleParamRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.redis;
+
+import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 公式参数表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Component
+public class KpiRuleParamRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleRedis.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleRedis.java
new file mode 100644
index 000000000..7f60563cc
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
+import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
+import com.elink.esua.epdc.dao.KpiRuleParamDao;
+import com.elink.esua.epdc.dto.KpiRuleParamDTO;
+import com.elink.esua.epdc.entity.KpiRuleParamEntity;
+import com.elink.esua.epdc.redis.KpiRuleParamRedis;
+import com.elink.esua.epdc.service.KpiRuleParamService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 公式参数表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-27
+ */
+@Service
+public class KpiRuleParamServiceImpl extends BaseServiceImpl implements KpiRuleParamService {
+
+ @Autowired
+ private KpiRuleParamRedis kpiRuleParamRedis;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, KpiRuleParamDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, KpiRuleParamDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public KpiRuleParamDTO get(String id) {
+ KpiRuleParamEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, KpiRuleParamDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(KpiRuleParamDTO dto) {
+ KpiRuleParamEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleParamEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(KpiRuleParamDTO dto) {
+ KpiRuleParamEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleParamEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java
new file mode 100644
index 000000000..d6058c737
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java
@@ -0,0 +1,225 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *