Browse Source

统计群众反映问题数和群众反映问题响应数,分月、季、年

feature/dangjian
曲树通 6 years ago
parent
commit
dfea40d587
  1. 12
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  2. 12
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java
  3. 12
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java
  4. 8
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  5. 123
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml
  6. 6
      esua-epdc/epdc-gateway/pom.xml
  7. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java
  8. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  9. 31
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EventCountSqlFromDTO.java
  10. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml
  11. 15
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcEventsController.java
  12. 13
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java
  13. 13
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java
  14. 110
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
  15. 119
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml
  16. 27
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/KpiFeignClient.java
  17. 16
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/KpiFeignClientFallBack.java
  18. 18
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobKpiService.java
  19. 21
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobKpiServiceImpl.java
  20. 18
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiDataTask.java
  21. 28
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiDataTaskImple.java
  22. 76
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiDataName.java
  23. 25
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/EventCountFromDTO.java
  24. 107
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMetaDataDTO.java
  25. 106
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMetaDataController.java
  26. 33
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMetaDataDao.java
  27. 77
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMetaDataEntity.java
  28. 78
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMetaDataExcel.java
  29. 11
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java
  30. 14
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java
  31. 12
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java
  32. 7
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java
  33. 47
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMetaDataRedis.java
  34. 104
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMetaDataService.java
  35. 137
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMetaDataServiceImpl.java
  36. 24
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMetaDataDao.xml
  37. 2
      renren-cloud-generator/src/main/resources/application.yml
  38. 2
      renren-cloud-generator/src/main/resources/generator.properties

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

@ -199,4 +199,16 @@ public class SysDeptController {
List<UserSysDeptInfoResultDTO> list = sysDeptService.listUserSysDeptInfoResultDTO(formDTO);
return new Result<List<UserSysDeptInfoResultDTO>>().ok(list);
}
/***
* 获取所有网格 kpi模块原始数据
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/12/12 17:26
*/
@GetMapping("listAllGridId")
@ApiOperation("获取所有下属网格ID集合")
public Result listAllGridId() {
return sysDeptService.listAllGridId();
}
}

12
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java

@ -8,6 +8,7 @@
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CompleteDeptDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.SysSimpleDeptDTO;
@ -136,4 +137,15 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
* @Date 2019/12/4 20:22
**/
List<UserSysDeptInfoResultDTO> selectListUserSysDeptInfo(UserSysDeptInfoFormDTO formDTO);
/***
* 查询所有网格
* @param
* @return java.util.List<java.lang.Long>
* @author qushutong
* @date 2019/12/12 18:12
*/
List<Long> selectListAllGridId();
}

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

@ -170,4 +170,16 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
* @Date 2019/12/4 19:43
**/
List<UserSysDeptInfoResultDTO> listUserSysDeptInfoResultDTO(UserSysDeptInfoFormDTO formDTO);
/***
* 获取所有网格
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<java.lang.Long>>
* @author qushutong
* @date 2019/12/12 17:29
*/
Result listAllGridId();
}

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

@ -387,6 +387,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
return list;
}
@Override
public void packageUserDeptOption(Long userId) {
UserDetail userDetail = userDetailRedis.get(userId);
@ -503,4 +504,11 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
result.put("pids", parentDeptIdList);
return result;
}
@Override
public Result listAllGridId() {
List<Long> gridIdList = baseDao.selectListAllGridId();
return null;
}
}

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

