38 changed files with 1345 additions and 128 deletions
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.dto.events.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/16 14:52 |
|||
* @Description: 查询参数 |
|||
*/ |
|||
@Data |
|||
public class EventCountSqlFromDTO { |
|||
|
|||
/*** |
|||
* 网格id |
|||
*/ |
|||
private Long gridId; |
|||
|
|||
/*** |
|||
* 月 季 年 0,1,2 |
|||
*/ |
|||
private String type; |
|||
|
|||
/*** |
|||
* 0 是群众反应问题总数 1 群众反应问题响应数 |
|||
*/ |
|||
private String responseType; |
|||
|
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/12 18:46 |
|||
* @Description: kpi模块 |
|||
*/ |
|||
public interface KpiFeignClient { |
|||
|
|||
/*** |
|||
* 调用kpi模块执行获取元数据的定时任务 |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author qushutong |
|||
* @date 2019/12/12 18:55 |
|||
*/ |
|||
@GetMapping(value = "kpimetadata/buildMetaData", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result runKpiMateData(); |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.feign.KpiFeignClient; |
|||
|
|||
import java.util.List; |
|||
|
|||
public class KpiFeignClientFallBack implements KpiFeignClient { |
|||
|
|||
@Override |
|||
public Result runKpiMateData() { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_KPI_SERVER, "sendGridIdList", ""); |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/12 16:52 |
|||
* @Description: kpi 模块查原始数据 |
|||
*/ |
|||
public interface ScheduleJobKpiService { |
|||
|
|||
/*** |
|||
* 启动kpi模块获取原始数据 |
|||
* @param |
|||
* @return void |
|||
* @author qushutong |
|||
* @date 2019/12/12 16:56 |
|||
*/ |
|||
void runKpi(); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.feign.KpiFeignClient; |
|||
import com.elink.esua.epdc.service.ScheduleJobKpiService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/12 16:53 |
|||
* @Description: 查询gridId |
|||
*/ |
|||
public class ScheduleJobKpiServiceImpl implements ScheduleJobKpiService { |
|||
|
|||
@Autowired |
|||
private KpiFeignClient kpiFeignClient; |
|||
|
|||
@Override |
|||
public void runKpi() { |
|||
kpiFeignClient.runKpiMateData(); |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.elink.esua.epdc.task; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/12 16:47 |
|||
* @Description: kpi模块查询原始数据 |
|||
*/ |
|||
public interface KpiDataTask { |
|||
|
|||
/*** |
|||
* kpi模块查询原始数据 |
|||
* @param params |
|||
* @return void |
|||
* @author qushutong |
|||
* @date 2019/12/12 16:48 |
|||
*/ |
|||
void run(String params); |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.task; |
|||
|
|||
import com.elink.esua.epdc.service.ScheduleJobKpiService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/12 16:50 |
|||
* @Description: kpi |
|||
*/ |
|||
@Component("kpiDataTask") |
|||
public class KpiDataTaskImple implements KpiDataTask{ |
|||
|
|||
@Autowired |
|||
private ScheduleJobKpiService scheduleJobKpiService; |
|||
/*** |
|||
* 查询所有gruidID 统计kpi原始数据 |
|||
* @param params |
|||
* @return void |
|||
* @author qushutong |
|||
* @date 2019/12/12 16:51 |
|||
*/ |
|||
@Override |
|||
public void run(String params) { |
|||
scheduleJobKpiService.runKpi(); |
|||
} |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package com.elink.esua.epdc.constant; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/16 19:36 |
|||
* @Description: 数据项名称 |
|||
*/ |
|||
public interface KpiDataName { |
|||
|
|||
/*** |
|||
* 响应网格呼叫数 |
|||
*/ |
|||
String xywghjs = "xywghjs"; |
|||
|
|||
/*** |
|||
* 网格呼叫总数 |
|||
*/ |
|||
String wghjzs = "wghjzs"; |
|||
|
|||
/*** |
|||
* 办结呼叫事项数 |
|||
*/ |
|||
String bjhjsxs = "bjhjsxs"; |
|||
|
|||
/*** |
|||
* 呼叫总数 |
|||
*/ |
|||
String hjzs = "hjzs"; |
|||
|
|||
/*** |
|||
* 问题办理满意数 |
|||
*/ |
|||
String peopleHighEvaluationAmount = "people_high_evaluation_amount"; |
|||
|
|||
/*** |
|||
* 问题办理基本满意数 |
|||
*/ |
|||
String peopleMediumEvaluationAmount = "people_medium_evaluation_amount"; |
|||
|
|||
/*** |
|||
* 问题办理不满意数 |
|||
*/ |
|||
String peopleLowEvaluationAmount = "people_low_evaluation_amount"; |
|||
|
|||
/*** |
|||
* 评价总数 |
|||
*/ |
|||
String pjzs = "pjzs"; |
|||
|
|||
/*** |
|||
* 群众反映问题响应数 |
|||
*/ |
|||
String peopleReportRespAmount = "people_report_resp_amount"; |
|||
|
|||
/*** |
|||
* 群众反映问题总数 |
|||
*/ |
|||
String peopleReportAmount = "people_report_amount"; |
|||
|
|||
/*** |
|||
* 群众投票满意数 |
|||
*/ |
|||
String voteHighEvaluationAmount = "vote_high_evaluation_amount"; |
|||
|
|||
/*** |
|||
* 群众投票基本满意数 |
|||
*/ |
|||
String voteMediumEvaluationAmount = "vote_medium_evaluation_amount"; |
|||
|
|||
/*** |
|||
* 群众投票不满意数 |
|||
*/ |
|||
String voteLowEvaluationAmount = "vote_low_evaluation_amount"; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/12/17 10:23 |
|||
* @Description: kpi 群众反应问题数 |
|||
*/ |
|||
@Data |
|||
public class EventCountFromDTO { |
|||
|
|||
/*** |
|||
* 所有网格 |
|||
*/ |
|||
private List<Long> gridIdList; |
|||
|
|||
/*** |
|||
* 0 是群众反应问题总数 1 群众反应问题响应数 |
|||
*/ |
|||
private String responseType; |
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 绩效考核的元数据 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Data |
|||
public class KpiMetaDataDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 数据项编码 |
|||
*/ |
|||
private String dataCode; |
|||
|
|||
/** |
|||
* 数据项名称 |
|||
*/ |
|||
private String dataName; |
|||
|
|||
/** |
|||
* 元数据值 |
|||
*/ |
|||
private BigDecimal dataValue; |
|||
|
|||
/** |
|||
* 考核周期(字典值 代表月,季,年) |
|||
*/ |
|||
private String kpiCycle; |
|||
|
|||
/** |
|||
* 考核周期开始日 |
|||
*/ |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 考核周期结束日 |
|||
*/ |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 删除标记 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
/** |
|||
* 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.KpiMetaDataDTO; |
|||
import com.elink.esua.epdc.excel.KpiMetaDataExcel; |
|||
import com.elink.esua.epdc.service.KpiMetaDataService; |
|||
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-12-16 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("kpimetadata") |
|||
public class KpiMetaDataController { |
|||
|
|||
@Autowired |
|||
private KpiMetaDataService kpiMetaDataService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<KpiMetaDataDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<KpiMetaDataDTO> page = kpiMetaDataService.page(params); |
|||
return new Result<PageData<KpiMetaDataDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<KpiMetaDataDTO> get(@PathVariable("id") String id){ |
|||
KpiMetaDataDTO data = kpiMetaDataService.get(id); |
|||
return new Result<KpiMetaDataDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody KpiMetaDataDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
kpiMetaDataService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody KpiMetaDataDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
kpiMetaDataService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
kpiMetaDataService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<KpiMetaDataDTO> list = kpiMetaDataService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, KpiMetaDataExcel.class); |
|||
} |
|||
|
|||
/*** |
|||
* 构建元数据 |
|||
* @param |
|||
* @return void |
|||
* @author qushutong |
|||
* @date 2019/12/16 10:17 |
|||
*/ |
|||
@GetMapping("buildMetaData") |
|||
public void buildMetaData(){ |
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.KpiMetaDataEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 绩效考核的元数据 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Mapper |
|||
public interface KpiMetaDataDao extends BaseDao<KpiMetaDataEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
/** |
|||
* 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.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 绩效考核的元数据 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_kpi_meta_data") |
|||
public class KpiMetaDataEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 数据项编码 |
|||
*/ |
|||
private String dataCode; |
|||
|
|||
/** |
|||
* 数据项名称 |
|||
*/ |
|||
private String dataName; |
|||
|
|||
/** |
|||
* 元数据值 |
|||
*/ |
|||
private BigDecimal dataValue; |
|||
|
|||
/** |
|||
* 考核周期(字典值 代表月,季,年) |
|||
*/ |
|||
private String kpiCycle; |
|||
|
|||
/** |
|||
* 考核周期开始日 |
|||
*/ |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 考核周期结束日 |
|||
*/ |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
/** |
|||
* 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.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 绩效考核的元数据 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Data |
|||
public class KpiMetaDataExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "数据项编码") |
|||
private String dataCode; |
|||
|
|||
@Excel(name = "数据项名称") |
|||
private String dataName; |
|||
|
|||
@Excel(name = "元数据值") |
|||
private BigDecimal dataValue; |
|||
|
|||
@Excel(name = "考核周期(字典值 代表月,季,年)") |
|||
private String kpiCycle; |
|||
|
|||
@Excel(name = "考核周期开始日") |
|||
private Date startDate; |
|||
|
|||
@Excel(name = "考核周期结束日") |
|||
private Date endDate; |
|||
|
|||
@Excel(name = "部门ID") |
|||
private Long deptId; |
|||
|
|||
@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-12-16 |
|||
*/ |
|||
@Component |
|||
public class KpiMetaDataRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.KpiMetaDataDTO; |
|||
import com.elink.esua.epdc.entity.KpiMetaDataEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 绩效考核的元数据 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
public interface KpiMetaDataService extends BaseService<KpiMetaDataEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<KpiMetaDataDTO> |
|||
* @author generator |
|||
* @date 2019-12-16 |
|||
*/ |
|||
PageData<KpiMetaDataDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<KpiMetaDataDTO> |
|||
* @author generator |
|||
* @date 2019-12-16 |
|||
*/ |
|||
List<KpiMetaDataDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return KpiMetaDataDTO |
|||
* @author generator |
|||
* @date 2019-12-16 |
|||
*/ |
|||
KpiMetaDataDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-12-16 |
|||
*/ |
|||
void save(KpiMetaDataDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-12-16 |
|||
*/ |
|||
void update(KpiMetaDataDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-12-16 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/*** |
|||
* 构建元素数据 |
|||
* @param |
|||
* @return void |
|||
* @author qushutong |
|||
* @date 2019/12/16 10:19 |
|||
*/ |
|||
void createMataData(); |
|||
} |
|||
@ -0,0 +1,137 @@ |
|||
/** |
|||
* 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.constant.NumConstant; |
|||
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.KpiMetaDataDao; |
|||
import com.elink.esua.epdc.dto.EventCountFromDTO; |
|||
import com.elink.esua.epdc.dto.KpiMetaDataDTO; |
|||
import com.elink.esua.epdc.entity.KpiMetaDataEntity; |
|||
import com.elink.esua.epdc.feign.AdminFeignClient; |
|||
import com.elink.esua.epdc.feign.EventFeignClient; |
|||
import com.elink.esua.epdc.redis.KpiMetaDataRedis; |
|||
import com.elink.esua.epdc.service.KpiMetaDataService; |
|||
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.time.Month; |
|||
import java.time.Period; |
|||
import java.time.YearMonth; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 绩效考核的元数据 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Service |
|||
public class KpiMetaDataServiceImpl extends BaseServiceImpl<KpiMetaDataDao, KpiMetaDataEntity> implements KpiMetaDataService { |
|||
|
|||
@Autowired |
|||
private KpiMetaDataRedis kpiMetaDataRedis; |
|||
|
|||
@Autowired |
|||
private AdminFeignClient adminFeignClient; |
|||
|
|||
@Autowired |
|||
private EventFeignClient eventFeignClient; |
|||
|
|||
@Override |
|||
public PageData<KpiMetaDataDTO> page(Map<String, Object> params) { |
|||
IPage<KpiMetaDataEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, KpiMetaDataDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<KpiMetaDataDTO> list(Map<String, Object> params) { |
|||
List<KpiMetaDataEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, KpiMetaDataDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<KpiMetaDataEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<KpiMetaDataEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public KpiMetaDataDTO get(String id) { |
|||
KpiMetaDataEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, KpiMetaDataDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(KpiMetaDataDTO dto) { |
|||
KpiMetaDataEntity entity = ConvertUtils.sourceToTarget(dto, KpiMetaDataEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(KpiMetaDataDTO dto) { |
|||
KpiMetaDataEntity entity = ConvertUtils.sourceToTarget(dto, KpiMetaDataEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public void createMataData() { |
|||
// 获取所有网格
|
|||
Result<List<Long>> listResult = adminFeignClient.listAllGridId(); |
|||
if (listResult == null && listResult.getData() == null) { |
|||
throw new RuntimeException("获取网格列表失败"); |
|||
} |
|||
List<Long> gridList = listResult.getData(); |
|||
EventCountFromDTO eventCountFromDto = new EventCountFromDTO(); |
|||
eventCountFromDto.setGridIdList(gridList); |
|||
// 0 查询总数
|
|||
eventCountFromDto.setResponseType(NumConstant.ZERO_STR); |
|||
//获取事件 群众反映问题总数(事件提交总数)
|
|||
Result<List<KpiMetaDataDTO>> allCommitCount = eventFeignClient.getAllCommitCount(eventCountFromDto); |
|||
List<KpiMetaDataDTO> data = allCommitCount.getData(); |
|||
List<KpiMetaDataEntity> mataDataEntityList = ConvertUtils.sourceToTarget(data, KpiMetaDataEntity.class); |
|||
insertBatch(mataDataEntityList); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<?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.KpiMetaDataDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.KpiMetaDataEntity" id="kpiMetaDataMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="dataCode" column="data_code"/> |
|||
<result property="dataName" column="data_name"/> |
|||
<result property="dataValue" column="data_value"/> |
|||
<result property="kpiCycle" column="kpi_cycle"/> |
|||
<result property="startDate" column="start_date"/> |
|||
<result property="endDate" column="end_date"/> |
|||
<result property="deptId" column="dept_id"/> |
|||
<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> |
|||
|
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue