打卡位置

This commit is contained in:
2025-11-13 19:40:00 +08:00
parent 7e21e1ab02
commit 8784f82734
5 changed files with 280 additions and 4 deletions

View File

@ -0,0 +1,32 @@
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;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BddxlrwJlQuery 对象", description="打卡记录查询")
public class BddxlrwJlQuery extends BasePage implements Serializable, Cloneable {
private static final long serialVersionUID = 5669699389640027676L;
@ApiModelProperty(value = "开始打卡时间")
private String kssj;
@ApiModelProperty(value = "结束打卡时间")
private String jssj;
@ApiModelProperty(value = "打卡人姓名")
private String dkrXm;
@ApiModelProperty(value = "所属部门代码")
private String ssbmdm;
}

View File

@ -0,0 +1,168 @@
package com.mosty.base.model.vo.yjzl;
import com.fasterxml.jackson.annotation.JsonFormat;
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.math.BigDecimal;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="TbZdxlFgdwBddxlrwJlVo 对象", description="打卡记录")
public class TbZdxlFgdwBddxlrwJlVo {
@ApiModelProperty(value = "主键ID")
private String id;
/**
* 必到点巡逻任务ID
*/
@ApiModelProperty(value = "必到点巡逻任务ID")
private String bddxlrwId;
/**
* 开始打卡时间
*/
@ApiModelProperty(value = "开始打卡时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dkKsSj;
/**
* 开始打卡附件
*/
@ApiModelProperty(value = "开始打卡附件")
private String dkKsFj;
/**
* 开始打卡经度
*/
@ApiModelProperty(value = "开始打卡经度")
private BigDecimal dkKsJd;
/**
* 开始打卡纬度
*/
@ApiModelProperty(value = "开始打卡纬度")
private BigDecimal dkKsWd;
/**
* 结束打卡时间
*/
@ApiModelProperty(value = "结束打卡时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dkJsSj;
/**
* 结束打卡附件
*/
@ApiModelProperty(value = "结束打卡附件")
private String dkJsFj;
/**
* 结束打卡经度
*/
@ApiModelProperty(value = "结束打卡经度")
private BigDecimal dkJsJd;
/**
* 结束打卡纬度
*/
@ApiModelProperty(value = "结束打卡纬度")
private BigDecimal dkJsWd;
/**
* 打卡顺序
*/
@ApiModelProperty(value = "打卡顺序")
private Integer dkSx;
/**
* 打卡人姓名
*/
@ApiModelProperty(value = "打卡人姓名")
private String dkrXm;
/**
* 打卡人ID
*/
@ApiModelProperty(value = "打卡人ID")
private Long dkrId;
@ApiModelProperty(value = "打卡人ID")
private String sfzh;
/**
* 所属部门id
*/
@ApiModelProperty(value = "所属部门id")
private String ssbmid;
/**
* 所属部门
*/
@ApiModelProperty(value = "所属部门")
private String ssbm;
/**
* 所属部门代码
*/
@ApiModelProperty(value = "所属部门代码")
private String ssbmdm;
/**
* 所属县公安局
*/
@ApiModelProperty(value = "所属县公安局")
private String ssxgaj;
/**
* 所属县公安局id
*/
@ApiModelProperty(value = "所属县公安局id")
private String ssxgajid;
/**
* 所属县公安局代码
*/
@ApiModelProperty(value = "所属县公安局代码")
private String ssxgajdm;
/**
* 所属市公安局id
*/
@ApiModelProperty(value = "所属市公安局id")
private String sssgajid;
/**
* 所属市公安局
*/
@ApiModelProperty(value = "所属市公安局")
private String sssgaj;
/**
* 所属市公安局代码
*/
@ApiModelProperty(value = "所属市公安局代码")
private String sssgajdm;
/**
* 必到点名称
*/
@ApiModelProperty(value = "必到点名称")
private String bddMc;
/**
* 必到点地址
*/
@ApiModelProperty(value = "必到点地址")
private String bddDz;
}

View File

@ -1,9 +1,12 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.TbZdxlFgdwBddxlrwJl;
import com.mosty.base.model.query.yjzl.BddxlrwJlQuery;
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddxlrwJlVo;
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwVO;
import com.mosty.base.utils.MessageUtils;
import com.mosty.base.utils.spring.SpringValidUtils;
@ -174,8 +177,16 @@ public class TbZdxlFgdwBddxlrwJlController {
@GetMapping("/getRwjlByXfbbId")
@JwtSysUser
@Log(title = "警组打卡记录", businessType = BusinessType.OTHER)
public ResponseResult<List<TbZdxlFgdwBddxlrwJl>> getRwjlByXfbbId(String xfbbId) {
public ResponseResult<List<TbZdxlFgdwBddxlrwJlVo>> getRwjlByXfbbId(String xfbbId) {
return ResponseResult.success(tbZdxlFgdwBddxlrwJlService.getRwjlByXfbbId(xfbbId));
}
@ApiOperation(value = "警组打卡记录分页")
@GetMapping("/getPageList")
@JwtSysUser
@Log(title = "警组打卡记录分页", businessType = BusinessType.OTHER)
public ResponseResult<IPage<TbZdxlFgdwBddxlrwJlVo>> getPageList(BddxlrwJlQuery query) {
return ResponseResult.success(tbZdxlFgdwBddxlrwJlService.getPageList(query));
}
}

View File

@ -2,14 +2,21 @@ 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.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.entity.yjzl.zddw.TbZdxlFgdwBdd;
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrw;
import com.mosty.base.model.entity.yjzl.zddw.TbZdxlFgdwBddxlrwJl;
import com.mosty.base.model.query.yjzl.BddxlrwJlQuery;
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddxlrwJlVo;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.token.UserInfo;
import com.mosty.yjzl.mapper.TbZdxlFgdwBddMapper;
import com.mosty.yjzl.mapper.TbZdxlFgdwBddxlrwJlMapper;
import com.mosty.yjzl.mapper.TbZdxlFgdwBddxlrwMapper;
import com.mosty.yjzl.remote.TbQwzxAdaptRemoteService;
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
@ -17,12 +24,14 @@ import lombok.AllArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -41,6 +50,8 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
*/
private final TbZdxlFgdwBddxlrwService tbZdxlFgdwBddxlrwService;
private final TbQwzxAdaptRemoteService tbQwzxAdaptRemoteService;
private final TbZdxlFgdwBddxlrwMapper tbZdxlFgdwBddxlrwMapper;
private final TbZdxlFgdwBddMapper tbZdxlFgdwBddMapper;
@Override
public TbZdxlFgdwBddxlrwJl selectById(String id) {
@ -162,7 +173,7 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
}
@Override
public List<TbZdxlFgdwBddxlrwJl> getRwjlByXfbbId(String xfbbId) {
public List<TbZdxlFgdwBddxlrwJlVo> 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(
@ -171,7 +182,56 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
.orderByDesc(TbZdxlFgdwBddxlrwJl::getXtCjsj)
.last("limit 100")
);
return list;
List<TbZdxlFgdwBddxlrwJlVo> vos = new ArrayList<>();
list.forEach(xlrwjl -> {
TbZdxlFgdwBddxlrwJlVo vo = new TbZdxlFgdwBddxlrwJlVo();
BeanUtils.copyProperties(xlrwjl,vo);
TbZdxlFgdwBddxlrw tbZdxlFgdwBddxlrw = this.tbZdxlFgdwBddxlrwMapper.selectById(xlrwjl.getBddxlrwId());
if(Objects.nonNull(tbZdxlFgdwBddxlrw)){
TbZdxlFgdwBdd tbZdxlFgdwBdd = this.tbZdxlFgdwBddMapper.selectById(tbZdxlFgdwBddxlrw.getBddId());
if(Objects.nonNull(tbZdxlFgdwBdd)){
vo.setBddMc(tbZdxlFgdwBdd.getBddMc());
vo.setBddDz(tbZdxlFgdwBdd.getBddDz());
}
}
vos.add(vo);
});
return vos;
}
@Override
public IPage<TbZdxlFgdwBddxlrwJlVo> getPageList(BddxlrwJlQuery query) {
if(StringUtils.isNotEmpty(query.getSsbmdm())){
query.setSsbmdm(query.getSsbmdm().replaceAll("(00)+$", ""));
}
IPage<TbZdxlFgdwBddxlrwJl> page = this.baseMapper.selectPage(
new Page<>(query.getPageCurrent(),query.getPageSize()),
new LambdaQueryWrapper<TbZdxlFgdwBddxlrwJl>()
.like(StringUtils.isNotEmpty(query.getSsbmdm()),TbZdxlFgdwBddxlrwJl::getSsbmdm,query.getSsbmdm())
.like(StringUtils.isNotEmpty(query.getDkrXm()),TbZdxlFgdwBddxlrwJl::getDkrXm,query.getDkrXm())
.between(StringUtils.isNotEmpty(query.getKssj()),TbZdxlFgdwBddxlrwJl::getDkKsSj,query.getKssj(),query.getJssj())
.orderByDesc(TbZdxlFgdwBddxlrwJl::getXtCjsj)
);
List<TbZdxlFgdwBddxlrwJlVo> vos = new ArrayList<>();
if(CollectionUtils.isEmpty(page.getRecords())){
page.getRecords().forEach(item -> {
TbZdxlFgdwBddxlrwJlVo vo = new TbZdxlFgdwBddxlrwJlVo();
BeanUtils.copyProperties(item,vo);
TbZdxlFgdwBddxlrw tbZdxlFgdwBddxlrw = this.tbZdxlFgdwBddxlrwMapper.selectById(item.getBddxlrwId());
if(Objects.nonNull(tbZdxlFgdwBddxlrw)){
TbZdxlFgdwBdd tbZdxlFgdwBdd = this.tbZdxlFgdwBddMapper.selectById(tbZdxlFgdwBddxlrw.getBddId());
if(Objects.nonNull(tbZdxlFgdwBdd)){
vo.setBddMc(tbZdxlFgdwBdd.getBddMc());
vo.setBddDz(tbZdxlFgdwBdd.getBddDz());
}
}
vos.add(vo);
});
}
IPage<TbZdxlFgdwBddxlrwJlVo> voIPage = new Page<>(query.getPageCurrent(),query.getPageSize());
voIPage.setRecords(vos);
voIPage.setTotal(page.getTotal());
return voIPage;
}

View File

@ -1,8 +1,11 @@
package com.mosty.yjzl.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.model.query.yjzl.BddxlrwJlQuery;
import com.mosty.base.model.vo.yjzl.TbZdxlFgdwBddxlrwJlVo;
import com.mosty.common.token.UserInfo;
import java.util.Date;
@ -63,6 +66,8 @@ public interface TbZdxlFgdwBddxlrwJlService {
*/
String clockIn(TbZdxlFgdwBddxlrwJl baseEntity, TbZdxlFgdwBddxlrwJlClockInDTO dto, UserInfo user, Date dksj);
List<TbZdxlFgdwBddxlrwJl> getRwjlByXfbbId(String xfbbId);
List<TbZdxlFgdwBddxlrwJlVo> getRwjlByXfbbId(String xfbbId);
IPage<TbZdxlFgdwBddxlrwJlVo> getPageList(BddxlrwJlQuery query);
}