@ -5,7 +5,7 @@
<select id="getList" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
where t1.del_flag = 0
where t1.del_flag = 0
<if test="deptIdList != null">
and t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
@ -110,49 +110,53 @@
<select id="selectListGridForLeader" resultType="com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO">
SELECT
dis.`name` district,
dis.id districtId,
str.`name` street,
str.id streetId,
com.`name` community,
com.id communityId,
gri.`name` grid,
gri.id gridId,
gri.create_date switchedTime
dis.`name` district,
dis.id districtId,
str.`name` street,
str.id streetId,
com.`name` community,
com.id communityId,
gri.`name` grid,
gri.id gridId,
gri.create_date switchedTime
FROM
sys_dept gri
LEFT JOIN sys_dept com ON gri.pid = com.id
LEFT JOIN sys_dept str ON com.pid = str.id
LEFT JOIN sys_dept dis ON str.pid = dis.id
sys_dept gri
LEFT JOIN sys_dept com ON gri.pid = com.id
LEFT JOIN sys_dept str ON com.pid = str.id
LEFT JOIN sys_dept dis ON str.pid = dis.id
WHERE
gri.ID in
<foreach collection="gridIdList" item="gridId" open="(" separator="," close=")">#{gridId}</foreach>
AND gri.del_flag = '0'
AND dis.id IS NOT NULL
gri.ID in
<foreach collection="gridIdList" item="gridId" open="(" separator="," close=")">#{gridId}</foreach>
AND gri.del_flag = '0'
AND dis.id IS NOT NULL
</select>
<select id="selectListHeadDeptNode" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
SELECT
d1.id, d1.`name`
d1.id, d1.`name`
FROM
sys_dept d
LEFT JOIN sys_dept d1 ON d.pids LIKE CONCAT( '%', d1.id, '%' )
sys_dept d
LEFT JOIN sys_dept d1 ON d.pids LIKE CONCAT( '%', d1.id, '%' )
WHERE
d.id IN <foreach collection="dataScopeDeptList" item="deptId" open="(" separator="," close=")" > #{deptId} </foreach>
AND d1.pid = 0
d.id IN
<foreach collection="dataScopeDeptList" item="deptId" open="(" separator="," close=")">#{deptId}</foreach>
AND d1.pid = 0
GROUP BY d1.id
ORDER BY d1.create_date ASC
</select>
<select id="selectChildrenDeptNode" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
SELECT
tem2.*
tem2.*
FROM
( SELECT * FROM sys_dept d1 WHERE d1.id IN <foreach collection="dataScopeDeptList" item="item" open="(" separator="," close=")" > #{item} </foreach> ) tem1,
( SELECT * FROM sys_dept d2 WHERE d2.pid IN <foreach collection="parentDeptIdList" item="deptId" open="(" separator="," close=")" > #{deptId} </foreach>) tem2
( SELECT * FROM sys_dept d1 WHERE d1.id IN <foreach collection="dataScopeDeptList" item="item" open="("
separator="," close=")">#{item}
</foreach> ) tem1,
( SELECT * FROM sys_dept d2 WHERE d2.pid IN <foreach collection="parentDeptIdList" item="deptId" open="("
separator="," close=")">#{deptId}</foreach>) tem2
WHERE
( tem1.PIDS LIKE CONCAT( '%', tem2.id, '%' ) OR tem1.PID = tem2.ID )
OR ( tem2.ID = tem1.ID AND NOT EXISTS ( SELECT 1 FROM sys_dept d WHERE d.PID = tem2.ID ) )
AND tem2.ID != ''
( tem1.PIDS LIKE CONCAT( '%', tem2.id, '%' ) OR tem1.PID = tem2.ID )
OR ( tem2.ID = tem1.ID AND NOT EXISTS ( SELECT 1 FROM sys_dept d WHERE d.PID = tem2.ID ) )
AND tem2.ID != ''
GROUP BY tem2.ID
ORDER BY tem2.create_date ASC
</select>
@ -160,34 +164,43 @@
<select id="selectListUserSysDeptInfo" parameterType="com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO"
resultType="com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO">
SELECT
sd.id,
sd.NAME,
sd.pid,
p.NAME AS parentName,
sd.pids,
NULL AS parentNames,
null as street,
null as community,
(case
when sd.type_key='grid_party' then sd.name
else null
end) as grid
sd.id,
sd.NAME,
sd.pid,
p.NAME AS parentName,
sd.pids,
NULL AS parentNames,
null as street,
null as community,
(case
when sd.type_key='grid_party' then sd.name
else null
end) as grid
FROM
sys_dept sd
LEFT JOIN sys_dept p ON ( sd.pid = p.id )
WHERE
sd.del_flag = '0'
<if test="typeKeyList!=null and typeKeyList.size()>0">
AND sd.type_key in
<foreach collection="typeKeyList" item="typeKey" index="index" open="(" close=")" separator=",">
#{typeKey}
</foreach>
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
AND sd.id IN
<foreach collection="deptIdList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
</select>
<!--查询所有网格-->
<select id="selectListAllGridId" resultType="Long">
SELECT
sd.id
FROM
sys_dept sd
LEFT JOIN sys_dept p ON ( sd.pid = p.id )
WHERE
sd.del_flag = '0'
<if test="typeKeyList!=null and typeKeyList.size()>0">
AND sd.type_key in
<foreach collection="typeKeyList" item="typeKey" index="index" open="(" close=")" separator=",">
#{typeKey}
</foreach>
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
AND sd.id IN
<foreach collection="deptIdList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
sd.type_key = 'grid_party'
</select>
</mapper>

6
esua-epdc/epdc-gateway/pom.xml

@ -99,12 +99,12 @@
<!-- gateway routes -->
<gateway.routes.epdc-auth-server.uri>lb://epdc-auth-server</gateway.routes.epdc-auth-server.uri>
<!-- <gateway.routes.epdc-admin-server.uri>lb://epdc-admin-server</gateway.routes.epdc-admin-server.uri>-->
<!--<gateway.routes.epdc-admin-server.uri>lb://epdc-admin-server</gateway.routes.epdc-admin-server.uri>-->
<gateway.routes.epdc-admin-server.uri>http://127.0.0.1:9092</gateway.routes.epdc-admin-server.uri>
<gateway.routes.epdc-activiti-server.uri>lb://epdc-activiti-server
</gateway.routes.epdc-activiti-server.uri>
<gateway.routes.epdc-api-server.uri>lb://epdc-api-server</gateway.routes.epdc-api-server.uri>
<!-- <gateway.routes.epdc-api-server.uri>http://127.0.0.1:9040</gateway.routes.epdc-api-server.uri>-->
<!--<gateway.routes.epdc-api-server.uri>lb://epdc-api-server</gateway.routes.epdc-api-server.uri>-->
<gateway.routes.epdc-api-server.uri>http://127.0.0.1:9040</gateway.routes.epdc-api-server.uri>
<gateway.routes.epdc-app-server.uri>lb://epdc-app-server</gateway.routes.epdc-app-server.uri>
<!-- <gateway.routes.epdc-app-server.uri>http://127.0.0.1:9058</gateway.routes.epdc-app-server.uri>-->
<gateway.routes.epdc-heart-server.uri>lb://epdc-heart-server</gateway.routes.epdc-heart-server.uri>

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java

@ -18,7 +18,7 @@ import java.util.List;
* @email yujintao@elink-cn.com
* @date 2019/9/5 19:20
*/
@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class,url = "http://127.0.0.1:9064")
public interface NewsFeignClient {
/**

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java

@ -22,7 +22,7 @@ import java.util.List;
* @email yujintao@elink-cn.com
* @date 2019/9/7 9:27
*/
@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class,url = "http://localhost:9068")
public interface UserFeignClient {
/**

31
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EventCountSqlFromDTO.java

@ -0,0 +1,31 @@
package com.elink.esua.epdc.dto.events.form;
import lombok.Data;
import java.util.Date;
/**
* @author: qushutong
* @Date: 2019/12/16 14:52
* @Description: 查询参数
*/
@Data
public class EventCountSqlFromDTO {
/***
* 网格id
*/
private Long gridId;
/***
* 0,1,2
*/
private String type;
/***
* 0 是群众反应问题总数 1 群众反应问题响应数
*/
private String responseType;
}

5
esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml

@ -13,6 +13,11 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-kpi-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-events-client</artifactId>

15
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcEventsController.java

@ -26,6 +26,8 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.EventCountFromDTO;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.dto.events.EpdcRejectEventDetailDTO;
import com.elink.esua.epdc.dto.events.EpdcRejectEventsDTO;
import com.elink.esua.epdc.dto.events.EpdcEventsDTO;
@ -34,6 +36,7 @@ import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO;
import com.elink.esua.epdc.modules.events.excel.EpdcEventsExcel;
import com.elink.esua.epdc.modules.events.service.EpdcEventsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@ -160,4 +163,16 @@ public class EpdcEventsController {
return new Result();
}
/***
* 获取各个网格事件上报总数
* @param eventCountFromDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.KpiMetaDataDTO>>
* @author qushutong
* @date 2019/12/16 14:10
*/
@PostMapping(value = "getAllCommitCount")
public Result<List<KpiMetaDataDTO>> getAllCommitCount(@RequestBody EventCountFromDTO eventCountFromDto){
return epdcEventsService.listEventCountByGridId(eventCountFromDto);
}
}

13
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java

@ -18,15 +18,15 @@
package com.elink.esua.epdc.modules.events.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.dto.events.*;
import com.elink.esua.epdc.dto.events.form.EventCountSqlFromDTO;
import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO;
import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO;
import com.elink.esua.epdc.dto.issue.result.IssuePendingResponseResultDTO;
import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -144,5 +144,12 @@ public interface EpdcEventsDao extends BaseDao<EpdcEventsEntity> {
List<IssuePendingResponseResultDTO> listIssuePendingResponse(IssuePendingResponseFormDTO formDto);
/***
* 查询各个网格事件总数
* @param eventCountDtoFromDTO
* @return java.util.List<com.elink.esua.epdc.dto.KpiMetaDataDTO>
* @author qushutong
* @date 2019/12/16 14:32
*/
KpiMetaDataDTO seliceListEventCount(EventCountSqlFromDTO eventCountDtoFromDTO);
}

13
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java

@ -20,6 +20,8 @@ package com.elink.esua.epdc.modules.events.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.EventCountFromDTO;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.dto.events.*;
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO;
import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO;
@ -207,4 +209,15 @@ public interface EpdcEventsService extends BaseService<EpdcEventsEntity> {
*/
Result<IssueDTO> topicToIssue(EpdcEventSubmitFormDTO dto);
/***
* 群众反映问题总数
* @param eventCountFromDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.KpiMetaDataDTO>
* @author qushutong
* @date 2019/12/16 14:17
*/
Result<List<KpiMetaDataDTO>> listEventCountByGridId(EventCountFromDTO eventCountFromDto);
}

110
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java

@ -27,11 +27,15 @@ 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;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.EventIssueItemState;
import com.elink.esua.epdc.constant.EventsNoticeConstant;
import com.elink.esua.epdc.constant.ImageConstant;
import com.elink.esua.epdc.constant.KpiDataName;
import com.elink.esua.epdc.constants.MenuCodeConstant;
import com.elink.esua.epdc.dto.EventCountFromDTO;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.dto.MenuNoticeDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.category.CategoryDTO;
@ -39,10 +43,12 @@ import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.events.*;
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO;
import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO;
import com.elink.esua.epdc.dto.events.form.EventCountSqlFromDTO;
import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO;
import com.elink.esua.epdc.dto.issue.IssueDTO;
import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO;
import com.elink.esua.epdc.dto.issue.result.IssuePendingResponseResultDTO;
import com.elink.esua.epdc.enums.KpiCycleEnum;
import com.elink.esua.epdc.modules.async.NewsTask;
import com.elink.esua.epdc.modules.category.entity.CategoryEntity;
import com.elink.esua.epdc.modules.category.service.CategoryService;
@ -62,6 +68,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -173,16 +181,16 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
@Override
@Transactional(rollbackFor = Exception.class)
public Result eventReview(EpdcEventsReviewFormDTO dto) {
if(EventIssueItemState.EVENT_REVIEW_PASS == dto.getEventState()
if (EventIssueItemState.EVENT_REVIEW_PASS == dto.getEventState()
&& (dto.getCategoryId() == null
|| "".equals(dto.getCategoryId()))) {
|| "".equals(dto.getCategoryId()))) {
return new Result().error("分类信息不能为空");
}
EpdcEventsEntity entity = new EpdcEventsEntity();
entity.setId(dto.getId());
entity.setEventState(dto.getEventState());
// 初始化分类
if(dto.getCategoryId() != null && !"".equals(dto.getCategoryId())){
if (dto.getCategoryId() != null && !"".equals(dto.getCategoryId())) {
EventsCategoryDTO categoryInfo = this.initCategoryInfo(dto.getCategoryId());
entity.setCategoryCode(categoryInfo.getCategoryCode());
entity.setFirstCategoryCode(categoryInfo.getCategoryCode());
@ -233,7 +241,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
imageType = ImageConstant.TYPE_IMAGE_BIZ_ISSUE_HANDLE;
}
imgService.saveImages(dto.getImages(),referenceId,imageType);
imgService.saveImages(dto.getImages(), referenceId, imageType);
// 插入部门响应记录
// deptRespondTask.saveEventDeptRespond(dto);
@ -245,11 +253,10 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
}
/**
*
* 话题转议题审核回调
*
* @params [topicId, dto]
* @return void
* @params [topicId, dto]
* @author liuchuang
* @since 2019/11/11 10:28
*/
@ -323,7 +330,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
|| OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(dtoResult.getData().getTypeKey())
|| OrganizationTypeConstant.ORG_TYPE_STREET_PARTY.equals(dtoResult.getData().getTypeKey())
|| OrganizationTypeConstant.ORG_TYPE_STREET_DEPT.equals(dtoResult.getData().getTypeKey())
|| OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY.equals(dtoResult.getData().getTypeKey())){
|| OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY.equals(dtoResult.getData().getTypeKey())) {
// 项目-待处理项目-吹哨部门用户
itemService.sendWhistlingDeptItemHandleMenuNotice(Collections.singletonList(deptId), userId);
}
@ -364,7 +371,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
issueEntity.setGroupName(entity.getGroupName());
issueEntity.setTopicId(entity.getTopicId());
issueEntity.setIssueState(EventIssueItemState.ISSUE_REVIEW_PASS);
issueEntity.setIssueCode("DT"+System.currentTimeMillis());
issueEntity.setIssueCode("DT" + System.currentTimeMillis());
return issueEntity;
}
@ -396,11 +403,10 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
}
/**
*
* 菜单消息-议题待回应
*
* @params [deptId]
* @return void
* @params [deptId]
* @author liuchuang
* @since 2019/10/29 18:05
*/
@ -424,10 +430,10 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
@Override
public Result<List<IssuePendingResponseResultDTO>> listIssuePendingResponse(IssuePendingResponseFormDTO formDto) {
List list;
if (formDto.getDeptId() > 0){
if (formDto.getDeptId() > 0) {
list = new ArrayList<>();
list.add(formDto.getDeptId());
}else {
} else {
list = SecurityUser.getUser().getDeptIdList();
}
formDto.setDeptIdList(list);
@ -468,32 +474,32 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
return new Result<IssueDTO>().ok(issueDTO);
}
/**
*
* 初始化分类信息
*
* @params [categoryId]
* @return com.elink.esua.epdc.dto.events.EventsCategoryDTO
* @params [categoryId]
* @author liuchuang
* @since 2019/11/29 13:51
*/
private EventsCategoryDTO initCategoryInfo(String categoryId) {
Long category = Long.parseLong(categoryId);
EventsCategoryDTO resultDto = new EventsCategoryDTO();
CategoryDTO cateDto =categoryService.get(category);
CategoryDTO cateDto = categoryService.get(category);
resultDto.setCategoryCode(cateDto.getCategoryCode());
//获取所有父类分类标签
List<CategoryEntity> cateList = categoryService.getPidListById(category);
//所选分类标签为多级
if(cateList != null && cateList.size() > 0) {
if (cateList != null && cateList.size() > 0) {
// list第一个为一级分类标签
resultDto.setFirstCategoryCode(cateList.get(0).getCategoryCode());
//分类标签全称拼接:-分割
String name = "";
for (int i = 0; i < cateList.size(); i++){
if (i == cateList.size() -1){
for (int i = 0; i < cateList.size(); i++) {
if (i == cateList.size() - 1) {
name = name + cateList.get(i).getCategoryName();
}else {
} else {
name = name + cateList.get(i).getCategoryName() + "-";
}
}
@ -508,4 +514,70 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
return resultDto;
}
@Override
public Result<List<KpiMetaDataDTO>> listEventCountByGridId(EventCountFromDTO eventCountFromDto) {
List<Long> gridList = eventCountFromDto.getGridIdList();
//查询sql入参
EventCountSqlFromDTO eventCountDtoFromDTO;
//结果
KpiMetaDataDTO kpiMetaDataDto;
List<KpiMetaDataDTO> kpiMetaDataDtoList = new ArrayList<>();
//统计月
//取本月第一天
YearMonth now = YearMonth.now();
LocalDate endTime = now.atDay(1);
//上个月的第一天
LocalDate startTime = now.minusMonths(1).atDay(1);
for (Long gridId : gridList) {
eventCountDtoFromDTO = new EventCountSqlFromDTO();
eventCountDtoFromDTO.setGridId(gridId);
eventCountDtoFromDTO.setType(NumConstant.ZERO_STR);
eventCountDtoFromDTO.setResponseType(eventCountFromDto.getResponseType());
kpiMetaDataDto = baseDao.seliceListEventCount(eventCountDtoFromDTO);
kpiMetaDataDto.setDataCode(KpiDataName.peopleReportRespAmount);
kpiMetaDataDto.setKpiCycle(KpiCycleEnum.KPI_CYCLE_MONTH.getValue());
kpiMetaDataDto.setStartDate(LocalDateUtils.localDateToDate(startTime));
kpiMetaDataDto.setEndDate(LocalDateUtils.localDateToDate(endTime));
kpiMetaDataDtoList.add(kpiMetaDataDto);
}
//按照季统计
int nowMonth = now.getMonthValue();
// 1,4,7,10 月份的时候统计 季度 季度第一天统计上一季度
if (nowMonth == NumConstant.ONE || nowMonth == NumConstant.FOUR || nowMonth == NumConstant.SEVEN || nowMonth == NumConstant.TEN) {
//上个季度第一天
LocalDate lastQuarter = now.minusMonths(3).atDay(1);
for (Long gridId : gridList) {
eventCountDtoFromDTO = new EventCountSqlFromDTO();
eventCountDtoFromDTO.setGridId(gridId);
eventCountDtoFromDTO.setType(NumConstant.ONE_STR);
eventCountDtoFromDTO.setResponseType(eventCountFromDto.getResponseType());
kpiMetaDataDto = baseDao.seliceListEventCount(eventCountDtoFromDTO);
kpiMetaDataDto.setDataCode(KpiDataName.peopleReportRespAmount);
kpiMetaDataDto.setKpiCycle(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue());
kpiMetaDataDto.setStartDate(LocalDateUtils.localDateToDate(lastQuarter));
kpiMetaDataDto.setEndDate(LocalDateUtils.localDateToDate(endTime));
kpiMetaDataDtoList.add(kpiMetaDataDto);
}
}
//按照年
// 一月份统计去年的
if (nowMonth == NumConstant.ONE) {
//上个季度第一天
LocalDate lastYear = now.minusYears(1).atDay(1);
for (Long gridId : gridList) {
eventCountDtoFromDTO = new EventCountSqlFromDTO();
eventCountDtoFromDTO.setGridId(gridId);
eventCountDtoFromDTO.setType(NumConstant.TWO_STR);
eventCountDtoFromDTO.setResponseType(eventCountFromDto.getResponseType());
kpiMetaDataDto = baseDao.seliceListEventCount(eventCountDtoFromDTO);
kpiMetaDataDto.setDataCode(KpiDataName.peopleReportRespAmount);
kpiMetaDataDto.setKpiCycle(KpiCycleEnum.KPI_CYCLE_YEAR.getValue());
kpiMetaDataDto.setStartDate(LocalDateUtils.localDateToDate(lastYear));
kpiMetaDataDto.setEndDate(LocalDateUtils.localDateToDate(endTime));
kpiMetaDataDtoList.add(kpiMetaDataDto);
}
}
return new Result<List<KpiMetaDataDTO>>().ok(kpiMetaDataDtoList);
}
}

119
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml

@ -58,59 +58,59 @@
<select id="selectListOfPendingReviewEvents" resultType="com.elink.esua.epdc.dto.events.EpdcEventsDTO">
SELECT
temp.id,
temp.nick_Name AS nickName,
temp.event_content AS eventContent,
temp.CREATED_TIME AS createdTime
temp.id,
temp.nick_Name AS nickName,
temp.event_content AS eventContent,
temp.CREATED_TIME AS createdTime
FROM
epdc_events temp
epdc_events temp
WHERE
temp.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},temp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},temp.ALL_DEPT_IDS))
</if>
AND temp.EVENT_STATE = 0
temp.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},temp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},temp.ALL_DEPT_IDS))
</if>
AND temp.EVENT_STATE = 0
ORDER BY temp.CREATED_TIME DESC
</select>
<select id="selectListOfRejectEvents" resultType="com.elink.esua.epdc.dto.events.EpdcRejectEventsDTO">
SELECT
temp.ID AS id,
temp.NICK_NAME AS nickName,
temp.CREATED_TIME AS createdTime,
temp.EVENT_CONTENT AS eventContent
temp.ID AS id,
temp.NICK_NAME AS nickName,
temp.CREATED_TIME AS createdTime,
temp.EVENT_CONTENT AS eventContent
FROM
epdc_events temp
epdc_events temp
WHERE
temp.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
</if>
<if test="communityId != null and communityId != ''">
AND find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
</if>
AND temp.EVENT_STATE = 2
temp.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
</if>
<if test="communityId != null and communityId != ''">
AND find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
</if>
AND temp.EVENT_STATE = 2
ORDER BY
temp.CREATED_TIME DESC
temp.CREATED_TIME DESC
</select>
<resultMap id="rejectEventDetailMap" type="com.elink.esua.epdc.dto.events.EpdcRejectEventDetailDTO">
@ -310,6 +310,37 @@
order by CREATED_TIME
LIMIT #{pageIndex},#{pageSize}
</select>
<!--查询各个网格事件总数-->
<select id="seliceListEventCount" resultType="com.elink.esua.epdc.dto.KpiMetaDataDTO">
SELECT
COUNT(ev.id) as dataValue,
#{gridId} as deptId
FROM
epdc_events ev
WHERE
ev.GRID_ID = #{gridId}
<choose>
<when test="type == '0'">
AND PERIOD_DIFF(
date_format(now(), '%Y%m'),
date_format(ev.CREATED_TIME, '%Y%m')
) = 1
</when>
<when test="type == '1'">
AND QUARTER (ev.CREATED_TIME) = QUARTER (
DATE_SUB(now(), INTERVAL 1 QUARTER)
)
</when>
<when test="type == '2'">
AND YEAR (ev.CREATED_TIME) = YEAR (
date_sub(now(), INTERVAL 1 YEAR)
);
</when>
</choose>
<if test="responseType!=null and responseType == '1'">
AND ev.EVENT_STATE != '0'
</if>
AND ev.DEL_FLAG = '0'
</select>
</mapper>

27
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/KpiFeignClient.java

@ -0,0 +1,27 @@
package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.commons.tools.utils.Result;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author: qushutong
* @Date: 2019/12/12 18:46
* @Description: kpi模块
*/
public interface KpiFeignClient {
/***
* 调用kpi模块执行获取元数据的定时任务
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/12/12 18:55
*/
@GetMapping(value = "kpimetadata/buildMetaData", consumes = MediaType.APPLICATION_JSON_VALUE)
Result runKpiMateData();
}

16
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/KpiFeignClientFallBack.java

@ -0,0 +1,16 @@
package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.KpiFeignClient;
import java.util.List;
public class KpiFeignClientFallBack implements KpiFeignClient {
@Override
public Result runKpiMateData() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_KPI_SERVER, "sendGridIdList", "");
}
}

18
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobKpiService.java

@ -0,0 +1,18 @@
package com.elink.esua.epdc.service;
/**
* @author: qushutong
* @Date: 2019/12/12 16:52
* @Description: kpi 模块查原始数据
*/
public interface ScheduleJobKpiService {
/***
* 启动kpi模块获取原始数据
* @param
* @return void
* @author qushutong
* @date 2019/12/12 16:56
*/
void runKpi();
}

21
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobKpiServiceImpl.java

@ -0,0 +1,21 @@
package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.feign.KpiFeignClient;
import com.elink.esua.epdc.service.ScheduleJobKpiService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author: qushutong
* @Date: 2019/12/12 16:53
* @Description: 查询gridId
*/
public class ScheduleJobKpiServiceImpl implements ScheduleJobKpiService {
@Autowired
private KpiFeignClient kpiFeignClient;
@Override
public void runKpi() {
kpiFeignClient.runKpiMateData();
}
}

