From 492813fd989cd483ca32902bea1ff797388dfc3b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 9 Jul 2021 20:14:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=E9=87=87?= =?UTF-8?q?=E9=9B=86=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/ScreenUserJoinDao.java | 2 -- .../screen/impl/ScreenUserJoinServiceImpl.java | 1 - .../screen/impl/ShiBeiScreenCollServiceImpl.java | 13 +++++++++---- .../evaluationindex/screen/ScreenUserJoinDao.xml | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java index ada3123821..02757feb13 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -37,7 +37,6 @@ public interface ScreenUserJoinDao extends BaseDao { * 11、基层治理-公众参与 * 0) 查询上月的基础数据,可用来计算本月的增长率 * @param customerId - * @param yearId * @param monthId * @param orgIds 组织Id集合 * @return java.util.List @@ -45,7 +44,6 @@ public interface ScreenUserJoinDao extends BaseDao { * @Date 14:46 2020-08-21 **/ List selectLastMonthScreenUserJoinList(@Param("customerId") String customerId, - @Param("yearId") String yearId, @Param("monthId") String monthId, @Param("orgIds") String[] orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java index a402ac4370..d2e5dfcdb0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java @@ -72,7 +72,6 @@ public class ScreenUserJoinServiceImpl extends BaseServiceImpl lastMonthJoinList = baseDao.selectLastMonthScreenUserJoinList(formDTO.getCustomerId(), - dimIdBean.getYearId(), dimIdBean.getMonthId(), orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 5bb05989fe..0982493cb5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.CompareConstant; 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.service.evaluationindex.screen.ScreenEventImgDataService; import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,6 +56,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2020-05-11 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @@ -374,18 +377,19 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { 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 lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, - lastMonth[NumConstant.ZERO], - moneth, + monthId, orgIds); // 定义本月待添加数据的集合 List curMonthJoinEntityList = new ArrayList<>(); // 增加率计算 if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { + log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId的上月已有数据集合长度="+lastMonthJoinList.size()); // 存在上个月的数据 (本月-上月)/上月 *100 for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { @@ -402,6 +406,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } } } else { + log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId上月不存在数据。"); // 计算增长率后的 待新增数据 BigDecimal zero = new BigDecimal(NumConstant.ZERO); // 不存在上个月的数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 42cc5ffba3..031ea37121 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -13,7 +13,7 @@ AVG_ISSUE avgIssue, AVG_JOIN avgJoin from screen_user_join - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND ORG_ID IN #{item}