diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 72d2e072b4..ca3e901d44 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -166,6 +166,16 @@ public enum RequirePermissionEnum { MORE_BADGE_MANAGE_EDIT("more_badge_manage_edit","更多:徽章:徽章管理:编辑","编辑徽章"), MORE_BADGE_MANAGE_DELETE("more_badge_manage_delete","更多:徽章:徽章管理:删除","删除徽章"), + /** + * 更多-日志记录 + */ + MORE_PATROL_RECORD_LIST("more_patrol_record_list","更多:日志记录:巡查记录:列表","巡查记录列表"), + /** + * 更多-系统 + */ + MORE_SYSTEM_LOG_LIST("MORE_SYSTEM_LOG_LIST","更多:系统:系统日志:列表","系统日志列表"), + + /** * 项目立项 */ 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 a2f88e4133..67ab18f0ec 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 @@ -818,4 +818,15 @@ public class DateUtils { return date; } + /** + * @Author sun + * @Description 获取当前日期几个自然月之前的日期(yyyy-MM-dd HH:mm:ss) + **/ + public static String getBeforeMonthDate(int beforMonth){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, - beforMonth); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_TIME_PATTERN); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java new file mode 100644 index 0000000000..def0db685a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class StaffPatrolDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java new file mode 100644 index 0000000000..be8e0300f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class StaffPatrolRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java new file mode 100644 index 0000000000..4945b5de46 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description 巡查-各人员巡查记录列表查询-接口入参 + * @Auth sun + */ +@Data +public class StaffListFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 近1一个月传1; 近3个月传3【自然月分】 + */ + @NotNull(message = "最近时间不能为空", groups = StaffListFormDTO.Staff.class) + private Integer time; + /** + * 排序字段【巡查总次数:patrolTotal;最近开始巡查时间:latestPatrolledTime】 + */ + @NotBlank(message = "排序条件不能为空", groups = StaffListFormDTO.Staff.class) + private String sortCode; + /** + * 网格id集合,为空则查询当前组织下所有网格数据 + */ + private List gridIds; + /** + * 工作人员姓名;可空 + */ + private String staffName; + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + /** + * 每页多少条 + * */ + private Integer pageSize = 20; + //token中用户Id + private String userId; + //起止巡查开始时间 + private String patrolStartTime; + public interface Staff extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java new file mode 100644 index 0000000000..15f2647e88 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 巡查-各人员巡查记录列表查询-接口入参 + * @Auth sun + */ +@Data +public class StaffListResultDTO implements Serializable { + private static final long serialVersionUID = 7129564173128153335L; + + //工作人员所属网格id + private String gridId = ""; + //工作人员所在网格名称,最多显示到网格的上两级 + private String gridName = ""; + //工作人员用户id + private String staffId = ""; + //真名 + private String staffName = ""; + //最近巡查时间[最近一次进行中或已结束巡查的开始时间] + private String patrolStartTime = ""; + //巡查总次数 + private Integer patrolTotal = 0; + //性别0.未知,1男,2.女前端默认头像用 + private String gender = "0"; + //正在巡查中:patrolling;否则返回空字符串 + private String status = ""; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 583b66f4f1..4f7145b3fd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -1,8 +1,24 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import org.springframework.beans.factory.annotation.Autowired; +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; +import java.util.List; + /** * @Author zxc * @DateTime 2020/12/25 上午9:45 @@ -10,4 +26,28 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("epmetuser") public class EpmetUserController { + + @Autowired + private EpmetUserService epmetUserService; + + + /** + * @Param formDTO + * @Description 001、各人员巡查记录列表查询 + * @author sun + */ + @PostMapping("stafflist") + public Result> staffList(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class); + if (!"patrolTotal".equals(formDTO.getSortCode()) && !"latestPatrolledTime".equals(formDTO.getSortCode())) { + throw new RenException("参数错误,排序条件值错误"); + } + if (formDTO.getTime() != 1 && formDTO.getTime() != 3) { + throw new RenException("参数错误,最近时间值不正确"); + } + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(epmetUserService.staffList(formDTO)); + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..bb2247f220 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.epmetuser; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java new file mode 100644 index 0000000000..5c6cb03bdb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.epmetuser; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolRecordDao extends BaseDao { + + /** + * @Description 按条件查询巡查业务数据 + * @author sun + */ + List selectPatrolList(StaffListFormDTO formDTO); + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java index 1da9910104..cc73cc2c1f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; @@ -54,4 +55,11 @@ public interface CustomerGridDao extends BaseDao { * @Description 根据组织Id查询当前组织下所有网格列表 **/ List selectGridListByAgencyId(@Param("agencyId") String agencyId); + + /** + * @param staffId + * @Author sun + * @Description 查询工作人员所属组织下网格列表 + **/ + List gridListByStaffId(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..c74f88b459 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.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.dataaggre.entity.epmetuser; + +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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java new file mode 100644 index 0000000000..f15187a712 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_record") +public class StaffPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index d6e03f7f40..b43df6d3a4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -1,5 +1,7 @@ package com.epmet.dataaggre.service.epmetuser; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; import java.util.List; @@ -26,4 +28,10 @@ public interface EpmetUserService { */ List selectUserIdByCustomerId(List userIds); + /** + * @Param formDTO + * @Description 001、各人员巡查记录列表查询 + * @author sun + */ + List staffList(StaffListFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java new file mode 100644 index 0000000000..2463f47a0c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolDetailService extends BaseService { + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java new file mode 100644 index 0000000000..c2cfcdd450 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolRecordService extends BaseService { + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 2dac9b0ccd..301b3ff441 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -1,15 +1,25 @@ package com.epmet.dataaggre.service.epmetuser.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao; import com.epmet.dataaggre.dao.epmetuser.UserBaseInfoDao; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @Author zxc @@ -22,6 +32,10 @@ public class EpmetUserServiceImpl implements EpmetUserService { @Autowired private UserBaseInfoDao userBaseInfoDao; + @Autowired + private GovOrgService govOrgService; + @Autowired + private StaffPatrolRecordDao staffPatrolRecordDao; /** * @Description 根据UserIds查询 @@ -44,4 +58,40 @@ public class EpmetUserServiceImpl implements EpmetUserService { public List selectUserIdByCustomerId(List userIds) { return userBaseInfoDao.selectUserIdByCustomerId(userIds); } + + /** + * @Param formDTO + * @Description 001、各人员巡查记录列表查询 + * @author sun + */ + @Override + public List staffList(StaffListFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1.设置分页参数 + int num = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(num); + + //2.查询当前人员所属组织下网格列表数据,供后续使用 + List list = govOrgService.gridListByStaffId(formDTO.getUserId()); + if (list.size() < NumConstant.ONE) { + return resultList; + } + //网格集合为空则查询当前人员所属组织下网格列表 + if (CollectionUtils.isEmpty(formDTO.getGridIds())) { + formDTO.setGridIds(list.stream().map(CustomerGridDTO::getId).collect(Collectors.toList())); + } + + //3.按条件查询巡查业务数据 + formDTO.setPatrolStartTime(DateUtils.getBeforeMonthDate(formDTO.getTime())); + resultList = staffPatrolRecordDao.selectPatrolList(formDTO); + if (resultList.size() < NumConstant.ONE) { + return new ArrayList<>(); + } + + //4.封装数据并返回 + resultList.forEach(re -> list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()))); + return resultList; + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..fad170f41f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StaffPatrolDetailDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; +import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +@Service +public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..f245db7138 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; +import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +@Service +public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 916044b1f3..c79837ec60 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.service.govorg; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; @@ -48,4 +49,11 @@ public interface GovOrgService { List queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO); List queryNextOrgInfoDTO(String customerId, String orgId); + + /** + * @param staffId + * @Author sun + * @Description 查询工作人员所属组织下网格列表 + **/ + List gridListByStaffId(String staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index ec45f0419f..dfaff1bd06 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; import com.epmet.dataaggre.dao.govorg.CustomerGridDao; import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; @@ -225,5 +226,15 @@ public class GovOrgServiceImpl implements GovOrgService { System.out.println(JSON.toJSONString(allList, true)); } + /** + * @param staffId + * @Author sun + * @Description 查询工作人员所属组织下网格列表 + **/ + @Override + public List gridListByStaffId(String staffId) { + List resultList = customerGridDao.gridListByStaffId(staffId); + return resultList; + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..c06344967c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml new file mode 100644 index 0000000000..a0f8a495e0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml @@ -0,0 +1,52 @@ + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml index 331246a2f5..000f2c2b49 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -52,4 +52,26 @@ AND pid = #{agencyId} + + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java new file mode 100644 index 0000000000..a5f33265d5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java @@ -0,0 +1,131 @@ +/** + * 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-07 + */ +@Data +public class StaffPatrolDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + + /** + * 删除标识 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-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java new file mode 100644 index 0000000000..ef6b517d61 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java @@ -0,0 +1,121 @@ +/** + * 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-07 + */ +@Data +public class StaffPatrolRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + + /** + * 删除标识 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-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java new file mode 100644 index 0000000000..58a1912d1f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerListFormDTO implements Serializable { + + private static final long serialVersionUID = -7624307754570242679L; + + public interface GridManagerListForm{} + + @NotBlank(message = "组织ID不能为空",groups = GridManagerListForm.class) + private String agencyId; + + @NotBlank(message = "行政区域编码不能为空",groups = GridManagerListForm.class) + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java new file mode 100644 index 0000000000..831a4ee8fd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:27 下午 + * @DESC + */ +@Data +public class PatrolTrackFormDTO implements Serializable { + + private static final long serialVersionUID = 5074643104620363029L; + + public interface PatrolTrackForm{} + + @NotBlank(message = "巡查记录ID不能为空",groups = PatrolTrackForm.class) + private String staffPatrolRecId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java new file mode 100644 index 0000000000..c540ddc579 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:09 下午 + * @DESC + */ +@Data +public class RecordListFormDTO implements Serializable { + + private static final long serialVersionUID = 1034587652692011650L; + + public interface RecordListForm{} + + @NotBlank(message = "staffId不能为空",groups = RecordListForm.class) + private String staffId; + + @NotBlank(message = "网格ID不能为空",groups = RecordListForm.class) + private String gridId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java new file mode 100644 index 0000000000..7ea6da09f1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerListResultDTO implements Serializable { + + private static final long serialVersionUID = 3606724812822179356L; + + /** + * 工作人员id + */ + private String staffId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 网格ID + */ + private String gridId; + + /** + * 正在巡查:patrolling;否则返回空字符串 + */ + private String status; + + /** + * 网格名称,最多显示上两级 + */ + private String gridName; + + /** + * 姓名 + */ + private String staffName; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java new file mode 100644 index 0000000000..070b5a7d9a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:29 下午 + * @DESC + */ +@Data +public class PatrolTrackResultDTO implements Serializable { + + private static final long serialVersionUID = 5147586435344204616L; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java new file mode 100644 index 0000000000..aab9d52ef0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:14 下午 + * @DESC + */ +@Data +public class RecordListResultDTO implements Serializable { + + private static final long serialVersionUID = -1021736989973649009L; + + /** + * 巡查记录id + */ + private String staffPatrolRecId; + + /** + * 开始时间;yyyy-MM-dd HH:mm + */ + private String patrolStartTime; + + /** + * 结束时间;yyyy-MM-dd HH:mm + */ + private String patrolEndTime; + + /** + * 正在巡查:patrolling;已结束:end + */ + private String status; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java new file mode 100644 index 0000000000..e853fa3a48 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -0,0 +1,66 @@ +package com.epmet.datareport.controller.user; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@RestController +@RequestMapping("staffpatrol") +public class StaffPatrolDetailController { + + @Autowired + private StaffPatrolDetailService staffPatrolService; + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + @PostMapping("gridmanagerlist") + public Result> gridManagerList(@RequestBody GridManagerListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GridManagerListFormDTO.GridManagerListForm.class); + return new Result>().ok(staffPatrolService.gridManagerList(formDTO)); + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @PostMapping("recordlist") + public Result> recordList(@RequestBody RecordListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class); + return new Result>().ok(staffPatrolService.recordList(formDTO)); + } + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @PostMapping("patroltrack") + public Result> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class); + return new Result>().ok(staffPatrolService.patrolTrack(formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java new file mode 100644 index 0000000000..90a99c3d64 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java @@ -0,0 +1,21 @@ +package com.epmet.datareport.controller.user; + +import com.epmet.datareport.service.user.StaffPatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@RestController +@RequestMapping("staffpatrolrecord") +public class StaffPatrolRecordController { + + @Autowired + private StaffPatrolRecordService staffPatrolRecordService; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..56e3249113 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.user.result.PatrolTrackResultDTO; +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-07 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + + /** + * @Description 查询巡查轨迹 + * @Param staffPatrolRecId + * @author zxc + * @date 2021/6/7 5:13 下午 + */ + List selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java new file mode 100644 index 0000000000..a8637bd720 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.RecordListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolRecordDao extends BaseDao { + + /** + * @Description 巡查记录查询 + * @Param formDTO + * @author zxc + * @date 2021/6/7 5:29 下午 + */ + List recordList(RecordListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..fd00e1b58f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.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.datareport.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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java new file mode 100644 index 0000000000..7c37dd2813 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java @@ -0,0 +1,91 @@ +/** + * 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.datareport.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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_record") +public class StaffPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java new file mode 100644 index 0000000000..8afa465ea3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -0,0 +1,46 @@ +package com.epmet.datareport.service.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; + +import java.util.List; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolDetailService{ + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + List gridManagerList(GridManagerListFormDTO formDTO); + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + List recordList(RecordListFormDTO formDTO); + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + List patrolTrack(PatrolTrackFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java new file mode 100644 index 0000000000..e1d15008e5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java @@ -0,0 +1,14 @@ +package com.epmet.datareport.service.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolRecordService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..5c9537862f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,77 @@ +package com.epmet.datareport.service.user.impl; + +import com.epmet.datareport.dao.user.StaffPatrolDetailDao; +import com.epmet.datareport.dao.user.StaffPatrolRecordDao; +import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +@Slf4j +public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { + + @Autowired + private StaffPatrolDetailDao staffPatrolDetailDao; + + @Autowired + private StaffPatrolRecordDao staffPatrolRecordDao; + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + @Override + public List gridManagerList(GridManagerListFormDTO formDTO) { + + return null; + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @Override + public List recordList(RecordListFormDTO formDTO) { + List result = staffPatrolRecordDao.recordList(formDTO); + if (!CollectionUtils.isEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @Override + public List patrolTrack(PatrolTrackFormDTO formDTO) { + List results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId()); + if (!CollectionUtils.isEmpty(results)){ + return results; + } + return new ArrayList<>(); + } +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..35351b5746 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java @@ -0,0 +1,21 @@ +package com.epmet.datareport.service.user.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.datareport.dao.user.StaffPatrolRecordDao; +import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; +import com.epmet.datareport.service.user.StaffPatrolRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +@Slf4j +public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..cdc99d435b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml new file mode 100644 index 0000000000..5fef17c84a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java index c1f5f2ed12..60fdc4a14a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java @@ -55,6 +55,11 @@ public class ScreenProjectGridDailyDTO implements Serializable { */ private String gridId; + /** + * 网格id + */ + private String gridName; + /** * 网格所属的组织id */ @@ -149,4 +154,4 @@ public class ScreenProjectGridDailyDTO implements Serializable { this.delFlag = NumConstant.ZERO_STR; this.revision = NumConstant.ZERO; } -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java new file mode 100644 index 0000000000..59cf43ebf1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java @@ -0,0 +1,18 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * desc:修改组织中心点 + * @author liujianjun + */ +@Data +public class CenterPointForm implements Serializable { + private static final long serialVersionUID = 6425114459278919896L; + private String title; + private List center = new ArrayList<>(); +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java new file mode 100644 index 0000000000..6859b4a1ee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java @@ -0,0 +1,30 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * desc:修改组织中心点 + * @author liujianjun + */ +@Data +public class GridCenterPointForm implements Serializable { + + private static final long serialVersionUID = -6988009829971668860L; + + private String customerId; + + private List centerDataList = new ArrayList<>(); + + + /* @Data + public class CenterData implements Serializable{ + + private static final long serialVersionUID = 6425114459278919896L; + private String title; + private List center = new ArrayList<>(); + }*/ +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java index 761c62bb0b..e15b66e188 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java @@ -2,14 +2,18 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.form.GridCenterPointForm; import com.epmet.service.EIDimService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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; +import java.util.Map; + /** * epmet_evaluation_index库的维度controller */ @@ -45,4 +49,14 @@ public class EIDimController { return new Result(); } + /** + * desc 更新网格的中心点位 + * @return + */ + @PostMapping("update/gridcenterpoint") + public Result upsertOrgCenterPoint(@RequestBody GridCenterPointForm param) { + Map effectRow = eiDimService.updateCenterPointByName(param); + return new Result().ok(effectRow); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java index 64ba669caf..f74e041940 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java @@ -1,7 +1,10 @@ package com.epmet.service; +import com.epmet.dto.screen.form.GridCenterPointForm; import org.springframework.stereotype.Service; +import java.util.Map; + /** * epmet_evaluation_index 维度的service */ @@ -10,4 +13,14 @@ public interface EIDimService { void initAgencies(); void initDepartments(); void initGrids(); + + /** + * desc: 更新中心点位 + * + * @param param + * @return java.lang.Integer + * @author LiuJanJun + * @date 2021/6/7 3:52 下午 + */ + Map updateCenterPointByName(GridCenterPointForm param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index ef39e1b781..d19a8bfca8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -102,4 +103,8 @@ public interface ScreenCustomerGridService extends BaseService selectBelongGridInfo(String customerId,String level); -} \ No newline at end of file + + Integer updateCenterPointByName(String customerId, String title, List center); + + List selectGridInfoByCustomerId(String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 79591a5aab..f8100355bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -19,6 +19,8 @@ package com.epmet.service.evaluationindex.screen.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.utils.DateUtils; @@ -29,6 +31,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; @@ -38,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -186,4 +190,20 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectBelongGridInfo(String customerId, String level) { return baseDao.selectBelongGridInfo(customerId, level); } -} \ No newline at end of file + + @Override + public Integer updateCenterPointByName(String customerId, String title, List center) { + LambdaUpdateWrapper tWrapper = new LambdaUpdateWrapper<>(); + String val = center.toString(); + List array = new ArrayList<>(Collections.singleton(val)); + tWrapper.eq(ScreenCustomerGridEntity::getCustomerId,customerId) + .likeRight(ScreenCustomerGridEntity::getGridName,title) + .set(ScreenCustomerGridEntity::getCenterMark, array.toString()); + return baseDao.update(null,tWrapper); + } + + @Override + public List selectGridInfoByCustomerId(String customerId) { + return baseDao.selectGridInfoByCustomerId(customerId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java index d35aa6bec6..0633983ea4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -1,5 +1,7 @@ package com.epmet.service.impl; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screen.form.GridCenterPointForm; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -16,10 +18,8 @@ import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; @Service public class EIDimServiceImpl implements EIDimService { @@ -130,6 +130,35 @@ public class EIDimServiceImpl implements EIDimService { screenCustomerGridService.addAndUpdateGrids(grids2Add, grids2Update); } + @Override + public Map updateCenterPointByName(GridCenterPointForm param) { + //todo 怎么反向判断 左匹配 + List gridInfos = screenCustomerGridService.selectGridInfoByCustomerId(param.getCustomerId()); + Map result = new HashMap<>(); + + + gridInfos.forEach(grid->{ + //客户id 和组织id 都相等 且 名字 包含关系时才修改 + if (grid.getCustomerId().equals(param.getCustomerId())){ + AtomicInteger integer = new AtomicInteger(0); + param.getCenterDataList().forEach(o ->{ + if (grid.getGridName().contains(o.getTitle())) { + Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + integer.addAndGet(effectRow); + } + result.put(grid.getGridId(),integer.intValue()); + }); + } + }); + /*param.getCenterDataList().forEach(o ->{ + Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(),param.getAgencyId(), o.getTitle(), o.getCenter()); + if (integer == 0 || integer > 1){ + result.put(o.getTitle(),integer); + } + });*/ + return result; + } + private List listGrids2Update() { ScreenCustomerGridEntity lastUpdateGrid = screenCustomerGridService.getLastUpdateGrid(); if (lastUpdateGrid != null) { 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 50382aa75e..a6cc1d5c1d 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 @@ -1,7 +1,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.convert.DateConverter; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; @@ -11,7 +10,6 @@ import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; -import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; @@ -24,14 +22,12 @@ import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.configuration.ConfigurationException; 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.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; @@ -83,13 +79,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { Integer pageSize = NumConstant.ONE_HUNDRED; List customerIds = new ArrayList<>(); - if (StringUtils.isNotBlank(formDTO.getCustomerId())) { - customerIds.add(formDTO.getCustomerId()); - } else { - customerIds = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); - } do { - + if (StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerIds.add(formDTO.getCustomerId()); + } else { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + } DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); if (customerIds.size() != NumConstant.ZERO) { customerIds.forEach(customerId -> { @@ -214,7 +209,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { } }); }); - Integer groupCount = approvedResult.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); + Integer groupCount = approvedResult.stream().mapToInt(AgencyGroupTotalCountResultDTO::getGridGroupCount).sum(); agencyResult.setGroupTotalCount(groupCount); // 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" List peopleTotal = new ArrayList<>(); @@ -226,7 +221,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { } }); }); - Integer groupPeopleCount = peopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); + Integer groupPeopleCount = peopleTotal.stream().mapToInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal).sum(); agencyResult.setGroupMemberTotalCount(groupPeopleCount); // 4. 机关下小组平均人数 agencyResult.setGroupMemberAvgCount( diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java index f5ff55f74e..a8f8c7802d 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -1,5 +1,6 @@ package com.epmet.task; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsGroupService; import org.slf4j.Logger; @@ -28,7 +29,7 @@ public class StatsGroupAgencyDailyTask implements ITask { if (result.success()){ logger.info("StatsGroupAgencyDailyTask定时任务执行成功"); }else { - logger.error("StatsGroupAgencyDailyTask定时任务执行失败:" + result.getMsg()); + logger.error("StatsGroupAgencyDailyTask定时任务执行失败:" , JSON.toJSONString(result)); } } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 20fc7cb138..aa0d5545ed 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ hystrix: execution: isolation: thread: - timeoutInMilliseconds: 60000 #缺省为1000 + timeoutInMilliseconds: 90000 #缺省为1000 ribbon: ReadTimeout: 300000 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..844e0d0036 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java @@ -0,0 +1,33 @@ +/** + * 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.StaffPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java new file mode 100644 index 0000000000..61f5769af4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java @@ -0,0 +1,33 @@ +/** + * 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.StaffPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..fbc81edd1a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.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.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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java new file mode 100644 index 0000000000..2eed573090 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java @@ -0,0 +1,91 @@ +/** + * 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-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_record") +public class StaffPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java new file mode 100644 index 0000000000..ff79804e27 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java @@ -0,0 +1,32 @@ +/** + * 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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.StaffPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolDetailService extends BaseService { + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java new file mode 100644 index 0000000000..ae347f87e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java @@ -0,0 +1,33 @@ +/** + * 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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.StaffPatrolRecordEntity; + + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolRecordService extends BaseService { + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..591e95c093 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,37 @@ +/** + * 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.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.StaffPatrolDetailDao; +import com.epmet.entity.StaffPatrolDetailEntity; +import com.epmet.service.StaffPatrolDetailService; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..aa6f7c5571 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.StaffPatrolRecordDao; +import com.epmet.entity.StaffPatrolRecordEntity; +import com.epmet.service.StaffPatrolRecordService; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + + +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..235ad55597 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml new file mode 100644 index 0000000000..c57b356e99 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file