18
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiDataTask.java

@ -0,0 +1,18 @@
package com.elink.esua.epdc.task;
/**
* @author: qushutong
* @Date: 2019/12/12 16:47
* @Description: kpi模块查询原始数据
*/
public interface KpiDataTask {
/***
* kpi模块查询原始数据
* @param params
* @return void
* @author qushutong
* @date 2019/12/12 16:48
*/
void run(String params);
}

28
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiDataTaskImple.java

@ -0,0 +1,28 @@
package com.elink.esua.epdc.task;
import com.elink.esua.epdc.service.ScheduleJobKpiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author: qushutong
* @Date: 2019/12/12 16:50
* @Description: kpi
*/
@Component("kpiDataTask")
public class KpiDataTaskImple implements KpiDataTask{
@Autowired
private ScheduleJobKpiService scheduleJobKpiService;
/***
* 查询所有gruidID 统计kpi原始数据
* @param params
* @return void
* @author qushutong
* @date 2019/12/12 16:51
*/
@Override
public void run(String params) {
scheduleJobKpiService.runKpi();
}
}

76
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiDataName.java

@ -0,0 +1,76 @@
package com.elink.esua.epdc.constant;
/**
* @author: qushutong
* @Date: 2019/12/16 19:36
* @Description: 数据项名称
*/
public interface KpiDataName {
/***
* 响应网格呼叫数
*/
String xywghjs = "xywghjs";
/***
* 网格呼叫总数
*/
String wghjzs = "wghjzs";
/***
* 办结呼叫事项数
*/
String bjhjsxs = "bjhjsxs";
/***
* 呼叫总数
*/
String hjzs = "hjzs";
/***
* 问题办理满意数
*/
String peopleHighEvaluationAmount = "people_high_evaluation_amount";
/***
* 问题办理基本满意数
*/
String peopleMediumEvaluationAmount = "people_medium_evaluation_amount";
/***
* 问题办理不满意数
*/
String peopleLowEvaluationAmount = "people_low_evaluation_amount";
/***
* 评价总数
*/
String pjzs = "pjzs";
/***
* 群众反映问题响应数
*/
String peopleReportRespAmount = "people_report_resp_amount";
/***
* 群众反映问题总数
*/
String peopleReportAmount = "people_report_amount";
/***
* 群众投票满意数
*/
String voteHighEvaluationAmount = "vote_high_evaluation_amount";
/***
* 群众投票基本满意数
*/
String voteMediumEvaluationAmount = "vote_medium_evaluation_amount";
/***
* 群众投票不满意数
*/
String voteLowEvaluationAmount = "vote_low_evaluation_amount";
}

