Browse Source
# Conflicts: # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xmlfeature/dangjian
40 changed files with 2089 additions and 63 deletions
@ -0,0 +1,92 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 部门管理 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Data |
|||
public class DeptDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private Long id; |
|||
|
|||
/** |
|||
* 上级ID |
|||
*/ |
|||
private Long pid; |
|||
/** |
|||
* 所有上级ID,用逗号分开 |
|||
*/ |
|||
private String pids; |
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 上级部门名称 |
|||
*/ |
|||
private String parentName; |
|||
|
|||
/** |
|||
* 部门类型键值 |
|||
*/ |
|||
private String typeKey; |
|||
|
|||
/** |
|||
* 部门编码 |
|||
*/ |
|||
private String partyCode; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 联系方式 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 所属地区码(所属组织地区码) |
|||
*/ |
|||
private String areaCode; |
|||
|
|||
/**第三方编码 |
|||
*/ |
|||
private String infoCode; |
|||
|
|||
/** |
|||
* 市中心区划编码 |
|||
*/ |
|||
private String disCenterZoningCode; |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.elink.esua.epdc.dto.events.form; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class ItemDailyStatisFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 3950470078846120789L; |
|||
|
|||
/** |
|||
* 网格、部门Id |
|||
*/ |
|||
@NotBlank(message = "部门Id不能为空", groups = AddGroup.class) |
|||
private String deptId; |
|||
/** |
|||
* 诉求分类:0民生 1发展 2执法 |
|||
*/ |
|||
private String peopleFlag; |
|||
/** |
|||
* 开始日期 yyyy-MM-dd |
|||
*/ |
|||
private String startTime; |
|||
/** |
|||
* 结束日期 yyyy-MM-dd |
|||
*/ |
|||
private String endTime; |
|||
/** |
|||
* 日维度 yyyy-MM-dd |
|||
*/ |
|||
private String statDate; |
|||
/** |
|||
* 月维度 yyyy-MM |
|||
*/ |
|||
private String statMonth; |
|||
/** |
|||
* 年维度 yyyy |
|||
*/ |
|||
private String statYear; |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.elink.esua.epdc.dto.events.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class ItemDailyStatisResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 1171586248033198322L; |
|||
/** |
|||
* 网格、部门Id |
|||
*/ |
|||
private String deptId; |
|||
/** |
|||
* 诉求分类:0民生 1发展 2执法 |
|||
*/ |
|||
private String peopleFlag; |
|||
/** |
|||
* 总数 |
|||
*/ |
|||
private Integer total = 0; |
|||
/** |
|||
* 待处理总数 |
|||
*/ |
|||
private Integer pendingTotal = 0; |
|||
/** |
|||
* 处理中总数 |
|||
*/ |
|||
private Integer processingTotal = 0; |
|||
/** |
|||
* 已结案总数 |
|||
*/ |
|||
private Integer closedTotal = 0; |
|||
/** |
|||
* 红灯事件数 |
|||
*/ |
|||
private Integer redTotal = 0; |
|||
/** |
|||
* 黄灯事件数 |
|||
*/ |
|||
private Integer yellowTotal = 0; |
|||
/** |
|||
* 绿灯事件数 |
|||
*/ |
|||
private Integer greenTotal = 0; |
|||
|
|||
} |
|||
@ -0,0 +1,131 @@ |
|||
/** |
|||
* 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.screen; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 大屏-事件结案数与效能评价统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Data |
|||
public class ScreenDeptEventEfficiencyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 上级ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有上级ID |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 部门级别 |
|||
*/ |
|||
private String deptLevel; |
|||
|
|||
/** |
|||
* 部门排序 |
|||
*/ |
|||
private String deptSort; |
|||
|
|||
/** |
|||
* 统计类型 年year,月month,日date |
|||
*/ |
|||
private String statType; |
|||
|
|||
/** |
|||
* 统计日期根据STAT_TYPE分别 yyyy/yyyy-MM/yyyy-MM-dd |
|||
*/ |
|||
private String statDate; |
|||
|
|||
/** |
|||
* 事件数 |
|||
*/ |
|||
private Integer eventCount; |
|||
|
|||
/** |
|||
* 响应数 |
|||
*/ |
|||
private Integer responseCount; |
|||
|
|||
/** |
|||
* 满意数 |
|||
*/ |
|||
private Integer satisfiedCount; |
|||
|
|||
/** |
|||
* 结案数 |
|||
*/ |
|||
private Integer closedCount; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除,1:删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,166 @@ |
|||
/** |
|||
* 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.screen; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 大屏-事件汇总统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Data |
|||
public class ScreenDeptEventStatDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 上级ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有上级ID |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 部门级别 |
|||
*/ |
|||
private String deptLevel; |
|||
|
|||
/** |
|||
* 部门排序 |
|||
*/ |
|||
private String deptSort; |
|||
|
|||
/** |
|||
* 统计年份yyyy |
|||
*/ |
|||
private String statYear; |
|||
|
|||
/** |
|||
* 统计月份yyyy-MM |
|||
*/ |
|||
private String statMonth; |
|||
|
|||
/** |
|||
* 统计日期yyyy-MM-dd |
|||
*/ |
|||
private String statDate; |
|||
|
|||
/** |
|||
* 事件总数 |
|||
*/ |
|||
private Integer eventCount; |
|||
|
|||
/** |
|||
* 事件增量 |
|||
*/ |
|||
private Integer eventIncr; |
|||
|
|||
/** |
|||
* 民生诉求总数 |
|||
*/ |
|||
private Integer livelihoodCount; |
|||
|
|||
/** |
|||
* 民生诉求增量 |
|||
*/ |
|||
private Integer livelihoodIncr; |
|||
|
|||
/** |
|||
* 发展诉求总数 |
|||
*/ |
|||
private Integer developCount; |
|||
|
|||
/** |
|||
* 发展诉求增量 |
|||
*/ |
|||
private Integer developIncr; |
|||
|
|||
/** |
|||
* 执法诉求总数 |
|||
*/ |
|||
private Integer lawCount; |
|||
|
|||
/** |
|||
* 执法诉求增量 |
|||
*/ |
|||
private Integer lawIncr; |
|||
|
|||
/** |
|||
* 结案总数 |
|||
*/ |
|||
private Integer closedCount; |
|||
|
|||
/** |
|||
* 结案增量 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除,1:删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.elink.esua.epdc.dto.screen.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 10:21 |
|||
*/ |
|||
@Data |
|||
public class DataStatisticsFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private String statType; |
|||
private String statDate; |
|||
private String startDate; |
|||
private String endDate; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.dto.screen.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 10:21 |
|||
*/ |
|||
@Data |
|||
public class EventStatisticsFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
/** |
|||
* 统计类型 默认 1,本月 2,本年 3,自定义区间 4 |
|||
*/ |
|||
private String statType; |
|||
private String statDate; |
|||
private String startDate; |
|||
private String endDate; |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 10:21 |
|||
*/ |
|||
@Data |
|||
public class EventStatisticsResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 事件总数 |
|||
*/ |
|||
private Integer eventCount; |
|||
|
|||
/** |
|||
* 民生诉求总数 |
|||
*/ |
|||
private Integer livelihoodCount; |
|||
|
|||
/** |
|||
* 发展诉求总数 |
|||
*/ |
|||
private Integer developCount; |
|||
|
|||
/** |
|||
* 执法诉求总数 |
|||
*/ |
|||
private Integer lawCount; |
|||
} |
|||
@ -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.modules.screen.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.dto.events.form.ItemDailyStatisFormDTO; |
|||
import com.elink.esua.epdc.dto.events.result.ItemDailyStatisResultDTO; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
|
|||
/** |
|||
* 项目统计相关接口 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("itemstatis") |
|||
public class ScreenItemController { |
|||
|
|||
@Autowired |
|||
private ScreenService screenService; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 数据统计-各诉求不同状态数据 |
|||
* |
|||
* @return |
|||
*/ |
|||
@PostMapping("itemdailystatis") |
|||
public Result<ItemDailyStatisResultDTO> itemDailyStatis(@RequestBody ItemDailyStatisFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, AddGroup.class); |
|||
return new Result<ItemDailyStatisResultDTO>().ok(screenService.itemDailyStatis(formDTO)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
/** |
|||
* 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.modules.screen.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 大屏-事件结案数与效能评价统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenDeptEventEfficiencyDao extends BaseDao<ScreenDeptEventEfficiencyEntity> { |
|||
/** |
|||
* 日统计 |
|||
* @Param statDate |
|||
* @Return {@link List<ScreenDeptEventEfficiencyEntity>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:50 |
|||
*/ |
|||
List<ScreenDeptEventEfficiencyEntity> getEventEfficiencyDaily(@Param("statDate") String statDate); |
|||
|
|||
/** |
|||
* 月统计 |
|||
* @Param statDate |
|||
* @Return {@link List<ScreenDeptEventEfficiencyEntity>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:50 |
|||
*/ |
|||
List<ScreenDeptEventEfficiencyEntity> getEventEfficiencyMonthly(@Param("statDate") String statDate); |
|||
|
|||
/** |
|||
* 年统计 |
|||
* @Param statDate |
|||
* @Return {@link List<ScreenDeptEventEfficiencyEntity>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:50 |
|||
*/ |
|||
List<ScreenDeptEventEfficiencyEntity> getEventEfficiencyYearly(@Param("statDate") String statDate); |
|||
} |
|||
@ -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.modules.screen.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.screen.ScreenDeptEventStatDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.EventStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.EventStatisticsResultDTO; |
|||
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventStatEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 大屏-事件汇总统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenDeptEventStatDao extends BaseDao<ScreenDeptEventStatEntity> { |
|||
/** |
|||
* 事件统计 |
|||
* |
|||
* @Param statDate |
|||
* @Return {@link List< ScreenDeptEventStatDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 14:21 |
|||
*/ |
|||
List<ScreenDeptEventStatEntity> getEventStat(@Param("statDate") String statDate); |
|||
|
|||
/** |
|||
* 获取某天的统计结果 |
|||
* @Param formDTO |
|||
* @Return {@link List<EventStatisticsResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:31 |
|||
*/ |
|||
List<EventStatisticsResultDTO> getEventStatByDay(EventStatisticsFormDTO formDTO); |
|||
|
|||
/** |
|||
* 获取某个区间的统计结果,包括年,月,以及自定义区间 |
|||
* @Param formDTO |
|||
* @Return {@link List<EventStatisticsResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:32 |
|||
*/ |
|||
List<EventStatisticsResultDTO> getEventStatByOther(EventStatisticsFormDTO formDTO); |
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
/** |
|||
* 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.modules.screen.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 elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_dept_event_efficiency") |
|||
public class ScreenDeptEventEfficiencyEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 上级ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有上级ID |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 部门级别 |
|||
*/ |
|||
private String deptLevel; |
|||
|
|||
/** |
|||
* 部门排序 |
|||
*/ |
|||
private String deptSort; |
|||
|
|||
/** |
|||
* 统计类型 年3,月2,日1 |
|||
*/ |
|||
private String statType; |
|||
|
|||
/** |
|||
* 统计日期根据STAT_TYPE分别 yyyy/yyyy-MM/yyyy-MM-dd |
|||
*/ |
|||
private String statDate; |
|||
|
|||
/** |
|||
* 事件数 |
|||
*/ |
|||
private Integer eventCount; |
|||
|
|||
/** |
|||
* 响应数 |
|||
*/ |
|||
private Integer responseCount; |
|||
|
|||
/** |
|||
* 满意数 |
|||
*/ |
|||
private Integer satisfiedCount; |
|||
|
|||
/** |
|||
* 结案数 |
|||
*/ |
|||
private Integer closedCount; |
|||
|
|||
} |
|||
@ -0,0 +1,136 @@ |
|||
/** |
|||
* 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.modules.screen.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 elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_dept_event_stat") |
|||
public class ScreenDeptEventStatEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 上级ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有上级ID |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 部门级别 |
|||
*/ |
|||
private String deptLevel; |
|||
|
|||
/** |
|||
* 部门排序 |
|||
*/ |
|||
private String deptSort; |
|||
|
|||
/** |
|||
* 统计年份yyyy |
|||
*/ |
|||
private String statYear; |
|||
|
|||
/** |
|||
* 统计月份yyyy-MM |
|||
*/ |
|||
private String statMonth; |
|||
|
|||
/** |
|||
* 统计日期yyyy-MM-dd |
|||
*/ |
|||
private String statDate; |
|||
|
|||
/** |
|||
* 事件总数 |
|||
*/ |
|||
private Integer eventCount; |
|||
|
|||
/** |
|||
* 事件增量 |
|||
*/ |
|||
private Integer eventIncr; |
|||
|
|||
/** |
|||
* 民生诉求总数 |
|||
*/ |
|||
private Integer livelihoodCount; |
|||
|
|||
/** |
|||
* 民生诉求增量 |
|||
*/ |
|||
private Integer livelihoodIncr; |
|||
|
|||
/** |
|||
* 发展诉求总数 |
|||
*/ |
|||
private Integer developCount; |
|||
|
|||
/** |
|||
* 发展诉求增量 |
|||
*/ |
|||
private Integer developIncr; |
|||
|
|||
/** |
|||
* 执法诉求总数 |
|||
*/ |
|||
private Integer lawCount; |
|||
|
|||
/** |
|||
* 执法诉求增量 |
|||
*/ |
|||
private Integer lawIncr; |
|||
|
|||
/** |
|||
* 结案总数 |
|||
*/ |
|||
private Integer closedCount; |
|||
|
|||
/** |
|||
* 结案增量 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
} |
|||
@ -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.modules.screen.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.screen.ScreenDeptEventEfficiencyDTO; |
|||
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 大屏-事件结案数与效能评价统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
public interface ScreenDeptEventEfficiencyService extends BaseService<ScreenDeptEventEfficiencyEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ScreenDeptEventEfficiencyDTO> |
|||
* @author generator |
|||
* @date 2022-10-11 |
|||
*/ |
|||
PageData<ScreenDeptEventEfficiencyDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ScreenDeptEventEfficiencyDTO> |
|||
* @author generator |
|||
* @date 2022-10-11 |
|||
*/ |
|||
List<ScreenDeptEventEfficiencyDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ScreenDeptEventEfficiencyDTO |
|||
* @author generator |
|||
* @date 2022-10-11 |
|||
*/ |
|||
ScreenDeptEventEfficiencyDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-10-11 |
|||
*/ |
|||
void save(ScreenDeptEventEfficiencyDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-10-11 |
|||
*/ |
|||
void update(ScreenDeptEventEfficiencyDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-10-11 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
/** |
|||
* 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.modules.screen.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.screen.ScreenDeptEventStatDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.DataStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.EventStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.EventStatisticsResultDTO; |
|||
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventStatEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 大屏-事件汇总统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
public interface ScreenDeptEventStatService extends BaseService<ScreenDeptEventStatEntity> { |
|||
|
|||
/** |
|||
* 大屏数据统计 |
|||
* |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 10:24 |
|||
*/ |
|||
void dataStatistics(DataStatisticsFormDTO formDTO); |
|||
|
|||
/** |
|||
* 获取大屏数据 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link List<EventStatisticsResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:13 |
|||
*/ |
|||
List<EventStatisticsResultDTO> getEventStat(EventStatisticsFormDTO formDTO); |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
/** |
|||
* 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.modules.screen.service; |
|||
|
|||
import com.elink.esua.epdc.dto.events.form.ItemDailyStatisFormDTO; |
|||
import com.elink.esua.epdc.dto.events.result.ItemDailyStatisResultDTO; |
|||
|
|||
/** |
|||
* 项目统计相关接口 |
|||
*/ |
|||
public interface ScreenService { |
|||
|
|||
ItemDailyStatisResultDTO itemDailyStatis(ItemDailyStatisFormDTO formDTO); |
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
/** |
|||
* 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.modules.screen.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.dto.screen.ScreenDeptEventEfficiencyDTO; |
|||
import com.elink.esua.epdc.modules.screen.dao.ScreenDeptEventEfficiencyDao; |
|||
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenDeptEventEfficiencyService; |
|||
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 elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Service |
|||
public class ScreenDeptEventEfficiencyServiceImpl extends BaseServiceImpl<ScreenDeptEventEfficiencyDao, ScreenDeptEventEfficiencyEntity> implements ScreenDeptEventEfficiencyService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<ScreenDeptEventEfficiencyDTO> page(Map<String, Object> params) { |
|||
IPage<ScreenDeptEventEfficiencyEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ScreenDeptEventEfficiencyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ScreenDeptEventEfficiencyDTO> list(Map<String, Object> params) { |
|||
List<ScreenDeptEventEfficiencyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ScreenDeptEventEfficiencyDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ScreenDeptEventEfficiencyEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ScreenDeptEventEfficiencyEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ScreenDeptEventEfficiencyDTO get(String id) { |
|||
ScreenDeptEventEfficiencyEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ScreenDeptEventEfficiencyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ScreenDeptEventEfficiencyDTO dto) { |
|||
ScreenDeptEventEfficiencyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenDeptEventEfficiencyEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ScreenDeptEventEfficiencyDTO dto) { |
|||
ScreenDeptEventEfficiencyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenDeptEventEfficiencyEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,135 @@ |
|||
/** |
|||
* 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.modules.screen.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.DateUtils; |
|||
import com.elink.esua.epdc.dto.screen.ScreenDeptEventStatDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.DataStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.EventStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.EventStatisticsResultDTO; |
|||
import com.elink.esua.epdc.modules.screen.dao.ScreenDeptEventStatDao; |
|||
import com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventStatEntity; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenDeptEventStatService; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
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.*; |
|||
import java.util.function.Function; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 大屏-事件汇总统计 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-10-11 |
|||
*/ |
|||
@Service |
|||
public class ScreenDeptEventStatServiceImpl extends BaseServiceImpl<ScreenDeptEventStatDao, ScreenDeptEventStatEntity> implements ScreenDeptEventStatService { |
|||
|
|||
/** |
|||
* 数据统计 |
|||
* |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 10:24 |
|||
*/ |
|||
@Override |
|||
public void dataStatistics(DataStatisticsFormDTO formDTO) { |
|||
String statDate; |
|||
String statMonth; |
|||
String statYear; |
|||
if (StringUtils.isBlank(formDTO.getStatDate())) { |
|||
statDate = DateUtils.format(new Date(), DateUtils.DATE_PATTERN); |
|||
statMonth = statDate.substring(0,7); |
|||
statYear = statDate.substring(0,4); |
|||
} else { |
|||
statDate = formDTO.getStatDate(); |
|||
statMonth = formDTO.getStatDate().substring(0,7); |
|||
statYear = formDTO.getStatDate().substring(0,4); |
|||
} |
|||
//统计总数
|
|||
List<ScreenDeptEventStatEntity> list = baseDao.getEventStat(null); |
|||
//统计日增量
|
|||
List<ScreenDeptEventStatEntity> incrList = baseDao.getEventStat(statDate); |
|||
Map<String, ScreenDeptEventStatEntity> map = new HashMap<>(); |
|||
if (CollectionUtils.isNotEmpty(incrList)) { |
|||
map = incrList.stream().collect(Collectors.toMap(ScreenDeptEventStatEntity::getDeptId, Function.identity(), (key1, key2) -> key2)); |
|||
} |
|||
if (CollectionUtils.isNotEmpty(list)) { |
|||
Map<String, ScreenDeptEventStatEntity> finalMap = map; |
|||
list.forEach(item -> { |
|||
item.setStatYear(statYear); |
|||
item.setStatMonth(statMonth); |
|||
item.setStatDate(statDate); |
|||
if (finalMap.containsKey(item.getDeptId())) { |
|||
ScreenDeptEventStatEntity incr = finalMap.get(item.getDeptId()); |
|||
item.setEventIncr(incr.getEventCount()); |
|||
item.setLivelihoodIncr(incr.getLivelihoodCount()); |
|||
item.setDevelopIncr(incr.getDevelopCount()); |
|||
item.setLawIncr(incr.getLawCount()); |
|||
} |
|||
}); |
|||
insertBatch(list); |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
/** |
|||
* 获取大屏数据 |
|||
* |
|||
* @param formDTO |
|||
* @Param formDTO |
|||
* @Return {@link List< EventStatisticsResultDTO >} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/10/11 15:13 |
|||
*/ |
|||
@Override |
|||
public List<EventStatisticsResultDTO> getEventStat(EventStatisticsFormDTO formDTO) { |
|||
List<EventStatisticsResultDTO> result; |
|||
if (NumConstant.ONE_STR.equals(formDTO.getStatType())) { |
|||
//日期为当前日期前一天
|
|||
formDTO.setStatDate(DateUtils.format(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN)); |
|||
result = baseDao.getEventStatByDay(formDTO); |
|||
} else if (NumConstant.TWO_STR.equals(formDTO.getStatType())) { |
|||
//日期为本月
|
|||
formDTO.setStatDate(DateUtils.format(new Date(), DateUtils.DATE_PATTERN).substring(0, 7)); |
|||
result = baseDao.getEventStatByOther(formDTO); |
|||
} else if (NumConstant.THREE_STR.equals(formDTO.getStatType())) { |
|||
//日期为本年
|
|||
formDTO.setStatDate(DateUtils.format(new Date(), DateUtils.DATE_PATTERN).substring(0, 4)); |
|||
result = baseDao.getEventStatByOther(formDTO); |
|||
} else { |
|||
//自定义区间
|
|||
result = baseDao.getEventStatByOther(formDTO); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
} |
|||
@ -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.modules.screen.service.impl; |
|||
|
|||
import com.elink.esua.epdc.dto.events.form.ItemDailyStatisFormDTO; |
|||
import com.elink.esua.epdc.dto.events.result.ItemDailyStatisResultDTO; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemDao; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.joda.time.DateTime; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 项目统计相关接口 |
|||
*/ |
|||
@Service |
|||
public class ScreenServiceImpl implements ScreenService { |
|||
@Autowired |
|||
private ItemDao itemDao; |
|||
|
|||
|
|||
/** |
|||
* 数据统计-统计各诉求不同状态数据 |
|||
* 默认查询当前组织截止到昨天三大诉求的各状态数据 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public ItemDailyStatisResultDTO itemDailyStatis(ItemDailyStatisFormDTO formDTO) { |
|||
ItemDailyStatisResultDTO resultDTO = new ItemDailyStatisResultDTO(); |
|||
resultDTO.setDeptId(formDTO.getDeptId()); |
|||
resultDTO.setPeopleFlag(formDTO.getPeopleFlag()); |
|||
//1.入参时间有值的按时间查,没值的默认查截止到昨天的数据
|
|||
if(StringUtils.isEmpty(formDTO.getStatDate())&&StringUtils.isEmpty(formDTO.getStatMonth())&&StringUtils.isEmpty(formDTO.getStatYear())){ |
|||
DateTime dateTime = new DateTime(new Date()); |
|||
Date d = dateTime.plusDays(-1).toDate(); |
|||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|||
formDTO.setStatDate(df.format(d)); |
|||
} |
|||
//2.按条件统计数据
|
|||
resultDTO = itemDao.itemDailyStatis(formDTO); |
|||
return resultDTO; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,150 @@ |
|||
<?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.modules.screen.dao.ScreenDeptEventEfficiencyDao"> |
|||
<select id="getEventEfficiencyDaily" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity"> |
|||
SELECT a.id AS deptId, |
|||
a.`name` AS deptName, |
|||
a.pid, |
|||
a.pids, |
|||
'1' AS statType, |
|||
a.type_key AS deptLevel, |
|||
a.sort AS deptSort, |
|||
IFNULL(SUM(b.eventCount), 0) AS eventCount, |
|||
IFNULL(SUM(b.closedCount), 0) AS closedCount, |
|||
IFNULL(SUM(b.responseCount), 0) AS responseCount, |
|||
IFNULL(SUM(b.satisfiedCount), 0) AS satisfiedCount |
|||
FROM meta_sys_dept a |
|||
LEFT JOIN ( |
|||
SELECT ALL_DEPT_IDS, |
|||
COUNT(ID) AS eventCount, |
|||
COUNT(CASE ITEM_STATE WHEN '10' THEN ID END) AS closedCount, |
|||
COUNT(CASE WHEN processCount > 1 THEN ID END) AS responseCount, |
|||
COUNT(CASE WHEN EVALUATION_SCORE > 0 THEN ID END) AS satisfiedCount |
|||
FROM epdc_item a |
|||
LEFT JOIN ( |
|||
SELECT ITEM_ID, count(ID) AS 'processCount' |
|||
FROM epdc_item_handle_process |
|||
WHERE DEL_FLAG = '0' |
|||
GROUP BY ITEM_ID) b ON a.ID = b.ITEM_ID |
|||
WHERE DEL_FLAG = '0' |
|||
AND PEOPLE_FLAG is not null |
|||
<if test="statDate != null and statDate != ''"> |
|||
AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') <= #{statDate} |
|||
</if> |
|||
GROUP BY ALL_DEPT_IDS |
|||
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%') |
|||
WHERE a.del_flag = '0' |
|||
GROUP BY a.id |
|||
</select> |
|||
<select id="getEventEfficiencyMonthly" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity"> |
|||
SELECT a.id AS deptId, |
|||
a.`name` AS deptName, |
|||
a.pid, |
|||
a.pids, |
|||
'2' AS statType, |
|||
a.type_key AS deptLevel, |
|||
a.sort AS deptSort, |
|||
IFNULL(SUM(b.eventCount), 0) AS eventCount, |
|||
IFNULL(SUM(b.closedCount), 0) AS closedCount, |
|||
IFNULL(SUM(b.responseCount), 0) AS responseCount, |
|||
IFNULL(SUM(b.satisfiedCount), 0) AS satisfiedCount |
|||
FROM meta_sys_dept a |
|||
LEFT JOIN ( |
|||
SELECT ALL_DEPT_IDS, |
|||
COUNT(ID) AS eventCount, |
|||
COUNT(CASE |
|||
WHEN ITEM_STATE = '10' AND DATE_FORMAT(UPDATED_TIME, '%Y-%m') = #{statDate} |
|||
THEN ID END) AS closedCount, |
|||
COUNT(CASE WHEN DATE_FORMAT(b.CREATED_TIME, '%Y-%m') = #{statDate} THEN ID END) AS responseCount, |
|||
COUNT(CASE |
|||
WHEN DATE_FORMAT(EVALUATION_TIME, '%Y-%m') = #{statDate} AND EVALUATION_SCORE > 0 |
|||
THEN ID END) AS satisfiedCount |
|||
FROM epdc_item a |
|||
LEFT JOIN ( |
|||
SELECT a.ITEM_ID, |
|||
a.CREATED_TIME |
|||
FROM ( |
|||
SELECT b.ID, |
|||
b.ITEM_ID, |
|||
b.CREATED_TIME |
|||
FROM (SELECT ID |
|||
FROM epdc_item |
|||
WHERE DEL_FLAG = '0' |
|||
AND PEOPLE_FLAG IS NOT NULL |
|||
AND DATE_FORMAT(CREATED_TIME, '%Y-%m') = #{statDate}) a STRAIGHT_JOIN epdc_item_handle_process b |
|||
ON b.ITEM_ID = a.ID |
|||
AND b.DEL_FLAG = '0' |
|||
) a |
|||
WHERE a.ID = ( |
|||
SELECT ID |
|||
FROM epdc_item_handle_process |
|||
WHERE a.ITEM_ID = ITEM_ID |
|||
ORDER BY CREATED_TIME |
|||
LIMIT 1, 1 |
|||
)) b ON a.ID = b.ITEM_ID |
|||
WHERE DEL_FLAG = '0' |
|||
AND DATE_FORMAT(a.CREATED_TIME, '%Y-%m') = #{statDate} |
|||
AND PEOPLE_FLAG is not null |
|||
GROUP BY ALL_DEPT_IDS |
|||
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%') |
|||
WHERE a.del_flag = '0' |
|||
AND a.type_key = 'street_party' |
|||
GROUP BY a.id |
|||
</select> |
|||
<select id="getEventEfficiencyYearly" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventEfficiencyEntity"> |
|||
SELECT a.id AS deptId, |
|||
a.`name` AS deptName, |
|||
a.pid, |
|||
a.pids, |
|||
'3' AS statType, |
|||
a.type_key AS deptLevel, |
|||
a.sort AS deptSort, |
|||
IFNULL(SUM(b.eventCount), 0) AS eventCount, |
|||
IFNULL(SUM(b.closedCount), 0) AS closedCount, |
|||
IFNULL(SUM(b.responseCount), 0) AS responseCount, |
|||
IFNULL(SUM(b.satisfiedCount), 0) AS satisfiedCount |
|||
FROM meta_sys_dept a |
|||
LEFT JOIN ( |
|||
SELECT ALL_DEPT_IDS, |
|||
COUNT(ID) AS eventCount, |
|||
COUNT(CASE |
|||
WHEN ITEM_STATE = '10' AND DATE_FORMAT(UPDATED_TIME, '%Y') = #{statDate} |
|||
THEN ID END) AS closedCount, |
|||
COUNT(CASE WHEN DATE_FORMAT(b.CREATED_TIME, '%Y') = #{statDate} THEN ID END) AS responseCount, |
|||
COUNT(CASE |
|||
WHEN DATE_FORMAT(EVALUATION_TIME, '%Y') = #{statDate} AND EVALUATION_SCORE > 0 |
|||
THEN ID END) AS satisfiedCount |
|||
FROM epdc_item a |
|||
LEFT JOIN ( |
|||
SELECT a.ITEM_ID, |
|||
a.CREATED_TIME |
|||
FROM ( |
|||
SELECT b.ID, |
|||
b.ITEM_ID, |
|||
b.CREATED_TIME |
|||
FROM (SELECT ID |
|||
FROM epdc_item |
|||
WHERE DEL_FLAG = '0' |
|||
AND PEOPLE_FLAG IS NOT NULL |
|||
AND DATE_FORMAT(CREATED_TIME, '%Y') = #{statDate}) a STRAIGHT_JOIN epdc_item_handle_process b |
|||
ON b.ITEM_ID = a.ID |
|||
AND b.DEL_FLAG = '0' |
|||
) a |
|||
WHERE a.ID = ( |
|||
SELECT ID |
|||
FROM epdc_item_handle_process |
|||
WHERE a.ITEM_ID = ITEM_ID |
|||
ORDER BY CREATED_TIME |
|||
LIMIT 1, 1 |
|||
)) b ON a.ID = b.ITEM_ID |
|||
WHERE DEL_FLAG = '0' |
|||
AND DATE_FORMAT(a.CREATED_TIME, '%Y') = #{statDate} |
|||
AND PEOPLE_FLAG is not null |
|||
GROUP BY ALL_DEPT_IDS |
|||
) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%') |
|||
WHERE a.del_flag = '0' |
|||
AND a.type_key = 'street_party' |
|||
GROUP BY a.id |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,84 @@ |
|||
<?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.modules.screen.dao.ScreenDeptEventStatDao"> |
|||
<select id="getEventStat" resultType="com.elink.esua.epdc.modules.screen.entity.ScreenDeptEventStatEntity"> |
|||
SELECT a.id AS deptId, |
|||
a.`name` AS deptName, |
|||
a.pid, |
|||
a.pids, |
|||
a.type_key AS deptLevel, |
|||
a.sort AS deptSort, |
|||
IFNULL(SUM(b.eventCount), 0) AS 'eventCount', |
|||
IFNULL(SUM(b.livelihoodCount), 0) AS 'livelihoodCount', |
|||
IFNULL(SUM(b.developCount), 0) AS 'developCount', |
|||
IFNULL(SUM(b.lawCount), 0) AS 'lawCount' |
|||
FROM meta_sys_dept a |
|||
LEFT JOIN ( |
|||
SELECT ALL_DEPT_IDS, |
|||
SUM(total) AS 'eventCount', |
|||
SUM(livelihood) AS 'livelihoodCount', |
|||
SUM(develop) AS 'developCount', |
|||
SUM(law) AS 'lawCount' |
|||
FROM ( |
|||
SELECT ALL_DEPT_IDS, |
|||
total, |
|||
CASE PEOPLE_FLAG WHEN '0' THEN total END AS 'livelihood', |
|||
CASE PEOPLE_FLAG WHEN '1' THEN total END AS 'develop', |
|||
CASE PEOPLE_FLAG WHEN '2' THEN total END AS 'law' |
|||
FROM ( |
|||
SELECT ALL_DEPT_IDS, |
|||
PEOPLE_FLAG, |
|||
count(ID) AS total |
|||
FROM epdc_item |
|||
WHERE DEL_FLAG = '0' |
|||
AND PEOPLE_FLAG IS NOT NULL |
|||
<if test="statDate != null and statDate != ''"> |
|||
AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') <= #{statDate} |
|||
</if> |
|||
GROUP BY ALL_DEPT_IDS, PEOPLE_FLAG |
|||
) a |
|||
) t |
|||
GROUP BY ALL_DEPT_IDS |
|||
) b |
|||
ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%') |
|||
WHERE a.del_flag = '0' |
|||
GROUP BY a.id |
|||
</select> |
|||
<select id="getEventStatByDay" resultType="com.elink.esua.epdc.dto.screen.result.EventStatisticsResultDTO"> |
|||
SELECT DEPT_ID, |
|||
DEPT_NAME, |
|||
EVENT_COUNT, |
|||
LIVELIHOOD_COUNT, |
|||
DEVELOP_COUNT, |
|||
LAW_COUNT |
|||
FROM screen_dept_event_stat |
|||
WHERE PID = #{deptId} |
|||
AND STAT_DATE = #{startDate} |
|||
ORDER BY DEPT_SORT ASC, |
|||
CONVERT(DEPT_NAME USING gbk) ASC |
|||
</select> |
|||
|
|||
<select id="getEventStatByOther" resultType="com.elink.esua.epdc.dto.screen.result.EventStatisticsResultDTO"> |
|||
SELECT DEPT_ID, |
|||
DEPT_NAME, |
|||
SUM(EVENT_INCR) EVENT_COUNT, |
|||
SUM(LIVELIHOOD_INCR) LIVELIHOOD_COUNT, |
|||
SUM(DEVELOP_INCR) DEVELOP_COUNT, |
|||
SUM(LAW_INCR) LAW_COUNT |
|||
FROM screen_dept_event_stat |
|||
WHERE PID = #{deptId} |
|||
<if test="'2' == statType"> |
|||
AND STAT_MONTH = #{statDate} |
|||
</if> |
|||
<if test="'3' == statType"> |
|||
AND STAT_YEAR = #{statDate} |
|||
</if> |
|||
<if test="'4' == statType"> |
|||
AND STAT_DATE >= #{startDate} |
|||
AND STAT_DATE <= #{endDate} |
|||
</if> |
|||
ORDER BY DEPT_SORT ASC, |
|||
CONVERT(DEPT_NAME USING gbk) ASC |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue