Browse Source

Merge branch 'dev_bug_usershowname_syc' into dev_temp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
3d263217f5
  1. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  6. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  8. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java
  10. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

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

@ -200,6 +200,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
String agencyId = issue.getAgencyId();
agencyIdSet.add(agencyId);
ScreenUserJoinEntity entity = insertMap.get(agencyId);
//todo 这里为什么会没有
if (entity == null){
return;
}
entity.setJoinTotal(issue.getIssueIncr());
GridUserCountResultDTO user = userCountMap.get(agencyId);
//百人人均议题:统计周期内总的议题数/(注册用户数/100)

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java

@ -116,7 +116,6 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
}
private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) {
//todo 指标添加缓存
List<IndexGroupDetailEntity> indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
if (CollectionUtils.isEmpty(indexList)) {
@ -143,7 +142,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
Map<String, BigDecimal> weightMap = new HashMap<>();
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight()));
} else {
@ -153,7 +152,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
});
Map<String, DeptSelfSubScoreEntity> insertMap = new HashMap<>();
subScore.forEach(score -> {
String key = score.getAgencyId().concat(index.getIndexCode());
String key = score.getDeptId().concat(index.getIndexCode());
DeptSelfSubScoreEntity scoreEntity = insertMap.get(key);
if (scoreEntity == null) {
scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class);
@ -182,7 +181,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map<String, DeptSelfSubScoreEntity> insertMap) {
int effectRow = 0;
do {
deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
effectRow = deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
} while (effectRow > 0);
deptSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values()));
@ -465,4 +464,4 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
return map;
}
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -133,7 +133,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
Map<String, BigDecimal> weightMap = new HashMap<>();
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight()));
} else {

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -165,7 +165,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
Map<String, BigDecimal> weightMap = new HashMap<>();
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight()));
} else {

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -160,7 +160,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
Map<String, BigDecimal> weightMap = new HashMap<>();
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight()));
} else {

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java

@ -135,7 +135,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
start = System.currentTimeMillis();
try {
flag = gridCorreLationService.calculateGridCorreLation(formDTO);
log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
} catch (Exception e) {
log.error("indexCalculate calculateGridCorreLation exception", e);
}
@ -143,7 +143,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
start = System.currentTimeMillis();
try {
flag = indexCalculateCommunityService.calCommunityAll(formDTO);
log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
} catch (Exception e) {
log.error("indexCalculate calCommunityAll exception", e);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -168,7 +168,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
Map<String, BigDecimal> weightMap = new HashMap<>();
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight()));
} else {

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -80,13 +80,19 @@ public class BatchScoreCalculator {
.multiply(
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)))
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP);
//
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}
//如果是负相关 则用100-归一后的值为最大值减
if (Correlation.NEGATIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
}
//如果归一后的值小于0 则置为0
if (normalizeValue.compareTo(NumConstant.ZERO_DECIMAL)<=-1){
normalizeValue = NumConstant.ZERO_DECIMAL;
}
BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP);
CalculateResult result = scoreCountOfSamples.get(sampleId);

2
epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java

@ -5,7 +5,7 @@ import java.math.RoundingMode;
public class MathUtilTest {
public static void main(String[] args) {
//值 域:(-π/2,π/2) ->(60,100)
//值 域:[-π/2,π/2] ->[60,100]
double tan = Math.atan(4);
double tan2 = Math.atan(1);
double tan3 = Math.atan(8);

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -338,7 +338,7 @@
LEFT JOIN customer_agency ca ON ca.id = cg.pid
WHERE
cg.id = #{gridId}
AND cg.del_flag = 0
<!-- AND cg.del_flag = 0 --><!-- 网格被删除时,首次在该网格注册的居民就找不到了所属网格,暂时关闭这个查询条件,避免缓存中user的showname和组成员member的usershowname出现空值 -->
</select>
<select id="selectGridList" resultType="com.epmet.dto.result.GridListResultDTO">

Loading…
Cancel
Save