diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java new file mode 100644 index 0000000000..1d56dd17b1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标计算通用入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:49 + */ +@Data +public class CalculateCommonFormDTO implements Serializable { + /** + * 月份id: yyyyMM + */ + private String monthId; + + /** + * 客户id + */ + private String customerId; + + public CalculateCommonFormDTO(String customerId, String monthId) { + this.monthId=monthId; + this.customerId=customerId; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java new file mode 100644 index 0000000000..63dbb58262 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueCommonDTO implements Serializable { + + /** + * 最小值 + */ + private BigDecimal minValue; + + /** + * 最小值 + */ + private BigDecimal maxValue; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java new file mode 100644 index 0000000000..89001f5d4f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java @@ -0,0 +1,21 @@ +package com.epmet.service.indexcal; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 网格相关指标计算 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:34 + */ +public interface GridCorreLationService { + + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java new file mode 100644 index 0000000000..70a6a9222b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -0,0 +1,27 @@ +package com.epmet.service.indexcal.impl; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.service.indexcal.GridCorreLationService; +import org.springframework.stereotype.Service; + +/** + * 网格相关service + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:35 + */ +@Service +public class GridCorreLationServiceImpl implements GridCorreLationService { + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + @Override + public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 4558c87927..54a368044b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -3,9 +3,11 @@ package com.epmet.service.screen.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.screen.IndexCalculateService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; @@ -27,6 +29,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private GridCorreLationService gridCorreLationService; @Override public Boolean indexCalculate(IndexCalculateForm formDTO) { @@ -44,6 +48,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { formDTO.setCustomerIds(externalCustomerIdsResult.getData()); } formDTO.getCustomerIds().forEach(customerId -> { + CalculateCommonFormDTO calculateCommonFormDTO=new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); //计算党员 try { List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId()); @@ -53,7 +58,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算网格 //TODO - + gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); //计算社区 //TODO