package org.springblade.jfpt.feign;
|
|
import com.alibaba.fastjson.JSONObject;
|
import lombok.AllArgsConstructor;
|
import org.springblade.common.entity.*;
|
import org.springblade.jfpt.alarm.service.IAlarmService;
|
import org.springblade.jfpt.alarm.vo.AlarmVO;
|
import org.springblade.jfpt.animalheat.service.AnimalHeatService;
|
import org.springblade.jfpt.animalheat.vo.AnimalHeatVo;
|
import org.springblade.jfpt.healthcode.service.IhealthcodeService;
|
import org.springblade.jfpt.healthcode.vo.HealthcodeVO;
|
import org.springblade.jfpt.parcel.service.ParcelService;
|
import org.springblade.jfpt.parcel.vo.ConditionVo;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import java.util.Map;
|
|
@RestController
|
@AllArgsConstructor
|
public class ReportFeign {
|
|
private final IhealthcodeService ihealthcodeService;
|
|
private final AnimalHeatService animalHeatService;
|
|
private final ParcelService parcelService;
|
|
private final IAlarmService iAlarmService;
|
|
/**
|
* 获取实时警情数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getAlarmList")
|
public List<AlarmExcel> getAlarmList(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
AlarmVO alarmVO = getAlarmVO(map);
|
//查询数据并返回数据
|
List<AlarmExcel> excelList = iAlarmService.exportAlarm(alarmVO);
|
return excelList;
|
}
|
|
/**
|
* 获取实时警情数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getAlarmPie")
|
public List<ReportReturnData> getAlarmPie(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
AlarmVO alarmVO = getAlarmVO(map);
|
//查询数据并返回数据
|
List<ReportReturnData> excelList = iAlarmService.getAlarmPie(alarmVO);
|
return excelList;
|
}
|
|
/**
|
* 封装实时警情查询条件
|
* @param map
|
* @return
|
*/
|
private AlarmVO getAlarmVO(Map<String, Object> map) {
|
AlarmVO alarmVO = new AlarmVO();
|
if (null!=map.get("beginTime")) {
|
alarmVO.setBeginTime(map.get("beginTime").toString());
|
}
|
if (null!=map.get("endTime")) {
|
alarmVO.setEndTime(map.get("endTime").toString());
|
}
|
if (null!=map.get("waringType")) {
|
alarmVO.setWaringType(map.get("waringType").toString());
|
}
|
if (null!=map.get("timeDesc")) {
|
alarmVO.setTimeDesc(map.get("timeDesc").toString());
|
}
|
return alarmVO;
|
}
|
|
|
/**
|
* 获取健康码数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getHealthcodeList")
|
public List<HealthcodeExcel> getHealthcodeList(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
HealthcodeVO healthcodeVO = getHealthcodeVo(map);
|
//查询数据并返回数据
|
List<HealthcodeExcel> excelList = ihealthcodeService.exportHealthcode(healthcodeVO);
|
return excelList;
|
}
|
|
|
|
/**
|
* 获取健康码图标数据
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getHealthcodePie")
|
public List<HealthcodeExcel> getHealthcodePie(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
HealthcodeVO healthcodeVO = getHealthcodeVo(map);
|
//查询数据并返回数据
|
return ihealthcodeService.getHealthcodePie(healthcodeVO);
|
}
|
|
/**
|
* 封装健康码条件数据
|
* @param map
|
* @return
|
*/
|
private HealthcodeVO getHealthcodeVo(Map<String, Object> map) {
|
HealthcodeVO healthcodeVO = new HealthcodeVO();
|
if (null!=map.get("begTime")) {
|
healthcodeVO.setBegTime(map.get("begTime").toString());
|
}
|
if (null!=map.get("endTime")) {
|
healthcodeVO.setEndTime(map.get("endTime").toString());
|
}
|
if (null!=map.get("type")) {
|
healthcodeVO.setType(map.get("type").toString());
|
}
|
if (null!=map.get("timeDesc")) {
|
healthcodeVO.setTimeDesc(map.get("timeDesc").toString());
|
}
|
return healthcodeVO;
|
}
|
|
/**
|
* 获取体温数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getAnimalHeatList")
|
public List<AnimalHeatExcel> getAnimalHeatList(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
AnimalHeatVo animalHeatVo = getAnimalHeatVo(map);
|
//查询数据并返回数据
|
return animalHeatService.exportAnimalHeat(animalHeatVo);
|
}
|
|
/**
|
* 获取体温图表数据
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getAnimalHeatPie")
|
public List<ReportReturnData> getAnimalHeatPie(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
AnimalHeatVo animalHeatVo = getAnimalHeatVo(map);
|
//查询数据并返回数据
|
return animalHeatService.getAnimalHeatPie(animalHeatVo);
|
}
|
|
/**
|
* 体温数据条件封装
|
* @param map
|
* @return
|
*/
|
private AnimalHeatVo getAnimalHeatVo(Map<String, Object> map) {
|
AnimalHeatVo animalHeatVo = new AnimalHeatVo();
|
if (null!=map.get("begTime")) {
|
animalHeatVo.setBegTime(map.get("begTime").toString());
|
}
|
if (null!=map.get("endTime")) {
|
animalHeatVo.setEndTime(map.get("endTime").toString());
|
}
|
if (null!=map.get("status")) {
|
animalHeatVo.setStatus(Integer.parseInt(map.get("status").toString()));
|
}
|
if (null!=map.get("timeDesc")) {
|
animalHeatVo.setTimeDesc(map.get("timeDesc").toString());
|
}
|
return animalHeatVo;
|
}
|
|
/**
|
* 获取包裹数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getParcelList")
|
public List<ParcelExcel> getParcelList(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
ConditionVo conditionVo = getConditionVo(map);
|
//查询数据并返回数据
|
List<ParcelExcel> parcelExcels = parcelService.exportParcel(conditionVo);
|
// List<ParcelExcel> parcelExcels = new ArrayList<>();
|
// ParcelExcel parcelExcel = new ParcelExcel();
|
// parcelExcel.setCheckMachineCode("ceshi");
|
// parcelExcel.setCheckMachineName("ceshi");
|
// parcelExcel.setCheckMachinePosition("ceshi");
|
// parcelExcel.setImgUrl("ceshi");
|
// parcelExcel.setDecisioDiagramResultDetails("ceshi");
|
// parcelExcels.add(parcelExcel);
|
// try {
|
// int time = 9000;
|
// System.out.println("休眠时间 = " + time);
|
// Thread.sleep(time);
|
// } catch (InterruptedException e) {
|
// e.printStackTrace();
|
// }
|
return parcelExcels;
|
}
|
|
/**
|
* 获取包裹数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getParcelPie")
|
public List<ReportReturnData> getParcelPie(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
ConditionVo conditionVo = getConditionVo(map);
|
//查询数据并返回数据
|
return null;
|
}
|
|
/**
|
* 封装conditionVo数据
|
* @param map
|
* @return
|
*/
|
private ConditionVo getConditionVo(Map<String, Object> map) {
|
ConditionVo conditionVo = new ConditionVo();
|
if (null!=map.get("startTime")) {
|
conditionVo.setStartTime(map.get("startTime").toString());
|
}
|
if (null!=map.get("endTime")) {
|
conditionVo.setEndTime(map.get("endTime").toString());
|
}
|
if (null!=map.get("decisioDiagramResult")) {
|
conditionVo.setDecisioDiagramResult(map.get("decisioDiagramResult").toString());
|
}
|
if (null!=map.get("timeDesc")) {
|
conditionVo.setTimeDesc(map.get("timeDesc").toString());
|
}
|
//返回
|
return conditionVo;
|
}
|
|
|
/**
|
* 获取违禁品数据集合
|
* @param body map集合数据
|
* @return
|
*/
|
@PostMapping("getParcelKindList")
|
public List<ParcelKindExcel> getParcelKindList(@RequestBody String body){
|
Map<String,Object> map = JSONObject.parseObject(body);
|
//创建对象,并封装数据
|
ConditionVo conditionVo = getConditionVo(map);
|
//查询数据并返回数据
|
List<ParcelKindExcel> excelList = parcelService.exportParcelKind(conditionVo);
|
return excelList;
|
}
|
}
|