Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data_2.0' into dev_screen_data_an_2.0

dev_shibei_match
jianjun 5 years ago
parent
commit
f25d6cfe8f
  1. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java
  2. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  4. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java
  5. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  6. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml
  7. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java
  8. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java
  9. 18
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java
  10. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java
  11. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java
  12. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java
  13. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java
  14. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  15. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  16. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java
  17. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java
  18. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  19. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  21. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml
  22. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml
  23. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml
  24. 7
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java

@ -25,7 +25,7 @@ public class PublicPartiProfileResultDTO implements Serializable {
* */ * */
private String monthTrend = ""; private String monthTrend = "";
private BigDecimal averageIssue = new BigDecimal(NumConstant.ZERO); private Integer averageIssue = NumConstant.ZERO;
/** /**
* 较上月百分比 * 较上月百分比

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java

@ -38,8 +38,8 @@ public class UserJoinIndicatorGrowthRateResultDTO implements Serializable {
/** /**
* 平均参与度 * 平均参与度
* */ */
private Integer averageJoin; private BigDecimal averageJoin;
private BigDecimal joinCompareLatestMonth; private BigDecimal joinCompareLatestMonth;

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -269,6 +269,7 @@ public class IndexServiceImpl implements IndexService {
* @author sun * @author sun
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO) { public IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO) {
//screen_index_data_monthly 根据组织id和月份获取月度指标得分 //screen_index_data_monthly 根据组织id和月份获取月度指标得分
//1.大屏接口 orgType和monthId字段不传值,默认查询上一个月数据 //1.大屏接口 orgType和monthId字段不传值,默认查询上一个月数据
@ -307,6 +308,7 @@ public class IndexServiceImpl implements IndexService {
* @author sun * @author sun
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<IndexAdvanceBranchRankResultDTO> advancedBranchRank(AdvancedBranchRankFormDTO formDTO) { public List<IndexAdvanceBranchRankResultDTO> advancedBranchRank(AdvancedBranchRankFormDTO formDTO) {
//根据当前所选组织,查询screen_index_data_monthly中类型为网格的按照总指数倒序,关联screen_org_rank_data表取其他数据 //根据当前所选组织,查询screen_index_data_monthly中类型为网格的按照总指数倒序,关联screen_org_rank_data表取其他数据
//1.级联查询组织下所有网格的先进支部排行数据,按总指数降序 //1.级联查询组织下所有网格的先进支部排行数据,按总指数降序

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java

@ -4,7 +4,6 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService;
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO;
@ -34,6 +33,7 @@ public class ScreenUserServiceImpl implements ScreenUserService {
* @author sun * @author sun
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<UserPointRankListResultDTO> userPointRank(UserPointRankFormDTO formDTO) { public List<UserPointRankListResultDTO> userPointRank(UserPointRankFormDTO formDTO) {
//1.参数校验 //1.参数校验
if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) {
@ -49,6 +49,7 @@ public class ScreenUserServiceImpl implements ScreenUserService {
* @author sun * @author sun
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<PartIndexScroeRankResultDTO> partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) { public List<PartIndexScroeRankResultDTO> partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) {
//1.参数校验 //1.参数校验
if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) {

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -454,6 +454,7 @@ public class FactIndexServiceImpl implements FactIndexService {
* @author sun * @author sun
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) { public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) {
//1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据)
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO);
@ -466,6 +467,7 @@ public class FactIndexServiceImpl implements FactIndexService {
* @author sun * @author sun
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) {
RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); RootAgencyResultDTO resultDTO = new RootAgencyResultDTO();
//1.根据agencyId查询是否为根级组织 //1.根据agencyId查询是否为根级组织

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml

@ -10,7 +10,7 @@
ROUND( AVG_JOIN, 1 ) AS averageJoin, ROUND( AVG_JOIN, 1 ) AS averageJoin,
JOIN_TOTAL_UP_RATE AS monthIncr, JOIN_TOTAL_UP_RATE AS monthIncr,
JOIN_TOTAL_UP_FLAG AS monthTrend, JOIN_TOTAL_UP_FLAG AS monthTrend,
ROUND(AVG_ISSUE,1) AS averageIssue, AVG_ISSUE AS averageIssue,
AVG_ISSUE_UP_RATE AS issueCompareLatestMonth, AVG_ISSUE_UP_RATE AS issueCompareLatestMonth,
AVG_ISSUE_UP_FLAG AS issueCompareLatestTrend, AVG_ISSUE_UP_FLAG AS issueCompareLatestTrend,
AGVG_JOIN_UP_RATE AS joinCompareLatestMonth, AGVG_JOIN_UP_RATE AS joinCompareLatestMonth,

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java

@ -20,6 +20,8 @@ public interface ExtractConstant {
String SHIFT_PROJECT = "shift_project"; String SHIFT_PROJECT = "shift_project";
String CLOSE = "close";
String CLOSED = "closed"; String CLOSED = "closed";
String GRID_ORG_TYPE = "grid"; String GRID_ORG_TYPE = "grid";

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java

@ -5,7 +5,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
/** /**
* 描述一下 * 党员相关用
* *
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/10/12 21:57 * @date 2020/10/12 21:57

18
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.indexcollect.result;
import lombok.Data;
import java.io.Serializable;
/**
* 网格服务能力用
*
* @author yinzuomei@elink-cn.com
* @date 2020/10/14 10:02
*/
@Data
public class GridIndexCommonDTO implements Serializable {
private static final long serialVersionUID = -4316054054019675419L;
private String gridId;
private Integer indexValue;
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
* 9党建引领|基层治理-居民党员积分排行榜 入参 * 9党建引领|基层治理-居民党员积分排行榜 入参
@ -64,6 +65,11 @@ public class PartyUserRankDataFormDTO implements Serializable {
*/ */
private Integer pointTotal; private Integer pointTotal;
/**
* 指标得分
*/
private BigDecimal indexScore;
/** /**
* *
*/ */

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java

@ -8,10 +8,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.screen.form.InitCustomerIndexForm;
import com.epmet.model.IndexExcelDataListener; import com.epmet.model.IndexExcelDataListener;
import com.epmet.model.IndexModel; import com.epmet.model.IndexModel;
import com.epmet.service.evaluationindex.screen.IndexDictService; import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService;
import com.epmet.service.evaluationindex.screen.IndexGroupService;
import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -37,7 +34,8 @@ public class IndexDictController {
private IndexGroupService indexGroupService; private IndexGroupService indexGroupService;
@Autowired @Autowired
private IndexGroupDetailTemplateService indexGroupDetailTemplateService; private IndexGroupDetailTemplateService indexGroupDetailTemplateService;
@Autowired
private IndexGroupDetailService indexGroupDetailService;
/** /**
* urlhttp://localhost:8108/data/stats/indexdict/initFromExcel * urlhttp://localhost:8108/data/stats/indexdict/initFromExcel
* desc:从excel初始化指标分组权重 * desc:从excel初始化指标分组权重
@ -46,7 +44,7 @@ public class IndexDictController {
* @return * @return
*/ */
@PostMapping("initFromExcel") @PostMapping("initFromExcel")
public Result<String> testTx(@RequestPart("file") MultipartFile file) { public Result<String> testTx(@RequestPart("file") MultipartFile file,@RequestParam("customerId") String customerId) {
ExcelReader excelReader = null; ExcelReader excelReader = null;
try { try {
InputStream inputStream = null; InputStream inputStream = null;
@ -58,7 +56,9 @@ public class IndexDictController {
excelReader = EasyExcel.read(inputStream).build(); excelReader = EasyExcel.read(inputStream).build();
// 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener
ReadSheet readSheet = EasyExcel.readSheet(1).head(IndexModel.class) ReadSheet readSheet = EasyExcel.readSheet(1).head(IndexModel.class)
.registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService)) .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService,
customerId,
indexGroupDetailService))
.build(); .build();
excelReader.read(readSheet); excelReader.read(readSheet);
} finally { } finally {

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java

@ -22,6 +22,7 @@ import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -47,4 +48,6 @@ public interface IndexGroupDetailDao extends BaseDao<IndexGroupDetailEntity> {
* @return * @return
*/ */
List<IndexGroupDetailEntity> selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath); List<IndexGroupDetailEntity> selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath);
int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight);
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java

@ -19,11 +19,11 @@ package com.epmet.dao.heart;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.indexcollect.result.GridIndexCommonDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
@ -42,7 +42,7 @@ public interface ActInfoDao{
* @description 查询这个月各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 * @description 查询这个月各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的
* @Date 2020/9/21 10:41 * @Date 2020/9/21 10:41
**/ **/
List<Map<String, Integer>> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); List<GridIndexCommonDTO> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/** /**
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -9,6 +9,7 @@ import com.epmet.entity.evaluationindex.screen.IndexDictEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity;
import com.epmet.service.evaluationindex.screen.IndexDictService; import com.epmet.service.evaluationindex.screen.IndexDictService;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailService;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService;
import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService;
import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.Correlation;
@ -51,16 +52,25 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
private IndexGroupDetailTemplateService indexGroupDetailTemplateService; private IndexGroupDetailTemplateService indexGroupDetailTemplateService;
private IndexGroupDetailService indexGroupDetailService;
/**
* 客户id不为空时需要修改index_group_detail
*/
private String customerId;
/** /**
* 如果使用了spring,请使用这个构造方法每次创建Listener的时候需要把spring管理的类传进来 * 如果使用了spring,请使用这个构造方法每次创建Listener的时候需要把spring管理的类传进来
* *
* @param indexDictService * @param indexDictService
*/ */
public IndexExcelDataListener(IndexDictService indexDictService, IndexGroupTemplateService indexGroupTemplateService, IndexGroupDetailTemplateService indexGroupDetailTemplateService) { public IndexExcelDataListener(IndexDictService indexDictService, IndexGroupTemplateService indexGroupTemplateService, IndexGroupDetailTemplateService indexGroupDetailTemplateService,
String customerId,
IndexGroupDetailService indexGroupDetailService) {
this.indexDictService = indexDictService; this.indexDictService = indexDictService;
this.indexGroupTemplateService = indexGroupTemplateService; this.indexGroupTemplateService = indexGroupTemplateService;
this.indexGroupDetailTemplateService = indexGroupDetailTemplateService; this.indexGroupDetailTemplateService = indexGroupDetailTemplateService;
this.customerId=customerId;
this.indexGroupDetailService=indexGroupDetailService;
} }
/** /**
@ -329,10 +339,16 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
@Override @Override
public void doAfterAllAnalysed(AnalysisContext context) { public void doAfterAllAnalysed(AnalysisContext context) {
// 这里也要保存数据,确保最后遗留的数据也存储到数据库 // 这里也要保存数据,确保最后遗留的数据也存储到数据库
if(StringUtils.isNotBlank(customerId)){
//修改客户权重信息
updateCustomerGroupDetail();
}else{
saveData(); saveData();
}
LOGGER.info("所有数据解析完成!total:{}", total.intValue()); LOGGER.info("所有数据解析完成!total:{}", total.intValue());
} }
/** /**
* 加上存储数据库 * 加上存储数据库
*/ */
@ -346,4 +362,11 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
indexGroupDetailTemplateService.deleteAndInsertBatch(indexGroupDetailMap.values()); indexGroupDetailTemplateService.deleteAndInsertBatch(indexGroupDetailMap.values());
LOGGER.info("存储数据库成功!指标:{}个,分组:{}个,详情:{}个", indexDicMap.values().size(), indexGroupMap.values().size(), indexGroupDetailMap.values().size()); LOGGER.info("存储数据库成功!指标:{}个,分组:{}个,详情:{}个", indexDicMap.values().size(), indexGroupMap.values().size(), indexGroupDetailMap.values().size());
} }
/**
* 修改客户权重信息
*/
private void updateCustomerGroupDetail() {
indexGroupDetailService.updateCustomerIndexGroupDetail(indexGroupDetailMap.values(),customerId);
}
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java

@ -275,7 +275,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
}); });
} }
//网格办结项目数 //网格办结项目数
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSE);
//网格吹哨部门准确率 【没被退回的项目数/项目总数 】 //网格吹哨部门准确率 【没被退回的项目数/项目总数 】
List<NotReturnProjectResultDTO> notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE); List<NotReturnProjectResultDTO> notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE);
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){ if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){
@ -319,7 +319,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
scoreMap.forEach((k,v) -> { scoreMap.forEach((k,v) -> {
allScore.set(++v); allScore.set(++v);
}); });
resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size())));
}); });
} }
String quarterId = DateUtils.getQuarterId(monthId); String quarterId = DateUtils.getQuarterId(monthId);

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java

