forked from rongchao/epmet-cloud-rizhao
				
			
			
			
				Browse Source
			
			
			
			
				
		# Conflicts: # epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml # epmet-module/epmet-third/epmet-third-server/pom.xmldev
				 16 changed files with 196 additions and 8 deletions
			
			
		| @ -0,0 +1,43 @@ | |||
| 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 ExtremeValueDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = -2227402439857459667L; | |||
| 
 | |||
|     /** | |||
|      * 最小值 | |||
|      */ | |||
|     private BigDecimal minValue1; | |||
|     private BigDecimal minValue2; | |||
|     private BigDecimal minValue3; | |||
|     private BigDecimal minValue4; | |||
|     private BigDecimal minValue5; | |||
|     private BigDecimal minValue6; | |||
|     private BigDecimal minValue7; | |||
|     private BigDecimal minValue8; | |||
|     private BigDecimal minValue9; | |||
|     private BigDecimal minValue10; | |||
| 
 | |||
|     private BigDecimal maxValue1; | |||
|     private BigDecimal maxValue2; | |||
|     private BigDecimal maxValue3; | |||
|     private BigDecimal maxValue4; | |||
|     private BigDecimal maxValue5; | |||
|     private BigDecimal maxValue6; | |||
|     private BigDecimal maxValue7; | |||
|     private BigDecimal maxValue8; | |||
|     private BigDecimal maxValue9; | |||
|     private BigDecimal maxValue10; | |||
| } | |||
| @ -0,0 +1,9 @@ | |||
| package com.epmet.dao.screen; | |||
| 
 | |||
| import com.epmet.commons.mybatis.dao.BaseDao; | |||
| import com.epmet.entity.screen.IndexCodeFieldReEntity; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| 
 | |||
| @Mapper | |||
| public interface IndexCodeFieldReDao extends BaseDao<IndexCodeFieldReEntity> { | |||
| } | |||
| @ -0,0 +1,21 @@ | |||
| package com.epmet.entity.screen; | |||
| 
 | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| 
 | |||
| @Data | |||
| @EqualsAndHashCode(callSuper=false) | |||
| @TableName("index_code_field_re") | |||
| public class IndexCodeFieldReEntity extends BaseEpmetEntity { | |||
|     /** | |||
|      * 指标code | |||
|      */ | |||
|     private String indexCode; | |||
| 
 | |||
|     /** | |||
|      * 字段名 | |||
|      */ | |||
|     private String fieldId; | |||
| } | |||
| @ -0,0 +1,18 @@ | |||
| package com.epmet.service.screen; | |||
| 
 | |||
| import com.epmet.dto.indexcal.CalculateCommonFormDTO; | |||
| 
 | |||
| /** | |||
|  * 党员指标计算service | |||
|  * | |||
|  * @author liujianjun@elink-cn.com | |||
|  * @date 2020/8/18 10:25 | |||
|  */ | |||
| public interface CpcIndexCalculateService { | |||
|     /** | |||
|      * desc:计算党员相关指标 | |||
|      * @param formDTO | |||
|      * @return | |||
|      */ | |||
|     Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO); | |||
| } | |||
| @ -0,0 +1,34 @@ | |||
| package com.epmet.service.screen.impl; | |||
| 
 | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; | |||
| import com.epmet.dto.indexcal.CalculateCommonFormDTO; | |||
| import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; | |||
| import com.epmet.service.screen.CpcIndexCalculateService; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.util.CollectionUtils; | |||
| 
 | |||
| import java.math.BigDecimal; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| 
 | |||
| @Slf4j | |||
| @Service | |||
| public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { | |||
|     @Autowired | |||
|     private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; | |||
|     @Override | |||
|     public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { | |||
|         //计算最大最小值
 | |||
|         Map<String, BigDecimal> minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); | |||
|         if (CollectionUtils.isEmpty(minAndMaxList)){ | |||
|             log.warn("customerId:{} have not any record",formDTO.getCustomerId()); | |||
|             return false; | |||
|         } | |||
|         log.info(JSON.toJSONString(minAndMaxList)); | |||
|         List<FactIndexPartyAblityCpcMonthlyEntity> list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); | |||
|         return null; | |||
|     } | |||
| } | |||
| @ -0,0 +1,6 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| 
 | |||
| <mapper namespace="com.epmet.dao.screen.IndexCodeFieldReDao"> | |||
| 
 | |||
| </mapper> | |||
					Loading…
					
					
				
		Reference in new issue