From 7f1c9f1a5f92640af7a26e11912e981d05f365cf Mon Sep 17 00:00:00 2001 From: yinzuomei Date: Thu, 28 Nov 2019 09:50:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E6=A0=B8=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/elink/esua/epdc/dto/KpiRuleDTO.java | 97 ++++++++ .../elink/esua/epdc/dto/KpiRuleParamDTO.java | 87 +++++++ .../dto/form/KpiRuleSaveOrUpdateFormDTO.java | 82 +++++++ .../dto/result/KpiFormulaDictResultDTO.java | 29 +++ .../dto/result/KpiRuleQueryResultDTO.java | 87 +++++++ .../epdc/controller/KpiFormulaController.java | 85 ++++--- .../epdc/controller/KpiRuleController.java | 145 +++++++++++ .../controller/KpiRuleParamController.java | 94 ++++++++ .../elink/esua/epdc/dao/KpiFormulaDao.java | 11 + .../com/elink/esua/epdc/dao/KpiRuleDao.java | 64 +++++ .../elink/esua/epdc/dao/KpiRuleParamDao.java | 41 ++++ .../elink/esua/epdc/entity/KpiRuleEntity.java | 66 +++++ .../esua/epdc/entity/KpiRuleParamEntity.java | 56 +++++ .../elink/esua/epdc/excel/KpiRuleExcel.java | 71 ++++++ .../esua/epdc/excel/KpiRuleParamExcel.java | 65 +++++ .../esua/epdc/redis/KpiRuleParamRedis.java | 47 ++++ .../elink/esua/epdc/redis/KpiRuleRedis.java | 47 ++++ .../esua/epdc/service/KpiFormulaService.java | 134 ++++++----- .../epdc/service/KpiRuleParamService.java | 95 ++++++++ .../esua/epdc/service/KpiRuleService.java | 134 +++++++++++ .../service/impl/KpiFormulaServiceImpl.java | 37 ++- .../service/impl/KpiRuleParamServiceImpl.java | 104 ++++++++ .../epdc/service/impl/KpiRuleServiceImpl.java | 225 ++++++++++++++++++ .../main/resources/mapper/KpiFormulaDao.xml | 14 +- .../src/main/resources/mapper/KpiRuleDao.xml | 126 ++++++++++ .../main/resources/mapper/KpiRuleParamDao.xml | 22 ++ 26 files changed, 1958 insertions(+), 107 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleDTO.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleParamDTO.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiFormulaDictResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleEntity.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiRuleParamEntity.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleExcel.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiRuleParamExcel.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleParamRedis.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiRuleRedis.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleParamService.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleParamServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml create mode 100644 esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleDTO.java new file mode 100644 index 000000000..3218725e7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleDTO.java @@ -0,0 +1,97 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; + + +/** + * 考核规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-27 + */ +@Data +public class KpiRuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 考核规则名称 + */ + private String ruleName; + + /** + * 考核规则编码 + */ + private String ruleCode; + + /** + * 规则生成方式(0-元公式,1-手工打分,2-投票) + */ + private String ruleMode; + + /** + * 引用ID(公式id、投票等) + */ + private String referenceId; + + /** + * 考核周期(字典值) + */ + private String kpiCycle; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleParamDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleParamDTO.java new file mode 100644 index 000000000..255d605bb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiRuleParamDTO.java @@ -0,0 +1,87 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; + + +/** + * 公式参数表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-27 + */ +@Data +public class KpiRuleParamDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 规则ID + */ + private String ruleId; + + /** + * 元数据编码(数据字典值) + */ + private String metaDataCode; + + /** + * 参数顺序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java new file mode 100644 index 000000000..67861a16c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java @@ -0,0 +1,82 @@ +package com.elink.esua.epdc.dto.form; + +import com.elink.esua.epdc.dto.KpiRuleParamDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description 新增、修改考核规则入参DTO + * @Author yinzuomei + * @Date 2019/11/27 16:21 + */ +@Data +public class KpiRuleSaveOrUpdateFormDTO implements Serializable { + private static final long serialVersionUID = 6944783947114092507L; + /** + * 主键 + */ + private String id; + + /** + * 考核规则名称 + */ + private String ruleName; + + /** + * 考核规则编码 + */ + private String ruleCode; + + /** + * 规则生成方式(0-元公式,1-手工打分,2-投票) + */ + private String ruleMode; + + /** + * 引用ID(公式id、投票等) + */ + private String referenceId; + + /** + * 考核周期(字典值) + */ + private String kpiCycle; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 公式参数表 + */ + private List ruleParamList; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiFormulaDictResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiFormulaDictResultDTO.java new file mode 100644 index 000000000..db3d4ef30 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiFormulaDictResultDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 新增考核规则界面[引用]下拉框 + * @Author yinzuomei + * @Date 2019/11/27 14:00 + */ +@Data +public class KpiFormulaDictResultDTO implements Serializable { + private static final long serialVersionUID = -51706543080866619L; + /** + * 主键 + */ + private String id; + + /** + * 公式名称 + */ + private String formulaName; + + /** + * 公式参数数量 + */ + private Integer paramAmount; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java new file mode 100644 index 000000000..105246b6f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java @@ -0,0 +1,87 @@ +package com.elink.esua.epdc.dto.result; + +import com.elink.esua.epdc.dto.KpiRuleParamDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description 考核规则列表查询返参DTO + * @Author yinzuomei + * @Date 2019/11/27 13:23 + */ +@Data +public class KpiRuleQueryResultDTO implements Serializable { + private static final long serialVersionUID = 8268124759182327315L; + /** + * 主键 + */ + private String id; + + /** + * 考核规则名称 + */ + private String ruleName; + + /** + * 考核规则编码 + */ + private String ruleCode; + + /** + * 规则生成方式(0-元公式,1-手工打分,2-投票) + */ + private String ruleMode; + + /** + * 引用ID(公式id、投票等) + */ + private String referenceId; + + /** + * 考核周期(字典值) + */ + private String kpiCycle; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 引用名称 + */ + private String referenceName; + + /** + * 参数集合 + */ + private List ruleParamList; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java index 45f0ea8e2..853f50dcc 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.dto.KpiFormulaDTO; +import com.elink.esua.epdc.dto.result.KpiFormulaDictResultDTO; import com.elink.esua.epdc.excel.KpiFormulaExcel; import com.elink.esua.epdc.service.KpiFormulaService; import com.elink.esua.epdc.commons.tools.page.PageData; @@ -46,48 +47,58 @@ import java.util.Map; @RequestMapping("kpiformula") public class KpiFormulaController { - @Autowired - private KpiFormulaService kpiFormulaService; + @Autowired + private KpiFormulaService kpiFormulaService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = kpiFormulaService.page(params); - return new Result>().ok(page); - } + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = kpiFormulaService.page(params); + return new Result>().ok(page); + } - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - KpiFormulaDTO data = kpiFormulaService.get(id); - return new Result().ok(data); - } + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + KpiFormulaDTO data = kpiFormulaService.get(id); + return new Result().ok(data); + } - @PostMapping - public Result save(@RequestBody KpiFormulaDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - //kpiFormulaService.save(dto); - return kpiFormulaService.saveKpiFormula(dto); - } + @PostMapping + public Result save(@RequestBody KpiFormulaDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + //kpiFormulaService.save(dto); + return kpiFormulaService.saveKpiFormula(dto); + } - @PutMapping - public Result update(@RequestBody KpiFormulaDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - return kpiFormulaService.update(dto); - } + @PutMapping + public Result update(@RequestBody KpiFormulaDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return kpiFormulaService.update(dto); + } - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - kpiFormulaService.delete(ids); - return new Result(); - } + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + return kpiFormulaService.delete(ids); + } - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = kpiFormulaService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, KpiFormulaExcel.class); - } + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = kpiFormulaService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, KpiFormulaExcel.class); + } + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取公式id、公式名称供下拉框使用 + * @Date 2019/11/27 14:02 + **/ + @GetMapping("getKpiFormulaList") + public Result> getKpiFormulaList() { + return kpiFormulaService.listKpiFormulaDictResultDTO(); + } } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java new file mode 100644 index 000000000..b4e21fa30 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java @@ -0,0 +1,145 @@ +/** + * 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.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. + *

+ * 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 KpiRuleRedis { + @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/service/KpiFormulaService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiFormulaService.java index f354275eb..0bd61c864 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiFormulaService.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiFormulaService.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.KpiFormulaDTO; +import com.elink.esua.epdc.dto.result.KpiFormulaDictResultDTO; import com.elink.esua.epdc.entity.KpiFormulaEntity; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; @@ -35,72 +36,81 @@ import java.util.Map; */ public interface KpiFormulaService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2019-11-26 - */ - PageData page(Map params); + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-26 + */ + PageData page(Map params); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2019-11-26 - */ - List list(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-26 + */ + List list(Map params); - /** - * 单条查询 - * - * @param id - * @return KpiFormulaDTO - * @author generator - * @date 2019-11-26 - */ - KpiFormulaDTO get(String id); + /** + * 单条查询 + * + * @param id + * @return KpiFormulaDTO + * @author generator + * @date 2019-11-26 + */ + KpiFormulaDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2019-11-26 - */ - void save(KpiFormulaDTO dto); + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-26 + */ + void save(KpiFormulaDTO dto); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2019-11-26 - */ - Result update(KpiFormulaDTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-26 + */ + Result update(KpiFormulaDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2019-11-26 - */ - void delete(String[] ids); + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-26 + */ + Result delete(String[] ids); - /** - * @param dto - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 新增 - * @Date 2019/11/26 17:14 - **/ - Result saveKpiFormula(KpiFormulaDTO dto); + /** + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 新增 + * @Date 2019/11/26 17:14 + **/ + Result saveKpiFormula(KpiFormulaDTO dto); + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取公式id、公式名称供下拉框使用 + * @Date 2019/11/27 14:02 + **/ + Result> listKpiFormulaDictResultDTO(); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleParamService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleParamService.java new file mode 100644 index 000000000..c064f98dd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleParamService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.KpiRuleParamDTO; +import com.elink.esua.epdc.entity.KpiRuleParamEntity; + +import java.util.List; +import java.util.Map; + +/** + * 公式参数表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-27 + */ +public interface KpiRuleParamService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return KpiRuleParamDTO + * @author generator + * @date 2019-11-27 + */ + KpiRuleParamDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-27 + */ + void save(KpiRuleParamDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-27 + */ + void update(KpiRuleParamDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-27 + */ + void delete(String[] ids); +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java new file mode 100644 index 000000000..5b0a41a28 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java @@ -0,0 +1,134 @@ +/** + * 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.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +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.entity.KpiRuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 考核规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-27 + */ +public interface KpiRuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return KpiRuleDTO + * @author generator + * @date 2019-11-27 + */ + KpiRuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-27 + */ + void save(KpiRuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-27 + */ + void update(KpiRuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-27 + */ + void delete(String[] ids); + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Author yinzuomei + * @Description 列表查询 + * @Date 2019/11/27 13:29 + **/ + PageData query(Map params); + + /** + * @param id 考核规则表主键 + * @return com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO + * @Author yinzuomei + * @Description 查询详情 + * @Date 2019/11/27 15:17 + **/ + KpiRuleQueryResultDTO queryDetailInfo(String id); + + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 新增 + * @Date 2019/11/27 16:27 + **/ + Result add(KpiRuleSaveOrUpdateFormDTO dto); + + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 修改 + * @Date 2019/11/27 16:27 + **/ + Result edit(KpiRuleSaveOrUpdateFormDTO dto); +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java index 529fffdcd..80e4fd086 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java @@ -19,16 +19,19 @@ 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.constant.FieldConstant; +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.utils.Result; import com.elink.esua.epdc.dao.KpiFormulaDao; +import com.elink.esua.epdc.dao.KpiRuleDao; import com.elink.esua.epdc.dto.KpiFormulaDTO; +import com.elink.esua.epdc.dto.result.KpiFormulaDictResultDTO; import com.elink.esua.epdc.entity.KpiFormulaEntity; +import com.elink.esua.epdc.entity.KpiRuleEntity; import com.elink.esua.epdc.redis.KpiFormulaRedis; import com.elink.esua.epdc.service.KpiFormulaService; -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 org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,7 +40,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.script.Invocable; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -53,7 +55,8 @@ public class KpiFormulaServiceImpl extends BaseServiceImpl page(Map params) { QueryWrapper wrapper=new QueryWrapper<>(); @@ -127,9 +130,17 @@ public class KpiFormulaServiceImpl extends BaseServiceImpl kpiRuleEntityQueryWrapper = new QueryWrapper<>(); + kpiRuleEntityQueryWrapper.in(ids.length>0,"reference_id",ids); + List kpiRuleEntityList= kpiRuleDao.selectList(kpiRuleEntityQueryWrapper); + if(null!=kpiRuleEntityList&&kpiRuleEntityList.size()>0){ + return new Result().error("存在公式被引用,不允许删除"); + } // 逻辑删除(@TableLogic 注解) baseDao.deleteBatchIds(Arrays.asList(ids)); + return new Result(); } /** @@ -162,4 +173,16 @@ public class KpiFormulaServiceImpl extends BaseServiceImpl + * @Author yinzuomei + * @Description 获取公式id、公式名称供下拉框使用 + * @Date 2019/11/27 14:02 + **/ + @Override + public Result> listKpiFormulaDictResultDTO() { + List list=baseDao.selectListKpiFormulaDictResultDTO(); + return new Result>().ok(list); + } + } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleParamServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleParamServiceImpl.java new file mode 100644 index 000000000..5b2794373 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleParamServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.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. + *

+ * 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.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.KpiFormulaDao; +import com.elink.esua.epdc.dao.KpiRuleDao; +import com.elink.esua.epdc.dao.KpiRuleParamDao; +import com.elink.esua.epdc.dto.KpiRuleDTO; +import com.elink.esua.epdc.dto.KpiRuleParamDTO; +import com.elink.esua.epdc.dto.form.KpiRuleSaveOrUpdateFormDTO; +import com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO; +import com.elink.esua.epdc.entity.KpiFormulaEntity; +import com.elink.esua.epdc.entity.KpiRuleEntity; +import com.elink.esua.epdc.entity.KpiRuleParamEntity; +import com.elink.esua.epdc.redis.KpiRuleRedis; +import com.elink.esua.epdc.service.KpiRuleParamService; +import com.elink.esua.epdc.service.KpiRuleService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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 KpiRuleServiceImpl extends BaseServiceImpl implements KpiRuleService { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private KpiRuleRedis kpiRuleRedis; + + @Autowired + private KpiRuleParamService kpiRuleParamService; + + @Autowired + private KpiRuleParamDao kpiRuleParamDao; + @Autowired + private KpiFormulaDao kpiFormulaDao; + + @Override + public PageData page(Map params) { + String ruleName = params.containsKey("ruleName") ? params.get("ruleName").toString() : null; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(ruleName), "rule_name", ruleName); + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + return getPageData(page, KpiRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, KpiRuleDTO.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 KpiRuleDTO get(String id) { + KpiRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, KpiRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(KpiRuleDTO dto) { + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(KpiRuleDTO dto) { + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + QueryWrapper kpiRuleParamEntityQueryWrapper = new QueryWrapper<>(); + kpiRuleParamEntityQueryWrapper.in(ids.length>0,"RULE_ID",ids); + kpiRuleParamDao.delete(kpiRuleParamEntityQueryWrapper); + } + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Author yinzuomei + * @Description 列表查询 + * @Date 2019/11/27 13:29 + **/ + @Override + public PageData query(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListKpiRuleQueryResultDTO(params); + return new PageData<>(list, page.getTotal()); + } + + /** + * @param id 考核规则表主键 + * @return com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO + * @Author yinzuomei + * @Description 查询详情 + * @Date 2019/11/27 15:17 + **/ + @Override + public KpiRuleQueryResultDTO queryDetailInfo(String id) { + return baseDao.queryDetailInfo(id); + } + + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 新增 + * @Date 2019/11/27 16:27 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result add(KpiRuleSaveOrUpdateFormDTO dto) { + Result checkResult = this.checkKpiRuleSaveOrUpdateFormDTO(dto); + if (checkResult.getCode() != 0) { + return checkResult; + } + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + logger.info("考核规则表id=" + entity.getId()); + insert(entity); + List ruleParamList = dto.getRuleParamList(); + for (KpiRuleParamDTO kpiRuleParamDTO : ruleParamList) { + kpiRuleParamDTO.setRuleId(entity.getId()); + kpiRuleParamService.save(kpiRuleParamDTO); + } + return new Result(); + } + + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 修改 + * @Date 2019/11/27 16:27 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result edit(KpiRuleSaveOrUpdateFormDTO dto) { + Result checkResult = this.checkKpiRuleSaveOrUpdateFormDTO(dto); + if (checkResult.getCode() != 0) { + return checkResult; + } + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + updateById(entity); + //全部删除参数记录表 + int deleteResultNum = kpiRuleParamDao.deleteByRuleId(entity.getId()); + logger.info("删除了" + deleteResultNum + "条记录"); + List ruleParamList = dto.getRuleParamList(); + for (KpiRuleParamDTO kpiRuleParamDTO : ruleParamList) { + kpiRuleParamDTO.setId(null); + kpiRuleParamDTO.setRuleId(entity.getId()); + kpiRuleParamService.save(kpiRuleParamDTO); + } + return new Result(); + } + + public Result checkKpiRuleSaveOrUpdateFormDTO(KpiRuleSaveOrUpdateFormDTO dto) { + if (("0").equals(dto.getRuleMode())) { + KpiFormulaEntity kpiFormulaEntity = kpiFormulaDao.selectById(dto.getReferenceId()); + if (kpiFormulaEntity.getParamAmount() != dto.getRuleParamList().size()) { + return new Result().error("公式缺少入参"); + } + //校验sort唯一性 + int sort = 0; + for (KpiRuleParamDTO kpiRuleParamDTO : dto.getRuleParamList()) { + if (kpiRuleParamDTO.getSort() == sort) { + return new Result().error("参数排序不唯一,请重新编辑"); + } + sort = kpiRuleParamDTO.getSort(); + } + } + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml index 588afe512..6cfe4092c 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml @@ -20,5 +20,17 @@ - + + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml new file mode 100644 index 000000000..f746c8399 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml new file mode 100644 index 000000000..2928504c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + delete from epdc_kpi_rule_param where rule_id=#{id} + +