+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.datareport.dao.evaluationindex.screen;
+
+import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目(事件)分类按组织_按天统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-02-23
+ */
+@Mapper
+public interface ScreenProjectCategoryOrgDailyDao {
+ /**
+ * 类型分析
+ * @author zhaoqifeng
+ * @date 2021/2/23 16:47
+ * @param agencyId
+ * @return java.util.List
+ */
+ List selectCategoryAnalysis(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+}
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
index aea908ff15..aa39e9345a 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
@@ -1,8 +1,12 @@
package com.epmet.datareport.service.evaluationindex.screen;
+import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
+import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
+import java.util.List;
+
/**
* 项目
*
@@ -19,4 +23,14 @@ public interface ScreenProjectService {
*/
ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO);
+ /**
+ * 【事件分析】类型分析
+ * @author zhaoqifeng
+ * @date 2021/2/23 15:37
+ * @param customerId
+ * @param formDTO
+ * @return java.util.List
+ */
+ List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO);
+
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
index 2cf288cae9..63111dd7f0 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
@@ -1,15 +1,20 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
+import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
+import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
+import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.Date;
import java.util.List;
/**
@@ -26,6 +31,8 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
private ScreenEventDataDao screenEventDataDao;
@Autowired
private ScreenEventImgDataDao screenEventImgDataDao;
+ @Autowired
+ private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
/**
* @Description 3、项目详情
@@ -44,4 +51,19 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
projectDetailResultDTO.setImgList(imgList);
return projectDetailResultDTO;
}
+
+ /**
+ * 【事件分析】类型分析
+ *
+ * @param customerId
+ * @param formDTO
+ * @return java.util.List
+ * @author zhaoqifeng
+ * @date 2021/2/23 15:37
+ */
+ @Override
+ public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) {
+ String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
+ return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId);
+ }
}
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
new file mode 100644
index 0000000000..06f7919bd1
--- /dev/null
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java
new file mode 100644
index 0000000000..50afc350ef
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java
@@ -0,0 +1,144 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao.evaluationindex.screen;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 项目(事件)分类按网格_按天统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-02-23
+ */
+@Mapper
+public interface ScreenProjectCategoryGridDailyDao extends BaseDao {
+ /**
+ * 按客户日期删除数据
+ * @author zhaoqifeng
+ * @date 2021/2/24 10:27
+ * @param customerId
+ * @param dateId
+ * @return int
+ */
+ int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
new file mode 100644
index 0000000000..c87d8bec0f
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao.evaluationindex.screen;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 项目(事件)分类按组织_按天统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-02-23
+ */
+@Mapper
+public interface ScreenProjectCategoryOrgDailyDao extends BaseDao {
+ /**
+ * 按客户日期删除数据
+ * @author zhaoqifeng
+ * @date 2021/2/24 10:27
+ * @param customerId
+ * @param dateId
+ * @return int
+ */
+ int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java
new file mode 100644
index 0000000000..ef91f696c2
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.evaluationindex.screen.impl;
+
+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.FieldConstant;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
+import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO;
+import com.epmet.dto.screencoll.ScreenCollFormDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
+import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目(事件)分类按组织_按天统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-02-23
+ */
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX)
+public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryOrgDailyService {
+
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ScreenProjectCategoryOrgDailyDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryOrgDailyDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public ScreenProjectCategoryOrgDailyDTO get(String id) {
+ ScreenProjectCategoryOrgDailyEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryOrgDailyDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(ScreenProjectCategoryOrgDailyDTO dto) {
+ ScreenProjectCategoryOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryOrgDailyEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(ScreenProjectCategoryOrgDailyDTO dto) {
+ ScreenProjectCategoryOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryOrgDailyEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ /**
+ * 【事件/项目分析】按类别统计-组织
+ *
+ * @param customerId
+ * @param param
+ * @return void
+ * @author zhaoqifeng
+ * @date 2021/2/24 10:17
+ */
+ @Override
+ public void collect(String customerId, ScreenCollFormDTO param) {
+ if(param.getIsFirst()){
+ int deleteNum;
+ do {
+ deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId());
+ } while (deleteNum > NumConstant.ZERO);
+ }
+ if (!CollectionUtils.isEmpty(param.getDataList())) {
+ param.getDataList().forEach(item -> {
+ item.setCustomerId(customerId);
+ item.setDateId(param.getDateId());
+ });
+ Lists.partition(param.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> {
+ insertBatch(ConvertUtils.sourceToTarget(list, ScreenProjectCategoryOrgDailyEntity.class));
+ });
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml
new file mode 100644
index 0000000000..bc84c6b2df
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete from screen_project_category_grid_daily
+ where customer_id = #{customerId}
+ and date_id = #{dateId}
+ limit 1000
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
new file mode 100644
index 0000000000..5d8cd9a73a
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete from screen_project_category_org_daily
+ where customer_id = #{customerId}
+ and date_id = #{dateId}
+ limit 1000
+
+
+
\ No newline at end of file