25
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/EventCountFromDTO.java

@ -0,0 +1,25 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.util.List;
/**
* @author: qushutong
* @Date: 2019/12/17 10:23
* @Description: kpi 群众反应问题数
*/
@Data
public class EventCountFromDTO {
/***
* 所有网格
*/
private List<Long> gridIdList;
/***
* 0 是群众反应问题总数 1 群众反应问题响应数
*/
private String responseType;
}

107
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMetaDataDTO.java

@ -0,0 +1,107 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
public class KpiMetaDataDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 数据项编码
*/
private String dataCode;
/**
* 数据项名称
*/
private String dataName;
/**
* 元数据值
*/
private BigDecimal dataValue;
/**
* 考核周期(字典值 代表月)
*/
private String kpiCycle;
/**
* 考核周期开始日
*/
private Date startDate;
/**
* 考核周期结束日
*/
private Date endDate;
/**
* 部门ID
*/
private Long deptId;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标记
*/
private String delFlag;
}

106
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMetaDataController.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.excel.KpiMetaDataExcel;
import com.elink.esua.epdc.service.KpiMetaDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@RestController
@RequestMapping("kpimetadata")
public class KpiMetaDataController {
@Autowired
private KpiMetaDataService kpiMetaDataService;
@GetMapping("page")
public Result<PageData<KpiMetaDataDTO>> page(@RequestParam Map<String, Object> params){
PageData<KpiMetaDataDTO> page = kpiMetaDataService.page(params);
return new Result<PageData<KpiMetaDataDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<KpiMetaDataDTO> get(@PathVariable("id") String id){
KpiMetaDataDTO data = kpiMetaDataService.get(id);
return new Result<KpiMetaDataDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody KpiMetaDataDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
kpiMetaDataService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody KpiMetaDataDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
kpiMetaDataService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
kpiMetaDataService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiMetaDataDTO> list = kpiMetaDataService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiMetaDataExcel.class);
}
/***
* 构建元数据
* @param
* @return void
* @author qushutong
* @date 2019/12/16 10:17
*/
@GetMapping("buildMetaData")
public void buildMetaData(){
}
}

