diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java index e95933e1c1..6cc63810e2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java +++ b/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 BigDecimal averageIssue = new BigDecimal(NumConstant.ZERO); + private Integer averageIssue = NumConstant.ZERO; /** * 较上月百分比 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java index a64f02a279..5e174b0de7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java +++ b/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; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 01b433dc0d..872210194d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/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 */ @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public IndexScoreResultDTO indexScore(IndexScoreFormDTO formDTO) { //screen_index_data_monthly 根据组织id和月份获取月度指标得分 //1.大屏接口 orgType和monthId字段不传值,默认查询上一个月数据 @@ -307,6 +308,7 @@ public class IndexServiceImpl implements IndexService { * @author sun */ @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public List advancedBranchRank(AdvancedBranchRankFormDTO formDTO) { //根据当前所选组织,查询screen_index_data_monthly中类型为网格的按照总指数倒序,关联screen_org_rank_data表取其他数据 //1.级联查询组织下所有网格的先进支部排行数据,按总指数降序 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java index 1a92a59d95..7721876c58 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java +++ b/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.constant.DataSourceConstant; 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.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; @@ -34,6 +33,7 @@ public class ScreenUserServiceImpl implements ScreenUserService { * @author sun */ @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public List userPointRank(UserPointRankFormDTO formDTO) { //1.参数校验 if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { @@ -49,6 +49,7 @@ public class ScreenUserServiceImpl implements ScreenUserService { * @author sun */ @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) { //1.参数校验 if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index bfcea6b543..d4543b4aa7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/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 */ @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public List peerComparison(PeerComparisonFormDTO formDTO) { //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) List resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); @@ -466,6 +467,7 @@ public class FactIndexServiceImpl implements FactIndexService { * @author sun */ @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); //1.根据agencyId查询是否为根级组织 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 7d7cde6449..0bbd2d41d0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -10,7 +10,7 @@ ROUND( AVG_JOIN, 1 ) AS averageJoin, JOIN_TOTAL_UP_RATE AS monthIncr, 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_FLAG AS issueCompareLatestTrend, AGVG_JOIN_UP_RATE AS joinCompareLatestMonth, diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java index 1616d2baa1..b14cf72156 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java +++ b/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 CLOSE = "close"; + String CLOSED = "closed"; String GRID_ORG_TYPE = "grid"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java index 10b5603577..f697eae86f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java +++ b/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; /** - * 描述一下 + * 党员相关用 * * @author yinzuomei@elink-cn.com * @date 2020/10/12 21:57 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java new file mode 100644 index 0000000000..3cec199149 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java index 5d9f5da32b..3e122dea76 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java +++ b/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 java.io.Serializable; +import java.math.BigDecimal; /** * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 @@ -64,6 +65,11 @@ public class PartyUserRankDataFormDTO implements Serializable { */ private Integer pointTotal; + /** + * 指标得分 + */ + private BigDecimal indexScore; + /** * 姓 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java index 03deff604d..6a24b3e98b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java +++ b/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.model.IndexExcelDataListener; import com.epmet.model.IndexModel; -import com.epmet.service.evaluationindex.screen.IndexDictService; -import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; -import com.epmet.service.evaluationindex.screen.IndexGroupService; -import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; +import com.epmet.service.evaluationindex.screen.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +34,8 @@ public class IndexDictController { private IndexGroupService indexGroupService; @Autowired private IndexGroupDetailTemplateService indexGroupDetailTemplateService; - + @Autowired + private IndexGroupDetailService indexGroupDetailService; /** * url:http://localhost:8108/data/stats/indexdict/initFromExcel * desc:从excel初始化指标,分组,权重 @@ -46,7 +44,7 @@ public class IndexDictController { * @return */ @PostMapping("initFromExcel") - public Result testTx(@RequestPart("file") MultipartFile file) { + public Result testTx(@RequestPart("file") MultipartFile file,@RequestParam("customerId") String customerId) { ExcelReader excelReader = null; try { InputStream inputStream = null; @@ -58,7 +56,9 @@ public class IndexDictController { excelReader = EasyExcel.read(inputStream).build(); // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener ReadSheet readSheet = EasyExcel.readSheet(1).head(IndexModel.class) - .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService)) + .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService, + customerId, + indexGroupDetailService)) .build(); excelReader.read(readSheet); } finally { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java index b173b94bd6..2c6d867a08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java +++ b/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.Param; +import java.math.BigDecimal; import java.util.List; /** @@ -47,4 +48,6 @@ public interface IndexGroupDetailDao extends BaseDao { * @return */ List selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath); + + int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java index d878fb84a3..f9771495df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java +++ b/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.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; /** @@ -42,7 +42,7 @@ public interface ActInfoDao{ * @description 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 * @Date 2020/9/21 10:41 **/ - List> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); + List selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * @return java.util.List diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index 23a305e8f9..9870714357 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/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.IndexGroupTemplateEntity; 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.IndexGroupTemplateService; import com.epmet.support.normalizing.Correlation; @@ -51,16 +52,25 @@ public class IndexExcelDataListener extends AnalysisEventListener { private IndexGroupDetailTemplateService indexGroupDetailTemplateService; + private IndexGroupDetailService indexGroupDetailService; + /** + * 客户id不为空时,需要修改index_group_detail + */ + private String customerId; /** * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 * * @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.indexGroupTemplateService = indexGroupTemplateService; this.indexGroupDetailTemplateService = indexGroupDetailTemplateService; + this.customerId=customerId; + this.indexGroupDetailService=indexGroupDetailService; } /** @@ -329,10 +339,16 @@ public class IndexExcelDataListener extends AnalysisEventListener { @Override public void doAfterAllAnalysed(AnalysisContext context) { // 这里也要保存数据,确保最后遗留的数据也存储到数据库 - saveData(); + if(StringUtils.isNotBlank(customerId)){ + //修改客户权重信息 + updateCustomerGroupDetail(); + }else{ + saveData(); + } LOGGER.info("所有数据解析完成!total:{}", total.intValue()); } + /** * 加上存储数据库 */ @@ -346,4 +362,11 @@ public class IndexExcelDataListener extends AnalysisEventListener { indexGroupDetailTemplateService.deleteAndInsertBatch(indexGroupDetailMap.values()); LOGGER.info("存储数据库成功!指标:{}个,分组:{}个,详情:{}个", indexDicMap.values().size(), indexGroupMap.values().size(), indexGroupDetailMap.values().size()); } + + /** + * 修改客户权重信息 + */ + private void updateCustomerGroupDetail() { + indexGroupDetailService.updateCustomerIndexGroupDetail(indexGroupDetailMap.values(),customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 1d189bacef..6cce879f26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/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 gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); + List gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSE); //网格吹哨部门准确率 【没被退回的项目数/项目总数 】 List notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE); if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){ @@ -319,7 +319,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { scoreMap.forEach((k,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); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java index eb77f2cf63..9e903481f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java +++ b/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.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import java.math.BigDecimal; +import java.util.Collection; import java.util.List; /** @@ -46,4 +48,14 @@ public interface IndexGroupDetailService extends BaseService values, String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java index 26fb5b8cc2..0b807c0f7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java +++ b/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.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import com.epmet.redis.IndexCalRedis; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; import lombok.extern.slf4j.Slf4j; @@ -33,6 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -79,4 +81,21 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl values, String customerId) { + int updatedNum=0; + for(IndexGroupDetailTemplateEntity entity:values){ + updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight()); + } + log.info("修改客户权重信息,影响行数="+updatedNum); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 9438f4c3ea..ef164bfaf8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/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; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.CompareConstant; import com.epmet.constant.DataSourceConstant; @@ -36,7 +39,9 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; +import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; /** * 大屏数据采集 @@ -299,6 +304,11 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + List 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); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java index dfe7a5f263..b0fffe3f6d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java +++ b/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.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.service.heart.ActInfoService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -53,12 +52,10 @@ public class ActInfoServiceImpl implements ActInfoService { @Override @DataSource(DataSourceConstant.EPMET_HEART) public Map calActivityCountMap(String customerId, String monthId) { - List> mapList = baseDao.selectActGroupByGridId(customerId, monthId); + List list = baseDao.selectActGroupByGridId(customerId, monthId); Map resultMap = new HashMap<>(); - for (Map map : mapList) { - for (Map.Entry m : map.entrySet()) { - resultMap.put(m.getKey(), m.getValue()); - } + for (GridIndexCommonDTO gridIndexCommonDTO : list) { + resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue()); } return resultMap; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 9b121ddcb5..7ddb366da3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/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 WHERE fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} + AND fm.PROJECT_STATUS = 'closed' ) a GROUP BY GRID_ID @@ -317,6 +318,7 @@ ) fl ON fm.ID = fl.PROJECT_ID WHERE fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} + AND fm.PROJECT_STATUS = 'closed' ) a GROUP BY AGENCY_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index 52ef05f966..6624f1b58a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/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' and ALL_PARENT_INDEX_CODE like concat(#{allIndexCodePath,jdbcType=VARCHAR},'%') + + + UPDATE index_group_detail + SET WEIGHT =#{weight} + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND INDEX_CODE = #{indexCode} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml index 66fc4cf716..2d59208760 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -30,6 +30,7 @@ `NAME`, USER_NAME, POINT_TOTAL, + INDEX_SCORE, DEL_FLAG, REVISION, CREATED_BY, @@ -53,6 +54,7 @@ #{item.name}, #{item.userName}, #{item.pointTotal}, + IFNULL(#{item.indexScore},0), 0, 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml index 8f04291c27..d29bbb6cce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -3,10 +3,10 @@ - SELECT - ai.SPONSOR_ID, - count( 1 ) AS totalAct + ai.SPONSOR_ID as gridId, + count( 1 ) AS indexValue FROM act_info ai WHERE diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 0f1674b319..b945889b7c 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/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 customrId = "b09527201c4409e19d1dbc5e3c3429a1"; //孔村 +// String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; +// String appId = "f358d63a89f3670c197c62ca4c3a0366"; +// String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + + //测试-模拟客户 String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; String appId = "f358d63a89f3670c197c62ca4c3a0366"; - String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + String customrId = "45687aa479955f9d06204d415238f7cc"; claim.put("customerId", customrId); claim.put("appId", appId);