Merge remote-tracking branch 'origin/test_future_wangge' into test_future_wangge
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/CommonApi.java
| | |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("创建网格和网格员的关联关系请求参数") |
| | | @ApiModel("创建网格员请求参数") |
| | | public class EventGridMemberAddDTO { |
| | | |
| | | @NotBlank(message = "账号昵称不能为空") |
| | | @Length(max=50) |
| | | @ApiModelProperty(value = "账号昵称", hidden = false, example = "") |
| | | @ApiModelProperty(value = "账号昵称", example = "") |
| | | private String nickName; |
| | | |
| | | @NotBlank(message = "登录账号不能为空") |
| | |
| | | @NotBlank(message = "登录密码不能为空") |
| | | @Length(min = 8, max=100) |
| | | @ApiModelProperty(value = "登录密码", hidden = false, example = "") |
| | | private String passwd; |
| | | private String password; |
| | | |
| | | @NotBlank(message = "联系电话不能为空") |
| | | @Length(max=11) |
| | |
| | | @NotNull(message = "工作开始时间不能为空") |
| | | @Max(24) |
| | | @ApiModelProperty(value = "工作开始时间", hidden = false, example = "") |
| | | private Integer workStartAt; |
| | | private Integer workStartTime; |
| | | |
| | | @NotNull(message = "工作结束时间不能为空") |
| | | @Max(24) |
| | | @ApiModelProperty(value = "工作结束时间", hidden = false, example = "") |
| | | private String workEndAt; |
| | | private Integer workEndTime; |
| | | |
| | | @Length(max=255) |
| | | @ApiModelProperty(value = "头像", hidden = false, example = "") |
| | | private String imageUrl; |
| | | |
| | | @NotBlank() @Length(max=100) |
| | | @ApiModelProperty(value = "账号状态", hidden = false, example = "") |
| | | private String status; |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | |
| | | @ApiModelProperty(value = "社区ID", hidden = true, example = "1") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "网格员id", hidden = false, example = "") |
| | | private Long gridMemberId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 创建表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("修改网格员状态请求参数") |
| | | public class EventGridMemberEditStatusDTO { |
| | | |
| | | @ApiModelProperty(value = "需要修改的网格员id集合", example = "") |
| | | private List<Long> ids; |
| | | |
| | | @ApiModelProperty(value = "状态(1.启用 2.禁用)", example = "") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 网格员密码重置请求参数 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("网格员密码重置请求参数") |
| | | public class EventGridMemberPassResetDTO { |
| | | |
| | | @NotBlank(message = "登录密码不能为空") |
| | | @Length(min = 8, max=100) |
| | | @ApiModelProperty(value = "登录密码", hidden = false, example = "") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "网格员id集合", hidden = false, example = "") |
| | | private List<Long> ids; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | |
| | | /** |
| | | * 创建表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("网格员预警记录请求参数") |
| | | public class EventGridMemberWainDTO { |
| | | |
| | | @Length(max=50) |
| | | @ApiModelProperty(value = "关键词", example = "") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "网格员id", hidden = false, example = "") |
| | | private Long gridMemberId; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | |
| | | /** |
| | | * 网格员工作轨迹请求参数 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("网格员工作轨迹请求参数") |
| | | public class EventGridMemberWorkTrajectoryDTO { |
| | | |
| | | @ApiModelProperty(value = "工作日期(格式:yyyy-MM-dd)", example = "") |
| | | private String time; |
| | | |
| | | @ApiModelProperty(value = "网格员id", example = "") |
| | | private Long gridMemberId; |
| | | |
| | | @ApiModelProperty(value = "查询开始时间", hidden = true, example = "") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "查询结束时间", hidden = true, example = "") |
| | | private String endTime; |
| | | |
| | | } |
| | |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("查询区县/街道/社区/网格员网格数据管理请求参数") |
| | | @ApiModel("查询网格数据管理请求参数") |
| | | public class PageEventGridDataDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "排序字段, 默认createAt", example = "createAt") |
| | | private String sortAttr="createAt"; |
| | | |
| | | @ApiModelProperty(value = "排序方式: asc/desc(默认)", example = "desc") |
| | | @Pattern(regexp = "asc|desc|ASC|DESC") |
| | | private String sortType="desc"; |
| | | |
| | | public String getSortColumns(){ |
| | | String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr); |
| | | return dbColumn; |
| | | } |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "主键ID", hidden = false, example = "1") |
| | | private Long id; |
| | | |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "类型,1、区县网格2街道网格3社区网格", hidden = false, example = "1") |
| | | private Long type; |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "区/县ID", hidden = false, example = "1") |
| | | private Long zoneId; |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格所属街道", hidden = false, example = "1") |
| | | private Long gridStreetId; |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格所属社区ID", hidden = false, example = "1") |
| | | private Long gridCommunityId; |
| | | |
| | | |
| | | @NotBlank() @Length(max=100) |
| | | @ApiModelProperty(value = "网格名称", hidden = false, example = "") |
| | | private String gridName; |
| | | |
| | | |
| | | @Max(32767) |
| | | @ApiModelProperty(value = "所属图层", hidden = false, example = "1") |
| | | private Integer mapLevel; |
| | | |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "面积", hidden = false, example = "") |
| | | private String area; |
| | | |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "线条颜色", hidden = false, example = "") |
| | | private String lineColor; |
| | | |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "线条宽度", hidden = false, example = "") |
| | | private String lineBroadband; |
| | | |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "填充颜色", hidden = false, example = "") |
| | | private String fillColor; |
| | | |
| | | |
| | | @Length(max=255) |
| | | @ApiModelProperty(value = "备注", hidden = false, example = "") |
| | | private String remarks; |
| | | |
| | | |
| | | @Length(max=2147483647) |
| | | @ApiModelProperty(value = "围栏数据", hidden = false, example = "") |
| | | private String data; |
| | | |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "创建人", hidden = false, example = "1") |
| | | private Long createBy; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间-开始时间", hidden = false, example = "2021-05-01 18:05:50") |
| | | private Date createAtBegin; |
| | | @ApiModelProperty(value = "创建时间-结束时间", hidden = false, example = "2021-05-01 18:05:50") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAtEnd; |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "修改人", hidden = false, example = "1") |
| | | private Long updateBy; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "修改时间-开始时间", hidden = false, example = "2021-05-01 18:05:50") |
| | | private Date updateAtBegin; |
| | | @ApiModelProperty(value = "修改时间-结束时间", hidden = false, example = "2021-05-01 18:05:50") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAtEnd; |
| | | |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | @ApiModelProperty(value = "关键字", example = "") |
| | | private String keyWord; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "排序字段, 默认createAt", example = "createAt") |
| | | private String sortAttr="createAt"; |
| | | |
| | | @ApiModelProperty(value = "排序方式: asc/desc(默认)", example = "desc") |
| | | @Pattern(regexp = "asc|desc|ASC|DESC") |
| | | private String sortType="desc"; |
| | | |
| | | public String getSortColumns(){ |
| | | String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr); |
| | | return dbColumn; |
| | | } |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "主键ID", hidden = false, example = "1") |
| | | private Long id; |
| | | |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格所属街道", hidden = false, example = "1") |
| | | @ApiModelProperty(value = "网格所属街道id", hidden = false, example = "1") |
| | | private Long gridStreetId; |
| | | |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格所属社区ID", hidden = false, example = "1") |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格所属社区id", hidden = false, example = "1") |
| | | private Long gridCommunityId; |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "关键词", hidden = false, example = "") |
| | | private String keyWord; |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格ID", hidden = false, example = "1") |
| | | private Long gridId; |
| | | |
| | | |
| | | @NotBlank() @Length(max=100) |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "网格名称", hidden = false, example = "") |
| | | private String gridName; |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "账号昵称", hidden = true, example = "") |
| | | private String nickName; |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "网格员ID", hidden = false, example = "1") |
| | | private Long gridMemberId; |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "登录账号", hidden = true, example = "") |
| | | private String account; |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "联系电话", hidden = true, example = "") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "账号状态(1.启用 2.禁用)", example = "1") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "网格员工作状态(1.在岗 2.脱岗 3.已下班)", example = "1") |
| | | private Integer workStatus; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "创建人", hidden = false, example = "1") |
| | | private Long createBy; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间-开始时间", hidden = false, example = "2021-05-01 18:05:50") |
| | | private Date createAtBegin; |
| | | @ApiModelProperty(value = "创建时间-结束时间", hidden = false, example = "2021-05-01 18:05:50") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAtEnd; |
| | | |
| | | @ApiModelProperty(value = "网格员ID", hidden = true, example = "1") |
| | | private String gridMemberId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("管理后台-网格返回参数") |
| | | public class EventGridAdminVO { |
| | | |
| | | @ApiModelProperty(value = "网格id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "网格名称") |
| | | private String gridName; |
| | | @ApiModelProperty(value = "网格员") |
| | | private String gridMemberName; |
| | | @ApiModelProperty(value = "网格描述") |
| | | private String remarks; |
| | | @ApiModelProperty(value = "网格面积") |
| | | private BigDecimal area; |
| | | @ApiModelProperty(value = "居住人口") |
| | | private Integer populationTotal = 0; |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | @ApiModelProperty(value = "创建人") |
| | | private String createBy; |
| | | @ApiModelProperty(value = "线条颜色") |
| | | private String lineColor; |
| | | @ApiModelProperty(value = "线条宽度") |
| | | private String lineBroadband; |
| | | @ApiModelProperty(value = "填充颜色") |
| | | private String fillColor; |
| | | @ApiModelProperty(value = "围栏数据") |
| | | private String data; |
| | | @ApiModelProperty(value = "所在社区") |
| | | private String communityName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("管理后台-网格员返回参数") |
| | | public class EventGridMemberAdminVO { |
| | | |
| | | @ApiModelProperty(value = "网格id") |
| | | private Long userId; |
| | | @ApiModelProperty(value = "网格名称") |
| | | private String nickName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("网格员预警记录返回参数") |
| | | public class EventGridMemberWarnLogAdminVO { |
| | | |
| | | @ApiModelProperty(value = "主键ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "地点") |
| | | private String positionAddress; |
| | | |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "预警发生时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private String happenAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("管理后台-网格员返回参数") |
| | | public class GridMemberVO { |
| | | |
| | | @ApiModelProperty(value = "网格员id") |
| | | private Long userId; |
| | | @ApiModelProperty(value = "网格员头像") |
| | | private String imageUrl; |
| | | @ApiModelProperty(value = "账号昵称") |
| | | private String nickName; |
| | | @ApiModelProperty(value = "登录账号") |
| | | private String account; |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "网格员工作状态(1.在岗 2.脱岗 3.已下班)") |
| | | private String workStatus; |
| | | @ApiModelProperty(value = "账号状态(1 启用 2 禁用)") |
| | | private String status; |
| | | @ApiModelProperty(value = "所属社区") |
| | | private String communityName; |
| | | @ApiModelProperty(value = "网格员上班开始时间") |
| | | private Integer workStartTime; |
| | | @ApiModelProperty(value = "网格员上班结束时间") |
| | | private Integer workEndTime; |
| | | |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/eventgriddata/getGridTodoData") |
| | | R getGridTodoData(@RequestBody EventGridTodoDataDTO eventGridTodoDataDTO); |
| | | |
| | | /** |
| | | * 后台获取网格员运动轨迹 |
| | | * @param workTrajectoryDTO 请求参数 |
| | | * @return 运动轨迹 |
| | | */ |
| | | @PostMapping("/map/gridMemberWorkTrajectory") |
| | | R gridMemberWorkTrajectory(@RequestBody EventGridMemberWorkTrajectoryDTO workTrajectoryDTO); |
| | | |
| | | /** |
| | | * 后台获取网格员预警记录 |
| | | * @param gridMemberWainDTO 请求参数 |
| | | * @return 预警记录 |
| | | */ |
| | | @PostMapping("/map/gridMemberWorkWarning") |
| | | R gridMemberWorkWarning(@RequestBody EventGridMemberWainDTO gridMemberWainDTO); |
| | | |
| | | /** |
| | | * 分页查询网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * @return 网格列表 |
| | | */ |
| | | @PostMapping("/eventgriddata/data/list") |
| | | R getGridDataList(PageEventGridDataDTO eventGridDataDTO); |
| | | |
| | | /** |
| | | * 查询社区下所有网格员 |
| | | * @param communityId 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | @PostMapping("/eventgriddata/member/list") |
| | | R getGridMemberLists(@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditStatusDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberPassResetDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | |
| | | */ |
| | | @PostMapping("addGridUser") |
| | | R addGridUser(@RequestBody EventGridMemberAddDTO eventGridMemberAddDTO); |
| | | |
| | | /** |
| | | * 分页查询网格员 |
| | | * @param memberRelationDTO 请求参数 |
| | | * @return 结果 |
| | | */ |
| | | @PostMapping("member/list") |
| | | R getGridMemberList(@RequestBody PageEventGridMemberRelationDTO memberRelationDTO); |
| | | |
| | | /** |
| | | * 修改网格员信息 |
| | | * @param eventGridMemberAddDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("editGridUser") |
| | | R editGridUser(@RequestBody EventGridMemberAddDTO eventGridMemberAddDTO); |
| | | |
| | | /** |
| | | * 重置网格员密码 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 重置结果 |
| | | */ |
| | | @PostMapping("passResetUser") |
| | | R gridMemberPassReset(@RequestBody EventGridMemberPassResetDTO gridMemberDTO); |
| | | |
| | | /** |
| | | * 批量删除网格员 |
| | | * @param Ids 网格员id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteMembers") |
| | | R deleteMembers(@RequestBody List<Long> Ids); |
| | | |
| | | /** |
| | | * 批量修改网格员状态 |
| | | * @param gridMemberEditDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("gridMemberEditStatus") |
| | | R gridMemberEditStatus(@RequestBody EventGridMemberEditStatusDTO gridMemberEditDTO); |
| | | } |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/easy/") |
| | | @Api(tags = {"网格综治APP随手拍模块"}) |
| | | @Api(tags = {"网格综治APP随手拍模块@lyq"}) |
| | | public class EasyPhotoApi extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/map/") |
| | | @Api(tags = {"网格综治APP地图模块"}) |
| | | @Api(tags = {"网格综治APP地图模块@lyq"}) |
| | | public class MapApi extends BaseController { |
| | | |
| | | @Resource |
New file |
| | |
| | | package com.panzhihua.grid_app.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.ComMapGridDetailVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/statistics/") |
| | | @Api(tags = {"网格综治APP统计模块@lyq"}) |
| | | public class StatisticsApi extends BaseController { |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | @ApiOperation(value = "根据网格id查询统计详情-lyq",response = ComMapGridDetailVO.class) |
| | | @PostMapping("event") |
| | | public R getGridDetail(@RequestParam("gridId") Long gridId){ |
| | | if(gridId == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_backstage.api; |
| | | |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 公共接口 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-10 15:41 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/common/") |
| | | @Api(tags = {"公共接口"}) |
| | | public class CommonApi { |
| | | |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | /** |
| | | * 允许的图片文件后缀 |
| | | */ |
| | | private static List<String> fileExtensionAllow = Arrays.asList("gif", "jpg", "png", "jpeg"); |
| | | /** |
| | | * 允许的视频文件后缀 |
| | | */ |
| | | private static List<String> videoExtensionAllow = Arrays.asList("mp4", "mov"); |
| | | |
| | | @ApiOperation(value = "上传照片/视频 (jpg/jpeg/png/mp4/mov)") |
| | | @PostMapping(value = "uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) throws IOException { |
| | | // 微信图片内容校验 |
| | | // WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService().getSecCheckService(); |
| | | String property = System.getProperty("user.dir"); |
| | | |
| | | String fileExtension = ".jpg"; |
| | | |
| | | String originName = file.getOriginalFilename(); |
| | | AtomicBoolean isVideo = new AtomicBoolean(false); |
| | | videoExtensionAllow.forEach(ext ->{ |
| | | String originNameLowerCase = originName.toLowerCase(); |
| | | if(originNameLowerCase.endsWith("." +ext)){ |
| | | isVideo.set(true); |
| | | } |
| | | }); |
| | | if(isVideo.get()){ |
| | | fileExtension = ".mp4"; |
| | | } |
| | | |
| | | String fileName = property + File.separator + UUID.randomUUID().toString().replace("-", "") + fileExtension; |
| | | File file1 = new File(fileName); |
| | | |
| | | String name = file.getOriginalFilename(); |
| | | name = UUID.randomUUID().toString().replaceAll("-", "") + fileExtension; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | InputStream is = file.getInputStream(); |
| | | file.transferTo(file1); |
| | | boolean delete = file1.delete(); |
| | | log.info("临时文件删除【{}】", delete); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | sftp.logout(); |
| | | return R.ok(url + "/idcard/" + name); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogAdminVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataEditDTO; |
| | | //import com.panzhihua.common.model.vos.IPageVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridDataDTO; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/eventgriddata") |
| | | @Api(tags = {"网格数据管理 @chendong"}) |
| | | @Api(tags = {"网格数据管理 @lyq"}) |
| | | public class EventGridDataApi extends BaseController { |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 新增区县/街道/社区/网格员网格数据管理 |
| | | * @param {classNameFirstLower}AddDTO 添加区县/街道/社区/网格员网格数据管理传递对象 |
| | | * @return 新增结果 |
| | | * 网格员分页查询 |
| | | * @param memberRelationDTO 请求参数 |
| | | * @return 网格员列表 |
| | | */ |
| | | @PostMapping() |
| | | @ApiOperation(value = "新增网格数据管理", response = R.class) |
| | | R add(@Validated @RequestBody EventGridDataAddDTO eventGridDataAddDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridDataAddDTO); |
| | | eventGridDataAddDTO.setUserId(getUserId()); |
| | | return gridService.add(eventGridDataAddDTO); |
| | | @ApiOperation(value = "网格员分页查询", response = GridMemberVO.class) |
| | | @PostMapping("/member/list") |
| | | public R getGridMemberList(@Validated @RequestBody PageEventGridMemberRelationDTO memberRelationDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(memberRelationDTO); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请先登录"); |
| | | } |
| | | if(loginUserInfo.getCommunityId() != 0){ |
| | | memberRelationDTO.setGridCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | return userService.getGridMemberList(memberRelationDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param eventGridDataEditDTO 修改区县/街道/社区/网格员网格数据管理传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping() |
| | | @ApiOperation(value = "编辑网格数据管理", response = R.class) |
| | | R edit(@Validated @RequestBody EventGridDataEditDTO eventGridDataEditDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridDataEditDTO); |
| | | eventGridDataEditDTO.setUserId(getUserId()); |
| | | return gridService.edit(eventGridDataEditDTO); |
| | | @ApiOperation(value = "网格员添加") |
| | | @PostMapping("/member/add") |
| | | public R gridMemberAdd(@Validated @RequestBody EventGridMemberAddDTO gridMemberDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(gridMemberDTO); |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if(userInfoVO.getCommunityId() != null){ |
| | | gridMemberDTO.setCommunityId(userInfoVO.getCommunityId()); |
| | | } |
| | | return userService.addGridUser(gridMemberDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找 |
| | | * @param pageEventGridDataDTO 查找区县/街道/社区/网格员网格数据管理传递对象 |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping() |
| | | @ApiOperation(value = "查询网格数据管理", response= EventGridDataVO.class) |
| | | R query(@Validated @ModelAttribute PageEventGridDataDTO pageEventGridDataDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(pageEventGridDataDTO); |
| | | return gridService.query(pageEventGridDataDTO); |
| | | @ApiOperation(value = "网格员修改") |
| | | @PostMapping("/member/edit") |
| | | public R gridMemberEdit(@Validated @RequestBody EventGridMemberAddDTO gridMemberDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(gridMemberDTO); |
| | | return userService.editGridUser(gridMemberDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param eventGridDataDeleteDTO 删除区县/街道/社区/网格员网格数据管理传递对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping() |
| | | @ApiOperation(value = "删除网格数据管理", response = R.class) |
| | | R delete(@Validated @RequestBody EventGridDataDeleteDTO eventGridDataDeleteDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridDataDeleteDTO); |
| | | return gridService.delete(eventGridDataDeleteDTO); |
| | | @ApiOperation(value = "网格员密码重置") |
| | | @PostMapping("/member/pass/reset") |
| | | public R gridMemberPassReset(@Validated @RequestBody EventGridMemberPassResetDTO gridMemberDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(gridMemberDTO); |
| | | return userService.gridMemberPassReset(gridMemberDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询区县/街道/社区/网格员网格数据管理详细信息 |
| | | * @param id 网格数据管理 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询网格数据管理详细信息") |
| | | R<EventGridDataDetailsVO> details(@PathVariable("id") Long id){ |
| | | return gridService.eventGridDataDetails(id); |
| | | @ApiOperation(value = "批量删除网格员") |
| | | @PostMapping("/member/delete") |
| | | public R deleteMembers(@RequestBody List<Long> Ids){ |
| | | return userService.deleteMembers(Ids); |
| | | } |
| | | |
| | | @ApiOperation(value = "网格员工作轨迹") |
| | | @PostMapping("/member/work/trajectory") |
| | | public R gridMemberWorkTrajectory(@RequestBody EventGridMemberWorkTrajectoryDTO workTrajectoryDTO){ |
| | | if(StringUtils.isEmpty(workTrajectoryDTO.getTime())){ |
| | | workTrajectoryDTO.setTime(DateUtils.getCurrentDateStrymd()); |
| | | } |
| | | workTrajectoryDTO.setStartTime(workTrajectoryDTO.getTime() + " 00:00:00"); |
| | | workTrajectoryDTO.setEndTime(workTrajectoryDTO.getTime() + " 23:59:59"); |
| | | return gridService.gridMemberWorkTrajectory(workTrajectoryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "网格员工作预警",response = EventGridMemberWarnLogAdminVO.class) |
| | | @PostMapping("/member/work/warning") |
| | | public R gridMemberWorkWarning(@RequestBody EventGridMemberWainDTO gridMemberWainDTO){ |
| | | return gridService.gridMemberWorkWarning(gridMemberWainDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "网格员批量修改状态") |
| | | @PostMapping("/member/edit/status") |
| | | public R gridMemberEditStatus(@RequestBody EventGridMemberEditStatusDTO gridMemberEditDTO){ |
| | | return userService.gridMemberEditStatus(gridMemberEditDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberRelationDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | | |
| | | /** |
| | | * |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/eventgridmember") |
| | | @Api(tags = {"网格员管理"}) |
| | | @Api(tags = {"网格管理"}) |
| | | public class EventGridMemberRelationApi extends BaseController { |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | /** |
| | | * 新增网格和网格员的关联关系 |
| | | * @param eventGridMemberAddDTO 添加网格和网格员的关联关系传递对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping() |
| | | @ApiOperation(value = "新增网格员", response = R.class) |
| | | R add(@Validated @RequestBody EventGridMemberAddDTO eventGridMemberAddDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridMemberAddDTO); |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | eventGridMemberAddDTO.setUserId(loginUserInfoVO.getUserId()); |
| | | eventGridMemberAddDTO.setUserName(loginUserInfoVO.getName()); |
| | | return gridService.add(eventGridMemberAddDTO); |
| | | @ApiOperation(value = "网格分页查询", response = EventGridAdminVO.class) |
| | | @PostMapping("/event/list") |
| | | public R getGridDataList(@Validated @RequestBody PageEventGridDataDTO eventGridDataDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridDataDTO); |
| | | Long communityId = this.getCommunityId(); |
| | | if(communityId == null){ |
| | | return R.fail("请先登录"); |
| | | } |
| | | eventGridDataDTO.setGridCommunityId(communityId); |
| | | return gridService.getGridDataList(eventGridDataDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param eventGridMemberEditDTO 修改网格和网格员的关联关系传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping() |
| | | @ApiOperation(value = "编辑网格员", response = R.class) |
| | | R edit(@Validated @RequestBody EventGridMemberEditDTO eventGridMemberEditDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridMemberEditDTO); |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | eventGridMemberEditDTO.setUserId(loginUserInfoVO.getUserId()); |
| | | eventGridMemberEditDTO.setUserName(loginUserInfoVO.getName()); |
| | | return gridService.edit(eventGridMemberEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找 |
| | | * @param pageEventGridMemberRelationDTO 查找网格和网格员的关联关系传递对象 |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping() |
| | | @ApiOperation(value = "查询网格员", response= EventGridMemberRelationVO.class) |
| | | R query(@Validated @ModelAttribute PageEventGridMemberRelationDTO pageEventGridMemberRelationDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(pageEventGridMemberRelationDTO); |
| | | return gridService.query(pageEventGridMemberRelationDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param eventGridMemberRelationDeleteDTO 删除网格和网格员的关联关系传递对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping() |
| | | @ApiOperation(value = "删除网格和网格员的关联关系", response = R.class) |
| | | R delete(@Validated @RequestBody EventGridMemberRelationDeleteDTO eventGridMemberRelationDeleteDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventGridMemberRelationDeleteDTO); |
| | | return gridService.delete(eventGridMemberRelationDeleteDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询网格和网格员的关联关系详细信息 |
| | | * @param id 网格和网格员的关联关系 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询网格和网格员的关联关系详细信息") |
| | | R<EventGridMemberRelationDetailsVO> details(@PathVariable("id") Long id){ |
| | | return gridService.eventGridMemberRelationDetails(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询网格员工作轨迹 |
| | | * @param userId 网格id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/locus/{userId}") |
| | | @ApiOperation(value = "查询网格员工作轨迹") |
| | | R locus(@PathVariable("userId") Long userId){ |
| | | return gridService.eventGridMemberRelationDetails(userId); |
| | | } |
| | | |
| | | /** |
| | | * 启用 |
| | | * @param userId 网格id |
| | | * @return 查找结果 |
| | | */ |
| | | @PutMapping("/on/{userId}") |
| | | @ApiOperation(value = "启用网格员") |
| | | R toggleOn(@PathVariable("userId") Long userId){ |
| | | return gridService.eventGridMemberRelationDetails(userId); |
| | | } |
| | | |
| | | /** |
| | | * 禁用 |
| | | * @param userId 网格id |
| | | * @return 查找结果 |
| | | */ |
| | | @PutMapping("/off/{userId}") |
| | | @ApiOperation(value = "禁用网格员") |
| | | R toggleOff(@PathVariable("userId") Long userId){ |
| | | return gridService.eventGridMemberRelationDetails(userId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 工作预警记录 |
| | | * @param userId 网格id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/gpslog/{userId}") |
| | | @ApiOperation(value = "工作预警记录") |
| | | R gpslog(@PathVariable("userId") Long userId){ |
| | | return gridService.eventGridMemberRelationDetails(userId); |
| | | @ApiOperation(value = "查询当前社区所有网格员", response = EventGridMemberAdminVO.class) |
| | | @PostMapping("/member/list") |
| | | public R getGridMemberLists(){ |
| | | Long communityId = this.getCommunityId(); |
| | | if(communityId == null){ |
| | | return R.fail("请先登录"); |
| | | } |
| | | return gridService.getGridMemberLists(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | @PostMapping("/add") |
| | | R add(@RequestBody EventGridDataAddDTO eventGridDataAddDTO){ |
| | | return eventGridDataService.add(eventGridDataAddDTO); |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 修改区县/街道/社区/网格员网格数据管理 |
| | |
| | | @PostMapping("/edit") |
| | | R edit(@RequestBody EventGridDataEditDTO eventGridDataEditDTO){ |
| | | return eventGridDataService.edit(eventGridDataEditDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 分页查找区县/街道/社区/网格员网格数据管理 |
| | | * @param pageEventGridDataDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | R<IPage<EventGridDataVO>> query(@RequestBody PageEventGridDataDTO pageEventGridDataDTO){ |
| | | return eventGridDataService.query(pageEventGridDataDTO); |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 删除区县/街道/社区/网格员网格数据管理 |
| | |
| | | @PostMapping("/delete") |
| | | R delete(@RequestBody EventGridDataDeleteDTO EventGridDataDeleteDTO){ |
| | | return eventGridDataService.delete(EventGridDataDeleteDTO); |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 查询区县/街道/社区/网格员网格数据管理详细信息 |
| | |
| | | @PostMapping("/{id}") |
| | | R<EventGridDataDetailsVO> eventGridDataDetails(@PathVariable("id") Long id){ |
| | | return eventGridDataService.eventGridDataDetails(id); |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * @return 网格列表 |
| | | */ |
| | | @PostMapping("/data/list") |
| | | public R getGridMemberList(@RequestBody PageEventGridDataDTO eventGridDataDTO){ |
| | | return eventGridDataService.getGridMemberList(eventGridDataDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区下所有网格员 |
| | | * @param communityId 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | @PostMapping("/member/list") |
| | | public R getGridMemberLists(@RequestParam("communityId") Long communityId){ |
| | | return eventGridDataService.getGridMemberLists(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 首页待处理 |
| | |
| | | package com.panzhihua.service_grid.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWainDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWorkTrajectoryDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_grid.service.EventGridDataService; |
| | | import com.panzhihua.service_grid.service.EventGridMemberGpsLogService; |
| | | import com.panzhihua.service_grid.service.EventGridMemberRelationService; |
| | | import com.panzhihua.service_grid.service.EventService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_grid.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | private EventGridDataService eventGridDataService; |
| | | @Resource |
| | | private EventGridMemberGpsLogService eventGridMemberGpsLogService; |
| | | @Resource |
| | | private EventGridMemberWarnLogService eventGridMemberWarnLogService; |
| | | @Resource |
| | | private EventGridMemberRelationService eventGridMemberRelationService; |
| | | |
| | |
| | | return eventGridMemberRelationService.getMapGridListByApp(userId); |
| | | } |
| | | |
| | | /** |
| | | * 后台获取网格员运动轨迹 |
| | | * @param workTrajectoryDTO 请求参数 |
| | | * @return 运动轨迹 |
| | | */ |
| | | @PostMapping("gridMemberWorkTrajectory") |
| | | public R gridMemberWorkTrajectory(@RequestBody EventGridMemberWorkTrajectoryDTO workTrajectoryDTO){ |
| | | if(StringUtils.isEmpty(workTrajectoryDTO.getTime())){ |
| | | workTrajectoryDTO.setTime(DateUtils.getCurrentDateStrymd()); |
| | | } |
| | | return eventGridMemberGpsLogService.gridMemberWorkTrajectory(workTrajectoryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 后台获取网格员预警记录 |
| | | * @param gridMemberWainDTO 请求参数 |
| | | * @return 预警记录 |
| | | */ |
| | | @PostMapping("gridMemberWorkWarning") |
| | | public R gridMemberWorkWarning(@RequestBody EventGridMemberWainDTO gridMemberWainDTO){ |
| | | return eventGridMemberWarnLogService.gridMemberWorkWarning(gridMemberWainDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridDataDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.UserEventGridDataVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridAdminVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberAdminVO; |
| | | import com.panzhihua.service_grid.model.dos.EventGridDataDO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param pageEventGridDataDTO |
| | | * @param eventGridDataDTO |
| | | * @return |
| | | */ |
| | | IPage<EventGridDataVO> findByPage(Page page, @Param("pageEventGridDataDTO") PageEventGridDataDTO pageEventGridDataDTO); |
| | | IPage<EventGridAdminVO> findByPage(Page page, @Param("eventGridDataDTO") PageEventGridDataDTO eventGridDataDTO); |
| | | |
| | | /** |
| | | * 分页查询网格员所在网格 |
| | |
| | | * @return |
| | | */ |
| | | List<UserEventGridDataVO> getGridTodoData(@Param("eventGridTodoDataDTO") EventGridTodoDataDTO eventGridTodoDataDTO); |
| | | /** |
| | | * 查询社区下所有网格员 |
| | | * @param communityId 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | List<EventGridMemberAdminVO> getGridMemberLists(@Param("communityId") Long communityId); |
| | | |
| | | List<String> getGridMember(@Param("gridId") Long gridId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWorkTrajectoryDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberGpsLogDTO; |
| | | import com.panzhihua.common.model.vos.grid.EventMapTrajectoryVO; |
| | | import com.panzhihua.service_grid.model.dos.EventGridMemberGpsLogDO; |
| | |
| | | |
| | | List<EventMapTrajectoryVO> getTrajectoryByApp(@Param("userId") Long userId); |
| | | |
| | | List<String> gridMemberWorkTrajectory(@Param("workTrajectoryDTO") EventGridMemberWorkTrajectoryDTO workTrajectoryDTO); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_grid.dao; |
| | | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWainDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberWarnLogDTO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogAdminVO; |
| | | import com.panzhihua.service_grid.model.dos.EventGridMemberWarnLogDO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | * @since 1.0 |
| | | */ |
| | | @Mapper |
| | | public interface EventGridMemberWarnLogMapper extends BaseMapper<EventGridMemberWarnLogDO> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param pageEventGridMemberWarnLogDTO |
| | | * @return |
| | | */ |
| | | IPage<EventGridMemberWarnLogVO> findByPage(Page page, @Param("pageEventGridMemberWarnLogDTO")PageEventGridMemberWarnLogDTO pageEventGridMemberWarnLogDTO); |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param pageEventGridMemberWarnLogDTO |
| | | * @return |
| | | */ |
| | | IPage<EventGridMemberWarnLogVO> findByPage(Page page, @Param("pageEventGridMemberWarnLogDTO") PageEventGridMemberWarnLogDTO pageEventGridMemberWarnLogDTO); |
| | | |
| | | /** |
| | | * 后台获取网格员预警记录 |
| | | * @param gridMemberWainDTO 请求参数 |
| | | * @return 预警记录 |
| | | */ |
| | | IPage<EventGridMemberWarnLogAdminVO> gridMemberWorkWarning(Page page, @Param("gridMemberWainDTO") EventGridMemberWainDTO gridMemberWainDTO); |
| | | |
| | | } |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | /** |
| | | * 定位地址信息 列:position_address |
| | | */ |
| | | private String positionAddress; |
| | | } |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | /** |
| | | * 定位地址信息 列:position_address |
| | | */ |
| | | private String positionAddress; |
| | | } |
| | |
| | | R edit(EventGridDataEditDTO eventGridDataEditDTO); |
| | | |
| | | /** |
| | | * 分页查找区县/街道/社区/网格员网格数据管理 |
| | | * @param pageEventGridDataDTO |
| | | * @return 维护结果 |
| | | */ |
| | | R<IPage<EventGridDataVO>> query(PageEventGridDataDTO pageEventGridDataDTO); |
| | | |
| | | /** |
| | | * 删除区县/街道/社区/网格员网格数据管理 |
| | | * @param EventGridDataDeleteDTO |
| | | * @return 平台用户信息 |
| | |
| | | * @return |
| | | */ |
| | | R getGridTodoData(EventGridTodoDataDTO eventGridTodoDataDTO); |
| | | |
| | | /** |
| | | * 分页查询网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * @return 网格列表 |
| | | */ |
| | | R getGridMemberList(PageEventGridDataDTO eventGridDataDTO); |
| | | |
| | | /** |
| | | * 查询社区下所有网格员 |
| | | * @param communityId 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | R getGridMemberLists(Long communityId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberGpsLogDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberGpsLogDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberGpsLogVO; |
| | |
| | | */ |
| | | R getTrajectoryByApp(Long userId); |
| | | |
| | | /** |
| | | * 后台获取网格员运动轨迹 |
| | | * @param workTrajectoryDTO 请求参数 |
| | | * @return 运动轨迹 |
| | | */ |
| | | R gridMemberWorkTrajectory(EventGridMemberWorkTrajectoryDTO workTrajectoryDTO); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberRelationDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | |
| | | R getMapGridListByApp(Long userId); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWarnLogAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWarnLogDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWarnLogEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberWarnLogDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogVO; |
| | |
| | | */ |
| | | R<EventGridMemberWarnLogDetailsVO> eventGridMemberWarnLogDetails(Long id); |
| | | |
| | | /** |
| | | * 后台获取网格员预警记录 |
| | | * @param gridMemberWainDTO 请求参数 |
| | | * @return 预警记录 |
| | | */ |
| | | R gridMemberWorkWarning(EventGridMemberWainDTO gridMemberWainDTO); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.google.common.base.Joiner; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridDataDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.service_grid.dao.*; |
| | |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找区县/街道/社区/网格员网格数据管理 |
| | | * @param pageEventGridDataDTO |
| | | * @return 维护结果 |
| | | */ |
| | | public R<IPage<EventGridDataVO>> query(PageEventGridDataDTO pageEventGridDataDTO){ |
| | | Page page = new Page(1,10); |
| | | if(pageEventGridDataDTO.getPageNum()!=null) { |
| | | page.setCurrent(pageEventGridDataDTO.getPageNum()); |
| | | } |
| | | if(pageEventGridDataDTO.getPageSize()!=null) { |
| | | page.setSize(pageEventGridDataDTO.getPageSize()); |
| | | } |
| | | return R.ok(eventGridDataMapper.findByPage(page, pageEventGridDataDTO)); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(userEventGridDataVO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * @return 网格列表 |
| | | */ |
| | | @Override |
| | | public R getGridMemberList(PageEventGridDataDTO eventGridDataDTO){ |
| | | IPage<EventGridAdminVO> gridAdminVOIPage = this.baseMapper.findByPage(new Page(eventGridDataDTO.getPageNum(),eventGridDataDTO.getPageSize()),eventGridDataDTO); |
| | | if(!gridAdminVOIPage.getRecords().isEmpty()){ |
| | | gridAdminVOIPage.getRecords().forEach(gridMember -> { |
| | | List<String> members = this.baseMapper.getGridMember(gridMember.getId()); |
| | | if(!members.isEmpty()){ |
| | | String memberNames = Joiner.on(",").join(members); |
| | | gridMember.setGridMemberName(memberNames); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(gridAdminVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区下所有网格员 |
| | | * @param communityId 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | @Override |
| | | public R getGridMemberLists(Long communityId){ |
| | | return R.ok(this.baseMapper.getGridMemberLists(communityId)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberGpsLogEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberGpsLogDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberGpsLogDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberGpsLogVO; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | return R.ok(this.baseMapper.getTrajectoryByApp(userId)); |
| | | } |
| | | |
| | | /** |
| | | * 后台获取网格员运动轨迹 |
| | | * @param workTrajectoryDTO 请求参数 |
| | | * @return 运动轨迹 |
| | | */ |
| | | @Override |
| | | public R gridMemberWorkTrajectory(EventGridMemberWorkTrajectoryDTO workTrajectoryDTO){ |
| | | List<String> workTrajectorys = new ArrayList<>(); |
| | | workTrajectorys = this.baseMapper.gridMemberWorkTrajectory(workTrajectoryDTO); |
| | | return R.ok(workTrajectorys); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberRelationDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWarnLogAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWarnLogDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberWarnLogEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberWarnLogDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogVO; |
| | |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 后台获取网格员预警记录 |
| | | * @param gridMemberWainDTO 请求参数 |
| | | * @return 预警记录 |
| | | */ |
| | | @Override |
| | | public R gridMemberWorkWarning(EventGridMemberWainDTO gridMemberWainDTO){ |
| | | return R.ok(this.baseMapper.gridMemberWorkWarning(new Page(gridMemberWainDTO.getPageNum(),gridMemberWainDTO.getPageSize()),gridMemberWainDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | </sql> |
| | | |
| | | |
| | | <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventGridDataVO" |
| | | <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventGridAdminVO" |
| | | parameterType="com.panzhihua.common.model.dtos.grid.PageEventGridDataDTO"> |
| | | SELECT <include refid="columns" /> |
| | | FROM event_grid_data |
| | | SELECT DISTINCT |
| | | egd.id, |
| | | egd.grid_name, |
| | | egd.remarks, |
| | | egd.area, |
| | | egd.line_color, |
| | | egd.line_broadband, |
| | | egd.fill_color, |
| | | egd.data, |
| | | egd.create_at, |
| | | egd.create_by, |
| | | ca.`name` AS communityName |
| | | FROM |
| | | event_grid_data AS egd |
| | | LEFT JOIN com_act AS ca ON ca.community_id = egd.grid_community_id |
| | | LEFT JOIN event_grid_member_relation AS egmr ON egmr.grid_id = egd.id |
| | | left join sys_user as su on su.user_id = egmr.grid_member_id |
| | | <where> |
| | | <if test="pageEventGridDataDTO.id!=null"> |
| | | AND id = #{pageEventGridDataDTO.id} |
| | | <if test="pageEventGridDataDTO.gridStreetId!=null"> |
| | | AND egd.grid_street_id = #{pageEventGridDataDTO.gridStreetId} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.type!=null"> |
| | | AND type = #{pageEventGridDataDTO.type} |
| | | <if test="pageEventGridDataDTO.gridCommunityId!=null"> |
| | | AND egd.grid_community_id = #{pageEventGridDataDTO.gridCommunityId} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.zoneId!=null"> |
| | | AND zone_id = #{pageEventGridDataDTO.zoneId} |
| | | |
| | | <if test="pageEventGridDataDTO.keyWord != null and pageEventGridDataDTO.keyWord != """> |
| | | AND (egd.grid_name like concat(#{pageEventGridDataDTO.keyWord},'%') or su.nick_name like concat(#{pageEventGridDataDTO.keyWord},'%')) |
| | | </if> |
| | | <if test="pageEventGridDataDTO.gridStreetId!=null"> |
| | | AND grid_street_id = #{pageEventGridDataDTO.gridStreetId} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.gridCommunityId!=null"> |
| | | AND grid_community_id = #{pageEventGridDataDTO.gridCommunityId} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.gridName!=null"> |
| | | AND grid_name = #{pageEventGridDataDTO.gridName} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.mapLevel!=null"> |
| | | AND map_level = #{pageEventGridDataDTO.mapLevel} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.area!=null"> |
| | | AND area = #{pageEventGridDataDTO.area} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.lineColor!=null"> |
| | | AND line_color = #{pageEventGridDataDTO.lineColor} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.lineBroadband!=null"> |
| | | AND line_broadband = #{pageEventGridDataDTO.lineBroadband} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.fillColor!=null"> |
| | | AND fill_color = #{pageEventGridDataDTO.fillColor} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.remarks!=null"> |
| | | AND remarks = #{pageEventGridDataDTO.remarks} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.data!=null"> |
| | | AND data = #{pageEventGridDataDTO.data} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.createBy!=null"> |
| | | AND create_by = #{pageEventGridDataDTO.createBy} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.createAtBegin!=null"> |
| | | AND create_at >= #{pageEventGridDataDTO.createAtBegin} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.createAtEnd!=null"> |
| | | AND create_at <= #{pageEventGridDataDTO.createAtEnd} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.updateBy!=null"> |
| | | AND update_by = #{pageEventGridDataDTO.updateBy} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.updateAtBegin!=null"> |
| | | AND update_at >= #{pageEventGridDataDTO.updateAtBegin} |
| | | </if> |
| | | <if test="pageEventGridDataDTO.updateAtEnd!=null"> |
| | | AND update_at <= #{pageEventGridDataDTO.updateAtEnd} |
| | | </if> |
| | | </where> |
| | | <if test="pageEventGridDataDTO.sortColumns!=null"> |
| | | ORDER BY ${pageEventGridDataDTO.sortColumns} ${pageEventGridDataDTO.sortType} |
| | | </if> |
| | | ORDER BY create_at desc |
| | | </select> |
| | | <select id="selectUserGrid" resultType="com.panzhihua.common.model.vos.grid.EventGridDataVO" |
| | | parameterType="com.panzhihua.common.model.dtos.grid.PageEventGridDataDTO"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getGridMemberLists" resultType="com.panzhihua.common.model.vos.grid.EventGridMemberAdminVO"> |
| | | select user_id,nick_name from sys_user where act_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="getGridMember" resultType="String"> |
| | | SELECT |
| | | su.nick_name |
| | | FROM |
| | | event_grid_member_relation AS egmr |
| | | LEFT JOIN sys_user AS su ON su.user_id = egmr.grid_member_id |
| | | WHERE |
| | | egmr.grid_id = #{gridId} |
| | | </select> |
| | | |
| | | <select id="getGridTodoData" resultType="com.panzhihua.common.model.vos.grid.UserEventGridDataVO" |
| | | parameterType="com.panzhihua.common.model.dtos.grid.EventGridTodoDataDTO"> |
| | | SELECT IFNULL(SUM(t.todoNums), 0), 1 event_type |
| | |
| | | create_at ASC |
| | | </select> |
| | | |
| | | <select id="gridMemberWorkTrajectory" resultType="String" parameterType="com.panzhihua.common.model.dtos.grid.EventGridMemberWorkTrajectoryDTO"> |
| | | SELECT |
| | | lng_lat |
| | | FROM |
| | | event_grid_member_gps_log |
| | | WHERE |
| | | create_at BETWEEN #{workTrajectoryDTO.startTime} |
| | | AND #{workTrajectoryDTO.endTime} |
| | | AND grid_member_id = #{workTrajectoryDTO.gridMemberId} |
| | | ORDER BY |
| | | create_at ASC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="gridMemberWorkWarning" parameterType="com.panzhihua.common.model.dtos.grid.EventGridMemberWainDTO" resultType="com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogAdminVO"> |
| | | SELECT |
| | | id, |
| | | position_address, |
| | | content, |
| | | happen_at |
| | | FROM |
| | | event_grid_member_warn_log |
| | | WHERE |
| | | grid_member_id = #{gridMemberWainDTO.gridMemberId} |
| | | <if test="gridMemberWainDTO.keyWord!=null and gridMemberWainDTO.keyWord!= """> |
| | | AND (content like concat(#{gridMemberWainDTO.keyWord},'%') or position_address like concat(#{gridMemberWainDTO.keyWord},'%')) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | //package com.panzhihua.service_user.api; |
| | | // |
| | | //import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | //import com.panzhihua.common.model.vos.R; |
| | | //import com.panzhihua.service_user.service.UserService; |
| | | //import lombok.extern.slf4j.Slf4j; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.RequestBody; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | // |
| | | ///** |
| | | // * 网格员管理 |
| | | // */ |
| | | // |
| | | //@Slf4j |
| | | //@RestController("/grid/") |
| | | //public class GridMemberApi { |
| | | // |
| | | // @Resource |
| | | // private UserService userService; |
| | | // |
| | | // /** |
| | | // * 网格员管理 |
| | | // * @param memberRelationDTO 请求参数 |
| | | // * @return 网格员列表 |
| | | // */ |
| | | // @PostMapping("/member/list") |
| | | // public R getGridMemberList(@RequestBody PageEventGridMemberRelationDTO memberRelationDTO){ |
| | | // return userService.getGridMemberList(memberRelationDTO); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | //} |
| | |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditStatusDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberPassResetDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.EditUserInfoPassAppDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.service_user.service.SysUserInputService; |
| | | import com.panzhihua.service_user.service.UserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | R addGridUser(@RequestBody EventGridMemberAddDTO eventGridMemberAddDTO){ |
| | | return userService.addGridUser(eventGridMemberAddDTO); |
| | | } |
| | | |
| | | /** |
| | | * 网格员管理 |
| | | * @param memberRelationDTO 请求参数 |
| | | * @return 网格员列表 |
| | | */ |
| | | @PostMapping("member/list") |
| | | public R getGridMemberList(@RequestBody PageEventGridMemberRelationDTO memberRelationDTO){ |
| | | return userService.getGridMemberList(memberRelationDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改网格员信息 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("editGridUser") |
| | | public R gridMemberEdit(@RequestBody EventGridMemberAddDTO gridMemberDTO){ |
| | | return userService.editGridUser(gridMemberDTO); |
| | | } |
| | | |
| | | /** |
| | | * 重置网格员密码 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 重置结果 |
| | | */ |
| | | @PostMapping("passResetUser") |
| | | public R passResetUser(@RequestBody EventGridMemberPassResetDTO gridMemberDTO){ |
| | | return userService.passResetUser(gridMemberDTO); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除网格员 |
| | | * @param Ids 网格员id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteMembers") |
| | | public R deleteMembers(@RequestBody List<Long> Ids){ |
| | | return userService.deleteMembers(Ids); |
| | | } |
| | | |
| | | @PostMapping("gridMemberEditStatus") |
| | | public R gridMemberEditStatus(@RequestBody EventGridMemberEditStatusDTO gridMemberEditDTO){ |
| | | return userService.gridMemberEditStatus(gridMemberEditDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditStatusDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberPassResetDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.vos.IndexDataKanbanVO; |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserVO; |
| | |
| | | @Select("select id from com_pb_member where audit_result = 1 and id_card = #{idCard}") |
| | | Long getPartyBuildingByIdCard(@Param("idCard")String idCard); |
| | | |
| | | @Select("<script>" + |
| | | "select su.user_id,su.image_url,su.nick_name,su.account,su.phone,su.work_status,su.`status`" + |
| | | ",ca.name as communityName,su.work_start_time,su.work_end_time from sys_user su" + |
| | | " left join com_act as ca on ca.community_id = su.community_id" + |
| | | " where su.type = 6 " + |
| | | "<if test='memberRelationDTO.status != null'>" + |
| | | "AND su.status = #{memberRelationDTO.status} " + |
| | | " </if> " + |
| | | "<if test='memberRelationDTO.gridCommunityId != null'>" + |
| | | "AND ca.community_id = #{memberRelationDTO.gridCommunityId} " + |
| | | " </if> " + |
| | | "<if test='memberRelationDTO.gridStreetId != null'>" + |
| | | "AND ca.street_id = #{memberRelationDTO.gridStreetId} " + |
| | | " </if> " + |
| | | "<if test='memberRelationDTO.workStatus != null'>" + |
| | | "AND su.work_status = #{memberRelationDTO.workStatus} " + |
| | | " </if> " + |
| | | "<if test='memberRelationDTO.keyWord != null and memberRelationDTO.keyWord != ""'>" + |
| | | "and (su.nick_name like concat(#{memberRelationDTO.keyWord},'%') OR su.user_id = #{memberRelationDTO.keyWord} OR su.account like concat(#{memberRelationDTO.keyWord},'%') OR su.phone like concat(#{memberRelationDTO.keyWord},'%'))" + |
| | | " </if> " + |
| | | " order by su.create_at desc" + |
| | | "</script>") |
| | | IPage<GridMemberVO> getGridMemberList(Page page, @Param("memberRelationDTO") PageEventGridMemberRelationDTO memberRelationDTO); |
| | | |
| | | @Select("<script>" + |
| | | "update sys_user" + |
| | | " set status = #{gridMemberEditDTO.status}" + |
| | | " where user_id in " + |
| | | "<foreach item=\"item\" collection=\"gridMemberEditDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" + |
| | | "#{item}\n" + |
| | | "</foreach>\n" + |
| | | "</script>") |
| | | void gridMemberEditStatus(@Param("gridMemberEditDTO") EventGridMemberEditStatusDTO gridMemberEditDTO); |
| | | |
| | | @Select("<script>" + |
| | | "update sys_user" + |
| | | " set password = #{gridMemberDTO.password}" + |
| | | " where user_id in " + |
| | | "<foreach item=\"item\" collection=\"gridMemberDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" + |
| | | "#{item}\n" + |
| | | "</foreach>\n" + |
| | | "</script>") |
| | | void passResetUser(@Param("gridMemberDTO") EventGridMemberPassResetDTO gridMemberDTO); |
| | | |
| | | } |
| | |
| | | * 户口本照片 逗号隔开 |
| | | */ |
| | | private String familyBook; |
| | | /** |
| | | * 网格员工作状态(1.在岗 2.脱岗 3.已下班) |
| | | */ |
| | | private Integer workStatus; |
| | | /** |
| | | * 网格员上班开始时间 |
| | | */ |
| | | private Integer workStartTime; |
| | | /** |
| | | * 网格员上班结束时间 |
| | | */ |
| | | private Integer workEndTime; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditStatusDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberPassResetDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | * @return 结果 |
| | | */ |
| | | R addGridUser(EventGridMemberAddDTO eventGridMemberAddDTO); |
| | | |
| | | /** |
| | | * 网格员管理 |
| | | * @param memberRelationDTO 请求参数 |
| | | * @return 网格员列表 |
| | | */ |
| | | R getGridMemberList(PageEventGridMemberRelationDTO memberRelationDTO); |
| | | |
| | | /** |
| | | * 网格员编辑 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | R editGridUser(EventGridMemberAddDTO gridMemberDTO); |
| | | |
| | | /** |
| | | * 网格员重置密码 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 重置结果 |
| | | */ |
| | | R passResetUser(EventGridMemberPassResetDTO gridMemberDTO); |
| | | |
| | | R deleteMembers(List<Long> Ids); |
| | | |
| | | R gridMemberEditStatus(EventGridMemberEditStatusDTO gridMemberEditDTO); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditStatusDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberPassResetDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | |
| | | import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | //import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.RealNameUtil; |
| | |
| | | private SysMenuDAO sysMenuDAO; |
| | | @Resource |
| | | private SysUserInputDAO sysUserInputDAO; |
| | | @Resource |
| | | private GridService gridService; |
| | | // @Resource |
| | | // private GridService gridService; |
| | | |
| | | /** |
| | | * 小程序微信用户信息更新 |
| | |
| | | List<SysMenuDO> menuDOList = sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda().eq(SysMenuDO::getCommunityId, 2l).orderByAsc(SysMenuDO::getOrderNum)); |
| | | menuIds = menuDOList.stream().map(sysMenuDO -> sysMenuDO.getMenuId()).collect(Collectors.toList()); |
| | | for (int i = 0; i < menuIds.size(); i++) { |
| | | SysRoleMenuDO sysRoleMenuDO = new SysRoleMenuDO(); |
| | | sysRoleMenuDO.setMenuId(menuIds.get(i)); |
| | | sysRoleMenuDO.setRoleId(roleId); |
| | | sysRoleMenuDAO.insert(sysRoleMenuDO); |
| | | SysRoleMenuDO sysRoleMenuDO = sysRoleMenuDAO.selectOne(new QueryWrapper<SysRoleMenuDO>().lambda().eq(SysRoleMenuDO::getMenuId,menuIds.get(i)) |
| | | .eq(SysRoleMenuDO::getRoleId,roleId)); |
| | | if(sysRoleMenuDO == null){ |
| | | sysRoleMenuDO.setMenuId(menuIds.get(i)); |
| | | sysRoleMenuDO.setRoleId(roleId); |
| | | sysRoleMenuDAO.insert(sysRoleMenuDO); |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加网格员 |
| | | * @param eventGridMemberAddDTO 请求参数 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addGridUser(EventGridMemberAddDTO eventGridMemberAddDTO) { |
| | |
| | | SysRoleDO gridMemberDefaultRole = roleDAO.selectOne(new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getRoleKey, Constants.GRID_DEFAULT_ROLE_KEY)); |
| | | if(gridMemberDefaultRole==null) { |
| | | //添加默认网格员角色 |
| | | SysRoleDO sysRoleDO = new SysRoleDO(); |
| | | sysRoleDO.setCommunityId(0L); |
| | | sysRoleDO.setRoleName("网格员默认角色"); |
| | | sysRoleDO.setRoleKey(Constants.GRID_DEFAULT_ROLE_KEY); |
| | | sysRoleDO.setRoleSort(0); |
| | | sysRoleDO.setCreateBy(eventGridMemberAddDTO.getUserId()); |
| | | int insert = roleDAO.insert(sysRoleDO); |
| | | gridMemberDefaultRole = new SysRoleDO(); |
| | | gridMemberDefaultRole.setCommunityId(0L); |
| | | gridMemberDefaultRole.setRoleName("网格员默认角色"); |
| | | gridMemberDefaultRole.setRoleKey(Constants.GRID_DEFAULT_ROLE_KEY); |
| | | gridMemberDefaultRole.setRoleSort(0); |
| | | gridMemberDefaultRole.setCreateBy(eventGridMemberAddDTO.getUserId()); |
| | | int insert = roleDAO.insert(gridMemberDefaultRole); |
| | | if (insert!=1) { |
| | | throw new ServiceException("网格员默认角色添加失败"); |
| | | } |
| | |
| | | menuRoleVO.setRoleId(roleId); |
| | | this.putMenuRole(menuRoleVO); |
| | | |
| | | //参数校验 |
| | | SysUserDO oldUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType,6) |
| | | .eq(SysUserDO::getNickName,eventGridMemberAddDTO.getNickName())); |
| | | if(oldUserDO != null){ |
| | | return R.fail("昵称已使用"); |
| | | } |
| | | |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | String encode = new BCryptPasswordEncoder().encode(eventGridMemberAddDTO.getPasswd()); |
| | | eventGridMemberAddDTO.setPasswd(encode); |
| | | String encode = new BCryptPasswordEncoder().encode(eventGridMemberAddDTO.getPassword()); |
| | | eventGridMemberAddDTO.setPassword(encode); |
| | | BeanUtils.copyProperties(eventGridMemberAddDTO, sysUserDO); |
| | | sysUserDO.setType(6); |
| | | int insert = 0; |
| | | try { |
| | | insert = userDao.insert(sysUserDO); |
| | | SysUserRoleDO sysUserRoleDO = new SysUserRoleDO(); |
| | | sysUserRoleDO.setUserId(sysUserDO.getUserId()); |
| | | sysUserRoleDO.setRoleId(roleId); |
| | | sysUserRoleDAO.insert(sysUserRoleDO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("新增后台用户报错【{}】", e.getMessage()); |
| | |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | throw new ServiceException("账户已经存在"); |
| | | } |
| | | |
| | | } |
| | | //TODO 添加关联关系 |
| | | //gridService.addEventGridMember(); |
| | | if(insert > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 网格员管理 |
| | | * @param memberRelationDTO 请求参数 |
| | | * @return 网格员列表 |
| | | */ |
| | | @Override |
| | | public R getGridMemberList(PageEventGridMemberRelationDTO memberRelationDTO){ |
| | | return R.ok(userDao.getGridMemberList(new Page(memberRelationDTO.getPageNum(),memberRelationDTO.getPageSize()),memberRelationDTO)); |
| | | } |
| | | |
| | | return R.fail(); |
| | | /** |
| | | * 修改网格员信息 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R editGridUser(EventGridMemberAddDTO gridMemberDTO){ |
| | | |
| | | if(gridMemberDTO.getGridMemberId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | SysUserDO sysUserDO = userDao.selectById(gridMemberDTO.getGridMemberId()); |
| | | if(sysUserDO == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | gridMemberDTO.setUserId(gridMemberDTO.getGridMemberId()); |
| | | |
| | | //参数校验 |
| | | SysUserDO oldUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType,6) |
| | | .eq(SysUserDO::getNickName,gridMemberDTO.getNickName())); |
| | | if(oldUserDO != null && !oldUserDO.getUserId().equals(gridMemberDTO.getGridMemberId())){ |
| | | return R.fail("昵称已使用"); |
| | | } |
| | | |
| | | String encode = new BCryptPasswordEncoder().encode(gridMemberDTO.getPassword()); |
| | | gridMemberDTO.setPassword(encode); |
| | | BeanUtils.copyProperties(gridMemberDTO,sysUserDO); |
| | | |
| | | int insert = 0; |
| | | try { |
| | | insert = userDao.updateById(sysUserDO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("修改网格员用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | throw new ServiceException("手机号已经存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | throw new ServiceException("账户已经存在"); |
| | | } |
| | | } |
| | | if(insert > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 重置网格员密码 |
| | | * @param gridMemberDTO 请求参数 |
| | | * @return 重置结果 |
| | | */ |
| | | @Override |
| | | public R passResetUser(EventGridMemberPassResetDTO gridMemberDTO){ |
| | | if(gridMemberDTO.getIds().isEmpty() || StringUtils.isEmpty(gridMemberDTO.getPassword())){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | String encode = new BCryptPasswordEncoder().encode(gridMemberDTO.getPassword()); |
| | | gridMemberDTO.setPassword(encode); |
| | | userDao.passResetUser(gridMemberDTO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除网格员 |
| | | * @param Ids 网格员id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteMembers(List<Long> Ids){ |
| | | if(Ids.isEmpty()){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | if(userDao.deleteBatchIds(Ids) > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R gridMemberEditStatus(EventGridMemberEditStatusDTO gridMemberEditDTO){ |
| | | if(gridMemberEditDTO.getIds().isEmpty()){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | userDao.gridMemberEditStatus(gridMemberEditDTO); |
| | | return R.ok(); |
| | | } |
| | | } |