diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/StaffPatrolStatsFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/StaffPatrolStatsFormDTO.java
new file mode 100644
index 0000000000..252162a682
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/StaffPatrolStatsFormDTO.java
@@ -0,0 +1,22 @@
+package com.epmet.dto.extract.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * desc: 工作人员巡查统计参数
+ *
+ * @author LiuJanJun
+ * @date 2021/6/29 10:19 上午
+ */
+@Data
+public class StaffPatrolStatsFormDTO implements Serializable {
+
+ private static final long serialVersionUID = -3639860733213306581L;
+ private String customerId;
+ private String dateId;
+ private String staffId;
+ private String gridId;
+ private String roleType;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java
new file mode 100644
index 0000000000..a5458793dd
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java
@@ -0,0 +1,137 @@
+/**
+ * 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.user.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 政府工作人员表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-18
+ */
+@Data
+public class CustomerStaffDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 关联User表的主键Id
+ */
+ private String userId;
+
+ /**
+ * 真实姓名
+ */
+ private String realName;
+
+ /**
+ * 性别0.未知,1男,2.女
+ */
+ private Integer gender;
+
+ /**
+ * 邮箱
+ */
+ private String email;
+
+ /**
+ * 手机号-唯一键
+ */
+ private String mobile;
+
+ /**
+ * 地址
+ */
+ private String address;
+
+ /**
+ * 删除标识
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * fulltime专职parttime兼职
+ */
+ private String workType;
+
+ /**
+ * 头像
+ */
+ private String headPhoto;
+
+ /**
+ * inactive未激活,active已激活
+ */
+ private String activeFlag;
+
+ /**
+ * 激活时间
+ */
+ private Date activeTime;
+
+ /**
+ * 未禁用enable,已禁用diabled
+ */
+ private String enableFlag;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 角色名称
+ */
+ private String roleName;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java
new file mode 100644
index 0000000000..ad8c156e77
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java
@@ -0,0 +1,147 @@
+/**
+ * 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.user.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * [天]工作人员巡查记录统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-06-29
+ */
+@Data
+public class StatsStaffPatrolRecordDailyDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 统计日期 关联日期dim表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 工作人员所属组织id=网格所属的组织id
+ */
+ private String agencyId;
+
+ /**
+ * 网格所有上级id
+ */
+ private String gridPids;
+
+ /**
+ * 工作人员用户id
+ */
+ private String staffId;
+
+ /**
+ * 巡查次数
+ */
+ private Integer patrolTotal;
+
+ /**
+ * 巡查时长 单位:秒
+ */
+ private Integer totalTime;
+
+ /**
+ * 巡查期间直接立项项目数
+ */
+ private Integer reportProjectCount;
+
+ /**
+ * 最新的巡查开始时间
+ */
+ private Date latestPatrolTime;
+
+ /**
+ * 最新的巡查状态 正在巡查中:patrolling;结束:end
+ */
+ private String latestPatrolStatus;
+
+ /**
+ * 删除标识 0.未删除 1.已删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BizDataStatsController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BizDataStatsController.java
new file mode 100644
index 0000000000..94e30fb994
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BizDataStatsController.java
@@ -0,0 +1,35 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
+import com.epmet.service.evaluationindex.extract.biz.BizDataStatsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description 用户统计
+ * @ClassName StatsUserController
+ * @Auth wangc
+ * @Date 2020-06-23 15:18
+ */
+@RestController
+@RequestMapping("bizData/stats")
+public class BizDataStatsController {
+
+ @Autowired
+ private BizDataStatsService bizDataStatsService;
+
+ /**
+ * @return com.epmet.commons.tools.utils.Result
+ * @param formDTO
+ * @description 工作端数据一期,用户分析:参与用户、注册用户分析
+ * @Date 2021/3/26 13:27
+ **/
+ @RequestMapping("patrol")
+ public Result execute(@RequestBody StaffPatrolStatsFormDTO formDTO) {
+ bizDataStatsService.initStaffPatrolStats(formDTO);
+ return new Result();
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerStaffGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerStaffGridDao.java
new file mode 100644
index 0000000000..171f45db3c
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerStaffGridDao.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.org;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.entity.org.CustomerStaffGridEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 客户网格人员关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Mapper
+public interface CustomerStaffGridDao extends BaseDao {
+
+ List selectGridStaffList(StaffPatrolStatsFormDTO formDTO);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/StatsStaffPatrolRecordDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/StatsStaffPatrolRecordDailyDao.java
new file mode 100644
index 0000000000..60176314f3
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/StatsStaffPatrolRecordDailyDao.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.user;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.entity.user.StatsStaffPatrolRecordDailyEntity;
+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-06-29
+ */
+@Mapper
+public interface StatsStaffPatrolRecordDailyDao extends BaseDao {
+
+ Integer insertBatch(@Param("list") List insertList);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
index dabacfd7da..608fe55e3f 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
@@ -1,9 +1,12 @@
package com.epmet.dao.user;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
+import com.epmet.dto.user.result.CustomerStaffDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -159,5 +162,17 @@ public interface UserDao {
* @date 2021/6/8 5:21 下午
*/
List selectStaffInfo(@Param("list") List staffUserIdList);
+
+ /**
+ * desc: 根据角色key条件获取所有的人
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author LiuJanJun
+ * @date 2021/6/29 2:58 下午
+ */
+ List selectUserByRoleKey(StaffPatrolStatsFormDTO formDTO);
+
+ List selectLastStaffPatrolList(StaffPatrolStatsFormDTO formDTO);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerStaffGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerStaffGridEntity.java
new file mode 100644
index 0000000000..bb94ef3ff2
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerStaffGridEntity.java
@@ -0,0 +1,40 @@
+/**
+ * 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.org;
+
+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 2020-03-16
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("customer_staff_grid")
+public class CustomerStaffGridEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+ private String customerId;
+ private String gridId;
+ private String userId;
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java
new file mode 100644
index 0000000000..9425887126
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java
@@ -0,0 +1,116 @@
+/**
+ * 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.user;
+
+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-06-29
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("stats_staff_patrol_record_daily")
+public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 统计日期 关联日期dim表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 工作人员所属组织id=网格所属的组织id
+ */
+ private String agencyId;
+
+ /**
+ * 网格所有上级id
+ */
+ private String gridPids;
+
+ /**
+ * 工作人员用户id
+ */
+ private String staffId;
+
+ /**
+ * 巡查次数
+ */
+ private Integer patrolTotal;
+
+ /**
+ * 巡查时长 单位:秒
+ */
+ private Integer totalTime;
+
+ /**
+ * 巡查期间直接立项项目数
+ */
+ private Integer reportProjectCount;
+
+ /**
+ * 最新的巡查开始时间
+ */
+ private Date latestPatrolTime;
+
+ /**
+ * 最新的巡查状态 正在巡查中:patrolling;结束:end
+ */
+ private String latestPatrolStatus;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/BizDataStatsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/BizDataStatsService.java
new file mode 100644
index 0000000000..c644f2393e
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/BizDataStatsService.java
@@ -0,0 +1,31 @@
+/**
+ * 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.extract.biz;
+
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
+
+/**
+ * [天]工作人员巡查记录统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-06-29
+ */
+public interface BizDataStatsService {
+
+ void initStaffPatrolStats(StaffPatrolStatsFormDTO formDTO);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java
new file mode 100644
index 0000000000..ad796d528c
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java
@@ -0,0 +1,87 @@
+package com.epmet.service.evaluationindex.extract.biz.impl;
+
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
+import com.epmet.dto.user.result.CustomerStaffDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.service.evaluationindex.extract.biz.BizDataStatsService;
+import com.epmet.service.org.CustomerStaffService;
+import com.epmet.service.user.StatsStaffPatrolService;
+import com.epmet.service.user.UserService;
+import com.epmet.util.DimIdGenerator;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * desc:【天】网格员巡查统计
+ *
+ * @author: LiuJanJun
+ * @date: 2021/6/29 3:08 下午
+ * @version: 1.0
+ */
+@Slf4j
+@Service
+public class BizDataStatsServiceImpl implements BizDataStatsService {
+ @Autowired
+ private CustomerStaffService customerStaffService;
+ @Autowired
+ private UserService userService;
+ @Autowired
+ private StatsStaffPatrolService statsStaffPatrolService;
+
+ @Override
+ public void initStaffPatrolStats(StaffPatrolStatsFormDTO formDTO) {
+ //获取所有的网格员
+ //1.获取所有网格用户
+ List allStaffList = customerStaffService.selectStaffGridList(formDTO);
+ /* if (CollectionUtils.isEmpty(allStaffList)){
+ log.warn("reloadStaffPatrolStats customerId:{} have any staff,param:{}",formDTO.getCustomerId(), JSON.toJSONString(formDTO));
+ return
+ }*/
+ //获取所有含有网格员角色的用户
+ List gridMemberList = userService.selectUserListByRoleKey(formDTO);
+ /*if (CollectionUtils.isEmpty(gridMemberList)){
+ log.warn("reloadStaffPatrolStats customerId:{} have any gridMembers,param:{}",formDTO.getCustomerId(), JSON.toJSONString(formDTO));
+ return
+ }*/
+
+ List lastStaffPatrolList = userService.selectLastStaffPatrolList(formDTO);
+ Map lastPatrolMap = lastStaffPatrolList.stream().collect(Collectors.toMap(o -> o.getGridId() + o.getStaffId(), o -> o, (o1, o2) -> o1));
+ //构建数据 插入
+ List insertList = new ArrayList<>();
+ DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(new Date());
+ allStaffList.forEach(gridStaff -> {
+ gridStaff.setDateId(dimIdBean.getDateId());
+ gridStaff.setWeekId(dimIdBean.getWeekId());
+ gridStaff.setQuarterId(dimIdBean.getQuarterId());
+ gridStaff.setYearId(dimIdBean.getYearId());
+ gridStaff.setMonthId(dimIdBean.getMonthId());
+ StatsStaffPatrolRecordDailyDTO recordDailyDTO = lastPatrolMap.get(gridStaff.getGridId().concat(gridStaff.getStaffId()));
+
+ gridStaff.setTotalTime(NumConstant.ZERO);
+ gridStaff.setPatrolTotal(NumConstant.ZERO);
+ gridStaff.setLatestPatrolStatus("end");
+ //最后巡查时间
+ gridStaff.setLatestPatrolTime(null);
+ if (recordDailyDTO != null) {
+ gridStaff.setLatestPatrolStatus(recordDailyDTO.getLatestPatrolStatus());
+ gridStaff.setLatestPatrolTime(recordDailyDTO.getLatestPatrolTime());
+ }
+
+ gridMemberList.forEach(gridMember -> {
+ if (gridStaff.getStaffId().equals(gridMember.getUserId())) {
+ insertList.add(gridStaff);
+ }
+ });
+ });
+ Integer effectRow = statsStaffPatrolService.insertBatch(insertList);
+ log.debug("initStaffPatrolStats insert rows:{}", effectRow);
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerStaffService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerStaffService.java
new file mode 100644
index 0000000000..f498bbfe9c
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerStaffService.java
@@ -0,0 +1,22 @@
+package com.epmet.service.org;
+
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+
+import java.util.List;
+
+/**
+ * @author liujianjun
+ */
+public interface CustomerStaffService {
+
+ /**
+ * desc: 条件获取 网格下的所有人
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author LiuJanJun
+ * @date 2021/6/29 3:13 下午
+ */
+ List selectStaffGridList(StaffPatrolStatsFormDTO formDTO);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerStaffServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerStaffServiceImpl.java
new file mode 100644
index 0000000000..fc11765d10
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerStaffServiceImpl.java
@@ -0,0 +1,39 @@
+package com.epmet.service.org.impl;
+
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.org.CustomerStaffGridDao;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.service.org.CustomerStaffService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * desc:
+ *
+ * @author: LiuJanJun
+ * @date: 2021/6/29 3:14 下午
+ * @version: 1.0
+ */
+@Service
+@DataSource(DataSourceConstant.GOV_ORG)
+public class CustomerStaffServiceImpl implements CustomerStaffService {
+ @Autowired
+ private CustomerStaffGridDao customerStaffGridDao;
+
+ /**
+ * desc: 条件获取 网格下的所有人
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author LiuJanJun
+ * @date 2021/6/29 3:13 下午
+ */
+ @Override
+ public List selectStaffGridList(StaffPatrolStatsFormDTO formDTO) {
+ return customerStaffGridDao.selectGridStaffList(formDTO);
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/StatsStaffPatrolService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/StatsStaffPatrolService.java
new file mode 100644
index 0000000000..430a46defd
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/StatsStaffPatrolService.java
@@ -0,0 +1,13 @@
+package com.epmet.service.user;
+
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+
+import java.util.List;
+
+/**
+ * @author liujianjun
+ */
+public interface StatsStaffPatrolService {
+
+ Integer insertBatch(List insertList);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
index ebc01ebdb3..aecbe35158 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
@@ -2,9 +2,12 @@ package com.epmet.service.user;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
import com.epmet.dto.org.result.OrgStaffDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.stats.user.result.UserStatisticalData;
+import com.epmet.dto.user.result.CustomerStaffDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.util.DimIdGenerator;
@@ -94,4 +97,16 @@ public interface UserService {
* @return com.epmet.dto.user.OrgGridManagerTotalDTO
*/
Map queryOrgGridManager(String customerId,List orgStaffDTOList);
+
+ /**
+ * desc: 请描述类的业务用途
+ *
+ * @param formDTO
+ * @return
+ * @author LiuJanJun
+ * @date 2021/6/29 10:15 上午
+ */
+ List selectUserListByRoleKey(StaffPatrolStatsFormDTO formDTO);
+
+ List selectLastStaffPatrolList(StaffPatrolStatsFormDTO formDTO);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java
new file mode 100644
index 0000000000..a4004de4d0
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java
@@ -0,0 +1,32 @@
+package com.epmet.service.user.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.user.StatsStaffPatrolRecordDailyDao;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.service.user.StatsStaffPatrolService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * desc:
+ *
+ * @author: LiuJanJun
+ * @date: 2021/6/30 8:33 上午
+ * @version: 1.0
+ */
+@DataSource(DataSourceConstant.EPMET_USER)
+@Service
+public class StatsStaffPatrolServiceImpl implements StatsStaffPatrolService {
+ @Autowired
+ private StatsStaffPatrolRecordDailyDao statsStaffPatrolRecordDailyDao;
+
+ @Override
+ public Integer insertBatch(List insertList) {
+ System.out.println("=====:"+JSON.toJSONString(insertList));
+ return statsStaffPatrolRecordDailyDao.insertBatch(insertList);
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
index 59897628e3..27ee9b6eb8 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
@@ -6,15 +6,19 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ExtractConstant;
import com.epmet.constant.ProjectConstant;
+import com.epmet.constant.RoleKeyConstants;
import com.epmet.dao.user.UserDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
+import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.org.result.OrgStaffDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
+import com.epmet.dto.user.result.CustomerStaffDTO;
+import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
@@ -797,4 +801,15 @@ public class UserServiceImpl implements UserService {
return resultMap;
}
+ @Override
+ public List selectUserListByRoleKey(StaffPatrolStatsFormDTO formDTO) {
+ formDTO.setRoleType(RoleKeyConstants.ROLE_KEY_GRID_MEMBER);
+ return userDao.selectUserByRoleKey(formDTO);
+ }
+
+ @Override
+ public List selectLastStaffPatrolList(StaffPatrolStatsFormDTO formDTO) {
+ return userDao.selectLastStaffPatrolList(formDTO);
+ }
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerStaffGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerStaffGridDao.xml
new file mode 100644
index 0000000000..5e41b9e84d
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerStaffGridDao.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+ SELECT
+ sg.customer_id,
+ sg.user_id AS staffId,
+ sg.grid_id,
+ grid.grid_name,
+ grid.PID agencyId,
+ grid.PIDS gridPids
+ FROM
+ customer_staff_grid sg
+ LEFT JOIN customer_grid grid ON grid.id = sg.grid_id
+ WHERE
+ sg.del_flag = '0'
+
+ AND sg.customer_id = #{customerId}
+
+
+ AND sg.GRID_ID = #{gridId}
+
+
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml
new file mode 100644
index 0000000000..cba48614f3
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+ insert into stats_staff_patrol_record_daily
+ (
+ ID,
+ CUSTOMER_ID,
+ DATE_ID,
+ WEEK_ID,
+ MONTH_ID,
+ YEAR_ID,
+ QUARTER_ID,
+ GRID_ID,
+ AGENCY_ID,
+ GRID_PIDS,
+ STAFF_ID,
+ PATROL_TOTAL,
+ TOTAL_TIME,
+ REPORT_PROJECT_COUNT,
+ LATEST_PATROL_TIME,
+ LATEST_PATROL_STATUS,
+ DEL_FLAG,
+ REVISION,
+ CREATED_BY,
+ CREATED_TIME,
+ UPDATED_BY,
+ UPDATED_TIME
+ ) values
+
+ (
+ (SELECT REPLACE(UUID(), '-', '') AS id),
+ #{item.customerId},
+ #{item.dateId},
+ #{item.weekId},
+ #{item.monthId},
+ #{item.yearId},
+ #{item.quarterId},
+ #{item.gridId},
+ #{item.agencyId},
+ #{item.gridPids},
+ #{item.staffId},
+ #{item.patrolTotal},
+ #{item.totalTime},
+ #{item.reportProjectCount},
+ #{item.latestPatrolTime},
+ #{item.latestPatrolStatus},
+ '0',
+ 0,
+ 'APP_USER',
+ now(),
+ 'APP_USER',
+ now()
+ )
+
+
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
index acb6c9feb3..578d20590a 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
@@ -570,4 +570,34 @@
user_id = #{userId}
+
+ SELECT DISTINCT
+ s.USER_ID,
+ s.*,
+ gsr.ROLE_NAME
+ FROM
+ customer_staff s
+ LEFT JOIN staff_role sr ON sr.STAFF_ID = s.USER_ID
+ AND sr.CUSTOMER_ID = s.CUSTOMER_ID
+ LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID
+ WHERE
+ s.del_flag = '0'
+ AND gsr.ROLE_KEY = 'grid_member'
+
+
+ SELECT
+ t.STAFF_ID,
+ t.GRID gridId,
+ t.PATROL_START_TIME latestPatrolTime,
+ t.STATUS latestPatrolStatus
+ FROM
+ ( SELECT GRID, STAFF_ID, max( CREATED_TIME ) AS CREATED_TIME FROM staff_patrol_record GROUP BY GRID, STAFF_ID ) a
+ LEFT JOIN staff_patrol_record t ON t.GRID = a.GRID
+ AND t.STAFF_ID = a.STAFF_ID
+ AND t.CREATED_TIME = a.CREATED_TIME
+ WHERE
+ a.del_flag = '0'
+ AND a.CUSTOMER_ID = #{customerId}
+
+
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/PatrolProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/PatrolProjectFormDTO.java
new file mode 100644
index 0000000000..c5add855bb
--- /dev/null
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/PatrolProjectFormDTO.java
@@ -0,0 +1,29 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/7/1 10:10 上午
+ * @DESC
+ */
+@Data
+public class PatrolProjectFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 7244072033926913678L;
+
+ private String userId;
+
+ /**
+ * 巡查开始时间
+ */
+ private Date patrolStartTime;
+
+ /**
+ * 巡查结束时间
+ */
+ private Date patrolEndTime;
+}
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
index e3246e8bae..7bd2b95f31 100644
--- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
@@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.ProjectDTO;
-import com.epmet.dto.form.DelCategoryFormDTO;
-import com.epmet.dto.form.ProcessListFormDTO;
-import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO;
-import com.epmet.dto.form.ProjectListFromDTO;
+import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
@@ -86,4 +83,13 @@ public interface GovProjectOpenFeignClient {
**/
@PostMapping("gov/project/projectcategory/getprojectcategorylist")
Result> getProjectCategoryList(@RequestBody DelCategoryFormDTO formDTO);
+
+ /**
+ * @Description 查询巡查期间的立项数
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/7/1 10:16 上午
+ */
+ @PostMapping("gov/project/project/patrolproject")
+ Result selectPatrolProject(@RequestBody PatrolProjectFormDTO formDTO);
}
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
index f03dabfef1..cb2dbf1abd 100644
--- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
@@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.ProjectDTO;
-import com.epmet.dto.form.DelCategoryFormDTO;
-import com.epmet.dto.form.ProcessListFormDTO;
-import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO;
-import com.epmet.dto.form.ProjectListFromDTO;
+import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
@@ -78,4 +75,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli
public Result> getProjectCategoryList(DelCategoryFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getProjectCategoryList", formDTO);
}
+
+ @Override
+ public Result selectPatrolProject(PatrolProjectFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "selectPatrolProject", formDTO);
+ }
}
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
index 60257a5e4d..1c1460b3cb 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
@@ -222,4 +222,16 @@ public class ProjectController {
projectService.platformCallBack(formDTO);
return new Result();
}
+
+ /**
+ * @Description 查询巡查期间的立项数
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/7/1 10:16 上午
+ */
+ @PostMapping("patrolproject")
+ public Result selectPatrolProject(@RequestBody PatrolProjectFormDTO formDTO){
+ return new Result().ok(projectService.selectPatrolProject(formDTO));
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
index 2c2fe53f31..38176df2ad 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
@@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.LatestListFormDTO;
+import com.epmet.dto.form.PatrolProjectFormDTO;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.form.ShiftProjectsFromDTO;
import com.epmet.dto.result.*;
@@ -164,4 +165,12 @@ public interface ProjectDao extends BaseDao {
* @date 2021/5/14 1:59 下午
*/
List selectProjectIdByTime(@Param("agencyId")String agencyId,@Param("endDate")Integer endDate,@Param("startDate")Integer startDate);
+
+ /**
+ * @Description 查询巡查期间的立项数
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/7/1 10:16 上午
+ */
+ Integer selectPatrolProject(PatrolProjectFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
index 67112ab5d4..f04d8f050a 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
@@ -295,4 +295,12 @@ public interface ProjectService extends BaseService {
* @return void
*/
void platformCallBack(PlatformCallBackFormDTO formDTO);
+
+ /**
+ * @Description 查询巡查期间的立项数
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/7/1 10:16 上午
+ */
+ Integer selectPatrolProject(PatrolProjectFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
index 2c1f91bc3b..953104da7b 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
@@ -2694,4 +2694,15 @@ public class ProjectServiceImpl extends BaseServiceImpl
+
+
+ SELECT
+ COUNT(1)
+ FROM
+ project
+ WHERE DEL_FLAG = '0'
+ AND CREATED_TIME BETWEEN #{patrolStartTime} AND #{patrolEndTime}
+ AND ORIGIN = 'agency'
+ AND CREATED_BY = #{userId}
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java
new file mode 100644
index 0000000000..43a8cdf336
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java
@@ -0,0 +1,146 @@
+/**
+ * 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-06-30
+ */
+@Data
+public class StatsStaffPatrolRecordDailyDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 统计日期 关联日期dim表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 工作人员所属组织id=网格所属的组织id
+ */
+ private String agencyId;
+
+ /**
+ * 网格所有上级id
+ */
+ private String gridPids;
+
+ /**
+ * 工作人员用户id
+ */
+ private String staffId;
+
+ /**
+ * 巡查次数
+ */
+ private Integer patrolTotal;
+
+ /**
+ * 巡查时长 单位:秒
+ */
+ private Integer totalTime;
+
+ /**
+ * 巡查期间直接立项项目数
+ */
+ private Integer reportProjectCount;
+
+ /**
+ * 最新的巡查开始时间
+ */
+ private Date latestPatrolTime;
+
+ /**
+ * 最新的巡查状态 正在巡查中:patrolling;结束:end
+ */
+ private String latestPatrolStatus;
+
+ /**
+ * 删除标识 0.未删除 1.已删除
+ */
+ private Integer 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-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java
new file mode 100644
index 0000000000..b2dad2bce4
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java
@@ -0,0 +1,32 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.dto.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.service.StatsStaffPatrolRecordDailyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+/**
+ * [天]工作人员巡查记录统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-06-30
+ */
+@RestController
+@RequestMapping("statsstaffpatrolrecorddaily")
+public class StatsStaffPatrolRecordDailyController {
+
+ @Autowired
+ private StatsStaffPatrolRecordDailyService statsStaffPatrolRecordDailyService;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java
new file mode 100644
index 0000000000..ac7ea8b7da
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java
@@ -0,0 +1,43 @@
+/**
+ * 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;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.StatsStaffPatrolRecordDailyEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * [天]工作人员巡查记录统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-06-30
+ */
+@Mapper
+public interface StatsStaffPatrolRecordDailyDao extends BaseDao {
+
+ /**
+ * @Description 校验今天某人是不是有数据
+ * @Param staffId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/30 2:41 下午
+ */
+ Integer checkStatsCount(@Param("staffId")String staffId, @Param("dateId")String dateId);
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java
new file mode 100644
index 0000000000..2bb2e583e3
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java
@@ -0,0 +1,116 @@
+/**
+ * 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;
+
+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-06-30
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("stats_staff_patrol_record_daily")
+public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 统计日期 关联日期dim表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 工作人员所属组织id=网格所属的组织id
+ */
+ private String agencyId;
+
+ /**
+ * 网格所有上级id
+ */
+ private String gridPids;
+
+ /**
+ * 工作人员用户id
+ */
+ private String staffId;
+
+ /**
+ * 巡查次数
+ */
+ private Integer patrolTotal;
+
+ /**
+ * 巡查时长 单位:秒
+ */
+ private Integer totalTime;
+
+ /**
+ * 巡查期间直接立项项目数
+ */
+ private Integer reportProjectCount;
+
+ /**
+ * 最新的巡查开始时间
+ */
+ private Date latestPatrolTime;
+
+ /**
+ * 最新的巡查状态 正在巡查中:patrolling;结束:end
+ */
+ private String latestPatrolStatus;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java
new file mode 100644
index 0000000000..4eb51384d9
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java
@@ -0,0 +1,15 @@
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.entity.StatsStaffPatrolRecordDailyEntity;
+
+/**
+ * [天]工作人员巡查记录统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-06-30
+ */
+public interface StatsStaffPatrolRecordDailyService extends BaseService {
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
new file mode 100644
index 0000000000..a53fc8e3a5
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
@@ -0,0 +1,32 @@
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dao.StatsStaffPatrolRecordDailyDao;
+import com.epmet.dto.StatsStaffPatrolRecordDailyDTO;
+import com.epmet.entity.StatsStaffPatrolRecordDailyEntity;
+import com.epmet.service.StatsStaffPatrolRecordDailyService;
+import lombok.extern.slf4j.Slf4j;
+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-06-30
+ */
+@Service
+@Slf4j
+public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl implements StatsStaffPatrolRecordDailyService {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml
new file mode 100644
index 0000000000..3c51b767fb
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ SELECT
+ COUNT(1)
+ FROM
+ stats_staff_patrol_record_daily
+ WHERE
+ DEL_FLAG = 0
+ AND DATE_ID = #{dateId}
+ AND STAFF_ID = #{staffId}
+
+
+
\ No newline at end of file