打卡位置
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.mosty.base.model.dto.yjzl;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -74,4 +75,8 @@ public class TbZdxlFgdwBddUpdateDTO {
|
||||
@NotNull(message = "zdxl.fgdwBdd.wd.notNull")
|
||||
private BigDecimal wd;
|
||||
|
||||
@ApiModelProperty(value = "打卡间隔时间")
|
||||
@TableField(value = "dkjgsj")
|
||||
private Integer dkjgsj;
|
||||
|
||||
}
|
||||
|
||||
@ -66,6 +66,10 @@ public class TbZdxlFgdwBdd extends BaseEntity implements Serializable, Cloneable
|
||||
@TableField(value = "bdd_sm")
|
||||
private String bddSm;
|
||||
|
||||
@ApiModelProperty(value = "打卡间隔时间")
|
||||
@TableField(value = "dkjgsj")
|
||||
private Integer dkjgsj;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
|
||||
@ -129,6 +129,10 @@ public class TbZdxlFgdwBddxlrwJl extends BaseEntity implements Serializable, Clo
|
||||
@TableField(value = "dkr_id")
|
||||
private Long dkrId;
|
||||
|
||||
@ApiModelProperty(value = "打卡人ID")
|
||||
@TableField(value = "sfzh")
|
||||
private String sfzh;
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
|
||||
@ -24,6 +24,10 @@ import java.util.Date;
|
||||
@ApiModel(value = "TbZdxlFgxlrwQuery对象", description = "指导巡逻方格巡逻任务查询对象")
|
||||
public class TbZdxlFgxlrwQuery extends BasePage {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "方格ID")
|
||||
private String bbdId;
|
||||
|
||||
/**
|
||||
* 方格ID
|
||||
*/
|
||||
|
||||
@ -26,6 +26,9 @@ public class TbZdxlFgdwBddxlrwVO extends TbZdxlFgdwBddxlrw {
|
||||
@ApiModelProperty(value = "必到点名称")
|
||||
private String bddMc;
|
||||
|
||||
@ApiModelProperty(value = "打卡间隔时间(分钟)")
|
||||
private Integer dkjgsj;
|
||||
|
||||
/**
|
||||
* 必到点进度
|
||||
*/
|
||||
|
||||
@ -50,6 +50,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
@ -1352,7 +1353,11 @@ public class TbQwXfbbServiceImpl extends ServiceImpl<TbQwXfbbMapper, TbQwXfbb> i
|
||||
// xfbb.setLx(user1.getType());
|
||||
// }
|
||||
WebSocketObject obj = new WebSocketObject("04", xfbb, null);
|
||||
try{
|
||||
this.tbWebSocketAdaptRemoteService.sendBbMessage(obj);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
TbWzLswz wz = new TbWzLswz();
|
||||
wz.setId(UUIDGenerator.getUUID());
|
||||
wz.setSjly("02");
|
||||
@ -1360,6 +1365,11 @@ public class TbQwXfbbServiceImpl extends ServiceImpl<TbQwXfbbMapper, TbQwXfbb> i
|
||||
wz.setYwid(xfbb.getId());
|
||||
wz.setJd(BigDecimal.valueOf(dto.getJd()));
|
||||
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()));
|
||||
this.baseMapper.insertTbWzSblswz(wz);
|
||||
}
|
||||
|
||||
@ -533,7 +533,7 @@
|
||||
</if>
|
||||
and a.xt_sjzt = '1'
|
||||
and a.bbzt = '0'
|
||||
and a.bbjssj is null
|
||||
|
||||
and (
|
||||
a.fzr_sfzh = #{sfzh} or a.id in (select ywid
|
||||
from tb_qw_jl b
|
||||
@ -665,8 +665,8 @@
|
||||
|
||||
<insert id="insertTbWzSblswz">
|
||||
insert into mosty_wzzx.tb_wz_lswz
|
||||
(id,sjly,dwsj,ywid,jd,wd)
|
||||
values (#{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}, #{xtSjly}, #{xtSjzt}, #{xtScbz})
|
||||
</insert>
|
||||
|
||||
<select id="getSumXfsc" resultType="java.util.Map">
|
||||
|
||||
@ -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>()
|
||||
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