diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryDTO.java
new file mode 100644
index 0000000000..f9fedd5560
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryDTO.java
@@ -0,0 +1,102 @@
+/**
+ * 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.screen;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 项目所属分类表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-11-10
+ */
+@Data
+public class ScreenProjectCategoryDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 项目id
+ */
+ private String projectId;
+
+ /**
+ * 分类编码
+ */
+ private String categoryCode;
+
+ /**
+ * 所属父类分类编码
+ */
+ private String parentCategoryCode;
+
+ /**
+ * 原始分类编码
+ */
+ private String originCategoryCode;
+
+ /**
+ * 分类等级:1、2....;产品目前只有2级分类
+ */
+ private Integer level;
+
+ /**
+ * 删除标识 0未删除;1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/GridAndOrgCategoryCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/GridAndOrgCategoryCountResultDTO.java
new file mode 100644
index 0000000000..f62e1c3d54
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/GridAndOrgCategoryCountResultDTO.java
@@ -0,0 +1,74 @@
+package com.epmet.dto.screen.result;
+
+import com.epmet.commons.tools.constant.NumConstant;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/11/10 10:36 上午
+ * @DESC
+ */
+@Data
+public class GridAndOrgCategoryCountResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -5167964547464983118L;
+
+ /**
+ * 组织ID
+ */
+ private String orgId;
+
+ /**
+ * 组织类型
+ */
+ private String orgType;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 上级组织ID
+ */
+ private String pid;
+
+ /**
+ * 所有上级组织ID
+ */
+ private String pids;
+
+ private String dateId;
+
+ private String customerId;
+
+ /**
+ * 分类CODE
+ */
+ private String categoryCode;
+
+ /**
+ * 分类CODE级别
+ */
+ private Integer level;
+
+ /**
+ * 项目总数
+ */
+ private Integer projectTotal;
+
+ /**
+ * 关闭【结案】项目总数
+ */
+ private Integer closedProjectTotal;
+
+ public GridAndOrgCategoryCountResultDTO() {
+ this.orgId = "";
+ this.categoryCode = "";
+ this.level = NumConstant.ZERO;
+ this.projectTotal = NumConstant.ZERO;
+ this.closedProjectTotal = NumConstant.ZERO;
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml
index 7a0ae49569..0fc10e94cb 100644
--- a/epmet-module/data-statistical/data-statistical-server/pom.xml
+++ b/epmet-module/data-statistical/data-statistical-server/pom.xml
@@ -142,6 +142,12 @@
2.0.0
compile
+
+ com.epmet
+ oper-crm-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
index 6b9966b154..ec417c1c60 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
@@ -90,4 +90,7 @@ public interface ProjectConstant {
* 上报
*/
String PROJECT_REPORT="02";
+
+ String PROJECT_STATUS_CLOSED = "closed";
+ String PROJECT_STATUS_ALL = "all";
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
index 6fefc845b6..98cfbaf838 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
@@ -62,7 +62,6 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
-import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@@ -136,6 +135,8 @@ public class DemoController {
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
@Autowired
private DimCustomerService dimCustomerService;
+ @Autowired
+ private ScreenProjectDataService screenProjectDataService;
@GetMapping("testAlarm")
public void testAlarm() {
@@ -1068,4 +1069,34 @@ public class DemoController {
customerAgencyService.sysAgencyInfo(formDTO.getFromCustomerId(), formDTO.getToCustomerId());
return new Result();
}
+
+ @PostMapping("extractCategory")
+ public Result extractCategory(@RequestBody StatsFormDTO formDTO) {
+ screenProjectDataService.extractCategory(formDTO.getCustomerId());
+ return new Result();
+ }
+
+ @Autowired
+ private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService;
+
+ @PostMapping("gridandorgdailynew")
+ public Result gridAndDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId,
+ @RequestParam(name = "startDate",required = false)String startDate,
+ @RequestParam(name = "endDate",required = false)String endDate
+ ){
+ long start = System.currentTimeMillis();
+ if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
+ List daysBetween = DateUtils.getDaysBetween(startDate, endDate);
+ daysBetween.forEach(d -> {
+ screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,d);
+ screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,d);
+ });
+ }else {
+ screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,dateId);
+ screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,dateId);
+ }
+ long end = System.currentTimeMillis();
+ long l = (end - start) / 1000;
+ return new Result().ok("gridAndOrgDaily耗时" + l+ "s");
+ }
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
index e6155e982e..619e9f2e67 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
@@ -28,6 +28,7 @@ import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcal.AgencyAndParentResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screen.ScreenProjectOrgDailyDTO;
+import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
@@ -244,4 +245,15 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectByCustomerId(@Param("customerId") String customerId);
+ /**
+ * @Description 查询父子客户的组织【平阴】
+ * @param customerIds 平阴,榆山,锦水的客户ID
+ * @param customerId 孔村的客户ID🤬
+ * @author zxc
+ * @date 2021/11/10 2:52 下午
+ */
+ List selectParentSonAgency(@Param("customerIds") List customerIds ,@Param("customerId") String customerId);
+
+
+ String getParentAgencyId(@Param("agencyId") String agencyId);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryDao.java
new file mode 100644
index 0000000000..08d28b6c86
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryDao.java
@@ -0,0 +1,36 @@
+/**
+ * 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.ScreenProjectCategoryEntity;
+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-11-10
+ */
+@Mapper
+public interface ScreenProjectCategoryDao extends BaseDao {
+ void deleteByProjectIds(@Param("customerId") String customerId, @Param("projectIds") List projectIds);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
index 97c85d1bc0..5a9155f237 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
@@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.ScreenProjectDataDTO;
+import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -68,4 +69,31 @@ public interface ScreenProjectDataDao extends BaseDao {
int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score);
List selectProjectList(@Param("customerId") String customerId, @Param("projectId") String projectId);
+
+ /**
+ * @Description 查询网格下的项目分类
+ * @param customerIds 父子客户的customerId
+ * @param dateId 日期ID
+ * @param status 所有项目:all,已结案项目:closed
+ * @param customerId 父级客户ID
+ * @param subCount 分类截取位数
+ * @author zxc
+ * @date 2021/11/10 3:12 下午
+ */
+ List selectGridCategoryProjectCount(@Param("customerIds") List customerIds,@Param("dateId") String dateId,
+ @Param("status")String status,@Param("customerId") String customerId,
+ @Param("subCount")Integer subCount);
+
+ /**
+ * @Description 查询组织下的项目分类
+ * @param dateId 日期ID
+ * @param status 所有项目:all,已结案项目:closed
+ * @param customerId 父级客户ID
+ * @param subCount 分类截取位数
+ * @author zxc
+ * @date 2021/11/10 3:14 下午
+ */
+ List selectOrgCategoryProjectCount(@Param("dateId") String dateId, @Param("status")String status,
+ @Param("customerId") String customerId, @Param("subCount")Integer subCount,
+ @Param("allAgencies") List allAgencies);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryEntity.java
new file mode 100644
index 0000000000..4e1ea78bfe
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryEntity.java
@@ -0,0 +1,68 @@
+/**
+ * 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.entity.evaluationindex.screen;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 项目所属分类表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-11-10
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("screen_project_category")
+public class ScreenProjectCategoryEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 项目id
+ */
+ private String projectId;
+
+ /**
+ * 分类编码
+ */
+ private String categoryCode;
+
+ /**
+ * 所属父类分类编码
+ */
+ private String parentCategoryCode;
+
+ /**
+ * 原始分类编码
+ */
+ private String originCategoryCode;
+
+ /**
+ * 分类等级:1、2....;产品目前只有2级分类
+ */
+ private Integer level;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
index 600786782c..e5a348fbbf 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
@@ -84,6 +84,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@Autowired
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
+ @Autowired
+ private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService;
/**
* @param extractOriginFormDTO
@@ -243,14 +245,14 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
//按天统计:网格内各个分类下的项目总数
try {
- projectCategoryGridDailyService.extractProjectCategoryData(customerId, dateId);
+ screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId, dateId);
} catch (Exception e) {
log.error("按天统计:网格内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e);
}
// 按天统计:组织内各个分类下的项目总数
try {
- projectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId, dateId);
+ screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId, dateId);
} catch (Exception e) {
log.error("按天统计:组织内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
index fcb81fc243..9a46990c1d 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
@@ -155,4 +155,13 @@ public interface ScreenCustomerAgencyService extends BaseService getAgencyList(String customerId);
+ /**
+ * @Description 获取父级组织ID(外部客户)
+ * @Param agencyId
+ * @Return {@link String}
+ * @Author zhaoqifeng
+ * @Date 2021/11/10 17:00
+ */
+ String getParentAgencyId(String agencyId);
+
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridAndOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridAndOrgDailyService.java
new file mode 100644
index 0000000000..9cdc9f3522
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridAndOrgDailyService.java
@@ -0,0 +1,34 @@
+package com.epmet.service.evaluationindex.screen;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO;
+import com.epmet.dto.screencoll.ScreenCollFormDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目(事件)分类按 网格——组织——按天统计
+ */
+public interface ScreenProjectCategoryGridAndOrgDailyService {
+
+ /**
+ * @Description 分类下的项目数【grid】
+ * @param customerId
+ * @param dateId
+ * @author zxc
+ * @date 2021/11/10 10:23 上午
+ */
+ void extractCategoryProjectGridData(String customerId, String dateId);
+
+ /**
+ * @Description 分类下的项目数【org】
+ * @param customerId
+ * @param dateId
+ * @author zxc
+ * @date 2021/11/10 10:23 上午
+ */
+ void extractCategoryProjectOrgData(String customerId, String dateId);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryService.java
new file mode 100644
index 0000000000..7cea3ea62c
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryService.java
@@ -0,0 +1,105 @@
+/**
+ * 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.service.evaluationindex.screen;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.screen.ScreenProjectCategoryDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目所属分类表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-11-10
+ */
+public interface ScreenProjectCategoryService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2021-11-10
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2021-11-10
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return ScreenProjectCategoryDTO
+ * @author generator
+ * @date 2021-11-10
+ */
+ ScreenProjectCategoryDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-11-10
+ */
+ void save(ScreenProjectCategoryDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-11-10
+ */
+ void update(ScreenProjectCategoryDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2021-11-10
+ */
+ void delete(String[] ids);
+
+ /**
+ * 删除项目分类
+ * @Param customerId
+ * @Param projectIds
+ * @Return
+ * @Author zhaoqifeng
+ * @Date 2021/11/10 11:06
+ */
+ void deleteByProjectId(String customerId, List projectIds);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
index a29640a75b..845a2fc844 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
@@ -148,4 +148,13 @@ public interface ScreenProjectDataService extends BaseService relationInfo = relationService.selectSubCustomer(customerId);
+ List customerIds = new ArrayList<>();
+ customerIds.add(customerId);
+ List allList = new ArrayList<>();
+ List closedList = new ArrayList<>();
+ if (CollectionUtils.isEmpty(relationInfo)){
+ // 单客户
+ allList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_ALL,customerId, NumConstant.FOUR);
+ closedList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_CLOSED,customerId, NumConstant.FOUR);
+ }else {
+ // 多客户
+ List subCustomerIds = relationInfo.stream().map(CustomerRelationEntity::getCustomerId).collect(Collectors.toList());
+ customerIds.addAll(subCustomerIds);
+ allList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_ALL,customerId, NumConstant.TWO);
+ closedList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_CLOSED,customerId, NumConstant.TWO);
+ }
+ List finalClosedList = closedList;
+ allList.forEach(a -> finalClosedList.stream().filter(c -> c.getGridId().equals(a.getGridId()) && c.getCategoryCode().equals(a.getCategoryCode())).forEach(c -> a.setClosedProjectTotal(c.getClosedProjectTotal())));
+ gridDel(customerId,dateId);
+ gridInsert(allList);
+ }
+
+ /**
+ * @Description 项目分类网格删除
+ * @param customerId
+ * @param dateId
+ * @author zxc
+ * @date 2021/11/10 1:55 下午
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void gridDel(String customerId,String dateId){
+ Integer num = NumConstant.ZERO;
+ do {
+ num = gridDailyDao.deleteByDateIdAndCustomerId(customerId, dateId);
+ }while (num > NumConstant.ZERO && num == NumConstant.ONE_THOUSAND);
+ }
+
+ /**
+ * @Description 项目分类网格添加
+ * @param needInsert
+ * @author zxc
+ * @date 2021/11/10 1:55 下午
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void gridInsert(List needInsert){
+ List> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED);
+ partition.forEach(p -> {
+ gridDailyService.insertBatch(ConvertUtils.sourceToTarget(p,ScreenProjectCategoryGridDailyEntity.class));
+ log.info("插入的网格项目分类为" + JSON.toJSONString(p));
+ });
+ }
+
+ /**
+ * @Description 分类下的项目数【org】
+ * 项目分类来源
+ * 本级【直接立项】 + 下级 + 直属网格
+ * @param customerId
+ * @param dateId
+ * @author zxc
+ * @date 2021/11/10 10:23 上午
+ */
+ @Override
+ public void extractCategoryProjectOrgData(String customerId, String dateId) {
+ List relationInfo = relationService.selectSubCustomer(customerId);
+ List customerIds = new ArrayList<>();
+ customerIds.add(customerId);
+ List result = new ArrayList<>();
+ if (CollectionUtils.isEmpty(relationInfo)){
+ // one customer
+ List agencies = screenCustomerAgencyDao.selectAgencyByCustomer(customerId);
+ List allAgencies = ConvertUtils.sourceToTarget(agencies, GridAndOrgCategoryCountResultDTO.class);
+ result = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_ALL, customerId, NumConstant.FOUR, allAgencies);
+ List closedList = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_CLOSED, customerId, NumConstant.FOUR, allAgencies);
+ result.forEach(r -> closedList.stream().filter(c -> r.getOrgId().equals(c.getOrgId()) && r.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> r.setClosedProjectTotal(c.getClosedProjectTotal())));
+ }else {
+ // more customers
+ // 去除孔村的客户ID,孔村镇的单独查😡
+ List subCustomerIds = relationInfo.stream().map(CustomerRelationEntity::getCustomerId).collect(Collectors.toList());
+ for (int i = NumConstant.ZERO; i < subCustomerIds.size(); i++) {
+ if (subCustomerIds.get(i).equals(PingYinConstant.KONG_CUN_CUSTOMER_ID)){
+ customerIds.remove(i);
+ continue;
+ }
+ }
+ List allAgencies = screenCustomerAgencyDao.selectParentSonAgency(subCustomerIds, PingYinConstant.KONG_CUN_CUSTOMER_ID);
+ List> partition = ListUtils.partition(allAgencies, NumConstant.FIFTY);
+ List allOrgCategoryList = result;
+ partition.forEach(p -> {
+ List allOrgList = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_ALL, customerId, NumConstant.TWO, p);
+ List closedOrgList = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_CLOSED, customerId, NumConstant.TWO, p);
+ allOrgList.forEach(a -> closedOrgList.stream().filter(c -> a.getOrgId().equals(c.getOrgId()) && a.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> a.setClosedProjectTotal(c.getClosedProjectTotal())));
+ allOrgCategoryList.addAll(allOrgList);
+ });
+ }
+ orgDel(customerId,dateId);
+ orgInsert(result);
+ }
+
+ /**
+ * @Description 项目分类组织删除
+ * @param customerId
+ * @param dateId
+ * @author zxc
+ * @date 2021/11/10 4:58 下午
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void orgDel(String customerId,String dateId){
+ Integer num = NumConstant.ZERO;
+ do {
+ num = orgDailyDao.deleteByDateIdAndCustomerId(customerId, dateId);
+ }while (num > NumConstant.ZERO && num == NumConstant.ONE_THOUSAND);
+ }
+
+ /**
+ * @Description 项目分类组织插入
+ * @param needInsert
+ * @author zxc
+ * @date 2021/11/10 5:03 下午
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void orgInsert(List needInsert){
+ List> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED);
+ partition.forEach(p -> {
+ orgDailyService.insertBatch(ConvertUtils.sourceToTarget(p, ScreenProjectCategoryOrgDailyEntity.class));
+ log.info("插入的组织项目分类为" + JSON.toJSONString(p));
+ });
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryServiceImpl.java
new file mode 100644
index 0000000000..b696efeeb3
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryServiceImpl.java
@@ -0,0 +1,119 @@
+/**
+ * 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.service.evaluationindex.screen.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.constant.FieldConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryDao;
+import com.epmet.dto.screen.ScreenProjectCategoryDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity;
+import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目所属分类表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-11-10
+ */
+@Service
+public class ScreenProjectCategoryServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ScreenProjectCategoryDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryDTO.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 ScreenProjectCategoryDTO get(String id) {
+ ScreenProjectCategoryEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(ScreenProjectCategoryDTO dto) {
+ ScreenProjectCategoryEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(ScreenProjectCategoryDTO dto) {
+ ScreenProjectCategoryEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ /**
+ * 删除项目分类
+ *
+ * @param customerId
+ * @param projectIds
+ * @Param customerId
+ * @Param projectIds
+ * @Return
+ * @Author zhaoqifeng
+ * @Date 2021/11/10 11:06
+ */
+ @Override
+ public void deleteByProjectId(String customerId, List projectIds) {
+ if (CollectionUtils.isEmpty(projectIds)) {
+ return;
+ }
+ baseDao.deleteByProjectIds(customerId, projectIds);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
index f04234049e..d5b114852a 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
@@ -17,6 +17,7 @@
package com.epmet.service.evaluationindex.screen.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;
@@ -24,19 +25,27 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg;
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.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
+import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
+import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
+import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
+import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryService;
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService;
+import com.epmet.service.stats.CustomerProjectCategoryDictService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.ArrayUtils;
@@ -48,10 +57,8 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
/**
* 中央区-项目数据
@@ -67,6 +74,14 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl page(Map params) {
@@ -132,6 +147,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl projectList = new ArrayList<>();
param.getDataList().forEach(item -> {
String projectStatusCode = item.getProjectStatusCode();
@@ -195,7 +211,12 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl {
List list = ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class);
insertBatch(list);
+ saveCategory(customerId, list);
});
}
if(!CollectionUtils.isEmpty(orient)){
List> partition = ListUtils.partition(orient, NumConstant.ONE_HUNDRED);
- partition.forEach(part -> baseDao.updateBatch(part,dateId));
+ partition.forEach(part -> {
+ baseDao.updateBatch(part,dateId);
+ saveCategory(customerId, ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class));
+ });
}
}
@@ -306,4 +333,57 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(customerId), ScreenProjectDataEntity::getCustomerId, customerId);
+ List projectList = baseDao.selectList(wrapper);
+ saveCategory(customerId, projectList);
+ }
+
+ private void saveCategory(String customerId, List projectList) {
+
+ Result parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(customerId);
+ //删除旧分类
+ List projectIds = projectList.stream().map(ScreenProjectDataEntity::getProjectId).collect(Collectors.toList());
+ screenProjectCategoryService.deleteByProjectId(customerId, projectIds);
+ //提取分类信息
+ List projectCategoryList = new ArrayList<>();
+ projectList.forEach(project -> {
+ //分类为空不作处理
+ if (StringUtils.isNotBlank(project.getCategoryCode())) {
+ List categoryList = Arrays.asList(project.getCategoryCode().split(StrConstant.COMMA));
+ categoryList.forEach(category -> {
+ ScreenProjectCategoryEntity entity = new ScreenProjectCategoryEntity();
+ entity.setCustomerId(customerId);
+ entity.setProjectId(project.getProjectId());
+ entity.setOriginCategoryCode(category);
+ CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(customerId, category);
+ if (null != categoryEntity) {
+ //
+ if ("external".equals(categoryEntity.getCustomerType())) {
+ entity.setCategoryCode(categoryEntity.getEpmetCategoryCode());
+ CustomerProjectCategoryDictEntity parent = customerProjectCategoryDictService.getByCategoryCode(parentCustomer.getData(), categoryEntity.getEpmetCategoryCode());
+ entity.setParentCategoryCode(parent.getParentCategoryCode());
+ } else {
+ entity.setCategoryCode(categoryEntity.getCategoryCode());
+ entity.setParentCategoryCode(categoryEntity.getParentCategoryCode());
+ }
+ entity.setLevel(categoryEntity.getLevel());
+ }
+ projectCategoryList.add(entity);
+ });
+ }
+ });
+ screenProjectCategoryService.insertBatch(projectCategoryList);
+ }
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
index 1772d2a0aa..f97f5b4946 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
@@ -505,5 +505,41 @@
del_flag = 0
AND customer_id = #{customerId}
+
+ SELECT
+ a.AGENCY_ID
+ FROM
+ screen_customer_agency a
+ INNER JOIN screen_customer_agency b ON a.AREA_CODE = b.PARENT_AREA_CODE
+ AND b.DEL_FLAG = '0'
+ AND b.AGENCY_ID = #{agencyId}
+ WHERE
+ a.DEL_FLAG = '0'
+
+
+
+
+ SELECT
+ AGENCY_ID AS orgId,
+ PID,
+ REPLACE(PIDS,',',':') AS pids,
+ `LEVEL` AS orgType
+ FROM screen_customer_agency
+ WHERE DEL_FLAG = '0'
+ AND CUSTOMER_ID IN
+
+ #{c}
+
+ UNION ALL
+ SELECT
+ AGENCY_ID AS orgId,
+ PID,
+ REPLACE(PIDS,',',':') AS pids,
+ CASE WHEN `LEVEL` = 'district' THEN 'street' ELSE `LEVEL` END AS orgType
+ FROM screen_customer_agency
+ WHERE DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+ AND `LEVEL` != 'street'
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryDao.xml
new file mode 100644
index 0000000000..afe80a6416
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryDao.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete from screen_project_category
+ where CUSTOMER_ID = #{customerId}
+
+ PROJECT_ID = #{projectId}
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
index 5930ae87c9..2988342b64 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
@@ -269,4 +269,120 @@
ORDER BY
a.CREATED_TIME ASC
+
+
+
+ SELECT
+ #{dateId} AS dateId,
+ #{customerId} AS customerId,
+ pc.CATEGORY_CODE,
+ pd.ORG_ID AS gridId,
+ pd.PARENT_ID AS pid,
+ pd.ALL_PARENT_IDS AS pids,
+ pc.`LEVEL`,
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS closedProjectTotal
+
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS projectTotal
+
+ FROM screen_project_data pd
+ LEFT JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
+ WHERE pd.DEL_FLAG = '0'
+ AND pd.CUSTOMER_ID IN
+
+ #{c}
+
+ AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') #{dateId}
+ AND pd.ORG_TYPE = 'grid'
+ AND pc.level = 2
+
+ AND pd.PROJECT_STATUS_CODE IN ('closed','closed_case')
+
+ GROUP BY pd.ORG_ID,pc.CATEGORY_CODE
+ UNION ALL
+ SELECT
+ #{dateId} AS dateId,
+ #{customerId} AS customerId,
+ left(pc.CATEGORY_CODE, #{subCount}) AS categoryCode,
+ pd.ORG_ID AS gridId,
+ pd.PARENT_ID AS pid,
+ pd.ALL_PARENT_IDS AS pids,
+ 1 AS level,
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS closedProjectTotal
+
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS projectTotal
+
+ FROM screen_project_data pd
+ INNER JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
+ WHERE pd.DEL_FLAG = '0'
+ AND pd.CUSTOMER_ID IN
+
+ #{c}
+
+ AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') #{dateId}
+ AND pd.ORG_TYPE = 'grid'
+
+ AND pd.PROJECT_STATUS_CODE IN ('closed','closed_case')
+
+ GROUP BY pd.ORG_ID,categoryCode
+
+
+
+
+
+ SELECT
+ #{dateId} AS dateId,
+ #{customerId} AS customerId,
+ pc.CATEGORY_CODE,
+ #{a.orgId} AS orgId,
+ #{a.pid} AS pid,
+ #{a.pids} AS pids,
+ #{a.orgType} AS orgType,
+ pc.`LEVEL`,
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS closedProjectTotal
+
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS projectTotal
+
+ FROM screen_project_data pd
+ LEFT JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
+ WHERE pd.DEL_FLAG = '0'
+ AND pc.level = 2
+ AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') #{dateId}
+ AND ALL_PARENT_IDS LIKE #{a.orgId}
+
+ AND pd.PROJECT_STATUS_CODE IN ('closed','closed_case')
+
+ GROUP BY pc.CATEGORY_CODE
+ UNION ALL
+ SELECT
+ #{dateId} AS dateId,
+ #{customerId} AS customerId,
+ left(pc.CATEGORY_CODE, #{subCount}) AS categoryCode,
+ #{a.orgId} AS orgId,
+ #{a.pid} AS pid,
+ #{a.pids} AS pids,
+ #{a.orgType} AS orgType,
+ pc.`LEVEL`,
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS closedProjectTotal
+
+
+ COUNT(DISTINCT pc.PROJECT_ID) AS projectTotal
+
+ FROM screen_project_data pd
+ INNER JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
+ WHERE pd.DEL_FLAG = '0'
+ AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') #{dateId}
+ AND ALL_PARENT_IDS LIKE #{a.orgId}
+
+ AND pd.PROJECT_STATUS_CODE IN ('closed','closed_case')
+
+ GROUP BY categoryCode
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
index 5b408d1367..f1aac1a9c0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
@@ -23,6 +23,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@@ -47,10 +48,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
/**
@@ -180,15 +179,24 @@ public class BuildingController {
List failList = importResult.getFailList();
+ //存放错误数据行号
+ List numList = new ArrayList<>();
if(!CollectionUtils.isEmpty(failList)){
for ( IcBuildingExcel entity : failList) {
log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息
+ numList.add(entity.getRowNum());
}
- return new Result().error(8001,failList.get(0).getErrorMsg());
+ //return new Result().error(8001,failList.get(0).getErrorMsg());
}
List result =importResult.getList();
-
- return new Result().ok(buildingService.importExcel(customerId,result,tokenDTO.getUserId()));
+ List resultList = buildingService.importExcel(customerId,result,tokenDTO.getUserId(),numList);
+ String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size());
+ if(resultList.size()> NumConstant.ZERO){
+ Collections.sort(resultList);
+ String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
+ return new Result().error(9999, str+"第"+subList+"行未成功!");
+ }
+ return new Result().ok(str);
}
/**
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
index 1807565cee..a2bb68f09f 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
@@ -21,6 +21,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@@ -42,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
+import java.util.stream.Collectors;
/**
@@ -145,15 +147,25 @@ public class HouseController {
List failList = importResult.getFailList();
+ //存放错误数据行号
+ List numList = new ArrayList<>();
if(!CollectionUtils.isEmpty(failList)){
for ( IcHouseExcel entity : failList) {
log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息
+ numList.add(entity.getRowNum());
}
- return new Result().error(8001,failList.get(0).getErrorMsg());
+ //return new Result().error(8001,failList.get(0).getErrorMsg());
}
List result =importResult.getList();
- return new Result().ok(houseService.importExcel(customerId,result,tokenDTO.getUserId()));
+ List resultList = houseService.importExcel(customerId,result,tokenDTO.getUserId(),numList);
+ String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size());
+ if(resultList.size()> NumConstant.ZERO){
+ Collections.sort(resultList);
+ String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
+ return new Result().error(9999, str+"第"+subList+"行未成功!");
+ }
+ return new Result().ok(str);
}
@PostMapping( "queryListHouseInfo")
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
index 11e1f65d6b..cb22dd00f2 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
@@ -22,6 +22,7 @@ import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@@ -45,10 +46,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
/**
@@ -207,16 +206,25 @@ public class NeighborHoodController {
// List result = ExcelPoiUtils.importExcel(file, 0, 1, IcNeighborHoodExcel.class);
List failList = importResult.getFailList();
+ //存放错误数据行号
+ List numList = new ArrayList<>();
if(!CollectionUtils.isEmpty(failList)){
for ( IcNeighborHoodExcel entity : failList) {
log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息
+ numList.add(entity.getRowNum());
}
- return new Result().error(8001,failList.get(0).getErrorMsg());
+ //return new Result().error(8001,failList.get(0).getErrorMsg());
}
List result =importResult.getList();
// log.info(JSON.toJSONString(result));
- neighborHoodService.importExcel(customerId,result,tokenDTO.getUserId());
- return new Result();
+ List resultList = neighborHoodService.importExcel(customerId,result,tokenDTO.getUserId(),numList);
+ String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size());
+ if(resultList.size()> NumConstant.ZERO){
+ Collections.sort(resultList);
+ String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
+ return new Result().error(9999, str+"第"+subList+"行未成功!");
+ }
+ return new Result().ok(str);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index 34534391c3..bec972b9d7 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -336,4 +336,10 @@ public interface CustomerGridDao extends BaseDao {
* @Date 2021/10/25 16:04
*/
List selectUnitList(@Param("buildingId") String buildingId);
+
+ /**
+ * @Author sun
+ * @Description 查询组织下直属网格列表
+ **/
+ List selectByPid(@Param("pid") String pid);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
index e0fce5c740..b0cb1d46b6 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
@@ -56,7 +56,8 @@ public interface IcBuildingDao extends BaseDao {
List selectAgencyChildrenList(@Param("agencyId") String agencyId);
- List> selectListByName(@Param("neighborNameList")ArrayList strings,
+ List> selectListByName(@Param("customerId") String customerId,
+ @Param("neighborNameList")ArrayList strings,
@Param("buildingNameList") ArrayList strings1,
@Param("buildingUnitList") ArrayList integers);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
index 19e30210ae..6e5d0487eb 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
@@ -43,7 +43,8 @@ public interface IcNeighborHoodDao extends BaseDao {
// List searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper);
List searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house);
- List selectListByName(@Param("neighborNameList")List neighborNameList,
+ List selectListByName(@Param("customerId") String customerId,
+ @Param("neighborNameList")List neighborNameList,
@Param("agencyNameList") List agencyNameList,
@Param("gridNameList") List gridNameList);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
index 1a8c8c04e9..405887d709 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
@@ -17,7 +17,6 @@
package com.epmet.service;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
@@ -53,7 +52,7 @@ public interface BuildingService {
List treeList(String customerId);
- Result importExcel(String customerId, List list, String staffId);
+ List importExcel(String customerId, List list, String staffId, List numList);
IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
index 0fd98dc3df..48ab8c7d1b 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
@@ -17,7 +17,6 @@
package com.epmet.service;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
@@ -48,7 +47,7 @@ public interface HouseService {
void delHouse(String houseId);
- Result importExcel(String customerId, List list, String staffId);
+ List importExcel(String customerId, List list, String staffId, List numList);
IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
index 266c3b912d..ff1a35f45a 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
@@ -52,5 +52,5 @@ public interface NeighborHoodService{
*/
void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ;
- void importExcel(String customerId,List list,String staffId);
+ List importExcel(String customerId, List list, String staffId, List numList);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
index 40659b958f..d00fade930 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
@@ -9,7 +9,6 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.*;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.CustomerStaffAgencyDTO;
@@ -210,7 +209,7 @@ public class BuildingServiceImpl implements BuildingService {
@Override
@Transactional(rollbackFor = Exception.class)
- public Result importExcel(String customerId, List list, String staffId) {
+ public List importExcel(String customerId, List list, String staffId, List numList) {
//2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId);
//组织名称不一样的数据舍弃
@@ -218,15 +217,16 @@ public class BuildingServiceImpl implements BuildingService {
while (iterator.hasNext()) {
IcBuildingExcel obj = iterator.next();
if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) {
+ numList.add(obj.getRowNum());
iterator.remove();
}
}
//用于存储匹配不上的数据给前端的提示 如南宁社区不存在
- StringBuffer str = new StringBuffer("");
+ //StringBuffer str = new StringBuffer("");
//end sun
//导入
if(CollectionUtils.isEmpty(list)){
- return new Result();
+ return numList;
}
//查询所有组织和网格根据名字
@@ -236,7 +236,7 @@ public class BuildingServiceImpl implements BuildingService {
Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet());
Set agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toSet());
Set gridNameList = list.stream().map(item -> item.getGridName()).collect(Collectors.toSet());
- List neighborHoodList = icNeighborHoodDao.selectListByName(new ArrayList(neighborNameList),new ArrayList(agencyNameList),new ArrayList(gridNameList));
+ List neighborHoodList = icNeighborHoodDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(agencyNameList),new ArrayList(gridNameList));
// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList));
Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1));
@@ -252,7 +252,8 @@ public class BuildingServiceImpl implements BuildingService {
entity.setCustomerId(customerId);
entity.setNeighborHoodId(Optional.ofNullable(neighborHoodMap.get(icBuildingExcel.getNeighborHoodName())).map(u->u.getId()).orElse(""));//neighborHoodMap.get(icBuildingExcel.getNeighborHoodName()).getId()
if ("".equals(entity.getNeighborHoodId())) {
- str.append("".equals(str) ? icBuildingExcel.getNeighborHoodName() : str.append("、").append(icBuildingExcel.getNeighborHoodName()));
+ //str.append("".equals(str) ? icBuildingExcel.getNeighborHoodName() : str.append("、").append(icBuildingExcel.getNeighborHoodName()));
+ numList.add(icBuildingExcel.getRowNum());
continue;
}
entity.setBuildingName(icBuildingExcel.getBuildingName());
@@ -286,10 +287,10 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingService.insertBatch(buildingEntityList);
icBuildingUnitService.insertBatch(icBuildingUnitEntityList);
- if(!"".equals(str)){
+ /* if(!"".equals(str)){
return new Result().error(9999, str.append("不存在").toString());
- }
- return new Result();
+ }*/
+ return numList;
}
@Override
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
index 2a0ce1465d..d6bbe4dc86 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
@@ -8,7 +8,6 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
@@ -24,7 +23,6 @@ import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
-import com.epmet.excel.IcBuildingExcel;
import com.epmet.excel.IcHouseExcel;
import com.epmet.service.HouseService;
import com.epmet.service.IcBuildingService;
@@ -123,7 +121,8 @@ public class HouseServiceImpl implements HouseService {
}
@Override
- public Result importExcel(String customerId, List list, String staffId) {
+ @Transactional(rollbackFor = Exception.class)
+ public List importExcel(String customerId, List list, String staffId, List numList) {
//2021.11.10 需求变更 当前工作人员只能导致自己所属组织下数据,对应不上的数据舍弃【注:需求就这样】 sun
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId);
//组织名称不一样的数据舍弃
@@ -131,15 +130,16 @@ public class HouseServiceImpl implements HouseService {
while (iterator.hasNext()) {
IcHouseExcel obj = iterator.next();
if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) {
+ numList.add(obj.getRowNum());
iterator.remove();
}
}
//用于存储匹配不上的数据给前端的提示 如南宁社区不存在
- StringBuffer str = new StringBuffer("");
+ //StringBuffer str = new StringBuffer("");
//end sun
//导入
if(CollectionUtils.isEmpty(list)){
- return new Result();
+ return numList;
}
//获取所有小区 list
// List neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toList());
@@ -153,7 +153,7 @@ public class HouseServiceImpl implements HouseService {
Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet());
Set buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toSet());
Set buildingUnitList = list.stream().map(item -> item.getBuildingUnit()).collect(Collectors.toSet());
- List> buildMapList = icBuildingDao.selectListByName(new ArrayList(neighborNameList),new ArrayList(buildingNameList),new ArrayList(buildingUnitList));
+ List> buildMapList = icBuildingDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(buildingNameList),new ArrayList(buildingUnitList));
//转Map
Map> buildMap = new HashMap<>();
buildMapList.forEach(item->{
@@ -173,7 +173,8 @@ public class HouseServiceImpl implements HouseService {
entity.setBuildingUnitId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingUnitId")).orElse("")));
entity.setHouseName(icHouseExcel.getBuildingName()+"-"+icHouseExcel.getBuildingUnit()+"-"+icHouseExcel.getDoorName());
if ("".equals(entity.getNeighborHoodId()) || "".equals(entity.getBuildingId()) || "".equals(entity.getBuildingUnitId())) {
- str.append("".equals(str) ? icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit() : str.append("、").append(icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit()));
+ //str.append("".equals(str) ? icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit() : str.append("、").append(icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit()));
+ numList.add(icHouseExcel.getRowNum());
continue;
}
entity.setDoorName(icHouseExcel.getDoorName());
@@ -193,10 +194,10 @@ public class HouseServiceImpl implements HouseService {
//3.保存
icHouseService.insertBatch(houseEntityList);
- if(!"".equals(str)){
+ /*if(!"".equals(str)){
return new Result().error(9999, str.append("不存在").toString());
- }
- return new Result();
+ }*/
+ return numList;
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
index 4e36375890..d7558cd110 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
@@ -36,6 +36,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -240,32 +241,49 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
@Override
@Transactional(rollbackFor = Exception.class)
- public void importExcel(String customerId,List list,String staffId) {
+ public List importExcel(String customerId,List list,String staffId, List numList) {
//2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId);
+ //查询当前组织下网格列表
+ List customerGridList = customerGridDao.selectByPid(staffInfoCache.getAgencyId());
//组织名称不一样的数据舍弃
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
IcNeighborHoodExcel obj = iterator.next();
if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) {
+ numList.add(obj.getRowNum());
iterator.remove();
}
+ //当前组织下网格名不存在的也不允许导入
+ AtomicBoolean br = new AtomicBoolean(true);
+ customerGridList.forEach(g->{
+ if(obj.getGridName().trim().equals(g.getGridName())){
+ br.set(false);
+ }
+ });
+ if(br.get()){
+ numList.add(obj.getRowNum());
+ iterator.remove();
+ }
+
}
//end sun
//导入
if(CollectionUtils.isEmpty(list)){
- return ;
+ return numList;
}
//获取所有组织 list
List agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toList());
+ agencyNameList = agencyNameList.stream().distinct().collect(Collectors.toList());
//获取所有网格 list
- List gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList());
+ //List gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList());
//获取所有物业 list
List propertyNameList = list.stream().map(item->item.getPropertyName()).collect(Collectors.toList());
+ propertyNameList = propertyNameList.stream().distinct().collect(Collectors.toList());
//查询对应的id
List customerAgencyList = customerAgencyDao.selectList(new QueryWrapper().lambda().in(CustomerAgencyEntity::getOrganizationName, agencyNameList));
- List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getGridName, gridNameList));
+ //List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getGridName, gridNameList));
List icPropertyManagementList = icPropertyManagementDao.selectList(new QueryWrapper().lambda().in(IcPropertyManagementEntity::getName, propertyNameList));
Map agencyMap = customerAgencyList.stream().collect(Collectors.toMap(CustomerAgencyEntity::getOrganizationName, Function.identity(),(key1, key2)->key1));
@@ -294,6 +312,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
entity.setGridId(Optional.ofNullable(gridMap.get(icNeighborHoodExcel.getGridName().trim())).map(u->u.getId()).orElse(""));//gridMap.get(icNeighborHoodExcel.getGridName()).getId()
//网格名对应不上的数据舍弃
if ("".equals(entity.getGridId())) {
+ numList.add(icNeighborHoodExcel.getRowNum());
continue;
}
entity.setAddress(icNeighborHoodExcel.getAddress());
@@ -312,6 +331,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
icNeighborHoodService.insertBatch(neighborHoodEntityList);
icNeighborHoodPropertyService.insertBatch(icNeighborHoodPropertyEntityList);
+ return numList;
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index a3aba7122e..8b90fc9e74 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
@@ -680,5 +680,13 @@
DEL_FLAG = '0'
AND BUILDING_ID = #{buildingId}
+
+ SELECT
+ *
+ FROM customer_grid
+ WHERE
+ del_flag = '0'
+ AND pid = #{pid}
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
index 3c4022ea6f..2091daeba8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
@@ -283,7 +283,9 @@
#{val}
- WHERE a.DEL_FLAG = '0' and a.NEIGHBOR_HOOD_NAME in
+ WHERE a.DEL_FLAG = '0'
+ AND a.CUSTOMER_ID = #{customerId}
+ and a.NEIGHBOR_HOOD_NAME in
#{val}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
index dba659f38c..ea950eb90b 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
@@ -193,7 +193,9 @@
#{val}
- where a.DEL_FLAG= '0'and a.NEIGHBOR_HOOD_NAME in
+ where a.DEL_FLAG= '0'
+ AND a.CUSTOMER_ID = #{customerId}
+ and a.NEIGHBOR_HOOD_NAME in
#{val}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java
index e5afdeddc2..45cd1dd0ea 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java
@@ -27,7 +27,7 @@ public class CustomerFormResultDTO implements Serializable {
/**
* 表单项
*/
- private List itemList;
+ private List itemList;
/**
* 表单分组
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java
index dbb3f60e70..1b2a6c8964 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java
@@ -42,6 +42,6 @@ public class FormGroupDTO implements Serializable {
/**
* 分组里面的组件
*/
- private List itemList;
+ private List itemList;
}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java
similarity index 97%
rename from epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem.java
rename to epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java
index 7e3abbaa0e..dfe0b85ffa 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java
@@ -12,7 +12,7 @@ import java.util.List;
* @Date 2021/10/26 2:15 下午
*/
@Data
-public class FormItem implements Serializable {
+public class FormItemResult implements Serializable {
private static final long serialVersionUID = 7443085469505238040L;
/**
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem2.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java
similarity index 97%
rename from epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem2.java
rename to epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java
index 99114fe830..3372b55a37 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem2.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java
@@ -12,7 +12,7 @@ import java.util.List;
* @Date 2021/10/26 4:29 下午
*/
@Data
-public class FormItem2 implements Serializable {
+public class FormItemResult2 implements Serializable {
private static final long serialVersionUID = -7571266621687396261L;
/**
* 父项ID
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
index ecfe051d35..9205d5bedb 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
@@ -91,7 +91,7 @@ public interface OperCustomizeOpenFeignClient {
* @date 2021.10.28 15:19:59
*/
@PostMapping("/oper/customize/icform/items")
- Result> listItems(@RequestBody CustomerFormQueryDTO formDto);
+ Result> listItems(@RequestBody CustomerFormQueryDTO formDto);
/**
* @Author sun
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
index b1cc198c20..7835c21b5b 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
@@ -73,7 +73,7 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
}
@Override
- public Result> listItems(CustomerFormQueryDTO formDto) {
+ public Result> listItems(CustomerFormQueryDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listItems", formDto);
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java
index 8c506cfe74..f6f52d00c2 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java
@@ -187,9 +187,9 @@ public class IcFormController {
* @date 2021.10.28 15:19:59
*/
@PostMapping("items")
- public Result> listItems(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto) {
+ public Result> listItems(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto) {
ValidatorUtils.validateEntity(formDto, CustomerFormQueryDTO.GetFormInfoGroup.class);
- List rst = icFormService.listItems(tokenDto.getCustomerId(), formDto.getFormCode());
- return new Result>().ok(rst);
+ List rst = icFormService.listItems(tokenDto.getCustomerId(), formDto.getFormCode());
+ return new Result>().ok(rst);
}
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java
index 6cd4fa7188..7cd489b2bb 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java
@@ -20,7 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.CustomerFormResultDTO;
import com.epmet.dto.result.FormGroupDTO;
-import com.epmet.dto.result.FormItem;
+import com.epmet.dto.result.FormItemResult;
import com.epmet.dto.result.OptionDTO;
import com.epmet.entity.IcFormEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -47,9 +47,9 @@ public interface IcFormDao extends BaseDao {
*/
CustomerFormResultDTO selectByCode(@Param("customerId") String customerId, @Param("formCode") String formCode);
- List selectItemList(String formId, Boolean dynamic);
+ List selectItemList(String formId, Boolean dynamic);
- List selectItemListByGroupId(String groupId);
+ List selectItemListByGroupId(String groupId);
List selectListOption(String itemId);
List selectListGroup(String formId);
@@ -64,5 +64,5 @@ public interface IcFormDao extends BaseDao {
* @author wxz
* @date 2021.10.28 16:43:00
*/
- List listItems(@Param("formId") String formId);
+ List listItems(@Param("formId") String formId);
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java
index b1d0dddaf1..c90e6227dc 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java
@@ -22,7 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.CustomerFormResultDTO;
-import com.epmet.dto.result.FormItem;
+import com.epmet.dto.result.FormItemResult;
import com.epmet.entity.IcFormEntity;
import java.util.List;
@@ -115,5 +115,5 @@ public interface IcFormService extends BaseService {
* @author wxz
* @date 2021.10.27 17:41:59
*/
- List listItems(String customerId, String formCode);
-}
\ No newline at end of file
+ List listItems(String customerId, String formCode);
+}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java
index 1170a08309..7d50e6091b 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java
@@ -17,9 +17,7 @@
package com.epmet.service.impl;
-import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@@ -35,21 +33,18 @@ import com.epmet.dto.IcFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.CustomerFormResultDTO;
import com.epmet.dto.result.FormGroupDTO;
-import com.epmet.dto.result.FormItem;
+import com.epmet.dto.result.FormItemResult;
import com.epmet.entity.IcFormEntity;
import com.epmet.redis.CustomerFootBarRedis;
import com.epmet.service.IcFormService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
-import java.util.Optional;
/**
* 配置表单
@@ -61,7 +56,7 @@ import java.util.Optional;
public class IcFormServiceImpl extends BaseServiceImpl implements IcFormService {
@Autowired
private CustomerFootBarRedis customerFootBarRedis;
-
+
@Autowired
private RedisUtils redisUtils;
@@ -135,7 +130,7 @@ public class IcFormServiceImpl extends BaseServiceImpl
if (null == resultDTO) {
throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg());
}
- List itemList=baseDao.selectItemList(resultDTO.getFormId(),formDto.getDynamic());
+ List itemList=baseDao.selectItemList(resultDTO.getFormId(),formDto.getDynamic());
List groupList=baseDao.selectListGroup(resultDTO.getFormId());
resultDTO.setItemList(itemList);
resultDTO.setGroupList(groupList);
@@ -144,13 +139,13 @@ public class IcFormServiceImpl extends BaseServiceImpl
}
@Override
- public List listItems(String customerId, String formCode) {
+ public List listItems(String customerId, String formCode) {
// 从redis取
String icFormItemsKey = RedisKeys.getIcFormItemsKey(customerId, formCode);
-
+
Object objValue = redisUtils.get(icFormItemsKey);
if (objValue != null) {
- return ((JSONArray) objValue).toJavaList(FormItem.class);
+ return ((JSONArray) objValue).toJavaList(FormItemResult.class);
//return JSON.parseObject((String) objValue, type);
}
@@ -160,14 +155,14 @@ public class IcFormServiceImpl extends BaseServiceImpl
throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg());
}
- List formItems = baseDao.listItems(formResultDto.getFormId());
- formItems.forEach(i -> {
+ List formItemResults = baseDao.listItems(formResultDto.getFormId());
+ formItemResults.forEach(i -> {
i.setOptions(baseDao.selectListOption(i.getItemId()));
});
-
+
// 缓存
- redisUtils.set(icFormItemsKey, formItems);
+ redisUtils.set(icFormItemsKey, formItemResults);
- return formItems;
+ return formItemResults;
}
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml
index 44d23cda3f..d93d611f7c 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml
@@ -17,7 +17,7 @@
-
+
@@ -123,13 +123,13 @@
-
-
+
@@ -210,7 +210,7 @@
g.SORT ASC
-
+
SELECT fi.ID AS item_id,
case
when g.TABLE_NAME is null or g.TABLE_NAME = '' then 'ic_resi_user'
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnCountFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnCountFormDTO.java
new file mode 100644
index 0000000000..7fba162e27
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnCountFormDTO.java
@@ -0,0 +1,46 @@
+/**
+ * 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.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 预警统计表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-11-04
+ */
+@Data
+public class StatsResiWarnCountFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 组织id
+ */
+ @NotBlank(message = "用户id不能为空")
+ private String userId;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
index 52f4ea9adf..0bc25d5ccd 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
@@ -29,10 +29,12 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@@ -178,58 +180,21 @@ public class IcResiUserController {
* @throws Exception
*/
@RequestMapping(value = "/exportExcel2")
- public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
+ public void exportExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
+ CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
+ String staffOrgPath = null;
+ if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
+ staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
+ }else{
+ staffOrgPath=staffInfoCacheResult.getAgencyId();
+ }
pageFormDTO.setCustomerId(customerId);
pageFormDTO.setPageFlag(false);
- CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
-
- Map> otherSheetItems = new HashMap<>();
+ CustomerFormResultDTO resiFormItems = getResiFormAddItems(pageFormDTO.getCustomerId());
- //主表的
- for (FormItem formItem : resiFormItems.getItemList()) {
- if (StringUtils.isBlank(formItem.getColumnName())) {
- continue;
- }
-
- Map itemMap = otherSheetItems.getOrDefault(formItem.getTableName(), new HashMap<>());
- otherSheetItems.putIfAbsent(formItem.getTableName(), itemMap);
- if (formItem.getItemType().equals("checkbox") || formItem.getItemType().equals("select") || formItem.getItemType().equals("radio")) {
- itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem);
- }
- if (formItem.getChildGroup() != null) {
- itemMap = otherSheetItems.getOrDefault(formItem.getChildGroup().getTableName(), new HashMap<>());
- otherSheetItems.putIfAbsent(formItem.getChildGroup().getTableName(), itemMap);
- for (FormItem2 item2 : formItem.getChildGroup().getItemList()) {
- if (StringUtils.isBlank(item2.getColumnName())) {
- continue;
- }
-
- if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
- itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItem.class));
- }
- }
-
- }
- }
- //其他sheet
-
- for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
- if (groupItem.getItemList() == null) {
- continue;
- }
- Map itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>());
- otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap);
- for (FormItem2 formItem2 : groupItem.getItemList()) {
- if (StringUtils.isBlank(formItem2.getColumnName())) {
- continue;
- }
- if ("checkbox".equals(formItem2.getItemType()) || "select".equals(formItem2.getItemType()) || "radio".equals(formItem2.getItemType())) {
- itemMap.put(formItem2.getColumnName().concat(formItem2.getColumnNum() == 0 ? "" : formItem2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItem2, FormItem.class));
- }
- }
- }
+ Map> otherSheetItems = buildItemMap(resiFormItems);
- Map> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
+ Map> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//resiMainList = (List>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]");
log.info("resiMainList:{}", JSON.toJSONString(resiMainList));
String templatePath = "excel/ic_resi_info_cid.xls";
@@ -241,12 +206,12 @@ public class IcResiUserController {
System.out.println("===resiMainList==="+" "+JSON.toJSONString(resiMainList.values()));
sheetMap.put(0, mapData);
AtomicInteger n = new AtomicInteger();
- for (FormItem item : resiFormItems.getItemList()) {
+ for (FormItemResult item : resiFormItems.getItemList()) {
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
- Map itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
- Map> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
+ Map itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
+ Map> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
Map mapData2 = new HashMap<>();
@@ -263,58 +228,25 @@ public class IcResiUserController {
}
@RequestMapping(value = "/exportExcel")
- public void exportExcelByEasyExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
+ public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
+ //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02");
+ CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
+ String staffOrgPath = null;
+ if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
+ staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
+ }else{
+ staffOrgPath=staffInfoCacheResult.getAgencyId();
+ }
pageFormDTO.setCustomerId(customerId);
pageFormDTO.setPageFlag(false);
- CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
+ CustomerFormResultDTO resiFormItems = getResiFormAddItems(pageFormDTO.getCustomerId());
+ Map> otherSheetItems = buildItemMap(resiFormItems);
- Map> otherSheetItems = new HashMap<>();
+ /*List resiFormAllItems = getResiFormAllItems(pageFormDTO.getCustomerId());
+ resiFormAllItems.stream().collect(Collectors.groupingBy(e ->e.get));*/
- //主表的
- for (FormItem formItem : resiFormItems.getItemList()) {
- if (StringUtils.isBlank(formItem.getColumnName())) {
- continue;
- }
-
- Map itemMap = otherSheetItems.getOrDefault(formItem.getTableName(), new HashMap<>());
- otherSheetItems.putIfAbsent(formItem.getTableName(), itemMap);
- if (formItem.getItemType().equals("checkbox") || formItem.getItemType().equals("select") || formItem.getItemType().equals("radio")) {
- itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem);
- }
- if (formItem.getChildGroup() != null) {
- itemMap = otherSheetItems.getOrDefault(formItem.getChildGroup().getTableName(), new HashMap<>());
- otherSheetItems.putIfAbsent(formItem.getChildGroup().getTableName(), itemMap);
- for (FormItem2 item2 : formItem.getChildGroup().getItemList()) {
- if (StringUtils.isBlank(item2.getColumnName())) {
- continue;
- }
-
- if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
- itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItem.class));
- }
- }
-
- }
- }
- //其他sheet
-
- for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
- if (groupItem.getItemList() == null) {
- continue;
- }
- Map itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>());
- otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap);
- for (FormItem2 formItem2 : groupItem.getItemList()) {
- if (StringUtils.isBlank(formItem2.getColumnName())) {
- continue;
- }
- if ("checkbox".equals(formItem2.getItemType()) || "select".equals(formItem2.getItemType()) || "radio".equals(formItem2.getItemType())) {
- itemMap.put(formItem2.getColumnName().concat(formItem2.getColumnNum() == 0 ? "" : formItem2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItem2, FormItem.class));
- }
- }
- }
- Map> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
+ Map> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//=========================================
String templatePath = "excel/ic_resi_info_cid_for_easy_excel.xlsx";
@@ -329,12 +261,12 @@ public class IcResiUserController {
//=======================================
AtomicInteger n = new AtomicInteger();
- for (FormItem item : resiFormItems.getItemList()) {
+ for (FormItemResult item : resiFormItems.getItemList()) {
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
- Map itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
- Map> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
+ Map itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
+ Map> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
int sheetNo = n.incrementAndGet();
@@ -348,6 +280,57 @@ public class IcResiUserController {
excelWriter.finish();
}
+
+ @NotNull
+ private Map> buildItemMap(CustomerFormResultDTO resiFormItems) {
+ Map> otherSheetItems = new HashMap<>();
+
+ //主表的
+ for (FormItemResult formItemResult : resiFormItems.getItemList()) {
+ if (StringUtils.isBlank(formItemResult.getColumnName())) {
+ continue;
+ }
+
+ Map itemMap = otherSheetItems.getOrDefault(formItemResult.getTableName(), new HashMap<>());
+ otherSheetItems.putIfAbsent(formItemResult.getTableName(), itemMap);
+ if (formItemResult.getItemType().equals("checkbox") || formItemResult.getItemType().equals("select") || formItemResult.getItemType().equals("radio")) {
+ itemMap.put(formItemResult.getColumnName().concat(formItemResult.getColumnNum() == 0 ? "" : formItemResult.getColumnNum().toString()), formItemResult);
+ }
+ if (formItemResult.getChildGroup() != null) {
+ itemMap = otherSheetItems.getOrDefault(formItemResult.getChildGroup().getTableName(), new HashMap<>());
+ otherSheetItems.putIfAbsent(formItemResult.getChildGroup().getTableName(), itemMap);
+ for (FormItemResult2 item2 : formItemResult.getChildGroup().getItemList()) {
+ if (StringUtils.isBlank(item2.getColumnName())) {
+ continue;
+ }
+
+ if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
+ itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItemResult.class));
+ }
+ }
+
+ }
+ }
+ //其他sheet
+
+ for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
+ if (groupItem.getItemList() == null) {
+ continue;
+ }
+ Map itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>());
+ otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap);
+ for (FormItemResult2 formItemResult2 : groupItem.getItemList()) {
+ if (StringUtils.isBlank(formItemResult2.getColumnName())) {
+ continue;
+ }
+ if ("checkbox".equals(formItemResult2.getItemType()) || "select".equals(formItemResult2.getItemType()) || "radio".equals(formItemResult2.getItemType())) {
+ itemMap.put(formItemResult2.getColumnName().concat(formItemResult2.getColumnNum() == 0 ? "" : formItemResult2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItemResult2, FormItemResult.class));
+ }
+ }
+ }
+ return otherSheetItems;
+ }
+
private static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception {
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setContentType("application/vnd.ms-excel");
@@ -397,13 +380,14 @@ public class IcResiUserController {
}
@PostMapping("test")
- public Result>> test(@RequestBody DynamicQueryFormDTO formDTO) {
+ public Result>> test(@LoginUser TokenDto tokenDto,@RequestBody DynamicQueryFormDTO formDTO) {
formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
//formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result>>().ok(icResiUserService.dynamicQuery(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getResultTableName(),
- formDTO.getConditions()));
+ formDTO.getConditions(),
+ tokenDto.getUserId(),null));
}
/**
@@ -431,7 +415,7 @@ public class IcResiUserController {
}
@NotNull
- private CustomerFormResultDTO getResiFormItems(String customerId) {
+ private CustomerFormResultDTO getResiFormAddItems(String customerId) {
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setFormCode("resi_base_info");
queryDTO.setCustomerId(customerId);
@@ -443,6 +427,19 @@ public class IcResiUserController {
return resultForm.getData();
}
+ @NotNull
+ private List getResiFormAllItems(String customerId) {
+ CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
+ queryDTO.setFormCode("resi_base_info");
+ queryDTO.setCustomerId(customerId);
+ Result> resultForm = operCustomizeOpenFeignClient.listItems(queryDTO);
+ if (resultForm == null || !resultForm.success() || resultForm.getData() == null) {
+ throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
+ }
+ System.out.println(JSON.toJSONString(resultForm.getData()));
+ return resultForm.getData();
+ }
+
/**
* @Description 个人信息-家庭关系
* @Param formDTO
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
index 6a872d078d..510c434264 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
@@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.StatsResiListFormDTO;
+import com.epmet.dto.form.StatsResiWarnCountFormDTO;
import com.epmet.dto.form.StatsResiWarnFormDTO;
import com.epmet.dto.result.IcStatsResiResultDTO;
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
@@ -83,7 +84,7 @@ public class StatsResiWarnController {
}
/**
- * 统计
+ * 统计所有
* @return
*/
@PostMapping("resiwarn")
@@ -91,5 +92,11 @@ public class StatsResiWarnController {
statsResiWarnService.resiWarn(tokenDto.getCustomerId());
return new Result();
}
+ @PostMapping("resiWarnByOne")
+ public Result resiWarnByOne(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnCountFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO);
+ statsResiWarnService.resiWarnByOne(tokenDto.getCustomerId(),formDTO.getUserId());
+ return new Result();
+ }
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
index db7344b6ea..fbd753f8fb 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
@@ -100,7 +100,9 @@ public interface IcResiUserDao extends BaseDao {
List