提交 15de1d03 作者: 17607474349

Merge remote-tracking branch 'origin/dev_tzl' into dev_lijing

......@@ -2,6 +2,7 @@
package com.yiring.app.domain.video;
import java.io.Serializable;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
......@@ -18,8 +19,8 @@ public interface VideoRepository extends JpaRepository<Video, Serializable>, Jpa
* 根据监控点位名称模糊查询
* @author tzl
* @date 2022/4/27 13:39
* @param VideoName 监控点位名称
* @param str 监控点位名称
* @return com.yiring.app.domain.video.Video
*/
Video findByVideoNameLike(String VideoName);
List<Video> findByVideoNameLike(String str);
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.domain.workArea;
import com.yiring.app.domain.video.Video;
import com.yiring.common.domain.BasicEntity;
import java.io.Serial;
import java.io.Serializable;
import javax.persistence.*;
import lombok.*;
import lombok.experimental.FieldDefaults;
import lombok.experimental.FieldNameConstants;
import org.hibernate.annotations.Comment;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/20 16:08
*/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@Entity
@Table(name = "BS_WORK_AREA")
@Comment("工区")
public class WorkArea extends BasicEntity implements Serializable {
@Serial
private static final long serialVersionUID = -6738299404223231827L;
@Comment("工区名称")
String workAreaName;
@Comment("消抖阈值(秒)")
Integer threshold;
@Comment("超时时间(秒)")
Integer timeout;
@Comment("负责人")
String personInCharge;
@Comment("联系电话")
String mobile;
@Comment("监控设备")
@OneToOne
Video video;
}
......@@ -27,8 +27,8 @@ public class PersonnelStatisticsExportExcel implements Serializable {
String region;
@ExcelColumn(title = "入场人数", width = 5)
String admissionNumber;
Long admissionNumber;
@ExcelColumn(title = "出场人数", width = 5)
String attendance;
Long attendance;
}
......@@ -34,9 +34,9 @@ public class BroadcastQueryParam implements Serializable {
@ApiModelProperty(value = "状态", example = "1")
String status;
@ApiModelProperty(value = "分页条数", example = "10", required = true)
@ApiModelProperty(value = "分页条数", example = "10")
Integer pageSize;
@ApiModelProperty(value = "当前页数", example = "1", required = true)
@ApiModelProperty(value = "当前页数", example = "1")
Integer pageNo;
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.*;
import lombok.experimental.FieldDefaults;
......@@ -25,6 +26,15 @@ public class PersonnelStatisticsQueryParam implements Serializable {
@Serial
private static final long serialVersionUID = -638192778218413746L;
@ApiModelProperty(value = "区域", example = "化工区")
String region;
@ApiModelProperty(value = "区域", example = "11")
Long sourceId;
@ApiModelProperty(value = "部门名称", example = "11")
Long departmentId;
@ApiModelProperty(value = "开始时间")
LocalDateTime startTime;
@ApiModelProperty(value = "结束时间")
LocalDateTime endTime;
}
......@@ -27,12 +27,17 @@ public class StreamProxyItem implements Serializable {
String stream;
//拉流地址
String url;
//ffmpeg地址
String src_url;
String rtp_type;
String ffmpeg_cmd_key;
//类型,根据地址是否有关键字判断
String type;
//节点选择
String mediaServerId;
//是否启用
boolean enable;
boolean status;
//是否转HLS
boolean enable_hls;
......
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.service.perstatistics;
package com.yiring.app.service.location.turnover;
import com.yiring.app.param.perstatistics.PersonnelStatisticsQueryParam;
import com.yiring.app.vo.perstatistics.PersonnelStatisticsDetailVo;
import com.yiring.app.vo.perstatistics.PersonnelStatisticsVo;
import com.yiring.common.core.Result;
import com.yiring.common.param.PageParam;
......@@ -10,30 +11,48 @@ import javax.servlet.http.HttpServletResponse;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/15 9:27
* 2022/5/15 11:41
*/
public interface PersonnelStatisticsService {
public interface LocationTurnoverService {
/**
* 分页查询
* 分页区域人员统计信息
* @author tzl
* @date 2022/5/15 9:41
* @date 2022/5/15 11:44
* @param personnelStatisticsQueryParam PersonnelStatisticsQueryParam
* @param pageParam PageParam
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<com.yiring.app.vo.perstatistics.PersonnelStatisticsVo>>
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<com.yiring.app.domain.location.LocationTurnover>>
*/
Result<PageVo<PersonnelStatisticsVo>> pagePerSta(
Result<PageVo<PersonnelStatisticsVo>> pageInfo(
PersonnelStatisticsQueryParam personnelStatisticsQueryParam,
PageParam pageParam
);
/**
* 下拉框
* @author tzl
* @date 2022/5/16 13:59
* @param personnelStatisticsQueryParam PersonnelStatisticsQueryParam
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<com.yiring.app.vo.perstatistics.PersonnelStatisticsVo>>
*/
Result<PageVo<PersonnelStatisticsVo>> indexInfo(PersonnelStatisticsQueryParam personnelStatisticsQueryParam);
/**
* 导出人员统计
*
* @author tzl
* @date 2022/5/15 9:56
* @date 2022/5/16 11:57
* @param personnelStatisticsQueryParam PersonnelStatisticsQueryParam
* @param response HttpServletResponse
* @param httpServletResponse HttpServletResponse
*/
void export(PersonnelStatisticsQueryParam personnelStatisticsQueryParam, HttpServletResponse response);
void export(PersonnelStatisticsQueryParam personnelStatisticsQueryParam, HttpServletResponse httpServletResponse);
/**
*
* @author tzl
* @date 2022/5/15 17:42
* @param personnelStatisticsQueryParam PersonnelStatisticsQueryParam
* @param pageParam PageParam
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<com.yiring.app.vo.perstatistics.PersonnelStatisticsVo>>
*/
Result<PageVo<PersonnelStatisticsDetailVo>> selectInfo(
PersonnelStatisticsQueryParam personnelStatisticsQueryParam,
PageParam pageParam
);
}
......@@ -13,6 +13,7 @@ import com.yiring.app.domain.log.ZyRealtimeLogRepository;
import com.yiring.app.param.key.KeyAlarmAddParam;
import com.yiring.app.service.message.PositionMessageService;
import com.yiring.app.util.GeoUtils;
import com.yiring.app.vo.equipment.EquipmentVo;
import com.yiring.auth.domain.dept.Department;
import com.yiring.auth.domain.user.User;
import com.yiring.auth.domain.user.UserRepository;
......@@ -28,6 +29,7 @@ import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
import lombok.extern.slf4j.Slf4j;
import org.locationtech.jts.geom.Point;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.*;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;
......@@ -422,6 +424,25 @@ public class PositionMessageServiceImpl implements PositionMessageService {
public void processDeviceStatusMessage(JSONObject data) {
// TODO
log.info("DeviceStatus Message: {}", data);
EquipmentVo equipmentVo = data.toJavaObject(EquipmentVo.class);
if (equipmentVo.getDeviceType().equals("BTI")) {
Optional<LocationTag> one = locationTagRepository.findOne(
Example.of(LocationTag.builder().code(equipmentVo.getDeviceId()).build())
);
if (one.isEmpty()) {
log.error("没找到该标签");
return;
}
//修改标签电量
LocationTag locationTag = LocationTag
.builder()
.code(equipmentVo.getDeviceId())
.volt(equipmentVo.getVolt())
.voltUnit(equipmentVo.getField_21())
.build();
BeanUtils.copyProperties(one.get(), locationTag);
locationTagRepository.saveAndFlush(locationTag);
}
}
/**
......
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.service.perstatistics.impl;
import cn.hutool.core.util.StrUtil;
import com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder;
import com.yiring.app.domain.perstatistics.PersonnelStatistics;
import com.yiring.app.domain.perstatistics.PersonnelStatisticsRepository;
import com.yiring.app.excel.perstatistics.PersonnelStatisticsExportExcel;
import com.yiring.app.param.perstatistics.PersonnelStatisticsQueryParam;
import com.yiring.app.service.perstatistics.PersonnelStatisticsService;
import com.yiring.app.vo.perstatistics.PersonnelStatisticsVo;
import com.yiring.common.core.Result;
import com.yiring.common.param.PageParam;
import com.yiring.common.vo.PageVo;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.persistence.criteria.Order;
import javax.persistence.criteria.Predicate;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/15 9:28
*/
@Slf4j
@Transactional(rollbackFor = RuntimeException.class)
@Service
public class PersonnelStatisticsServiceImpl implements PersonnelStatisticsService {
@Resource
PersonnelStatisticsRepository personnelStatisticsRepository;
@Override
public Result<PageVo<PersonnelStatisticsVo>> pagePerSta(
PersonnelStatisticsQueryParam personnelStatisticsQueryParam,
PageParam pageParam
) {
//分页
Pageable pageable = PageRequest.of(pageParam.getPageNo() - 1, pageParam.getPageSize());
Page<PersonnelStatistics> all = personnelStatisticsRepository.findAll(
condition(personnelStatisticsQueryParam),
pageable
);
List<PersonnelStatisticsVo> data = all
.get()
.map(personnelStatistics -> {
PersonnelStatisticsVo vo = new PersonnelStatisticsVo();
BeanUtils.copyProperties(personnelStatistics, vo);
return vo;
})
.collect(Collectors.toList());
PageVo<PersonnelStatisticsVo> resultVo = PageVo.build(data, all.getTotalElements());
return Result.ok(resultVo);
}
@Override
public void export(PersonnelStatisticsQueryParam personnelStatisticsQueryParam, HttpServletResponse response) {
List<PersonnelStatistics> all = personnelStatisticsRepository.findAll(condition(personnelStatisticsQueryParam));
List<PersonnelStatisticsExportExcel> visitorExportExcels = all
.stream()
.map(personnelStatistics -> {
PersonnelStatisticsExportExcel personnelStatisticsExportExcel = new PersonnelStatisticsExportExcel();
BeanUtils.copyProperties(personnelStatistics, personnelStatisticsExportExcel);
return personnelStatisticsExportExcel;
})
.toList();
try (
DefaultStreamExcelBuilder<PersonnelStatisticsExportExcel> defaultStreamExcelBuilder = DefaultStreamExcelBuilder
.of(PersonnelStatisticsExportExcel.class)
.threadPool(Executors.newFixedThreadPool(2))
.rowHeight(14)
.titleRowHeight(14)
.widths(8)
.style(
"cell->vertical-align:center;text-align:center",
"title->vertical-align:center;text-align:center;font-weight:bold;font-family:等线"
)
.start()
) {
defaultStreamExcelBuilder.append(visitorExportExcels);
String fileName = URLEncoder.encode("人员统计.xlsx", StandardCharsets.UTF_8);
response.setContentType("application/octet-stream");
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
OutputStream out = response.getOutputStream();
Workbook workbook = defaultStreamExcelBuilder.fixedTitles().build();
workbook.write(out);
workbook.close();
out.flush();
out.close();
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RuntimeException("导出访客信息失败: " + e.getMessage());
}
}
public Specification<PersonnelStatistics> condition(PersonnelStatisticsQueryParam personnelStatisticsQueryParam) {
return (root, query, criteriaBuilder) -> {
List<Predicate> list = new ArrayList<>();
//查询条件
if (StrUtil.isNotBlank(personnelStatisticsQueryParam.getRegion())) {
//区域查询
list.add(
criteriaBuilder.like(
root.get(PersonnelStatistics.Fields.region),
"%" + personnelStatisticsQueryParam.getRegion() + "%"
)
);
}
Order order = criteriaBuilder.desc(root.get(PersonnelStatistics.Fields.updateTime));
Predicate[] predicates = new Predicate[list.size()];
query.orderBy(order);
query.where(list.toArray(predicates));
return criteriaBuilder.and(list.toArray(predicates));
};
}
}
......@@ -98,5 +98,5 @@ public interface VideoService {
* @param indexParam 入参
* @return com.yiring.common.core.Result<com.yiring.app.vo.video.VideoNameVo>
*/
Result<VideoNameVo> findByVideoNameLike(IndexParam indexParam);
Result<PageVo<VideoNameVo>> findByVideoNameLike(IndexParam indexParam);
}
......@@ -91,12 +91,16 @@ public class VideoServiceImpl implements VideoService {
.name(video.getVideoName())
.app("stream")
.stream(video.getUuid())
.url(video.getM3u8())
.url(video.getM3u8().contains("/h264") ? video.getM3u8() : "")
.src_url(video.getM3u8().contains("/h265") ? video.getM3u8() : "")
.ffmpeg_cmd_key(video.getM3u8().contains("/h265") ? "ffmpeg.cmd" : "")
.rtp_type(video.getM3u8().contains("/h265") ? "" : "0")
.mediaServerId("ZbnQN5csqxrPix7a")
.enable(true)
.enable_hls(true)
.type(video.getM3u8().contains("sss") ? "ffmpeg" : "default")
.timeout_ms(video.getM3u8().contains("sss") ? 60 : null)
// .status(true)
.type(video.getM3u8().contains("/h265") ? "ffmpeg" : "default")
.timeout_ms(video.getM3u8().contains("/h265") ? 30000 : null)
.build();
JSONObject jsonObject = gbClient.proxySave(streamProxyItem, gbCookie());
if (!jsonObject.get("code").equals(0)) {
......@@ -158,8 +162,8 @@ public class VideoServiceImpl implements VideoService {
.mediaServerId("ZbnQN5csqxrPix7a")
.enable(true)
.enable_hls(true)
.type(video.getM3u8().contains("sss") ? "ffmpeg" : "default")
.timeout_ms(video.getM3u8().contains("sss") ? 60 : null)
.type(video.getM3u8().contains("/h265") ? "ffmpeg" : "default")
.timeout_ms(video.getM3u8().contains("/h265") ? 60 : null)
.build();
JSONObject jsonObject = gbClient.proxySave(streamProxyItem, gbCookie());
if (!jsonObject.get("code").equals(0)) {
......@@ -363,11 +367,20 @@ public class VideoServiceImpl implements VideoService {
}
@Override
public Result<VideoNameVo> findByVideoNameLike(IndexParam indexParam) {
VideoNameVo videoNameVo = new VideoNameVo();
Video byVideoNameLike = videoRepository.findByVideoNameLike(indexParam.getStr());
BeanUtils.copyProperties(byVideoNameLike, videoNameVo);
return Result.ok(videoNameVo);
public Result<PageVo<VideoNameVo>> findByVideoNameLike(IndexParam indexParam) {
List<Video> byVideoNameLike = videoRepository.findAll(
condition(VideoQueryParam.builder().videoName(indexParam.getStr()).build())
);
List<VideoNameVo> data = byVideoNameLike
.stream()
.map(video -> {
VideoNameVo vo = new VideoNameVo();
BeanUtils.copyProperties(video, vo);
return vo;
})
.collect(Collectors.toList());
PageVo<VideoNameVo> pageVo = PageVo.build(data, data.size());
return Result.ok(pageVo);
}
boolean has(String uuid) {
......
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.vo.equipment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/16 9:56
*/
@ApiModel("EquipmentVo")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EquipmentVo implements Serializable {
@Serial
private static final long serialVersionUID = -3268799901290404934L;
@ApiModelProperty(value = "设备编号", example = "1518841086628335616")
String deviceId;
@ApiModelProperty(value = "地图编号", example = "1518841086628335616")
String areaId;
@ApiModelProperty(value = "设备类型", example = "BTI:定位器 SXT:监控摄像头 GAT:闸机 LAB:指示牌 BTR:定位基站")
String deviceType;
@ApiModelProperty(value = "电量", example = "1")
Integer volt;
@ApiModelProperty(value = "电量单位(默认mV)", example = "mV")
String field_21;
@ApiModelProperty(value = "修改时间", example = "2022")
LocalDateTime updateTime;
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.vo.location.station;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yiring.app.util.GeoUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.*;
import lombok.experimental.FieldDefaults;
import org.locationtech.jts.geom.Point;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/17 10:41
*/
@ApiModel("LocationBaseStationVo")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class LocationBaseStationVo implements Serializable {
@Serial
private static final long serialVersionUID = 2580621691725484516L;
@JsonSerialize(using = ToStringSerializer.class)
@ApiModelProperty(value = "主键", example = "188354391834")
Long id;
@ApiModelProperty(value = "编号", example = "BTI88888888")
String deviceId;
@ApiModelProperty(value = "类型", example = "BTI88888888")
String deviceType;
@ApiModelProperty(value = "最后一次在线时间", example = "BTI88888888")
LocalDateTime time;
@ApiModelProperty(value = "坐标", example = "01010000805C8FC2F528D4734033333333335B7D400000000000000000")
Point point;
public Point getPoint() {
if (x != null && y != null && z != null) {
return GeoUtils.xyzToPoint(x, y, z);
}
return null;
}
@JsonSerialize(using = ToStringSerializer.class)
@ApiModelProperty(value = "所属地图id", example = "1:总图2:一层3:二层")
Long areaId;
@ApiModelProperty(value = "所属地图", example = "1:总图2:一层3:二层")
String areaName;
@ApiModelProperty(value = "电量单位", example = "")
String voltUnit;
Double x;
Double y;
Double z;
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.vo.perstatistics;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.*;
import lombok.experimental.FieldDefaults;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/15 9:15
*/
@ApiModel("PersonnelStatisticsDetailVo")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class PersonnelStatisticsDetailVo implements Serializable {
@Serial
private static final long serialVersionUID = -1591876062645939080L;
@JsonSerialize(using = ToStringSerializer.class)
@ApiModelProperty(value = "区域id", example = "1")
Long sourceId;
@ApiModelProperty(value = "区域", example = "化工区")
String region;
@ApiModelProperty(value = "时间", example = "")
LocalDateTime time;
@ApiModelProperty(value = "是否入场")
Boolean enter;
@ApiModelProperty(value = "用户")
UserVo userVo;
@ApiModel("UserVo")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public static class UserVo implements Serializable {
@Serial
private static final long serialVersionUID = 4115779013003587949L;
@ApiModelProperty(value = "被访人姓名", example = "张三")
String realName;
String uuid;
String deptName;
}
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.vo.perstatistics;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.*;
import lombok.experimental.FieldDefaults;
......@@ -25,15 +28,22 @@ public class PersonnelStatisticsVo implements Serializable {
@Serial
private static final long serialVersionUID = -5973651085056867803L;
@ApiModelProperty(value = "主键id", example = "1")
Long id;
@JsonSerialize(using = ToStringSerializer.class)
@ApiModelProperty(value = "区域id", example = "1")
Long sourceId;
@ApiModelProperty(value = "区域", example = "化工区")
String region;
@ApiModelProperty(value = "入场人数", example = "10")
String admissionNumber;
Long admissionNumber;
@ApiModelProperty(value = "出场人数", example = "5")
String attendance;
Long attendance;
@ApiModelProperty(value = "开始时间")
LocalDateTime startTime;
@ApiModelProperty(value = "结束时间")
LocalDateTime endTime;
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.vo.perstatistics;
import io.swagger.annotations.ApiModel;
import java.io.Serial;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.FieldDefaults;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/15 14:07
*/
@ApiModel("TurnoverResultVo")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class TurnoverResultVo implements Serializable {
@Serial
private static final long serialVersionUID = 4478127252599634203L;
Long num;
Long sourceId;
Boolean enter;
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.web.location.station;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.yiring.app.feign.zy.location.beacon.LocationBeaconClient;
import com.yiring.app.util.zy.ZyUtil;
import com.yiring.app.vo.location.station.LocationBaseStationVo;
import com.yiring.common.core.Result;
import com.yiring.common.vo.PageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/17 10:36
*/
@Validated
@SuppressWarnings({ "deprecation" })
@Api(tags = "基站", description = "")
@RestController
@RequestMapping("/station/")
public class LocationBaseStationController {
@Resource
LocationBeaconClient locationBeaconClient;
@ApiOperation(value = "查询基站信息")
@PostMapping("/page")
public Result<PageVo<LocationBaseStationVo>> page() {
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("deviceType", "BTR");
hashMap.put("pageSize", 1000);
hashMap.put("pageNum", 1);
hashMap.put("orgId", 100);
hashMap.put("deviceId", "");
JSONObject page = locationBeaconClient.page(JSONUtil.toJsonStr(hashMap), ZyUtil.manageLogin());
JSONObject data = JSONUtil.parseObj(page.get("data"));
JSONArray records = JSONUtil.parseArray(data.get("records"));
List<LocationBaseStationVo> locationBaseStationVos = JSONUtil.toList(
JSONUtil.toJsonStr(records),
LocationBaseStationVo.class
);
return Result.ok(PageVo.build(locationBaseStationVos, locationBaseStationVos.size()));
}
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.web.perstatistics;
package com.yiring.app.web.location.turnover;
import com.yiring.app.param.perstatistics.PersonnelStatisticsQueryParam;
import com.yiring.app.service.perstatistics.PersonnelStatisticsService;
import com.yiring.app.service.location.turnover.LocationTurnoverService;
import com.yiring.app.vo.perstatistics.PersonnelStatisticsDetailVo;
import com.yiring.app.vo.perstatistics.PersonnelStatisticsVo;
import com.yiring.common.core.Result;
import com.yiring.common.param.PageParam;
......@@ -29,21 +30,29 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j
@Validated
@SuppressWarnings({ "deprecation" })
@Api(tags = "人员统计", description = "PersonnelStatistics")
@Api(tags = "人员统计", description = "LocationTurnover")
@RestController
@RequestMapping("/personnelStatistics/")
public class PersonnelStatisticsController {
@RequestMapping("/locationTurnover/")
public class LocationTurnoverController {
@Resource
PersonnelStatisticsService personnelStatisticsService;
LocationTurnoverService locationTurnoverService;
@ApiOperation(value = "分页查询人员统计")
@GetMapping("pagePerSta")
public Result<PageVo<PersonnelStatisticsVo>> pagePerSta(
@GetMapping("pageInfo")
public Result<PageVo<PersonnelStatisticsVo>> pageInfo(
@Valid PersonnelStatisticsQueryParam personnelStatisticsQueryParam,
@Valid PageParam pageParam
) {
return personnelStatisticsService.pagePerSta(personnelStatisticsQueryParam, pageParam);
return locationTurnoverService.pageInfo(personnelStatisticsQueryParam, pageParam);
}
@ApiOperation(value = "下拉框")
@GetMapping("indexInfo")
public Result<PageVo<PersonnelStatisticsVo>> indexInfo(
@Valid PersonnelStatisticsQueryParam personnelStatisticsQueryParam
) {
return locationTurnoverService.indexInfo(personnelStatisticsQueryParam);
}
@ApiOperation(value = "导出", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
......@@ -52,6 +61,15 @@ public class PersonnelStatisticsController {
HttpServletResponse response,
@Valid PersonnelStatisticsQueryParam personnelStatisticsQueryParam
) {
personnelStatisticsService.export(personnelStatisticsQueryParam, response);
locationTurnoverService.export(personnelStatisticsQueryParam, response);
}
@ApiOperation(value = "查询人员统计详情")
@GetMapping("selectInfo")
public Result<PageVo<PersonnelStatisticsDetailVo>> selectInfo(
@Valid PersonnelStatisticsQueryParam personnelStatisticsQueryParam,
@Valid PageParam pageParam
) {
return locationTurnoverService.selectInfo(personnelStatisticsQueryParam, pageParam);
}
}
......@@ -89,7 +89,7 @@ public class VideoController {
@ApiOperation(value = "根据监控点位名称模糊查询")
@GetMapping("findByVideoNameLike")
public Result<VideoNameVo> findByVideoNameLike(@Valid IndexParam indexParam) {
public Result<PageVo<VideoNameVo>> findByVideoNameLike(@Valid IndexParam indexParam) {
return videoService.findByVideoNameLike(indexParam);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论