app人员轨迹接口
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
package org.dromara.gps.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -54,6 +56,31 @@ public class GpsEquipmentSonController extends BaseController {
|
||||
return R.ok(gpsEquipmentSonService.queryList(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询GPS设备定位信息列表
|
||||
*/
|
||||
// @SaCheckPermission("gps:equipmentSon:appGetList")
|
||||
@GetMapping("/app/getList")
|
||||
public R<Map<String,Object>> getAppList(GpsEquipmentSonBo bo) {
|
||||
if (bo.getUserId() == null) {
|
||||
throw new ServiceException("用户id不能为空!!!");
|
||||
}
|
||||
if (bo.getProjectId() == null) {
|
||||
throw new ServiceException("项目id不能为空!!!");
|
||||
}
|
||||
if (bo.getStartTime() == null ) {
|
||||
throw new ServiceException("开始时间不能为空!!!");
|
||||
}
|
||||
if (bo.getEndTime() == null) {
|
||||
throw new ServiceException("结束时间不能为空!!!");
|
||||
}
|
||||
if (bo.getStartTime().isAfter(bo.getEndTime())) {
|
||||
throw new ServiceException("结束时间不能在开始时间之前!!!");
|
||||
}
|
||||
return R.ok(gpsEquipmentSonService.getAppList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出GPS设备定位信息列表
|
||||
*/
|
||||
|
||||
@ -10,6 +10,8 @@ import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* GPS设备定位信息业务对象 gps_equipment_son
|
||||
@ -121,4 +123,13 @@ public class GpsEquipmentSonBo extends BaseEntity {
|
||||
*/
|
||||
private Integer gpsType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import org.dromara.gps.domain.GpsEquipmentSon;
|
||||
import org.dromara.gps.domain.vo.GpsEquipmentSonVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -32,4 +33,14 @@ public interface GpsEquipmentSonMapper extends BaseMapperPlus<GpsEquipmentSon, G
|
||||
"WHERE\n" +
|
||||
" rn = 1;")
|
||||
List<GpsEquipmentSonVo> getClientList(@Param("projectId") Long projectId);
|
||||
|
||||
@Select("SELECT loc_latitude AS locLatitude," +
|
||||
" loc_longitude AS locLongitude " +
|
||||
"FROM gps_equipment_son " +
|
||||
"WHERE " +
|
||||
"project_id = #{projectId} " +
|
||||
"AND user_id =#{userId} " +
|
||||
"AND create_time BETWEEN #{startTime} AND #{endTime} " +
|
||||
"ORDER BY create_time")
|
||||
List<GpsEquipmentSonVo> getAppSonByBo(@Param("projectId") Long projectId, @Param("userId") Long userId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* GPS设备定位信息Service接口
|
||||
@ -69,4 +70,6 @@ public interface IGpsEquipmentSonService extends IService<GpsEquipmentSon>{
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
List<GpsEquipmentSonVo> getClientList(Long projectId);
|
||||
|
||||
Map<String, Object> getAppList(GpsEquipmentSonBo bo);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.dromara.gps.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.service.OssService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -9,6 +10,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysDictDataService;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.gps.domain.bo.GpsEquipmentSonBo;
|
||||
import org.dromara.gps.domain.vo.GpsEquipmentSonVo;
|
||||
@ -16,9 +25,7 @@ import org.dromara.gps.domain.GpsEquipmentSon;
|
||||
import org.dromara.gps.mapper.GpsEquipmentSonMapper;
|
||||
import org.dromara.gps.service.IGpsEquipmentSonService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* GPS设备定位信息Service业务层处理
|
||||
@ -32,6 +39,13 @@ public class GpsEquipmentSonServiceImpl extends ServiceImpl<GpsEquipmentSonMappe
|
||||
|
||||
private final GpsEquipmentSonMapper baseMapper;
|
||||
|
||||
@Autowired
|
||||
private ISubConstructionUserService constructionUserService;
|
||||
@Autowired
|
||||
private ISysDictDataService sysDictDataService;
|
||||
@Autowired
|
||||
private ISysOssService ossService;
|
||||
|
||||
/**
|
||||
* 查询GPS设备定位信息
|
||||
*
|
||||
@ -143,4 +157,22 @@ public class GpsEquipmentSonServiceImpl extends ServiceImpl<GpsEquipmentSonMappe
|
||||
public List<GpsEquipmentSonVo> getClientList(Long projectId) {
|
||||
return baseMapper.getClientList(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAppList(GpsEquipmentSonBo bo) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
SubConstructionUser subConstructionUser = constructionUserService.getBySysUserId(bo.getUserId());
|
||||
SysOssVo ossVo = ossService.getById(Long.valueOf(subConstructionUser.getFacePic()));
|
||||
map.put("facePic",ossVo ==null ?"":ossVo.getUrl());
|
||||
map.put("userName",subConstructionUser.getUserName());
|
||||
map.put("teamName",subConstructionUser.getTeamName());
|
||||
if (subConstructionUser.getTypeOfWork() != null){
|
||||
String typeOfWork = sysDictDataService.selectDictLabel("type_of_work", subConstructionUser.getTypeOfWork());
|
||||
map.put("typeOfWork",typeOfWork);
|
||||
}
|
||||
List<GpsEquipmentSonVo> gpsEquipmentSonVoList = baseMapper.getAppSonByBo(bo.getProjectId(),bo.getUserId(),bo.getStartTime(),bo.getEndTime());
|
||||
map.put("footprint", gpsEquipmentSonVoList.isEmpty() ? new ArrayList<GpsEquipmentSonVo>() : gpsEquipmentSonVoList);
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
||||
});
|
||||
if (bo.getType().equals(LimitListTypeEnum.SPECIAL.getCode())) {
|
||||
return listVoList;
|
||||
}
|
||||
}
|
||||
|
||||
//构建父子映射
|
||||
Map<String, List<BusBillofquantitiesLimitListVo>> parentMap = listVoList.stream()
|
||||
@ -271,7 +271,7 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
||||
limitList.setType(bo.getType());
|
||||
limitList.setUnitPrice(item.getUnitPrice());
|
||||
limitList.setTaxRate(item.getTaxRate());
|
||||
limitList.setNum(item.getNum());
|
||||
// limitList.setNum(item.getNum());
|
||||
if (LimitListTypeEnum.SPECIAL.getCode().equals(bo.getType())){
|
||||
limitList.setSupplier(item.getSupplier());
|
||||
limitList.setContractNumber(item.getContractNumber());
|
||||
|
||||
Reference in New Issue
Block a user