Browse Source

网格员数据统计

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
e25cdc018b
  1. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridMemberStatisticsDailyService.java
  3. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java
  4. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  6. 38
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.21__grid_member_statistics.sql
  7. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -121,6 +121,8 @@ public class DemoController {
private FactGridGovernDailyService factGridGovernDailyService;
@Autowired
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@Autowired
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -936,4 +938,10 @@ public class DemoController {
return new Result();
}
@PostMapping("extractFactGridMemberDaily")
public Result extractFactGridMemberDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){
factGridMemberStatisticsDailyService.extractGridMemberStatisticsDaily(fromDTO.getCustomerId(), fromDTO.getDateId());
return new Result();
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridMemberStatisticsDailyService.java

@ -36,6 +36,6 @@ public interface FactGridMemberStatisticsDailyService extends BaseService<FactGr
* @author zhaoqifeng
* @date 2021/7/5 9:29
*/
void extractFactAgencyGovernDaily(String customerId, String dateId);
void extractGridMemberStatisticsDaily(String customerId, String dateId);
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java

@ -73,9 +73,12 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa
* @date 2021/7/5 9:29
*/
@Override
public void extractFactAgencyGovernDaily(String customerId, String dateId) {
public void extractGridMemberStatisticsDaily(String customerId, String dateId) {
List<CustomerStaffGridDTO> staffGridList = customerGridService.getCustomerStaffGridList(customerId);
List<StaffRoleInfoDTO> staffInfoList = userService.getStaffByRoleKey(customerId, RoleKeyConstants.ROLE_KEY_GRID_MEMBER);
if (CollectionUtils.isEmpty(staffGridList) || CollectionUtils.isNotEmpty(staffInfoList)) {
return;
}
Map<String, StaffRoleInfoDTO> staffMap = staffInfoList.stream().collect(Collectors.toMap(StaffRoleInfoDTO :: getStaffId,
Function.identity()));
List<FactGridMemberStatisticsDailyEntity> list = staffGridList.stream().filter(p -> null != staffMap.get(p.getStaffId())).map(item -> {
@ -85,6 +88,7 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa
entity.setAgencyId(item.getAgencyId());
entity.setGridId(item.getGridId());
entity.setPid(item.getPid());
entity.setPids(item.getPids());
entity.setGridId(item.getGridId());
entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX));

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -12,6 +12,7 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.service.evaluationindex.screen.*;
@ -76,6 +77,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private FactGridGovernDailyService factGridGovernDailyService;
@Autowired
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@Autowired
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
/**
* @param extractOriginFormDTO
@ -264,6 +267,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}catch(Exception e){
log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
try{
factGridMemberStatisticsDailyService.extractGridMemberStatisticsDaily(customerId, dateId);
}catch(Exception e){
log.error("网格员数据统计fact_grid_member_statistics_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
extractPartData(customerId, dateId);
log.info("===== extractDaily method end ======");
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -814,7 +814,7 @@ public class UserServiceImpl implements UserService {
*/
@Override
public List<StaffRoleInfoDTO> getStaffByRoleKey(String customerId, String roleKey) {
return null;
return userDao.getStaffByRoleKey(customerId, roleKey);
}
@Override

38
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.21__grid_member_statistics.sql

@ -0,0 +1,38 @@
CREATE TABLE `fact_grid_member_statistics_daily`
(
`ID` varchar(64) NOT NULL COMMENT '主键(t-1)',
`DATE_ID` varchar(32) NOT NULL COMMENT 'yyyyMMdd',
`MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID',
`YEAR_ID` varchar(32) NOT NULL COMMENT '年度ID',
`CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID',
`AGENCY_ID` varchar(32) NOT NULL COMMENT '组织ID',
`GRID_ID` varchar(32) NOT NULL COMMENT '网格I',
`PID` varchar(32) NOT NULL COMMENT '上级ID(网格所属Agency的上级组织Id)',
`PIDS` varchar(512) NOT NULL COMMENT '所有agencyId的上级组织ID(包含agencyId)',
`STAFF_ID` varchar(32) NOT NULL COMMENT '工作人员ID',
`STAFF_NAME` varchar(32) DEFAULT NULL COMMENT '工作人员姓名',
`PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '项目立项数',
`ISSUE_TO_PROJECT_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '议题转项目数',
`CLOSED_ISSUE_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '议题关闭数',
`PROJECT_RESPONSE_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '项目响应数',
`PROJECT_TRANSFER_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '项目吹哨数',
`PROJECT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '项目结案数',
`PROJECT_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '项目立项数日增量',
`ISSUE_TO_PROJECT_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '议题转项目数日增量',
`CLOSED_ISSUE_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '议题关闭数日增量',
`PROJECT_RESPONSE_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '项目响应数日增量',
`PROJECT_TRANSFER_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '项目吹哨数日增量',
`PROJECT_CLOSED_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '项目结案数日增量',
`DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除状态,0:正常,1:删除',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='网格员数据统计_日统计';
ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily`
ADD COLUMN `PROJECT_CREATOR` varchar(32) NULL COMMENT '项目创建人(议题转项目或立项人)' AFTER `IS_SATISFIED`;

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -573,9 +573,9 @@
<select id="getStaffByRoleKey" resultType="com.epmet.dto.user.result.StaffRoleInfoDTO">
SELECT
sr.CUSTOMER_ID,
sr.ORG_ID,
sr.ORG_ID AS "agencyId",
sr.STAFF_ID,
cs.REAL_NAME
cs.REAL_NAME AS "staffName"
FROM
staff_role sr
INNER JOIN gov_staff_role gsr ON sr.ROLE_ID = gsr.ID

Loading…
Cancel
Save