Browse Source

根据指标code获取feild

dev_shibei_match
jianjun 5 years ago
parent
commit
59ddb2ef4e
  1. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java
  2. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml
  5. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java

@ -4,10 +4,10 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.screen.IndexCodeFieldReEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
import java.util.List;
@Mapper
public interface IndexCodeFieldReDao extends BaseDao<IndexCodeFieldReEntity> {
Map<String, String> getAllData();
List<IndexCodeFieldReEntity> getAllData();
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -48,9 +48,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
log.warn("cpcIndexCalculate have any indexcodefieldre");
return false;
}
indexDetails.forEach(indexDetail->{
String indexCode = null;
String fieldName = null;
for (IndexGroupDetailEntity indexDetail : indexDetails) {
indexCode = indexDetail.getIndexCode();
fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode);
});
}
log.info(JSON.toJSONString(minAndMaxList));
Map<String, BigDecimal> list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java

@ -1,13 +1,17 @@
package com.epmet.service.indexcal.impl;
import com.epmet.dao.screen.IndexCodeFieldReDao;
import com.epmet.entity.screen.IndexCodeFieldReEntity;
import com.epmet.redis.IndexCodeFieldReRedis;
import com.epmet.service.indexcal.IndexCodeFieldReService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService {
@ -21,7 +25,11 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService {
public Map<String, String> getIndexCodeFieldReMap() {
Map<String, String> indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap();
if (CollectionUtils.isEmpty(indexCodeFiledReMap)) {
indexCodeFiledReMap = indexCodeFieldReDao.getAllData();
List<IndexCodeFieldReEntity> allData = indexCodeFieldReDao.getAllData();
if (CollectionUtils.isEmpty(allData)){
return new HashMap<>();
}
indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexCodeFieldReEntity::getIndexCode, o -> o.getFieldId()));
indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap);
}
return indexCodeFiledReMap;

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml

@ -96,6 +96,10 @@
<select id="getCountByMonthId" resultType="java.util.Map">
SELECT
CUSTOMER_ID,
AGENCY_ID,
PARENT_ID,
GRID_ID,
CREATE_TOPIC_COUNT,
JOIN_TOPIC_COUNT,
SHIFT_ISSUE_COUNT,

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml

@ -4,7 +4,8 @@
<mapper namespace="com.epmet.dao.screen.IndexCodeFieldReDao">
<select id="getAllData" resultType="java.util.Map">
SELECT INDEX_CODE,FIELD_ID FROM index_code_field_re WHERE DEL_FLAG = '0';
<select id="getAllData" resultType="com.epmet.entity.screen.IndexCodeFieldReEntity">
SELECT INDEX_CODE,FIELD_ID FROM index_code_field_re WHERE DEL_FLAG = '0'
</select>
</mapper>
Loading…
Cancel
Save