getRangeOrgList(String projectKey);
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java
index 6ac1399035..74d1ddd332 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java
@@ -1,25 +1,10 @@
-/**
- * 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.dataaggre.service.epmettduck;
+import com.baomidou.mybatisplus.extension.service.IService;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectItemDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.TDuckDetailFormDTO;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectItemEntity;
import java.util.List;
@@ -31,65 +16,13 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
-public interface PrUserProjectItemService extends BaseService {
-
- /**
- * 默认分页
- *
- * @param params
- * @return PageData
- * @author generator
- * @date 2021-09-15
- */
- PageData page(Map params);
-
- /**
- * 默认查询
- *
- * @param params
- * @return java.util.List
- * @author generator
- * @date 2021-09-15
- */
- List list(Map params);
-
- /**
- * 单条查询
- *
- * @param id
- * @return PrUserProjectItemDTO
- * @author generator
- * @date 2021-09-15
- */
- PrUserProjectItemDTO get(String id);
-
- /**
- * 默认保存
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-09-15
- */
- void save(PrUserProjectItemDTO dto);
-
- /**
- * 默认更新
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-09-15
- */
- void update(PrUserProjectItemDTO dto);
+public interface PrUserProjectItemService extends IService {
/**
- * 批量删除
- *
- * @param ids
- * @return void
- * @author generator
- * @date 2021-09-15
+ * @Description 问卷调查详情
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/9/16 2:51 下午
*/
- void delete(String[] ids);
+ List queryProjectItem(TDuckDetailFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java
index 9ff485770a..b68943ec11 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java
@@ -20,7 +20,11 @@ package com.epmet.dataaggre.service.epmettduck;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO;
-import com.epmet.dataaggre.dto.epmettduck.result.ProjectProfileResultDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.ItemResDetailFormDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.ProjectKeyCommonDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO;
+import com.epmet.dataaggre.dto.epmettduck.result.*;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity;
import java.util.List;
@@ -103,4 +107,61 @@ public interface PrUserProjectService extends BaseService {
* @date 2021/9/16 2:54 下午
*/
ProjectProfileResultDTO queryProjectProfile(String projectKey);
+
+ /**
+ * @Description 问卷调查列表
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/9/18 10:29 上午
+ */
+ List queryProjectList(TDuckListFormDTO formDTO);
+
+ /**
+ * 分析报告
+ *
+ * @param projectKey
+ * @return com.epmet.dataaggre.dto.epmettduck.result.AnalysisReportResDTO
+ * @author yinzuomei
+ * @date 2021/9/16 5:57 下午
+ */
+ List queryAnalysisReport(String projectKey);
+
+ /**
+ * @Description 查询问卷调查的头部信息
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/9/18 10:35 上午
+ */
+ PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO);
+
+ /**
+ * @Description 获取发布范围
+ * @Param projectKey
+ * @Return {@link GetRangeResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/9/18 15:18
+ */
+ GetRangeResultDTO getRange(String projectKey);
+
+ /**
+ * 查看详情
+ * 1、联系人组件统一用一个统计显示多少条,点击查看更多显示汇总列表,如有非必填项没有填写显示空(手机号验证不需要统计)
+ * 2、单行文本、多行文本、时间选择、时间范围、日期选择、日期范围,统计填写人数,点击查看列表
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/22 1:37 下午
+ */
+ List queryItemResDetail(ItemResDetailFormDTO formDTO);
+
+ /**
+ * 联系人组件
+ *
+ * @param formDTO
+ * @return com.epmet.dataaggre.dto.epmettduck.result.ItemResDetailConcatResultDTO
+ * @author yinzuomei
+ * @date 2021/9/22 2:57 下午
+ */
+ ItemResDetailConcatResultDTO queryItemResDetailConcat(ProjectKeyCommonDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java
index 4cddcac638..2887bd8ecf 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.AcUserAuthorizeDao;
import com.epmet.dataaggre.dto.epmettduck.AcUserAuthorizeDTO;
import com.epmet.dataaggre.entity.epmettduck.AcUserAuthorizeEntity;
import com.epmet.dataaggre.service.epmettduck.AcUserAuthorizeService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class AcUserAuthorizeServiceImpl extends BaseServiceImpl implements AcUserAuthorizeService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java
index b85ff41893..c53ce7da8e 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.AcUserDao;
import com.epmet.dataaggre.dto.epmettduck.AcUserDTO;
import com.epmet.dataaggre.entity.epmettduck.AcUserEntity;
import com.epmet.dataaggre.service.epmettduck.AcUserService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class AcUserServiceImpl extends BaseServiceImpl implements AcUserService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java
index cd00fb7a9a..bf82320282 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java
@@ -17,7 +17,10 @@
package com.epmet.dataaggre.service.epmettduck.impl;
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.service.epmettduck.PrProjectTemplateCategoryService;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
@@ -26,6 +29,8 @@ import org.springframework.stereotype.Service;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrProjectTemplateCategoryServiceImpl implements PrProjectTemplateCategoryService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java
index cdee7cae3b..a903234d27 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrProjectTemplateItemDao;
import com.epmet.dataaggre.dto.epmettduck.PrProjectTemplateItemDTO;
import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateItemEntity;
import com.epmet.dataaggre.service.epmettduck.PrProjectTemplateItemService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrProjectTemplateItemServiceImpl extends BaseServiceImpl implements PrProjectTemplateItemService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java
index 51c0932019..29eabe1520 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrProjectTemplateDao;
import com.epmet.dataaggre.dto.epmettduck.PrProjectTemplateDTO;
import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateEntity;
import com.epmet.dataaggre.service.epmettduck.PrProjectTemplateService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrProjectTemplateServiceImpl extends BaseServiceImpl implements PrProjectTemplateService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java
index db86a529d7..07345640c1 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrProjectThemeDao;
import com.epmet.dataaggre.dto.epmettduck.PrProjectThemeDTO;
import com.epmet.dataaggre.entity.epmettduck.PrProjectThemeEntity;
import com.epmet.dataaggre.service.epmettduck.PrProjectThemeService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrProjectThemeServiceImpl extends BaseServiceImpl implements PrProjectThemeService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java
index f89d60925a..cc7d940a6e 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java
@@ -17,24 +17,30 @@
package com.epmet.dataaggre.service.epmettduck.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrPublishRangeDao;
import com.epmet.dataaggre.dto.epmettduck.PrPublishRangeDTO;
import com.epmet.dataaggre.entity.epmettduck.PrPublishRangeEntity;
import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* 项目发布范围表
@@ -42,6 +48,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrPublishRangeServiceImpl extends BaseServiceImpl implements PrPublishRangeService {
@@ -97,4 +105,23 @@ public class PrPublishRangeServiceImpl extends BaseServiceImpl}
+ * @Author zhaoqifeng
+ * @Date 2021/9/18 15:28
+ */
+ @Override
+ public List getRangeOrgList(String projectKey) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(PrPublishRangeEntity::getProjectKey, projectKey);
+ List list = baseDao.selectList(wrapper);
+ if (CollectionUtils.isEmpty(list)) {
+ return Collections.emptyList();
+ }
+ return list.stream().map(PrPublishRangeEntity::getOrgId).collect(Collectors.toList());
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java
index fa3011975b..00bff5e49e 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrResultExtDao;
import com.epmet.dataaggre.dto.epmettduck.PrResultExtDTO;
import com.epmet.dataaggre.entity.epmettduck.PrResultExtEntity;
import com.epmet.dataaggre.service.epmettduck.PrResultExtService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrResultExtServiceImpl extends BaseServiceImpl implements PrResultExtService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java
index 7b61e6a6e7..3078d9221c 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java
@@ -17,24 +17,20 @@
package com.epmet.dataaggre.service.epmettduck.impl;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-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.dynamic.datasource.annotation.DataSource;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectItemDao;
-import com.epmet.dataaggre.dto.epmettduck.PrUserProjectItemDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.TDuckDetailFormDTO;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectItemEntity;
import com.epmet.dataaggre.service.epmettduck.PrUserProjectItemService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
/**
* 项目表单项
@@ -43,58 +39,26 @@ import java.util.Map;
* @since v1.0.0 2021-09-15
*/
@Service
-public class PrUserProjectItemServiceImpl extends BaseServiceImpl implements PrUserProjectItemService {
+@Slf4j
+@DataSource(DataSourceConstant.EPMET_T_DUCK)
+public class PrUserProjectItemServiceImpl extends ServiceImpl implements PrUserProjectItemService {
+ /**
+ * @Description 问卷调查详情
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/9/16 2:51 下午
+ */
@Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
+ public List queryProjectItem(TDuckDetailFormDTO formDTO) {
+ List itemEntityList = list(Wrappers.lambdaQuery()
+ .eq(PrUserProjectItemEntity::getProjectKey, formDTO.getKey())
+ .eq(PrUserProjectItemEntity::getDisplayType,formDTO.getDisplayType())
+ .orderByAsc(PrUserProjectItemEntity::getSort)
);
- return getPageData(page, PrUserProjectItemDTO.class);
+ if (CollectionUtils.isEmpty(itemEntityList)){
+ return new ArrayList<>();
+ }
+ return itemEntityList;
}
-
- @Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
-
- return ConvertUtils.sourceToTarget(entityList, PrUserProjectItemDTO.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 PrUserProjectItemDTO get(String id) {
- PrUserProjectItemEntity entity = baseDao.selectById(id);
- return ConvertUtils.sourceToTarget(entity, PrUserProjectItemDTO.class);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void save(PrUserProjectItemDTO dto) {
- PrUserProjectItemEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectItemEntity.class);
- insert(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void update(PrUserProjectItemDTO dto) {
- PrUserProjectItemEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectItemEntity.class);
- updateById(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void delete(String[] ids) {
- // 逻辑删除(@TableLogic 注解)
- baseDao.deleteBatchIds(Arrays.asList(ids));
- }
-
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java
index ed3a9ede57..052d9252a6 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectLogicDao;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectLogicDTO;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectLogicEntity;
import com.epmet.dataaggre.service.epmettduck.PrUserProjectLogicService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrUserProjectLogicServiceImpl extends BaseServiceImpl implements PrUserProjectLogicService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java
index 5d45b7e36d..884b2f2384 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectResultDao;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectResultDTO;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity;
import com.epmet.dataaggre.service.epmettduck.PrUserProjectResultService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrUserProjectResultServiceImpl extends BaseServiceImpl implements PrUserProjectResultService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java
index 27c2f60212..936545842f 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java
@@ -17,24 +17,47 @@
package com.epmet.dataaggre.service.epmettduck.impl;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectDao;
+import com.epmet.dataaggre.dao.epmettduck.PrVistRecordDao;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO;
-import com.epmet.dataaggre.dto.epmettduck.result.ProjectProfileResultDTO;
+import com.epmet.dataaggre.dto.epmettduck.ProjectItemTypeEnum;
+import com.epmet.dataaggre.dto.epmettduck.form.ItemResDetailFormDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.ProjectKeyCommonDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO;
+import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO;
+import com.epmet.dataaggre.dto.epmettduck.result.*;
+import com.epmet.dataaggre.dto.epmettduck.struct.*;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity;
+import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity;
+import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService;
import com.epmet.dataaggre.service.epmettduck.PrUserProjectService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
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;
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
/**
* 项目表
@@ -42,9 +65,16 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrUserProjectServiceImpl extends BaseServiceImpl implements PrUserProjectService {
+ @Autowired
+ private PrVistRecordDao visitRecordDao;
+ @Resource
+ private PrPublishRangeService prPublishRangeService;
+
@Override
public PageData page(Map params) {
IPage page = baseDao.selectPage(
@@ -110,4 +140,531 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl queryProjectList(TDuckListFormDTO formDTO) {
+ List projectKeys = baseDao.selectProjectKey(formDTO.getOrgIds());
+ if (CollectionUtils.isEmpty(projectKeys)){
+ return new ArrayList<>();
+ }
+ PageInfo projectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryProjectList(projectKeys, formDTO.getStatus(), formDTO.getClient()));
+ List result = projectPageInfo.getList();
+ List records = visitRecordDao.selectVisitRecordByUserId(formDTO.getUserId());
+ if (!CollectionUtils.isEmpty(records)){
+ for (String r : records) {
+ for (TDuckListResultDTO t : result) {
+ if (r.equals(t.getKey())){
+ t.setFillStatus(true);
+ continue;
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 分析报告
+ *
+ * @param projectKey
+ * @return com.epmet.dataaggre.dto.epmettduck.result.AnalysisReportResDTO
+ * @author yinzuomei
+ * @date 2021/9/16 5:57 下午
+ */
+ @Override
+ public List queryAnalysisReport(String projectKey) {
+ List itemList=baseDao.selectItems(projectKey);
+ if(CollectionUtils.isEmpty(itemList)){
+ return new ArrayList<>();
+ }
+ List resultList=baseDao.selectResults(projectKey);
+ if(CollectionUtils.isEmpty(resultList)){
+ return new ArrayList<>();
+ }
+ for(AnalysisReportResDTO item:itemList){
+ String currentType=item.getType();
+ String key="field".concat(item.getFormItemId());
+ log.info("key="+key);
+
+ Map detail=new HashMap<>();
+ //总采集数
+ detail.put("collectionTotal",resultList.size());
+ //有效记录
+ int validTotal=0;
+
+ //1、联系人组件统一用一个统计显示多少条,点击查看更多显示汇总列表,如有非必填项没有填写显示空(手机号验证不需要统计)
+ //2、单行文本、多行文本、时间选择、时间范围、日期选择、日期范围,统计填写人数,点击查看列表
+ if(ProjectItemTypeEnum.INPUT.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.PROVINCE_CITY.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.INPUT_MAP.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.TEXTAREA.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.TIME.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.TIME_RANGE.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.DATE.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(currentType)){
+
+ for(PrUserProjectResultEntity res:resultList){
+
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ //手机号、邮箱、身份证、单行文本: INPUT
+ //多行文本
+ //时间选择
+ //日期选择
+ if(ProjectItemTypeEnum.INPUT.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.TEXTAREA.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.TIME.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.DATE.getValue().equals(currentType)){
+ if(originalData.containsKey(key)){
+ if(StringUtils.isNotBlank(originalData.get(key).toString())){
+ validTotal+=1;
+ }
+ }else{
+ log.warn("没有当前的key:,可能用户没填写吧"+key);
+ }
+ continue;
+ }
+ //省市联动: PROVINCE_CITY
+ //时间范围选择
+ //日期范围选择
+ if(ProjectItemTypeEnum.PROVINCE_CITY.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.TIME_RANGE.getValue().equals(currentType)
+ ||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(currentType)){
+ if(originalData.containsKey(key)){
+ List provinceCityList= (List) originalData.get(key);
+ if(!CollectionUtils.isEmpty(provinceCityList)){
+ validTotal+=1;
+ }
+ }
+ continue;
+ }
+
+ //地理位置:INPUT_MAP
+ if(ProjectItemTypeEnum.INPUT_MAP.getValue().equals(currentType)){
+ if(originalData.containsKey(key)){
+ List provinceCityList= (List) originalData.get(key);
+ log.info("地理位置:"+JSON.toJSONString(provinceCityList,true));
+ if (!CollectionUtils.isEmpty(provinceCityList) && provinceCityList.size() == 3) {
+ validTotal += 1;
+ }
+ }
+ //不加也行,后面也没有代码块了
+ continue;
+ }
+ }
+
+ detail.put("validTotal",validTotal);
+ item.setDetail(detail);
+ continue;
+ }
+ // 3、下拉选择、级联选择、单选框组、多选框组显示不同选项选择次数、所占比例
+ //3.1、下拉选择
+ if (ProjectItemTypeEnum.SELECT.getValue().equals(currentType)) {
+ SelectExpandStruct selectExpandStruct = JSON.parseObject(item.getExpand(), SelectExpandStruct.class);
+ List options = new ArrayList<>();
+ if (null != selectExpandStruct) {
+ options = ConvertUtils.sourceToTarget(selectExpandStruct.getOptions(), OptionDTO.class);
+ }
+
+ //共选择了多少次,每道题相加
+ int totalCount = 0;
+ for (OptionDTO optionDTO : options) {
+ //currentCount:每道题,被选了多少次?
+ int currentCount = 0;
+ for (PrUserProjectResultEntity res : resultList) {
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ if (selectExpandStruct.getMultiple()) {
+ //多选
+ if(originalData.containsKey(key)){
+ List answers = (List) originalData.get(key);
+ if (!CollectionUtils.isEmpty(answers) && answers.contains(optionDTO.getValue())) {
+ currentCount += 1;
+ }
+ }
+
+ } else {
+ //单选
+ if(originalData.containsKey(key)){
+ Integer answer = (Integer) originalData.get(key);
+ if (null != answer && optionDTO.getValue() == answer) {
+ currentCount += 1;
+ }
+ }
+ }
+ }
+ optionDTO.setCurrentCount(currentCount);
+ totalCount += currentCount;
+ }
+ detail.put("totalCount", totalCount);
+ detail.put("options", options);
+ item.setDetail(detail);
+ continue;
+ }
+ // 3.2 单选
+ if (ProjectItemTypeEnum.RADIO.getValue().equals(currentType)) {
+ RadioExpandStruct radioExpandStruct = JSON.parseObject(item.getExpand(), RadioExpandStruct.class);
+ List options = new ArrayList<>();
+ if (null != radioExpandStruct) {
+ options = ConvertUtils.sourceToTarget(radioExpandStruct.getOptions(), OptionDTO.class);
+ }
+
+ //共选择了多少次,每道题相加
+ int totalCount = 0;
+ for (OptionDTO optionDTO : options) {
+ //currentCount:每道题,被选了多少次?
+ int currentCount = 0;
+ for (PrUserProjectResultEntity res : resultList) {
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ //单选
+ if(originalData.containsKey(key)){
+ Integer answer = (Integer) originalData.get(key);
+ if (null != answer && optionDTO.getValue() == answer) {
+ currentCount += 1;
+ }
+ }
+ }
+ optionDTO.setCurrentCount(currentCount);
+ totalCount += currentCount;
+ }
+ detail.put("totalCount", totalCount);
+ detail.put("options", options);
+ item.setDetail(detail);
+ continue;
+ }
+
+ // 3.3多选
+ if (ProjectItemTypeEnum.CHECKBOX.getValue().equals(currentType)) {
+ CheckboxExpandStruct checkboxExpandStruct = JSON.parseObject(item.getExpand(), CheckboxExpandStruct.class);
+ List options = new ArrayList<>();
+ if (null != checkboxExpandStruct) {
+ options = ConvertUtils.sourceToTarget(checkboxExpandStruct.getOptions(), OptionDTO.class);
+ }
+
+ //共选择了多少次,每道题相加
+ int totalCount = 0;
+ for (OptionDTO optionDTO : options) {
+ //currentCount:每道题,被选了多少次?
+ int currentCount = 0;
+ for (PrUserProjectResultEntity res : resultList) {
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ //多选
+ if(originalData.containsKey(key)){
+ List answers = (List) originalData.get(key);
+ if (!CollectionUtils.isEmpty(answers) && answers.contains(optionDTO.getValue())) {
+ currentCount += 1;
+ }
+ }
+ }
+ optionDTO.setCurrentCount(currentCount);
+ totalCount += currentCount;
+ }
+ detail.put("totalCount", totalCount);
+ detail.put("options", options);
+ item.setDetail(detail);
+ continue;
+ }
+
+ //3.4级联 todo
+ if(ProjectItemTypeEnum.CASCADER.getValue().equals(currentType)){
+ //目前cascaderExpandStruct 没啥用
+ CascaderExpandStruct cascaderExpandStruct = JSON.parseObject(item.getExpand(), CascaderExpandStruct.class);
+ //共选择了多少次,每道题相加
+ int totalCount = 0;
+ Map resMap = new HashMap<>();
+ for (PrUserProjectResultEntity res : resultList) {
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ if(originalData.containsKey(key)){
+ List dtoList = JSON.parseArray(originalData.get(key).toString(), CascaderDTO.class);
+ if(CollectionUtils.isEmpty(dtoList)){
+ log.info(String.format("当前userId:%s,没有填写本题itemId:%s",res.getUserId(),key));
+ continue;
+ }
+
+ for (CascaderDTO cascaderDTO : dtoList) {
+ if (null != cascaderDTO && !CollectionUtils.isEmpty(cascaderDTO.getLabels())) {
+ totalCount += 1;
+ String pathName = StringUtils.join(cascaderDTO.getLabels(), StringUtils.isNotBlank(cascaderExpandStruct.getSeparator()) ? cascaderExpandStruct.getSeparator() : StrConstant.HYPHEN);
+ Integer count = resMap.get(pathName);
+ resMap.put(pathName, count == null ? 1 : count + 1);
+ }
+ }
+ }
+ }
+ detail.put("totalCount", totalCount);
+ detail.put("profile", resMap);
+ item.setDetail(detail);
+ continue;
+ }
+
+ //4、计数器显示所有填写者选择的数字总和
+ if(ProjectItemTypeEnum.NUMBER_INPUT.getValue().equals(currentType)){
+ int sumTotal=0;
+ for(PrUserProjectResultEntity res:resultList){
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ if(originalData.containsKey(key)){
+ Integer score= (Integer) originalData.get(key);
+ if(null!=score){
+ sumTotal+=score;
+ validTotal+=1;
+ }
+ }
+ }
+ detail.put("validTotal",validTotal);
+ detail.put("sumTotal",sumTotal);
+ item.setDetail(detail);
+ continue;
+ }
+
+
+ //5、开关统计开有多少、关有多少
+ if(ProjectItemTypeEnum.SWITCH.getValue().equals(currentType)){
+ int openTotal=0;
+ int closedTotal=0;
+ for(PrUserProjectResultEntity res:resultList){
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ if(originalData.containsKey(key)){
+ Boolean result= (Boolean) originalData.get(key);
+ if(null!=result){
+ validTotal+=1;
+ if(result){
+ openTotal+=1;
+ }else{
+ closedTotal+=1;
+ }
+ }
+ }
+ }
+ detail.put("validTotal",validTotal);
+ detail.put("openTotal",openTotal);
+ detail.put("closedTotal",closedTotal);
+ item.setDetail(detail);
+ continue;
+ }
+
+ //6、滑块、颜色选择、上传不统计
+
+ //7、评分统计1星几人,2星几人,3星几人......,显示平均分
+ if (ProjectItemTypeEnum.RATE.getValue().equals(currentType)) {
+ // 1、标签设置的满星是几个星星?
+ RateExpandStruct rateExpandStruct = JSON.parseObject(item.getExpand(), RateExpandStruct.class);
+ if (null != rateExpandStruct && null != rateExpandStruct.getMax()) {
+ detail.put("maxStarNum", rateExpandStruct.getMax());
+ } else {
+ log.warn(String.format("当前评分组件未设置最大值,默认赋值5,projectKey:%s,itemId:%s",projectKey,item.getFormItemId()));
+ detail.put("maxStarNum", NumConstant.FIVE);
+ }
+
+ //总分
+ int totalStarNum = 0;
+ Map starMap = new HashMap<>();
+ for (PrUserProjectResultEntity res : resultList) {
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ if(originalData.containsKey(key)){
+ Integer starNum = (Integer) originalData.get(key);
+ if (null != starNum) {
+ validTotal += 1;
+ totalStarNum += starNum;
+ Integer count = starMap.get(starNum);
+ starMap.put(starNum, count == null ? 1 : count + 1);
+
+ }
+ }
+ }
+ //按照星星大小升序排列
+ this.sortMap(starMap, true);
+ //2、平均分
+ detail.put("avgStarNum", new BigDecimal((float)totalStarNum / validTotal).setScale(0, BigDecimal.ROUND_HALF_UP));
+ //3、几条有效记录
+ detail.put("validTotal", validTotal);
+ //4、得分列表
+ detail.put("starProfile", starMap);
+ item.setDetail(detail);
+ continue;
+ }
+
+
+ }
+ return itemList;
+ }
+
+ /**
+ * @Description 查询问卷调查的头部信息
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/9/18 10:35 上午
+ */
+ @Override
+ public PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO) {
+ PrUserProjectEntity prUserProjectEntity = baseDao.selectOne(new QueryWrapper().lambda().eq(PrUserProjectEntity::getKey, formDTO.getProjectKey()));
+ return prUserProjectEntity;
+ }
+
+ /**
+ * @param projectKey
+ * @Description 获取发布范围
+ * @Param projectKey
+ * @Return {@link GetRangeResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/9/18 15:18
+ */
+ @Override
+ public GetRangeResultDTO getRange(String projectKey) {
+ GetRangeResultDTO result = new GetRangeResultDTO();
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(PrUserProjectEntity :: getKey, projectKey);
+ PrUserProjectEntity entity = baseDao.selectOne(wrapper);
+ result.setClient(entity.getClient());
+ result.setOrgList(prPublishRangeService.getRangeOrgList(projectKey));
+ return result;
+ }
+
+ private List> sortMap(Map map, boolean asc) {
+
+ Stream> stream = null;
+ if (asc) {
+ stream = map.entrySet().stream().sorted(Map.Entry.comparingByValue());
+ } else {
+ stream = map.entrySet().stream().sorted(Collections.reverseOrder(Map.Entry.comparingByValue()));
+ }
+ return stream.collect(Collectors.toList());
+ }
+
+
+ /**
+ * 查看详情
+ * 1、联系人组件统一用一个统计显示多少条,点击查看更多显示汇总列表,如有非必填项没有填写显示空(手机号验证不需要统计)
+ * 2、单行文本、多行文本、时间选择、时间范围、日期选择、日期范围,统计填写人数,点击查看列表
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/22 1:37 下午
+ */
+ @Override
+ public List queryItemResDetail(ItemResDetailFormDTO formDTO) {
+ List resultList=baseDao.selectResults(formDTO.getProjectKey());
+ if(CollectionUtils.isEmpty(resultList)){
+ return new ArrayList<>();
+ }
+ List stringList=new ArrayList<>();
+ String key="field".concat(formDTO.getFormItemId());
+ for(PrUserProjectResultEntity res:resultList){
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+ if(ProjectItemTypeEnum.INPUT.getValue().equals(formDTO.getType())
+ ||ProjectItemTypeEnum.TEXTAREA.getValue().equals(formDTO.getType())
+ ||ProjectItemTypeEnum.TIME.getValue().equals(formDTO.getType())
+ ||ProjectItemTypeEnum.DATE.getValue().equals(formDTO.getType())){
+ if(originalData.containsKey(key)){
+ stringList.add((String) originalData.get(key));
+ continue;
+ }
+ }else if(ProjectItemTypeEnum.TIME_RANGE.getValue().equals(formDTO.getType())
+ ||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(formDTO.getType())){
+ if(originalData.containsKey(key)){
+ List originalList= (List) originalData.get(key);
+ if(!CollectionUtils.isEmpty(originalList)){
+ String rangeStr=StringUtils.join(originalList,StrConstant.COMMA);
+ stringList.add(rangeStr);
+ }
+ }
+ }
+ }
+ return stringList;
+ }
+
+ /**
+ * 联系人组件
+ *
+ * @param formDTO
+ * @return com.epmet.dataaggre.dto.epmettduck.result.ItemResDetailConcatResultDTO
+ * @author yinzuomei
+ * @date 2021/9/22 2:57 下午
+ */
+ @Override
+ public ItemResDetailConcatResultDTO queryItemResDetailConcat(ProjectKeyCommonDTO formDTO) {
+ // 联系人题目
+ List itemList=baseDao.selectCocatItems(formDTO.getProjectKey());
+ if(CollectionUtils.isEmpty(itemList)){
+ return new ItemResDetailConcatResultDTO();
+ }
+ //答案
+ List resultList=baseDao.selectResults(formDTO.getProjectKey());
+ if(CollectionUtils.isEmpty(resultList)){
+ return new ItemResDetailConcatResultDTO();
+ }
+
+ ItemResDetailConcatResultDTO resultDTO=new ItemResDetailConcatResultDTO();
+
+ List tableHeaderList=new ArrayList<>();
+ for(AnalysisReportResDTO item:itemList){
+ ConcatTableHeaderDTO headerDTO=new ConcatTableHeaderDTO();
+ headerDTO.setFormItemId(item.getFormItemId());
+ headerDTO.setLabel(item.getLabel());
+ headerDTO.setType(item.getType());
+ tableHeaderList.add(headerDTO);
+ }
+
+ List> dataList=new ArrayList<>();
+ for(PrUserProjectResultEntity res:resultList){
+ List userAnswer=new ArrayList<>();
+ JSONObject originalData = JSON.parseObject(res.getOriginalData());
+
+ for(ConcatTableHeaderDTO header:tableHeaderList){
+ String key="field".concat(header.getFormItemId());
+
+ //手机号、邮箱、身份证、单行文本: INPUT
+ if(ProjectItemTypeEnum.INPUT.getValue().equals(header.getType())){
+ if(originalData.containsKey(key)){
+ if(StringUtils.isNotBlank(originalData.get(key).toString())){
+ userAnswer.add((String) originalData.get(key));
+ }else{
+ userAnswer.add(StrConstant.EPMETY_STR);
+ }
+ }else{
+ log.warn("没有当前的key:,可能用户没填写吧"+key);
+ userAnswer.add(StrConstant.HYPHEN);
+ }
+ }
+ //省市联动: PROVINCE_CITY
+ if(ProjectItemTypeEnum.PROVINCE_CITY.getValue().equals(header.getType())){
+ if(originalData.containsKey(key)){
+ List provinceCityList= (List) originalData.get(key);
+ if(!CollectionUtils.isEmpty(provinceCityList)){
+ userAnswer.add(StringUtils.join(provinceCityList,StrConstant.HYPHEN));
+ }else{
+ userAnswer.add(StrConstant.EPMETY_STR);
+ }
+ }else{
+ log.warn("没有当前的key:,可能用户没填写吧"+key);
+ userAnswer.add(StrConstant.HYPHEN);
+ }
+ }
+
+ //地理位置:INPUT_MAP
+ if(ProjectItemTypeEnum.INPUT_MAP.getValue().equals(header.getType())){
+ if(originalData.containsKey(key)){
+ List inputMap= (List) originalData.get(key);
+ log.info("地理位置:"+JSON.toJSONString(inputMap,true));
+ if (!CollectionUtils.isEmpty(inputMap) && inputMap.size() == 3) {
+ userAnswer.add(inputMap.get(2));
+ }else{
+ userAnswer.add(StrConstant.EPMETY_STR);
+ }
+ }else{
+ log.warn("没有当前的key:,可能用户没填写吧"+key);
+ userAnswer.add(StrConstant.HYPHEN);
+ }
+ }
+
+ }
+ dataList.add(userAnswer);
+ }
+ resultDTO.setTableHeaderList(tableHeaderList);
+ resultDTO.setDataList(dataList);
+ return resultDTO;
+ }
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java
index 67bf9b50a5..cbfb3989f0 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectSettingDao;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectSettingDTO;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectSettingEntity;
import com.epmet.dataaggre.service.epmettduck.PrUserProjectSettingService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrUserProjectSettingServiceImpl extends BaseServiceImpl implements PrUserProjectSettingService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java
index d153971e1f..ef204311f3 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectThemeDao;
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectThemeDTO;
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectThemeEntity;
import com.epmet.dataaggre.service.epmettduck.PrUserProjectThemeService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrUserProjectThemeServiceImpl extends BaseServiceImpl implements PrUserProjectThemeService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java
index 5427486bb9..408701f7ce 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.PrVistRecordDao;
import com.epmet.dataaggre.dto.epmettduck.PrVistRecordDTO;
import com.epmet.dataaggre.entity.epmettduck.PrVistRecordEntity;
import com.epmet.dataaggre.service.epmettduck.PrVistRecordService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class PrVistRecordServiceImpl extends BaseServiceImpl implements PrVistRecordService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java
index bd5d459e90..ac4e961890 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java
@@ -19,16 +19,18 @@ package com.epmet.dataaggre.service.epmettduck.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmettduck.WxMpUserDao;
import com.epmet.dataaggre.dto.epmettduck.WxMpUserDTO;
import com.epmet.dataaggre.entity.epmettduck.WxMpUserEntity;
import com.epmet.dataaggre.service.epmettduck.WxMpUserService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-15
*/
+@Slf4j
+@DataSource(DataSourceConstant.EPMETTDUCK)
@Service
public class WxMpUserServiceImpl extends BaseServiceImpl implements WxMpUserService {
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
index a641be3095..1bd061569e 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
@@ -135,4 +135,14 @@ public interface GovOrgService {
* @return
*/
StaffOrgRelationResultDTO getStaffFromOrgType(String staffId);
+
+ /**
+ * @Description 当前组织级下级组织树
+ * @Param tokenDto
+ * @Param formDTO
+ * @Return {@link OrgTreeResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/9/17 14:03
+ */
+ List getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO);
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
index 8142f4a728..a9cd8bbcf4 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
@@ -497,4 +497,25 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerAgencyDao.getStaffFromOrgType(staffId);
}
+ /**
+ * @param tokenDto
+ * @param formDTO
+ * @Description 当前组织级下级组织树
+ * @Param tokenDto
+ * @Param formDTO
+ * @Return {@link OrgTreeResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/9/17 14:03
+ */
+ @Override
+ public List getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO) {
+ List list = new ArrayList<>();
+ if ("resi".equals(formDTO.getClient())) {
+ list.add(customerAgencyDao.getResiOrgTree(formDTO.getAgencyId()));
+ return list;
+ }
+ list.add(customerAgencyDao.getOrgTree(formDTO.getAgencyId()));
+ return list;
+ }
+
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
index 0850b865c5..5c25d1edee 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
@@ -887,7 +887,7 @@
, agency_id orgId
- FROM fact_topic_total_agency_daily
+ FROM fact_topic_hotdiscuss_agency_daily
WHERE del_flag = '0'
#{id}
@@ -895,7 +895,7 @@
, grid_id orgId
- FROM fact_topic_total_grid_daily
+ FROM fact_topic_hotdiscuss_grid_daily
WHERE del_flag = '0'
#{id}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml
index f0086b42af..c3eba867a2 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml
@@ -6,13 +6,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml
index 8ea675b0e9..77f2f5c68a 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml
@@ -3,4 +3,10 @@
+
+
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
index 2573d8b674..d47b736984 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
@@ -142,4 +142,125 @@
SELECT STAFF_ID,ORG_ID,ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
index 8b45ddb6ef..0c27cbc878 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
@@ -464,6 +464,8 @@ public class AgencyServiceImpl implements AgencyService {
pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON));
}else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){
pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA));
+ } else if (customerAgencyDTO.getPid().equals(customerAgencyDTO.getPids())) {
+ pidList.add(customerAgencyDTO.getPids());
}
if(!CollectionUtils.isEmpty(pidList)){
//单客户,存在上级时查询...
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java
index 01b1630ebc..2e3adc0e89 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java
@@ -63,4 +63,10 @@ public class MineResultDTO implements Serializable {
* 根组织名
*/
private String rootAgencyName;
+ //工作人员添加入口Id(agencyId;deptId;gridId)
+ private String orgId = "";
+ //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
+ private String orgName = "";
+ //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
+ private String orgType = "";
}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java
new file mode 100644
index 0000000000..58424f63f0
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java
@@ -0,0 +1,45 @@
+/**
+ * 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.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 查询工作人员注册组织信息
+ * @author sun
+ */
+@Data
+public class StaffOrgNameResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ //工作人员所属组织Id
+ private String agencyId = "";
+ //人员Id
+ private String staffId = "";
+ //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
+ private String orgName = "";
+ //工作人员添加入口Id(agencyId;deptId;gridId)
+ private String orgId = "";
+ //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
+ private String orgType = "";
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java
index a4d6610658..97c4e875b7 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java
@@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.result.StaffOrgNameResultDTO;
import com.epmet.entity.StaffOrgRelationEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* 工作人员注册组织关系表
@@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface StaffOrgRelationDao extends BaseDao {
-
+ /**
+ * @Description 批量查询工作人员注册组织信息
+ * @author sun
+ */
+ List selelctStaffOrg(@Param("staffIdList") List staffIdList);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index fd8be5cdbd..dae768cbf9 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -36,6 +36,7 @@ import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
+import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
@@ -712,7 +713,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getBaseInfo(CustomerGridFormDTO customerGridFormDTO) {
- return new Result().ok(ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class));
+ CustomerGridDTO restltDTO = ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class);
+ if (null != restltDTO) {
+ CustomerAgencyEntity entity = customerAgencyService.selectById(restltDTO.getPid());
+ restltDTO.setAgencyName(null != entity ? entity.getOrganizationName() : "");
+ }
+ return new Result().ok(restltDTO);
}
/**
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
index f0cc95c409..b70354aceb 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
@@ -13,6 +13,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.CustomerStaffAgencyDao;
+import com.epmet.dao.StaffOrgRelationDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@@ -75,6 +76,8 @@ public class StaffServiceImpl implements StaffService {
private StaffOrgRelationService staffOrgRelationService;
@Resource
private CustomerStaffRedis customerStaffRedis;
+ @Resource
+ private StaffOrgRelationDao staffOrgRelationDao;
@Override
public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) {
@@ -243,6 +246,18 @@ public class StaffServiceImpl implements StaffService {
result.setRootAgencyName(agency.getOrganizationName());
}
//2021.08.27 zhaoqf end
+ //2021.9.17 sun 添加工作人员注册组织、类型、id返参 start
+ List staffIdList = new ArrayList<>();
+ staffIdList.add(result.getStaffId());
+ List list = staffOrgRelationDao.selelctStaffOrg(staffIdList);
+ list.forEach(l->{
+ if(l.getStaffId().equals(result.getStaffId())){
+ result.setOrgId(l.getOrgId());
+ result.setOrgName(l.getOrgName());
+ result.setOrgType(l.getOrgType());
+ }
+ });
+ //2021.9.17 sun 添加工作人员注册组织、类型、id返参 end
return result;
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml
index 350dae73ac..76f749c00a 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml
@@ -3,6 +3,81 @@
-
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
index 0bada1c5ee..3561cb4060 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
@@ -58,4 +58,13 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{
* XX街道-YYY 如果是未认证居民,这一列为空
*/
private String userStreetTrueName;
+
+ //真实姓名
+ private String realName;
+ //工作人员添加入口Id(agencyId;deptId;gridId)
+ private String orgId = "";
+ //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
+ private String orgName = "";
+ //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
+ private String orgType = "";
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
index e2aaae2963..2d1a9df160 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
@@ -158,6 +158,7 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl gridDTOResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if(gridDTOResult.success() && null != gridDTOResult.getData()){
resultObj.setCurrentGridName(gridDTOResult.getData().getGridName());
+ resultObj.setOrgId(resultObj.getCurrentGridId());
+ resultObj.setOrgName(gridDTOResult.getData().getAgencyName()+"-"+gridDTOResult.getData().getGridName());
+ resultObj.setOrgType("grid");
}else{
//查询网格名称失败
log.warn(String.format("查找网格信息失败,网格Id:【%s】",gridId));