增加点位打卡功能,以及关联功能
This commit is contained in:
@ -0,0 +1,66 @@
|
||||
package com.mosty.base.feign.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.feign.service.MostyQwzxFeignService;
|
||||
import com.mosty.base.model.dto.qwzx.TbQwXfbbVo;
|
||||
import com.mosty.base.model.entity.qwzx.TbQwXfbb;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.SpringUtils;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @description qwgl服务FeignService路由工具
|
||||
* @modifier
|
||||
* @modifiedTime 2025/05/26 19:30
|
||||
* @since 2025/25/26 19:30
|
||||
*/
|
||||
@Slf4j
|
||||
public class MostyQwzxFeignServiceRemote {
|
||||
|
||||
/**
|
||||
* 基础服务FeignService
|
||||
*/
|
||||
private static MostyQwzxFeignService mostyQwzxFeignService;
|
||||
|
||||
/**
|
||||
* 获取基础服务FeignService
|
||||
* @return MostyQwglFeignService
|
||||
*/
|
||||
private static MostyQwzxFeignService getService(){
|
||||
if(mostyQwzxFeignService == null){
|
||||
mostyQwzxFeignService = SpringUtils.getBean(MostyQwzxFeignService.class);
|
||||
}
|
||||
return mostyQwzxFeignService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据报备ID获取报备详情
|
||||
* @param id 主键ID
|
||||
* @return 报备详情
|
||||
*/
|
||||
public static TbQwXfbbVo getXfbbInfo(String id) {
|
||||
ResponseResult<TbQwXfbbVo> responseResult = MostyQwzxFeignServiceRemote.getService().getBbInfo(id);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("根据报备ID获取报备详情异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("根据报备ID获取报备详情异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我今天的报备new
|
||||
* @param bblx 报备类型
|
||||
* @return 报备详情
|
||||
*/
|
||||
public static TbQwXfbb getMyXfbbTodayNew(String bblx) {
|
||||
ResponseResult<TbQwXfbb> responseResult = MostyQwzxFeignServiceRemote.getService().getMyXfbbTodayNew(bblx);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("查询我今天的报备异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("查询我今天的报备异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
}
|
@ -54,4 +54,12 @@ public interface MostyQwzxFeignService {
|
||||
// 查询部门时长、里程
|
||||
@PostMapping("/mosty-qwzx/tbQwXfbb/getScLc")
|
||||
ResponseResult<Map<String, Integer>> getScLc(@RequestParam("ssbmdm") String ssbmdm, @RequestParam("time") String time);
|
||||
|
||||
/**
|
||||
* 查询我今天的报备new
|
||||
* @param bblx 报备类型
|
||||
* @return 报备信息
|
||||
*/
|
||||
@GetMapping("/mosty-qwzx/tbQwXfbb/getMybbTodayNew")
|
||||
ResponseResult<TbQwXfbb> getMyXfbbTodayNew(@RequestParam String bblx);
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点表保存DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 14:31
|
||||
* @since 2025/09/06 14:31
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwBddSaveDTO对象", description = "指导巡逻方格点位必到点表保存DTO对象")
|
||||
public class TbZdxlFgdwBddSaveDTO {
|
||||
|
||||
/**
|
||||
* 方格点位ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格点位ID")
|
||||
@NotNull(message = "zdxl.fgdwBdd.fgdwId.notNull")
|
||||
private Long fgdwId;
|
||||
|
||||
/**
|
||||
* 必到点名称
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点名称")
|
||||
@NotBlank(message = "zdxl.fgdwBdd.bddMc.notBlank")
|
||||
@Size(max = 64, message = "zdxl.fgdwBdd.bddMc.size")
|
||||
private String bddMc;
|
||||
|
||||
/**
|
||||
* 必到点地址
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点地址")
|
||||
@Size(max = 255, message = "zdxl.fgdwBdd.bddDz.size")
|
||||
private String bddDz;
|
||||
|
||||
/**
|
||||
* 必到点说明
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点说明")
|
||||
@Size(max = 128, message = "zdxl.fgdwBdd.bddSm.size")
|
||||
private String bddSm;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ApiModelProperty(value = "经度")
|
||||
@NotNull(message = "zdxl.fgdwBdd.jd.notNull")
|
||||
private BigDecimal jd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "纬度")
|
||||
@NotNull(message = "zdxl.fgdwBdd.wd.notNull")
|
||||
private BigDecimal wd;
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 岗哨系统线索专题表修改DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 14:33
|
||||
* @since 2025/09/06 14:33
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbGsxtXsztUpdateDTO对象", description = "岗哨系统线索专题表修改DTO对象")
|
||||
public class TbZdxlFgdwBddUpdateDTO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id", required = true)
|
||||
@NotBlank(message = "id.bnwk")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 方格点位ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格点位ID")
|
||||
@NotNull(message = "zdxl.fgdwBdd.fgdwId.notNull")
|
||||
private Long fgdwId;
|
||||
|
||||
/**
|
||||
* 必到点名称
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点名称")
|
||||
@NotBlank(message = "zdxl.fgdwBdd.bddMc.notBlank")
|
||||
@Size(max = 64, message = "zdxl.fgdwBdd.bddMc.size")
|
||||
private String bddMc;
|
||||
|
||||
/**
|
||||
* 必到点地址
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点地址")
|
||||
@Size(max = 255, message = "zdxl.fgdwBdd.bddDz.size")
|
||||
private String bddDz;
|
||||
|
||||
/**
|
||||
* 必到点说明
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点说明")
|
||||
@Size(max = 128, message = "zdxl.fgdwBdd.bddSm.size")
|
||||
private String bddSm;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ApiModelProperty(value = "经度")
|
||||
@NotNull(message = "zdxl.fgdwBdd.jd.notNull")
|
||||
private BigDecimal jd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "纬度")
|
||||
@NotNull(message = "zdxl.fgdwBdd.wd.notNull")
|
||||
private BigDecimal wd;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务表操作DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 16:54
|
||||
* @since 2025/09/07 16:54
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwBddxlrwHandleDTO对象", description = "指导巡逻方格点位必到点巡逻任务表操作DTO对象")
|
||||
public class TbZdxlFgdwBddxlrwHandleDTO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 必到点ID
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点ID")
|
||||
private String bddId;
|
||||
|
||||
/**
|
||||
* 方格巡逻任务ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格巡逻任务ID")
|
||||
private String fgxlrwId;
|
||||
|
||||
/**
|
||||
* 巡逻规划打卡次数
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻规划打卡次数")
|
||||
private Integer xlghDkcs;
|
||||
|
||||
/**
|
||||
* 巡逻实际打卡次数
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻实际打卡次数")
|
||||
private Integer xlsjDkcs;
|
||||
|
||||
/**
|
||||
* 是否开始 D_BZ_SF
|
||||
*/
|
||||
@ApiModelProperty(value = "是否开始 D_BZ_SF")
|
||||
private String sfKs;
|
||||
|
||||
/**
|
||||
* 是否结束 D_BZ_SF
|
||||
*/
|
||||
@ApiModelProperty(value = "是否结束 D_BZ_SF")
|
||||
private String sfJs;
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务记录表打卡DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 20:43
|
||||
* @since 2025/09/07 20:43
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwBddxlrwJlClockInDTO对象", description = "指导巡逻方格点位必到点巡逻任务记录表打卡DTO对象")
|
||||
public class TbZdxlFgdwBddxlrwJlClockInDTO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "id.bnwk")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 打卡附件
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡附件")
|
||||
// @NotBlank(message = "zdxl.fgdwBdd.xlrwJl.dkFj.notBlank")
|
||||
@Size(max = 255, message = "zdxl.fgdwBdd.xlrwJl.dkFj.size")
|
||||
private String dkFj;
|
||||
|
||||
/**
|
||||
* 打卡经度
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡经度")
|
||||
@NotNull(message = "zdxl.fgdwBdd.xlrwJl.dkJd.notNull")
|
||||
private BigDecimal dkJd;
|
||||
|
||||
/**
|
||||
* 打卡纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡纬度")
|
||||
@NotNull(message = "zdxl.fgdwBdd.xlrwJl.dkWd.notNull")
|
||||
private BigDecimal dkWd;
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格默认配置表修改DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/05 19:16
|
||||
* @since 2025/09/05 19:16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgmrpzUpdateDTO对象", description = "指导巡逻方格默认配置表修改DTO对象")
|
||||
public class TbZdxlFgmrpzUpdateDTO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id", required = true)
|
||||
@NotBlank(message = "id.bnwk")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 盘查车辆
|
||||
*/
|
||||
@ApiModelProperty(value = "盘查车辆")
|
||||
private Integer pcCl;
|
||||
|
||||
/**
|
||||
* 盘查人员
|
||||
*/
|
||||
@ApiModelProperty(value = "盘查人员")
|
||||
private Integer pcRy;
|
||||
|
||||
/**
|
||||
* 巡逻时长(分钟)
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻时长(分钟)")
|
||||
private Double xlSc;
|
||||
|
||||
/**
|
||||
* 巡逻里程(公里)
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻里程(公里)")
|
||||
private Double xlLc;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格巡逻任务表下发DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 17:23
|
||||
* @since 2025/09/07 17:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgxlrwIssueDTO对象", description = "指导巡逻方格巡逻任务表下发DTO对象")
|
||||
public class TbZdxlFgxlrwIssueDTO {
|
||||
|
||||
/**
|
||||
* 主键id字符串(用英语逗号“,”分隔)
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id字符串(用英语逗号“,”分隔)")
|
||||
private String ids;
|
||||
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格巡逻任务表警情配置修改DTO对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/08/26 17:16
|
||||
* @since 2025/08/26 17:16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgxlrwJqpzUpdateDTO对象", description = "指导巡逻方格巡逻任务表警情配置修改DTO对象")
|
||||
public class TbZdxlFgxlrwJqpzUpdateDTO {
|
||||
|
||||
/**
|
||||
* 报警细类
|
||||
*/
|
||||
@ApiModelProperty(value = "报警细类")
|
||||
@NotBlank(message = "zdxl.fgxlrw.jqpz.bjxl.notBlank")
|
||||
@Size(max = 1000, message = "zdxl.fgxlrw.jqpz.bjxl.size")
|
||||
private String bjxl;
|
||||
|
||||
/**
|
||||
* 报警细类说明
|
||||
*/
|
||||
@Size(max = 200, message = "zdxl.fgxlrw.jqpz.bjxlSm.size")
|
||||
private String bjxlSm;
|
||||
|
||||
/**
|
||||
* 报警子类
|
||||
*/
|
||||
@ApiModelProperty(value = "报警子类")
|
||||
@NotBlank(message = "zdxl.fgxlrw.jqpz.bjzl.notBlank")
|
||||
@Size(max = 1000, message = "zdxl.fgxlrw.jqpz.bjzl.size")
|
||||
private String bjzl;
|
||||
|
||||
/**
|
||||
* 报警子类说明
|
||||
*/
|
||||
@Size(max = 200, message = "zdxl.fgxlrw.jqpz.bjzlSm.size")
|
||||
private String bjzlSm;
|
||||
|
||||
}
|
@ -12,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -79,4 +80,28 @@ public class TbZdxlFgxlrwUpdateDTO {
|
||||
@NotNull(message = "zdxl.fgxlrw.rwRq.xlghXllc.notNull")
|
||||
private Double xlghXllc;
|
||||
|
||||
/**
|
||||
* 巡逻规划盘查车辆
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻规划盘查车辆")
|
||||
private Integer xlghPcCl;
|
||||
|
||||
/**
|
||||
* 巡逻规划盘查人员
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻规划盘查人员")
|
||||
private Integer xlghPcRy;
|
||||
|
||||
/**
|
||||
* 巡防报备ID
|
||||
*/
|
||||
@ApiModelProperty(value = "巡防报备ID")
|
||||
private String xfbbId;
|
||||
|
||||
/**
|
||||
* 必到点列表
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点列表")
|
||||
List<TbZdxlFgdwBddxlrwHandleDTO> bddList;
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class TbZdxlFgdw extends BaseEntity implements Serializable, Cloneable {
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@Excel(name = "主键ID", sort = 1)
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
@ -194,7 +194,7 @@ public class TbZdxlFgdw extends BaseEntity implements Serializable, Cloneable {
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
public static String MC = "mc";
|
||||
public static String MC = "mc1";
|
||||
|
||||
/**
|
||||
* 字段名
|
||||
@ -209,22 +209,22 @@ public class TbZdxlFgdw extends BaseEntity implements Serializable, Cloneable {
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
public static String X1 = "x1";
|
||||
public static String X1 = "x11";
|
||||
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
public static String Y1 = "y1";
|
||||
public static String Y1 = "y11";
|
||||
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
public static String X2 = "x2";
|
||||
public static String X2 = "x21";
|
||||
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
public static String Y2 = "y2";
|
||||
public static String Y2 = "y21";
|
||||
|
||||
/**
|
||||
* 字段名
|
||||
@ -257,12 +257,12 @@ public class TbZdxlFgdw extends BaseEntity implements Serializable, Cloneable {
|
||||
public static String SSBMID_TYPE = "ssbmid";
|
||||
|
||||
/**
|
||||
* 报备部门
|
||||
* 所属部门
|
||||
*/
|
||||
public static String SSBM_TYPE = "ssbm";
|
||||
|
||||
/**
|
||||
* 报备部门代码
|
||||
* 所属部门代码
|
||||
*/
|
||||
public static String SSBMDM_TYPE = "ssbmdm";
|
||||
|
||||
|
@ -0,0 +1,227 @@
|
||||
package com.mosty.base.model.entity.yjzl.zddw;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mosty.base.model.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点表
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 11:49
|
||||
* @since 2025/09/06 11:49
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_zdxl_fgdw_bdd")
|
||||
@ApiModel(value = "TbZdxlFgdwBdd对象", description = "指导巡逻方格点位必到点表")
|
||||
public class TbZdxlFgdwBdd extends BaseEntity implements Serializable, Cloneable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 方格点位ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格点位ID")
|
||||
@TableField(value = "fgdw_id")
|
||||
private Long fgdwId;
|
||||
|
||||
/**
|
||||
* 必到点名称
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点名称")
|
||||
@TableField(value = "bdd_mc")
|
||||
private String bddMc;
|
||||
|
||||
/**
|
||||
* 必到点地址
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点地址")
|
||||
@TableField(value = "bdd_dz")
|
||||
private String bddDz;
|
||||
|
||||
/**
|
||||
* 必到点说明
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点说明")
|
||||
@TableField(value = "bdd_sm")
|
||||
private String bddSm;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ApiModelProperty(value = "经度")
|
||||
@TableField(value = "jd")
|
||||
private BigDecimal jd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "纬度")
|
||||
@TableField(value = "wd")
|
||||
private BigDecimal wd;
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门id")
|
||||
@TableField(value = "ssbmid")
|
||||
private String ssbmid;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
@TableField(value = "ssbm")
|
||||
private String ssbm;
|
||||
|
||||
/**
|
||||
* 所属部门代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门代码")
|
||||
@TableField(value = "ssbmdm")
|
||||
private String ssbmdm;
|
||||
|
||||
/**
|
||||
* 所属县公安局
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局")
|
||||
@TableField(value = "ssxgaj")
|
||||
private String ssxgaj;
|
||||
|
||||
/**
|
||||
* 所属县公安局id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局id")
|
||||
@TableField(value = "ssxgajid")
|
||||
private String ssxgajid;
|
||||
|
||||
/**
|
||||
* 所属县公安局代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局代码")
|
||||
@TableField(value = "ssxgajdm")
|
||||
private String ssxgajdm;
|
||||
|
||||
/**
|
||||
* 所属市公安局id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局id")
|
||||
@TableField(value = "sssgajid")
|
||||
private String sssgajid;
|
||||
|
||||
/**
|
||||
* 所属市公安局
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局")
|
||||
@TableField(value = "sssgaj")
|
||||
private String sssgaj;
|
||||
|
||||
/**
|
||||
* 所属市公安局代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局代码")
|
||||
@TableField(value = "sssgajdm")
|
||||
private String sssgajdm;
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID字段名
|
||||
*/
|
||||
public static String ID_FIELD = "id";
|
||||
|
||||
/**
|
||||
* 方格点位ID字段名
|
||||
*/
|
||||
public static String FGDW_ID_FIELD = "fgdw_id";
|
||||
|
||||
/**
|
||||
* 必到点名称字段名
|
||||
*/
|
||||
public static String BDD_MC_FIELD = "bdd_mc";
|
||||
|
||||
/**
|
||||
* 必到点地址字段名
|
||||
*/
|
||||
public static String BDD_DZ_FIELD = "bdd_dz";
|
||||
|
||||
/**
|
||||
* 必到点说明字段名
|
||||
*/
|
||||
public static String BDD_SM_FIELD = "bdd_sm";
|
||||
|
||||
/**
|
||||
* 经度字段名
|
||||
*/
|
||||
public static String JD_FIELD = "jd";
|
||||
|
||||
/**
|
||||
* 纬度字段名
|
||||
*/
|
||||
public static String WD_FIELD = "wd";
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
public static String SSBMID_TYPE = "ssbmid";
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
public static String SSBM_TYPE = "ssbm";
|
||||
|
||||
/**
|
||||
* 所属部门代码
|
||||
*/
|
||||
public static String SSBMDM_TYPE = "ssbmdm";
|
||||
|
||||
/**
|
||||
* 所属县公安局
|
||||
*/
|
||||
public static String SSXGAJ_TYPE = "ssxgaj";
|
||||
|
||||
/**
|
||||
* 所属县公安局id
|
||||
*/
|
||||
public static String SSXGAJID_TYPE = "ssxgajid";
|
||||
|
||||
/**
|
||||
* 所属县公安局代码
|
||||
*/
|
||||
public static String SSXGAJDM_TYPE = "ssxgajdm";
|
||||
|
||||
/**
|
||||
* 所属市公安局id
|
||||
*/
|
||||
public static String SSSGAJID_TYPE = "sssgajid";
|
||||
|
||||
/**
|
||||
* 所属市公安局
|
||||
*/
|
||||
public static String SSSGAJ_TYPE = "sssgaj";
|
||||
|
||||
/**
|
||||
* 所属市公安局代码
|
||||
*/
|
||||
public static String SSSGAJDM_TYPE = "sssgajdm";
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.mosty.base.model.entity.yjzl.zddw;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mosty.base.model.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务表
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 19:27
|
||||
* @since 2025/09/06 19:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_zdxl_fgdw_bddxlrw")
|
||||
@ApiModel(value = "TbZdxlFgdwBddxlrw对象", description = "指导巡逻方格点位必到点巡逻任务表")
|
||||
public class TbZdxlFgdwBddxlrw extends BaseEntity implements Serializable, Cloneable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 必到点ID
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点ID")
|
||||
@TableField(value = "bdd_id")
|
||||
private String bddId;
|
||||
|
||||
/**
|
||||
* 方格巡逻任务ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格巡逻任务ID")
|
||||
@TableField(value = "fgxlrw_id")
|
||||
private String fgxlrwId;
|
||||
|
||||
/**
|
||||
* 巡逻规划打卡次数
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻规划打卡次数")
|
||||
@TableField(value = "xlgh_dkcs")
|
||||
private Integer xlghDkcs;
|
||||
|
||||
/**
|
||||
* 巡逻实际打卡次数
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻实际打卡次数")
|
||||
@TableField(value = "xlsj_dkcs")
|
||||
private Integer xlsjDkcs;
|
||||
|
||||
/**
|
||||
* 是否开始 D_BZ_SF
|
||||
*/
|
||||
@ApiModelProperty(value = "是否开始 D_BZ_SF")
|
||||
@TableField(value = "sf_ks")
|
||||
private String sfKs;
|
||||
|
||||
/**
|
||||
* 是否结束 D_BZ_SF
|
||||
*/
|
||||
@ApiModelProperty(value = "是否结束 D_BZ_SF")
|
||||
@TableField(value = "sf_js")
|
||||
private String sfJs;
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID字段名
|
||||
*/
|
||||
public static String ID_FIELD = "id";
|
||||
|
||||
/**
|
||||
* 必到点ID字段名
|
||||
*/
|
||||
public static String BDD_ID_FIELD = "bdd_id";
|
||||
|
||||
/**
|
||||
* 方格巡逻任务ID字段名
|
||||
*/
|
||||
public static String FGXLRW_ID_FIELD = "fgxlrw_id";
|
||||
|
||||
/**
|
||||
* 巡逻规划打卡次数字段名
|
||||
*/
|
||||
public static String XLGH_DKCS_FIELD = "xlgh_dkcs";
|
||||
|
||||
/**
|
||||
* 巡逻实际打卡次数字段名
|
||||
*/
|
||||
public static String XLSJ_DKCS_FIELD = "xlsj_dkcs";
|
||||
|
||||
/**
|
||||
* 是否开始字段名
|
||||
*/
|
||||
public static String SF_KS_FIELD = "sf_ks";
|
||||
|
||||
/**
|
||||
* 是否结束字段名
|
||||
*/
|
||||
public static String SF_JS_FIELD = "sf_js";
|
||||
|
||||
}
|
@ -0,0 +1,306 @@
|
||||
package com.mosty.base.model.entity.yjzl.zddw;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mosty.base.model.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务记录表
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 19:06
|
||||
* @since 2025/09/07 19:06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_zdxl_fgdw_bddxlrw_jl")
|
||||
@ApiModel(value = "TbZdxlFgdwBddxlrwJl对象", description = "指导巡逻方格点位必到点巡逻任务记录表")
|
||||
public class TbZdxlFgdwBddxlrwJl extends BaseEntity implements Serializable, Cloneable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 必到点巡逻任务ID
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点巡逻任务ID")
|
||||
@TableField(value = "bddxlrw_id")
|
||||
private String bddxlrwId;
|
||||
|
||||
/**
|
||||
* 开始打卡时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始打卡时间")
|
||||
@TableField(value = "dk_ks_sj")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dkKsSj;
|
||||
|
||||
/**
|
||||
* 开始打卡附件
|
||||
*/
|
||||
@ApiModelProperty(value = "开始打卡附件")
|
||||
@TableField(value = "dk_ks_fj")
|
||||
private String dkKsFj;
|
||||
|
||||
/**
|
||||
* 开始打卡经度
|
||||
*/
|
||||
@ApiModelProperty(value = "开始打卡经度")
|
||||
@TableField(value = "dk_ks_jd")
|
||||
private BigDecimal dkKsJd;
|
||||
|
||||
/**
|
||||
* 开始打卡纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "开始打卡纬度")
|
||||
@TableField(value = "dk_ks_wd")
|
||||
private BigDecimal dkKsWd;
|
||||
|
||||
/**
|
||||
* 结束打卡时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结束打卡时间")
|
||||
@TableField(value = "dk_js_sj")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dkJsSj;
|
||||
|
||||
/**
|
||||
* 结束打卡附件
|
||||
*/
|
||||
@ApiModelProperty(value = "结束打卡附件")
|
||||
@TableField(value = "dk_js_fj")
|
||||
private String dkJsFj;
|
||||
|
||||
/**
|
||||
* 结束打卡经度
|
||||
*/
|
||||
@ApiModelProperty(value = "结束打卡经度")
|
||||
@TableField(value = "dk_js_jd")
|
||||
private BigDecimal dkJsJd;
|
||||
|
||||
/**
|
||||
* 结束打卡纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "结束打卡纬度")
|
||||
@TableField(value = "dk_js_wd")
|
||||
private BigDecimal dkJsWd;
|
||||
|
||||
/**
|
||||
* 打卡顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡顺序")
|
||||
@TableField(value = "dk_sx")
|
||||
private Integer dkSx;
|
||||
|
||||
/**
|
||||
* 打卡人姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡人姓名")
|
||||
@TableField(value = "dkr_xm")
|
||||
private String dkrXm;
|
||||
|
||||
/**
|
||||
* 打卡人身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡人身份证号")
|
||||
@TableField(value = "dkr_sfzh")
|
||||
private String dkrSfzh;
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门id")
|
||||
@TableField(value = "ssbmid")
|
||||
private String ssbmid;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
@TableField(value = "ssbm")
|
||||
private String ssbm;
|
||||
|
||||
/**
|
||||
* 所属部门代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门代码")
|
||||
@TableField(value = "ssbmdm")
|
||||
private String ssbmdm;
|
||||
|
||||
/**
|
||||
* 所属县公安局
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局")
|
||||
@TableField(value = "ssxgaj")
|
||||
private String ssxgaj;
|
||||
|
||||
/**
|
||||
* 所属县公安局id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局id")
|
||||
@TableField(value = "ssxgajid")
|
||||
private String ssxgajid;
|
||||
|
||||
/**
|
||||
* 所属县公安局代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局代码")
|
||||
@TableField(value = "ssxgajdm")
|
||||
private String ssxgajdm;
|
||||
|
||||
/**
|
||||
* 所属市公安局id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局id")
|
||||
@TableField(value = "sssgajid")
|
||||
private String sssgajid;
|
||||
|
||||
/**
|
||||
* 所属市公安局
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局")
|
||||
@TableField(value = "sssgaj")
|
||||
private String sssgaj;
|
||||
|
||||
/**
|
||||
* 所属市公安局代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局代码")
|
||||
@TableField(value = "sssgajdm")
|
||||
private String sssgajdm;
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID字段名
|
||||
*/
|
||||
public static String ID_FIELD = "id";
|
||||
|
||||
/**
|
||||
* 必到点巡逻任务ID字段名
|
||||
*/
|
||||
public static String BDDXLRW_ID_FIELD = "bddxlrw_id";
|
||||
|
||||
/**
|
||||
* 开始打卡时间字段名
|
||||
*/
|
||||
public static String DK_KS_SJ_FIELD = "dk_ks_sj";
|
||||
|
||||
/**
|
||||
* 开始打卡附件字段名
|
||||
*/
|
||||
public static String DK_KS_FJ_FIELD = "dk_ks_fj";
|
||||
|
||||
/**
|
||||
* 开始打卡经度字段名
|
||||
*/
|
||||
public static String DK_KS_JD_FIELD = "dk_ks_jd";
|
||||
|
||||
/**
|
||||
* 开始打卡纬度字段名
|
||||
*/
|
||||
public static String DK_KS_WD_FIELD = "dk_ks_wd";
|
||||
|
||||
/**
|
||||
* 结束打卡时间字段名
|
||||
*/
|
||||
public static String DK_JS_SJ_FIELD = "dk_js_sj";
|
||||
|
||||
/**
|
||||
* 结束打卡附件字段名
|
||||
*/
|
||||
public static String DK_JS_FJ_FIELD = "dk_js_fj";
|
||||
|
||||
/**
|
||||
* 结束打卡经度字段名
|
||||
*/
|
||||
public static String DK_JS_JD_FIELD = "dk_js_jd";
|
||||
|
||||
/**
|
||||
* 结束打卡纬度字段名
|
||||
*/
|
||||
public static String DK_JS_WD_FIELD = "dk_js_wd";
|
||||
|
||||
/**
|
||||
* 打卡顺序字段名
|
||||
*/
|
||||
public static String DK_SX_FIELD = "dk_sx";
|
||||
|
||||
/**
|
||||
* 打卡人姓名字段名
|
||||
*/
|
||||
public static String DKR_XM_FIELD = "dkr_xm";
|
||||
|
||||
/**
|
||||
* 打卡人身份证号字段名
|
||||
*/
|
||||
public static String DKR_SFZH_FIELD = "dkr_sfzh";
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
public static String SSBMID_TYPE = "ssbmid";
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
public static String SSBM_TYPE = "ssbm";
|
||||
|
||||
/**
|
||||
* 所属部门代码
|
||||
*/
|
||||
public static String SSBMDM_TYPE = "ssbmdm";
|
||||
|
||||
/**
|
||||
* 所属县公安局
|
||||
*/
|
||||
public static String SSXGAJ_TYPE = "ssxgaj";
|
||||
|
||||
/**
|
||||
* 所属县公安局id
|
||||
*/
|
||||
public static String SSXGAJID_TYPE = "ssxgajid";
|
||||
|
||||
/**
|
||||
* 所属县公安局代码
|
||||
*/
|
||||
public static String SSXGAJDM_TYPE = "ssxgajdm";
|
||||
|
||||
/**
|
||||
* 所属市公安局id
|
||||
*/
|
||||
public static String SSSGAJID_TYPE = "sssgajid";
|
||||
|
||||
/**
|
||||
* 所属市公安局
|
||||
*/
|
||||
public static String SSSGAJ_TYPE = "sssgaj";
|
||||
|
||||
/**
|
||||
* 所属市公安局代码
|
||||
*/
|
||||
public static String SSSGAJDM_TYPE = "sssgajdm";
|
||||
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
package com.mosty.base.model.entity.yjzl.zddw;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mosty.base.model.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格默认配置表
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/05 18:50
|
||||
* @since 2025/09/05 18:50
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_zdxl_fgmrpz")
|
||||
@ApiModel(value = "TbZdxlFgmrpz对象", description = "指导巡逻方格默认配置表")
|
||||
public class TbZdxlFgmrpz extends BaseEntity implements Serializable, Cloneable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 盘查车辆
|
||||
*/
|
||||
@ApiModelProperty(value = "盘查车辆")
|
||||
@TableField(value = "pc_cl")
|
||||
private Integer pcCl;
|
||||
|
||||
/**
|
||||
* 盘查人员
|
||||
*/
|
||||
@ApiModelProperty(value = "盘查人员")
|
||||
@TableField(value = "pc_ry")
|
||||
private Integer pcRy;
|
||||
|
||||
/**
|
||||
* 巡逻时长(分钟)
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻时长(分钟)")
|
||||
@TableField(value = "xl_sc")
|
||||
private Double xlSc;
|
||||
|
||||
/**
|
||||
* 巡逻里程(公里)
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻里程(公里)")
|
||||
@TableField(value = "xl_lc")
|
||||
private Double xlLc;
|
||||
|
||||
/**
|
||||
* 方格打卡次数
|
||||
*/
|
||||
@ApiModelProperty(value = "方格打卡次数")
|
||||
@TableField(value = "fg_dkcs")
|
||||
private Integer fgDkcs;
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门id")
|
||||
@TableField(value = "ssbmid")
|
||||
private String ssbmid;
|
||||
|
||||
/**
|
||||
* 报备部门
|
||||
*/
|
||||
@ApiModelProperty(value = "报备部门")
|
||||
@TableField(value = "ssbm")
|
||||
private String ssbm;
|
||||
|
||||
/**
|
||||
* 报备部门代码
|
||||
*/
|
||||
@ApiModelProperty(value = "报备部门代码")
|
||||
@TableField(value = "ssbmdm")
|
||||
private String ssbmdm;
|
||||
|
||||
/**
|
||||
* 所属县公安局
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局")
|
||||
@TableField(value = "ssxgaj")
|
||||
private String ssxgaj;
|
||||
|
||||
/**
|
||||
* 所属县公安局id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局id")
|
||||
@TableField(value = "ssxgajid")
|
||||
private String ssxgajid;
|
||||
|
||||
/**
|
||||
* 所属县公安局代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属县公安局代码")
|
||||
@TableField(value = "ssxgajdm")
|
||||
private String ssxgajdm;
|
||||
|
||||
/**
|
||||
* 所属市公安局id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局id")
|
||||
@TableField(value = "sssgajid")
|
||||
private String sssgajid;
|
||||
|
||||
/**
|
||||
* 所属市公安局
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局")
|
||||
@TableField(value = "sssgaj")
|
||||
private String sssgaj;
|
||||
|
||||
/**
|
||||
* 所属市公安局代码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属市公安局代码")
|
||||
@TableField(value = "sssgajdm")
|
||||
private String sssgajdm;
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID字段名
|
||||
*/
|
||||
public static String ID_FIELD = "id";
|
||||
|
||||
/**
|
||||
* 盘查车辆字段名
|
||||
*/
|
||||
public static String PC_CL_FIELD = "pc_cl";
|
||||
|
||||
/**
|
||||
* 盘查人员字段名
|
||||
*/
|
||||
public static String PC_RY_FIELD = "pc_ry";
|
||||
|
||||
/**
|
||||
* 巡逻时长(分钟)字段名
|
||||
*/
|
||||
public static String XL_SC_FIELD = "xl_sc";
|
||||
|
||||
/**
|
||||
* 巡逻里程(公里)字段名
|
||||
*/
|
||||
public static String XL_LC_FIELD = "xl_lc";
|
||||
|
||||
/**
|
||||
* 方格打卡次数字段名
|
||||
*/
|
||||
public static String FG_DKCS_FIELD = "fg_dkcs";
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
public static String SSBMID_TYPE = "ssbmid";
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
public static String SSBM_TYPE = "ssbm";
|
||||
|
||||
/**
|
||||
* 所属部门代码
|
||||
*/
|
||||
public static String SSBMDM_TYPE = "ssbmdm";
|
||||
|
||||
/**
|
||||
* 所属县公安局
|
||||
*/
|
||||
public static String SSXGAJ_TYPE = "ssxgaj";
|
||||
|
||||
/**
|
||||
* 所属县公安局id
|
||||
*/
|
||||
public static String SSXGAJID_TYPE = "ssxgajid";
|
||||
|
||||
/**
|
||||
* 所属县公安局代码
|
||||
*/
|
||||
public static String SSXGAJDM_TYPE = "ssxgajdm";
|
||||
|
||||
/**
|
||||
* 所属市公安局id
|
||||
*/
|
||||
public static String SSSGAJID_TYPE = "sssgajid";
|
||||
|
||||
/**
|
||||
* 所属市公安局
|
||||
*/
|
||||
public static String SSSGAJ_TYPE = "sssgaj";
|
||||
|
||||
/**
|
||||
* 所属市公安局代码
|
||||
*/
|
||||
public static String SSSGAJDM_TYPE = "sssgajdm";
|
||||
|
||||
}
|
@ -48,7 +48,7 @@ public class TbZdxlFgxlrw extends BaseEntity implements Serializable, Cloneable
|
||||
@ApiModelProperty(value = "方格ID")
|
||||
@TableField(value = "fg_id")
|
||||
@Excel(name = "方格ID", sort = 2, cellType = Excel.ColumnType.NUMERIC)
|
||||
private Integer fgId;
|
||||
private Long fgId;
|
||||
|
||||
/**
|
||||
* 方格排序
|
||||
@ -157,7 +157,7 @@ public class TbZdxlFgxlrw extends BaseEntity implements Serializable, Cloneable
|
||||
@TableField(value = "xlgh_sj_js")
|
||||
@JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
@Excel(name = "巡逻规划开始时间", sort = 15, dateFormat = "HH:mm:ss")
|
||||
@Excel(name = "巡逻规划结束时间", sort = 15, dateFormat = "HH:mm:ss")
|
||||
private Date xlghSjJs;
|
||||
|
||||
/**
|
||||
@ -168,6 +168,20 @@ public class TbZdxlFgxlrw extends BaseEntity implements Serializable, Cloneable
|
||||
@Excel(name = "巡逻规划巡逻里程(公里)", sort = 16, cellType = Excel.ColumnType.NUMERIC)
|
||||
private Double xlghXllc;
|
||||
|
||||
/**
|
||||
* 巡逻规划盘查车辆
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻规划盘查车辆")
|
||||
@TableField(value = "xlgh_pc_cl")
|
||||
private Integer xlghPcCl;
|
||||
|
||||
/**
|
||||
* 巡逻规划盘查人员
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻规划盘查人员")
|
||||
@TableField(value = "xlgh_pc_ry")
|
||||
private Integer xlghPcRy;
|
||||
|
||||
/**
|
||||
* 巡逻实际时长(分钟)
|
||||
*/
|
||||
@ -202,6 +216,27 @@ public class TbZdxlFgxlrw extends BaseEntity implements Serializable, Cloneable
|
||||
@Excel(name = "巡逻实际巡逻里程(公里)", sort = 20, cellType = Excel.ColumnType.NUMERIC)
|
||||
private Double xlsjXllc;
|
||||
|
||||
/**
|
||||
* 巡逻实际盘查车辆
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻实际盘查车辆")
|
||||
@TableField(value = "xlsj_pc_cl")
|
||||
private Integer xlsjPcCl;
|
||||
|
||||
/**
|
||||
* 巡逻实际盘查人员
|
||||
*/
|
||||
@ApiModelProperty(value = "巡逻实际盘查人员")
|
||||
@TableField(value = "xlsj_pc_ry")
|
||||
private Integer xlsjPcRy;
|
||||
|
||||
/**
|
||||
* 巡防报备ID
|
||||
*/
|
||||
@ApiModelProperty(value = "巡防报备ID")
|
||||
@TableField(value = "xfbb_id")
|
||||
private String xfbbId;
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID字段名
|
||||
@ -283,6 +318,16 @@ public class TbZdxlFgxlrw extends BaseEntity implements Serializable, Cloneable
|
||||
*/
|
||||
public static String XLGH_XLLC_FIELD = "xlgh_xllc";
|
||||
|
||||
/**
|
||||
* 巡逻规划盘查车辆字段名
|
||||
*/
|
||||
public static String XLGH_PC_CL_FIELD = "xlgh_pc_cl";
|
||||
|
||||
/**
|
||||
* 巡逻规划盘查人员字段名
|
||||
*/
|
||||
public static String XLGH_PC_RY_FIELD = "xlgh_pc_ry";
|
||||
|
||||
/**
|
||||
* 巡逻实际时长字段名
|
||||
*/
|
||||
@ -303,4 +348,19 @@ public class TbZdxlFgxlrw extends BaseEntity implements Serializable, Cloneable
|
||||
*/
|
||||
public static String XLSJ_XLLC_FIELD = "xlsj_xllc";
|
||||
|
||||
/**
|
||||
* 巡逻实际盘查车辆字段名
|
||||
*/
|
||||
public static String XLSJ_PC_CL_FIELD = "xlsj_pc_cl";
|
||||
|
||||
/**
|
||||
* 巡逻实际盘查人员字段名
|
||||
*/
|
||||
public static String XLSJ_PC_RY_FIELD = "xlsj_pc_ry";
|
||||
|
||||
/**
|
||||
* 巡防报备ID字段名
|
||||
*/
|
||||
public static String XFBB_ID_FIELD = "xfbb_id";
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
package com.mosty.base.model.query.yjzl;
|
||||
|
||||
import com.mosty.base.model.BasePage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点表查询对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 14:44
|
||||
* @since 2025/09/06 14:44
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwBddQuery对象", description = "指导巡逻方格点位必到点表查询对象")
|
||||
public class TbZdxlFgdwBddQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 方格点位ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格点位ID")
|
||||
private Long fgdwId;
|
||||
|
||||
/**
|
||||
* 必到点名称
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点名称")
|
||||
private String bddMc;
|
||||
|
||||
/**
|
||||
* 必到点地址
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点地址")
|
||||
private String bddDz;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.mosty.base.model.query.yjzl;
|
||||
|
||||
import com.mosty.base.model.BasePage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位查询对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 16:20
|
||||
* @since 2025/09/07 16:20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwQuery对象", description = "指导巡逻方格点位查询对象")
|
||||
public class TbZdxlFgdwQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String mc;
|
||||
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.mosty.base.model.query.yjzl;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mosty.base.model.BasePage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -29,9 +28,20 @@ public class TbZdxlFgxlrwQuery extends BasePage {
|
||||
* 方格ID
|
||||
*/
|
||||
@ApiModelProperty(value = "方格ID")
|
||||
@TableField(value = "fg_id")
|
||||
private Integer fgId;
|
||||
|
||||
/**
|
||||
* 方格名称
|
||||
*/
|
||||
@ApiModelProperty(value = "方格名称")
|
||||
private String fgMc;
|
||||
|
||||
/**
|
||||
* 方格预警等级 D_ZDXL_FGXLRW_YJDJ
|
||||
*/
|
||||
@ApiModelProperty(value = "方格预警等级 D_ZDXL_FGXLRW_YJDJ")
|
||||
private String fgYjdj;
|
||||
|
||||
/**
|
||||
* 任务日期
|
||||
*/
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.mosty.base.model.vo.yjzl;
|
||||
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBdd;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点返回对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 16:00
|
||||
* @since 2025/09/07 16:00
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwBddVO对象", description = "指导巡逻方格点位必到点返回对象")
|
||||
public class TbZdxlFgdwBddVO extends TbZdxlFgdwBdd {
|
||||
|
||||
/**
|
||||
* 方格点位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "方格点位名称")
|
||||
private String fgdwMc;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.mosty.base.model.vo.yjzl;
|
||||
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrw;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务表返回对象
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 19:56
|
||||
* @since 2025/09/06 19:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TbZdxlFgdwBddxlrwVO对象", description = "指导巡逻方格点位必到点巡逻任务表返回对象")
|
||||
public class TbZdxlFgdwBddxlrwVO extends TbZdxlFgdwBddxlrw {
|
||||
|
||||
/**
|
||||
* 必到点名称
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点名称")
|
||||
private String bddMc;
|
||||
|
||||
/**
|
||||
* 必到点进度
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点进度")
|
||||
private Double bddProgress;
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.mosty.base.model.vo.yjzl;
|
||||
|
||||
import com.mosty.base.model.dto.qwzx.TbQwXfbbVo;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgxlrw;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -8,6 +9,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -26,7 +28,7 @@ public class TbZdxlFgxlrwVO extends TbZdxlFgxlrw {
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String mc;
|
||||
private String fgMc;
|
||||
|
||||
/**
|
||||
* 网格坐标X1
|
||||
@ -64,4 +66,22 @@ public class TbZdxlFgxlrwVO extends TbZdxlFgxlrw {
|
||||
@ApiModelProperty(value = "中心Y")
|
||||
private BigDecimal zxY;
|
||||
|
||||
/**
|
||||
* 必到点列表
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点列表")
|
||||
List<TbZdxlFgdwBddxlrwVO> bddList;
|
||||
|
||||
/**
|
||||
* 必到点总进度
|
||||
*/
|
||||
@ApiModelProperty(value = "必到点总进度")
|
||||
private Double bddAllProgress;
|
||||
|
||||
/**
|
||||
* 巡防报备信息
|
||||
*/
|
||||
@ApiModelProperty(value = "巡防报备信息")
|
||||
private TbQwXfbbVo xfbb;
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,9 @@ import com.mosty.common.base.exception.BusinessException;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.builder.BuilderException;
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import org.locationtech.jts.geom.GeometryFactory;
|
||||
import org.locationtech.jts.geom.Point;
|
||||
import org.locationtech.jts.geom.Polygon;
|
||||
import org.locationtech.jts.algorithm.PointLocator;
|
||||
import org.locationtech.jts.geom.*;
|
||||
import org.locationtech.jts.operation.buffer.BufferOp;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
@ -150,11 +149,32 @@ public class Kit {
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点在范围内
|
||||
*
|
||||
* @param coordinates
|
||||
* @param isPoint
|
||||
* @return
|
||||
* 判断点在线的范围内(缓冲区法)
|
||||
* @param coordinates 线坐标
|
||||
* @param isPoint 点位
|
||||
* @return 是否在范围内
|
||||
*/
|
||||
public static boolean isInLineGeometry(Coordinate[] coordinates, String isPoint) {
|
||||
String[] sp = isPoint.split(",");
|
||||
double xx = Double.parseDouble(sp[0]);
|
||||
double yy = Double.parseDouble(sp[1]);
|
||||
//点是否在多边形内判断
|
||||
Coordinate point = new Coordinate(xx, yy);
|
||||
PointLocator a = new PointLocator();
|
||||
GeometryFactory gf = new GeometryFactory();
|
||||
Geometry gfLineString = gf.createLineString(coordinates);
|
||||
double degree = 500 / (2 * Math.PI * 6371004) * 360;
|
||||
BufferOp bufOp = new BufferOp(gfLineString);
|
||||
bufOp.setEndCapStyle(BufferOp.CAP_BUTT);
|
||||
Geometry bg = bufOp.getResultGeometry(degree);
|
||||
return a.intersects(point, bg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点在范围内(缓冲区法)(不推荐)
|
||||
* @param coordinates 范围边界
|
||||
* @param isPoint 点位
|
||||
* @return 是否在范围内
|
||||
*/
|
||||
public static boolean isInGeometry(Coordinate[] coordinates, String isPoint) {
|
||||
if (coordinates[0].x != coordinates[coordinates.length - 1].x || coordinates[0].y != coordinates[coordinates.length - 1].y) {
|
||||
@ -164,14 +184,59 @@ public class Kit {
|
||||
double xx = Double.parseDouble(sp[0]);
|
||||
double yy = Double.parseDouble(sp[1]);
|
||||
//点是否在多边形内判断
|
||||
Coordinate coordinate = new Coordinate(xx, yy);
|
||||
Coordinate point = new Coordinate(xx, yy);
|
||||
PointLocator a = new PointLocator();
|
||||
GeometryFactory gf = new GeometryFactory();
|
||||
Point point = gf.createPoint(coordinate);
|
||||
Polygon polygon = gf.createPolygon(coordinates);
|
||||
if (point.within(polygon) || point.intersects(polygon)) {
|
||||
return true;
|
||||
Geometry gfLineString = gf.createPolygon(coordinates);
|
||||
double degree = 500 / (2 * Math.PI * 6371004) * 360;
|
||||
BufferOp bufOp = new BufferOp(gfLineString);
|
||||
bufOp.setEndCapStyle(BufferOp.CAP_BUTT);
|
||||
Geometry bg = bufOp.getResultGeometry(degree);
|
||||
return a.intersects(point, bg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点在范围内(射线法)(推荐)
|
||||
* @param coordinates 范围边界
|
||||
* @param isPoint 点位
|
||||
* @return 是否在范围内
|
||||
*/
|
||||
public static boolean isInGeometryByRay(Coordinate[] coordinates, String isPoint){
|
||||
if(StringUtils.isBlank(isPoint) || coordinates == null || coordinates.length <= 0){
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
int count = 0;
|
||||
int length = coordinates.length;
|
||||
|
||||
String[] sp = isPoint.split(",");
|
||||
double pointX = Double.parseDouble(sp[0]);
|
||||
double pointY = Double.parseDouble(sp[1]);
|
||||
|
||||
for(int i = 0 ; i < length ; i++){
|
||||
Coordinate c1 = coordinates[i];
|
||||
Coordinate c2 = coordinates[(i + 1) % length];
|
||||
if(c1.x == pointX && c1.y == pointY){
|
||||
return true;
|
||||
}
|
||||
if(c1.y == c2.y){
|
||||
continue;
|
||||
}
|
||||
if(pointY < Math.min(c1.y, c2.y)){
|
||||
continue;
|
||||
}
|
||||
if(pointY >= Math.max(c1.y, c2.y)){
|
||||
continue;
|
||||
}
|
||||
double x = (pointY - c1.y) * (c2.x - c1.x) / (c2.y - c1.y) + c1.x;
|
||||
if(x > pointX){
|
||||
count++;
|
||||
}else if(x == pointX){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return count % 2 == 1;
|
||||
}
|
||||
|
||||
// 检查经纬度是否合法
|
||||
|
@ -0,0 +1,381 @@
|
||||
package com.mosty.base.utils;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 数学计算工具类
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2024/01/02 11:33
|
||||
* @since 2024/01/02 11:33
|
||||
*/
|
||||
public class MathUtils {
|
||||
|
||||
/**
|
||||
* 默认除法运算精度
|
||||
*/
|
||||
private static final int DEF_DIV_SCALE = 10;
|
||||
|
||||
/**
|
||||
* 计算百分比数值(小数点后两位)
|
||||
* @param sl 数量
|
||||
* @param zs 总数
|
||||
* @return 百分比数值
|
||||
*/
|
||||
public static Double percentage(int sl, int zs){
|
||||
if(sl == 0 || zs == 0){
|
||||
return 0.0;
|
||||
}
|
||||
return MathUtils.percentage(new BigDecimal(sl + ""), new BigDecimal(zs + ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算百分比数值(小数点后两位)
|
||||
* @param sl 数量
|
||||
* @param zs 总数
|
||||
* @return 百分比数值
|
||||
*/
|
||||
public static Double percentage(BigDecimal sl, BigDecimal zs){
|
||||
if(ObjectUtils.isEmpty(sl) || ObjectUtils.isEmpty(zs) || sl.compareTo(BigDecimal.ZERO) == 0 || zs.compareTo(BigDecimal.ZERO) == 0){
|
||||
return 0.0;
|
||||
}
|
||||
return Double.parseDouble(
|
||||
sl.divide(zs, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).toString()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的加法运算
|
||||
*
|
||||
* @param v1 被加数
|
||||
* @param v2 加数
|
||||
* @return 两个参数的和
|
||||
*/
|
||||
|
||||
public static double add(double v1, double v2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.add(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的加法运算
|
||||
*
|
||||
* @param v1 被加数
|
||||
* @param v2 加数
|
||||
* @return 两个参数的和
|
||||
*/
|
||||
public static BigDecimal add(String v1, String v2) {
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.add(b2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的加法运算
|
||||
*
|
||||
* @param v1 被加数
|
||||
* @param v2 加数
|
||||
* @param scale 保留scale 位小数
|
||||
* @return 两个参数的和
|
||||
*/
|
||||
public static String add(String v1, String v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.add(b2).setScale(scale, BigDecimal.ROUND_HALF_UP).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的减法运算
|
||||
*
|
||||
* @param v1 被减数
|
||||
* @param v2 减数
|
||||
* @return 两个参数的差
|
||||
*/
|
||||
public static double sub(double v1, double v2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.subtract(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的减法运算。
|
||||
*
|
||||
* @param v1 被减数
|
||||
* @param v2 减数
|
||||
* @return 两个参数的差
|
||||
*/
|
||||
public static BigDecimal sub(String v1, String v2) {
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.subtract(b2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的减法运算。
|
||||
*
|
||||
* @param b1 被减数
|
||||
* @param b2 减数
|
||||
* @param scale 精度
|
||||
* @param roundingMode 舍入模式
|
||||
* @return 两个参数的差
|
||||
*/
|
||||
public static BigDecimal sub(BigDecimal b1, BigDecimal b2, int scale, int roundingMode){
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
if (roundingMode < 0 || roundingMode > 7) {
|
||||
throw new IllegalArgumentException("roundingMode must in BigDecimal Rounding Modes");
|
||||
}
|
||||
return b1.subtract(b2).setScale(scale, roundingMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的减法运算
|
||||
*
|
||||
* @param v1 被减数
|
||||
* @param v2 减数
|
||||
* @param scale 保留scale 位小数
|
||||
* @return 两个参数的差
|
||||
*/
|
||||
public static String sub(String v1, String v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException( "The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.subtract(b2).setScale(scale, BigDecimal.ROUND_HALF_UP).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的乘法运算
|
||||
*
|
||||
* @param v1 被乘数
|
||||
* @param v2 乘数
|
||||
* @return 两个参数的积
|
||||
*/
|
||||
public static double mul(double v1, double v2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.multiply(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的乘法运算
|
||||
*
|
||||
* @param v1 被乘数
|
||||
* @param v2 乘数
|
||||
* @return 两个参数的积
|
||||
*/
|
||||
public static BigDecimal mul(String v1, String v2) {
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.multiply(b2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的乘法运算
|
||||
*
|
||||
* @param v1 被乘数
|
||||
* @param v2 乘数
|
||||
* @param scale 保留scale 位小数
|
||||
* @return 两个参数的积
|
||||
*/
|
||||
public static double mul(double v1, double v2, int scale) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return round(b1.multiply(b2).doubleValue(), scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供BigDecimal乘法
|
||||
* @param b1 被乘数
|
||||
* @param b2 乘数
|
||||
* @param scale 精度
|
||||
* @param roundingMode 舍入模式
|
||||
* @return 两个参数的积
|
||||
*/
|
||||
public static BigDecimal mul(BigDecimal b1, BigDecimal b2, int scale, int roundingMode){
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
if (roundingMode < 0 || roundingMode > 7) {
|
||||
throw new IllegalArgumentException("roundingMode must in BigDecimal Rounding Modes");
|
||||
}
|
||||
if(b1 == null || b2 == null){
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return b1.multiply(b2).setScale(scale, roundingMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的乘法运算
|
||||
*
|
||||
* @param v1 被乘数
|
||||
* @param v2 乘数
|
||||
* @param scale 保留scale 位小数
|
||||
* @return 两个参数的积
|
||||
*/
|
||||
public static String mul(String v1, String v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException( "The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.multiply(b2).setScale(scale, BigDecimal.ROUND_HALF_UP).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
|
||||
* 小数点以后10位,以后的数字四舍五入
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @return 两个参数的商
|
||||
*/
|
||||
|
||||
public static double div(double v1, double v2) {
|
||||
return div(v1, v2, DEF_DIV_SCALE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指
|
||||
* 定精度,以后的数字四舍五入
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @param scale 表示表示需要精确到小数点以后几位。
|
||||
* @return 两个参数的商
|
||||
*/
|
||||
public static double div(double v1, double v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指
|
||||
* 定精度,以后的数字四舍五入
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @param scale 表示需要精确到小数点以后几位
|
||||
* @return 两个参数的商
|
||||
*/
|
||||
public static String div(String v1, String v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v1);
|
||||
return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供(相对)精确的BigDecimal除法运算。当发生除不尽的情况时,由scale参数指
|
||||
* @param b1 被除数
|
||||
* @param b2 除数
|
||||
* @param scale 表示需要精确到小数点以后几位
|
||||
* @param roundingMode 舍入模式
|
||||
* @return 两个参数的商
|
||||
*/
|
||||
public static BigDecimal div(BigDecimal b1, BigDecimal b2, int scale, int roundingMode) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
if (roundingMode < 0 || roundingMode > 7) {
|
||||
throw new IllegalArgumentException("roundingMode must in BigDecimal Rounding Modes");
|
||||
}
|
||||
if(b1 == null || b2 == null){
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return b1.divide(b2, scale, roundingMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的小数位四舍五入处理
|
||||
*
|
||||
* @param v 需要四舍五入的数字
|
||||
* @param scale 小数点后保留几位
|
||||
* @return 四舍五入后的结果
|
||||
*/
|
||||
public static double round(double v, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b = new BigDecimal(Double.toString(v));
|
||||
return b.setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的小数位四舍五入处理
|
||||
*
|
||||
* @param v 需要四舍五入的数字
|
||||
* @param scale 小数点后保留几位
|
||||
* @return 四舍五入后的结果
|
||||
*/
|
||||
public static String round(String v, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b = new BigDecimal(v);
|
||||
return b.setScale(scale, BigDecimal.ROUND_HALF_UP).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取余数
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @param scale 小数点后保留几位
|
||||
* @return 余数
|
||||
*/
|
||||
public static String remainder(String v1, String v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
return b1.remainder(b2).setScale(scale, BigDecimal.ROUND_HALF_UP).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取余数 BigDecimal
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @param scale 小数点后保留几位
|
||||
* @return 余数
|
||||
*/
|
||||
public static BigDecimal remainder(BigDecimal v1, BigDecimal v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
return v1.remainder(v2).setScale(scale, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 比较大小
|
||||
*
|
||||
* @param v1 被比较数
|
||||
* @param v2 比较数
|
||||
* @return 如果v1 大于v2 则 返回true 否则false
|
||||
*/
|
||||
public static boolean compare(String v1, String v2) {
|
||||
BigDecimal b1 = new BigDecimal(v1);
|
||||
BigDecimal b2 = new BigDecimal(v2);
|
||||
int bj = b1.compareTo(b2);
|
||||
boolean res;
|
||||
res = bj > 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
@ -162,3 +162,18 @@ zdxl.fgxlrw.rwRq.xlghSjKs.notNull=【巡逻规划开始时间】不能为空
|
||||
zdxl.fgxlrw.rwRq.xlghSjJs.notNull=【巡逻规划结束时间】不能为空
|
||||
zdxl.fgxlrw.rwRq.xlghXllc.notNull=【巡逻规划巡逻里程】不能为空
|
||||
zdxl.fgxlrw.rwRq.export.queryNull=当日没有生成任务,请生成后再下载
|
||||
|
||||
#指导巡逻-方格点位必到点
|
||||
zdxl.fgdwBdd.fgdwId.notNull=请选择【方格点位】
|
||||
zdxl.fgdwBdd.bddMc.notBlank=【必到点名称】不能为空
|
||||
zdxl.fgdwBdd.bddMc.size=【必到点名称】不能超过64位
|
||||
zdxl.fgdwBdd.bddDz.size=【必到点地址】不能超过255位
|
||||
zdxl.fgdwBdd.bddSm.size=【必到点说明】不能超过128位
|
||||
zdxl.fgdwBdd.jd.notNull=【经度】不能为空
|
||||
zdxl.fgdwBdd.wd.notNull=【纬度】不能为空
|
||||
|
||||
#指导巡逻-方格点位必到点巡逻任务记录
|
||||
zdxl.fgdwBdd.xlrwJl.dkFj.notBlank=【打卡附件】不能为空
|
||||
zdxl.fgdwBdd.xlrwJl.dkFj.size=【打卡附件】不能超过64位
|
||||
zdxl.fgdwBdd.xlrwJl.dkJd.notNull=【打卡经度】不能为空
|
||||
zdxl.fgdwBdd.xlrwJl.dkWd.notNull=【打卡纬度】不能为空
|
@ -0,0 +1,236 @@
|
||||
package com.mosty.yjzl.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddSaveDTO;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBdd;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgdwBddQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddVO;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
|
||||
import com.mosty.base.utils.Kit;
|
||||
import com.mosty.base.utils.MessageUtils;
|
||||
import com.mosty.base.utils.spring.SpringValidUtils;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点接口
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 12:00
|
||||
* @since 2025/09/06 12:00
|
||||
*/
|
||||
@Api(tags = {"指导巡逻-方格点位必到点接口"})
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbZdxlFgdwBdd")
|
||||
public class TbZdxlFgdwBddController {
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位必到点表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddService tbZdxlFgdwBddService;
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位表Service
|
||||
*/
|
||||
private final TbZdxlFgdwService tbZdxlFgdwService;
|
||||
|
||||
/**
|
||||
* 查询单条(根据主键ID)
|
||||
* @param id 主键ID
|
||||
* @return ResponseResult 实体信息
|
||||
*/
|
||||
@ApiOperation(value = "查询单条(根据主键ID)")
|
||||
@GetMapping("{id}")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-查询单条(根据主键ID)", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<TbZdxlFgdwBdd> selectById(@PathVariable("id") String id) {
|
||||
return ResponseResult.success(tbZdxlFgdwBddService.selectById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页
|
||||
* @param query 实体查询对象
|
||||
* @return ResponseResult 实体信息分页列表
|
||||
*/
|
||||
@ApiOperation(value = "查询分页")
|
||||
@GetMapping("/selectPage")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-查询分页", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<IPage<TbZdxlFgdwBddVO>> selectPage(TbZdxlFgdwBddQuery query) {
|
||||
return ResponseResult.success(tbZdxlFgdwBddService.selectPage(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
* @return ResponseResult 实体信息列表
|
||||
*/
|
||||
@ApiOperation(value = "查询列表")
|
||||
@GetMapping("/selectList")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-查询列表", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<List<TbZdxlFgdwBddVO>> selectList(TbZdxlFgdwBddQuery query) {
|
||||
return ResponseResult.success(tbZdxlFgdwBddService.selectList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存单条
|
||||
* @param dto 保存DTO对象
|
||||
* @param bindResult 校验对象
|
||||
* @return ResponseResult 实体主键ID
|
||||
*/
|
||||
@ApiOperation(value = "保存单条")
|
||||
@PostMapping("save")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-保存单条", businessType = BusinessType.INSERT)
|
||||
public ResponseResult<String> save(@RequestBody @Valid TbZdxlFgdwBddSaveDTO dto, BindingResult bindResult) {
|
||||
try {
|
||||
//基础信息校验
|
||||
String message = SpringValidUtils.getErrorsMsg(bindResult);
|
||||
if (StringUtils.isNotBlank(message)) {
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + message);
|
||||
}
|
||||
|
||||
//校验点位是否在方格内
|
||||
TbZdxlFgdwVO fgdwVO = tbZdxlFgdwService.selectById(dto.getFgdwId());
|
||||
if(ObjectUtils.isEmpty(fgdwVO)){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "方格信息不存在,请退出页面后重新选择");
|
||||
}
|
||||
if(ObjectUtils.isEmpty(fgdwVO.getX1()) || ObjectUtils.isEmpty(fgdwVO.getY1()) || ObjectUtils.isEmpty(fgdwVO.getX2()) || ObjectUtils.isEmpty(fgdwVO.getY2())){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "方格信息不准确,请选择其他方格");
|
||||
}
|
||||
boolean isInGeometry = this.isInGeometry(fgdwVO, dto.getJd(), dto.getWd());
|
||||
if(!isInGeometry){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "点位不在方格内,请重新选点");
|
||||
}
|
||||
|
||||
//保存
|
||||
String resultId = tbZdxlFgdwBddService.saveEntity(dto);
|
||||
if(StringUtils.isNotBlank(resultId)){
|
||||
return ResponseResult.success(resultId);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg());
|
||||
} catch (Exception e) {
|
||||
return ResponseResult.fail(MessageUtils.getSaveServerErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单条
|
||||
* @param dto 修改DTO对象
|
||||
* @param bindResult 校验对象
|
||||
* @return ResponseResult 实体主键ID
|
||||
*/
|
||||
@ApiOperation(value = "修改单条")
|
||||
@PostMapping("update")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-修改单条", businessType = BusinessType.UPDATE)
|
||||
public ResponseResult<String> update(@RequestBody @Valid TbZdxlFgdwBddUpdateDTO dto, BindingResult bindResult){
|
||||
try {
|
||||
//基础信息校验
|
||||
String message = SpringValidUtils.getErrorsMsg(bindResult);
|
||||
if (StringUtils.isNotBlank(message)) {
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + message);
|
||||
}
|
||||
|
||||
//校验数据是否存在
|
||||
TbZdxlFgdwBdd baseEntity = tbZdxlFgdwBddService.selectById(dto.getId());
|
||||
if(ObjectUtils.isEmpty(baseEntity)){
|
||||
return ResponseResult.fail(MessageUtils.getEditDataNotFoundMsg());
|
||||
}
|
||||
|
||||
//校验点位是否在方格内
|
||||
TbZdxlFgdwVO fgdwVO = tbZdxlFgdwService.selectById(dto.getFgdwId());
|
||||
if(ObjectUtils.isEmpty(fgdwVO)){
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + "方格信息不存在,请退出页面后重新选择");
|
||||
}
|
||||
if(ObjectUtils.isEmpty(fgdwVO.getX1()) || ObjectUtils.isEmpty(fgdwVO.getY1()) || ObjectUtils.isEmpty(fgdwVO.getX2()) || ObjectUtils.isEmpty(fgdwVO.getY2())){
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + "方格信息不准确,请选择其他方格");
|
||||
}
|
||||
boolean isInGeometry = this.isInGeometry(fgdwVO, dto.getJd(), dto.getWd());
|
||||
if(!isInGeometry){
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + "点位不在方格内,请重新选点");
|
||||
}
|
||||
|
||||
//修改
|
||||
String resultId = tbZdxlFgdwBddService.updateEntity(dto);
|
||||
if(StringUtils.isNotBlank(resultId)){
|
||||
return ResponseResult.success(resultId);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseResult.fail(MessageUtils.getEditServerErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销单条
|
||||
* @param id 主键ID
|
||||
* @return ResponseResult 注销条数
|
||||
*/
|
||||
@ApiOperation(value = "注销单条")
|
||||
@DeleteMapping("{id}")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-注销单条", businessType = BusinessType.DELETE)
|
||||
public ResponseResult<Integer> cancelById(@PathVariable("id") String id) {
|
||||
try {
|
||||
//如果传入的ID为空,返回失败
|
||||
if(StringUtils.isBlank(id)){
|
||||
return ResponseResult.fail(MessageUtils.getCancelFailMsg() + MessageUtils.message("id.bnwk"));
|
||||
}
|
||||
|
||||
//如果该实体已经被注销,则返回成功
|
||||
TbZdxlFgdwBdd entity = tbZdxlFgdwBddService.selectById(id);
|
||||
if(entity == null){
|
||||
return ResponseResult.success(0);
|
||||
}
|
||||
|
||||
return ResponseResult.success(tbZdxlFgdwBddService.cancelEntity(entity));
|
||||
} catch (Exception e) {
|
||||
return ResponseResult.fail(MessageUtils.getCancelServerErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验点位是否在方格中
|
||||
* @param fgdwVO 方格信息
|
||||
* @param jd 经度
|
||||
* @param wd 纬度
|
||||
* @return 是否在方格中
|
||||
*/
|
||||
private boolean isInGeometry(TbZdxlFgdwVO fgdwVO, BigDecimal jd, BigDecimal wd){
|
||||
if(ObjectUtils.isEmpty(fgdwVO) || ObjectUtils.isEmpty(jd) || ObjectUtils.isEmpty(wd)){
|
||||
return false;
|
||||
}
|
||||
Coordinate leftTop = new Coordinate(fgdwVO.getX1().doubleValue(), fgdwVO.getY2().doubleValue());
|
||||
Coordinate rightTop = new Coordinate(fgdwVO.getX2().doubleValue(), fgdwVO.getY2().doubleValue());
|
||||
Coordinate leftBottom = new Coordinate(fgdwVO.getX1().doubleValue(), fgdwVO.getY1().doubleValue());
|
||||
Coordinate rightBottom = new Coordinate(fgdwVO.getX2().doubleValue(), fgdwVO.getY1().doubleValue());
|
||||
Coordinate[] coordinates = new Coordinate[4];
|
||||
coordinates[0] = leftTop;
|
||||
coordinates[1] = rightTop;
|
||||
coordinates[2] = rightBottom;
|
||||
coordinates[3] = leftBottom;
|
||||
return Kit.isInGeometryByRay(coordinates, jd + "," + wd);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.mosty.yjzl.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务接口
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 19:38
|
||||
* @since 2025/09/06 19:38
|
||||
*/
|
||||
@Api(tags = {"指导巡逻-方格点位必到点巡逻任务接口"})
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbZdxlFgdwBddxlrw")
|
||||
public class TbZdxlFgdwBddxlrwController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.mosty.yjzl.controller;
|
||||
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwJlClockInDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
|
||||
import com.mosty.base.utils.MessageUtils;
|
||||
import com.mosty.base.utils.spring.SpringValidUtils;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务记录接口
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 19:55
|
||||
* @since 2025/09/07 19:55
|
||||
*/
|
||||
@Api(tags = {"指导巡逻-方格点位必到点巡逻任务记录接口"})
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbZdxlFgdwBddxlrwJl")
|
||||
public class TbZdxlFgdwBddxlrwJlController {
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位必到点巡逻任务记录表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddxlrwJlService tbZdxlFgdwBddxlrwJlService;
|
||||
|
||||
/**
|
||||
* 查询列表(根据必到点巡逻任务ID)
|
||||
* @param bddxlrwId 必到点巡逻任务ID
|
||||
* @return ResponseResult 实体信息列表
|
||||
*/
|
||||
@ApiOperation(value = "查询列表(根据必到点巡逻任务ID)")
|
||||
@GetMapping("/selectListByBddxlrwId")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-查询列表(根据必到点巡逻任务ID)", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<List<TbZdxlFgdwBddxlrwJl>> selectListByBddxlrwId(String bddxlrwId) {
|
||||
return ResponseResult.success(tbZdxlFgdwBddxlrwJlService.selectListByBddxlrwId(bddxlrwId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建列表(根据方格巡逻任务ID)
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return ResponseResult 实体信息列表
|
||||
*/
|
||||
@ApiOperation(value = "创建列表(根据方格巡逻任务ID)")
|
||||
@GetMapping("/createListByFgxlrwId")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-创建列表(根据方格巡逻任务ID)", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<Integer> createListByFgxlrwId(String fgxlrwId) {
|
||||
return ResponseResult.success(tbZdxlFgdwBddxlrwJlService.createListByFgxlrwId(fgxlrwId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存单条
|
||||
* @param dto 打卡DTO对象
|
||||
* @param bindResult 校验对象
|
||||
* @return ResponseResult 实体主键ID
|
||||
*/
|
||||
@ApiOperation(value = "打卡")
|
||||
@PostMapping("clockIn")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位必到点接口-打卡", businessType = BusinessType.INSERT)
|
||||
public ResponseResult<String> clockIn(@RequestBody @Valid TbZdxlFgdwBddxlrwJlClockInDTO dto, BindingResult bindResult) {
|
||||
try {
|
||||
//基础信息校验
|
||||
String message = SpringValidUtils.getErrorsMsg(bindResult);
|
||||
if (StringUtils.isNotBlank(message)) {
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + message);
|
||||
}
|
||||
|
||||
TbZdxlFgdwBddxlrwJl baseEntity = tbZdxlFgdwBddxlrwJlService.selectById(dto.getId());
|
||||
if(ObjectUtils.isEmpty(baseEntity)){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "打卡记录不存在,请退出页面重新进入");
|
||||
}
|
||||
|
||||
//打卡时间
|
||||
Date dksj = new Date();
|
||||
|
||||
// TODO: 2025/9/7 需要加上方格内部和打卡点附近的坐标验证
|
||||
|
||||
//校验上一次打卡情况
|
||||
int lastSx = baseEntity.getDkSx() - 1;
|
||||
if(lastSx > 0){
|
||||
TbZdxlFgdwBddxlrwJl lastEntity = tbZdxlFgdwBddxlrwJlService.selectByBddxlrwIdAndDkSx(baseEntity.getBddxlrwId(), lastSx);
|
||||
if(ObjectUtils.isNotEmpty(lastEntity) && ObjectUtils.isEmpty(lastEntity.getDkJsSj())){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "请完成上一次打卡后,再进行本次打卡");
|
||||
}
|
||||
}
|
||||
|
||||
//如果是打结束卡,需要进行以下验证
|
||||
UserInfo user = UserInfoManager.get();
|
||||
if(ObjectUtils.isNotEmpty(baseEntity.getDkKsSj())){
|
||||
//开始和结束是否是同一个人
|
||||
if(!user.getIdEntityCard().equals(baseEntity.getDkrSfzh())){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "您不是此记录的打卡人,不能进行打卡");
|
||||
}
|
||||
//是否待满10分钟
|
||||
if(dksj.getTime()-baseEntity.getDkKsSj().getTime() < 10*60*1000){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "请在开始10分后,再打卡结束");
|
||||
}
|
||||
}
|
||||
|
||||
//打卡
|
||||
String resultId = tbZdxlFgdwBddxlrwJlService.clockIn(baseEntity, dto, user, dksj);
|
||||
if(StringUtils.isNotBlank(resultId)){
|
||||
return ResponseResult.success(resultId);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseResult.fail(MessageUtils.getSaveServerErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.mosty.yjzl.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwUpdateDTO;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgdwQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
|
||||
import com.mosty.base.utils.MessageUtils;
|
||||
import com.mosty.base.utils.spring.SpringValidUtils;
|
||||
@ -38,7 +40,6 @@ public class TbZdxlFgdwController {
|
||||
*/
|
||||
private final TbZdxlFgdwService tbZdxlFgdwService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询单条(根据主键ID)
|
||||
* @param id 主键ID
|
||||
@ -48,7 +49,7 @@ public class TbZdxlFgdwController {
|
||||
@GetMapping("{id}")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位接口-查询单条(根据主键ID)", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<TbZdxlFgdwVO> selectById(@PathVariable("id") Integer id) {
|
||||
public ResponseResult<TbZdxlFgdwVO> selectById(@PathVariable("id") Long id) {
|
||||
return ResponseResult.success(tbZdxlFgdwService.selectById(id));
|
||||
}
|
||||
|
||||
@ -64,6 +65,32 @@ public class TbZdxlFgdwController {
|
||||
return ResponseResult.success(tbZdxlFgdwService.selectAllList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页
|
||||
* @param query 实体查询对象
|
||||
* @return ResponseResult 实体信息分页列表
|
||||
*/
|
||||
@ApiOperation(value = "查询分页")
|
||||
@GetMapping("/selectPage")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位接口-查询分页", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<IPage<TbZdxlFgdwVO>> selectPage(TbZdxlFgdwQuery query) {
|
||||
return ResponseResult.success(tbZdxlFgdwService.selectPage(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
* @return ResponseResult 实体信息列表
|
||||
*/
|
||||
@ApiOperation(value = "查询列表")
|
||||
@GetMapping("/selectList")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位接口-查询列表", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<List<TbZdxlFgdwVO>> selectList(TbZdxlFgdwQuery query) {
|
||||
return ResponseResult.success(tbZdxlFgdwService.selectList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单条
|
||||
* @param dto 修改DTO对象
|
||||
@ -74,7 +101,7 @@ public class TbZdxlFgdwController {
|
||||
@PostMapping("update")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格点位接口-修改单条", businessType = BusinessType.UPDATE)
|
||||
public ResponseResult<Integer> update(@RequestBody @Valid TbZdxlFgdwUpdateDTO dto, BindingResult bindResult){
|
||||
public ResponseResult<Long> update(@RequestBody @Valid TbZdxlFgdwUpdateDTO dto, BindingResult bindResult){
|
||||
try {
|
||||
//基础信息校验
|
||||
String message = SpringValidUtils.getErrorsMsg(bindResult);
|
||||
@ -83,7 +110,7 @@ public class TbZdxlFgdwController {
|
||||
}
|
||||
|
||||
//修改
|
||||
Integer resultId = tbZdxlFgdwService.updateEntity(dto);
|
||||
Long resultId = tbZdxlFgdwService.updateEntity(dto);
|
||||
if(ObjectUtils.isNotEmpty(resultId)){
|
||||
return ResponseResult.success(resultId);
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
package com.mosty.yjzl.controller;
|
||||
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgmrpzUpdateDTO;
|
||||
import com.mosty.base.utils.MessageUtils;
|
||||
import com.mosty.base.utils.spring.SpringValidUtils;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.base.util.StringUtils;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.yjzl.service.TbZdxlFgmrpzService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
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.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格默认配置接口
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/05 18:58
|
||||
* @since 2025/09/05 18:58
|
||||
*/
|
||||
@Api(tags = {"指导巡逻-方格默认配置接口"})
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbZdxlFgmrpz")
|
||||
public class TbZdxlFgmrpzController {
|
||||
|
||||
/**
|
||||
* 指导巡逻方格默认配置表Service
|
||||
*/
|
||||
private final TbZdxlFgmrpzService tbZdxlFgmrpzService;
|
||||
|
||||
/**
|
||||
* 修改单条
|
||||
* @param dto 修改DTO对象
|
||||
* @param bindResult 校验对象
|
||||
* @return ResponseResult 实体主键ID
|
||||
*/
|
||||
@ApiOperation(value = "修改单条")
|
||||
@PostMapping("update")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格默认配置接口-修改单条", businessType = BusinessType.UPDATE)
|
||||
public ResponseResult<String> update(@RequestBody @Valid TbZdxlFgmrpzUpdateDTO dto, BindingResult bindResult){
|
||||
try {
|
||||
//基础信息校验
|
||||
String message = SpringValidUtils.getErrorsMsg(bindResult);
|
||||
if (StringUtils.isNotBlank(message)) {
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + message);
|
||||
}
|
||||
|
||||
//修改
|
||||
String resultId = tbZdxlFgmrpzService.updateEntity(dto);
|
||||
if(StringUtils.isNotBlank(resultId)){
|
||||
return ResponseResult.success(resultId);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseResult.fail(MessageUtils.getEditServerErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package com.mosty.yjzl.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgxlrwCreateDTO;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgxlrwIssueDTO;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgxlrwUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgxlrw;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgxlrwQuery;
|
||||
@ -14,11 +15,14 @@ import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.base.util.StringUtils;
|
||||
import com.mosty.common.config.Excel.ExcelUtil;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgxlrwService;
|
||||
import com.mosty.yjzl.utils.TbZdxlFgxlrwUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -26,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -45,6 +50,11 @@ public class TbZdxlFgxlrwController {
|
||||
*/
|
||||
private final TbZdxlFgxlrwService tbZdxlFgxlrwService;
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位必到点巡逻任务记录表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddxlrwJlService tbZdxlFgdwBddxlrwJlService;
|
||||
|
||||
/**
|
||||
* 查询分页
|
||||
* @param query 实体查询对象
|
||||
@ -58,6 +68,19 @@ public class TbZdxlFgxlrwController {
|
||||
return ResponseResult.success(tbZdxlFgxlrwService.selectPage(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页(需要执行的任务)
|
||||
* @param query 实体查询对象
|
||||
* @return ResponseResult 实体返回信息分页列表
|
||||
*/
|
||||
@ApiOperation(value = "查询分页(需要执行的任务)")
|
||||
@GetMapping("/selectRwPage")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格巡逻任务接口-查询分页(需要执行的任务)", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<IPage<TbZdxlFgxlrwVO>> selectRwPage(TbZdxlFgxlrwQuery query) {
|
||||
return ResponseResult.success(tbZdxlFgxlrwService.selectRwPage(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
@ -89,6 +112,14 @@ public class TbZdxlFgxlrwController {
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + message);
|
||||
}
|
||||
|
||||
TbZdxlFgxlrw baseEntity = tbZdxlFgxlrwService.selectById(dto.getId());
|
||||
if(ObjectUtils.isEmpty(baseEntity)){
|
||||
return ResponseResult.fail(MessageUtils.getEditDataNotFoundMsg());
|
||||
}
|
||||
if(!(TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_CJ.equals(baseEntity.getRwZt()) || TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_YDC.equals(baseEntity.getRwZt()))){
|
||||
return ResponseResult.fail(MessageUtils.getEditFailMsg() + "任务已下发,不能再进行修改");
|
||||
}
|
||||
|
||||
//修改
|
||||
String resultId = tbZdxlFgxlrwService.updateEntity(dto);
|
||||
if(StringUtils.isNotBlank(resultId)){
|
||||
@ -145,12 +176,13 @@ public class TbZdxlFgxlrwController {
|
||||
public ResponseResult<Integer> importListByMb(MultipartFile file) {
|
||||
try {
|
||||
ExcelUtil<TbZdxlFgxlrw> util = new ExcelUtil<>(TbZdxlFgxlrw.class);
|
||||
List<TbZdxlFgxlrw> fgxlrwList = util.importExcel(file.getInputStream());
|
||||
List<TbZdxlFgxlrw> fgxlrwList = util.importExcel(file.getInputStream(), 1);
|
||||
if(CollectionUtils.isEmpty(fgxlrwList)){
|
||||
int resultInt = tbZdxlFgxlrwService.importListByMb(fgxlrwList);
|
||||
if(resultInt > 0){
|
||||
return ResponseResult.success(resultInt);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getImportFailMsg() + "表格数据获取为空");
|
||||
}
|
||||
int resultInt = tbZdxlFgxlrwService.importListByMb(fgxlrwList);
|
||||
if(resultInt > 0){
|
||||
return ResponseResult.success(resultInt);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getImportFailMsg());
|
||||
} catch (Exception e) {
|
||||
@ -158,4 +190,49 @@ public class TbZdxlFgxlrwController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发任务
|
||||
* @param dto 下发DTO对象
|
||||
* @return ResponseResult 实体主键ID
|
||||
*/
|
||||
@ApiOperation(value = "下发任务")
|
||||
@PostMapping("issueList")
|
||||
@JwtSysUser
|
||||
@Log(title = "指导巡逻-方格巡逻任务接口-下发任务", businessType = BusinessType.UPDATE)
|
||||
public ResponseResult<Integer> issueList(@RequestBody TbZdxlFgxlrwIssueDTO dto){
|
||||
try {
|
||||
//基础信息校验
|
||||
if(ObjectUtils.isEmpty(dto) || StringUtils.isBlank(dto.getIds())){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "请选择需要下发的任务");
|
||||
}
|
||||
|
||||
List<TbZdxlFgxlrw> entityList = tbZdxlFgxlrwService.selectListByIds(dto.getIds());
|
||||
if(CollectionUtils.isEmpty(entityList)){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "您选择的任务不存在,请刷新页面后重新下发");
|
||||
}
|
||||
|
||||
List<TbZdxlFgxlrw> issueList = entityList.stream()
|
||||
.filter(entity -> TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_CJ.equals(entity.getRwZt()) || TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_YDC.equals(entity.getRwZt()))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(issueList)){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "您选择的任务都已下发,请选择其他任务");
|
||||
}
|
||||
|
||||
//下发
|
||||
int resultInt = tbZdxlFgxlrwService.issueList(issueList);
|
||||
if(resultInt > 0){
|
||||
//新建打卡记录
|
||||
for(TbZdxlFgxlrw entity : issueList){
|
||||
tbZdxlFgdwBddxlrwJlService.createListByFgxlrwId(entity.getId());
|
||||
}
|
||||
//返回
|
||||
return ResponseResult.success(resultInt);
|
||||
}
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseResult.fail(MessageUtils.getSaveServerErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.mosty.yjzl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBdd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点表Mapper
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 14:17
|
||||
* @since 2025/09/06 14:17
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbZdxlFgdwBddMapper extends BaseMapper<TbZdxlFgdwBdd> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.mosty.yjzl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务记录表Mapper
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 19:58
|
||||
* @since 2025/09/07 19:58
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbZdxlFgdwBddxlrwJlMapper extends BaseMapper<TbZdxlFgdwBddxlrwJl> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.mosty.yjzl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrw;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务表Mapper
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 19:50
|
||||
* @since 2025/09/06 19:50
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbZdxlFgdwBddxlrwMapper extends BaseMapper<TbZdxlFgdwBddxlrw> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.mosty.yjzl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgmrpz;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格默认配置表Mapper
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/05 19:03
|
||||
* @since 2025/09/05 19:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbZdxlFgmrpzMapper extends BaseMapper<TbZdxlFgmrpz> {
|
||||
|
||||
}
|
@ -0,0 +1,247 @@
|
||||
package com.mosty.yjzl.service.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.mosty.base.model.dto.yjzl.TbZdxlFgdwBddSaveDTO;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdw;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBdd;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgdwBddQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddVO;
|
||||
import com.mosty.base.utils.PageUtils;
|
||||
import com.mosty.base.utils.QueryWrapperUtils;
|
||||
import com.mosty.base.utils.UUIDGenerator;
|
||||
import com.mosty.yjzl.mapper.TbZdxlFgdwBddMapper;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点表Service实现类
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 14:16
|
||||
* @since 2025/09/06 14:16
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbZdxlFgdwBddServiceImpl extends ServiceImpl<TbZdxlFgdwBddMapper, TbZdxlFgdwBdd> implements TbZdxlFgdwBddService {
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位表Service
|
||||
*/
|
||||
private final TbZdxlFgdwService tbZdxlFgdwService;
|
||||
|
||||
@Override
|
||||
public TbZdxlFgdwBdd selectById(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return null;
|
||||
}
|
||||
return this.baseMapper.selectOne(new QueryWrapper<TbZdxlFgdwBdd>()
|
||||
.eq(TbZdxlFgdwBdd.ID_FIELD, id)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TbZdxlFgdwBddVO> selectPage(TbZdxlFgdwBddQuery query) {
|
||||
IPage<TbZdxlFgdwBdd> page = PageUtils.buildPage(query.getPageSize(), query.getPageCurrent());
|
||||
QueryWrapper<TbZdxlFgdwBdd> qw = new QueryWrapper<>();
|
||||
|
||||
//组装查询参数
|
||||
this.buildListSelectQueryWrapper(qw, query);
|
||||
|
||||
//返回Page
|
||||
IPage<TbZdxlFgdwBddVO> resultPage = new Page<>(query.getPageCurrent(), query.getPageSize());
|
||||
|
||||
//查询数据
|
||||
page = this.baseMapper.selectPage(page, qw);
|
||||
List<TbZdxlFgdwBdd> list = page.getRecords();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
//转为VO
|
||||
List<TbZdxlFgdwBddVO> resultList = this.buildAllInfoListByEntityList(list);
|
||||
|
||||
//组装VO
|
||||
resultPage.setRecords(resultList);
|
||||
resultPage.setTotal(page.getTotal());
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBddVO> selectList(TbZdxlFgdwBddQuery query) {
|
||||
QueryWrapper<TbZdxlFgdwBdd> qw = new QueryWrapper<>();
|
||||
|
||||
//组装查询参数
|
||||
this.buildListSelectQueryWrapper(qw, query);
|
||||
|
||||
//查询数据
|
||||
List<TbZdxlFgdwBdd> list = this.baseMapper.selectList(qw);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//转为VO返回
|
||||
return this.buildAllInfoListByEntityList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBdd> selectListByIdList(List<String> idList) {
|
||||
if(CollectionUtils.isEmpty(idList)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询数据
|
||||
return this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBdd>()
|
||||
.in(TbZdxlFgdwBdd.ID_FIELD, idList)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBdd> selectListByFgdwId(Long fgdwId) {
|
||||
if(ObjectUtils.isEmpty(fgdwId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询数据
|
||||
return this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBdd>()
|
||||
.eq(TbZdxlFgdwBdd.FGDW_ID_FIELD, fgdwId)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBdd> selectListByFgxlrwId(String fgxlrwId) {
|
||||
if(ObjectUtils.isEmpty(fgxlrwId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询数据
|
||||
return this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBdd>()
|
||||
.inSql(TbZdxlFgdwBdd.FGDW_ID_FIELD, "select fg_id from tb_zdxl_fgxlrw where xt_sjzt = '1' and xt_scbz = '0' and id = '" + fgxlrwId + "'")
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String saveEntity(TbZdxlFgdwBddSaveDTO dto) {
|
||||
//复制参数至实体
|
||||
TbZdxlFgdwBdd entity = BeanUtil.copyProperties(dto, TbZdxlFgdwBdd.class);
|
||||
|
||||
//组装参数
|
||||
entity.setId(UUIDGenerator.getUUID());
|
||||
entity.setXtSjly("1");
|
||||
|
||||
//保存实体
|
||||
int resultInt = this.baseMapper.insert(entity);
|
||||
if(resultInt > 0){
|
||||
//返回主键
|
||||
return entity.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String updateEntity(TbZdxlFgdwBddUpdateDTO dto) {
|
||||
//复制参数至实体
|
||||
TbZdxlFgdwBdd entity = BeanUtil.copyProperties(dto, TbZdxlFgdwBdd.class);
|
||||
|
||||
//修改实体
|
||||
int resultInt = this.baseMapper.updateById(entity);
|
||||
if(resultInt > 0){
|
||||
//返回主键
|
||||
return entity.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int cancelEntity(TbZdxlFgdwBdd entity) {
|
||||
//先修改系统字段
|
||||
TbZdxlFgdwBdd cancelEntity = new TbZdxlFgdwBdd();
|
||||
cancelEntity.setId(entity.getId());
|
||||
this.baseMapper.updateById(cancelEntity);
|
||||
//再注销
|
||||
return this.baseMapper.deleteById(entity.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装查询参数
|
||||
* @param qw QueryWrapper
|
||||
* @param query 查询对象
|
||||
*/
|
||||
private void buildListSelectQueryWrapper(QueryWrapper<TbZdxlFgdwBdd> qw, TbZdxlFgdwBddQuery query){
|
||||
//组装其他排序方式
|
||||
QueryWrapperUtils.buildQueryWrapperOrder(qw, query.getSort(), query.getOrder());
|
||||
//未注销数据
|
||||
qw.eq("xt_sjzt", "1").eq("xt_scbz", "0");
|
||||
|
||||
//方格点位ID
|
||||
qw.like(ObjectUtils.isNotEmpty(query.getFgdwId()), TbZdxlFgdwBdd.FGDW_ID_FIELD, query.getFgdwId());
|
||||
//必到点名称
|
||||
qw.like(StringUtils.isNotBlank(query.getBddMc()), TbZdxlFgdwBdd.BDD_MC_FIELD, query.getBddMc());
|
||||
//必到点地址
|
||||
qw.like(StringUtils.isNotBlank(query.getBddDz()), TbZdxlFgdwBdd.BDD_DZ_FIELD, query.getBddDz());
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装全量信息列表(根据实体列表)
|
||||
* @param entityList 实体列表
|
||||
* @return 全量信息列表
|
||||
*/
|
||||
private List<TbZdxlFgdwBddVO> buildAllInfoListByEntityList(List<TbZdxlFgdwBdd> entityList){
|
||||
List<TbZdxlFgdwBddVO> allInfoVOList = new ArrayList<>();
|
||||
//组装返回数据
|
||||
for(TbZdxlFgdwBdd entity : entityList){
|
||||
TbZdxlFgdwBddVO resultVO = this.buildAllInfoByEntity(entity);
|
||||
allInfoVOList.add(resultVO);
|
||||
}
|
||||
//返回列表
|
||||
if(CollectionUtils.isEmpty(allInfoVOList)){
|
||||
return null;
|
||||
}
|
||||
return allInfoVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装全量信息(根据实体信息)
|
||||
* @param entity 实体信息
|
||||
* @return 全量信息
|
||||
*/
|
||||
private TbZdxlFgdwBddVO buildAllInfoByEntity(TbZdxlFgdwBdd entity){
|
||||
TbZdxlFgdwBddVO resultVO = BeanUtil.copyProperties(entity, TbZdxlFgdwBddVO.class);
|
||||
|
||||
if(ObjectUtils.isNotEmpty(resultVO.getFgdwId())){
|
||||
//组装方格数据
|
||||
TbZdxlFgdw fg = tbZdxlFgdwService.selectById(resultVO.getFgdwId());
|
||||
if(ObjectUtils.isNotEmpty(fg)){
|
||||
resultVO.setFgdwMc(fg.getMc1());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
package com.mosty.yjzl.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwJlClockInDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrw;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
|
||||
import com.mosty.base.utils.UUIDGenerator;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.yjzl.mapper.TbZdxlFgdwBddxlrwJlMapper;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务记录表Service实现类
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 19:57
|
||||
* @since 2025/09/07 19:57
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlrwJlMapper, TbZdxlFgdwBddxlrwJl> implements TbZdxlFgdwBddxlrwJlService {
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位必到点巡逻任务表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddxlrwService tbZdxlFgdwBddxlrwService;
|
||||
|
||||
@Override
|
||||
public TbZdxlFgdwBddxlrwJl selectById(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return null;
|
||||
}
|
||||
return this.baseMapper.selectOne(new QueryWrapper<TbZdxlFgdwBddxlrwJl>()
|
||||
.eq(TbZdxlFgdwBddxlrwJl.ID_FIELD, id)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbZdxlFgdwBddxlrwJl selectByBddxlrwIdAndDkSx(String bddxlrwId, int dkSx) {
|
||||
if(StringUtils.isBlank(bddxlrwId)){
|
||||
return null;
|
||||
}
|
||||
return this.baseMapper.selectOne(new QueryWrapper<TbZdxlFgdwBddxlrwJl>()
|
||||
.eq(TbZdxlFgdwBddxlrwJl.BDDXLRW_ID_FIELD, bddxlrwId)
|
||||
.eq(TbZdxlFgdwBddxlrwJl.DK_SX_FIELD, dkSx)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBddxlrwJl> selectListByBddxlrwId(String bddxlrwId) {
|
||||
if(ObjectUtils.isEmpty(bddxlrwId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBddxlrwJl>()
|
||||
.eq(TbZdxlFgdwBddxlrwJl.BDDXLRW_ID_FIELD, bddxlrwId)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
.orderByAsc(TbZdxlFgdwBddxlrwJl.DK_SX_FIELD)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int createListByFgxlrwId(String fgxlrwId) {
|
||||
if(StringUtils.isBlank(fgxlrwId)){
|
||||
return -1;
|
||||
}
|
||||
|
||||
List<TbZdxlFgdwBddxlrw> bddxlrwList = tbZdxlFgdwBddxlrwService.selectListByFgxlrwId(fgxlrwId);
|
||||
if(CollectionUtils.isEmpty(bddxlrwList)){
|
||||
return -2;
|
||||
}
|
||||
|
||||
//循环组装数据
|
||||
List<TbZdxlFgdwBddxlrwJl> saveList = new ArrayList<>();
|
||||
for(TbZdxlFgdwBddxlrw bbdxlrw : bddxlrwList){
|
||||
if(ObjectUtils.isEmpty(bbdxlrw.getXlghDkcs())){
|
||||
continue;
|
||||
}
|
||||
|
||||
for(int i = 1 ; i <= bbdxlrw.getXlghDkcs() ; i++){
|
||||
TbZdxlFgdwBddxlrwJl entity = new TbZdxlFgdwBddxlrwJl();
|
||||
entity.setId(UUIDGenerator.getUUID());
|
||||
entity.setBddxlrwId(bbdxlrw.getId());
|
||||
entity.setDkSx(i);
|
||||
entity.setXtSjly("1");
|
||||
saveList.add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
boolean success = this.saveBatch(saveList);
|
||||
if(success){
|
||||
return saveList.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String clockIn(TbZdxlFgdwBddxlrwJl baseEntity, TbZdxlFgdwBddxlrwJlClockInDTO dto, UserInfo user, Date dksj) {
|
||||
if(ObjectUtils.isEmpty(baseEntity) || ObjectUtils.isEmpty(dto) || ObjectUtils.isEmpty(user)){
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean start = ObjectUtils.isEmpty(baseEntity.getDkKsSj());
|
||||
if(start){
|
||||
//开始
|
||||
baseEntity.setDkKsSj(dksj);
|
||||
baseEntity.setDkKsFj(dto.getDkFj());
|
||||
baseEntity.setDkKsJd(dto.getDkJd());
|
||||
baseEntity.setDkKsWd(dto.getDkWd());
|
||||
baseEntity.setDkrXm(user.getUserName());
|
||||
baseEntity.setDkrSfzh(user.getIdEntityCard());
|
||||
}else{
|
||||
//结束
|
||||
baseEntity.setDkJsSj(dksj);
|
||||
baseEntity.setDkJsFj(dto.getDkFj());
|
||||
baseEntity.setDkJsJd(dto.getDkJd());
|
||||
baseEntity.setDkJsWd(dto.getDkWd());
|
||||
}
|
||||
|
||||
int resultInt = this.baseMapper.updateById(baseEntity);
|
||||
if(resultInt > 0){
|
||||
//保存成功后,同步必到点状态
|
||||
tbZdxlFgdwBddxlrwService.clockInByJl(baseEntity, start);
|
||||
//返回
|
||||
return baseEntity.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,344 @@
|
||||
package com.mosty.yjzl.service.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwHandleDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.*;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddxlrwVO;
|
||||
import com.mosty.base.utils.Constant;
|
||||
import com.mosty.base.utils.MathUtils;
|
||||
import com.mosty.base.utils.UUIDGenerator;
|
||||
import com.mosty.yjzl.mapper.TbZdxlFgdwBddxlrwMapper;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgmrpzService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务表Service实现类
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 19:49
|
||||
* @since 2025/09/06 19:49
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbZdxlFgdwBddxlrwServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlrwMapper, TbZdxlFgdwBddxlrw> implements TbZdxlFgdwBddxlrwService {
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位必到点表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddService tbZdxlFgdwBddService;
|
||||
|
||||
/**
|
||||
* 指导巡逻方格默认配置表Service
|
||||
*/
|
||||
private final TbZdxlFgmrpzService tbZdxlFgmrpzService;
|
||||
|
||||
@Override
|
||||
public TbZdxlFgdwBddxlrw selectById(String id) {
|
||||
if(ObjectUtils.isEmpty(id)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询已配置的任务数据
|
||||
return this.baseMapper.selectOne(new QueryWrapper<TbZdxlFgdwBddxlrw>()
|
||||
.eq(TbZdxlFgdwBddxlrw.ID_FIELD, id)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBddxlrw> selectListByFgxlrwId(String fgxlrwId) {
|
||||
if(ObjectUtils.isEmpty(fgxlrwId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询已配置的任务数据
|
||||
return this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBddxlrw>()
|
||||
.eq(TbZdxlFgdwBddxlrw.FGXLRW_ID_FIELD, fgxlrwId)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBddxlrwVO> selectVoListByYxfFgxlrwId(String fgxlrwId) {
|
||||
if(ObjectUtils.isEmpty(fgxlrwId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询已配置的任务数据
|
||||
List<TbZdxlFgdwBddxlrw> entityList = this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBddxlrw>()
|
||||
.eq(TbZdxlFgdwBddxlrw.FGXLRW_ID_FIELD, fgxlrwId)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
|
||||
//组装并返回数据
|
||||
return this.buildAllInfoList(entityList, null, fgxlrwId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwBddxlrwVO> selectVoListByFgxlrwId(String fgxlrwId) {
|
||||
if(ObjectUtils.isEmpty(fgxlrwId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询已配置的任务数据
|
||||
List<TbZdxlFgdwBddxlrw> entityList = this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBddxlrw>()
|
||||
.eq(TbZdxlFgdwBddxlrw.FGXLRW_ID_FIELD, fgxlrwId)
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
//查询所有必到点
|
||||
List<TbZdxlFgdwBdd> bddList = tbZdxlFgdwBddService.selectListByFgxlrwId(fgxlrwId);
|
||||
|
||||
//组装并返回数据
|
||||
return this.buildAllInfoList(entityList, bddList, fgxlrwId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int handleList(List<TbZdxlFgdwBddxlrwHandleDTO> handleList) {
|
||||
if(CollectionUtils.isEmpty(handleList)){
|
||||
return -1;
|
||||
}
|
||||
|
||||
//筛选数据
|
||||
List<TbZdxlFgdwBddxlrwHandleDTO> saveDtoList = handleList.stream().filter(dto -> ObjectUtils.isEmpty(dto.getId())).collect(Collectors.toList());
|
||||
List<TbZdxlFgdwBddxlrwHandleDTO> updateDtoList = handleList.stream().filter(dto -> ObjectUtils.isNotEmpty(dto.getId())).collect(Collectors.toList());
|
||||
List<TbZdxlFgdwBddxlrw> saveList = new ArrayList<>(), updateList = new ArrayList<>();
|
||||
|
||||
//组装保存列表
|
||||
if(CollectionUtils.isNotEmpty(saveDtoList)){
|
||||
for(TbZdxlFgdwBddxlrwHandleDTO dto : saveDtoList){
|
||||
TbZdxlFgdwBddxlrw entity = BeanUtil.copyProperties(dto, TbZdxlFgdwBddxlrw.class);
|
||||
//组装参数
|
||||
entity.setId(UUIDGenerator.getUUID());
|
||||
entity.setXtSjly("1");
|
||||
saveList.add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
//组装修改列表
|
||||
if(CollectionUtils.isNotEmpty(updateDtoList)){
|
||||
for(TbZdxlFgdwBddxlrwHandleDTO dto : saveDtoList){
|
||||
TbZdxlFgdwBddxlrw entity = new TbZdxlFgdwBddxlrw();
|
||||
entity.setId(dto.getId());
|
||||
entity.setXlghDkcs(dto.getXlghDkcs());
|
||||
updateList.add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
//保存或修改信息
|
||||
int resultInt = 0;
|
||||
if(CollectionUtils.isNotEmpty(saveList)){
|
||||
boolean success = this.saveBatch(saveList);
|
||||
if(success){
|
||||
resultInt += saveList.size();
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(updateList)){
|
||||
boolean success = this.updateBatchById(updateList);
|
||||
if(success){
|
||||
resultInt += updateList.size();
|
||||
}
|
||||
}
|
||||
return resultInt;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int handleListByFgxlrwList(List<TbZdxlFgxlrw> fgxlrwList) {
|
||||
if(CollectionUtils.isEmpty(fgxlrwList)){
|
||||
return -1;
|
||||
}
|
||||
|
||||
//通过查询vo列表,组装成dto列表,进行保存
|
||||
int resultInt = 0;
|
||||
for(TbZdxlFgxlrw fgxlrw : fgxlrwList){
|
||||
List<TbZdxlFgdwBddxlrwVO> voList = this.selectVoListByFgxlrwId(fgxlrw.getId());
|
||||
if(CollectionUtils.isEmpty(voList)){
|
||||
continue;
|
||||
}
|
||||
List<TbZdxlFgdwBddxlrwHandleDTO> dtoList = new ArrayList<>();
|
||||
for(TbZdxlFgdwBddxlrwVO vo : voList){
|
||||
TbZdxlFgdwBddxlrwHandleDTO dto = BeanUtil.copyProperties(vo, TbZdxlFgdwBddxlrwHandleDTO.class);
|
||||
dtoList.add(dto);
|
||||
}
|
||||
resultInt += this.handleList(dtoList);
|
||||
}
|
||||
|
||||
return resultInt;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String clockInByJl(TbZdxlFgdwBddxlrwJl jl, boolean start) {
|
||||
if(ObjectUtils.isEmpty(jl) || ObjectUtils.isEmpty(jl.getBddxlrwId())){
|
||||
return null;
|
||||
}
|
||||
|
||||
TbZdxlFgdwBddxlrw baseEntity = this.selectById(jl.getBddxlrwId());
|
||||
if(ObjectUtils.isEmpty(baseEntity)){
|
||||
return null;
|
||||
}
|
||||
|
||||
TbZdxlFgdwBddxlrw updateEntity = new TbZdxlFgdwBddxlrw();
|
||||
updateEntity.setId(baseEntity.getId());
|
||||
|
||||
//修改开始状态
|
||||
if(Constant.DICT_ITEM_D_BZ_SF_NO.equals(baseEntity.getSfKs())){
|
||||
updateEntity.setSfKs(Constant.DICT_ITEM_D_BZ_SF_YES);
|
||||
}
|
||||
|
||||
//判断是否修改结束状态
|
||||
if(baseEntity.getXlghDkcs().equals(jl.getDkSx()) && !start){
|
||||
//规划打卡次数与记录打卡相同,则表示是最后一次打卡,如果是结束打卡,则可以将状态改为结束
|
||||
updateEntity.setSfJs(Constant.DICT_ITEM_D_BZ_SF_YES);
|
||||
}
|
||||
|
||||
//结束打卡,增加次数
|
||||
if(!start){
|
||||
int newSjDkCs = baseEntity.getXlsjDkcs() + 1;
|
||||
if(newSjDkCs > baseEntity.getXlghDkcs()){
|
||||
newSjDkCs = baseEntity.getXlghDkcs();
|
||||
}
|
||||
updateEntity.setXlsjDkcs(newSjDkCs);
|
||||
}
|
||||
|
||||
int resultInt = this.baseMapper.updateById(updateEntity);
|
||||
if(resultInt > 0){
|
||||
return baseEntity.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 组装全量信息列表(根据实体列表、必到点列表)
|
||||
* @param entityList 实体列表
|
||||
* @param bddList 必到点列表
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 全量信息列表
|
||||
*/
|
||||
private List<TbZdxlFgdwBddxlrwVO> buildAllInfoList(List<TbZdxlFgdwBddxlrw> entityList, List<TbZdxlFgdwBdd> bddList, String fgxlrwId){
|
||||
if(CollectionUtils.isEmpty(entityList) && CollectionUtils.isEmpty(bddList)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//组装实体数据
|
||||
Map<String, TbZdxlFgdwBddxlrw> entityMap = new HashMap<>();
|
||||
List<TbZdxlFgdwBddxlrwVO> allInfoVoList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(entityList)){
|
||||
List<TbZdxlFgdwBddxlrwVO> entityAllInfoList = this.buildAllInfoListByEntityList(entityList);
|
||||
if(CollectionUtils.isNotEmpty(entityAllInfoList)){
|
||||
allInfoVoList.addAll(entityAllInfoList);
|
||||
}
|
||||
entityMap = entityList.stream().collect(Collectors.toMap(TbZdxlFgdwBddxlrw::getBddId, Function.identity(), (key1, key2) -> key2));
|
||||
}
|
||||
|
||||
//组装必到点数据
|
||||
if(CollectionUtils.isNotEmpty(bddList)){
|
||||
Map<String, TbZdxlFgdwBddxlrw> finalEntityMap = entityMap;
|
||||
List<TbZdxlFgdwBdd> bddNotCreateList = bddList.stream().filter(bdd -> !finalEntityMap.containsKey(bdd.getId())).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(bddNotCreateList)){
|
||||
List<TbZdxlFgdwBddxlrwVO> bddAllInfoList = this.buildAllInfoListByBddList(bddNotCreateList, fgxlrwId);
|
||||
if(CollectionUtils.isNotEmpty(bddAllInfoList)){
|
||||
allInfoVoList.addAll(bddAllInfoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allInfoVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装全量信息列表(根据必到点列表)
|
||||
* @param bddList 必到点列表
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 全量信息列表
|
||||
*/
|
||||
private List<TbZdxlFgdwBddxlrwVO> buildAllInfoListByBddList(List<TbZdxlFgdwBdd> bddList, String fgxlrwId){
|
||||
if(CollectionUtils.isEmpty(bddList)){
|
||||
return null;
|
||||
}
|
||||
|
||||
TbZdxlFgmrpz mrpz = tbZdxlFgmrpzService.selectDefault();
|
||||
if(ObjectUtils.isEmpty(mrpz)){
|
||||
return null;
|
||||
}
|
||||
|
||||
List<TbZdxlFgdwBddxlrwVO> allInfoVOList = new ArrayList<>();
|
||||
for(TbZdxlFgdwBdd bdd : bddList){
|
||||
TbZdxlFgdwBddxlrwVO vo = new TbZdxlFgdwBddxlrwVO();
|
||||
|
||||
vo.setBddMc(bdd.getBddMc());
|
||||
vo.setBddId(bdd.getId());
|
||||
vo.setFgxlrwId(fgxlrwId);
|
||||
vo.setXlghDkcs(mrpz.getFgDkcs());
|
||||
vo.setXlsjDkcs(0);
|
||||
vo.setSfKs(Constant.DICT_ITEM_D_BZ_SF_NO);
|
||||
vo.setSfJs(Constant.DICT_ITEM_D_BZ_SF_NO);
|
||||
allInfoVOList.add(vo);
|
||||
}
|
||||
|
||||
return allInfoVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装全量信息列表(根据实体列表)
|
||||
* @param entityList 实体列表
|
||||
* @return 全量信息列表
|
||||
*/
|
||||
private List<TbZdxlFgdwBddxlrwVO> buildAllInfoListByEntityList(List<TbZdxlFgdwBddxlrw> entityList){
|
||||
List<TbZdxlFgdwBddxlrwVO> allInfoVOList = new ArrayList<>();
|
||||
//组装返回数据
|
||||
for(TbZdxlFgdwBddxlrw entity : entityList){
|
||||
TbZdxlFgdwBddxlrwVO resultVO = this.buildAllInfoByEntity(entity);
|
||||
allInfoVOList.add(resultVO);
|
||||
}
|
||||
//返回列表
|
||||
if(CollectionUtils.isEmpty(allInfoVOList)){
|
||||
return null;
|
||||
}
|
||||
return allInfoVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装全量信息(根据实体信息)
|
||||
* @param entity 实体信息
|
||||
* @return 全量信息
|
||||
*/
|
||||
private TbZdxlFgdwBddxlrwVO buildAllInfoByEntity(TbZdxlFgdwBddxlrw entity){
|
||||
TbZdxlFgdwBddxlrwVO resultVO = BeanUtil.copyProperties(entity, TbZdxlFgdwBddxlrwVO.class);
|
||||
|
||||
//组装必到点信息
|
||||
if(ObjectUtils.isNotEmpty(resultVO.getBddId())){
|
||||
TbZdxlFgdwBdd bdd = tbZdxlFgdwBddService.selectById(resultVO.getBddId());
|
||||
if(ObjectUtils.isNotEmpty(bdd)){
|
||||
resultVO.setBddMc(bdd.getBddMc());
|
||||
}
|
||||
}
|
||||
|
||||
//计算进度
|
||||
resultVO.setBddProgress(MathUtils.percentage(entity.getXlsjDkcs(), entity.getXlghDkcs()));
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
}
|
@ -2,10 +2,16 @@ package com.mosty.yjzl.service.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.mosty.base.model.dto.yjzl.TbZdxlFgdwUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdw;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdw;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgdwQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
|
||||
import com.mosty.base.utils.PageUtils;
|
||||
import com.mosty.base.utils.QueryWrapperUtils;
|
||||
import com.mosty.yjzl.mapper.TbZdxlFgdwMapper;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwService;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -14,9 +20,8 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -30,7 +35,7 @@ import java.util.stream.Collectors;
|
||||
public class TbZdxlFgdwServiceImpl extends ServiceImpl<TbZdxlFgdwMapper, TbZdxlFgdw> implements TbZdxlFgdwService {
|
||||
|
||||
@Override
|
||||
public TbZdxlFgdwVO selectById(Integer id) {
|
||||
public TbZdxlFgdwVO selectById(Long id) {
|
||||
if(ObjectUtils.isEmpty(id)){
|
||||
return null;
|
||||
}
|
||||
@ -49,96 +54,52 @@ public class TbZdxlFgdwServiceImpl extends ServiceImpl<TbZdxlFgdwMapper, TbZdxlF
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveListByGenerate(List<TbZdxlFgdw> saveList, String firstMc) {
|
||||
if(CollectionUtils.isEmpty(saveList)){
|
||||
return -1;
|
||||
public IPage<TbZdxlFgdwVO> selectPage(TbZdxlFgdwQuery query) {
|
||||
IPage<TbZdxlFgdw> page = PageUtils.buildPage(query.getPageSize(), query.getPageCurrent());
|
||||
QueryWrapper<TbZdxlFgdw> qw = new QueryWrapper<>();
|
||||
|
||||
//组装查询参数
|
||||
this.buildListSelectQueryWrapper(qw, query);
|
||||
|
||||
//返回Page
|
||||
IPage<TbZdxlFgdwVO> resultPage = new Page<>(query.getPageCurrent(), query.getPageSize());
|
||||
|
||||
//查询数据
|
||||
page = this.baseMapper.selectPage(page, qw);
|
||||
List<TbZdxlFgdw> list = page.getRecords();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
//获取基准方格,baseLeftTopDw表示最左侧一列从上向下第一个方格,baseTopLeftDw表示最上一行从左向右第一个方格
|
||||
TbZdxlFgdw baseLeftTopDw = new TbZdxlFgdw(), baseTopLeftDw = new TbZdxlFgdw();
|
||||
for(TbZdxlFgdw dw : saveList){
|
||||
//x11取最小值,y11取最大值
|
||||
if(ObjectUtils.isEmpty(baseLeftTopDw.getX11()) && ObjectUtils.isEmpty(baseLeftTopDw.getY11())){
|
||||
baseLeftTopDw = dw;
|
||||
} else if (dw.getX11().compareTo(baseLeftTopDw.getX11()) < 0){
|
||||
baseLeftTopDw = dw;
|
||||
} else if (dw.getX11().compareTo(baseLeftTopDw.getX11()) == 0 && dw.getY11().compareTo(baseLeftTopDw.getY11()) >= 0){
|
||||
baseLeftTopDw = dw;
|
||||
}
|
||||
//转为VO
|
||||
List<TbZdxlFgdwVO> resultList = this.buildAllInfoListByEntityList(list);
|
||||
|
||||
//y21取最大值,x21取最小值
|
||||
if(ObjectUtils.isEmpty(baseTopLeftDw.getX21()) && ObjectUtils.isEmpty(baseTopLeftDw.getY21())){
|
||||
baseTopLeftDw = dw;
|
||||
}else if (dw.getY21().compareTo(baseTopLeftDw.getY21()) > 0){
|
||||
baseTopLeftDw = dw;
|
||||
}else if (dw.getY21().compareTo(baseTopLeftDw.getY21()) == 0 && dw.getX21().compareTo(baseTopLeftDw.getX21()) <= 0){
|
||||
baseTopLeftDw = dw;
|
||||
}
|
||||
//组装VO
|
||||
resultPage.setRecords(resultList);
|
||||
resultPage.setTotal(page.getTotal());
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgdwVO> selectList(TbZdxlFgdwQuery query) {
|
||||
QueryWrapper<TbZdxlFgdw> qw = new QueryWrapper<>();
|
||||
|
||||
//组装查询参数
|
||||
this.buildListSelectQueryWrapper(qw, query);
|
||||
|
||||
//查询数据
|
||||
List<TbZdxlFgdw> list = this.baseMapper.selectList(qw);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return null;
|
||||
}
|
||||
|
||||
//按列循环,赋值中间名,从基准方格中,取x11的值为开始
|
||||
Map<String, TbZdxlFgdw> entityMap = new HashMap<>();
|
||||
BigDecimal baseLeftTopDwX11 = baseLeftTopDw.getX11();
|
||||
char letter = 'A';
|
||||
while (baseLeftTopDwX11 != null) {
|
||||
BigDecimal finalBaseLeftTopDwX11 = baseLeftTopDwX11;
|
||||
//查询x11相同的方格,按y11正序排列,开始取名
|
||||
List<TbZdxlFgdw> dwList = saveList.stream()
|
||||
.filter(entity -> entity.getX11().compareTo(finalBaseLeftTopDwX11) == 0)
|
||||
.sorted(Comparator.comparing(TbZdxlFgdw::getY11))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(dwList)){
|
||||
//如果查询出来的列表不为空,则需要将列表中的x21赋值给baseLeftTopDwX11,以进行下次循环
|
||||
baseLeftTopDwX11 = dwList.get(0).getX21();
|
||||
//同一列的名称,中间名相同
|
||||
for(TbZdxlFgdw entity : dwList){
|
||||
entity.setMc1(firstMc + "-" + letter);
|
||||
entityMap.put("" + entity.getX11() + entity.getY11(), entity);
|
||||
}
|
||||
letter++;
|
||||
if(letter > 'Z'){
|
||||
letter = 'A';
|
||||
}
|
||||
}else{
|
||||
baseLeftTopDwX11 = null;
|
||||
}
|
||||
}
|
||||
|
||||
//按行循环,赋值尾名,从基准方格中,取y21的值为开始
|
||||
BigDecimal baseTopLeftDwY21 = baseTopLeftDw.getY21();
|
||||
int i = 1;
|
||||
while (baseTopLeftDwY21 != null) {
|
||||
BigDecimal finalBaseTopLeftDwY21 = baseTopLeftDwY21;
|
||||
//查询y21相同的方格,按x21正序排列,开始取名
|
||||
List<TbZdxlFgdw> dwList = saveList.stream()
|
||||
.filter(entity -> entity.getY21().compareTo(finalBaseTopLeftDwY21) == 0)
|
||||
.sorted(Comparator.comparing(TbZdxlFgdw::getX21))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(dwList)){
|
||||
//如果查询出来的列表不为空,则需要将列表中的y11赋值给baseTopLeftDwY21,以进行下次循环
|
||||
baseTopLeftDwY21 = dwList.get(0).getY11();
|
||||
//同一行的名称,尾名相同
|
||||
for(TbZdxlFgdw entity : dwList){
|
||||
TbZdxlFgdw mcEntity = entityMap.get("" + entity.getX11() + entity.getY11());
|
||||
mcEntity.setMc1(entity.getMc1() + "-" + i);
|
||||
entityMap.put("" + entity.getX11() + entity.getY11(), mcEntity);
|
||||
}
|
||||
i++;
|
||||
}else{
|
||||
baseTopLeftDwY21 = null;
|
||||
}
|
||||
}
|
||||
|
||||
boolean success = this.saveBatch(entityMap.values());
|
||||
if(success){
|
||||
return entityMap.values().size();
|
||||
}
|
||||
return 0;
|
||||
//转为VO返回
|
||||
return this.buildAllInfoListByEntityList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer updateEntity(TbZdxlFgdwUpdateDTO dto) {
|
||||
public Long updateEntity(TbZdxlFgdwUpdateDTO dto) {
|
||||
//复制参数至实体
|
||||
TbZdxlFgdw entity = BeanUtil.copyProperties(dto, TbZdxlFgdw.class);
|
||||
entity.setMc1(dto.getMc());
|
||||
@ -152,6 +113,22 @@ public class TbZdxlFgdwServiceImpl extends ServiceImpl<TbZdxlFgdwMapper, TbZdxlF
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装查询参数
|
||||
* @param qw QueryWrapper
|
||||
* @param query 查询对象
|
||||
*/
|
||||
private void buildListSelectQueryWrapper(QueryWrapper<TbZdxlFgdw> qw, TbZdxlFgdwQuery query){
|
||||
//组装其他排序方式
|
||||
QueryWrapperUtils.buildQueryWrapperOrder(qw, query.getSort(), query.getOrder());
|
||||
//未注销数据
|
||||
qw.eq("xt_sjzt", "1").eq("xt_scbz", "0");
|
||||
|
||||
//方格点位ID
|
||||
qw.like(ObjectUtils.isNotEmpty(query.getMc()), TbZdxlFgdw.MC, query.getMc());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装全量信息列表(根据实体列表)
|
||||
* @param entityList 实体列表
|
||||
|
@ -0,0 +1,58 @@
|
||||
package com.mosty.yjzl.service.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgmrpzUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgmrpz;
|
||||
import com.mosty.yjzl.mapper.TbZdxlFgmrpzMapper;
|
||||
import com.mosty.yjzl.service.TbZdxlFgmrpzService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格默认配置表Service实现类
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/05 19:02
|
||||
* @since 2025/09/05 19:02
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbZdxlFgmrpzServiceImpl extends ServiceImpl<TbZdxlFgmrpzMapper, TbZdxlFgmrpz> implements TbZdxlFgmrpzService {
|
||||
|
||||
@Override
|
||||
public TbZdxlFgmrpz selectDefault() {
|
||||
return this.baseMapper.selectOne(new QueryWrapper<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateEntity(TbZdxlFgmrpzUpdateDTO dto) {
|
||||
//复制参数至实体
|
||||
TbZdxlFgmrpz entity = BeanUtil.copyProperties(dto, TbZdxlFgmrpz.class);
|
||||
|
||||
//如果参数为空,则设置默认值为0
|
||||
if(ObjectUtils.isEmpty(entity.getPcCl())){
|
||||
entity.setPcCl(0);
|
||||
}
|
||||
if(ObjectUtils.isEmpty(entity.getPcRy())){
|
||||
entity.setPcRy(0);
|
||||
}
|
||||
if(ObjectUtils.isEmpty(entity.getXlSc())){
|
||||
entity.setXlSc(0.0);
|
||||
}
|
||||
if(ObjectUtils.isEmpty(entity.getXlLc())){
|
||||
entity.setXlLc(0.0);
|
||||
}
|
||||
|
||||
//修改实体
|
||||
int resultInt = this.baseMapper.updateById(entity);
|
||||
if(resultInt > 0){
|
||||
//返回主键
|
||||
return entity.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -5,16 +5,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.mosty.base.feign.remote.MostyQwzxFeignServiceRemote;
|
||||
import com.mosty.base.model.dto.qwzx.TbQwXfbbVo;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgxlrwUpdateDTO;
|
||||
import com.mosty.base.model.entity.qwzx.TbQwXfbb;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdw;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgmrpz;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgxlrw;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgxlrwQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddxlrwVO;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgxlrwVO;
|
||||
import com.mosty.base.utils.Constant;
|
||||
import com.mosty.base.utils.MathUtils;
|
||||
import com.mosty.base.utils.PageUtils;
|
||||
import com.mosty.base.utils.QueryWrapperUtils;
|
||||
import com.mosty.common.base.util.StringUtils;
|
||||
import com.mosty.yjzl.mapper.TbZdxlFgxlrwMapper;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgmrpzService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgxlrwService;
|
||||
import com.mosty.yjzl.utils.TbZdxlFgxlrwUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -24,8 +33,10 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -43,6 +54,16 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
*/
|
||||
private final TbZdxlFgdwService tbZdxlFgdwService;
|
||||
|
||||
/**
|
||||
* 指导巡逻方格默认配置表Service
|
||||
*/
|
||||
private final TbZdxlFgmrpzService tbZdxlFgmrpzService;
|
||||
|
||||
/**
|
||||
* 指导巡逻方格点位必到点巡逻任务表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddxlrwService tbZdxlFgdwBddxlrwService;
|
||||
|
||||
@Override
|
||||
public TbZdxlFgxlrw selectById(String id) {
|
||||
if(StringUtils.isBlank(id)){
|
||||
@ -82,6 +103,43 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TbZdxlFgxlrwVO> selectRwPage(TbZdxlFgxlrwQuery query) {
|
||||
IPage<TbZdxlFgxlrw> page = PageUtils.buildPage(query.getPageSize(), query.getPageCurrent());
|
||||
QueryWrapper<TbZdxlFgxlrw> qw = new QueryWrapper<>();
|
||||
|
||||
//组装查询参数
|
||||
this.buildListSelectQueryWrapper(qw, query);
|
||||
|
||||
//组装本人所在巡组需要打卡或者没有指定巡组的任务
|
||||
qw.and(qw1 -> {
|
||||
TbQwXfbb xfbb = MostyQwzxFeignServiceRemote.getMyXfbbTodayNew(null);
|
||||
if(ObjectUtils.isNotEmpty(xfbb)){
|
||||
qw1.eq(TbZdxlFgxlrw.XFBB_ID_FIELD, xfbb.getId()).or();
|
||||
}
|
||||
//组装其他需要打卡的任务
|
||||
qw1.isNull(TbZdxlFgxlrw.XFBB_ID_FIELD);
|
||||
});
|
||||
|
||||
//返回Page
|
||||
IPage<TbZdxlFgxlrwVO> resultPage = new Page<>(query.getPageCurrent(), query.getPageSize());
|
||||
|
||||
//查询数据
|
||||
page = this.baseMapper.selectPage(page, qw);
|
||||
List<TbZdxlFgxlrw> list = page.getRecords();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
//转为VO
|
||||
List<TbZdxlFgxlrwVO> resultList = this.buildAllInfoListByEntityList(list);
|
||||
|
||||
//组装VO
|
||||
resultPage.setRecords(resultList);
|
||||
resultPage.setTotal(page.getTotal());
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgxlrwVO> selectList(TbZdxlFgxlrwQuery query) {
|
||||
QueryWrapper<TbZdxlFgxlrw> qw = new QueryWrapper<>();
|
||||
@ -99,6 +157,19 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
return this.buildAllInfoListByEntityList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgxlrw> selectListByIds(String ids) {
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.baseMapper.selectList(new QueryWrapper<TbZdxlFgxlrw>()
|
||||
.in(TbZdxlFgxlrw.ID_FIELD, Arrays.asList(ids.split(Constant.SEPARATOR_ENGLISH_COMMA)))
|
||||
.eq("xt_sjzt", "1")
|
||||
.eq("xt_scbz", "0")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgxlrw> selectListByRwRq(Date rwRq) {
|
||||
if (ObjectUtils.isEmpty(rwRq)) {
|
||||
@ -112,6 +183,7 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String updateEntity(TbZdxlFgxlrwUpdateDTO dto) {
|
||||
//复制参数至实体
|
||||
TbZdxlFgxlrw entity = BeanUtil.copyProperties(dto, TbZdxlFgxlrw.class);
|
||||
@ -119,6 +191,8 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
//修改实体
|
||||
int resultInt = this.baseMapper.updateById(entity);
|
||||
if(resultInt > 0){
|
||||
//保存必到点信息
|
||||
tbZdxlFgdwBddxlrwService.handleList(dto.getBddList());
|
||||
//返回主键
|
||||
return entity.getId();
|
||||
}
|
||||
@ -157,11 +231,27 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
return -1;
|
||||
}
|
||||
|
||||
//查询默认配置
|
||||
TbZdxlFgmrpz mrpz = tbZdxlFgmrpzService.selectDefault();
|
||||
if(ObjectUtils.isEmpty(mrpz)){
|
||||
mrpz = new TbZdxlFgmrpz();
|
||||
mrpz.setPcCl(0);
|
||||
mrpz.setPcRy(0);
|
||||
mrpz.setXlSc(0.0);
|
||||
mrpz.setXlLc(0.0);
|
||||
}
|
||||
|
||||
//筛选保存和修改列表
|
||||
List<TbZdxlFgxlrw> saveList = new ArrayList<>(), updateList = new ArrayList<>();
|
||||
for(TbZdxlFgxlrw entity : entityList){
|
||||
TbZdxlFgxlrw baseEntity = this.selectById(entity.getId());
|
||||
|
||||
if(ObjectUtils.isEmpty(baseEntity)){
|
||||
//设置默认值
|
||||
entity.setXlghSc(mrpz.getXlSc());
|
||||
entity.setXlghXllc(mrpz.getXlLc());
|
||||
entity.setXlghPcCl(mrpz.getPcCl());
|
||||
entity.setXlghPcRy(mrpz.getPcRy());
|
||||
//保存
|
||||
saveList.add(entity);
|
||||
}else{
|
||||
@ -191,6 +281,31 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
return resultInt;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int issueList(List<TbZdxlFgxlrw> entityList) {
|
||||
if(CollectionUtils.isEmpty(entityList)){
|
||||
return -1;
|
||||
}
|
||||
|
||||
List<TbZdxlFgxlrw> updateList = new ArrayList<>();
|
||||
for(TbZdxlFgxlrw entity : entityList){
|
||||
TbZdxlFgxlrw updateEntity = new TbZdxlFgxlrw();
|
||||
updateEntity.setId(entity.getId());
|
||||
updateEntity.setRwZt(TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_YXF);
|
||||
updateList.add(updateEntity);
|
||||
}
|
||||
|
||||
boolean success = this.updateBatchById(updateList);
|
||||
if(success){
|
||||
//再保存一次打卡点信息
|
||||
tbZdxlFgdwBddxlrwService.handleListByFgxlrwList(entityList);
|
||||
//返回
|
||||
return updateList.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装查询参数
|
||||
* @param qw QueryWrapper
|
||||
@ -208,6 +323,13 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
qw.eq("xt_sjzt", "1").eq("xt_scbz", "0");
|
||||
//方格ID
|
||||
qw.eq(ObjectUtils.isNotEmpty(query.getFgId()), TbZdxlFgxlrw.FG_ID_FIELD, query.getFgId());
|
||||
//方格名称
|
||||
qw.inSql(StringUtils.isNotBlank(query.getFgMc()), TbZdxlFgxlrw.FG_ID_FIELD, "select id from tb_zdxl_fgdw where mc1 like '%" + query.getFgMc() + "%' ");
|
||||
|
||||
//方格预警等级
|
||||
if(StringUtils.isNotBlank(query.getFgYjdj())){
|
||||
qw.in(TbZdxlFgxlrw.FG_YJDJ_FIELD, Arrays.stream(query.getFgYjdj().split(",")).filter(org.apache.commons.lang3.StringUtils::isNotBlank).collect(Collectors.toList()));
|
||||
}
|
||||
//任务日期
|
||||
qw.eq(ObjectUtils.isNotEmpty(query.getRwRq()), TbZdxlFgxlrw.RW_RQ_FIELD, query.getRwRq());
|
||||
}
|
||||
@ -239,11 +361,11 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
private TbZdxlFgxlrwVO buildAllInfoByEntity(TbZdxlFgxlrw entity){
|
||||
TbZdxlFgxlrwVO resultVO = BeanUtil.copyProperties(entity, TbZdxlFgxlrwVO.class);
|
||||
|
||||
//组装方格数据
|
||||
if(ObjectUtils.isNotEmpty(resultVO.getFgId())){
|
||||
//组装方格数据
|
||||
TbZdxlFgdw fg = tbZdxlFgdwService.selectById(resultVO.getFgId());
|
||||
if(ObjectUtils.isNotEmpty(fg)){
|
||||
resultVO.setMc(fg.getMc1());
|
||||
resultVO.setFgMc(fg.getMc1());
|
||||
resultVO.setX1(fg.getX11());
|
||||
resultVO.setY1(fg.getY11());
|
||||
resultVO.setX2(fg.getX21());
|
||||
@ -251,6 +373,30 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
resultVO.setZxX(fg.getZxX());
|
||||
resultVO.setZxY(fg.getZxY());
|
||||
}
|
||||
|
||||
//组装必到点信息
|
||||
List<TbZdxlFgdwBddxlrwVO> bddList;
|
||||
if(TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_CJ.equals(resultVO.getRwZt()) || TbZdxlFgxlrwUtils.DICT_ITEM_D_ZDXL_FGXLRW_RWZT_YDC.equals(resultVO.getRwZt())){
|
||||
//未下发查询实时必到点
|
||||
bddList = tbZdxlFgdwBddxlrwService.selectVoListByFgxlrwId(resultVO.getId());
|
||||
}else{
|
||||
//已下发查询固定必到点
|
||||
bddList = tbZdxlFgdwBddxlrwService.selectVoListByYxfFgxlrwId(resultVO.getId());
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(bddList)){
|
||||
int totalGhCs = bddList.stream().mapToInt(TbZdxlFgdwBddxlrwVO::getXlghDkcs).sum();
|
||||
int totalSjCs = bddList.stream().mapToInt(TbZdxlFgdwBddxlrwVO::getXlsjDkcs).sum();
|
||||
resultVO.setBddAllProgress(MathUtils.percentage(totalSjCs, totalGhCs));
|
||||
resultVO.setBddList(bddList);
|
||||
}
|
||||
}
|
||||
|
||||
//组装巡防报备信息
|
||||
if(StringUtils.isNotBlank(resultVO.getXfbbId())){
|
||||
TbQwXfbbVo xfbb = MostyQwzxFeignServiceRemote.getXfbbInfo(resultVO.getXfbbId());
|
||||
if(ObjectUtils.isNotEmpty(xfbb)){
|
||||
resultVO.setXfbb(xfbb);
|
||||
}
|
||||
}
|
||||
|
||||
return resultVO;
|
||||
|
@ -0,0 +1,84 @@
|
||||
package com.mosty.yjzl.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddSaveDTO;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBdd;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgdwBddQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点表Service
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 12:01
|
||||
* @since 2025/09/06 12:01
|
||||
*/
|
||||
public interface TbZdxlFgdwBddService {
|
||||
|
||||
/**
|
||||
* 查询单条(根据主键ID)
|
||||
* @param id 主键ID
|
||||
* @return 实体信息
|
||||
*/
|
||||
TbZdxlFgdwBdd selectById(String id);
|
||||
|
||||
/**
|
||||
* 查询分页
|
||||
* @param query 实体查询对象
|
||||
* @return 实体信息分页列表
|
||||
*/
|
||||
IPage<TbZdxlFgdwBddVO> selectPage(TbZdxlFgdwBddQuery query);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
* @return 实体信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBddVO> selectList(TbZdxlFgdwBddQuery query);
|
||||
|
||||
/**
|
||||
* 查询列表(根据ID列表)
|
||||
* @param idList ID列表
|
||||
* @return 实体信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBdd> selectListByIdList(List<String> idList);
|
||||
|
||||
/**
|
||||
* 查询列表(根据方格点位ID)
|
||||
* @param fgdwId 方格点位ID
|
||||
* @return 实体信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBdd> selectListByFgdwId(Long fgdwId);
|
||||
|
||||
/**
|
||||
* 查询列表(根据方格巡逻任务ID)
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 实体信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBdd> selectListByFgxlrwId(String fgxlrwId);
|
||||
|
||||
/**
|
||||
* 保存单条
|
||||
* @param dto 保存DTO对象
|
||||
* @return 实体主键ID
|
||||
*/
|
||||
String saveEntity(TbZdxlFgdwBddSaveDTO dto);
|
||||
|
||||
/**
|
||||
* 修改单条
|
||||
* @param dto 修改DTO对象
|
||||
* @return 实体主键ID
|
||||
*/
|
||||
String updateEntity(TbZdxlFgdwBddUpdateDTO dto);
|
||||
|
||||
/**
|
||||
* 注销单条
|
||||
* @param entity 实体信息
|
||||
* @return 注销条数
|
||||
*/
|
||||
int cancelEntity(TbZdxlFgdwBdd entity);
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.mosty.yjzl.service;
|
||||
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwJlClockInDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务记录表Service
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/07 19:56
|
||||
* @since 2025/09/07 19:56
|
||||
*/
|
||||
public interface TbZdxlFgdwBddxlrwJlService {
|
||||
|
||||
/**
|
||||
* 查询单条(根据主键ID)
|
||||
* @param id 主键ID
|
||||
* @return 实体信息
|
||||
*/
|
||||
TbZdxlFgdwBddxlrwJl selectById(String id);
|
||||
|
||||
/**
|
||||
* 查询单条(根据必到点巡逻任务ID和顺序)
|
||||
* @param bddxlrwId 必到点巡逻任务ID
|
||||
* @param dkSx 顺序
|
||||
* @return 实体信息
|
||||
*/
|
||||
TbZdxlFgdwBddxlrwJl selectByBddxlrwIdAndDkSx(String bddxlrwId, int dkSx);
|
||||
|
||||
/**
|
||||
* 查询列表(根据必到点巡逻任务ID)
|
||||
* @param bddxlrwId 必到点巡逻任务ID
|
||||
* @return 实体列表
|
||||
*/
|
||||
List<TbZdxlFgdwBddxlrwJl> selectListByBddxlrwId(String bddxlrwId);
|
||||
|
||||
/**
|
||||
* 创建列表(根据方格巡逻任务ID)
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 操作条数
|
||||
*/
|
||||
int createListByFgxlrwId(String fgxlrwId);
|
||||
|
||||
/**
|
||||
* 打卡
|
||||
* @param baseEntity 实体信息
|
||||
* @param dto 打卡DTO对象
|
||||
* @param user 当前登录人员信息
|
||||
* @param dksj 打卡时间
|
||||
* @return 主键ID
|
||||
*/
|
||||
String clockIn(TbZdxlFgdwBddxlrwJl baseEntity, TbZdxlFgdwBddxlrwJlClockInDTO dto, UserInfo user, Date dksj);
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.mosty.yjzl.service;
|
||||
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwHandleDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrw;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgxlrw;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddxlrwVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格点位必到点巡逻任务表Service
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/06 19:43
|
||||
* @since 2025/09/06 19:43
|
||||
*/
|
||||
public interface TbZdxlFgdwBddxlrwService {
|
||||
|
||||
/**
|
||||
* 查询单条(根据主键ID)
|
||||
* @param id 主键ID
|
||||
* @return 实体信息
|
||||
*/
|
||||
TbZdxlFgdwBddxlrw selectById(String id);
|
||||
|
||||
/**
|
||||
* 查询列表(根据方格巡逻任务ID)
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 实体信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBddxlrw> selectListByFgxlrwId(String fgxlrwId);
|
||||
|
||||
/**
|
||||
* 查询返回信息列表(根据方格巡逻任务ID)
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 返回信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBddxlrwVO> selectVoListByYxfFgxlrwId(String fgxlrwId);
|
||||
|
||||
/**
|
||||
* 查询返回信息列表(根据方格巡逻任务ID)
|
||||
* @param fgxlrwId 方格巡逻任务ID
|
||||
* @return 返回信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwBddxlrwVO> selectVoListByFgxlrwId(String fgxlrwId);
|
||||
|
||||
/**
|
||||
* 保存列表
|
||||
* @param handleList 操作列表
|
||||
* @return 操作条数
|
||||
*/
|
||||
int handleList(List<TbZdxlFgdwBddxlrwHandleDTO> handleList);
|
||||
|
||||
/**
|
||||
* 保存列表(根据方格巡逻任务列表)
|
||||
* @param fgxlrwList 方格巡逻任务列表
|
||||
* @return 操作条数
|
||||
*/
|
||||
int handleListByFgxlrwList(List<TbZdxlFgxlrw> fgxlrwList);
|
||||
|
||||
/**
|
||||
* 打卡(根据打卡记录)
|
||||
* @param jl 打卡记录
|
||||
* @param start 是否是开始打卡
|
||||
* @return 主键ID
|
||||
*/
|
||||
String clockInByJl(TbZdxlFgdwBddxlrwJl jl, boolean start);
|
||||
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
package com.mosty.yjzl.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdw;
|
||||
import com.mosty.base.model.query.yjzl.TbZdxlFgdwQuery;
|
||||
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +21,7 @@ public interface TbZdxlFgdwService {
|
||||
* @param id 主键ID
|
||||
* @return 实体信息
|
||||
*/
|
||||
TbZdxlFgdwVO selectById(Integer id);
|
||||
TbZdxlFgdwVO selectById(Long id);
|
||||
|
||||
/**
|
||||
* 查询全量列表
|
||||
@ -29,17 +30,24 @@ public interface TbZdxlFgdwService {
|
||||
List<TbZdxlFgdwVO> selectAllList();
|
||||
|
||||
/**
|
||||
* 保存列表(根据生成数据)
|
||||
* @param saveList 生成数据列表
|
||||
* @return 保存数量
|
||||
* 查询分页
|
||||
* @param query 实体查询对象
|
||||
* @return 实体信息分页列表
|
||||
*/
|
||||
int saveListByGenerate(List<TbZdxlFgdw> saveList, String firstMc);
|
||||
IPage<TbZdxlFgdwVO> selectPage(TbZdxlFgdwQuery query);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
* @return 实体信息列表
|
||||
*/
|
||||
List<TbZdxlFgdwVO> selectList(TbZdxlFgdwQuery query);
|
||||
|
||||
/**
|
||||
* 修改单条
|
||||
* @param dto 修改DTO对象
|
||||
* @return 实体主键ID
|
||||
*/
|
||||
Integer updateEntity(TbZdxlFgdwUpdateDTO dto);
|
||||
Long updateEntity(TbZdxlFgdwUpdateDTO dto);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.mosty.yjzl.service;
|
||||
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwUpdateDTO;
|
||||
import com.mosty.base.model.dto.yjzl.TbZdxlFgmrpzUpdateDTO;
|
||||
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgmrpz;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
* @description 指导巡逻方格默认配置表Service
|
||||
* @modifier zhangzhao
|
||||
* @modifiedTime 2025/09/05 19:00
|
||||
* @since 2025/09/05 19:00
|
||||
*/
|
||||
public interface TbZdxlFgmrpzService {
|
||||
|
||||
/**
|
||||
* 查询单条(默认数据)
|
||||
* @return 实体信息
|
||||
*/
|
||||
TbZdxlFgmrpz selectDefault();
|
||||
|
||||
/**
|
||||
* 修改单条
|
||||
* @param dto 修改DTO对象
|
||||
* @return 实体主键ID
|
||||
*/
|
||||
String updateEntity(TbZdxlFgmrpzUpdateDTO dto);
|
||||
|
||||
}
|
@ -32,6 +32,13 @@ public interface TbZdxlFgxlrwService {
|
||||
*/
|
||||
IPage<TbZdxlFgxlrwVO> selectPage(TbZdxlFgxlrwQuery query);
|
||||
|
||||
/**
|
||||
* 查询分页(需要执行的任务)
|
||||
* @param query 实体查询对象
|
||||
* @return 实体返回信息分页列表
|
||||
*/
|
||||
IPage<TbZdxlFgxlrwVO> selectRwPage(TbZdxlFgxlrwQuery query);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
@ -39,6 +46,13 @@ public interface TbZdxlFgxlrwService {
|
||||
*/
|
||||
List<TbZdxlFgxlrwVO> selectList(TbZdxlFgxlrwQuery query);
|
||||
|
||||
/**
|
||||
* 查询列表(根据主键ID字符串)
|
||||
* @param ids 主键ID字符串
|
||||
* @return 实体返回信息列表
|
||||
*/
|
||||
List<TbZdxlFgxlrw> selectListByIds(String ids);
|
||||
|
||||
/**
|
||||
* 查询列表(根据任务日期)
|
||||
* @param rwRq 任务日期
|
||||
@ -67,4 +81,11 @@ public interface TbZdxlFgxlrwService {
|
||||
*/
|
||||
int importListByMb(List<TbZdxlFgxlrw> entityList);
|
||||
|
||||
/**
|
||||
* 下发列表
|
||||
* @param entityList 需下发的列表
|
||||
* @return 操作条数
|
||||
*/
|
||||
int issueList(List<TbZdxlFgxlrw> entityList);
|
||||
|
||||
}
|
||||
|
@ -109,6 +109,11 @@ public class TbZdxlFgxlrwUtils {
|
||||
*/
|
||||
public final static String DICT_ITEM_D_ZDXL_FGXLRW_RWZT_YDC = "02";
|
||||
|
||||
/**
|
||||
* 字典项-指导巡逻方格巡逻任务状态-已下发
|
||||
*/
|
||||
public final static String DICT_ITEM_D_ZDXL_FGXLRW_RWZT_YXF = "03";
|
||||
|
||||
/**
|
||||
* 系统配置配置键-方格巡逻任务警情配置-报警细类
|
||||
*/
|
||||
|
@ -42,6 +42,9 @@ spring:
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 50
|
||||
messages:
|
||||
basename: i18n/messages
|
||||
encoding: utf-8
|
||||
|
||||
swagger:
|
||||
host: 80.155.0.84
|
||||
|
Reference in New Issue
Block a user