26 changed files with 1958 additions and 107 deletions
@ -0,0 +1,97 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
|
|||
} |
@ -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<KpiRuleParamDTO> ruleParamList; |
|||
} |
@ -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; |
|||
} |
@ -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<KpiRuleParamDTO> ruleParamList; |
|||
} |
@ -0,0 +1,145 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<PageData<KpiRuleDTO>> page(@RequestParam Map<String, Object> params) { |
|||
PageData<KpiRuleDTO> page = kpiRuleService.page(params); |
|||
return new Result<PageData<KpiRuleDTO>>().ok(page); |
|||
} |
|||
|
|||
/*@GetMapping("{id}") |
|||
public Result<KpiRuleDTO> get(@PathVariable("id") String id){ |
|||
KpiRuleDTO data = kpiRuleService.get(id); |
|||
return new Result<KpiRuleDTO>().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<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<KpiRuleDTO> list = kpiRuleService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, KpiRuleExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData < com.elink.esua.epdc.dto.KpiRuleDTO>> |
|||
* @Author yinzuomei |
|||
* @Description 列表查询 |
|||
* @Date 2019/11/27 13:22 |
|||
**/ |
|||
@GetMapping("query") |
|||
public Result<PageData<KpiRuleQueryResultDTO>> query(@RequestParam Map<String, Object> params) { |
|||
PageData<KpiRuleQueryResultDTO> page = kpiRuleService.query(params); |
|||
return new Result<PageData<KpiRuleQueryResultDTO>>().ok(page); |
|||
} |
|||
|
|||
/** |
|||
* @param id |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 查询详情 |
|||
* @Date 2019/11/27 15:17 |
|||
**/ |
|||
@GetMapping("{id}") |
|||
public Result<KpiRuleQueryResultDTO> queryDetailInfo(@PathVariable("id") String id) { |
|||
KpiRuleQueryResultDTO data = kpiRuleService.queryDetailInfo(id); |
|||
return new Result<KpiRuleQueryResultDTO>().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); |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<PageData<KpiRuleParamDTO>> page(@RequestParam Map<String, Object> params) { |
|||
PageData<KpiRuleParamDTO> page = kpiRuleParamService.page(params); |
|||
return new Result<PageData<KpiRuleParamDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<KpiRuleParamDTO> get(@PathVariable("id") String id) { |
|||
KpiRuleParamDTO data = kpiRuleParamService.get(id); |
|||
return new Result<KpiRuleParamDTO>().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<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<KpiRuleParamDTO> list = kpiRuleParamService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, KpiRuleParamExcel.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<KpiRuleEntity> { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 列表查询 |
|||
* @Date 2019/11/27 13:32 |
|||
**/ |
|||
List<KpiRuleQueryResultDTO> selectListKpiRuleQueryResultDTO(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param ruleId |
|||
* @return java.util.List<com.elink.esua.epdc.dto.result.KpiRuleParamInfoDTO> |
|||
* @Author yinzuomei |
|||
* @Description 根据规则id查询公式参数表 |
|||
* @Date 2019/11/27 15:32 |
|||
**/ |
|||
List<KpiRuleParamDTO> 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); |
|||
} |
@ -0,0 +1,41 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<KpiRuleParamEntity> { |
|||
|
|||
/** |
|||
* @param id 规则ID |
|||
* @return int |
|||
* @Author yinzuomei |
|||
* @Description 根据规则id删除公式参数表记录 |
|||
* @Date 2019/11/27 16:36 |
|||
**/ |
|||
int deleteByRuleId(String id); |
|||
} |
@ -0,0 +1,66 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
|
|||
|
|||
} |
@ -0,0 +1,65 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<KpiRuleParamEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<KpiRuleParamDTO> |
|||
* @author generator |
|||
* @date 2019-11-27 |
|||
*/ |
|||
PageData<KpiRuleParamDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<KpiRuleParamDTO> |
|||
* @author generator |
|||
* @date 2019-11-27 |
|||
*/ |
|||
List<KpiRuleParamDTO> list(Map<String, Object> 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); |
|||
} |
@ -0,0 +1,134 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<KpiRuleEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<KpiRuleDTO> |
|||
* @author generator |
|||
* @date 2019-11-27 |
|||
*/ |
|||
PageData<KpiRuleDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<KpiRuleDTO> |
|||
* @author generator |
|||
* @date 2019-11-27 |
|||
*/ |
|||
List<KpiRuleDTO> list(Map<String, Object> 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<com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 列表查询 |
|||
* @Date 2019/11/27 13:29 |
|||
**/ |
|||
PageData<KpiRuleQueryResultDTO> query(Map<String, Object> 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); |
|||
} |
@ -0,0 +1,104 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<KpiRuleParamDao, KpiRuleParamEntity> implements KpiRuleParamService { |
|||
|
|||
@Autowired |
|||
private KpiRuleParamRedis kpiRuleParamRedis; |
|||
|
|||
@Override |
|||
public PageData<KpiRuleParamDTO> page(Map<String, Object> params) { |
|||
IPage<KpiRuleParamEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, KpiRuleParamDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<KpiRuleParamDTO> list(Map<String, Object> params) { |
|||
List<KpiRuleParamEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, KpiRuleParamDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<KpiRuleParamEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<KpiRuleParamEntity> 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)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,225 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
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<KpiRuleDao, KpiRuleEntity> 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<KpiRuleDTO> page(Map<String, Object> params) { |
|||
String ruleName = params.containsKey("ruleName") ? params.get("ruleName").toString() : null; |
|||
QueryWrapper<KpiRuleEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.like(StringUtils.isNotBlank(ruleName), "rule_name", ruleName); |
|||
IPage<KpiRuleEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
wrapper |
|||
); |
|||
return getPageData(page, KpiRuleDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<KpiRuleDTO> list(Map<String, Object> params) { |
|||
List<KpiRuleEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, KpiRuleDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<KpiRuleEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<KpiRuleEntity> 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<KpiRuleParamEntity> 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<com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 列表查询 |
|||
* @Date 2019/11/27 13:29 |
|||
**/ |
|||
@Override |
|||
public PageData<KpiRuleQueryResultDTO> query(Map<String, Object> params) { |
|||
IPage<KpiRuleQueryResultDTO> page = getPage(params); |
|||
List<KpiRuleQueryResultDTO> 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<KpiRuleParamDTO> 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<KpiRuleParamDTO> 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(); |
|||
} |
|||
} |
@ -0,0 +1,126 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.dao.KpiRuleDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.KpiRuleEntity" id="kpiRuleMap"> |
|||
<result property="id" column="id"/> |
|||
<result property="ruleName" column="rule_name"/> |
|||
<result property="ruleCode" column="rule_code"/> |
|||
<result property="ruleMode" column="rule_mode"/> |
|||
<result property="referenceId" column="reference_id"/> |
|||
<result property="kpiCycle" column="kpi_cycle"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
</resultMap> |
|||
|
|||
<!-- 列表查询 --> |
|||
<select id="selectListKpiRuleQueryResultDTO" parameterType="map" resultType="com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO"> |
|||
SELECT |
|||
ekr.ID as id, |
|||
ekr.rule_name as ruleName, |
|||
ekr.rule_code as ruleCode, |
|||
ekr.rule_mode as ruleMode, |
|||
ekr.reference_id as referenceId, |
|||
ekr.kpi_cycle as kpiCycle, |
|||
ekr.revision as revision, |
|||
ekr.CREATED_BY as createdBy, |
|||
ekr.CREATED_TIME as createdTime, |
|||
ekr.UPDATED_BY as updatedBy, |
|||
ekr.UPDATED_TIME as updatedTime, |
|||
ekr.DEL_FLAG as delFlag, |
|||
(case rule_mode |
|||
when '0' then (select ekf.name from epdc_kpi_formula ekf where ekf.ID=ekr.reference_id) |
|||
else null |
|||
end)as referenceName |
|||
FROM |
|||
epdc_kpi_rule ekr |
|||
WHERE |
|||
ekr.DEL_FLAG = '0' |
|||
<if test="ruleName != null and ruleName.trim() != ''"> |
|||
and ekr.rule_name like concat('%', #{ruleName}, '%') |
|||
</if> |
|||
ORDER BY |
|||
ekr.CREATED_TIME DESC |
|||
</select> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO" id="KpiRuleQueryResultDTOMap"> |
|||
<result property="id" column="id"/> |
|||
<result property="ruleName" column="rule_name"/> |
|||
<result property="ruleCode" column="rule_code"/> |
|||
<result property="ruleMode" column="rule_mode"/> |
|||
<result property="referenceId" column="reference_id"/> |
|||
<result property="kpiCycle" column="kpi_cycle"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="referenceName" column="reference_name"/> |
|||
<collection property="ruleParamList" select="com.elink.esua.epdc.dao.KpiRuleDao.selectKpiRuleParamInfoDTO" column="id"></collection> |
|||
</resultMap> |
|||
|
|||
<resultMap id="KpiRuleParamDTOMap" type="com.elink.esua.epdc.dto.KpiRuleParamDTO"> |
|||
<result property="id" column="ID"/> |
|||
<result property="ruleId" column="RULE_ID"/> |
|||
<result property="metaDataCode" column="META_DATA_CODE"/> |
|||
<result property="sort" column="SORT"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
</resultMap> |
|||
|
|||
<select id="selectKpiRuleParamInfoDTO" resultMap="KpiRuleParamDTOMap"> |
|||
SELECT |
|||
id, |
|||
rule_id, |
|||
META_DATA_CODE, |
|||
sort, |
|||
revision, |
|||
CREATED_BY, |
|||
CREATED_TIME, |
|||
UPDATED_BY, |
|||
UPDATED_TIME, |
|||
DEL_FLAG |
|||
FROM |
|||
epdc_kpi_rule_param |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND rule_id =#{ruleId} |
|||
ORDER BY |
|||
sort ASC |
|||
</select> |
|||
<!-- --> |
|||
<select id="queryDetailInfo" parameterType="java.lang.String" resultMap="KpiRuleQueryResultDTOMap"> |
|||
SELECT |
|||
ekr.ID, |
|||
ekr.rule_name, |
|||
ekr.rule_code, |
|||
ekr.rule_mode, |
|||
ekr.reference_id, |
|||
ekr.kpi_cycle, |
|||
ekr.revision, |
|||
ekr.CREATED_BY, |
|||
ekr.CREATED_TIME, |
|||
ekr.UPDATED_BY, |
|||
ekr.UPDATED_TIME, |
|||
ekr.DEL_FLAG, |
|||
(case rule_mode |
|||
when '0' then (select ekf.name from epdc_kpi_formula ekf where ekf.ID=ekr.reference_id) |
|||
else null |
|||
end)as reference_name |
|||
FROM |
|||
epdc_kpi_rule ekr |
|||
WHERE |
|||
ekr.DEL_FLAG = '0' |
|||
and ekr.id=#{id} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.dao.KpiRuleParamDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.KpiRuleParamEntity" id="kpiRuleParamMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="ruleId" column="RULE_ID"/> |
|||
<result property="metaDataCode" column="META_DATA_CODE"/> |
|||
<result property="sort" column="SORT"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
</resultMap> |
|||
|
|||
<update id="deleteByRuleId"> |
|||
delete from epdc_kpi_rule_param where rule_id=#{id} |
|||
</update> |
|||
</mapper> |
Loading…
Reference in new issue