Browse Source

Merge remote-tracking branch 'origin/feature/bssb_screen' into feature/bssb_screen

# 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.xml
feature/dangjian
wanggongfeng 3 years ago
parent
commit
46e4a9e670
  1. 92
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptDTO.java
  2. 10
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  3. 10
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java
  4. 7
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  5. 6
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml
  6. 42
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/ItemDailyStatisFormDTO.java
  7. 47
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/result/ItemDailyStatisResultDTO.java
  8. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemPendingHandleDTO.java
  9. 3
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemAppealPageResultDTO.java
  10. 131
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/ScreenDeptEventEfficiencyDTO.java
  11. 166
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/ScreenDeptEventStatDTO.java
  12. 19
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/form/DataStatisticsFormDTO.java
  13. 26
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/form/EventStatisticsFormDTO.java
  14. 44
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/result/EventStatisticsResultDTO.java
  15. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java
  16. 24
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java
  17. 8
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/PushToCityGridController.java
  18. 22
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java
  19. 4
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java
  20. 11
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java
  21. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/PushToCityGridService.java
  22. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemFusingDelayServiceImpl.java
  23. 137
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  24. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemTimeoutServiceImpl.java
  25. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/PushToCityGridServiceImpl.java
  26. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/.gitkeep
  27. 56
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenItemController.java
  28. 61
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventEfficiencyDao.java
  29. 66
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventStatDao.java
  30. 101
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/entity/ScreenDeptEventEfficiencyEntity.java
  31. 136
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/entity/ScreenDeptEventStatEntity.java
  32. 95
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenDeptEventEfficiencyService.java
  33. 59
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenDeptEventStatService.java
  34. 30
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenService.java
  35. 101
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventEfficiencyServiceImpl.java
  36. 135
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java
  37. 65
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenServiceImpl.java
  38. 175
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml
  39. 150
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml
  40. 84
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventStatDao.xml

92
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptDTO.java

@ -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;
}

10
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java

@ -346,7 +346,7 @@ public class SysDeptController {
}
/**
* @param [deptId]
* @param deptId
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @describe: 获得部门类型
* @author wangtong
@ -513,4 +513,12 @@ public class SysDeptController {
return new Result<SysDeptDTO>().ok(sysDeptService.getDept(formDTO));
}
@GetMapping("option/list")
@ApiOperation("下拉列表")
public Result<List<DeptDTO>> listOption(@RequestParam Map<String, Object> params) {
List<DeptDTO> list = sysDeptService.listDefault(params);
return new Result<List<DeptDTO>>().ok(list);
}
}

10
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java

@ -34,6 +34,16 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
List<SysDeptDTO> list(Map<String, Object> params);
/**
* 默认列表无数据权限
*
* @param params
* @return java.util.List<com.elink.esua.epdc.dto.DeptDTO>
* @author zhy
* @date 2022/10/11 14:46
*/
List<DeptDTO> listDefault(Map<String, Object> params);
SysDeptDTO get(Long id);
void save(SysDeptDTO dto);

7
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java

@ -129,6 +129,13 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
return TreeUtils.build(dtoList);
}
@Override
public List<DeptDTO> listDefault(Map<String, Object> params) {
List<SysDeptEntity> entityList = baseDao.getList(params);
return ConvertUtils.sourceToTarget(entityList, DeptDTO.class);
}
@Override
public List<SysSimpleDeptDTO> subList(String pid) {
QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>();

6
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml

@ -12,6 +12,12 @@
#{id}
</foreach>
</if>
<if test="pid != null and pid != ''">
AND t1.pid = #{pid}
</if>
<if test="eventContent != null and eventContent != ''">
AND t1.type_key = #{typeKey}
</if>
order by t1.sort asc
</select>

42
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/ItemDailyStatisFormDTO.java

@ -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;
}

47
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/result/ItemDailyStatisResultDTO.java

@ -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;
}

5
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemPendingHandleDTO.java

@ -75,6 +75,11 @@ public class ItemPendingHandleDTO implements Serializable {
*/
private String isRemind;
/**
* 剩余小时数
*/
private Integer remainTime;
/**
* 头像
*/

3
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemAppealPageResultDTO.java

@ -116,7 +116,8 @@ public class ItemAppealPageResultDTO implements Serializable {
private String evaluationTime;
/**
* 是否提醒社区处理(1:提示)
* 是否提醒社区处理(1:红灯2黄灯3绿灯)
*/
private String isRemind;
}

131
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/ScreenDeptEventEfficiencyDTO.java

@ -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;
}

166
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/ScreenDeptEventStatDTO.java

@ -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;
}

19
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/form/DataStatisticsFormDTO.java

@ -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;
}

26
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/form/EventStatisticsFormDTO.java

@ -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;
}

44
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/result/EventStatisticsResultDTO.java

@ -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;
}

5
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java

