111 changed files with 4731 additions and 67 deletions
@ -0,0 +1,131 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,121 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/10 14:31 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolDateListFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -3120791500214908595L; |
||||
|
public interface PatrolDateListGroup {} |
||||
|
|
||||
|
@NotBlank(message = "网格Id不能为空",groups = PatrolDateListGroup.class) |
||||
|
private String gridId; |
||||
|
@NotBlank(message = "工作人员ID不能为空",groups = PatrolDateListGroup.class) |
||||
|
private String staffId; |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class PatrolRecordListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 7496587490046732883L; |
||||
|
public interface PatrolRecordListGroup {} |
||||
|
|
||||
|
/** |
||||
|
* 巡查日期,格式:yyyy-MM-dd |
||||
|
*/ |
||||
|
@NotBlank(message = "巡查日期不能为空",groups = PatrolRecordListGroup.class) |
||||
|
private String patrolDate; |
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
@NotBlank(message = "网格Id不能为空",groups = PatrolRecordListGroup.class) |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
@NotBlank(message = "用户ID不能为空",groups = PatrolRecordListGroup.class) |
||||
|
private String userId; |
||||
|
} |
||||
@ -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<String> 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 {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/10 14:32 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolDateListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -1516170049255588336L; |
||||
|
private String startDate; |
||||
|
private List<String> list; |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/9 14:38 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolRecordDetailDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 757994412954699222L; |
||||
|
/** |
||||
|
* 上传时间;yyyy-MM-dd HH:mm |
||||
|
*/ |
||||
|
private String uploadTime; |
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
/** |
||||
|
* 速度,单位m/s |
||||
|
*/ |
||||
|
private String speed; |
||||
|
/** |
||||
|
* 后端返回:开始巡查;结束巡查;此列只有集合第一条,和最后一条有值 |
||||
|
*/ |
||||
|
private String flag; |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:24 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolRecordListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -8808482239766626564L; |
||||
|
/** |
||||
|
* 巡查记录id |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
/** |
||||
|
* 总时长描述,后端返回格式:XX小时XX分;前端直接展示 |
||||
|
*/ |
||||
|
private String totalTimeDesc; |
||||
|
/** |
||||
|
* 开始时间;yyyy-MM-dd HH:mm |
||||
|
*/ |
||||
|
private String patrolStartTime; |
||||
|
/** |
||||
|
* 结束时间;yyyy-MM-dd HH:mm |
||||
|
*/ |
||||
|
private String patrolEndTime; |
||||
|
/** |
||||
|
* 巡查中:patrolling;已结束:end;如果是巡查中,界面不展示结束时间这一行 |
||||
|
*/ |
||||
|
private String status; |
||||
|
/** |
||||
|
* 后端返回:巡查员最近地址变动是XX分钟前 |
||||
|
*/ |
||||
|
private String latestChangeDesc; |
||||
|
/** |
||||
|
* 巡查记录详情 |
||||
|
*/ |
||||
|
private List<PatrolRecordDetailDTO> details; |
||||
|
|
||||
|
} |
||||
@ -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 = ""; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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<StaffPatrolDetailEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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<StaffPatrolRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 按条件查询巡查业务数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<StaffListResultDTO> selectPatrolList(StaffListFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,101 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.epmetuser; |
||||
|
|
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO; |
||||
|
import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查记录明细 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-07 |
||||
|
*/ |
||||
|
public interface StaffPatrolDetailService extends BaseService<StaffPatrolDetailEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 获取记录明细 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/9 15:09 |
||||
|
* @param recordIds |
||||
|
* @return java.util.Map<java.lang.String,java.util.List<com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO>> |
||||
|
*/ |
||||
|
Map<String, List<StaffPatrolDetailDTO>> getDetailByRecordIds(List<String> recordIds); |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.epmetuser; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO; |
||||
|
import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查主记录 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-07 |
||||
|
*/ |
||||
|
public interface StaffPatrolRecordService extends BaseService<StaffPatrolRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 获取巡查记录列表 |
||||
|
* |
||||
|
* @param gridId |
||||
|
* @param userId |
||||
|
* @param patrolDate |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/9 14:55 |
||||
|
*/ |
||||
|
List<StaffPatrolRecordDTO> getRecordList(String gridId, String userId, String patrolDate); |
||||
|
|
||||
|
/** |
||||
|
* 获取日期列表 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/10 14:49 |
||||
|
* @param gridId |
||||
|
* @param staffId |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
*/ |
||||
|
List<String> getDateList(String gridId, String staffId); |
||||
|
} |
||||
@ -0,0 +1,71 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.epmetuser.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
||||
|
import com.epmet.dataaggre.dao.epmetuser.StaffPatrolDetailDao; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO; |
||||
|
import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; |
||||
|
import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查记录明细 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-07 |
||||
|
*/ |
||||
|
@DataSource(DataSourceConstant.EPMET_USER) |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class StaffPatrolDetailServiceImpl extends BaseServiceImpl<StaffPatrolDetailDao, StaffPatrolDetailEntity> implements StaffPatrolDetailService { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取记录明细 |
||||
|
* |
||||
|
* @param recordIds |
||||
|
* @return java.util.Map<java.lang.String, java.util.List < com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO>> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/9 15:09 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Map<String, List<StaffPatrolDetailDTO>> getDetailByRecordIds(List<String> recordIds) { |
||||
|
if (CollectionUtils.isEmpty(recordIds)) { |
||||
|
return Collections.emptyMap(); |
||||
|
} |
||||
|
StringBuilder sql = new StringBuilder("( STAFF_PATROL_REC_ID = '' "); |
||||
|
for (String id : recordIds) { |
||||
|
sql.append("OR STAFF_PATROL_REC_ID = '").append(id).append("' "); |
||||
|
} |
||||
|
sql.append(")"); |
||||
|
QueryWrapper<StaffPatrolDetailEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.apply(sql.toString()); |
||||
|
List<StaffPatrolDetailDTO> list = ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), StaffPatrolDetailDTO.class); |
||||
|
return list.stream().collect(Collectors.groupingBy(StaffPatrolDetailDTO::getStaffPatrolRecId)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,93 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.epmetuser.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
||||
|
import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao; |
||||
|
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO; |
||||
|
import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; |
||||
|
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查主记录 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-07 |
||||
|
*/ |
||||
|
@DataSource(DataSourceConstant.EPMET_USER) |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRecordDao, StaffPatrolRecordEntity> implements StaffPatrolRecordService { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取巡查记录列表 |
||||
|
* |
||||
|
* @param gridId |
||||
|
* @param userId |
||||
|
* @param patrolDate |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/9 14:55 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<StaffPatrolRecordDTO> getRecordList(String gridId, String userId, String patrolDate) { |
||||
|
QueryWrapper<StaffPatrolRecordEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq("GRID", gridId) |
||||
|
.eq("STAFF_ID", userId) |
||||
|
.eq("DATE_FORMAT(PATROL_START_TIME,'%Y-%m-%d') ", patrolDate) |
||||
|
.orderByDesc("PATROL_START_TIME"); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), StaffPatrolRecordDTO.class); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取日期列表 |
||||
|
* |
||||
|
* @param gridId |
||||
|
* @param staffId |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/10 14:49 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<String> getDateList(String gridId, String staffId) { |
||||
|
QueryWrapper<StaffPatrolRecordEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.select("DISTINCT DATE_FORMAT(PATROL_START_TIME,'%Y-%m-%d') AS ID") |
||||
|
.eq("GRID", gridId) |
||||
|
.eq("STAFF_ID", staffId) |
||||
|
.orderByAsc("PATROL_START_TIME"); |
||||
|
List<StaffPatrolRecordEntity> list = baseDao.selectList(wrapper); |
||||
|
if (CollectionUtils.isEmpty(list)) { |
||||
|
return Collections.emptyList(); |
||||
|
} |
||||
|
|
||||
|
return list.stream().map(StaffPatrolRecordEntity::getId).collect(Collectors.toList()); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.StaffPatrolDetailDao"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,52 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao"> |
||||
|
|
||||
|
<select id="selectPatrolList" resultType="com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO"> |
||||
|
SELECT |
||||
|
spr.grid AS "gridId", |
||||
|
spr.staff_id AS "staffId", |
||||
|
MAX(spr.patrol_start_time) AS "patrolStartTime", |
||||
|
COUNT(spr.staff_id) AS "patrolTotal", |
||||
|
( |
||||
|
select |
||||
|
`status` |
||||
|
from |
||||
|
staff_patrol_record |
||||
|
where |
||||
|
grid = spr.grid |
||||
|
and staff_id = spr.staff_id |
||||
|
order by |
||||
|
patrol_start_time desc |
||||
|
limit 1 |
||||
|
) AS "status", |
||||
|
cs.real_name AS "staffName", |
||||
|
cs.gender AS "gender" |
||||
|
FROM |
||||
|
staff_patrol_record spr |
||||
|
LEFT JOIN customer_staff cs ON spr.staff_id = cs.user_id |
||||
|
WHERE |
||||
|
spr.del_flag = '0' |
||||
|
<if test='patrolStartTime != "" and patrolStartTime != null'> |
||||
|
AND spr.patrol_start_time <![CDATA[ >= ]]> #{patrolStartTime} |
||||
|
</if> |
||||
|
<if test='staffName != "" and staffName != null'> |
||||
|
AND cs.real_name LIKE CONCAT('%',#{staffName},'%') |
||||
|
</if> |
||||
|
<foreach collection="gridIds" item="gridId" open="AND( " separator=" OR " close=")"> |
||||
|
spr.GRID = #{gridId} |
||||
|
</foreach> |
||||
|
GROUP BY |
||||
|
spr.grid, spr.staff_id |
||||
|
<if test='sortCode != "" and sortCode != null and sortCode == "patrolTotal" '> |
||||
|
ORDER BY COUNT(spr.staff_id) DESC |
||||
|
</if> |
||||
|
<if test='sortCode != "" and sortCode != null and sortCode == "latestPatrolledTime" '> |
||||
|
ORDER BY MAX(spr.patrol_start_time) DESC |
||||
|
</if> |
||||
|
LIMIT |
||||
|
#{pageNo}, #{pageSize} |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,131 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,121 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 行政区域编码 【平阴传】 |
||||
|
*/ |
||||
|
private String areaCode; |
||||
|
} |
||||
@ -0,0 +1,76 @@ |
|||||
|
package com.epmet.user.result; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 中心点位 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private String centerMark; |
||||
|
|
||||
|
/** |
||||
|
* 经纬度赋值状态 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private Boolean llStatus; |
||||
|
|
||||
|
public GridManagerListResultDTO() { |
||||
|
this.staffId = ""; |
||||
|
this.longitude = ""; |
||||
|
this.latitude = ""; |
||||
|
this.gridId = ""; |
||||
|
this.status = ""; |
||||
|
this.gridName = ""; |
||||
|
this.staffName = ""; |
||||
|
this.centerMark = ""; |
||||
|
this.llStatus = false; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.datareport.constant; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/9 1:49 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
public interface PatrolConstant { |
||||
|
|
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
String LONGITUDE = "longitude"; |
||||
|
|
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
String LATITUDE = "latitude"; |
||||
|
|
||||
|
} |
||||
@ -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.dto.form.PatrolTrackFormDTO; |
||||
|
import com.epmet.dto.form.RecordListFormDTO; |
||||
|
import com.epmet.user.result.GridManagerListResultDTO; |
||||
|
import com.epmet.dto.result.PatrolTrackResultDTO; |
||||
|
import com.epmet.dto.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<List<GridManagerListResultDTO>> gridManagerList(@RequestBody GridManagerListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, GridManagerListFormDTO.GridManagerListForm.class); |
||||
|
return new Result<List<GridManagerListResultDTO>>().ok(staffPatrolService.gridManagerList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 002、查看巡查记录 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:25 下午 |
||||
|
*/ |
||||
|
@PostMapping("recordlist") |
||||
|
public Result<List<RecordListResultDTO>> recordList(@RequestBody RecordListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class); |
||||
|
return new Result<List<RecordListResultDTO>>().ok(staffPatrolService.recordList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 003、巡查轨迹 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:35 下午 |
||||
|
*/ |
||||
|
@PostMapping("patroltrack") |
||||
|
public Result<List<PatrolTrackResultDTO>> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class); |
||||
|
return new Result<List<PatrolTrackResultDTO>>().ok(staffPatrolService.patrolTrack(formDTO)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.datareport.dao.user; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; |
||||
|
import com.epmet.dto.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<StaffPatrolDetailEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询巡查轨迹 |
||||
|
* @Param staffPatrolRecId |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 5:13 下午 |
||||
|
*/ |
||||
|
List<PatrolTrackResultDTO> selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.datareport.dao.user; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; |
||||
|
import com.epmet.dto.form.RecordListFormDTO; |
||||
|
import com.epmet.user.result.GridManagerListResultDTO; |
||||
|
import com.epmet.dto.result.RecordListResultDTO; |
||||
|
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 StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 巡查记录查询 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 5:29 下午 |
||||
|
*/ |
||||
|
List<RecordListResultDTO> recordList(RecordListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询经纬度 |
||||
|
* @Param userIds |
||||
|
* @author zxc |
||||
|
* @date 2021/6/9 10:24 上午 |
||||
|
*/ |
||||
|
List<GridManagerListResultDTO> selectLL(@Param("userIds")List<String> userIds); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,101 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.datareport.service.evaluationindex.screen; |
||||
|
|
||||
|
import com.epmet.user.result.GridManagerListResultDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/8 10:45 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
public interface ScreenOrgService { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询组织下的所有网格 |
||||
|
* @Param agencyId |
||||
|
* @Param areaCode |
||||
|
* @author zxc |
||||
|
* @date 2021/6/8 10:46 上午 |
||||
|
*/ |
||||
|
List<GridManagerListResultDTO> selectAllGrid(String agencyId,String areaCode); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.epmet.datareport.service.evaluationindex.screen.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; |
||||
|
import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService; |
||||
|
import com.epmet.user.result.GridManagerListResultDTO; |
||||
|
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 zxc |
||||
|
* @DateTime 2021/6/8 10:45 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class ScreenOrgServiceImpl implements ScreenOrgService { |
||||
|
|
||||
|
@Autowired |
||||
|
private ScreenCustomerAgencyDao agencyDao; |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询组织下的所有网格 |
||||
|
* @Param agencyId |
||||
|
* @Param areaCode |
||||
|
* @author zxc |
||||
|
* @date 2021/6/8 10:46 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<GridManagerListResultDTO> selectAllGrid(String agencyId,String areaCode) { |
||||
|
List<GridManagerListResultDTO> result = agencyDao.selectGrid(agencyId, areaCode); |
||||
|
if (!CollectionUtils.isEmpty(result)){ |
||||
|
return result; |
||||
|
} |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.epmet.datareport.service.user; |
||||
|
|
||||
|
import com.epmet.user.form.GridManagerListFormDTO; |
||||
|
import com.epmet.dto.form.PatrolTrackFormDTO; |
||||
|
import com.epmet.dto.form.RecordListFormDTO; |
||||
|
import com.epmet.user.result.GridManagerListResultDTO; |
||||
|
import com.epmet.dto.result.PatrolTrackResultDTO; |
||||
|
import com.epmet.dto.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<GridManagerListResultDTO> gridManagerList(GridManagerListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Description 002、查看巡查记录 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:25 下午 |
||||
|
*/ |
||||
|
List<RecordListResultDTO> recordList(RecordListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Description 003、巡查轨迹 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:35 下午 |
||||
|
*/ |
||||
|
List<PatrolTrackResultDTO> patrolTrack(PatrolTrackFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -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<StaffPatrolRecordEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,194 @@ |
|||||
|
package com.epmet.datareport.service.user.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.datareport.constant.PatrolConstant; |
||||
|
import com.epmet.datareport.dao.user.StaffPatrolDetailDao; |
||||
|
import com.epmet.datareport.dao.user.StaffPatrolRecordDao; |
||||
|
import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService; |
||||
|
import com.epmet.datareport.service.user.StaffPatrolDetailService; |
||||
|
import com.epmet.dto.result.GridStaffResultDTO; |
||||
|
import com.epmet.dto.result.UserNameAndLLResultDTO; |
||||
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.user.form.GridManagerListFormDTO; |
||||
|
import com.epmet.dto.form.PatrolTrackFormDTO; |
||||
|
import com.epmet.dto.form.RecordListFormDTO; |
||||
|
import com.epmet.user.result.GridManagerListResultDTO; |
||||
|
import com.epmet.dto.result.PatrolTrackResultDTO; |
||||
|
import com.epmet.dto.result.RecordListResultDTO; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员巡查记录明细 |
||||
|
* |
||||
|
* @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; |
||||
|
|
||||
|
@Autowired |
||||
|
private ScreenOrgService screenOrgService; |
||||
|
|
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @Description 001、网格员分布 |
||||
|
* 1.根据agencyId或者areaCode查询出网格 |
||||
|
* 2.根据查出来的网格ID去查网格下边的人【人只要网格员】 |
||||
|
* 3.根据userId查询巡查记录表 |
||||
|
* 4.数据补全 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:06 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<GridManagerListResultDTO> gridManagerList(GridManagerListFormDTO formDTO) { |
||||
|
List<GridManagerListResultDTO> grids = new ArrayList<>(); |
||||
|
if (StringUtils.isEmpty(formDTO.getAreaCode())){ |
||||
|
// 根据agencyId查询网格
|
||||
|
grids = screenOrgService.selectAllGrid(formDTO.getAgencyId(), null); |
||||
|
}else { |
||||
|
// 根据areaCode查询网格
|
||||
|
grids = screenOrgService.selectAllGrid(null, formDTO.getAreaCode()); |
||||
|
} |
||||
|
if (CollectionUtils.isEmpty(grids)){ |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
List<String> gridIds = grids.stream().map(m -> m.getGridId()).collect(Collectors.toList()); |
||||
|
// 查询网格下的网格员
|
||||
|
Result<List<GridStaffResultDTO>> resultData = govOrgOpenFeignClient.selectGridStaffByGridIds(gridIds); |
||||
|
if(!resultData.success()){ |
||||
|
throw new RenException("查询网格下的网格员失败【"+resultData.getMsg()+"】"); |
||||
|
} |
||||
|
List<GridStaffResultDTO> data = resultData.getData(); |
||||
|
if (CollectionUtils.isEmpty(data)){ |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
List<GridManagerListResultDTO> result = ConvertUtils.sourceToTarget(data, GridManagerListResultDTO.class); |
||||
|
// 查询经纬度
|
||||
|
Result<UserNameAndLLResultDTO> selectll = epmetUserOpenFeignClient.selectll(result.stream().map(m -> m.getStaffId()).collect(Collectors.toList())); |
||||
|
if (!selectll.success()){ |
||||
|
throw new RenException("查询经纬度和姓名失败【"+selectll.getMsg()+"】"); |
||||
|
} |
||||
|
UserNameAndLLResultDTO llAndNameData = selectll.getData(); |
||||
|
List<GridManagerListResultDTO> finalGrids = grids; |
||||
|
result.forEach(r -> { |
||||
|
// 经纬度赋值 巡查状态赋值
|
||||
|
if (!CollectionUtils.isEmpty(llAndNameData.getLl())) { |
||||
|
llAndNameData.getLl().forEach(l -> { |
||||
|
if (r.getStaffId().equals(l.getStaffId()) && r.getGridId().equals(l.getGridId())) { |
||||
|
r.setLatitude(l.getLatitude()); |
||||
|
r.setLongitude(l.getLongitude()); |
||||
|
r.setStatus(l.getStatus()); |
||||
|
r.setLlStatus(true); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 姓名赋值
|
||||
|
if (!CollectionUtils.isEmpty(llAndNameData.getUserNames())){ |
||||
|
llAndNameData.getUserNames().forEach(n -> { |
||||
|
if (r.getStaffId().equals(n.getUserId())){ |
||||
|
r.setStaffName(n.getUserName()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
finalGrids.forEach(g -> { |
||||
|
if (r.getGridId().equals(g.getGridId())){ |
||||
|
r.setGridName(g.getGridName()); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
result.forEach(r -> { |
||||
|
if (!r.getLlStatus()){ |
||||
|
finalGrids.forEach(g -> { |
||||
|
if (StringUtils.isNotBlank(g.getCenterMark())){ |
||||
|
r.setLongitude(getLL(g.getCenterMark(),PatrolConstant.LONGITUDE)); |
||||
|
r.setLatitude(getLL(g.getCenterMark(),PatrolConstant.LATITUDE)); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 根据中心点位截取经纬度 |
||||
|
* @Param centMark |
||||
|
* @Param ll |
||||
|
* @author zxc |
||||
|
* @date 2021/6/9 2:08 下午 |
||||
|
*/ |
||||
|
public String getLL(String centMark,String ll){ |
||||
|
if (ll.equals(PatrolConstant.LONGITUDE)){ |
||||
|
String longitude = centMark.substring(NumConstant.TWO, centMark.indexOf(",")); |
||||
|
return longitude; |
||||
|
}else { |
||||
|
String s = centMark.substring(NumConstant.ZERO, centMark.indexOf(",")); |
||||
|
String latitude = centMark.substring(s.length() + NumConstant.ONE, centMark.length() - NumConstant.TWO); |
||||
|
return latitude; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 002、查看巡查记录 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:25 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<RecordListResultDTO> recordList(RecordListFormDTO formDTO) { |
||||
|
Result<List<RecordListResultDTO>> listResult = epmetUserOpenFeignClient.recordList(formDTO); |
||||
|
if (!listResult.success()){ |
||||
|
throw new RenException("查询巡查记录失败【"+listResult.getMsg()+"】"); |
||||
|
} |
||||
|
List<RecordListResultDTO> result = listResult.getData(); |
||||
|
if (!CollectionUtils.isEmpty(result)){ |
||||
|
return result; |
||||
|
} |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 003、巡查轨迹 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:35 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<PatrolTrackResultDTO> patrolTrack(PatrolTrackFormDTO formDTO) { |
||||
|
Result<List<PatrolTrackResultDTO>> result = epmetUserOpenFeignClient.patrolTrack(formDTO); |
||||
|
if (!result.success()){ |
||||
|
throw new RenException("查询 巡查轨迹失败【"+result.getMsg()+"】"); |
||||
|
} |
||||
|
List<PatrolTrackResultDTO> results = result.getData(); |
||||
|
if (!CollectionUtils.isEmpty(results)){ |
||||
|
return results; |
||||
|
} |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -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<StaffPatrolRecordDao, StaffPatrolRecordEntity> implements StaffPatrolRecordService { |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.user.StaffPatrolDetailDao"> |
||||
|
|
||||
|
<!-- 查询巡查轨迹 --> |
||||
|
<select id="selectPatrolTrack" resultType="com.epmet.dto.result.PatrolTrackResultDTO"> |
||||
|
SELECT |
||||
|
LATITUDE, |
||||
|
LONGITUDE |
||||
|
FROM |
||||
|
staff_patrol_detail |
||||
|
WHERE |
||||
|
STAFF_PATROL_REC_ID = #{staffPatrolRecId} |
||||
|
AND DEL_FLAG = 0 |
||||
|
ORDER BY SERIAL_NUM |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,41 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.user.StaffPatrolRecordDao"> |
||||
|
|
||||
|
<!-- 巡查记录查询 --> |
||||
|
<select id="recordList" resultType="com.epmet.dto.result.RecordListResultDTO"> |
||||
|
SELECT |
||||
|
ID AS staffPatrolRecId, |
||||
|
DATE_FORMAT(PATROL_START_TIME,'%Y-%m-%d %H:%i:%s') AS patrolStartTime, |
||||
|
DATE_FORMAT(PATROL_END_TIME,'%Y-%m-%d %H:%i:%s') AS patrolEndTime, |
||||
|
`STATUS` |
||||
|
FROM staff_patrol_record |
||||
|
WHERE DEL_FLAG = 0 |
||||
|
AND GRID_ID = #{gridId} |
||||
|
AND STAFF_ID = #{staffId} |
||||
|
ORDER BY CREATED_TIME DESC |
||||
|
</select> |
||||
|
|
||||
|
<!-- 查询经纬度 --> |
||||
|
<select id="selectLL" resultType="com.epmet.user.result.GridManagerListResultDTO"> |
||||
|
SELECT t.* FROM |
||||
|
(SELECT |
||||
|
distinct(pr.ID) AS ID, |
||||
|
pr.GRID AS gridId, |
||||
|
pr.STAFF_ID, |
||||
|
pr.`STATUS`, |
||||
|
pd.LATITUDE, |
||||
|
pd.LONGITUDE, |
||||
|
pd.SERIAL_NUM |
||||
|
FROM staff_patrol_record pr |
||||
|
LEFT JOIN staff_patrol_detail pd ON pd.STAFF_PATROL_REC_ID = pr.ID AND pd.DEL_FLAG = 0 |
||||
|
WHERE pr.DEL_FLAG = 0 |
||||
|
AND ( |
||||
|
<foreach collection="userIds" item="userId" separator=" OR "> |
||||
|
pr.STAFF_ID = #{userId} |
||||
|
</foreach> |
||||
|
) |
||||
|
ORDER BY pd.SERIAL_NUM DESC)t GROUP BY ID |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -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<Double> center = new ArrayList<>(); |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
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 String pids; |
||||
|
|
||||
|
private List<CenterPointForm> centerDataList = new ArrayList<>(); |
||||
|
|
||||
|
|
||||
|
/* @Data |
||||
|
public class CenterData implements Serializable{ |
||||
|
|
||||
|
private static final long serialVersionUID = 6425114459278919896L; |
||||
|
private String title; |
||||
|
private List<Double> center = new ArrayList<>(); |
||||
|
}*/ |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/8 3:23 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridStaffResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -5910427385795368242L; |
||||
|
|
||||
|
private String gridId; |
||||
|
|
||||
|
private String staffId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.epmet.constant; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/8 15:28 |
||||
|
*/ |
||||
|
public interface PatrolConstant { |
||||
|
String PATROLLING = "patrolling"; |
||||
|
String END = "end"; |
||||
|
|
||||
|
String NOT_END_MSG = "%s巡查尚未结束,请切换至%s查看。"; |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:23 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolRecordDetailFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 7496587490046732883L; |
||||
|
/** |
||||
|
* 巡查记录id |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.dto.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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/9 16:31 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PatrolUploadDetailFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 1527344810917196996L; |
||||
|
/** |
||||
|
* 巡查主记录id, 开始巡查反参 |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
private List<PatrolUploadFormDTO> details; |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:05 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolUploadFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 4665110896043941317L; |
||||
|
/** |
||||
|
* 巡查主记录id, 开始巡查反参 |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
/** |
||||
|
* 速度 |
||||
|
*/ |
||||
|
private String speed; |
||||
|
/** |
||||
|
* 位置的精确度 |
||||
|
*/ |
||||
|
private String accuracy; |
||||
|
/** |
||||
|
* 高度,单位m |
||||
|
*/ |
||||
|
private String altitude; |
||||
|
/** |
||||
|
* 垂直经度,单位m |
||||
|
*/ |
||||
|
private String verticalAccuracy; |
||||
|
/** |
||||
|
* 水平经度,单位m |
||||
|
*/ |
||||
|
private String horizontalAccuracy; |
||||
|
/** |
||||
|
* 序号,前端生成,后端记录 |
||||
|
*/ |
||||
|
private Integer serialNum; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dto.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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:16 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class StaffPatrolInitFormDTO { |
||||
|
|
||||
|
/** |
||||
|
* 当前工作人员基层治理所在网格id;可为空 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:32 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class StartPatrolFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -2765639550834711582L; |
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
/** |
||||
|
* 速度,如果拿不到默认0 |
||||
|
*/ |
||||
|
private String speed; |
||||
|
/** |
||||
|
* 序号;前端生成,后端负责记录,开始巡查赋值0 |
||||
|
*/ |
||||
|
private Integer serialNum; |
||||
|
|
||||
|
private String staffPatrolRecId; |
||||
|
|
||||
|
private String patrolEndTime; |
||||
|
} |
||||
@ -0,0 +1,65 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/7 2:57 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridManagerUserListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3606766812822179356L; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
|
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 正在巡查:patrolling;否则返回空字符串 |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称,最多显示上两级 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String staffName; |
||||
|
|
||||
|
/** |
||||
|
* 中心点位 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private String centerMark; |
||||
|
|
||||
|
/** |
||||
|
* 经纬度赋值状态 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private Boolean llStatus; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/8 4:30 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridStaffUserResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 7715622585539953368L; |
||||
|
|
||||
|
private String gridId; |
||||
|
|
||||
|
private String staffId; |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:24 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PatrolRecordDetailResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -1812674284508241468L; |
||||
|
/** |
||||
|
* 上传时间;yyyy-MM-dd HH:mm |
||||
|
*/ |
||||
|
private String uploadTime; |
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
/** |
||||
|
* 速度,单位m/s |
||||
|
*/ |
||||
|
private String speed; |
||||
|
/** |
||||
|
* 后端返回:开始巡查;结束巡查;此列只有集合第一条,和最后一条有值 |
||||
|
*/ |
||||
|
private String flag; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dto.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; |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:14 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PatrolUploadResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -1750373142795803118L; |
||||
|
/** |
||||
|
* 巡查主记录id |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.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; |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:17 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class StaffPatrolInitResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -1752690564468072256L; |
||||
|
/** |
||||
|
* 存在正在巡查中记录返回:patrolling;不存在:end |
||||
|
*/ |
||||
|
private String status; |
||||
|
/** |
||||
|
* 巡查记录id,status=patrolling时此列有值 |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
/** |
||||
|
* patrolling:返回最大的序号;status=end时,此列返回-1 |
||||
|
*/ |
||||
|
private Integer latestSerialNum; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 16:34 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class StartPatrolResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -8064467225255970920L; |
||||
|
/** |
||||
|
* 巡查记录id |
||||
|
*/ |
||||
|
private String staffPatrolRecId; |
||||
|
/** |
||||
|
* 最小时间间隔,单位s;默认30,后面可以做成客户可配置参数 |
||||
|
*/ |
||||
|
private Integer carmDown; |
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/9 11:12 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserNameAndLLResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 8997436689118596889L; |
||||
|
|
||||
|
/** |
||||
|
* 用户名字 |
||||
|
*/ |
||||
|
private List<UserNameResultDTO> userNames; |
||||
|
|
||||
|
/** |
||||
|
* 经纬度 |
||||
|
*/ |
||||
|
private List<GridManagerUserListResultDTO> ll; |
||||
|
|
||||
|
public UserNameAndLLResultDTO() { |
||||
|
this.userNames = new ArrayList<>(); |
||||
|
this.ll = new ArrayList<>(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/9 11:12 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserNameResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 5383959788021394553L; |
||||
|
|
||||
|
private String userId; |
||||
|
private String userName; |
||||
|
} |
||||
@ -0,0 +1,144 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.form.*; |
||||
|
import com.epmet.dto.result.*; |
||||
|
import com.epmet.service.StaffPatrolDetailService; |
||||
|
import com.epmet.service.StaffPatrolRecordService; |
||||
|
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 javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/6/7 15:49 |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/9 10:32 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("staffpatrol") |
||||
|
public class StaffPatrolController { |
||||
|
@Resource |
||||
|
private StaffPatrolDetailService staffPatrolDetailService; |
||||
|
@Resource |
||||
|
private StaffPatrolRecordService staffPatrolRecordService; |
||||
|
|
||||
|
/** |
||||
|
* 巡查界面初始化 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.StaffPatrolInitResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/7 16:40 |
||||
|
*/ |
||||
|
@PostMapping("init") |
||||
|
public Result<StaffPatrolInitResultDTO> init(@LoginUser TokenDto tokenDto, @RequestBody StaffPatrolInitFormDTO formDTO) { |
||||
|
StaffPatrolInitResultDTO result = staffPatrolRecordService.init(tokenDto, formDTO); |
||||
|
return new Result<StaffPatrolInitResultDTO>().ok(result); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 开始巡查 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.StartPatrolResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/7 16:46 |
||||
|
*/ |
||||
|
@PostMapping("startpatrol") |
||||
|
public Result<StartPatrolResultDTO> startPatrol(@LoginUser TokenDto tokenDto, @RequestBody StartPatrolFormDTO formDTO) { |
||||
|
StartPatrolResultDTO result = staffPatrolRecordService.startPatrol(tokenDto, formDTO); |
||||
|
return new Result<StartPatrolResultDTO>().ok(result); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 结束巡查 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/7 16:46 |
||||
|
*/ |
||||
|
@PostMapping("endpatrol") |
||||
|
public Result endPatrol(@LoginUser TokenDto tokenDto, @RequestBody StartPatrolFormDTO formDTO) { |
||||
|
staffPatrolRecordService.endPatrol(tokenDto, formDTO); |
||||
|
return new Result(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 上传巡查记录 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.PatrolUploadResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2021/6/7 16:46 |
||||
|
*/ |
||||
|
@PostMapping("uploaddetail") |
||||
|
public Result<PatrolUploadResultDTO> uploadDetail(@LoginUser TokenDto tokenDto, @RequestBody PatrolUploadFormDTO formDTO) { |
||||
|
PatrolUploadResultDTO result = staffPatrolRecordService.uploadDetail(tokenDto, formDTO); |
||||
|
return new Result<PatrolUploadResultDTO>().ok(result); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@PostMapping("uploaddetails") |
||||
|
public Result<PatrolUploadResultDTO> uploadDetails(@LoginUser TokenDto tokenDto, @RequestBody PatrolUploadDetailFormDTO formDTO) { |
||||
|
PatrolUploadResultDTO result = staffPatrolRecordService.uploadDetails(tokenDto, formDTO); |
||||
|
return new Result<PatrolUploadResultDTO>().ok(result); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询经纬度 |
||||
|
* @Param userIds |
||||
|
* @author zxc |
||||
|
* @date 2021/6/9 10:40 上午 |
||||
|
*/ |
||||
|
@PostMapping("getll") |
||||
|
public Result<UserNameAndLLResultDTO> selectll(@RequestBody List<String> userIds){ |
||||
|
return new Result<UserNameAndLLResultDTO>().ok(staffPatrolRecordService.selectLL(userIds)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 002、查看巡查记录 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:25 下午 |
||||
|
*/ |
||||
|
@PostMapping("recordlist") |
||||
|
public Result<List<RecordListResultDTO>> recordList(@RequestBody RecordListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class); |
||||
|
return new Result<List<RecordListResultDTO>>().ok(staffPatrolRecordService.recordList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 003、巡查轨迹 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 3:35 下午 |
||||
|
*/ |
||||
|
@PostMapping("patroltrack") |
||||
|
public Result<List<PatrolTrackResultDTO>> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class); |
||||
|
return new Result<List<PatrolTrackResultDTO>>().ok(staffPatrolRecordService.patrolTrack(formDTO)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.PatrolTrackResultDTO; |
||||
|
import com.epmet.entity.StaffPatrolDetailEntity; |
||||
|
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<StaffPatrolDetailEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询巡查轨迹 |
||||
|
* @Param staffPatrolRecId |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 5:13 下午 |
||||
|
*/ |
||||
|
List<PatrolTrackResultDTO> selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.form.RecordListFormDTO; |
||||
|
import com.epmet.dto.result.GridManagerUserListResultDTO; |
||||
|
import com.epmet.dto.result.RecordListResultDTO; |
||||
|
import com.epmet.entity.StaffPatrolRecordEntity; |
||||
|
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 StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询经纬度 |
||||
|
* @Param userIds |
||||
|
* @author zxc |
||||
|
* @date 2021/6/9 10:24 上午 |
||||
|
*/ |
||||
|
List<GridManagerUserListResultDTO> selectLL(@Param("userIds")List<String> userIds); |
||||
|
|
||||
|
/** |
||||
|
* @Description 巡查记录查询 |
||||
|
* @Param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2021/6/7 5:29 下午 |
||||
|
*/ |
||||
|
List<RecordListResultDTO> recordList(RecordListFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,101 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue