Browse Source
# Conflicts: # epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.javadev_shibei_match
35 changed files with 1366 additions and 209 deletions
@ -0,0 +1,11 @@ |
|||
package com.epmet.constant; |
|||
|
|||
public interface OrgSourceTypeConstant { |
|||
|
|||
// 外部
|
|||
String EXTERNAL = "external"; |
|||
|
|||
// 内部
|
|||
String INTERNAL = "internal"; |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/22 2:19 下午 |
|||
*/ |
|||
public interface ScreenConstant { |
|||
|
|||
String COMMUNITY = "community"; |
|||
|
|||
String LEVEL = "level"; |
|||
|
|||
String STR_NULL = ""; |
|||
|
|||
String ENGLISH_COMMA = ","; |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.dto.screen.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/22 2:00 下午 |
|||
*/ |
|||
@Data |
|||
public class TreeResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3860368744336541373L; |
|||
|
|||
/** |
|||
* 显示名称 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* agencyId下拉框value |
|||
*/ |
|||
private String pid; |
|||
|
|||
private String pids; |
|||
|
|||
private String level; |
|||
} |
|||
|
@ -0,0 +1,48 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.service.EIDimService; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* epmet_evaluation_index库的维度controller |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("eidim") |
|||
public class EIDimController { |
|||
|
|||
Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private EIDimService eiDimService; |
|||
|
|||
@PostMapping("init-all") |
|||
public Result initAll() { |
|||
|
|||
try { |
|||
//eiDimService.initAgencies();
|
|||
} catch (Exception e) { |
|||
logger.error("初始化epmet_evaluation_index的agency维度失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
|||
} |
|||
|
|||
try { |
|||
//eiDimService.initDepartments();
|
|||
} catch (Exception e) { |
|||
logger.error("初始化epmet_evaluation_index的department维度失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
|||
} |
|||
|
|||
try { |
|||
eiDimService.initGrids(); |
|||
} catch (Exception e) { |
|||
logger.error("初始化epmet_evaluation_index的grids维度失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
|||
} |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.epmet.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* epmet_evaluation_index 维度的service |
|||
*/ |
|||
@Service |
|||
public interface EIDimService { |
|||
void initAgencies(); |
|||
void initDepartments(); |
|||
void initGrids(); |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.epmet.service.evaluationindex.extract.toscreen; |
|||
|
|||
/** |
|||
* @Desciption 党员基本情况 |
|||
* @Author zxc |
|||
* @DateTime 2020/9/22 11:14 上午 |
|||
*/ |
|||
public interface PartyBaseInfoService { |
|||
|
|||
/** |
|||
* @Description 统计基层党建-党员基本情况 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @author zxc |
|||
* @date 2020/9/22 1:22 下午 |
|||
*/ |
|||
Boolean statsPartyMemberBaseInfoToScreen(String customerId,String dateId); |
|||
|
|||
} |
@ -1,10 +1,48 @@ |
|||
package com.epmet.service.evaluationindex.extract.toscreen; |
|||
|
|||
/** |
|||
* 先进模范数据抽取到大屏表screen_pioneer_data |
|||
* 先进模范数据抽取到大屏表 screen_pioneer_data |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/22 11:25 |
|||
*/ |
|||
public interface PioneerDataExtractService { |
|||
/** |
|||
* @return void |
|||
* @param customerId |
|||
* @param dateId |
|||
* @author yinzuomei |
|||
* @description 总方法入口 |
|||
* @Date 2020/9/22 14:17 |
|||
**/ |
|||
void extractPioneerData(String customerId, String dateId); |
|||
|
|||
|
|||
|
|||
// 机关级别(社区级:community,
|
|||
// 乡(镇、街道)级:street,
|
|||
// 区县级: district,
|
|||
// 市级: city
|
|||
// 省级:province)
|
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return void |
|||
* @author yinzuomei |
|||
* @description 网格级别的 党建引领-先锋模范数据 |
|||
* @Date 2020/9/22 13:46 |
|||
**/ |
|||
void extractGridPioneerData(String customerId, String dateId); |
|||
|
|||
// 社区、街道、区县、市级别、省级
|
|||
void extractCommunityPioneerData(String customerId, String dateId); |
|||
|
|||
void extractStreetPioneerData(String customerId, String dateId); |
|||
|
|||
void extractDistrictPioneerData(String customerId, String dateId); |
|||
|
|||
void extractCityPioneerData(String customerId, String dateId); |
|||
|
|||
void extractProvincePioneerData(String customerId, String dateId); |
|||
} |
|||
|
@ -0,0 +1,37 @@ |
|||
package com.epmet.service.evaluationindex.extract.toscreen.impl; |
|||
|
|||
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; |
|||
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Desciption 党员基本情况 |
|||
* @Author zxc |
|||
* @DateTime 2020/9/22 11:15 上午 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { |
|||
|
|||
@Autowired |
|||
private ScreenCustomerAgencyService agencyService; |
|||
|
|||
/** |
|||
* @Description 统计基层党建-党员基本情况 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @author zxc |
|||
* @date 2020/9/22 1:22 下午 |
|||
*/ |
|||
@Override |
|||
public Boolean statsPartyMemberBaseInfoToScreen(String customerId, String dateId) { |
|||
String agencyId = "cyagstrbee8711eaa1fac03fd56f7847"; |
|||
Map<String, Object> stringObjectMap = agencyService.selectAllSubAgencyId(agencyId, customerId); |
|||
System.out.println(stringObjectMap); |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,155 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; |
|||
import com.epmet.entity.org.CustomerAgencyEntity; |
|||
import com.epmet.entity.org.CustomerDepartmentEntity; |
|||
import com.epmet.entity.org.CustomerGridEntity; |
|||
import com.epmet.service.EIDimService; |
|||
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; |
|||
import com.epmet.service.evaluationindex.screen.ScreenCustomerDeptService; |
|||
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; |
|||
import com.epmet.service.org.CustomerAgencyService; |
|||
import com.epmet.service.org.CustomerDepartmentService; |
|||
import com.epmet.service.org.CustomerGridService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.lang.reflect.Array; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class EIDimServiceImpl implements EIDimService { |
|||
|
|||
@Autowired |
|||
private ScreenCustomerAgencyService screenCustomerAgencyService; |
|||
|
|||
@Autowired |
|||
private ScreenCustomerDeptService screenCustomerDeptService; |
|||
|
|||
@Autowired |
|||
private ScreenCustomerGridService screenCustomerGridService; |
|||
|
|||
@Autowired |
|||
private CustomerAgencyService originCustomerAgencyService; |
|||
|
|||
@Autowired |
|||
private CustomerDepartmentService originCustomerDepartmentService; |
|||
|
|||
@Autowired |
|||
private CustomerGridService customerGridService; |
|||
|
|||
@Override |
|||
public void initAgencies() { |
|||
List<CustomerAgencyEntity> agencies2Add = listAgencies2Add(); |
|||
List<CustomerAgencyEntity> agencies2Update = listAgencies2Update(); |
|||
|
|||
screenCustomerAgencyService.initAgencies(agencies2Add, agencies2Update); |
|||
} |
|||
|
|||
/** |
|||
* 查询可更新的单位 |
|||
* @return |
|||
*/ |
|||
private List<CustomerAgencyEntity> listAgencies2Update() { |
|||
ScreenCustomerAgencyEntity e = screenCustomerAgencyService.getLastUpdatedAgency(); |
|||
|
|||
if (e != null) { |
|||
// 说明不是第一次初始化
|
|||
Date startTime = e.getUpdatedTime(); |
|||
Date endTime = new Date(); |
|||
return originCustomerAgencyService.listAgenciesByUpdatedTime(startTime, endTime); |
|||
} |
|||
|
|||
return new ArrayList<>(); |
|||
} |
|||
|
|||
/** |
|||
* 查询可增加的单位 |
|||
* @return |
|||
*/ |
|||
private List<CustomerAgencyEntity> listAgencies2Add() { |
|||
ScreenCustomerAgencyEntity e = screenCustomerAgencyService.getLastAddedAgency(); |
|||
|
|||
Date endTime = new Date(); |
|||
Date startTime = null; |
|||
if (e != null) { |
|||
startTime = e.getCreatedTime(); |
|||
} |
|||
|
|||
return originCustomerAgencyService.listAgenciesByCreateTime(startTime, endTime); |
|||
} |
|||
|
|||
@Override |
|||
public void initDepartments() { |
|||
List<CustomerDepartmentEntity> depts2Add = listDepts2Add(); |
|||
List<CustomerDepartmentEntity> depts2Update = listDepts2Update(); |
|||
screenCustomerDeptService.addAndUpdateDepartments(depts2Add, depts2Update); |
|||
} |
|||
|
|||
/** |
|||
* 查询需要更新的部门列表 |
|||
* @return |
|||
*/ |
|||
private List<CustomerDepartmentEntity> listDepts2Update() { |
|||
ScreenCustomerDeptEntity lastUpdateDept = screenCustomerDeptService.getLastUpdateDept(); |
|||
|
|||
if (lastUpdateDept != null) { |
|||
// 不是第一次初始化
|
|||
Date endTime = new Date(); |
|||
Date startTime = lastUpdateDept.getUpdatedTime(); |
|||
return originCustomerDepartmentService.listDepartmentsByUpdatedTime(startTime, endTime); |
|||
} |
|||
|
|||
return new ArrayList<>(); |
|||
} |
|||
|
|||
/** |
|||
* 查询需要新增的部门列表 |
|||
* @return |
|||
*/ |
|||
private List<CustomerDepartmentEntity> listDepts2Add() { |
|||
ScreenCustomerDeptEntity lastAddDept = screenCustomerDeptService.getLastAddDept(); |
|||
|
|||
Date startTime = null; |
|||
Date endTime = new Date(); |
|||
if (lastAddDept != null) { |
|||
startTime = lastAddDept.getCreatedTime(); |
|||
} |
|||
|
|||
return originCustomerDepartmentService.listDepartmentsByCreatedTime(startTime, endTime); |
|||
} |
|||
|
|||
@Override |
|||
public void initGrids() { |
|||
List<CustomerGridEntity> grids2Add = listGrids2Add(); |
|||
List<CustomerGridEntity> grids2Update =listGrids2Update(); |
|||
screenCustomerGridService.addAndUpdateGrids(grids2Add, grids2Update); |
|||
} |
|||
|
|||
private List<CustomerGridEntity> listGrids2Update() { |
|||
ScreenCustomerGridEntity lastUpdateGrid = screenCustomerGridService.getLastUpdateGrid(); |
|||
if (lastUpdateGrid != null) { |
|||
Date endTime = new Date(); |
|||
Date startTime = lastUpdateGrid.getUpdatedTime(); |
|||
return customerGridService.listUpdatedGridsByUpdateTime(startTime, endTime); |
|||
} |
|||
|
|||
return new ArrayList(); |
|||
} |
|||
|
|||
private List<CustomerGridEntity> listGrids2Add() { |
|||
ScreenCustomerGridEntity lastAddGrid = screenCustomerGridService.getLastAddGrid(); |
|||
|
|||
Date endTime = new Date(); |
|||
Date startTime = null; |
|||
if (lastAddGrid != null) { |
|||
startTime = lastAddGrid.getCreatedTime(); |
|||
} |
|||
|
|||
return customerGridService.listGridsByCreateTime(startTime, endTime); |
|||
} |
|||
} |
@ -0,0 +1,3 @@ |
|||
alter table screen_customer_agency add column SOURCE_TYPE varchar(20) default 'external' after AREA_CODE; |
|||
alter table screen_customer_dept add column SOURCE_TYPE varchar(20) default 'external' after DEPT_MARK; |
|||
alter table screen_customer_grid add column SOURCE_TYPE varchar(20) default 'external' after PARTY_MARK; |
Loading…
Reference in new issue