33
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMetaDataDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.KpiMetaDataEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Mapper
public interface KpiMetaDataDao extends BaseDao<KpiMetaDataEntity> {
}

77
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMetaDataEntity.java

@ -0,0 +1,77 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_kpi_meta_data")
public class KpiMetaDataEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 数据项编码
*/
private String dataCode;
/**
* 数据项名称
*/
private String dataName;
/**
* 元数据值
*/
private BigDecimal dataValue;
/**
* 考核周期(字典值 代表月)
*/
private String kpiCycle;
/**
* 考核周期开始日
*/
private Date startDate;
/**
* 考核周期结束日
*/
private Date endDate;
/**
* 部门ID
*/
private Long deptId;
}

78
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMetaDataExcel.java

@ -0,0 +1,78 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
public class KpiMetaDataExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "数据项编码")
private String dataCode;
@Excel(name = "数据项名称")
private String dataName;
@Excel(name = "元数据值")
private BigDecimal dataValue;
@Excel(name = "考核周期(字典值 代表月,季,年)")
private String kpiCycle;
@Excel(name = "考核周期开始日")
private Date startDate;
@Excel(name = "考核周期结束日")
private Date endDate;
@Excel(name = "部门ID")
private Long deptId;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "删除标记")
private String delFlag;
}

