打卡位置
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.mosty.yjzl.controller;
|
||||
|
||||
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.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.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwService;
|
||||
@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -56,6 +59,8 @@ public class TbZdxlFgdwBddxlrwJlController {
|
||||
*/
|
||||
private final TbZdxlFgdwService tbZdxlFgdwService;
|
||||
|
||||
private final TbZdxlFgdwBddService tbZdxlFgdwBddService;
|
||||
|
||||
/**
|
||||
* 查询列表(根据必到点巡逻任务ID)
|
||||
* @param bddxlrwId 必到点巡逻任务ID
|
||||
@ -142,9 +147,14 @@ public class TbZdxlFgdwBddxlrwJlController {
|
||||
if(!baseEntity.getDkrXm().equals(user.getUserName())){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "您不是此记录的打卡人,不能进行打卡");
|
||||
}
|
||||
TbZdxlFgdwBdd tbZdxlFgdwBdd = this.tbZdxlFgdwBddService.selectById(bddxlrw.getBddId());
|
||||
Integer jgsj = 10;
|
||||
if(Objects.nonNull(tbZdxlFgdwBdd)){
|
||||
jgsj = tbZdxlFgdwBdd.getDkjgsj();
|
||||
}
|
||||
//是否待满10分钟
|
||||
if(dksj.getTime()-baseEntity.getDkKsSj().getTime() < TbZdxlFgxlrwUtils.CLOCK_IN_INTERVAL_TIME){
|
||||
return ResponseResult.fail(MessageUtils.getSaveFailMsg() + "请在开始10分后,再打卡结束");
|
||||
if(dksj.getTime()-baseEntity.getDkKsSj().getTime() < jgsj){
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -75,6 +75,14 @@ public class TbZdxlFgxlrwController {
|
||||
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 实体查询对象
|
||||
|
||||
@ -144,13 +144,14 @@ public class TbZdxlFgdwBddServiceImpl extends ServiceImpl<TbZdxlFgdwBddMapper, T
|
||||
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")
|
||||
List<TbZdxlFgdwBdd> list = 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")
|
||||
);
|
||||
//查询数据
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
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.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.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.remote.TbQwzxAdaptRemoteService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwJlService;
|
||||
import com.mosty.yjzl.service.TbZdxlFgdwBddxlrwService;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -20,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangzhao
|
||||
@ -36,6 +40,7 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
|
||||
* 指导巡逻方格点位必到点巡逻任务表Service
|
||||
*/
|
||||
private final TbZdxlFgdwBddxlrwService tbZdxlFgdwBddxlrwService;
|
||||
private final TbQwzxAdaptRemoteService tbQwzxAdaptRemoteService;
|
||||
|
||||
@Override
|
||||
public TbZdxlFgdwBddxlrwJl selectById(String id) {
|
||||
@ -137,7 +142,7 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
|
||||
baseEntity.setDkKsJd(dto.getDkJd());
|
||||
baseEntity.setDkKsWd(dto.getDkWd());
|
||||
baseEntity.setDkrXm(user.getUserName());
|
||||
baseEntity.setDkrId(user.getUserId());
|
||||
baseEntity.setSfzh(user.getIdEntityCard());
|
||||
}else{
|
||||
//结束
|
||||
baseEntity.setDkJsSj(dksj);
|
||||
@ -156,5 +161,18 @@ public class TbZdxlFgdwBddxlrwJlServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlr
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -21,10 +21,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
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.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -365,6 +362,11 @@ public class TbZdxlFgdwBddxlrwServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlrwM
|
||||
TbZdxlFgdwBddxlrwVO vo = new TbZdxlFgdwBddxlrwVO();
|
||||
|
||||
vo.setBddMc(bdd.getBddMc());
|
||||
if(Objects.nonNull(bdd.getDkjgsj())){
|
||||
vo.setDkjgsj(bdd.getDkjgsj());
|
||||
}else{
|
||||
vo.setDkjgsj(10);
|
||||
}
|
||||
vo.setBddId(bdd.getId());
|
||||
vo.setFgxlrwId(fgxlrwId);
|
||||
vo.setXlghDkcs(mrpz.getFgDkcs());
|
||||
@ -412,6 +414,7 @@ public class TbZdxlFgdwBddxlrwServiceImpl extends ServiceImpl<TbZdxlFgdwBddxlrwM
|
||||
TbZdxlFgdwBdd bdd = tbZdxlFgdwBddService.selectById(resultVO.getBddId());
|
||||
if(ObjectUtils.isNotEmpty(bdd)){
|
||||
resultVO.setBddMc(bdd.getBddMc());
|
||||
resultVO.setDkjgsj(bdd.getDkjgsj());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -154,6 +154,13 @@ public class TbZdxlFgxlrwServiceImpl extends ServiceImpl<TbZdxlFgxlrwMapper, TbZ
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbZdxlFgxlrwVO selectByBBdId(TbZdxlFgxlrwQuery query) {
|
||||
TbZdxlFgxlrw xlrw = this.baseMapper.selectById(query.getBbdId());
|
||||
TbZdxlFgxlrwVO resultVO = this.buildAllInfoByEntity(xlrw);
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbZdxlFgxlrwVO> selectList(TbZdxlFgxlrwQuery query) {
|
||||
QueryWrapper<TbZdxlFgxlrw> qw = new QueryWrapper<>();
|
||||
|
||||
@ -63,4 +63,6 @@ public interface TbZdxlFgdwBddxlrwJlService {
|
||||
*/
|
||||
String clockIn(TbZdxlFgdwBddxlrwJl baseEntity, TbZdxlFgdwBddxlrwJlClockInDTO dto, UserInfo user, Date dksj);
|
||||
|
||||
List<TbZdxlFgdwBddxlrwJl> getRwjlByXfbbId(String xfbbId);
|
||||
|
||||
}
|
||||
|
||||
@ -39,6 +39,8 @@ public interface TbZdxlFgxlrwService {
|
||||
*/
|
||||
IPage<TbZdxlFgxlrwVO> selectRwPage(TbZdxlFgxlrwQuery query);
|
||||
|
||||
TbZdxlFgxlrwVO selectByBBdId(TbZdxlFgxlrwQuery query);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 实体查询对象
|
||||
|
||||
Reference in New Issue
Block a user