打卡位置

This commit is contained in:
2025-11-12 10:48:44 +08:00
parent 878615344d
commit 7e21e1ab02
15 changed files with 105 additions and 17 deletions

View File

@ -1,5 +1,6 @@
package com.mosty.base.model.dto.yjzl; package com.mosty.base.model.dto.yjzl;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -74,4 +75,8 @@ public class TbZdxlFgdwBddUpdateDTO {
@NotNull(message = "zdxl.fgdwBdd.wd.notNull") @NotNull(message = "zdxl.fgdwBdd.wd.notNull")
private BigDecimal wd; private BigDecimal wd;
@ApiModelProperty(value = "打卡间隔时间")
@TableField(value = "dkjgsj")
private Integer dkjgsj;
} }

View File

@ -66,6 +66,10 @@ public class TbZdxlFgdwBdd extends BaseEntity implements Serializable, Cloneable
@TableField(value = "bdd_sm") @TableField(value = "bdd_sm")
private String bddSm; private String bddSm;
@ApiModelProperty(value = "打卡间隔时间")
@TableField(value = "dkjgsj")
private Integer dkjgsj;
/** /**
* 经度 * 经度
*/ */

View File

@ -129,6 +129,10 @@ public class TbZdxlFgdwBddxlrwJl extends BaseEntity implements Serializable, Clo
@TableField(value = "dkr_id") @TableField(value = "dkr_id")
private Long dkrId; private Long dkrId;
@ApiModelProperty(value = "打卡人ID")
@TableField(value = "sfzh")
private String sfzh;
/** /**
* 所属部门id * 所属部门id
*/ */

View File