11
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java

@ -55,4 +55,15 @@ public interface AdminFeignClient {
**/
@GetMapping("/sys/dept/{id}")
Result<SysDeptDTO> getSysDeptDTO(@PathVariable("id") Long id);
/***
* 查询所有网格
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/12/12 17:16
*/
@GetMapping("/sys/dept/listAllGridId")
Result<List<Long>> listAllGridId();
}

14
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java

@ -2,12 +2,15 @@ package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.EventCountFromDTO;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO;
import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO;
import com.elink.esua.epdc.feign.fallback.EventFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -28,4 +31,15 @@ public interface EventFeignClient {
**/
@GetMapping(value = "events/category/queryCategoryInfo", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<CategoryInfoResultDTO>> queryCategoryInfo(CategoryInfoFormDTO categoryInfoFormDTO);
/***
* 事件提交总数群众反应问题总数
* @param eventCountFromDto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/12/16 13:54
*/
@PostMapping(value = "events/epdcevents/getAllCommitCount", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<KpiMetaDataDTO>> getAllCommitCount(EventCountFromDTO eventCountFromDto);
}

12
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java

@ -55,4 +55,16 @@ public class AdminFeignClientFallback implements AdminFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getSysDeptDTO", id);
}
/***
* 获取所有网格
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<java.lang.Long>>
* @author qushutong
* @date 2019/12/12 19:03
*/
@Override
public Result<List<Long>> listAllGridId() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listAllGridId","1");
}
}