@ -472,10 +472,11 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
itemEntity.setPeopleFlag("0");//民生诉求
//民生诉求所属网格对应的所属社区的市中心编码
Result<CompleteDeptDTO> result = adminFeignClient.getCompleteDept(issueEntity.getGridId());
if(!result.success()){
if (!result.success()) {
throw new RenException(result.getMsg());
}
itemEntity.setSerialNum(itemServiceImpl.getSerialNum("MS" + result.getData().getCommunityDisCenterZoningCode()));
String code = result.getData().getCommunityDisCenterZoningCode();
itemEntity.setSerialNum(itemServiceImpl.getSerialNum("MS" + code));
return itemEntity;
}

24
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java

@ -349,6 +349,19 @@ public class ItemController {
return new Result<PageData<ItemAppealPageResultDTO>>().ok(page);
}
/**
* @describe: 北尚诉求列表(不满意列表)
* @author wgf
* @date 2022/10/10 08:39
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.item.result.ItemAppealPageResultDTO>>
*/
@GetMapping("getItemAppealPageUnsatisfactory")
public Result<PageData<ItemAppealPageResultDTO>> getItemAppealPageUnsatisfactory(@RequestParam Map<String, Object> params){
PageData<ItemAppealPageResultDTO> page = itemService.getItemAppealPageUnsatisfactory(params);
return new Result<PageData<ItemAppealPageResultDTO>>().ok(page);
}
/**
* @describe: 北尚诉求详情
* @author wangtong
@ -401,5 +414,16 @@ public class ItemController {
ValidatorUtils.validateEntity(formDto);
return itemService.pushItemProcess(formDto);
}
/**
* @describe: 数据统计页面-北上诉求列表
* 逻辑同方法 getItemAppealPage
*/
@GetMapping("getItemStatisListPage")
public Result<PageData<ItemAppealPageResultDTO>> getItemStatisListPage(@RequestParam Map<String, Object> params){
PageData<ItemAppealPageResultDTO> page = itemService.getItemStatisListPage(params);
return new Result<PageData<ItemAppealPageResultDTO>>().ok(page);
}
}

8
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/PushToCityGridController.java