@ -19,8 +19,10 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
@ -46,4 +48,14 @@ public interface IndexGroupDetailService extends BaseService<IndexGroupDetailEnt
* @param allPathIndexCode * @param allPathIndexCode
*/ */
BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode); BigDecimal getWeightByAllPathIndexCode(String customerId, String allPathIndexCode);
/**
* @return void
* @param values
* @param customerId
* @author yinzuomei
* @description 修改客户权重信息
* @Date 2020/10/14 13:40
**/
void updateCustomerIndexGroupDetail(Collection<IndexGroupDetailTemplateEntity> values, String customerId);
} }

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity;
import com.epmet.redis.IndexCalRedis; import com.epmet.redis.IndexCalRedis;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -33,6 +34,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -79,4 +81,21 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl<IndexGroupDetai
return weight == null ? new BigDecimal(NumConstant.ONE_NEG) : weight; return weight == null ? new BigDecimal(NumConstant.ONE_NEG) : weight;
} }
/**
* @param values
* @param customerId
* @return void
* @author yinzuomei
* @description 修改客户权重信息
* @Date 2020/10/14 13:40
**/
@Override
public void updateCustomerIndexGroupDetail(Collection<IndexGroupDetailTemplateEntity> values, String customerId) {
int updatedNum=0;
for(IndexGroupDetailTemplateEntity entity:values){
updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight());
}
log.info("修改客户权重信息,影响行数="+updatedNum);
}
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java

