From 7d59b04fbc9fac3d3954c932887e1ac105aac546 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 28 Jan 2021 13:51:02 +0800 Subject: [PATCH] canshujiaoyan --- .../ScreenProjectDataCollController.java | 139 +++++++++++------- ...enProjectCategoryGridDailyServiceImpl.java | 5 +- ...eenProjectCategoryOrgDailyServiceImpl.java | 5 +- .../ScreenProjectGridDailyServiceImpl.java | 5 +- .../ScreenProjectOrgDailyServiceImpl.java | 5 +- ...ProjectQuantityGridMonthlyServiceImpl.java | 5 +- ...nProjectQuantityOrgMonthlyServiceImpl.java | 5 +- 7 files changed, 91 insertions(+), 78 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java index d1cb54fa7c..863af7e32c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -6,6 +6,7 @@ import com.epmet.dto.indexcollect.*; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.service.evaluationindex.indexcoll.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestBody; @@ -24,65 +25,95 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("project") public class ScreenProjectDataCollController { - @Autowired - private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; - @Autowired - private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; - @Autowired - private ScreenProjectGridDailyService projectGridDailyService; - @Autowired - private ScreenProjectOrgDailyService projectOrgDailyService; - @Autowired - private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; - @Autowired - private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; + @Autowired + private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; + @Autowired + private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; + @Autowired + private ScreenProjectGridDailyService projectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; - @RequestMapping("category-grid-daily") - public Result categoryGridDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO param){ - if(null == param || CollectionUtils.isEmpty(param.getDataList())) - throw new ValidateException("传入数据不可为空"); - projectCategoryGridDailyService.collect(customerId,param); - return new Result(); - } + /** + * @author wangc + * @description 【事件/项目分析】按类别统计-网格 + **/ + @RequestMapping("category-grid-daily") + public Result categoryGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectCategoryGridDailyService.collect(customerId, param); + return new Result(); + } - @RequestMapping("category-org-daily") - public Result categoryOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO param){ - if(null == param || CollectionUtils.isEmpty(param.getDataList())) - throw new ValidateException("传入数据不可为空"); - projectCategoryOrgDailyService.collect(customerId,param); - return new Result(); - } + /** + * @author wangc + * @description 【事件/项目分析】按类别统计-组织 + **/ + @RequestMapping("category-org-daily") + public Result categoryOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectCategoryOrgDailyService.collect(customerId, param); + return new Result(); + } - @RequestMapping("quantity-grid-monthly") - public Result quantityGridMonthly(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO param){ - if(null == param || CollectionUtils.isEmpty(param.getDataList())) - throw new ValidateException("传入数据不可为空"); - projectQuantityGridMonthlyService.collect(customerId,param); - return new Result(); - } + /** + * @author wangc + * @description 【事件/项目分析】网格内月度数量统计 + **/ + @RequestMapping("quantity-grid-monthly") + public Result quantityGridMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { + throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); + } + projectQuantityGridMonthlyService.collect(customerId, param); + return new Result(); + } - @RequestMapping("quantity-org-monthly") - public Result quantityOrgMonthly(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO param){ - if(null == param || CollectionUtils.isEmpty(param.getDataList())) - throw new ValidateException("传入数据不可为空"); - projectQuantityOrgMonthlyService.collect(customerId,param); - return new Result(); - } + /** + * @author wangc + * @description 【事件/项目分析】组织内月度数量统计 + **/ + @RequestMapping("quantity-org-monthly") + public Result quantityOrgMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { + throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); + } + projectQuantityOrgMonthlyService.collect(customerId, param); + return new Result(); + } - @RequestMapping("project-grid-daily") - public Result projectGridDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO param){ - if(null == param || CollectionUtils.isEmpty(param.getDataList())) - throw new ValidateException("传入数据不可为空"); - projectGridDailyService.collect(customerId,param); - return new Result(); - } + /** + * @author wangc + * @description 【事件/项目分析】网格内事件 + **/ + @RequestMapping("project-grid-daily") + public Result projectGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectGridDailyService.collect(customerId, param); + return new Result(); + } - @RequestMapping("project-org-daily") - public Result projectOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO param){ - if(null == param || CollectionUtils.isEmpty(param.getDataList())) - throw new ValidateException("传入数据不可为空"); - projectOrgDailyService.collect(customerId,param); - return new Result(); - } + /** + * @author wangc + * @description 【事件/项目分析】组织内事件 + **/ + @RequestMapping("project-org-daily") + public Result projectOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectOrgDailyService.collect(customerId, param); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryGridDailyServiceImpl.java index a9ec67e0aa..3e6f889ec4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryGridDailyServiceImpl.java @@ -21,11 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.ScreenProjectCategoryGridDailyDao; import com.epmet.dto.indexcollect.ScreenProjectCategoryGridDailyDTO; @@ -113,7 +111,6 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl data) { - if(StringUtils.isBlank(data.getDateId())) data.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); if(data.getIsFirst()){ baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index 52ebd193aa..6202729df7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -21,11 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.ScreenProjectCategoryOrgDailyDao; import com.epmet.dto.indexcollect.ScreenProjectCategoryOrgDailyDTO; @@ -113,7 +111,6 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl data) { - if(StringUtils.isBlank(data.getDateId())) data.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); if(data.getIsFirst()){ baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectGridDailyServiceImpl.java index 9eadef0999..d18ea97190 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectGridDailyServiceImpl.java @@ -21,11 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.ScreenProjectGridDailyDao; import com.epmet.dto.indexcollect.ScreenProjectGridDailyDTO; @@ -114,7 +112,6 @@ public class ScreenProjectGridDailyServiceImpl extends BaseServiceImpl data) { - if(StringUtils.isBlank(data.getDateId())) data.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); if(data.getIsFirst()){ baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectOrgDailyServiceImpl.java index 2d98768ec1..b3a9d69487 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectOrgDailyServiceImpl.java @@ -21,11 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.ScreenProjectOrgDailyDao; import com.epmet.dto.indexcollect.ScreenProjectOrgDailyDTO; @@ -115,7 +113,6 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl data) { - if(StringUtils.isBlank(data.getDateId())) data.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); if(data.getIsFirst()){ baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java index 4b797fa009..6ea7bddb5d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -21,11 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.ScreenProjectQuantityGridMonthlyDao; import com.epmet.dto.indexcollect.ScreenProjectQuantityGridMonthlyDTO; @@ -114,7 +112,6 @@ public class ScreenProjectQuantityGridMonthlyServiceImpl extends BaseServiceImpl @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public void collect(String customerId, ScreenCollFormDTO data) { - if(StringUtils.isBlank(data.getMonthId())) data.setMonthId(DateUtils.getBeforeNMonth(NumConstant.ONE)); if(data.getIsFirst()){ baseDao.deleteByDateIdAndCustomerId(customerId,data.getMonthId()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 8a05d8f543..1c6bf17104 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -21,11 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.ScreenProjectQuantityOrgMonthlyDao; import com.epmet.dto.indexcollect.ScreenProjectQuantityOrgMonthlyDTO; @@ -113,7 +111,6 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public void collect(String customerId, ScreenCollFormDTO data) { - if(StringUtils.isBlank(data.getMonthId())) data.setMonthId(DateUtils.getBeforeNMonth(NumConstant.ONE)); if(data.getIsFirst()){ baseDao.deleteByDateIdAndCustomerId(customerId,data.getMonthId()); }