@ -24,6 +24,10 @@ import java.util.Date;
@ApiModel(value = "TbZdxlFgxlrwQuery对象", description = "指导巡逻方格巡逻任务查询对象") @ApiModel(value = "TbZdxlFgxlrwQuery对象", description = "指导巡逻方格巡逻任务查询对象")
public class TbZdxlFgxlrwQuery extends BasePage { public class TbZdxlFgxlrwQuery extends BasePage {
@ApiModelProperty(value = "方格ID")
private String bbdId;
/** /**
* 方格ID * 方格ID
*/ */

View File

@ -26,6 +26,9 @@ public class TbZdxlFgdwBddxlrwVO extends TbZdxlFgdwBddxlrw {
@ApiModelProperty(value = "必到点名称") @ApiModelProperty(value = "必到点名称")
private String bddMc; private String bddMc;
@ApiModelProperty(value = "打卡间隔时间(分钟)")
private Integer dkjgsj;
/** /**
* 必到点进度 * 必到点进度
*/ */

View File

@ -50,6 +50,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -1352,7 +1353,11 @@ public class TbQwXfbbServiceImpl extends ServiceImpl<TbQwXfbbMapper, TbQwXfbb> i
// xfbb.setLx(user1.getType()); // xfbb.setLx(user1.getType());
// } // }
WebSocketObject obj = new WebSocketObject("04", xfbb, null); WebSocketObject obj = new WebSocketObject("04", xfbb, null);
try{
this.tbWebSocketAdaptRemoteService.sendBbMessage(obj); this.tbWebSocketAdaptRemoteService.sendBbMessage(obj);
}catch (Exception e){
}
TbWzLswz wz = new TbWzLswz(); TbWzLswz wz = new TbWzLswz();
wz.setId(UUIDGenerator.getUUID()); wz.setId(UUIDGenerator.getUUID());
wz.setSjly("02"); wz.setSjly("02");
@ -1360,6 +1365,11 @@ public class TbQwXfbbServiceImpl extends ServiceImpl<TbQwXfbbMapper, TbQwXfbb> i
wz.setYwid(xfbb.getId()); wz.setYwid(xfbb.getId());
wz.setJd(BigDecimal.valueOf(dto.getJd())); wz.setJd(BigDecimal.valueOf(dto.getJd()));
wz.setWd(BigDecimal.valueOf(dto.getWd())); wz.setWd(BigDecimal.valueOf(dto.getWd()));
Timestamp csdtTime = new Timestamp(System.currentTimeMillis());
wz.setXtCjsj(csdtTime);
wz.setXtSjly("1");
wz.setXtSjzt("1");
wz.setXtScbz("0");
// wz.setZb(JtsUtils.getPoint(wz.getJd(), wz.getWd())); // wz.setZb(JtsUtils.getPoint(wz.getJd(), wz.getWd()));
this.baseMapper.insertTbWzSblswz(wz); this.baseMapper.insertTbWzSblswz(wz);
} }

View File

@ -533,7 +533,7 @@
</if> </if>
and a.xt_sjzt = '1' and a.xt_sjzt = '1'
and a.bbzt = '0' and a.bbzt = '0'
and a.bbjssj is null
and ( and (
a.fzr_sfzh = #{sfzh} or a.id in (select ywid a.fzr_sfzh = #{sfzh} or a.id in (select ywid
from tb_qw_jl b from tb_qw_jl b
@ -665,8 +665,8 @@
<insert id="insertTbWzSblswz"> <insert id="insertTbWzSblswz">
insert into mosty_wzzx.tb_wz_lswz insert into mosty_wzzx.tb_wz_lswz
(id,sjly,dwsj,ywid,jd,wd) (id,sjly,dwsj,ywid,jd,wd, xt_sjly, xt_sjzt, xt_scbz)
values (#{id},#{sjly},#{dwsj},#{ywid},#{jd},#{wd}) values (#{id},#{sjly},#{dwsj},#{ywid},#{jd},#{wd}, #{xtSjly}, #{xtSjzt}, #{xtScbz})
</insert> </insert>
<select id="getSumXfsc" resultType="java.util.Map"> <select id="getSumXfsc" resultType="java.util.Map">

View File

@ -1,6 +1,7 @@
package com.mosty.yjzl.controller; package com.mosty.yjzl.controller;
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwJlClockInDTO; import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwJlClockInDTO;
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBdd;
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrw; 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.TbZdxlFgdwBddxlrwJl;
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO; import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
@ -12,6 +13,7 @@ import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser; import com.mosty.common.token.JwtSysUser;
import com.mosty.common.token.UserInfo; import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager; import com.mosty.common.token.UserInfoManager;
import com.mosty.yjzl.service.TbZdxlFgdwBddService;
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService; import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService; import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
import com.mosty.yjzl.service.TbZdxlFgdwService; import com.mosty.yjzl.service.TbZdxlFgdwService;
@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* @author zhangzhao * @author zhangzhao
@ -56,6 +59,8 @@ public class TbZdxlFgdwBddxlrwJlController {
*/ */
private final TbZdxlFgdwService tbZdxlFgdwService; private final TbZdxlFgdwService tbZdxlFgdwService;
private final TbZdxlFgdwBddService tbZdxlFgdwBddService;
/** /**
* 查询列表根据必到点巡逻任务ID * 查询列表根据必到点巡逻任务ID
* @param bddxlrwId 必到点巡逻任务ID * @param bddxlrwId 必到点巡逻任务ID
@ -142,9 +147,14 @@ public class TbZdxlFgdwBddxlrwJlController {
if(!baseEntity.getDkrXm().equals(user.getUserName())){ if(!baseEntity.getDkrXm().equals(user.getUserName())){
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "您不是此记录的打卡人,不能进行打卡"); return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "您不是此记录的打卡人,不能进行打卡");
} }
TbZdxlFgdwBdd tbZdxlFgdwBdd = this.tbZdxlFgdwBddService.selectById(bddxlrw.getBddId());
Integer jgsj = 10;
if(Objects.nonNull(tbZdxlFgdwBdd)){
jgsj = tbZdxlFgdwBdd.getDkjgsj();
}
//是否待满10分钟 //是否待满10分钟
if(dksj.getTime()-baseEntity.getDkKsSj().getTime() < TbZdxlFgxlrwUtils.CLOCK_IN_INTERVAL_TIME){ if(dksj.getTime()-baseEntity.getDkKsSj().getTime() < jgsj){
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "请在开始10分后,再打卡结束"); return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "请在开始"+jgsj+"分后,再打卡结束");
} }
} }
@ -160,5 +170,12 @@ public class TbZdxlFgdwBddxlrwJlController {
} }
} }
@ApiOperation(value = "警组打卡记录")
@GetMapping("/getRwjlByXfbbId")
@JwtSysUser
@Log(title = "警组打卡记录", businessType = BusinessType.OTHER)
public ResponseResult<List<TbZdxlFgdwBddxlrwJl>> getRwjlByXfbbId(String xfbbId) {
return ResponseResult.success(tbZdxlFgdwBddxlrwJlService.getRwjlByXfbbId(xfbbId));
}
} }

View File

@ -75,6 +75,14 @@ public class TbZdxlFgxlrwController {
return ResponseResult.success(tbZdxlFgxlrwService.selectRwPage(query)); return ResponseResult.success(tbZdxlFgxlrwService.selectRwPage(query));
} }
@ApiOperation(value = "查询详情(需要执行的任务)")
@GetMapping("/selectByBBdId")
@JwtSysUser
@Log(title = "指导巡逻-方格巡逻任务接口-查询详情(需要执行的任务)", businessType = BusinessType.OTHER)
public ResponseResult<TbZdxlFgxlrwVO> selectByBBdId(TbZdxlFgxlrwQuery query) {
return ResponseResult.success(tbZdxlFgxlrwService.selectByBBdId(query));
}
/** /**
* 查询列表 * 查询列表
* @param query 实体查询对象 * @param query 实体查询对象

View File

@ -144,13 +144,14 @@ public class TbZdxlFgdwBddServiceImpl extends ServiceImpl<TbZdxlFgdwBddMapper, T
if(ObjectUtils.isEmpty(fgxlrwId)){ if(ObjectUtils.isEmpty(fgxlrwId)){
return null; return null;
} }
List<TbZdxlFgdwBdd> list = this.baseMapper.selectList(new QueryWrapper<TbZdxlFgdwBdd>()
//查询数据
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 + "'") .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_sjzt", "1")
.eq("xt_scbz", "0") .eq("xt_scbz", "0")
); );
//查询数据
return list;
} }
@Override @Override

View File

@ -1,13 +1,16 @@
package com.mosty.yjzl.service.Impl; package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.dto.qwzx.TbQwJlDto;
import com.mosty.base.model.dto.yjzl.TbZdxlFgdwBddxlrwJlClockInDTO; 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.TbZdxlFgdwBddxlrw;
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl; import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
import com.mosty.base.utils.UUIDGenerator; import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.token.UserInfo; import com.mosty.common.token.UserInfo;
import com.mosty.yjzl.mapper.TbZdxlFgdwBddxlrwJlMapper; import com.mosty.yjzl.mapper.TbZdxlFgdwBddxlrwJlMapper;
import com.mosty.yjzl.remote.TbQwzxAdaptRemoteService;
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService; import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService; import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -20,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author zhangzhao * @author zhangzhao
@ -36,6 +40,7 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
* 指导巡逻方格点位必到点巡逻任务表Service * 指导巡逻方格点位必到点巡逻任务表Service
*/ */
private final TbZdxlFgdwBddxlrwService tbZdxlFgdwBddxlrwService; private final TbZdxlFgdwBddxlrwService tbZdxlFgdwBddxlrwService;
private final TbQwzxAdaptRemoteService tbQwzxAdaptRemoteService;
@Override @Override
public TbZdxlFgdwBddxlrwJl selectById(String id) { public TbZdxlFgdwBddxlrwJl selectById(String id) {
@ -137,7 +142,7 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
baseEntity.setDkKsJd(dto.getDkJd()); baseEntity.setDkKsJd(dto.getDkJd());
baseEntity.setDkKsWd(dto.getDkWd()); baseEntity.setDkKsWd(dto.getDkWd());
baseEntity.setDkrXm(user.getUserName()); baseEntity.setDkrXm(user.getUserName());
baseEntity.setDkrId(user.getUserId()); baseEntity.setSfzh(user.getIdEntityCard());
}else{ }else{
//结束 //结束
baseEntity.setDkJsSj(dksj); baseEntity.setDkJsSj(dksj);
@ -156,5 +161,18 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
return null; return null;
} }
@Override
public List<TbZdxlFgdwBddxlrwJl> getRwjlByXfbbId(String xfbbId) {
List<TbQwJlDto> jlDtos = this.tbQwzxAdaptRemoteService.getJlxxByBbid(xfbbId);
List<String> sfzhList = jlDtos.stream().map(TbQwJlDto::getSfzh).collect(Collectors.toList());
List<TbZdxlFgdwBddxlrwJl> list = this.baseMapper.selectList(
new LambdaQueryWrapper<TbZdxlFgdwBddxlrwJl>()
.in(TbZdxlFgdwBddxlrwJl::getSfzh,sfzhList)
.orderByDesc(TbZdxlFgdwBddxlrwJl::getXtCjsj)
.last("limit 100")
);
return list;
}
} }

View File

@ -21,10 +21,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -365,6 +362,11 @@ public class TbZdxlFgdwBddxlrwServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlrwM
TbZdxlFgdwBddxlrwVO vo = new TbZdxlFgdwBddxlrwVO(); TbZdxlFgdwBddxlrwVO vo = new TbZdxlFgdwBddxlrwVO();
vo.setBddMc(bdd.getBddMc()); vo.setBddMc(bdd.getBddMc());
if(Objects.nonNull(bdd.getDkjgsj())){
vo.setDkjgsj(bdd.getDkjgsj());
}else{
vo.setDkjgsj(10);
}
vo.setBddId(bdd.getId()); vo.setBddId(bdd.getId());
vo.setFgxlrwId(fgxlrwId); vo.setFgxlrwId(fgxlrwId);
vo.setXlghDkcs(mrpz.getFgDkcs()); vo.setXlghDkcs(mrpz.getFgDkcs());
@ -412,6 +414,7 @@ public class TbZdxlFgdwBddxlrwServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlrwM
TbZdxlFgdwBdd bdd = tbZdxlFgdwBddService.selectById(resultVO.getBddId()); TbZdxlFgdwBdd bdd = tbZdxlFgdwBddService.selectById(resultVO.getBddId());
if(ObjectUtils.isNotEmpty(bdd)){ if(ObjectUtils.isNotEmpty(bdd)){
resultVO.setBddMc(bdd.getBddMc()); resultVO.setBddMc(bdd.getBddMc());
resultVO.setDkjgsj(bdd.getDkjgsj());
} }
} }

View File

@ -154,6 +154,13 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
return resultPage; return resultPage;
} }
@Override
public TbZdxlFgxlrwVO selectByBBdId(TbZdxlFgxlrwQuery query) {
TbZdxlFgxlrw xlrw = this.baseMapper.selectById(query.getBbdId());
TbZdxlFgxlrwVO resultVO = this.buildAllInfoByEntity(xlrw);
return resultVO;
}
@Override @Override
public List<TbZdxlFgxlrwVO> selectList(TbZdxlFgxlrwQuery query) { public List<TbZdxlFgxlrwVO> selectList(TbZdxlFgxlrwQuery query) {
QueryWrapper<TbZdxlFgxlrw> qw = new QueryWrapper<>(); QueryWrapper<TbZdxlFgxlrw> qw = new QueryWrapper<>();

View File

@ -63,4 +63,6 @@ public interface TbZdxlFgdwBddxlrwJlService {
*/ */
String clockIn(TbZdxlFgdwBddxlrwJl baseEntity, TbZdxlFgdwBddxlrwJlClockInDTO dto, UserInfo user, Date dksj); String clockIn(TbZdxlFgdwBddxlrwJl baseEntity, TbZdxlFgdwBddxlrwJlClockInDTO dto, UserInfo user, Date dksj);
List<TbZdxlFgdwBddxlrwJl> getRwjlByXfbbId(String xfbbId);
} }

View File

@ -39,6 +39,8 @@ public interface TbZdxlFgxlrwService {
*/ */
IPage<TbZdxlFgxlrwVO> selectRwPage(TbZdxlFgxlrwQuery query); IPage<TbZdxlFgxlrwVO> selectRwPage(TbZdxlFgxlrwQuery query);
TbZdxlFgxlrwVO selectByBBdId(TbZdxlFgxlrwQuery query);
/** /**
* 查询列表 * 查询列表
* @param query 实体查询对象 * @param query 实体查询对象