|
@ -413,15 +413,35 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
* @Author zhangyong |
|
|
* @Author zhangyong |
|
|
* @Date 15:38 2020-08-21 |
|
|
* @Date 15:38 2020-08-21 |
|
|
**/ |
|
|
**/ |
|
|
private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ |
|
|
private BigDecimal calculateGrowthRateNumber(Integer old, Integer now) { |
|
|
if (NumConstant.ZERO == old){ |
|
|
if (NumConstant.ZERO == old) { |
|
|
return new BigDecimal(now * NumConstant.ONE_HUNDRED); |
|
|
return new BigDecimal(now * NumConstant.ONE_HUNDRED); |
|
|
} |
|
|
} |
|
|
BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); |
|
|
BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); |
|
|
BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); |
|
|
BigDecimal bignum2 = bignum1.divide(new BigDecimal(old), 2, BigDecimal.ROUND_HALF_UP); |
|
|
return bignum2; |
|
|
return bignum2; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 计算 本月数值 相较于 上月数值,的增长率 |
|
|
|
|
|
* |
|
|
|
|
|
* @param old 上月数值 |
|
|
|
|
|
* @param now 本月数值 |
|
|
|
|
|
* @return java.math.BigDecimal |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 15:38 2020-08-21 |
|
|
|
|
|
**/ |
|
|
|
|
|
private BigDecimal calculateGrowthRateNumber(BigDecimal old, BigDecimal now) { |
|
|
|
|
|
BigDecimal oneHundred = new BigDecimal(NumConstant.ONE_HUNDRED); |
|
|
|
|
|
if (old.compareTo(new BigDecimal(NumConstant.ZERO)) == NumConstant.ZERO) { |
|
|
|
|
|
return now.multiply(oneHundred); |
|
|
|
|
|
} |
|
|
|
|
|
BigDecimal bignum1 = now.subtract(old).multiply(oneHundred); |
|
|
|
|
|
BigDecimal bignum2 = bignum1.divide(old, 2, BigDecimal.ROUND_HALF_UP); |
|
|
|
|
|
return bignum2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 计算 本月数值 相较于 上月数值,的增长率, 得出标识 |
|
|
* 计算 本月数值 相较于 上月数值,的增长率, 得出标识 |
|
|
* |
|
|
* |
|
@ -431,10 +451,29 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
* @Author zhangyong |
|
|
* @Author zhangyong |
|
|
* @Date 15:38 2020-08-21 |
|
|
* @Date 15:38 2020-08-21 |
|
|
**/ |
|
|
**/ |
|
|
private String calculateGrowthRateFlag(Integer old, Integer now){ |
|
|
private String calculateGrowthRateFlag(Integer old, Integer now) { |
|
|
if (old > now){ |
|
|
if (old > now) { |
|
|
|
|
|
return CompareConstant.DECR_STR; |
|
|
|
|
|
} else if (old < now) { |
|
|
|
|
|
return CompareConstant.INCR_STR; |
|
|
|
|
|
} else { |
|
|
|
|
|
return CompareConstant.EQ_STR; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 计算 本月数值 相较于 上月数值,的增长率, 得出标识 |
|
|
|
|
|
* |
|
|
|
|
|
* @param old 上月数值 |
|
|
|
|
|
* @param now 本月数值 |
|
|
|
|
|
* @return java.util.String |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 15:38 2020-08-21 |
|
|
|
|
|
**/ |
|
|
|
|
|
private String calculateGrowthRateFlag(BigDecimal old, BigDecimal now) { |
|
|
|
|
|
if (old.compareTo(now) == 1) { |
|
|
return CompareConstant.DECR_STR; |
|
|
return CompareConstant.DECR_STR; |
|
|
} else if (old < now){ |
|
|
} else if (old.compareTo(now) == -1) { |
|
|
return CompareConstant.INCR_STR; |
|
|
return CompareConstant.INCR_STR; |
|
|
} else { |
|
|
} else { |
|
|
return CompareConstant.EQ_STR; |
|
|
return CompareConstant.EQ_STR; |
|
@ -448,7 +487,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
if (formDTO.getIsFirst()) { |
|
|
if (formDTO.getIsFirst()) { |
|
|
int deleteNum; |
|
|
int deleteNum; |
|
|
do { |
|
|
do { |
|
|
deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE); |
|
|
deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId, IndexCalConstant.DELETE_SIZE); |
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
} |
|
|
} |
|
|
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|
|
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|
|