diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 1886bd8300..c79f891d7c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -17,6 +17,7 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.ZoneId; @@ -781,4 +782,22 @@ public class DateUtils { Date nowDate = c.getTime(); return com.epmet.commons.tools.utils.DateUtils.format(nowDate, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); } + + /** + * @Author sun + * @Description 获取当前日期的前一天日期(yyyy-mm-dd) + **/ + public static Date yesterDay() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, -24); + String str = sdf.format(calendar.getTime()); + date = sdf.parse(str); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java index 7ec31acd09..d1fa2f824b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -1,7 +1,6 @@ package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; @@ -17,6 +16,9 @@ import java.util.List; @Data public class ScreenProjectDetailResultDTO implements Serializable { private static final long serialVersionUID = 1L; + private String customerId; + private String projectStatusCode; + /** * 项目id */ @@ -57,7 +59,6 @@ public class ScreenProjectDetailResultDTO implements Serializable { @Data public static class processDTO{ - @JsonIgnore private String processId; /** * 处理部门名称 @@ -85,6 +86,9 @@ public class ScreenProjectDetailResultDTO implements Serializable { @Data public static class AttachmentDTO{ + //ATTACHMENT_ID + private String attachmentId; + @JsonInclude(JsonInclude.Include.NON_NULL) /** * 文件名 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 84e109d3fc..87547a1777 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -17,6 +17,7 @@ import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -60,9 +61,9 @@ public class ScreenProjectController { * @Date 2021/2/24 16:10 */ @PostMapping("projectdistribution") - public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){ + public Result> projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO); - return screenProjectService.projectDistribution(formDTO); + return new Result>().ok(screenProjectService.projectDistribution(formDTO)); } /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index b4b0fe8725..b4154a790a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,12 +1,13 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.commons.tools.utils.Result; -import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; -import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; import java.util.List; @@ -36,7 +37,7 @@ public interface ScreenProjectService { */ List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO); - Result projectDistribution(ScreenProjectDistributionFormDTO formDTO); + List projectDistribution(ScreenProjectDistributionFormDTO formDTO); Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index 0c02e07031..bed88ec3d4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -70,7 +70,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { */ @Override @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) { + public List projectDistribution(ScreenProjectDistributionFormDTO formDTO) { // 1:红色:为刚提交未做任何响应处理未结案的项目; // 2:黄色: 至少做过一次响应处理答复但未结案的项目; // 3:绿色:已经结案的项目。 @@ -82,7 +82,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { formDTO.setPageSize(NumConstant.TWO_HUNDRED); } List resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getPageSize()); - return new Result().ok(resultDTOS); + return resultDTOS; } @Override diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index aa42f30931..f6c6f2b20e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -64,7 +64,9 @@ ALL_CATEGORY_NAME as categoryName, LINK_NAME as reportUserName, link_mobile as mobile, - project_address as reportAddress + project_address as reportAddress, + CUSTOMER_ID as customerId, + PROJECT_STATUS_CODE as projectStatusCode FROM screen_project_data WHERE @@ -84,7 +86,7 @@ PUBLIC_REPLY as suggestion, PROCESS_TIME as reponseTime, operation as operation, - TRANSFER_DEPT_NAME as whistleDeptName + IFNULL(TRANSFER_DEPT_NAME,'') as whistleDeptName from screen_project_process where del_flag = '0' and project_id = #{projectId} @@ -92,6 +94,7 @@ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java index 8292361039..818d5a399c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java @@ -150,6 +150,11 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 */ private Date updatedTime; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + private List members = new ArrayList(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java new file mode 100644 index 0000000000..ce3c23761d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 小组总数-网格日统计-接口入参 + */ +@Data +public class GroupTotalFormDTO implements Serializable { + + private static final long serialVersionUID = -4527492073390715391L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 需要执行的日期(格式:yyyy-MM-dd)2020-01-01 + */ + private String date = ""; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java new file mode 100644 index 0000000000..d840d0510f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * 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; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +public class FactGroupTotalAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 当前组织及下级小组总数 + */ + private Integer groupTotal; + + /** + * 当前组织及下级楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 当前组织及下级支部小组总数 + */ + private Integer branchTotal; + + /** + * 删除标识 未删除: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/stats/FactGroupTotalGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java new file mode 100644 index 0000000000..942888e0cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * 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; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +public class FactGroupTotalGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格下小组总数 + */ + private Integer groupTotal; + + /** + * 网格下楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 网格下支部小组总数 + */ + private Integer branchTotal; + + /** + * 删除标识 未删除: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-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java index e3e70ba31c..9896ae6290 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -1,10 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.service.StatsGroupService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * @Author zxc @@ -56,4 +61,25 @@ public class StatsGroupController { return new Result(); } + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + @PostMapping("gridgrouptotal") + public Result gridGroupTotal(@RequestBody(required = false) GroupTotalFormDTO formDTO) { + statsGroupService.gridGroupTotal(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + @PostMapping("agencygrouptotal") + public Result agencyGroupTotal(@RequestBody(required = false) GroupTotalFormDTO formDTO) { + statsGroupService.agencyGroupTotal(formDTO); + return new Result(); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 32059b58b3..0e29f1530a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -6,6 +6,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.group.ResiGroupEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -90,4 +91,10 @@ public interface GroupDataDao { * @date 2020.09.18 22:45 **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); + + /** + * @Author sun + * @Description 查询客户下有效群组列表 + **/ + List selectCustomerGroupList(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java new file mode 100644 index 0000000000..a38c1d00b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Mapper +public interface FactGroupTotalAgencyDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java new file mode 100644 index 0000000000..cf88536956 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Mapper +public interface FactGroupTotalGridDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java new file mode 100644 index 0000000000..138bfba563 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java @@ -0,0 +1,95 @@ +/** + * 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.group; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群组信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group") +public class ResiGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 群头像(htt://地址) + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 群介绍 + */ + private String groupIntroduction; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String state; + + /** + * 最新话题时间 + */ + private Date latestTopicPublishDate; + + /** + * 进组审核open开启;close关闭 + */ + private String auditSwitch; + + /** + * VISIT_SWITCH 小组是否允许参观:允许:open;不允许:closed + */ + private String visitSwitch; + + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + + /** + * 小组等级 + */ + private Integer level; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java new file mode 100644 index 0000000000..814c9abd6a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java @@ -0,0 +1,96 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_total_agency_daily") +public class FactGroupTotalAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 当前组织及下级小组总数 + */ + private Integer groupTotal; + + /** + * 当前组织及下级楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 当前组织及下级支部小组总数 + */ + private Integer branchTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java new file mode 100644 index 0000000000..995fe3fbb5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java @@ -0,0 +1,96 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_total_grid_daily") +public class FactGroupTotalGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格下小组总数 + */ + private Integer groupTotal; + + /** + * 网格下楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 网格下支部小组总数 + */ + private Integer branchTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 10bb4f3a46..1fcb3da75b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; /** * @Author zxc @@ -26,4 +27,15 @@ public interface StatsGroupService { */ void groupAgencyMonthly(GroupStatsFormDTO formDTO); + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + void gridGroupTotal(GroupTotalFormDTO formDTO); + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + void agencyGroupTotal(GroupTotalFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 4e53c3db97..127479f37e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -879,10 +879,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { m.setServiceAblity(monthCountBd.multiply(m.getServiceAblity())); m.setGovernAblity(monthCountBd.multiply(m.getGovernAblity())); }else { - m.setIndexTotal(monthCountBd.multiply(m.getIndexTotal()).divide(selfCount)); - m.setPartyDevAblity(monthCountBd.multiply(m.getPartyDevAblity()).divide(selfCount)); - m.setServiceAblity(monthCountBd.multiply(m.getServiceAblity()).divide(selfCount)); - m.setGovernAblity(monthCountBd.multiply(m.getGovernAblity()).divide(selfCount)); + m.setIndexTotal(monthCountBd.multiply(m.getIndexTotal()).divide(selfCount,NumConstant.SIX,BigDecimal.ROUND_HALF_UP)); + m.setPartyDevAblity(monthCountBd.multiply(m.getPartyDevAblity()).divide(selfCount,NumConstant.SIX,BigDecimal.ROUND_HALF_UP)); + m.setServiceAblity(monthCountBd.multiply(m.getServiceAblity()).divide(selfCount,NumConstant.SIX,BigDecimal.ROUND_HALF_UP)); + m.setGovernAblity(monthCountBd.multiply(m.getGovernAblity()).divide(selfCount,NumConstant.SIX,BigDecimal.ROUND_HALF_UP)); } } }); 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 501bfa2c43..baf94d5929 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 @@ -123,12 +123,12 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl param) { - if (param.getIsFirst()) { + /*if (param.getIsFirst()) { int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); while (affectedRows > 0) { affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); } - } + }*/ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date today = new Date(); param.getDataList().forEach(item -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java index 95206d2fd4..445183e466 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEnt import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; @@ -122,21 +123,24 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl 0) { affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); } - } + }*/ List processIdList = param.getDataList().stream().map(ScreenProjectProcessFormDTO :: getProcessId).collect(Collectors.toList()).stream().distinct() .collect(Collectors.toList()); if (CollectionUtils.isEmpty(processIdList)){ return; } - //删除旧数据 - baseDao.deleteByProcessIds(param.getCustomerId(), processIdList); - screenProjectProcessAttachmentDao.deleteByProcessIds(param.getCustomerId(), processIdList); + Lists.partition(processIdList, NumConstant.TWO_HUNDRED).forEach(list -> { + //删除旧数据 + baseDao.deleteByProcessIds(param.getCustomerId(), list); + screenProjectProcessAttachmentDao.deleteByProcessIds(param.getCustomerId(), list); + }); + List attachmentList = new ArrayList<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java index 8b58a474b5..1476600147 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java @@ -85,12 +85,14 @@ public class ScreenUserJoinServiceImpl extends BaseServiceImpl lastMonthJoinList.size()){ lastJoinEntity = new ScreenUserJoinEntity(); lastJoinEntity.setJoinTotal(NumConstant.ZERO); lastJoinEntity.setAvgIssue(NumConstant.ZERO_DECIMAL); lastJoinEntity.setAvgJoin(NumConstant.ZERO_DECIMAL); + }else{ + lastJoinEntity = lastMonthJoinList.get(i); } entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastJoinEntity.getJoinTotal(), list.get(j).getJoinTotal())); entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastJoinEntity.getJoinTotal(), list.get(j).getJoinTotal())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 38e291d420..e971566233 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -2,6 +2,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -66,4 +67,9 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); + /** + * @Author sun + * @Description 查询客户下有效群组列表 + **/ + List getGroupListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index b7875982d5..ca2c54b87d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; @@ -211,4 +212,14 @@ public class GroupDataServiceImpl implements GroupDataService { } + /** + * @Author sun + * @Description 查询客户下有效群组列表 + **/ + @Override + public List getGroupListByCustomerId(String customerId) { + return groupDataDao.selectCustomerGroupList(customerId); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 5e4fde3280..4be803a4a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -6,9 +6,14 @@ import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; @@ -20,11 +25,13 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -50,6 +57,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { private DimCustomerService dimCustomerService; @Autowired private CustomerGridService customerGridService; + @Autowired + private DimGridService dimGridService; + @Autowired + private FactGroupTotalGridDailyService factGroupTotalGridDailyService; + @Autowired + private FactGroupTotalAgencyDailyService factGroupTotalAgencyDailyService; /** * @param @@ -333,4 +346,241 @@ public class StatsGroupServiceImpl implements StatsGroupService { return DimIdGenerator.getDimIdBean(result); } + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + @Override + public void gridGroupTotal(GroupTotalFormDTO formDTO) { + Date date = DateUtils.yesterDay(); + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户网格-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + gridGroupStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取有效客户列表 + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计网格-小组总数日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + gridGroupStats(customerId, date); + } catch (Exception e) { + log.error("小组总数-网格日统计-程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 小组总数-网格日统计数据 + **/ + private void gridGroupStats(String customerId, Date date) { + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3.根据客户Id查询客户下有效的群组列表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); + List groupList = groupDataService.getGroupListByCustomerId(customerId); + + //4.分别计算每个网格下审核通过的小组数据 + List list = new ArrayList<>(); + dimGridList.forEach(grid -> { + FactGroupTotalGridDailyEntity entity = new FactGroupTotalGridDailyEntity(); + AtomicInteger total = new AtomicInteger(0); + AtomicInteger ordinary = new AtomicInteger(0); + AtomicInteger branch = new AtomicInteger(0); + groupList.forEach(group -> { + if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getState())) { + + total.addAndGet(1); + if ("ordinary".equals(group.getGroupType())) { + ordinary.addAndGet(1); + } + if ("branch".equals(group.getGroupType())) { + branch.addAndGet(1); + } + } + }); + //封装数据 + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupTotal(total.get()); + entity.setOrdinaryTotal(ordinary.get()); + entity.setBranchTotal(branch.get()); + list.add(entity); + }); + + //5.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactGroupTotalGridDailyEntity delEntity = new FactGroupTotalGridDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalGridDailyService.delDateGroupTotal(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsGroupServiceImpl.customerGridStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalGridDailyService.insertBatch(list); + } + + } + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + @Override + public void agencyGroupTotal(GroupTotalFormDTO formDTO) { + Date date = DateUtils.yesterDay(); + //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户组织下-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + agencyGroupStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计机关-小组总数日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + agencyGroupStats(customerId, date); + } catch (Exception e) { + log.error("小组总数-机关日统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 小组总数-机关日统计数据 + **/ + private void agencyGroupStats(String customerId, Date date) { + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + //3.根据客户Id查询网格维度表数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + + //4.根据客户Id查询客户下有效的群组列表数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); + List groupList = groupDataService.getGroupListByCustomerId(customerId); + + List list = new ArrayList<>(); + //5.遍历组织维度数据分别计算每个组织下群组数据 + agencyList.forEach(agency->{ + FactGroupTotalAgencyDailyEntity entity = new FactGroupTotalAgencyDailyEntity(); + //5-1.汇总组织及所有下级组织列表 + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + agencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + + //5-2.汇总组织及下级所有的网格列表 + List agencyGridList = new ArrayList<>(); + gridList.forEach(grid->{ + if (map.containsKey(grid.getAgencyId())) { + agencyGridList.add(grid.getId()); + } + }); + + AtomicInteger total = new AtomicInteger(0); + AtomicInteger ordinary = new AtomicInteger(0); + AtomicInteger branch = new AtomicInteger(0); + //5-3.根据汇总的网格列表统计对应的群组数据 + agencyGridList.forEach(gridId -> { + groupList.forEach(group -> { + if (gridId.equals(group.getGridId()) && "approved".equals(group.getState())) { + total.addAndGet(1); + if ("ordinary".equals(group.getGroupType())) { + ordinary.addAndGet(1); + } + if ("branch".equals(group.getGroupType())) { + branch.addAndGet(1); + } + } + }); + }); + //封装数据 + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupTotal(total.get()); + entity.setOrdinaryTotal(ordinary.get()); + entity.setBranchTotal(branch.get()); + list.add(entity); + }); + + //6.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactGroupTotalAgencyDailyEntity delEntity = new FactGroupTotalAgencyDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalAgencyDailyService.delDateGroupTotal(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalAgencyDailyService.insertBatch(list); + } + + + } + + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java new file mode 100644 index 0000000000..602b0092f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java @@ -0,0 +1,101 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FactGroupTotalAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +public interface FactGroupTotalAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupTotalAgencyDailyDTO + * @author generator + * @date 2021-05-10 + */ + FactGroupTotalAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void save(FactGroupTotalAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void update(FactGroupTotalAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-10 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java new file mode 100644 index 0000000000..fef3b0328c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java @@ -0,0 +1,101 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FactGroupTotalGridDailyDTO; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +public interface FactGroupTotalGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupTotalGridDailyDTO + * @author generator + * @date 2021-05-10 + */ + FactGroupTotalGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void save(FactGroupTotalGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void update(FactGroupTotalGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-10 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..d10940fcc3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java @@ -0,0 +1,108 @@ +/** + * 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.stats.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.stats.FactGroupTotalAgencyDailyDao; +import com.epmet.dto.FactGroupTotalAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import com.epmet.service.stats.FactGroupTotalAgencyDailyService; +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-05-10 + */ +@Service +public class FactGroupTotalAgencyDailyServiceImpl extends BaseServiceImpl implements FactGroupTotalAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupTotalAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupTotalAgencyDailyDTO.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 FactGroupTotalAgencyDailyDTO get(String id) { + FactGroupTotalAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupTotalAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupTotalAgencyDailyDTO dto) { + FactGroupTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupTotalAgencyDailyDTO dto) { + FactGroupTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity) { + baseDao.delDateGroupTotal(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java new file mode 100644 index 0000000000..f8aa5d5afe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java @@ -0,0 +1,108 @@ +/** + * 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.stats.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.stats.FactGroupTotalGridDailyDao; +import com.epmet.dto.FactGroupTotalGridDailyDTO; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; +import com.epmet.service.stats.FactGroupTotalGridDailyService; +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-05-10 + */ +@Service +public class FactGroupTotalGridDailyServiceImpl extends BaseServiceImpl implements FactGroupTotalGridDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupTotalGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupTotalGridDailyDTO.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 FactGroupTotalGridDailyDTO get(String id) { + FactGroupTotalGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupTotalGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupTotalGridDailyDTO dto) { + FactGroupTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupTotalGridDailyDTO dto) { + FactGroupTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity) { + baseDao.delDateGroupTotal(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql new file mode 100644 index 0000000000..a4e1300cdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql @@ -0,0 +1,3 @@ +ALTER TABLE `fact_origin_group_main_daily` +ADD COLUMN `GROUP_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小组类型(ordinary:楼院小组 branch:支部小组)' AFTER `GROUP_STATE`; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index db5dc8b583..3107a108d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -139,6 +139,7 @@ id, customer_id, group_state, + group_type, grid_id, agency_id, parent_id, @@ -165,6 +166,7 @@ #{item.id}, #{item.customerId}, #{item.groupState}, + #{item.groupType}, #{item.gridId}, #{item.agencyId}, #{item.parentId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 4ec21cd214..096b309c89 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -186,7 +186,8 @@ oper.UPDATED_TIME AS joinDate, IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag, groupp.CREATED_BY AS groupOwnerId, - IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode + IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode, + groupp.group_type AS groupType FROM RESI_GROUP groupp @@ -226,4 +227,14 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..618a957a95 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_group_total_agency_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml new file mode 100644 index 0000000000..689f3f5820 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_group_total_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.11__groupAchievementRule.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.11__groupAchievementRule.sql index c249201058..c039cf9076 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.11__groupAchievementRule.sql +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.11__groupAchievementRule.sql @@ -1 +1,2 @@ -INSERT INTO `epmet_point`.`point_rule_default`(`ID`, `RULE_NAME`, `RULE_DESC`, `EVENT_CODE`, `FUNCTION_ID`, `OPERATE_TYPE`, `UP_LIMIT`, `UP_LIMIT_DESC`, `UP_LIMIT_PREFIX`, `RULE_PERIOD`, `POINT`, `POINT_UNIT`, `ENABLED_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', '组长解决话题', '组长解决组内话题', 'leader_resolve_topic', '1', 'plus', 0, '无上限', NULL, 'day', 2, 'time', '0', '0', 0, 'APP_USER', '2021-04-19 15:55:18', 'APP_USER', '2021-04-19 15:55:18'); +#INSERT INTO `epmet_point`.`point_rule_default`(`ID`, `RULE_NAME`, `RULE_DESC`, `EVENT_CODE`, `FUNCTION_ID`, `OPERATE_TYPE`, `UP_LIMIT`, `UP_LIMIT_DESC`, `UP_LIMIT_PREFIX`, `RULE_PERIOD`, `POINT`, `POINT_UNIT`, `ENABLED_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', '组长解决话题', '组长解决组内话题', 'leader_resolve_topic', '1', 'plus', 0, '无上限', NULL, 'day', 2, 'time', '0', '0', 0, 'APP_USER', '2021-04-19 15:55:18', 'APP_USER', '2021-04-19 15:55:18'); +select 1;