@ -6,8 +6,6 @@ import com.elink.esua.epdc.modules.item.service.PushToCityGridService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.management.relation.RelationSupport;
@RestController
@RequestMapping("PushToCity")
public class PushToCityGridController {
@ -52,7 +50,7 @@ public class PushToCityGridController {
*/
@PostMapping("AppealReporting")
public Result AppealReporting(String processId, String source){
return pushToCityGridService.AppealReporting(processId, source);
return pushToCityGridService.appealReporting(processId, source);
}
/**
@ -65,7 +63,7 @@ public class PushToCityGridController {
*/
@PostMapping("ReportRejection")
public Result ReportRejection(ItemHandleProcessDTO dto){
return pushToCityGridService.ReportRejection(dto.getItemId());
return pushToCityGridService.reportRejection(dto.getItemId());
}
/**
@ -78,6 +76,6 @@ public class PushToCityGridController {
*/
@PostMapping("AppealHandling")
public Result AppealHandling(@RequestBody ItemHandleProcessDTO dto){
return pushToCityGridService.AppealHandling(dto);
return pushToCityGridService.appealHandling(dto);
}
}

22
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java

@ -18,16 +18,18 @@
package com.elink.esua.epdc.modules.item.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.item.ItemHandleProcessDTO;
import com.elink.esua.epdc.dto.item.form.*;
import com.elink.esua.epdc.dto.result.KpiItemTimeLimitByDeptResultDTO;
import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO;
import com.elink.esua.epdc.dto.events.form.GroupFormDTO;
import com.elink.esua.epdc.dto.events.form.ItemDailyStatisFormDTO;
import com.elink.esua.epdc.dto.events.result.ItemDailyStatisResultDTO;
import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO;
import com.elink.esua.epdc.dto.item.ItemDTO;
import com.elink.esua.epdc.dto.item.ItemHandleProcessDTO;
import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO;
import com.elink.esua.epdc.dto.item.form.*;
import com.elink.esua.epdc.dto.item.result.*;
import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO;
import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO;
import com.elink.esua.epdc.dto.result.KpiItemTimeLimitByDeptResultDTO;
import com.elink.esua.epdc.modules.item.entity.ItemEntity;
import com.elink.esua.epdc.modules.item.entity.ItemHandleProcessEntity;
import org.apache.ibatis.annotations.Mapper;
@ -409,6 +411,15 @@ public interface ItemDao extends BaseDao<ItemEntity> {
*/
List<ItemAppealPageResultDTO> getItemAppealPage(Map<String, Object> params);
/**
* @describe: 北尚诉求列表(不满意列表)
* @author wgf
* @date 2022/10/10 08:39
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.item.result.ItemAppealPageResultDTO>>
*/
List<ItemAppealPageResultDTO> getItemAppealPageUnsatisfactory(Map<String, Object> params);
/**
* @return com.elink.esua.epdc.dto.item.result.ItemAppealDetailResultDTO
* @describe: 北尚诉求详情
@ -466,6 +477,9 @@ public interface ItemDao extends BaseDao<ItemEntity> {
*/
List<ItemHandleProcessDTO> listItemHandleDept();
ItemDailyStatisResultDTO itemDailyStatis(ItemDailyStatisFormDTO formDTO);
/**
* 类别分析
* @param formDTO

4
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java

@ -153,6 +153,10 @@ public class ItemEntity extends BaseEpdcEntity {
*/
private Double issueLongitude;
/**
* 满意度评价状态(0-不可评价1-可评价)
*/
private String evaluationState;
/**
* 满意度评价得分
*/

11
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java

@ -544,6 +544,15 @@ public interface ItemService extends BaseService<ItemEntity> {
*/
PageData<ItemAppealPageResultDTO> getItemAppealPage(Map<String, Object> params);
/**
* @describe: 北尚诉求列表(不满意列表)
* @author wgf
* @date 2022/10/10 08:39
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.item.result.ItemAppealPageResultDTO>>
*/
PageData<ItemAppealPageResultDTO> getItemAppealPageUnsatisfactory(Map<String, Object> params);
/**
* @describe: 北尚诉求详情
* @author wangtong
@ -610,6 +619,8 @@ public interface ItemService extends BaseService<ItemEntity> {
*/
String getSqid(String itemId);
PageData<ItemAppealPageResultDTO> getItemStatisListPage(Map<String, Object> params);
/**
* 大屏-类别分析
* @param formDTO

6
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/PushToCityGridService.java

@ -107,7 +107,7 @@ public interface PushToCityGridService {
* @author LZN
* @date 2022/9/19 10:22
*/
Result AppealReporting(String processId,String source);
Result appealReporting(String processId, String source);
/**
* 事件感知
@ -127,7 +127,7 @@ public interface PushToCityGridService {
* @author LZN
* @date 2022/9/19 10:43
*/
Result ReportRejection(String id);
Result reportRejection(String id);
/**
* 诉求处理
@ -137,7 +137,7 @@ public interface PushToCityGridService {
* @author LZN
* @date 2022/9/19 11:01
*/
Result AppealHandling(ItemHandleProcessDTO dto);
Result appealHandling(ItemHandleProcessDTO dto);
/**
* 2.8 诉求退件

2
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemFusingDelayServiceImpl.java

@ -77,7 +77,7 @@ public class ItemFusingDelayServiceImpl extends BaseServiceImpl<ItemFusingDelayD
public PageData<ItemHandleListDTO> page(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {

137
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -228,7 +228,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public PageData<ItemPendingHandleDTO> listOfItemsForPCEnd(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {
@ -280,7 +280,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public List<ItemPendingHandleDTO> listEqPc(ItemWorkListFormDTO formDTO) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (formDTO.getStreetId() != null && !"".equals(formDTO.getStreetId())) {
@ -325,7 +325,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public PageData<ItemPendingHandleDTO> listOfItemsForPCReject(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {
@ -365,7 +365,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public List<ItemPendingHandleDTO> rejectListEqPc(ItemWorkListFormDTO formDTO) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (formDTO.getStreetId() != null && !"".equals(formDTO.getStreetId())) {
@ -495,11 +495,11 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public Result submitLawItem(ItemLawSubmitDTO formDto) {
UserDetail userDetail = SecurityUser.getUser();
if (null == userDetail) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (!(StringUtils.isNotBlank(userDetail.getTypeKey())
&& OrganizationTypeConstant.ORG_TYPE_STREET_PARTY.equals(userDetail.getTypeKey()))) {
throw new RuntimeException("请用街道账号进行上报");
throw new RenException("请用街道账号进行上报");
}
ItemEntity itemEntity = new ItemEntity();
/**
@ -515,6 +515,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
itemEntity.setDistributeTime(new Date());
itemEntity.setGrid("执法诉求" + userDetail.getDeptName());
itemEntity.setGridId(userDetail.getDeptId());
itemEntity.setItemContent(formDto.getLawContent());
itemEntity.setItemVoice(formDto.getItemVoice());
itemEntity.setDuration(formDto.getDuration());
@ -535,8 +536,18 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
if (!dtoResult.success()) {
throw new RenException(dtoResult.getMsg());
}
// 因为是街道账号,所以上级一定是市北区委
Long pids = dtoResult.getData().getPid();
String pnames = dtoResult.getData().getParentName();
itemEntity.setParentDeptIds(pids + "");
itemEntity.setParentDeptNames(pnames);
itemEntity.setAllDeptIds(pids + "," + userDetail.getDeptId());
itemEntity.setAllDeptNames(pnames + "-" + userDetail.getDeptName());
// 流水号
itemEntity.setSerialNum(getSerialNum("ZF" + dtoResult.getData().getDisCenterZoningCode()));
String code = dtoResult.getData().getDisCenterZoningCode();
itemEntity.setSerialNum(getSerialNum("ZF" + code));
baseDao.insert(itemEntity);
//插入项目部门关联表
itemDeptService.savePeopleSubmitInfo(itemEntity);
@ -1279,12 +1290,12 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public List<ItemHandleProgressResultDTO> listOfItemHandleProgressByMobile(String itemId) {
List<ItemHandleProgressResultDTO> list = baseDao.selectListOfItemHandleProgressByMobile(itemId);
// 处理多次拼接处理人信息问题
for(ItemHandleProgressResultDTO dto : list){
for (ItemHandleProgressResultDTO dto : list) {
String advice = dto.getAdvice();
// 对包含【h_s】的数据进行重新组装
if(advice.contains("h_s")){
String hsStr = advice.substring(advice.indexOf("h_s"),advice.length());
String adviceOld = advice.substring(0,advice.indexOf(" 办理人:"));
if (advice.contains("h_s") && advice.contains(" 办理人:")) {
String hsStr = advice.substring(advice.indexOf("h_s"), advice.length());
String adviceOld = advice.substring(0, advice.indexOf(" 办理人:"));
String adviceNew = adviceOld + hsStr;
dto.setAdvice(adviceNew);
}
@ -1385,7 +1396,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
// 发送菜单消息-待处理项目-吹哨部门
this.sendWhistlingDeptItemHandleMenuNotice(deptIds, null);
// 网格吹哨,上报市平台
pushToCityGridService.AppealReporting(handleProcessEntity.getId(), NumConstant.ZERO_STR);
pushToCityGridService.appealReporting(handleProcessEntity.getId(), NumConstant.ZERO_STR);
log.info("网格吹哨,上报市平台-结束");
// 上报网格化平台(社区吹哨)
} else if (ItemHandleCategoryEnum.HANDLE_REPORT.getValue() == dto.getHandleCategory()) {
@ -1397,7 +1408,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
log.info("处理项目-上报网格化平台-if结束");
//社区吹哨,上报市平台
pushToCityGridService.AppealReporting(handleProcessEntity.getId(), NumConstant.ZERO_STR);
pushToCityGridService.appealReporting(handleProcessEntity.getId(), NumConstant.ZERO_STR);
log.info("社区吹哨-上报市平台-结束");
// 结案申请
} else if (ItemHandleCategoryEnum.HANDLE_CLOSING_CASE_APPLY.getValue() == dto.getHandleCategory()) {
@ -1458,11 +1469,11 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
longTreeSet.addAll(newDeptIds);
List<Long> deptIds = new ArrayList<>(longTreeSet);
// 网格结案,社区结案,上报市平台
pushToCityGridService.AppealReporting(handleProcessEntity.getId(), NumConstant.ZERO_STR);
// 网格结案申请,社区结案申请,上报市平台
// pushToCityGridService.AppealReporting(handleProcessEntity.getId(), NumConstant.ZERO_STR);
// 发送菜单消息-待处理项目-吹哨部门
this.sendWhistlingDeptItemHandleMenuNotice(deptIds, null);
pushToCityGridService.AppealHandling(ConvertUtils.sourceToTarget(handleProcessEntity, ItemHandleProcessDTO.class));
pushToCityGridService.appealHandling(ConvertUtils.sourceToTarget(handleProcessEntity, ItemHandleProcessDTO.class));
log.info("处理项目-结案申请-if结束");
} else {
handleProcessEntity.setState(dto.getHandleCategory());
@ -1911,7 +1922,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
ItemWorkListFormDTO formDTO = new ItemWorkListFormDTO();
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (formDTO.getStreetId() != null && !"".equals(formDTO.getStreetId())) {
@ -2143,7 +2154,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
*/
private SendEventFormDto packageSendEventEntity(ItemEntity itemEntity, ItemHandleSubmitFormDTO dto) throws Exception {
SendEventFormDto sendDto = new SendEventFormDto();
SendInputInfoFormDto formDto = new SendInputInfoFormDto();
//推送类别(事件上报)
sendDto.setSENDTYPE(CommonConstants.SEND_TYPE);
//上报
@ -2165,7 +2176,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
//事件来源
sendDto.setSJLY(CommonConstants.PARTY_EVENT_SOURCE_ZF);
//备注
sendDto.setBZXX(getItemLawNote(itemEntity.getId()));
sendDto.setBZXX(getItemLawNote(itemEntity.getId(), itemEntity.getSerialNum()));
}
//执法诉求和发展诉求gridId存的是街道id,需要单独查
Result<SysDeptDTO> streetResult = adminFeignClient.getSysDeptInfo(itemEntity.getGridId());
@ -2191,9 +2202,9 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
}
//备注
log.info("上报网格化平台dto:" + dto);
sendDto.setBZXX(dto.getHandleAdvice());
sendDto.setBZXX(dto.getHandleAdvice()+" 诉求编码:" + itemEntity.getSerialNum());
if (StringUtils.isNotBlank(dto.getHandleAdviceRemark())) {
sendDto.setBZXX(sendDto.getBZXX() + "\n不予受理详细说明:" + dto.getHandleAdviceRemark());
sendDto.setBZXX(sendDto.getBZXX() + "\n不予受理详细说明:" + dto.getHandleAdviceRemark() + "\n诉求编码:" + itemEntity.getSerialNum());
}
Result<DeptInfoCodeDTO> deptResult = adminFeignClient.getDeptInfoCode(itemEntity.getGridId());
@ -2305,7 +2316,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
}
//查询所对应的大类
CategoryEntity thirdCate = categoryDao.selectById(thirdId);
if (null == thirdCate) {
if (null == thirdCate || StringUtils.isBlank(thirdCate.getEventCategoryCode())) {
sendDto.setSJLYU("21");
sendDto.setSJDL("2199");
return;
@ -2344,13 +2355,14 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return result;
}
private String getItemLawNote(String itemId) {
private String getItemLawNote(String itemId, String serialNum) {
QueryWrapper<ItemLawEntity> wrapper = new QueryWrapper<>();
wrapper.eq("item_id", itemId);
wrapper.eq("del_flag", "0");
ItemLawEntity itemLaw = itemLawDao.selectOne(wrapper);
String result = "主办单位:" + itemLaw.getHostUnit() + "\n\n"
+ "协办单位:" + itemLaw.getAssistUnit();
+ "协办单位:" + itemLaw.getAssistUnit() + "\n\n"
+ "诉求编码:" + serialNum;
return result;
}
@ -2832,7 +2844,12 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
ItemGridPlatformHandleStatusEnum.HANDLE_YQSQ.getValue() == dto.getState() ||
ItemGridPlatformHandleStatusEnum.HANDLE_SQBJ.getValue() == dto.getState() ||
ItemGridPlatformHandleStatusEnum.HANDLE_XSSQ.getValue() == dto.getState()) {
pushToCityGridService.AppealReporting(dto.getId(), NumConstant.ONE_STR);
// pushToCityGridService.appealReporting(dto.getId(), NumConstant.ONE_STR);
}
// 网格化平台,处置完成
if (ItemGridPlatformHandleStatusEnum.HANDLE_CL.getValue() == dto.getState()) {
pushToCityGridService.appealHandling(dto);
}
}
@ -3145,9 +3162,17 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
} else if (NumConstant.ONE_STR.equals(formDto.getPeopleFlag())) {
//执法诉求所属街道的市中心编码
Result<SysDeptDTO> dtoResult = adminFeignClient.getSysDeptInfo(entity.getGridId());
if (!dtoResult.success()) {
if (dtoResult.success()) {
code = dtoResult.getData().getDisCenterZoningCode();
// 因为是街道账号,所以上级一定是市北区委
Long pids = dtoResult.getData().getPid();
String pnames = dtoResult.getData().getParentName();
entity.setParentDeptIds(pids + "");
entity.setParentDeptNames(pnames);
entity.setAllDeptIds(pids + "," + entity.getGridId());
entity.setAllDeptNames(pnames + "-" + entity.getGrid());
}
entity.setSerialNum(getSerialNum("FZ" + code));
}
baseDao.insert(entity);
@ -3355,7 +3380,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public List<ItemPendingHandleDTO> unExportList(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {
@ -3395,7 +3420,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public List<ItemPendingHandleDTO> rejectUnexport(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {
@ -3471,6 +3496,23 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
}
@Override
public PageData<ItemAppealPageResultDTO> getItemAppealPageUnsatisfactory(@RequestParam Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
//部门ID列表
List<Long> deptIdList = user.getDeptIdList();
params.put("deptIdList", null);
if (null != deptIdList && deptIdList.size() > 0) {
params.put("deptIdList", deptIdList);
}
IPage<ItemAppealPageResultDTO> page = getPage(params);
List<ItemAppealPageResultDTO> list = baseDao.getItemAppealPageUnsatisfactory(params);
Map<String, Long> map = listItemHandleDept();
list.forEach(item -> item.setItemHandleDeptId(map.get(item.getId())));
return new PageData<>(list, page.getTotal());
}
@Override
public Result<ItemAppealDetailResultDTO> getItemAppealDetail(String id) {
ItemAppealDetailResultDTO result = baseDao.getItemAppealDetail(id);
@ -3503,7 +3545,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public PageData<ItemExaminePageResultDTO> getExaminePage(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
params.put("deptId", user.getDeptId());
IPage<ItemExaminePageResultDTO> page = getPage(params);
@ -3518,7 +3560,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
formDTO.setDeptId(user.getDeptId());
List<ItemExaminePageResultDTO> list = baseDao.getExaminePageEqPc(formDTO);
@ -3530,7 +3572,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public Result examineCase(ExamineCaseFormDTO formDto) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
ItemHandleProcessEntity process = new ItemHandleProcessEntity();
@ -3550,12 +3592,12 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
throw new RenException("审批标识有误");
}
itemHandleProcessDao.insert(process);
//同意的时候,上报诉求处理
if (NumConstant.ZERO_STR.equals(formDto.getCheckFlag())) {
// 社区审批,上报市平台
pushToCityGridService.AppealReporting(process.getId(), NumConstant.ZERO_STR);
//pushToCityGridService.AppealHandling(ConvertUtils.sourceToTarget(process, ItemHandleProcessDTO.class));
}
// // 结案申请,同意的时候,上报诉求处理
// if (NumConstant.ZERO_STR.equals(formDto.getCheckFlag())) {
// // 社区审批,上报市平台
//// pushToCityGridService.AppealReporting(process.getId(), NumConstant.ZERO_STR);
// //pushToCityGridService.AppealHandling(ConvertUtils.sourceToTarget(process, ItemHandleProcessDTO.class));
// }
if ("0".equals(formDto.getCheckFlag())) {
//发送结案申请至街道网格化平台
@ -3643,7 +3685,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
public String getSerialNum(String prefix) {
String serialNum = prefix;
String dateStr = DateUtils.format(new Date(), DateUtils.DATE_TIME);
serialNum = serialNum + dateStr + "-";
serialNum = serialNum + "-" + dateStr + "-";
String key = RedisKeys.getSerialNumKey(serialNum);
String numStr;
@ -3724,6 +3766,8 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
itemHandleProcessDto.setGridPartyname("结案");
itemHandleProcessDto.setGridTaskcnname("区中心");
item.setItemState(ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue());
// 可以进行评价了
item.setEvaluationState(NumConstant.ONE_STR);
updateById(item);
} else if ("1".equals(formDto.getState())) {
itemHandleProcessDto.setState(ItemGridPlatformHandleStatusEnum.HANDLE_BH.getValue());
@ -3746,7 +3790,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
if ("1".equals(formDto.getState())) {
// 上报驳回,上报市平台
log.info("上报驳回,上报市平台" + itemHandleProcessDto.getId());
pushToCityGridService.ReportRejection(itemHandleProcessDto.getId());
pushToCityGridService.reportRejection(itemHandleProcessDto.getId());
} else if ("0".equals(formDto.getState())) {
// 诉求审核,上报市平台
pushToCityGridService.appealAudit(itemHandleProcessDto.getId());
@ -3880,6 +3924,21 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return "";
}
/**
* @describe: 数据统计页面-北上诉求列表
* 逻辑同方法 getItemAppealPage
*/
@Override
public PageData<ItemAppealPageResultDTO> getItemStatisListPage(@RequestParam Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
IPage<ItemAppealPageResultDTO> page = getPage(params);
List<ItemAppealPageResultDTO> list = baseDao.getItemAppealPage(params);
Map<String, Long> map = listItemHandleDept();
list.forEach(item -> item.setItemHandleDeptId(map.get(item.getId())));
return new PageData<>(list, page.getTotal());
}
@Override
public List<CategoryAnalysisPieResultDTO> categoryAnalysis(ScreenTotalFormDTO formDTO) {

5
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemTimeoutServiceImpl.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
@ -115,7 +116,7 @@ public class ItemTimeoutServiceImpl extends BaseServiceImpl<ItemTimeoutDao, Item
public PageData<ItemTimeOutDTO> listOfItemsForPCEnd(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {
@ -172,7 +173,7 @@ public class ItemTimeoutServiceImpl extends BaseServiceImpl<ItemTimeoutDao, Item
public List<ItemTimeOutDTO> itemOutExportList(Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (null == user) {
throw new RuntimeException("获取用户信息失败");
throw new RenException("获取用户信息失败");
}
if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) {
if (params.get("streetId") != null && !"".equals(params.get("streetId"))) {

6
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/PushToCityGridServiceImpl.java

@ -439,7 +439,7 @@ public class PushToCityGridServiceImpl implements PushToCityGridService {
* @date 2022/9/19 10:22
*/
@Override
public Result AppealReporting(String processId, String source) {
public Result appealReporting(String processId, String source) {
ItemHandleProcessToCityResultDTO item = itemHandleProcessDao.getAppealReporting(processId);
if (null == item) {
log.error("流程节点不存在");
@ -528,7 +528,7 @@ public class PushToCityGridServiceImpl implements PushToCityGridService {
* @date 2022/9/19 10:44
*/
@Override
public Result ReportRejection(String id) {
public Result reportRejection(String id) {
String ids = id; // ItemGridPlatformHandleStatusEnum.HANDLE_BH.getValue();
ItemHandleProcessToCityResultDTO item = itemHandleProcessDao.getReportRejection(ids);
if (null == item) {
@ -587,7 +587,7 @@ public class PushToCityGridServiceImpl implements PushToCityGridService {
* @date 2022/9/19 11:02
*/
@Override
public Result AppealHandling(ItemHandleProcessDTO processDTO) {
public Result appealHandling(ItemHandleProcessDTO processDTO) {
String id = processDTO.getId();
AppealHandlingToCityResultDTO item = itemHandleProcessDao.getAppealHandling(id, processDTO.getItemId());

0
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/.gitkeep

56
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenItemController.java

@ -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));
}
}

61
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventEfficiencyDao.java

@ -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);
}

66
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventStatDao.java

@ -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);
}

101
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/entity/ScreenDeptEventEfficiencyEntity.java

@ -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;
}

136
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/entity/ScreenDeptEventStatEntity.java

@ -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;
}

95
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenDeptEventEfficiencyService.java

@ -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);
}

59
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenDeptEventStatService.java

@ -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);
}

30
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenService.java

@ -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);
}

101
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventEfficiencyServiceImpl.java

@ -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));
}
}

135
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java

@ -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;
}
}

65
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenServiceImpl.java

@ -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;
}
}