@ -17,8 +17,11 @@
package com.epmet.service.evaluationindex.screen.impl; package com.epmet.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.CompareConstant; import com.epmet.constant.CompareConstant;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -36,7 +39,9 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 大屏数据采集 * 大屏数据采集
@ -299,6 +304,11 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
} while (deleteNum != NumConstant.ZERO); } while (deleteNum != NumConstant.ZERO);
} }
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
List<CustomerAgencyFormDTO> pidIsZeroList = formDTO.getDataList().stream().filter(d -> d.getPid().equals(NumConstant.ZERO_STR) || "".equals(d.getPid())).collect(Collectors.toList());
if (pidIsZeroList.size()>=NumConstant.ONE){
Object o = JSONObject.toJSON(pidIsZeroList);
throw new RenException("多个pid为【0】的数据:"+o.toString());
}
screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId); screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId);
} }
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java

@ -5,13 +5,12 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.heart.ActInfoDao; import com.epmet.dao.heart.ActInfoDao;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.indexcollect.result.GridIndexCommonDTO;
import com.epmet.service.heart.ActInfoService; import com.epmet.service.heart.ActInfoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -53,12 +52,10 @@ public class ActInfoServiceImpl implements ActInfoService {
@Override @Override
@DataSource(DataSourceConstant.EPMET_HEART) @DataSource(DataSourceConstant.EPMET_HEART)
public Map<String, Integer> calActivityCountMap(String customerId, String monthId) { public Map<String, Integer> calActivityCountMap(String customerId, String monthId) {
List<Map<String, Integer>> mapList = baseDao.selectActGroupByGridId(customerId, monthId); List<GridIndexCommonDTO> list = baseDao.selectActGroupByGridId(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>(); Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) { for (GridIndexCommonDTO gridIndexCommonDTO : list) {
for (Map.Entry<String, Integer> m : map.entrySet()) { resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue());
resultMap.put(m.getKey(), m.getValue());
}
} }
return resultMap; return resultMap;
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -281,6 +281,7 @@
) fl ON fm.ID = fl.PROJECT_ID ) fl ON fm.ID = fl.PROJECT_ID
WHERE fm.CUSTOMER_ID = #{customerId} WHERE fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId} AND fm.MONTH_ID = #{monthId}
AND fm.PROJECT_STATUS = 'closed'
) a ) a
GROUP BY GROUP BY
GRID_ID GRID_ID
@ -317,6 +318,7 @@
) fl ON fm.ID = fl.PROJECT_ID ) fl ON fm.ID = fl.PROJECT_ID
WHERE fm.CUSTOMER_ID = #{customerId} WHERE fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId} AND fm.MONTH_ID = #{monthId}
AND fm.PROJECT_STATUS = 'closed'
) a ) a
GROUP BY GROUP BY
AGENCY_ID AGENCY_ID

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml

@ -31,4 +31,13 @@
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0' CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0'
and ALL_PARENT_INDEX_CODE like concat(#{allIndexCodePath,jdbcType=VARCHAR},'%') and ALL_PARENT_INDEX_CODE like concat(#{allIndexCodePath,jdbcType=VARCHAR},'%')
</select> </select>
<update id="updateWeight" parameterType="map">
UPDATE index_group_detail
SET WEIGHT =#{weight}
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND INDEX_CODE = #{indexCode}
</update>
</mapper> </mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml

@ -30,6 +30,7 @@
`NAME`, `NAME`,
USER_NAME, USER_NAME,
POINT_TOTAL, POINT_TOTAL,
INDEX_SCORE,
DEL_FLAG, DEL_FLAG,
REVISION, REVISION,
CREATED_BY, CREATED_BY,
@ -53,6 +54,7 @@
#{item.name}, #{item.name},
#{item.userName}, #{item.userName},
#{item.pointTotal}, #{item.pointTotal},
IFNULL(#{item.indexScore},0),
0, 0,
0, 0,
'APP_USER', 'APP_USER',

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

@ -3,10 +3,10 @@
<mapper namespace="com.epmet.dao.heart.ActInfoDao"> <mapper namespace="com.epmet.dao.heart.ActInfoDao">
<!-- 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 --> <!-- 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 -->
<select id="selectActGroupByGridId" parameterType="map" resultType="java.util.Map"> <select id="selectActGroupByGridId" parameterType="map" resultType="com.epmet.dto.indexcollect.result.GridIndexCommonDTO">
SELECT SELECT
ai.SPONSOR_ID, ai.SPONSOR_ID as gridId,
count( 1 ) AS totalAct count( 1 ) AS indexValue
FROM FROM
act_info ai act_info ai
WHERE WHERE

7
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

@ -80,9 +80,14 @@ public class ExtAppJwtTokenUtils {
//String appId = "acc4ad66c82a7b46e741364b4c62dce2"; //String appId = "acc4ad66c82a7b46e741364b4c62dce2";
// String customrId = "b09527201c4409e19d1dbc5e3c3429a1"; // String customrId = "b09527201c4409e19d1dbc5e3c3429a1";
//孔村 //孔村
// String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8";
// String appId = "f358d63a89f3670c197c62ca4c3a0366";
// String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933";
//测试-模拟客户
String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8";
String appId = "f358d63a89f3670c197c62ca4c3a0366"; String appId = "f358d63a89f3670c197c62ca4c3a0366";
String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; String customrId = "45687aa479955f9d06204d415238f7cc";
claim.put("customerId", customrId); claim.put("customerId", customrId);
claim.put("appId", appId); claim.put("appId", appId);

Loading…
Cancel
Save