|
@ -22,6 +22,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
import com.epmet.constant.CompareConstant; |
|
|
import com.epmet.constant.CompareConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
@ -35,6 +36,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; |
|
|
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; |
|
|
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; |
|
|
import com.epmet.service.evaluationindex.screen.ScreenEventImgDataService; |
|
|
import com.epmet.service.evaluationindex.screen.ScreenEventImgDataService; |
|
|
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; |
|
|
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -54,6 +56,7 @@ import java.util.stream.Collectors; |
|
|
* @author generator generator@elink-cn.com |
|
|
* @author generator generator@elink-cn.com |
|
|
* @since v1.0.0 2020-05-11 |
|
|
* @since v1.0.0 2020-05-11 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Slf4j |
|
|
@Service |
|
|
@Service |
|
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|
|
public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
@ -374,18 +377,19 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
orgIds[i] = formDTO.getDataList().get(i).getOrgId(); |
|
|
orgIds[i] = formDTO.getDataList().get(i).getOrgId(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String[] lastMonth = this.lastMonthDate(); |
|
|
/*String[] lastMonth = this.lastMonthDate(); |
|
|
// 获取上个月的基本数据
|
|
|
// 获取上个月的基本数据
|
|
|
String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; |
|
|
String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE];*/ |
|
|
|
|
|
String monthId= DateUtils.getBeforeNMonthByMonth(1,formDTO.getMonthId()); |
|
|
List<ScreenUserJoinEntity> lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, |
|
|
List<ScreenUserJoinEntity> lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, |
|
|
lastMonth[NumConstant.ZERO], |
|
|
monthId, |
|
|
moneth, |
|
|
|
|
|
orgIds); |
|
|
orgIds); |
|
|
|
|
|
|
|
|
// 定义本月待添加数据的集合
|
|
|
// 定义本月待添加数据的集合
|
|
|
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>(); |
|
|
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>(); |
|
|
// 增加率计算
|
|
|
// 增加率计算
|
|
|
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { |
|
|
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { |
|
|
|
|
|
log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId的上月已有数据集合长度="+lastMonthJoinList.size()); |
|
|
// 存在上个月的数据 (本月-上月)/上月 *100
|
|
|
// 存在上个月的数据 (本月-上月)/上月 *100
|
|
|
for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { |
|
|
for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { |
|
|
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { |
|
|
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { |
|
@ -402,6 +406,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId上月不存在数据。"); |
|
|
// 计算增长率后的 待新增数据
|
|
|
// 计算增长率后的 待新增数据
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
// 不存在上个月的数据
|
|
|
// 不存在上个月的数据
|
|
|