打卡位置

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

@ -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);
}