175
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -1739,6 +1739,9 @@
SELECT i.id,
i.NICK_NAME,
i.CREATED_TIME,
case when (getworkminute(i.CREATED_TIME,now()) / 60 > 8) then '1'
when (getworkminute(i.CREATED_TIME,now()) / 60 > 6 and getworkminute(i.CREATED_TIME,now()) / 60 &lt;=8) then '2'
when (getworkminute(i.CREATED_TIME,now()) / 60 &lt;= 6) then '3' else '' end as isRemind,
i.ITEM_STATE,
i.SERIAL_NUM,
i.GRID as gridName,
@ -1765,8 +1768,7 @@
else ''
end as evaluationScoreName,
i.EVALUATION_CONTENT,
i.EVALUATION_TIME,
(case when (process.STATE = 1001 and HOUR( timediff( now(), i.CREATED_TIME) ) >= 24) then '1' else '' end) as isRemind
i.EVALUATION_TIME
FROM epdc_item i
left join (
select b.ID,b.ITEM_ID,b.CREATED_TIME,b.state
@ -1826,8 +1828,121 @@
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( i.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<!-- 数据统计页面列表查询条件 -->
<if test="deptId != null and deptId != ''">
AND i.all_dept_ids LIKE concat('%', trim(#{deptId}), '%')
</if>
<if test="peopleFlag != null and peopleFlag != ''">
AND i.people_flag = #{peopleFlag}
</if>
<if test="statDate != null and statDate != ''">
AND DATE_FORMAT(i.created_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{statDate}
</if>
<if test="statMonth != null and statMonth != ''">
AND DATE_FORMAT(i.created_time,'%Y-%m') = #{statMonth}
</if>
<if test="statYear != null and statYear != ''">
AND DATE_FORMAT(i.created_time,'%Y') = #{statYear}
</if>
order by i.CREATED_TIME desc
</select>
<select id="getItemAppealPageUnsatisfactory" resultType="com.elink.esua.epdc.dto.item.result.ItemAppealPageResultDTO">
SELECT i.id,
i.NICK_NAME,
i.CREATED_TIME,
i.ITEM_STATE,
i.SERIAL_NUM,
i.GRID as gridName,
SUBSTRING_INDEX(REPLACE(i.PARENT_DEPT_NAMES,'市北区委-',''),'-',1) as streetName,
SUBSTRING_INDEX(REPLACE(i.PARENT_DEPT_NAMES,'市北区委-',''),'-',-1) as communityName,
CASE i.ITEM_STATE
WHEN '0' THEN '处理中'
WHEN '10' THEN '已结案'
ELSE ''
END AS itemStateName,
i.ITEM_CONTENT,
i.PEOPLE_FLAG,
CASE i.PEOPLE_FLAG
WHEN '0' THEN '民生诉求'
WHEN '1' THEN '发展诉求'
WHEN '2' THEN '执法诉求'
ELSE ''
END AS peopleFlagName,
i.EVALUATION_SCORE,
case i.EVALUATION_SCORE
when '0' then '不满意'
when '1' then '基本满意'
when '2' then '非常满意'
else ''
end as evaluationScoreName,
i.EVALUATION_CONTENT,
i.EVALUATION_TIME,
(case when (process.STATE = 1001 and HOUR( timediff( now(), i.CREATED_TIME) ) >= 24) then '1' else '' end) as isRemind
FROM epdc_item i
left join (
select b.ID,b.ITEM_ID,b.CREATED_TIME,b.state
from epdc_item_handle_process b
where b.DEL_FLAG = '0'
and b.CREATED_TIME = (
SELECT
max(CREATED_TIME)
from epdc_item_handle_process
where b.ITEM_ID = ITEM_ID
and DEL_FLAG = '0'
)
and (b.HANDLER_DEPT != '网格化平台' or (b.HANDLER_DEPT = '网格化平台' and b.STATE in (1060,1065)))
) process on process.ITEM_ID = i.ID
where
i.DEL_FLAG='0'
and i.EVALUATION_SCORE = '0'
and IS_PEOPLE = '1'
<if test="appealType != null and appealType != ''">
and i.PEOPLE_FLAG = #{appealType}
</if>
<if test="itemState != null and itemState != ''">
and i.ITEM_STATE = #{itemState}
</if>
<if test="deptIdList != null and deptIdList.size() > 0">
AND i.GRID_ID IN
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
<if test="gridId != null and gridId != ''">
AND (i.GRID_ID = #{gridId}
OR find_in_set(#{gridId},i.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND (i.GRID_ID = #{streetId}
OR find_in_set(#{streetId},i.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},i.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},i.ALL_DEPT_IDS))
</if>
<if test="userId != null and userId != ''">
and i.USER_ID = #{userId}
</if>
<if test="mobile != null and mobile != ''">
and i.MOBILE = #{mobile}
</if>
<if test="itemContent != null and itemContent != ''">
and i.ITEM_CONTENT like '%${itemContent}%'
</if>
<if test="serialNum != null and serialNum != ''">
and i.SERIAL_NUM like '%${serialNum}%'
</if>
<if test="evaluationScore != null and evaluationScore != ''">
and i.EVALUATION_SCORE = #{evaluationScore}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( i.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
order by i.CREATED_TIME desc
</select>
<resultMap id="appealDetailMap" type="com.elink.esua.epdc.dto.item.result.ItemAppealDetailResultDTO">
<result property="id" column="ID"/>
<result property="nickName" column="NICK_NAME"/>
@ -2037,6 +2152,62 @@
b.ITEM_ID
</select>
<select id="itemDailyStatis" resultType="com.elink.esua.epdc.dto.events.result.ItemDailyStatisResultDTO">
SELECT
COUNT(a.id)total,
SUM(a.ITEM_STATE='10')closedTotal,
sum((case when a.ITEM_STATE='0' and b.STATE = 1001 then 1 else 0 end))pendingTotal,
sum((case when a.ITEM_STATE='0' and b.STATE != 1001 then 1 else 0 end))processingTotal,
sum((case when a.ITEM_STATE='0' and getworkminute(a.created_time,'2022-10-08 12:00:00')>=480 then 1 else 0 end))redTotal,
sum(
(case when a.ITEM_STATE='0'
and getworkminute(a.created_time,'2022-10-08 12:00:00')>360
and getworkminute(a.created_time,'2022-10-08 12:00:00')<![CDATA[ <= ]]>480
then 1 else 0 end)
)yellowTotal,
sum((case when a.ITEM_STATE='0' and getworkminute(a.created_time,'2022-10-08 12:00:00')<![CDATA[ <= ]]> 360 then 1 else 0 end))greenTotal
FROM
epdc_item a
LEFT JOIN (
select h.id,h.item_id,h.created_time,h.state
from epdc_item_handle_process h
where h.del_flag = '0'
and h.created_time = (
select max(created_time)
from epdc_item_handle_process
where h.item_id = item_id
and del_flag = '0'
)
GROUP BY h.item_id
)b ON a.id = b.item_id
WHERE
a.del_flag = '0'
AND a.is_people = '1'
AND a.event_id is NULL
AND a.issue_id is NULL
<if test="deptId != null and deptId != ''">
AND a.all_dept_ids LIKE concat('%', trim(#{deptId}), '%')
</if>
<if test="peopleFlag != null and peopleFlag != ''">
AND a.people_flag = #{peopleFlag}
</if>
<if test="statDate != null and statDate != ''">
AND DATE_FORMAT(a.created_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{statDate}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(a.created_time,'%Y-%m-%d') >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(a.created_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
</if>
<if test="statMonth != null and statMonth != ''">
AND DATE_FORMAT(a.created_time,'%Y-%m') = #{statMonth}
</if>
<if test="statYear != null and statYear != ''">
AND DATE_FORMAT(a.created_time,'%Y') = #{statYear}
</if>
</select>
<select id="categoryAnalysis" resultType="com.elink.esua.epdc.dto.item.result.CategoryAnalysisPieResultDTO"
parameterType="com.elink.esua.epdc.dto.item.form.ScreenTotalFormDTO">
select

150
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventEfficiencyDao.xml

@ -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') &lt;= #{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>

84
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/screen/ScreenDeptEventStatDao.xml

@ -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') &lt;= #{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 &gt;= #{startDate}
AND STAT_DATE &lt;= #{endDate}
</if>
ORDER BY DEPT_SORT ASC,
CONVERT(DEPT_NAME USING gbk) ASC
</select>
</mapper>
Loading…
Cancel
Save