7
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java

@ -3,6 +3,8 @@ package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.EventCountFromDTO;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO;
import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO;
import com.elink.esua.epdc.feign.EventFeignClient;
@ -22,4 +24,9 @@ public class EventFeignClientFallback implements EventFeignClient {
public Result<List<CategoryInfoResultDTO>> queryCategoryInfo(CategoryInfoFormDTO categoryInfoFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryCategoryInfo", categoryInfoFormDTO);
}
@Override
public Result<List<KpiMetaDataDTO>> getAllCommitCount( EventCountFromDTO eventCountFromDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "getAllCommitCount", eventCountFromDto);
}
}

47
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMetaDataRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Component
public class KpiMetaDataRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

104
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMetaDataService.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.entity.KpiMetaDataEntity;
import java.util.List;
import java.util.Map;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
public interface KpiMetaDataService extends BaseService<KpiMetaDataEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<KpiMetaDataDTO>
* @author generator
* @date 2019-12-16
*/
PageData<KpiMetaDataDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<KpiMetaDataDTO>
* @author generator
* @date 2019-12-16
*/
List<KpiMetaDataDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return KpiMetaDataDTO
* @author generator
* @date 2019-12-16
*/
KpiMetaDataDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2019-12-16
*/
void save(KpiMetaDataDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2019-12-16
*/
void update(KpiMetaDataDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2019-12-16
*/
void delete(String[] ids);
/***
* 构建元素数据
* @param
* @return void
* @author qushutong
* @date 2019/12/16 10:19
*/
void createMataData();
}

137
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMetaDataServiceImpl.java

@ -0,0 +1,137 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiMetaDataDao;
import com.elink.esua.epdc.dto.EventCountFromDTO;
import com.elink.esua.epdc.dto.KpiMetaDataDTO;
import com.elink.esua.epdc.entity.KpiMetaDataEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.EventFeignClient;
import com.elink.esua.epdc.redis.KpiMetaDataRedis;
import com.elink.esua.epdc.service.KpiMetaDataService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.Month;
import java.time.Period;
import java.time.YearMonth;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 绩效考核的元数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Service
public class KpiMetaDataServiceImpl extends BaseServiceImpl<KpiMetaDataDao, KpiMetaDataEntity> implements KpiMetaDataService {
@Autowired
private KpiMetaDataRedis kpiMetaDataRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Autowired
private EventFeignClient eventFeignClient;
@Override
public PageData<KpiMetaDataDTO> page(Map<String, Object> params) {
IPage<KpiMetaDataEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, KpiMetaDataDTO.class);
}
@Override
public List<KpiMetaDataDTO> list(Map<String, Object> params) {
List<KpiMetaDataEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, KpiMetaDataDTO.class);
}
private QueryWrapper<KpiMetaDataEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<KpiMetaDataEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public KpiMetaDataDTO get(String id) {
KpiMetaDataEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, KpiMetaDataDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(KpiMetaDataDTO dto) {
KpiMetaDataEntity entity = ConvertUtils.sourceToTarget(dto, KpiMetaDataEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiMetaDataDTO dto) {
KpiMetaDataEntity entity = ConvertUtils.sourceToTarget(dto, KpiMetaDataEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void createMataData() {
// 获取所有网格
Result<List<Long>> listResult = adminFeignClient.listAllGridId();
if (listResult == null && listResult.getData() == null) {
throw new RuntimeException("获取网格列表失败");
}
List<Long> gridList = listResult.getData();
EventCountFromDTO eventCountFromDto = new EventCountFromDTO();
eventCountFromDto.setGridIdList(gridList);
// 0 查询总数
eventCountFromDto.setResponseType(NumConstant.ZERO_STR);
//获取事件 群众反映问题总数(事件提交总数)
Result<List<KpiMetaDataDTO>> allCommitCount = eventFeignClient.getAllCommitCount(eventCountFromDto);
List<KpiMetaDataDTO> data = allCommitCount.getData();
List<KpiMetaDataEntity> mataDataEntityList = ConvertUtils.sourceToTarget(data, KpiMetaDataEntity.class);
insertBatch(mataDataEntityList);
}
}

24
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMetaDataDao.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.KpiMetaDataDao">
<resultMap type="com.elink.esua.epdc.entity.KpiMetaDataEntity" id="kpiMetaDataMap">
<result property="id" column="ID"/>
<result property="dataCode" column="data_code"/>
<result property="dataName" column="data_name"/>
<result property="dataValue" column="data_value"/>
<result property="kpiCycle" column="kpi_cycle"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="deptId" column="dept_id"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
</mapper>

2
renren-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epdc
password: elink833066
#oracle配置

2
renren-cloud-generator/src/main/resources/generator.properties

@ -3,7 +3,7 @@
main=
#\u5305\u540D
package=com.elink.esua.epdc
moduleName=news
moduleName=kpi
#\u4F5C\u8005
author=qu
#\u7248\u672C\u53F7

Loading…
Cancel
Save