代码提交
This commit is contained in:
1 parent
13990c058a
commit
8cd210fd20
381 files changed
+47550
No files matched your search
@@ -0,0 +1,113 @@
|
||||
package net.hzvtc.app.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* app在线更新对象 app_upgrade
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-05-19
|
||||
*/
|
||||
@Data
|
||||
@Alias("AppUpgrade")
|
||||
public class AppUpgrade {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
@Excel(name = "代码")
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
@Excel(name = "更新状态")
|
||||
private int updateStatus;
|
||||
|
||||
/**
|
||||
* 版本代码
|
||||
*/
|
||||
@Excel(name = "版本代码")
|
||||
private int versionCode;
|
||||
|
||||
/**
|
||||
* 版本名称
|
||||
*/
|
||||
@Excel(name = "版本名称")
|
||||
private String versionName;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 更新内容
|
||||
*/
|
||||
@Excel(name = "更新内容")
|
||||
private String modifyContent;
|
||||
|
||||
/**
|
||||
* 下载链接
|
||||
*/
|
||||
@Excel(name = "下载链接")
|
||||
private String downloadUrl;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@Excel(name = "文件大小")
|
||||
private int apkSize;
|
||||
|
||||
/**
|
||||
* md5值
|
||||
*/
|
||||
@Excel(name = "md5值")
|
||||
private String apkMd5;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@Excel(name = "消息")
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@Excel(name = "是否删除")
|
||||
private int isDeleted;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("updateStatus", getUpdateStatus())
|
||||
.append("versionCode", getVersionCode())
|
||||
.append("versionName", getVersionName())
|
||||
.append("uploadTime", getUploadTime())
|
||||
.append("modifyContent", getModifyContent())
|
||||
.append("downloadUrl", getDownloadUrl())
|
||||
.append("apkSize", getApkSize())
|
||||
.append("apkMd5", getApkMd5())
|
||||
.append("msg", getMsg())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.hzvtc.app.mapper;
|
||||
|
||||
import net.hzvtc.app.domain.AppUpgrade;
|
||||
|
||||
public interface AppUpgradeMapper {
|
||||
AppUpgrade getLastAppUpgradeInfo();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.hzvtc.app.service;
|
||||
|
||||
import net.hzvtc.app.domain.AppUpgrade;
|
||||
|
||||
public interface AppUpgradeService {
|
||||
AppUpgrade getLastAppUpgradeInfo();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.hzvtc.app.service.impl;
|
||||
|
||||
import net.hzvtc.app.domain.AppUpgrade;
|
||||
import net.hzvtc.app.mapper.AppUpgradeMapper;
|
||||
import net.hzvtc.app.service.AppUpgradeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class AppUpgradeServiceImpl implements AppUpgradeService {
|
||||
@Resource
|
||||
private AppUpgradeMapper appUpgradeMapper;
|
||||
|
||||
@Override
|
||||
public AppUpgrade getLastAppUpgradeInfo() {
|
||||
AppUpgrade data = appUpgradeMapper.getLastAppUpgradeInfo();
|
||||
// JSONObject obj = new JSONObject();
|
||||
// obj.put("Code", data.getCode());
|
||||
// obj.put("Msg", data.getMsg());
|
||||
// obj.put("UpdateStatus", data.getUpdateStatus());
|
||||
// obj.put("VersionCode", data.getVersionCode());
|
||||
// obj.put("VersionName", data.getVersionName());
|
||||
// obj.put("UploadTime", data.getUploadTime());
|
||||
// obj.put("ModifyContent", data.getModifyContent());
|
||||
// obj.put("DownloadUrl", data.getDownloadUrl());
|
||||
// obj.put("ApkSize", data.getApkSize());
|
||||
// obj.put("ApkMd5", data.getApkMd5());
|
||||
// System.out.println(obj.get("ModifyContent"));
|
||||
return data;
|
||||
}
|
||||
}
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
package net.hzvtc.area.controller;
|
||||
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
import net.hzvtc.area.service.ProtectedAreaService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.SecurityUtils;
|
||||
import net.hzvtc.common.utils.file.FileUploadUtils;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 保护区Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/area/protectedArea")
|
||||
public class ProtectedAreaController extends BaseController {
|
||||
@Autowired
|
||||
private ProtectedAreaService protectedAreaService;
|
||||
|
||||
@GetMapping("/listForPortal")
|
||||
public AjaxResult getProtectedAreaListForPortal() {
|
||||
return AjaxResult.success(protectedAreaService.getProtectedAreaListForPortal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询保护区列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('area:protectedArea:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProtectedArea protectedArea) {
|
||||
startPage();
|
||||
List<ProtectedArea> list = protectedAreaService.selectProtectedAreaList(protectedArea);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保护区列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:protectedArea:export')")
|
||||
@Log(title = "保护区", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProtectedArea protectedArea) {
|
||||
List<ProtectedArea> list = protectedAreaService.selectProtectedAreaList(protectedArea);
|
||||
ExcelUtil<ProtectedArea> util = new ExcelUtil<ProtectedArea>(ProtectedArea.class);
|
||||
util.exportExcel(response, list, "保护区数据");
|
||||
}
|
||||
|
||||
@GetMapping("/treeList")
|
||||
public AjaxResult getTreeList() {
|
||||
return AjaxResult.success(protectedAreaService.getProtectedAreaTreeList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保护区详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
if (checkAreaIsLegal(id)) {
|
||||
return AjaxResult.success(protectedAreaService.selectProtectedAreaById(id));
|
||||
} else {
|
||||
return AjaxResult.error(403, "非法访问未授权的保护区数据,请联系管理员开通权限!");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAreaIsLegal(Long areaId) {
|
||||
if (SecurityUtils.getLoginUser().getUser().isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
Set<Long> ids = SecurityUtils.getLoginUser().getAreaIds();
|
||||
if (ids == null || ids.size() == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return ids.contains(areaId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保护区
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:protectedArea:add')")
|
||||
@Log(title = "保护区", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProtectedArea protectedArea) {
|
||||
return toAjax(protectedAreaService.insertProtectedArea(protectedArea));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保护区
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:protectedArea:edit')")
|
||||
@Log(title = "保护区", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProtectedArea protectedArea) {
|
||||
return toAjax(protectedAreaService.updateProtectedArea(protectedArea));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保护区
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:protectedArea:remove')")
|
||||
@Log(title = "保护区", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(protectedAreaService.deleteProtectedAreaByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<ProtectedArea> util = new ExcelUtil<>(ProtectedArea.class);
|
||||
List<ProtectedArea> list = util.importExcel(file.getInputStream());
|
||||
String message = protectedAreaService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<ProtectedArea> util = new ExcelUtil<>(ProtectedArea.class);
|
||||
util.importTemplateExcel(response, "保护区信息");
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadFile(MultipartFile file) {
|
||||
|
||||
String baseDir = FileUploadUtils.getDefaultBaseDir() + "/" + "bgimg" + "/" + SecurityUtils.getDeptId();
|
||||
try {
|
||||
String filePath = FileUploadUtils.upload(baseDir, file);
|
||||
return AjaxResult.success(filePath);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
package net.hzvtc.area.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.area.domain.ProtectedAreaSpecies;
|
||||
import net.hzvtc.area.service.ProtectedAreaSpeciesService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.check.service.ResultRecordDetailsService;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保护区物种Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/area/areaSpecies")
|
||||
public class ProtectedAreaSpeciesController extends BaseController {
|
||||
@Autowired
|
||||
private ProtectedAreaSpeciesService protectedAreaSpeciesService;
|
||||
@Autowired
|
||||
private ResultRecordDetailsService resultRecordDetailsService;
|
||||
|
||||
/**
|
||||
* 查询保护区物种列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:areaSpecies:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
startPage();
|
||||
List<ProtectedAreaSpecies> list = protectedAreaSpeciesService.selectProtectedAreaSpeciesList(protectedAreaSpecies);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保护区物种列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:areaSpecies:export')")
|
||||
@Log(title = "保护区物种", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
List<ProtectedAreaSpecies> list = protectedAreaSpeciesService.selectProtectedAreaSpeciesList(protectedAreaSpecies);
|
||||
ExcelUtil<ProtectedAreaSpecies> util = new ExcelUtil<ProtectedAreaSpecies>(ProtectedAreaSpecies.class);
|
||||
util.exportExcel(response, list, "保护区物种数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保护区物种详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:areaSpecies:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(protectedAreaSpeciesService.selectProtectedAreaSpeciesById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保护区物种
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:areaSpecies:add')")
|
||||
@Log(title = "保护区物种", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
return toAjax(protectedAreaSpeciesService.batchInsertProtectedAreaSpecies(protectedAreaSpecies));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保护区物种
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:areaSpecies:edit')")
|
||||
@Log(title = "保护区物种", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
return toAjax(protectedAreaSpeciesService.updateProtectedAreaSpecies(protectedAreaSpecies));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保护区物种
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:areaSpecies:remove')")
|
||||
@Log(title = "保护区物种", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(protectedAreaSpeciesService.deleteProtectedAreaSpeciesByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<ProtectedAreaSpecies> util = new ExcelUtil<>(ProtectedAreaSpecies.class);
|
||||
List<ProtectedAreaSpecies> list = util.importExcel(file.getInputStream());
|
||||
String message = protectedAreaSpeciesService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<ProtectedAreaSpecies> util = new ExcelUtil<>(ProtectedAreaSpecies.class);
|
||||
util.importTemplateExcel(response, "保护区鸟类信息");
|
||||
}
|
||||
|
||||
@PostMapping("/listSpeciesByParam")
|
||||
public AjaxResult getSpeciesListByAreacode(@RequestBody JSONObject obj) {
|
||||
return AjaxResult.success(protectedAreaSpeciesService.getProtectedAreaSpeciesListByParam(obj));
|
||||
}
|
||||
|
||||
@PostMapping("/querySpeciesByQuery")
|
||||
public TableDataInfo querySpeciesListByQuery(@RequestBody JSONObject obj) {
|
||||
// Integer pageNum = obj.getInteger("pageNum");
|
||||
// Integer pageSize = obj.getInteger("pageSize");
|
||||
// startPage(pageNum, pageSize);
|
||||
// List<ProtectedAreaSpecies> list = protectedAreaSpeciesService.getProtectedAreaSpeciesByQuery(obj);
|
||||
return protectedAreaSpeciesService.getProtectedAreaSpeciesByQuery(obj);
|
||||
}
|
||||
|
||||
@PostMapping("/querySpeciesByParam")
|
||||
public TableDataInfo getBirdResultMediasByParam(@RequestBody JSONObject params) {
|
||||
Integer pageNum = params.getInteger("pageNum");
|
||||
Integer pageSize = params.getInteger("pageSize");
|
||||
startPage(pageNum, pageSize);
|
||||
List<BirdStatDataVo> list = resultRecordDetailsService.querySpeciesRecordListByParam(params);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/queryVideoListByParam")
|
||||
public TableDataInfo getBirdVidelByParam(@RequestBody JSONObject params) {
|
||||
Integer pageNum = params.getInteger("pageNum");
|
||||
Integer pageSize = params.getInteger("pageSize");
|
||||
startPage(pageNum, pageSize);
|
||||
List<BirdStatDataVo> list = resultRecordDetailsService.getResultMediaVideoListByParam(params);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/areaSpeciesByParam")
|
||||
public AjaxResult getProtectedAreaSpeciesByParam(@RequestBody JSONObject params) {
|
||||
return AjaxResult.success(protectedAreaSpeciesService.getProtectedAreaSpeciesListByParams(params));
|
||||
}
|
||||
|
||||
@PostMapping("/changeSpeciesInArea")
|
||||
public AjaxResult changeProtectedAreaSpeciesByParam(@RequestBody JSONObject params) {
|
||||
return AjaxResult.success(protectedAreaSpeciesService.changeProtectedAreaSpeciesByParam(params));
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package net.hzvtc.area.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.ProtectedCareSpecies;
|
||||
import net.hzvtc.area.service.ProtectedCareSpeciesService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 保护区关注鸟类Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/area/care")
|
||||
public class ProtectedCareSpeciesController extends BaseController {
|
||||
@Autowired
|
||||
private ProtectedCareSpeciesService protectedCareSpeciesService;
|
||||
|
||||
/**
|
||||
* 查询保护区关注鸟类列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public AjaxResult list(@RequestBody JSONObject params) {
|
||||
return AjaxResult.success(protectedCareSpeciesService.selectProtectedCareSpeciesList(params));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保护区关注鸟类详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:care:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(protectedCareSpeciesService.selectProtectedCareSpeciesById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保护区关注鸟类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:care:add')")
|
||||
@Log(title = "保护区关注鸟类", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProtectedCareSpecies protectedCareSpecies) {
|
||||
return toAjax(protectedCareSpeciesService.insertProtectedCareSpecies(protectedCareSpecies));
|
||||
}
|
||||
|
||||
@PostMapping("/changeCareSpeciesInArea")
|
||||
public AjaxResult changeProtectedAreaCareSpeciesByParam(@RequestBody JSONObject params) {
|
||||
return AjaxResult.success(protectedCareSpeciesService.changeProtectedAreaCareSpeciesByParam(params));
|
||||
}
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package net.hzvtc.area.controller;
|
||||
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.area.service.SpeciesAbnormalInfoService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 关键物种与异常事件报警Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/area/abnormalInfo")
|
||||
public class SpeciesAbnormalInfoController extends BaseController {
|
||||
@Autowired
|
||||
private SpeciesAbnormalInfoService speciesAbnormalInfoService;
|
||||
|
||||
/**
|
||||
* 查询关键物种与异常事件报警列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SpeciesAbnormalInfo speciesAbnormalInfo) {
|
||||
startPage();
|
||||
List<SpeciesAbnormalInfo> list = speciesAbnormalInfoService.selectSpeciesAbnormalInfoList(speciesAbnormalInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出关键物种与异常事件报警列表
|
||||
*/
|
||||
@Log(title = "关键物种与异常事件报警", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SpeciesAbnormalInfo speciesAbnormalInfo) {
|
||||
List<SpeciesAbnormalInfo> list = speciesAbnormalInfoService.selectSpeciesAbnormalInfoList(speciesAbnormalInfo);
|
||||
ExcelUtil<SpeciesAbnormalInfo> util = new ExcelUtil<SpeciesAbnormalInfo>(SpeciesAbnormalInfo.class);
|
||||
util.exportExcel(response, list, "关键物种与异常事件报警数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关键物种与异常事件报警详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(speciesAbnormalInfoService.selectSpeciesAbnormalInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关键物种与异常事件报警
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:abnormalInfo:add')")
|
||||
@Log(title = "关键物种与异常事件报警", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SpeciesAbnormalInfo speciesAbnormalInfo) {
|
||||
return toAjax(speciesAbnormalInfoService.insertSpeciesAbnormalInfo(speciesAbnormalInfo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除关键物种与异常事件报警
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:abnormalInfo:remove')")
|
||||
@Log(title = "关键物种与异常事件报警", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(speciesAbnormalInfoService.deleteSpeciesAbnormalInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package net.hzvtc.area.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.WinteringPeriod;
|
||||
import net.hzvtc.area.service.WinteringPeriodService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 越冬期Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/area/winterperiod")
|
||||
public class WinteringPeriodController extends BaseController {
|
||||
@Autowired
|
||||
private WinteringPeriodService winteringPeriodService;
|
||||
|
||||
/**
|
||||
* 查询越冬期列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:winterperiod:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WinteringPeriod winteringPeriod) {
|
||||
startPage();
|
||||
List<WinteringPeriod> list = winteringPeriodService.selectWinteringPeriodList(winteringPeriod);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出越冬期列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:winterperiod:export')")
|
||||
@Log(title = "越冬期", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WinteringPeriod winteringPeriod) {
|
||||
List<WinteringPeriod> list = winteringPeriodService.selectWinteringPeriodList(winteringPeriod);
|
||||
ExcelUtil<WinteringPeriod> util = new ExcelUtil<WinteringPeriod>(WinteringPeriod.class);
|
||||
util.exportExcel(response, list, "越冬期数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取越冬期详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:winterperiod:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(winteringPeriodService.selectWinteringPeriodById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增越冬期
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:winterperiod:add')")
|
||||
@Log(title = "越冬期", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WinteringPeriod winteringPeriod) {
|
||||
return toAjax(winteringPeriodService.insertWinteringPeriod(winteringPeriod));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改越冬期
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:winterperiod:edit')")
|
||||
@Log(title = "越冬期", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WinteringPeriod winteringPeriod) {
|
||||
return toAjax(winteringPeriodService.updateWinteringPeriod(winteringPeriod));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除越冬期
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('area:winterperiod:remove')")
|
||||
@Log(title = "越冬期", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(winteringPeriodService.deleteWinteringPeriodByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/chartList")
|
||||
public AjaxResult getWinterPeriodChartData(@RequestBody JSONObject obj) {
|
||||
return AjaxResult.success(winteringPeriodService.getWinteringPeriodDataList(obj));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package net.hzvtc.area.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import net.hzvtc.device.domain.DeviceInfo;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保护区对象 protected_area
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
@Data
|
||||
@Alias("ProtectedArea")
|
||||
public class ProtectedArea extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 保护区id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "保护区编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 保护区名称
|
||||
*/
|
||||
@Excel(name = "保护区名称")
|
||||
private String name;
|
||||
|
||||
@Excel(name = "简称")
|
||||
private String shortName;
|
||||
|
||||
@Excel(name = "大屏地址")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 保护区所在省份
|
||||
*/
|
||||
@Excel(name = "所在省份")
|
||||
private String province;
|
||||
|
||||
@Excel(name = "所在省份名称")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 保护区级别
|
||||
*/
|
||||
@Excel(name = "级别", readConverterExp = "1=国家级,2=省级,3=市县级")
|
||||
private String areaLevel;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Excel(name = "经度")
|
||||
private String lon;
|
||||
|
||||
/**
|
||||
* 维度
|
||||
*/
|
||||
@Excel(name = "维度")
|
||||
private String lat;
|
||||
|
||||
@Excel(name = "联系人")
|
||||
private String manager;
|
||||
|
||||
@Excel(name = "联系电话")
|
||||
private String telephone;
|
||||
|
||||
@Excel(name = "是否需要发邮件")
|
||||
private int sendEmail = 0;
|
||||
|
||||
@Excel(name = "电子邮件")
|
||||
private String email;
|
||||
|
||||
private int picWidth;
|
||||
|
||||
private int picHeight;
|
||||
|
||||
private int picNum;
|
||||
|
||||
private String bannerFile;
|
||||
|
||||
private String gisFile;
|
||||
/**
|
||||
* 保护区简介
|
||||
*/
|
||||
@Excel(name = "保护区简介")
|
||||
private String introduction;
|
||||
|
||||
private List<DeviceInfo> deviceList;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("province", getProvince())
|
||||
.append("areaLevel", getAreaLevel())
|
||||
.append("introduction", getIntroduction())
|
||||
.append("lon", getLon())
|
||||
.append("lat", getLat())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.hzvtc.area.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保护区物种对象 protected_area_species
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
@Data
|
||||
@Alias("ProtectedAreaSpecies")
|
||||
public class ProtectedAreaSpecies extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 物种id
|
||||
*/
|
||||
private Long speciesId;
|
||||
|
||||
@Excel(name = "物种名称")
|
||||
private String speciesName;
|
||||
|
||||
/**
|
||||
* 保护区id
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
@Excel(name = "保护区名称")
|
||||
private String areaName;
|
||||
|
||||
private int position = 0;
|
||||
|
||||
private BirdSpecies birdSpecies;
|
||||
|
||||
/**
|
||||
* 是否常见
|
||||
*/
|
||||
@Excel(name = "是否常见", readConverterExp = "1=是,0=否")
|
||||
private int isCommon;
|
||||
|
||||
private int isSpecial;
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("areaId", getAreaId())
|
||||
.append("isCommon", getIsCommon())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("isDelete", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.hzvtc.area.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 保护区关注鸟类对象 protected_care_species
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-16
|
||||
*/
|
||||
@Data
|
||||
@Alias("ProtectedCareSpecies")
|
||||
public class ProtectedCareSpecies {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 鸟类ID
|
||||
*/
|
||||
@Excel(name = "鸟类ID")
|
||||
private Long speciesId;
|
||||
|
||||
/**
|
||||
* 保护区ID
|
||||
*/
|
||||
@Excel(name = "保护区ID")
|
||||
private Long areaId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("areaId", getAreaId())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.hzvtc.area.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 关键物种与异常事件报警对象 species_abnormal_info
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-10
|
||||
*/
|
||||
@Data
|
||||
@Alias("SpeciesAbnormalInfo")
|
||||
public class SpeciesAbnormalInfo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备来源
|
||||
*/
|
||||
@Excel(name = "设备来源")
|
||||
private Long deviceId;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
private Long areaId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 发生时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "发生时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date happenTime;
|
||||
|
||||
/**
|
||||
* 物种ID
|
||||
*/
|
||||
@Excel(name = "物种ID")
|
||||
private Long speciesId;
|
||||
|
||||
private String speciesName;
|
||||
|
||||
private String speciesImageUrl;
|
||||
|
||||
private int count;
|
||||
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* 媒体ID
|
||||
*/
|
||||
private Long mediaId;
|
||||
|
||||
private Long recordId;
|
||||
|
||||
private String mediaUrl;
|
||||
|
||||
private ResultMedia resultMedia;
|
||||
|
||||
|
||||
private int isDeleted;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("happenTime", getHappenTime())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("mediaId", getMediaId())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package net.hzvtc.area.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 越冬期对象 wintering_period
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
@Data
|
||||
@Alias("WinteringPeriod")
|
||||
public class WinteringPeriod {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保护区id
|
||||
*/
|
||||
@Excel(name = "保护区id")
|
||||
private Long protectedAreaId;
|
||||
|
||||
@Excel(name = "保护区名称")
|
||||
private String protectedAreaName;
|
||||
|
||||
/**
|
||||
* 年份
|
||||
*/
|
||||
@Excel(name = "年份")
|
||||
private String year;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 鸟类数量
|
||||
*/
|
||||
@Excel(name = "鸟类数量")
|
||||
private int amount;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("protectedAreaId", getProtectedAreaId())
|
||||
.append("year", getYear())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("amount", getAmount())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package net.hzvtc.area.mapper;
|
||||
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保护区Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
public interface ProtectedAreaMapper {
|
||||
/**
|
||||
* 查询保护区
|
||||
*
|
||||
* @param id 保护区主键
|
||||
* @return 保护区
|
||||
*/
|
||||
public ProtectedArea selectProtectedAreaById(Long id);
|
||||
|
||||
ProtectedArea selectProtectedAreaByCode(String code);
|
||||
|
||||
ProtectedArea selectProtectedAreaByName(String name);
|
||||
|
||||
/**
|
||||
* 查询保护区列表
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 保护区集合
|
||||
*/
|
||||
public List<ProtectedArea> selectProtectedAreaList(ProtectedArea protectedArea);
|
||||
|
||||
public List<ProtectedArea> getProtectedAreaTreeList(Map<String, Object> params);
|
||||
|
||||
public List<ProtectedArea> getAllProtectedAreaList();
|
||||
|
||||
public List<ProtectedArea> getProtectedAreaListByUserId(Map<String, Object> params);
|
||||
|
||||
List<ProtectedArea> getProtectedAreaEmailList();
|
||||
|
||||
List<Long> getAreaIdsByUserId(Long userId);
|
||||
|
||||
List<ProtectedArea> getAreaListForSelect();
|
||||
|
||||
List<ProtectedArea> getAreaListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 新增保护区
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProtectedArea(ProtectedArea protectedArea);
|
||||
|
||||
/**
|
||||
* 修改保护区
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProtectedArea(ProtectedArea protectedArea);
|
||||
|
||||
/**
|
||||
* 删除保护区
|
||||
*
|
||||
* @param id 保护区主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProtectedAreaById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除保护区
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProtectedAreaByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package net.hzvtc.area.mapper;
|
||||
|
||||
import net.hzvtc.area.domain.ProtectedAreaSpecies;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保护区物种Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
public interface ProtectedAreaSpeciesMapper {
|
||||
/**
|
||||
* 查询保护区物种
|
||||
*
|
||||
* @param id 保护区物种主键
|
||||
* @return 保护区物种
|
||||
*/
|
||||
ProtectedAreaSpecies selectProtectedAreaSpeciesById(Long id);
|
||||
|
||||
ProtectedAreaSpecies selectProtectedAreaSpeciesByParam(ProtectedAreaSpecies param);
|
||||
|
||||
/**
|
||||
* 查询保护区物种列表
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 保护区物种集合
|
||||
*/
|
||||
List<ProtectedAreaSpecies> selectProtectedAreaSpeciesList(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
List<Long> getProtectedAreaSpeciesListByParams(Map<String, Object> map);
|
||||
|
||||
List<ProtectedAreaSpecies> getProtectedAreaSpeciesListByParam(Map<String, Object> map);
|
||||
|
||||
List<ProtectedAreaSpecies> getProtectedAreaSpeciesByQuery(Map<String, Object> map);
|
||||
|
||||
List<Long> getProtectedAreaSpeciesIdsByParam(Map<String, Object> map);
|
||||
|
||||
List<BirdStatDataVo> getProtectedAreaSpeciesListByAreaId(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 新增保护区物种
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 结果
|
||||
*/
|
||||
int insertProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
int batchInsertProtectedAreaSpecies(List<ProtectedAreaSpecies> list);
|
||||
|
||||
/**
|
||||
* 修改保护区物种
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 结果
|
||||
*/
|
||||
int updateProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
void batchUpdateProtectedAreaSpecies(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 删除保护区物种
|
||||
*
|
||||
* @param id 保护区物种主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteProtectedAreaSpeciesById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除保护区物种
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteProtectedAreaSpeciesByIds(Long[] ids);
|
||||
|
||||
int deleteProtectedAreaSpeciesByParam(Map<String, Object> map);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.hzvtc.area.mapper;
|
||||
|
||||
import net.hzvtc.area.domain.ProtectedCareSpecies;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保护区关注鸟类Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-16
|
||||
*/
|
||||
public interface ProtectedCareSpeciesMapper {
|
||||
/**
|
||||
* 查询保护区关注鸟类
|
||||
*
|
||||
* @param id 保护区关注鸟类主键
|
||||
* @return 保护区关注鸟类
|
||||
*/
|
||||
public ProtectedCareSpecies selectProtectedCareSpeciesById(Long id);
|
||||
|
||||
/**
|
||||
* 查询保护区关注鸟类列表
|
||||
*
|
||||
* @param map 保护区关注鸟类
|
||||
* @return 保护区关注鸟类集合
|
||||
*/
|
||||
List<Long> selectProtectedCareSpeciesList(Map<String, Object> map);
|
||||
|
||||
List<Long> getProtectedCareSpeciesByParam(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 新增保护区关注鸟类
|
||||
*
|
||||
* @param protectedCareSpecies 保护区关注鸟类
|
||||
* @return 结果
|
||||
*/
|
||||
int insertProtectedCareSpecies(ProtectedCareSpecies protectedCareSpecies);
|
||||
|
||||
|
||||
/**
|
||||
* 删除保护区关注鸟类
|
||||
*
|
||||
* @param map 保护区关注鸟类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProtectedCareSpeciesById(Map<String, Object> map);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.hzvtc.area.mapper;
|
||||
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.system.domain.vo.MessageVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 关键物种与异常事件报警Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-10
|
||||
*/
|
||||
public interface SpeciesAbnormalInfoMapper {
|
||||
/**
|
||||
* 查询关键物种与异常事件报警
|
||||
*
|
||||
* @param id 关键物种与异常事件报警主键
|
||||
* @return 关键物种与异常事件报警
|
||||
*/
|
||||
public SpeciesAbnormalInfo selectSpeciesAbnormalInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询关键物种与异常事件报警列表
|
||||
*
|
||||
* @param speciesAbnormalInfo 关键物种与异常事件报警
|
||||
* @return 关键物种与异常事件报警集合
|
||||
*/
|
||||
public List<SpeciesAbnormalInfo> selectSpeciesAbnormalInfoList(SpeciesAbnormalInfo speciesAbnormalInfo);
|
||||
|
||||
SpeciesAbnormalInfo getLatestSpeciesAbnormalInfo(Long userId);
|
||||
|
||||
int getSpeciesAbnormalInfoCountByUserId(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 新增关键物种与异常事件报警
|
||||
*
|
||||
* @param speciesAbnormalInfo 关键物种与异常事件报警
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSpeciesAbnormalInfo(SpeciesAbnormalInfo speciesAbnormalInfo);
|
||||
|
||||
int batchInsertSpeciesAbnormalInfo(List<SpeciesAbnormalInfo> list);
|
||||
|
||||
/**
|
||||
* 删除关键物种与异常事件报警
|
||||
*
|
||||
* @param id 关键物种与异常事件报警主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSpeciesAbnormalInfoById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除关键物种与异常事件报警
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSpeciesAbnormalInfoByIds(Long[] ids);
|
||||
|
||||
List<MessageVo> getSpeciesAbnormalInfoListByParam(Map<String, Object> map);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.hzvtc.area.mapper;
|
||||
|
||||
import net.hzvtc.area.domain.WinteringPeriod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 越冬期Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
public interface WinteringPeriodMapper {
|
||||
/**
|
||||
* 查询越冬期
|
||||
*
|
||||
* @param id 越冬期主键
|
||||
* @return 越冬期
|
||||
*/
|
||||
public WinteringPeriod selectWinteringPeriodById(Long id);
|
||||
|
||||
/**
|
||||
* 查询越冬期列表
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 越冬期集合
|
||||
*/
|
||||
public List<WinteringPeriod> selectWinteringPeriodList(WinteringPeriod winteringPeriod);
|
||||
|
||||
List<WinteringPeriod> getWinteringPeriodDataList(WinteringPeriod param);
|
||||
|
||||
/**
|
||||
* 新增越冬期
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWinteringPeriod(WinteringPeriod winteringPeriod);
|
||||
|
||||
/**
|
||||
* 修改越冬期
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWinteringPeriod(WinteringPeriod winteringPeriod);
|
||||
|
||||
/**
|
||||
* 删除越冬期
|
||||
*
|
||||
* @param id 越冬期主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWinteringPeriodById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除越冬期
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWinteringPeriodByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package net.hzvtc.area.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保护区Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
public interface ProtectedAreaService {
|
||||
/**
|
||||
* 查询保护区
|
||||
*
|
||||
* @param id 保护区主键
|
||||
* @return 保护区
|
||||
*/
|
||||
public ProtectedArea selectProtectedAreaById(Long id);
|
||||
|
||||
ProtectedArea selectProtectedAreaByName(String name);
|
||||
|
||||
public List<ProtectedArea> getProtectedAreaListForPortal();
|
||||
|
||||
/**
|
||||
* 查询保护区列表
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 保护区集合
|
||||
*/
|
||||
public List<ProtectedArea> selectProtectedAreaList(ProtectedArea protectedArea);
|
||||
|
||||
public List<ProtectedArea> getProtectedAreaTreeList();
|
||||
|
||||
/**
|
||||
* 新增保护区
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProtectedArea(ProtectedArea protectedArea);
|
||||
|
||||
/**
|
||||
* 修改保护区
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProtectedArea(ProtectedArea protectedArea);
|
||||
|
||||
/**
|
||||
* 批量删除保护区
|
||||
*
|
||||
* @param ids 需要删除的保护区主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProtectedAreaByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除保护区信息
|
||||
*
|
||||
* @param id 保护区主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProtectedAreaById(Long id);
|
||||
|
||||
String importData(List<ProtectedArea> list, boolean updateSupport);
|
||||
|
||||
List<ProtectedArea> getProtectedAreaEmailList();
|
||||
|
||||
ProtectedArea selectProtectedAreaByCode(String code);
|
||||
|
||||
List<ProtectedArea> getAreaListForSelect();
|
||||
|
||||
List<Long> getAreaIdsByUserId(Long userId);
|
||||
|
||||
List<JSONObject> getAreaListByUserId(Long userId);
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package net.hzvtc.area.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.ProtectedAreaSpecies;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保护区物种Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
public interface ProtectedAreaSpeciesService {
|
||||
/**
|
||||
* 查询保护区物种
|
||||
*
|
||||
* @param id 保护区物种主键
|
||||
* @return 保护区物种
|
||||
*/
|
||||
ProtectedAreaSpecies selectProtectedAreaSpeciesById(Long id);
|
||||
|
||||
/**
|
||||
* 查询保护区物种列表
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 保护区物种集合
|
||||
*/
|
||||
List<ProtectedAreaSpecies> selectProtectedAreaSpeciesList(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
/**
|
||||
* 新增保护区物种
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 结果
|
||||
*/
|
||||
int batchInsertProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
int insertProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
|
||||
/**
|
||||
* 修改保护区物种
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 结果
|
||||
*/
|
||||
int updateProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies);
|
||||
|
||||
/**
|
||||
* 批量删除保护区物种
|
||||
*
|
||||
* @param ids 需要删除的保护区物种主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteProtectedAreaSpeciesByIds(Long[] ids);
|
||||
|
||||
List<ProtectedAreaSpecies> getProtectedAreaSpeciesListByParam(JSONObject obj);
|
||||
|
||||
/**
|
||||
* 删除保护区物种信息
|
||||
*
|
||||
* @param id 保护区物种主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteProtectedAreaSpeciesById(Long id);
|
||||
|
||||
String importData(List<ProtectedAreaSpecies> list, boolean updateSupport);
|
||||
|
||||
TableDataInfo getProtectedAreaSpeciesByQuery(JSONObject param);
|
||||
|
||||
List<Long> getProtectedAreaSpeciesListByParams(JSONObject param);
|
||||
|
||||
int changeProtectedAreaSpeciesByParam(JSONObject param);
|
||||
|
||||
List<BirdStatDataVo> getProtectedAreaSpeciesListByAreaId(Map<String, Object> map);
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package net.hzvtc.area.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.ProtectedCareSpecies;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保护区关注鸟类Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-16
|
||||
*/
|
||||
public interface ProtectedCareSpeciesService {
|
||||
/**
|
||||
* 查询保护区关注鸟类
|
||||
*
|
||||
* @param id 保护区关注鸟类主键
|
||||
* @return 保护区关注鸟类
|
||||
*/
|
||||
public ProtectedCareSpecies selectProtectedCareSpeciesById(Long id);
|
||||
|
||||
/**
|
||||
* 查询保护区关注鸟类列表
|
||||
*
|
||||
* @param param 保护区关注鸟类
|
||||
* @return 保护区关注鸟类集合
|
||||
*/
|
||||
public List<Long> selectProtectedCareSpeciesList(JSONObject param);
|
||||
|
||||
/**
|
||||
* 新增保护区关注鸟类
|
||||
*
|
||||
* @param protectedCareSpecies 保护区关注鸟类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProtectedCareSpecies(ProtectedCareSpecies protectedCareSpecies);
|
||||
|
||||
|
||||
int changeProtectedAreaCareSpeciesByParam(JSONObject param);
|
||||
|
||||
List<Long> getProtectedCareSpeciesByParam(Map<String, Object> map);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.hzvtc.area.service;
|
||||
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.system.domain.vo.MessageVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 关键物种与异常事件报警Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-10
|
||||
*/
|
||||
public interface SpeciesAbnormalInfoService {
|
||||
/**
|
||||
* 查询关键物种与异常事件报警
|
||||
*
|
||||
* @param id 关键物种与异常事件报警主键
|
||||
* @return 关键物种与异常事件报警
|
||||
*/
|
||||
public SpeciesAbnormalInfo selectSpeciesAbnormalInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询关键物种与异常事件报警列表
|
||||
*
|
||||
* @param speciesAbnormalInfo 关键物种与异常事件报警
|
||||
* @return 关键物种与异常事件报警集合
|
||||
*/
|
||||
public List<SpeciesAbnormalInfo> selectSpeciesAbnormalInfoList(SpeciesAbnormalInfo speciesAbnormalInfo);
|
||||
|
||||
/**
|
||||
* 新增关键物种与异常事件报警
|
||||
*
|
||||
* @param speciesAbnormalInfo 关键物种与异常事件报警
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSpeciesAbnormalInfo(SpeciesAbnormalInfo speciesAbnormalInfo);
|
||||
|
||||
/**
|
||||
* 批量删除关键物种与异常事件报警
|
||||
*
|
||||
* @param ids 需要删除的关键物种与异常事件报警主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSpeciesAbnormalInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除关键物种与异常事件报警信息
|
||||
*
|
||||
* @param id 关键物种与异常事件报警主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSpeciesAbnormalInfoById(Long id);
|
||||
|
||||
void getDailyLevelOneSpecieResult();
|
||||
|
||||
void getAllLevelOneSpecieResult();
|
||||
|
||||
SpeciesAbnormalInfo getLatestSpeciesAbnormalInfo(Long userId);
|
||||
|
||||
int getSpeciesAbnormalInfoCountByUserId(Map<String, Object> map);
|
||||
|
||||
List<MessageVo> getSpeciesAbnormalInfoListByParam();
|
||||
|
||||
void getSpeciesAbnormalInfoListForJob();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.hzvtc.area.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.WinteringPeriod;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 越冬期Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
public interface WinteringPeriodService {
|
||||
/**
|
||||
* 查询越冬期
|
||||
*
|
||||
* @param id 越冬期主键
|
||||
* @return 越冬期
|
||||
*/
|
||||
public WinteringPeriod selectWinteringPeriodById(Long id);
|
||||
|
||||
/**
|
||||
* 查询越冬期列表
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 越冬期集合
|
||||
*/
|
||||
public List<WinteringPeriod> selectWinteringPeriodList(WinteringPeriod winteringPeriod);
|
||||
|
||||
/**
|
||||
* 新增越冬期
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWinteringPeriod(WinteringPeriod winteringPeriod);
|
||||
|
||||
/**
|
||||
* 修改越冬期
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWinteringPeriod(WinteringPeriod winteringPeriod);
|
||||
|
||||
/**
|
||||
* 批量删除越冬期
|
||||
*
|
||||
* @param ids 需要删除的越冬期主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWinteringPeriodByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除越冬期信息
|
||||
*
|
||||
* @param id 越冬期主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWinteringPeriodById(Long id);
|
||||
|
||||
List<BirdStatDataVo> getWinteringPeriodDataList(JSONObject param);
|
||||
}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
package net.hzvtc.area.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
import net.hzvtc.area.mapper.ProtectedAreaMapper;
|
||||
import net.hzvtc.area.service.ProtectedAreaService;
|
||||
import net.hzvtc.common.exception.ServiceException;
|
||||
import net.hzvtc.common.utils.DateUtils;
|
||||
import net.hzvtc.common.utils.SecurityUtils;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.common.utils.bean.BeanValidators;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 保护区Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ProtectedAreaServiceImpl implements ProtectedAreaService {
|
||||
// private static final Logger log = LoggerFactory.getLogger(ProtectedAreaServiceImpl.class);
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
@Resource
|
||||
private ProtectedAreaMapper protectedAreaMapper;
|
||||
|
||||
/**
|
||||
* 查询保护区
|
||||
*
|
||||
* @param id 保护区主键
|
||||
* @return 保护区
|
||||
*/
|
||||
@Override
|
||||
public ProtectedArea selectProtectedAreaById(Long id) {
|
||||
return protectedAreaMapper.selectProtectedAreaById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedArea selectProtectedAreaByName(String name) {
|
||||
return protectedAreaMapper.selectProtectedAreaByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProtectedArea> getProtectedAreaListForPortal() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId <= 1L) {
|
||||
return protectedAreaMapper.getAllProtectedAreaList();
|
||||
} else {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
return protectedAreaMapper.getProtectedAreaListByUserId(map);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询保护区列表
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 保护区
|
||||
*/
|
||||
@Override
|
||||
public List<ProtectedArea> selectProtectedAreaList(ProtectedArea protectedArea) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId > 1L) {
|
||||
protectedArea.setId(userId);
|
||||
} else {
|
||||
protectedArea.setId(null);
|
||||
}
|
||||
return protectedAreaMapper.selectProtectedAreaList(protectedArea);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProtectedArea> getProtectedAreaTreeList() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId > 1L) {
|
||||
map.put("userId", userId);
|
||||
}
|
||||
return protectedAreaMapper.getProtectedAreaTreeList(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保护区
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProtectedArea(ProtectedArea protectedArea) {
|
||||
protectedArea.setCreateTime(DateUtils.getNowDate());
|
||||
if (protectedArea.getShortName() == null || protectedArea.getShortName().isEmpty()) {
|
||||
protectedArea.setShortName(protectedArea.getName());
|
||||
}
|
||||
return protectedAreaMapper.insertProtectedArea(protectedArea);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保护区
|
||||
*
|
||||
* @param protectedArea 保护区
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProtectedArea(ProtectedArea protectedArea) {
|
||||
if (protectedArea.getShortName() == null || protectedArea.getShortName().isEmpty()) {
|
||||
protectedArea.setShortName(protectedArea.getName());
|
||||
}
|
||||
return protectedAreaMapper.updateProtectedArea(protectedArea);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除保护区
|
||||
*
|
||||
* @param ids 需要删除的保护区主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProtectedAreaByIds(Long[] ids) {
|
||||
return protectedAreaMapper.deleteProtectedAreaByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保护区信息
|
||||
*
|
||||
* @param id 保护区主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProtectedAreaById(Long id) {
|
||||
return protectedAreaMapper.deleteProtectedAreaById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importData(List<ProtectedArea> list, boolean updateSupport) {
|
||||
if (StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入保护区数据不能为空!");
|
||||
}
|
||||
AtomicInteger[] successNum = {new AtomicInteger()};
|
||||
int[] failureNum = {0};
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
list.forEach(data -> {
|
||||
try {
|
||||
ProtectedArea protectedArea = protectedAreaMapper.selectProtectedAreaByName(data.getName());
|
||||
if (Objects.isNull(protectedArea)) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setIsDeleted(0);
|
||||
insertProtectedArea(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、保护区 " + data.getName() + " 导入成功");
|
||||
} else if (updateSupport) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setId(protectedArea.getId());
|
||||
updateProtectedArea(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、保护区 " + data.getName() + " 更新成功");
|
||||
} else {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、保护区 " + data.getName() + " 已存在");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
failureNum[0]++;
|
||||
String msg = "<br/>" + failureNum + "、保护区 " + data.getName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
});
|
||||
if (failureNum[0] > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum[0] + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProtectedArea> getProtectedAreaEmailList() {
|
||||
return protectedAreaMapper.getProtectedAreaEmailList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedArea selectProtectedAreaByCode(String code) {
|
||||
return protectedAreaMapper.selectProtectedAreaByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProtectedArea> getAreaListForSelect() {
|
||||
return protectedAreaMapper.getAreaListForSelect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getAreaIdsByUserId(Long userId) {
|
||||
return protectedAreaMapper.getAreaIdsByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getAreaListByUserId(Long userId) {
|
||||
if (userId <= 1L) {
|
||||
userId = null;
|
||||
}
|
||||
List<ProtectedArea> list = protectedAreaMapper.getAreaListByUserId(userId);
|
||||
List<JSONObject> objectList = list.stream().map((item -> {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id", item.getId());
|
||||
obj.put("name", item.getName());
|
||||
obj.put("provinceName", item.getProvinceName());
|
||||
obj.put("code", item.getProvince());
|
||||
obj.put("lat", item.getLat());
|
||||
obj.put("lon", item.getLon());
|
||||
return obj;
|
||||
})).collect(Collectors.toList());
|
||||
return objectList;
|
||||
}
|
||||
}
|
||||
+319
@@ -0,0 +1,319 @@
|
||||
package net.hzvtc.area.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
import net.hzvtc.area.domain.ProtectedAreaSpecies;
|
||||
import net.hzvtc.area.mapper.ProtectedAreaSpeciesMapper;
|
||||
import net.hzvtc.area.service.ProtectedAreaService;
|
||||
import net.hzvtc.area.service.ProtectedAreaSpeciesService;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.bird.service.BirdSpeciesService;
|
||||
import net.hzvtc.common.constant.HttpStatus;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.exception.ServiceException;
|
||||
import net.hzvtc.common.utils.DateUtils;
|
||||
import net.hzvtc.common.utils.PageUtils;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.common.utils.bean.BeanValidators;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 保护区物种Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-20
|
||||
*/
|
||||
@Service
|
||||
public class ProtectedAreaSpeciesServiceImpl implements ProtectedAreaSpeciesService {
|
||||
private static final Logger log = LoggerFactory.getLogger(ProtectedAreaServiceImpl.class);
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
@Resource
|
||||
private ProtectedAreaSpeciesMapper protectedAreaSpeciesMapper;
|
||||
@Autowired
|
||||
private ProtectedAreaService protectedAreaService;
|
||||
@Autowired
|
||||
private BirdSpeciesService birdSpeciesService;
|
||||
|
||||
/**
|
||||
* 查询保护区物种
|
||||
*
|
||||
* @param id 保护区物种主键
|
||||
* @return 保护区物种
|
||||
*/
|
||||
@Override
|
||||
public ProtectedAreaSpecies selectProtectedAreaSpeciesById(Long id) {
|
||||
return protectedAreaSpeciesMapper.selectProtectedAreaSpeciesById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询保护区物种列表
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 保护区物种
|
||||
*/
|
||||
@Override
|
||||
public List<ProtectedAreaSpecies> selectProtectedAreaSpeciesList(ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
return protectedAreaSpeciesMapper.selectProtectedAreaSpeciesList(protectedAreaSpecies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保护区物种
|
||||
*
|
||||
* @param species 保护区物种
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int batchInsertProtectedAreaSpecies(ProtectedAreaSpecies species) {
|
||||
species.setCreateTime(DateUtils.getNowDate());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("areaId", species.getAreaId());
|
||||
map.put("list", species.getIds());
|
||||
List<Long> birdIds = protectedAreaSpeciesMapper.getProtectedAreaSpeciesListByParams(map);
|
||||
if (birdIds != null && birdIds.size() > 0) {
|
||||
map.clear();
|
||||
map.put("isCommon", species.getIsCommon());
|
||||
map.put("list", birdIds);
|
||||
map.put("areaId", species.getAreaId());
|
||||
protectedAreaSpeciesMapper.batchUpdateProtectedAreaSpecies(map);
|
||||
}
|
||||
List<Long> newIds = listRemove(species.getIds(), birdIds);
|
||||
if (newIds != null && newIds.size() > 0) {
|
||||
List<ProtectedAreaSpecies> list = new ArrayList<>();
|
||||
newIds.stream().forEach(id -> {
|
||||
ProtectedAreaSpecies data = new ProtectedAreaSpecies();
|
||||
data.setAreaId(species.getAreaId());
|
||||
data.setIsCommon(species.getIsCommon());
|
||||
data.setIsDeleted(0);
|
||||
data.setCreateTime(species.getCreateTime());
|
||||
data.setSpeciesId(id);
|
||||
list.add(data);
|
||||
});
|
||||
return protectedAreaSpeciesMapper.batchInsertProtectedAreaSpecies(list);
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
return protectedAreaSpeciesMapper.insertProtectedAreaSpecies(protectedAreaSpecies);
|
||||
}
|
||||
|
||||
private List<Long> listRemove(List<Long> fromList, List<Long> toList) {
|
||||
HashSet hs1 = new HashSet(fromList);
|
||||
HashSet hs2 = new HashSet(toList);
|
||||
hs1.removeAll(hs2);
|
||||
List<Long> list = new ArrayList<Long>();
|
||||
list.addAll(hs1);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保护区物种
|
||||
*
|
||||
* @param protectedAreaSpecies 保护区物种
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProtectedAreaSpecies(ProtectedAreaSpecies protectedAreaSpecies) {
|
||||
return protectedAreaSpeciesMapper.updateProtectedAreaSpecies(protectedAreaSpecies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除保护区物种
|
||||
*
|
||||
* @param ids 需要删除的保护区物种主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProtectedAreaSpeciesByIds(Long[] ids) {
|
||||
return protectedAreaSpeciesMapper.deleteProtectedAreaSpeciesByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProtectedAreaSpecies> getProtectedAreaSpeciesListByParam(JSONObject obj) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Integer isCommon = obj.getInteger("isCommon");
|
||||
if (isCommon != null) {
|
||||
map.put("isCommon", isCommon);
|
||||
}
|
||||
String code = obj.getString("code");
|
||||
if (code != null && !code.isEmpty()) {
|
||||
map.put("code", code);
|
||||
}
|
||||
Long areaId = obj.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
return protectedAreaSpeciesMapper.getProtectedAreaSpeciesListByParam(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保护区物种信息
|
||||
*
|
||||
* @param id 保护区物种主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProtectedAreaSpeciesById(Long id) {
|
||||
return protectedAreaSpeciesMapper.deleteProtectedAreaSpeciesById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importData(List<ProtectedAreaSpecies> list, boolean updateSupport) {
|
||||
if (StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入保护区鸟类不能为空!");
|
||||
}
|
||||
AtomicInteger[] successNum = {new AtomicInteger()};
|
||||
int[] failureNum = {0};
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
list.forEach(data -> {
|
||||
try {
|
||||
ProtectedArea protectedArea = protectedAreaService.selectProtectedAreaByName(data.getAreaName());
|
||||
BirdSpecies birdSpecies = birdSpeciesService.selectBirdSpeciesByName(data.getSpeciesName());
|
||||
if (Objects.isNull(protectedArea)) {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、保护区 " + data.getAreaName() + " 不存在");
|
||||
} else if (Objects.isNull(birdSpecies)) {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟类 " + data.getSpeciesName() + " 不存在");
|
||||
} else {
|
||||
ProtectedAreaSpecies param = new ProtectedAreaSpecies();
|
||||
param.setAreaId(protectedArea.getId());
|
||||
param.setSpeciesId(birdSpecies.getId());
|
||||
ProtectedAreaSpecies areaSpecies = protectedAreaSpeciesMapper.selectProtectedAreaSpeciesByParam(param);
|
||||
if (Objects.isNull(areaSpecies)) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setIsDeleted(0);
|
||||
data.setAreaId(protectedArea.getId());
|
||||
data.setSpeciesId(birdSpecies.getId());
|
||||
data.setCreateTime(new Date());
|
||||
insertProtectedAreaSpecies(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟类 " + data.getSpeciesName() + " 导入成功");
|
||||
} else if (updateSupport) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setId(areaSpecies.getId());
|
||||
data.setIsDeleted(0);
|
||||
data.setAreaId(protectedArea.getId());
|
||||
data.setSpeciesId(birdSpecies.getId());
|
||||
updateProtectedAreaSpecies(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟类 " + data.getSpeciesName() + " 更新成功");
|
||||
} else {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟类 " + data.getSpeciesName() + " 已存在");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
failureNum[0]++;
|
||||
String msg = "<br/>" + failureNum + "、鸟类 " + data.getSpeciesName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
});
|
||||
if (failureNum[0] > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum[0] + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo getProtectedAreaSpeciesByQuery(JSONObject param) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String areaName = "";
|
||||
Long areaId = param.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
if (areaId != null) {
|
||||
areaName = protectedAreaService.selectProtectedAreaById(areaId).getName();
|
||||
}
|
||||
String name = param.getString("name");
|
||||
map.put("name", name);
|
||||
Integer pageNum = param.getInteger("pageNum");
|
||||
Integer pageSize = param.getInteger("pageSize");
|
||||
PageUtils.startPage(pageNum, pageSize);
|
||||
List<BirdSpecies> birdSpecies = birdSpeciesService.getBirdSpeciesListByQuery(map);
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setTotal(new PageInfo(birdSpecies).getTotal());
|
||||
List<Long> ids = protectedAreaSpeciesMapper.getProtectedAreaSpeciesIdsByParam(map);
|
||||
if (birdSpecies == null) {
|
||||
rspData.setRows(new ArrayList<>());
|
||||
return rspData;
|
||||
}
|
||||
List<ProtectedAreaSpecies> list = new ArrayList<>();
|
||||
for (BirdSpecies item : birdSpecies) {
|
||||
ProtectedAreaSpecies data = new ProtectedAreaSpecies();
|
||||
data.setSpeciesId(item.getId());
|
||||
data.setBirdSpecies(item);
|
||||
if (ids.contains(item.getId())) {
|
||||
data.setAreaName(areaName);
|
||||
} else {
|
||||
data.setAreaName("当前未监测到");
|
||||
}
|
||||
list.add(data);
|
||||
}
|
||||
|
||||
rspData.setRows(list);
|
||||
|
||||
return rspData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getProtectedAreaSpeciesListByParams(JSONObject param) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long areaId = param.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
String str = param.getString("list");
|
||||
List<Long> list = JSON.parseArray(str, Long.class);
|
||||
map.put("list", list);
|
||||
return protectedAreaSpeciesMapper.getProtectedAreaSpeciesListByParams(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int changeProtectedAreaSpeciesByParam(JSONObject param) {
|
||||
Long id = param.getLong("id");
|
||||
int val = param.getInteger("val");
|
||||
Long areaId = param.getLong("areaId");
|
||||
if (val == 0) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("areaId", areaId);
|
||||
map.put("speciesId", id);
|
||||
return protectedAreaSpeciesMapper.deleteProtectedAreaSpeciesByParam(map);
|
||||
} else {
|
||||
ProtectedAreaSpecies data = new ProtectedAreaSpecies();
|
||||
data.setIsCommon(1);
|
||||
data.setSpeciesId(id);
|
||||
data.setAreaId(areaId);
|
||||
data.setCreateTime(new Date());
|
||||
data.setPosition(99);
|
||||
data.setIsDeleted(0);
|
||||
return protectedAreaSpeciesMapper.insertProtectedAreaSpecies(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdStatDataVo> getProtectedAreaSpeciesListByAreaId(Map<String, Object> map) {
|
||||
return protectedAreaSpeciesMapper.getProtectedAreaSpeciesListByAreaId(map);
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package net.hzvtc.area.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.ProtectedCareSpecies;
|
||||
import net.hzvtc.area.mapper.ProtectedCareSpeciesMapper;
|
||||
import net.hzvtc.area.service.ProtectedCareSpeciesService;
|
||||
import net.hzvtc.common.utils.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保护区关注鸟类Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-16
|
||||
*/
|
||||
@Service
|
||||
public class ProtectedCareSpeciesServiceImpl implements ProtectedCareSpeciesService {
|
||||
@Resource
|
||||
private ProtectedCareSpeciesMapper protectedCareSpeciesMapper;
|
||||
|
||||
/**
|
||||
* 查询保护区关注鸟类
|
||||
*
|
||||
* @param id 保护区关注鸟类主键
|
||||
* @return 保护区关注鸟类
|
||||
*/
|
||||
@Override
|
||||
public ProtectedCareSpecies selectProtectedCareSpeciesById(Long id) {
|
||||
return protectedCareSpeciesMapper.selectProtectedCareSpeciesById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询保护区关注鸟类列表
|
||||
*
|
||||
* @param param 保护区关注鸟类
|
||||
* @return 保护区关注鸟类
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectProtectedCareSpeciesList(JSONObject param) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long areaId = param.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
String str = param.getString("list");
|
||||
List<Long> list = JSON.parseArray(str, Long.class);
|
||||
map.put("list", list);
|
||||
return protectedCareSpeciesMapper.selectProtectedCareSpeciesList(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保护区关注鸟类
|
||||
*
|
||||
* @param protectedCareSpecies 保护区关注鸟类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProtectedCareSpecies(ProtectedCareSpecies protectedCareSpecies) {
|
||||
protectedCareSpecies.setCreateTime(DateUtils.getNowDate());
|
||||
return protectedCareSpeciesMapper.insertProtectedCareSpecies(protectedCareSpecies);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int changeProtectedAreaCareSpeciesByParam(JSONObject param) {
|
||||
Long id = param.getLong("id");
|
||||
int val = param.getInteger("val");
|
||||
Long areaId = param.getLong("areaId");
|
||||
if (val == 0) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("areaId", areaId);
|
||||
map.put("speciesId", id);
|
||||
return protectedCareSpeciesMapper.deleteProtectedCareSpeciesById(map);
|
||||
} else {
|
||||
ProtectedCareSpecies data = new ProtectedCareSpecies();
|
||||
data.setSpeciesId(id);
|
||||
data.setAreaId(areaId);
|
||||
data.setCreateTime(new Date());
|
||||
return protectedCareSpeciesMapper.insertProtectedCareSpecies(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getProtectedCareSpeciesByParam(Map<String, Object> map) {
|
||||
return protectedCareSpeciesMapper.getProtectedCareSpeciesByParam(map);
|
||||
}
|
||||
}
|
||||
+267
@@ -0,0 +1,267 @@
|
||||
package net.hzvtc.area.service.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.area.mapper.SpeciesAbnormalInfoMapper;
|
||||
import net.hzvtc.area.service.ProtectedCareSpeciesService;
|
||||
import net.hzvtc.area.service.SpeciesAbnormalInfoService;
|
||||
import net.hzvtc.common.utils.SecurityUtils;
|
||||
import net.hzvtc.data.check.service.ResultRecordDetailsService;
|
||||
import net.hzvtc.data.check.service.ResultRecordService;
|
||||
import net.hzvtc.data.job.domain.TableStatInfo;
|
||||
import net.hzvtc.data.job.service.TableStatInfoService;
|
||||
import net.hzvtc.system.domain.vo.MessageVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 关键物种与异常事件报警Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-10
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SpeciesAbnormalInfoServiceImpl implements SpeciesAbnormalInfoService {
|
||||
@Resource
|
||||
private SpeciesAbnormalInfoMapper speciesAbnormalInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private ResultRecordDetailsService resultRecordDetailsService;
|
||||
|
||||
@Autowired
|
||||
private TableStatInfoService tableStatInfoService;
|
||||
|
||||
@Autowired
|
||||
private ResultRecordService resultRecordService;
|
||||
|
||||
@Autowired
|
||||
private ProtectedCareSpeciesService careSpeciesService;
|
||||
|
||||
/**
|
||||
* 查询关键物种与异常事件报警
|
||||
*
|
||||
* @param id 关键物种与异常事件报警主键
|
||||
* @return 关键物种与异常事件报警
|
||||
*/
|
||||
@Override
|
||||
public SpeciesAbnormalInfo selectSpeciesAbnormalInfoById(Long id) {
|
||||
return speciesAbnormalInfoMapper.selectSpeciesAbnormalInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询关键物种与异常事件报警列表
|
||||
*
|
||||
* @param speciesAbnormalInfo 关键物种与异常事件报警
|
||||
* @return 关键物种与异常事件报警
|
||||
*/
|
||||
@Override
|
||||
public List<SpeciesAbnormalInfo> selectSpeciesAbnormalInfoList(SpeciesAbnormalInfo speciesAbnormalInfo) {
|
||||
return speciesAbnormalInfoMapper.selectSpeciesAbnormalInfoList(speciesAbnormalInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关键物种与异常事件报警
|
||||
*
|
||||
* @param speciesAbnormalInfo 关键物种与异常事件报警
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSpeciesAbnormalInfo(SpeciesAbnormalInfo speciesAbnormalInfo) {
|
||||
return speciesAbnormalInfoMapper.insertSpeciesAbnormalInfo(speciesAbnormalInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除关键物种与异常事件报警
|
||||
*
|
||||
* @param ids 需要删除的关键物种与异常事件报警主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSpeciesAbnormalInfoByIds(Long[] ids) {
|
||||
return speciesAbnormalInfoMapper.deleteSpeciesAbnormalInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关键物种与异常事件报警信息
|
||||
*
|
||||
* @param id 关键物种与异常事件报警主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSpeciesAbnormalInfoById(Long id) {
|
||||
return speciesAbnormalInfoMapper.deleteSpeciesAbnormalInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDailyLevelOneSpecieResult() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
DateTimeFormatter fmDate = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
map.put("happenTime", fmDate.format(LocalDate.now()));
|
||||
List<SpeciesAbnormalInfo> list = resultRecordDetailsService.getLevelOneSpeciesLitByParam(map);
|
||||
if (list != null && list.size() > 0) {
|
||||
list.forEach(item -> item.setType(1));
|
||||
speciesAbnormalInfoMapper.batchInsertSpeciesAbnormalInfo(list);
|
||||
}
|
||||
list = resultRecordDetailsService.getCrOrEnSpeciesLitByParam(map);
|
||||
if (list != null && list.size() > 0) {
|
||||
list.forEach(item -> item.setType(2));
|
||||
speciesAbnormalInfoMapper.batchInsertSpeciesAbnormalInfo(list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllLevelOneSpecieResult() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<SpeciesAbnormalInfo> list = resultRecordDetailsService.getLevelOneSpeciesLitByParam(map);
|
||||
if (list != null && list.size() > 0) {
|
||||
speciesAbnormalInfoMapper.batchInsertSpeciesAbnormalInfo(list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpeciesAbnormalInfo getLatestSpeciesAbnormalInfo(Long userId) {
|
||||
return speciesAbnormalInfoMapper.getLatestSpeciesAbnormalInfo(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpeciesAbnormalInfoCountByUserId(Map<String, Object> map) {
|
||||
return speciesAbnormalInfoMapper.getSpeciesAbnormalInfoCountByUserId(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageVo> getSpeciesAbnormalInfoListByParam() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
map.put("readerId", userId);
|
||||
if (userId <= 1L) {
|
||||
userId = null;
|
||||
}
|
||||
map.put("userId", userId);
|
||||
return speciesAbnormalInfoMapper.getSpeciesAbnormalInfoListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void getSpeciesAbnormalInfoListForJob() {
|
||||
TableStatInfo param = new TableStatInfo();
|
||||
param.setType(0);
|
||||
Long miniId = null;
|
||||
List<TableStatInfo> list = tableStatInfoService.selectTableStatInfoList(param);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (list == null || list.isEmpty()) {
|
||||
map.put("recordTime", new Date());
|
||||
} else {
|
||||
Long id = list.get(0).getTableId();
|
||||
map.put("recordId", id);
|
||||
}
|
||||
|
||||
List<Long> ids = resultRecordService.getResultRecordIdsByParam(map);
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (list == null || list.isEmpty()) {
|
||||
TableStatInfo data = new TableStatInfo();
|
||||
data.setType(0);
|
||||
data.setTableId(ids.get(0));
|
||||
tableStatInfoService.insertTableStatInfo(data);
|
||||
} else {
|
||||
TableStatInfo data = list.get(0);
|
||||
data.setTableId(ids.get(0));
|
||||
tableStatInfoService.updateTableStatInfo(data);
|
||||
}
|
||||
// log.info("========={}", ids.size());
|
||||
miniId = ids.get(ids.size() - 1);
|
||||
|
||||
map.clear();
|
||||
map.put("list", ids);
|
||||
List<SpeciesAbnormalInfo> speciesList = new ArrayList<>();
|
||||
//鸟类物种ICUN红色名录等级为濒危或极危
|
||||
List<SpeciesAbnormalInfo> nlist = resultRecordDetailsService.getCrOrEnSpeciesLitByParam(map);
|
||||
if (nlist != null && nlist.size() > 0) {
|
||||
|
||||
nlist.forEach(item -> {
|
||||
if (!containsItem(speciesList, item)) {
|
||||
item.setType(2);
|
||||
speciesList.add(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
//鸟类物种在保护区内首次被监测到,此前从未出现过
|
||||
|
||||
nlist = resultRecordDetailsService.getSpeciesDateListByParam(map);
|
||||
map.clear();
|
||||
map.put("recordId", miniId);
|
||||
nlist.forEach(item -> {
|
||||
if (!containsItem(speciesList, item)) {
|
||||
map.put("speciesId", item.getSpeciesId());
|
||||
map.put("areaId", item.getAreaId());
|
||||
List<Long> subIds = resultRecordDetailsService.checkIsNewSpeciesByParam(map);
|
||||
if (subIds == null || subIds.isEmpty()) {
|
||||
if (!containsItem(speciesList, item)) {
|
||||
item.setType(3);
|
||||
speciesList.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//用户自定义筛选的其他鸟类物种
|
||||
map.clear();
|
||||
map.put("list", ids);
|
||||
nlist.forEach(item -> {
|
||||
if (!containsItem(speciesList, item)) {
|
||||
map.put("speciesId", item.getSpeciesId());
|
||||
map.put("areaId", item.getAreaId());
|
||||
List<Long> subIds = careSpeciesService.getProtectedCareSpeciesByParam(map);
|
||||
if (subIds != null && !subIds.isEmpty()) {
|
||||
if (!containsItem(speciesList, item)) {
|
||||
item.setType(4);
|
||||
speciesList.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//鸟类物种为国家一级保护动物
|
||||
map.clear();
|
||||
map.put("list", ids);
|
||||
nlist = resultRecordDetailsService.getLevelOneSpeciesLitByParam(map);
|
||||
if (nlist != null && nlist.size() > 0) {
|
||||
nlist.forEach(item -> {
|
||||
if (!containsItem(speciesList, item)) {
|
||||
item.setType(1);
|
||||
speciesList.add(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (speciesList.size() > 0) {
|
||||
speciesAbnormalInfoMapper.batchInsertSpeciesAbnormalInfo(speciesList);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean containsItem(List<SpeciesAbnormalInfo> list, SpeciesAbnormalInfo item) {
|
||||
if (list == null || list.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
List<SpeciesAbnormalInfo> slist = list.stream().filter(sitem ->
|
||||
((sitem.getRecordId().longValue() == item.getRecordId().longValue()) && (sitem.getSpeciesId().longValue() == item.getSpeciesId().longValue()))
|
||||
).collect(Collectors.toList());
|
||||
// log.info("====================size============{}", slist.size());
|
||||
if (slist == null || slist.size() == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package net.hzvtc.area.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
import net.hzvtc.area.domain.WinteringPeriod;
|
||||
import net.hzvtc.area.mapper.WinteringPeriodMapper;
|
||||
import net.hzvtc.area.service.ProtectedAreaService;
|
||||
import net.hzvtc.area.service.WinteringPeriodService;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 越冬期Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
@Service
|
||||
public class WinteringPeriodServiceImpl implements WinteringPeriodService {
|
||||
@Resource
|
||||
private WinteringPeriodMapper winteringPeriodMapper;
|
||||
|
||||
@Autowired
|
||||
private ProtectedAreaService protectedAreaService;
|
||||
|
||||
/**
|
||||
* 查询越冬期
|
||||
*
|
||||
* @param id 越冬期主键
|
||||
* @return 越冬期
|
||||
*/
|
||||
@Override
|
||||
public WinteringPeriod selectWinteringPeriodById(Long id) {
|
||||
return winteringPeriodMapper.selectWinteringPeriodById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询越冬期列表
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 越冬期
|
||||
*/
|
||||
@Override
|
||||
public List<WinteringPeriod> selectWinteringPeriodList(WinteringPeriod winteringPeriod) {
|
||||
return winteringPeriodMapper.selectWinteringPeriodList(winteringPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增越冬期
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWinteringPeriod(WinteringPeriod winteringPeriod) {
|
||||
return winteringPeriodMapper.insertWinteringPeriod(winteringPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改越冬期
|
||||
*
|
||||
* @param winteringPeriod 越冬期
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWinteringPeriod(WinteringPeriod winteringPeriod) {
|
||||
return winteringPeriodMapper.updateWinteringPeriod(winteringPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除越冬期
|
||||
*
|
||||
* @param ids 需要删除的越冬期主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWinteringPeriodByIds(Long[] ids) {
|
||||
return winteringPeriodMapper.deleteWinteringPeriodByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除越冬期信息
|
||||
*
|
||||
* @param id 越冬期主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWinteringPeriodById(Long id) {
|
||||
return winteringPeriodMapper.deleteWinteringPeriodById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdStatDataVo> getWinteringPeriodDataList(JSONObject param) {
|
||||
String areaCode = param.getString("areaCode");
|
||||
if (areaCode != null) {
|
||||
ProtectedArea data = protectedAreaService.selectProtectedAreaByCode(areaCode);
|
||||
WinteringPeriod winteringPeriod = new WinteringPeriod();
|
||||
winteringPeriod.setProtectedAreaId(data.getId());
|
||||
List<WinteringPeriod> list = winteringPeriodMapper.getWinteringPeriodDataList(winteringPeriod);
|
||||
Collections.reverse(list);
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy");
|
||||
List<BirdStatDataVo> datalist = list.stream().map(item -> {
|
||||
BirdStatDataVo statDataVo = new BirdStatDataVo();
|
||||
statDataVo.setValue(item.getAmount());
|
||||
String code = df.format(item.getStartTime()) + "-" + df.format(item.getEndTime());
|
||||
statDataVo.setCode(code);
|
||||
return statDataVo;
|
||||
}).collect(Collectors.toList());
|
||||
return datalist;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdCatalogue;
|
||||
import net.hzvtc.bird.service.BirdCatalogueService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类目Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/birdInfo/catalogue")
|
||||
public class BirdCatalogueController extends BaseController {
|
||||
@Autowired
|
||||
private BirdCatalogueService birdCatalogueService;
|
||||
|
||||
/**
|
||||
* 查询鸟类目列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('birdInfo:catalogue:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdCatalogue birdCatalogue) {
|
||||
startPage();
|
||||
List<BirdCatalogue> list = birdCatalogueService.selectBirdCatalogueList(birdCatalogue);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/selectList")
|
||||
public AjaxResult getBirdCatalogueSelectList() {
|
||||
return AjaxResult.success(birdCatalogueService.getBirdCatalogueSelectList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出鸟类目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:catalogue:export')")
|
||||
@Log(title = "鸟类目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdCatalogue birdCatalogue) {
|
||||
List<BirdCatalogue> list = birdCatalogueService.selectBirdCatalogueList(birdCatalogue);
|
||||
ExcelUtil<BirdCatalogue> util = new ExcelUtil<BirdCatalogue>(BirdCatalogue.class);
|
||||
util.exportExcel(response, list, "鸟类目数据");
|
||||
}
|
||||
|
||||
@Log(title = "鸟类目", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<BirdCatalogue> util = new ExcelUtil<BirdCatalogue>(BirdCatalogue.class);
|
||||
List<BirdCatalogue> list = util.importExcel(file.getInputStream());
|
||||
String message = birdCatalogueService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<BirdCatalogue> util = new ExcelUtil<>(BirdCatalogue.class);
|
||||
util.importTemplateExcel(response, "鸟类目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鸟类目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:catalogue:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdCatalogueService.selectBirdCatalogueById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:catalogue:add')")
|
||||
@Log(title = "鸟类目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdCatalogue birdCatalogue) {
|
||||
return toAjax(birdCatalogueService.insertBirdCatalogue(birdCatalogue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:catalogue:edit')")
|
||||
@Log(title = "鸟类目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdCatalogue birdCatalogue) {
|
||||
return toAjax(birdCatalogueService.updateBirdCatalogue(birdCatalogue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:catalogue:remove')")
|
||||
@Log(title = "鸟类目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdCatalogueService.deleteBirdCatalogueByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFamily;
|
||||
import net.hzvtc.bird.service.BirdFamilyService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类科Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/birdInfo/family")
|
||||
public class BirdFamilyController extends BaseController {
|
||||
@Autowired
|
||||
private BirdFamilyService birdFamilyService;
|
||||
|
||||
/**
|
||||
* 查询鸟类科列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('birdInfo:family:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdFamily birdFamily) {
|
||||
startPage();
|
||||
List<BirdFamily> list = birdFamilyService.selectBirdFamilyList(birdFamily);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listByCataId")
|
||||
public AjaxResult getBirdFamilyListByCatalogueId(@RequestParam(name = "id") Long id) {
|
||||
return AjaxResult.success(birdFamilyService.getBirdFamilyListByCataId(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出鸟类科列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:family:export')")
|
||||
@Log(title = "鸟类科", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdFamily birdFamily) {
|
||||
List<BirdFamily> list = birdFamilyService.selectBirdFamilyList(birdFamily);
|
||||
ExcelUtil<BirdFamily> util = new ExcelUtil<BirdFamily>(BirdFamily.class);
|
||||
util.exportExcel(response, list, "鸟类科数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鸟类科详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:family:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdFamilyService.selectBirdFamilyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类科
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:family:add')")
|
||||
@Log(title = "鸟类科", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdFamily birdFamily) {
|
||||
return toAjax(birdFamilyService.insertBirdFamily(birdFamily));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类科
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:family:edit')")
|
||||
@Log(title = "鸟类科", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdFamily birdFamily) {
|
||||
return toAjax(birdFamilyService.updateBirdFamily(birdFamily));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类科
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:family:remove')")
|
||||
@Log(title = "鸟类科", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdFamilyService.deleteBirdFamilyByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<BirdFamily> util = new ExcelUtil<BirdFamily>(BirdFamily.class);
|
||||
List<BirdFamily> list = util.importExcel(file.getInputStream());
|
||||
String message = birdFamilyService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<BirdFamily> util = new ExcelUtil<>(BirdFamily.class);
|
||||
util.importTemplateExcel(response, "鸟类科数据");
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFlyingInfo;
|
||||
import net.hzvtc.bird.service.BirdFlyingInfoService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类越冬飞行路线图Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/birdInfo/flyingInfo")
|
||||
public class BirdFlyingInfoController extends BaseController {
|
||||
@Autowired
|
||||
private BirdFlyingInfoService birdFlyingInfoService;
|
||||
|
||||
@GetMapping("/allList")
|
||||
public AjaxResult getAll() {
|
||||
return AjaxResult.success(birdFlyingInfoService.getAllBirdFlyingInfoList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('birdInfo:flyingInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdFlyingInfo birdFlyingInfo) {
|
||||
startPage();
|
||||
List<BirdFlyingInfo> list = birdFlyingInfoService.selectBirdFlyingInfoList(birdFlyingInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出鸟类越冬飞行路线图列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:flyingInfo:export')")
|
||||
@Log(title = "鸟类越冬飞行路线图", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdFlyingInfo birdFlyingInfo) {
|
||||
List<BirdFlyingInfo> list = birdFlyingInfoService.selectBirdFlyingInfoList(birdFlyingInfo);
|
||||
ExcelUtil<BirdFlyingInfo> util = new ExcelUtil<BirdFlyingInfo>(BirdFlyingInfo.class);
|
||||
util.exportExcel(response, list, "鸟类越冬飞行路线图数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鸟类越冬飞行路线图详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:flyingInfo:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdFlyingInfoService.selectBirdFlyingInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类越冬飞行路线图
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:flyingInfo:add')")
|
||||
@Log(title = "鸟类越冬飞行路线图", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdFlyingInfo birdFlyingInfo) {
|
||||
return toAjax(birdFlyingInfoService.insertBirdFlyingInfo(birdFlyingInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类越冬飞行路线图
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:flyingInfo:edit')")
|
||||
@Log(title = "鸟类越冬飞行路线图", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdFlyingInfo birdFlyingInfo) {
|
||||
return toAjax(birdFlyingInfoService.updateBirdFlyingInfo(birdFlyingInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类越冬飞行路线图
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:flyingInfo:remove')")
|
||||
@Log(title = "鸟类越冬飞行路线图", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdFlyingInfoService.deleteBirdFlyingInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdGenus;
|
||||
import net.hzvtc.bird.service.BirdGenusService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类属Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/birdInfo/genus")
|
||||
public class BirdGenusController extends BaseController {
|
||||
@Autowired
|
||||
private BirdGenusService birdGenusService;
|
||||
|
||||
/**
|
||||
* 查询鸟类属列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('birdInfo:genus:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdGenus birdGenus) {
|
||||
startPage();
|
||||
List<BirdGenus> list = birdGenusService.selectBirdGenusList(birdGenus);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/listByFamilyId")
|
||||
public AjaxResult getBirdFamilyListByCatalogueId(@RequestParam(name = "id") Long id) {
|
||||
return AjaxResult.success(birdGenusService.getBirdGenusListByFamilyId(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出鸟类属列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:genus:export')")
|
||||
@Log(title = "鸟类属", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdGenus birdGenus) {
|
||||
List<BirdGenus> list = birdGenusService.selectBirdGenusList(birdGenus);
|
||||
ExcelUtil<BirdGenus> util = new ExcelUtil<BirdGenus>(BirdGenus.class);
|
||||
util.exportExcel(response, list, "鸟类属数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鸟类属详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:genus:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdGenusService.selectBirdGenusById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类属
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:genus:add')")
|
||||
@Log(title = "鸟类属", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdGenus birdGenus) {
|
||||
return toAjax(birdGenusService.insertBirdGenus(birdGenus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类属
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:genus:edit')")
|
||||
@Log(title = "鸟类属", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdGenus birdGenus) {
|
||||
return toAjax(birdGenusService.updateBirdGenus(birdGenus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类属
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:genus:remove')")
|
||||
@Log(title = "鸟类属", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdGenusService.deleteBirdGenusByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<BirdGenus> util = new ExcelUtil<BirdGenus>(BirdGenus.class);
|
||||
List<BirdGenus> list = util.importExcel(file.getInputStream());
|
||||
String message = birdGenusService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<BirdGenus> util = new ExcelUtil<>(BirdGenus.class);
|
||||
util.importTemplateExcel(response, "鸟类科数据");
|
||||
}
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.bird.domain.BirdLeaveArriveInfo;
|
||||
import net.hzvtc.bird.service.BirdLeaveArriveInfoService;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 候鸟飞离和抵达时间Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bird/leaveArrive")
|
||||
public class BirdLeaveArriveInfoController extends BaseController {
|
||||
@Autowired
|
||||
private BirdLeaveArriveInfoService birdLeaveArriveInfoService;
|
||||
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bird:leaveArrive:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
startPage();
|
||||
List<BirdLeaveArriveInfo> list = birdLeaveArriveInfoService.selectBirdLeaveArriveInfoList(birdLeaveArriveInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出候鸟飞离和抵达时间列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bird:leaveArrive:export')")
|
||||
@Log(title = "候鸟飞离和抵达时间", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
List<BirdLeaveArriveInfo> list = birdLeaveArriveInfoService.selectBirdLeaveArriveInfoList(birdLeaveArriveInfo);
|
||||
ExcelUtil<BirdLeaveArriveInfo> util = new ExcelUtil<BirdLeaveArriveInfo>(BirdLeaveArriveInfo. class);
|
||||
util.exportExcel(response, list, "候鸟飞离和抵达时间数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取候鸟飞离和抵达时间详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bird:leaveArrive:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdLeaveArriveInfoService.selectBirdLeaveArriveInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增候鸟飞离和抵达时间
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bird:leaveArrive:add')")
|
||||
@Log(title = "候鸟飞离和抵达时间", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
return toAjax(birdLeaveArriveInfoService.insertBirdLeaveArriveInfo(birdLeaveArriveInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改候鸟飞离和抵达时间
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bird:leaveArrive:edit')")
|
||||
@Log(title = "候鸟飞离和抵达时间", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
return toAjax(birdLeaveArriveInfoService.updateBirdLeaveArriveInfo(birdLeaveArriveInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除候鸟飞离和抵达时间
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bird:leaveArrive:remove')")
|
||||
@Log(title = "候鸟飞离和抵达时间", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdLeaveArriveInfoService.deleteBirdLeaveArriveInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdMedia;
|
||||
import net.hzvtc.bird.service.BirdMediaService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类媒体Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/birdInfo/media")
|
||||
public class BirdMediaController extends BaseController {
|
||||
@Autowired
|
||||
private BirdMediaService birdMediaService;
|
||||
|
||||
/**
|
||||
* 查询鸟类媒体列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('birdInfo:media:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdMedia birdMedia) {
|
||||
startPage();
|
||||
List<BirdMedia> list = birdMediaService.selectBirdMediaList(birdMedia);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出鸟类媒体列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:media:export')")
|
||||
@Log(title = "鸟类媒体", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdMedia birdMedia) {
|
||||
List<BirdMedia> list = birdMediaService.selectBirdMediaList(birdMedia);
|
||||
ExcelUtil<BirdMedia> util = new ExcelUtil<BirdMedia>(BirdMedia.class);
|
||||
util.exportExcel(response, list, "鸟类媒体数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鸟类媒体详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:media:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdMediaService.selectBirdMediaById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类媒体
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:media:add')")
|
||||
@Log(title = "鸟类媒体", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdMedia birdMedia) {
|
||||
return toAjax(birdMediaService.insertBirdMedia(birdMedia));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类媒体
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:media:edit')")
|
||||
@Log(title = "鸟类媒体", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdMedia birdMedia) {
|
||||
return toAjax(birdMediaService.updateBirdMedia(birdMedia));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类媒体
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:media:remove')")
|
||||
@Log(title = "鸟类媒体", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdMediaService.deleteBirdMediaByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult upload(MultipartFile file) {
|
||||
return birdMediaService.uploadFile(file);
|
||||
}
|
||||
|
||||
@GetMapping("/listForPage")
|
||||
public AjaxResult listByParam(BirdMedia birdMedia) {
|
||||
return AjaxResult.success(birdMediaService.selectBirdMediaList(birdMedia));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package net.hzvtc.bird.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.bird.service.BirdSpeciesService;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类种类Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/birdInfo/species")
|
||||
public class BirdSpeciesController extends BaseController {
|
||||
@Autowired
|
||||
private BirdSpeciesService birdSpeciesService;
|
||||
|
||||
/**
|
||||
* 查询鸟类种类列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('birdInfo:species:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BirdSpecies birdSpecies) {
|
||||
startPage();
|
||||
List<BirdSpecies> list = birdSpeciesService.selectBirdSpeciesList(birdSpecies);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出鸟类种类列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:species:export')")
|
||||
@Log(title = "鸟类种类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BirdSpecies birdSpecies) {
|
||||
List<BirdSpecies> list = birdSpeciesService.selectBirdSpeciesList(birdSpecies);
|
||||
ExcelUtil<BirdSpecies> util = new ExcelUtil<>(BirdSpecies.class);
|
||||
util.exportExcel(response, list, "鸟类种类数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鸟类种类详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(birdSpeciesService.selectBirdSpeciesById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类种类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:species:add')")
|
||||
@Log(title = "鸟类种类", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BirdSpecies birdSpecies) {
|
||||
return toAjax(birdSpeciesService.insertBirdSpecies(birdSpecies));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类种类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:species:edit')")
|
||||
@Log(title = "鸟类种类", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BirdSpecies birdSpecies) {
|
||||
return toAjax(birdSpeciesService.updateBirdSpecies(birdSpecies));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类种类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('birdInfo:species:remove')")
|
||||
@Log(title = "鸟类种类", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(birdSpeciesService.deleteBirdSpeciesByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<BirdSpecies> util = new ExcelUtil<>(BirdSpecies.class);
|
||||
List<BirdSpecies> list = util.importExcel(file.getInputStream());
|
||||
String message = birdSpeciesService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<BirdSpecies> util = new ExcelUtil<>(BirdSpecies.class);
|
||||
util.importTemplateExcel(response, "鸟类数据");
|
||||
}
|
||||
|
||||
@PostMapping("/birdResultMedias")
|
||||
public TableDataInfo getBirdResultMediasByParam(@RequestBody JSONObject params) {
|
||||
Integer pageNum = params.getInteger("pageNum");
|
||||
Integer pageSize = params.getInteger("pageSize");
|
||||
startPage(pageNum == null ? 1 : pageNum, pageSize == null ? 10 : pageSize);
|
||||
List<ResultMedia> list = birdSpeciesService.getResultMediaListByParam(params);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/birdResultAudioMedias")
|
||||
public TableDataInfo getBirdResultAudioMediasByParam(@RequestBody JSONObject params) {
|
||||
Integer pageNum = params.getInteger("pageNum");
|
||||
Integer pageSize = params.getInteger("pageSize");
|
||||
startPage(pageNum == null ? 1 : pageNum, pageSize == null ? 10 : pageSize);
|
||||
List<ResultMedia> list = birdSpeciesService.getResultAudioMediaListByParam(params);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/birdMediaesByParam")
|
||||
public TableDataInfo getSpeciesResultMediasByParam(@RequestBody JSONObject params) {
|
||||
Integer pageNum = params.getInteger("pageNum");
|
||||
pageNum = pageNum == null ? 1 : pageNum;
|
||||
Integer pageSize = params.getInteger("pageSize");
|
||||
pageSize = pageSize == null ? 10 : pageSize;
|
||||
startPage(pageNum, pageSize);
|
||||
return getDataTable(birdSpeciesService.getBirdMediaListByParam(params));
|
||||
}
|
||||
|
||||
@PostMapping("/birdMediaesForPageByParam")
|
||||
public TableDataInfo getSpeciesResultMediasForPageFirstByParam(@RequestBody JSONObject params) {
|
||||
return getDataTable(birdSpeciesService.getBirdMediaListByParam(params));
|
||||
}
|
||||
|
||||
@Log(title = "监测结果附件导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/mediaExport")
|
||||
public void export(HttpServletResponse response, @RequestBody JSONObject params) {
|
||||
List<ResultMedia> list = birdSpeciesService.getResultMediaListByParam(params);
|
||||
ExcelUtil<ResultMedia> util = new ExcelUtil<>(ResultMedia.class);
|
||||
util.exportExcel(response, list, "监测媒体数据");
|
||||
}
|
||||
|
||||
@Log(title = "media数据恢复", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/media/recovery")
|
||||
public AjaxResult recoverBirdMediaByParam(@RequestBody JSONObject params) {
|
||||
return AjaxResult.success(birdSpeciesService.recoverResultMediaStateByParam(params));
|
||||
}
|
||||
|
||||
@PostMapping("/updateSysSpeciesCode")
|
||||
public AjaxResult updateSysSpeciesCode() {
|
||||
return AjaxResult.success(birdSpeciesService.updateSysSpeciesCode());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* 鸟类目对象 bird_catalogue
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdCatalogue")
|
||||
public class BirdCatalogue extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 学名(拉丁文名)
|
||||
*/
|
||||
@Excel(name = "学名")
|
||||
private String scientificName;
|
||||
|
||||
/**
|
||||
* 英文名称
|
||||
*/
|
||||
@Excel(name = "英文名称")
|
||||
private String englishName;
|
||||
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("scientificName", getScientificName())
|
||||
.append("englishName", getEnglishName())
|
||||
.append("description", getDescription())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* 鸟类科对象 bird_family
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdFamily")
|
||||
public class BirdFamily extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 科id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 科名
|
||||
*/
|
||||
@Excel(name = "科名")
|
||||
private String familyName;
|
||||
|
||||
/**
|
||||
* 学名(拉丁文名)
|
||||
*/
|
||||
@Excel(name = "学名")
|
||||
private String scientificName;
|
||||
|
||||
/**
|
||||
* 英文名称
|
||||
*/
|
||||
@Excel(name = "英文名称")
|
||||
private String englishName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 所属目名
|
||||
*/
|
||||
private Long catalogueId;
|
||||
|
||||
@Excel(name = "所属类目")
|
||||
private String catalogueName;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("familyName", getFamilyName())
|
||||
.append("scientificName", getScientificName())
|
||||
.append("englishName", getEnglishName())
|
||||
.append("description", getDescription())
|
||||
.append("catalogueId", getCatalogueId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* 鸟类越冬飞行路线图对象 bird_flying_info
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-30
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdFlyingInfo")
|
||||
public class BirdFlyingInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 物种名称
|
||||
*/
|
||||
private Long speciesId;
|
||||
|
||||
/**
|
||||
* 起飞点
|
||||
*/
|
||||
@Excel(name = "起飞点")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 起飞点经度
|
||||
*/
|
||||
@Excel(name = "起飞点经度")
|
||||
private String sourceLongitude;
|
||||
|
||||
/**
|
||||
* 起飞点维度
|
||||
*/
|
||||
@Excel(name = "起飞点维度")
|
||||
private String sourceLatitude;
|
||||
|
||||
/**
|
||||
* 目的地
|
||||
*/
|
||||
@Excel(name = "目的地")
|
||||
private String target;
|
||||
|
||||
/**
|
||||
* 目的地经度
|
||||
*/
|
||||
@Excel(name = "目的地经度")
|
||||
private String targetLongitude;
|
||||
|
||||
/**
|
||||
* 目的地维度
|
||||
*/
|
||||
@Excel(name = "目的地维度")
|
||||
private String targetLatitude;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("source", getSource())
|
||||
.append("sourceLongitude", getSourceLongitude())
|
||||
.append("sourceLatitude", getSourceLatitude())
|
||||
.append("target", getTarget())
|
||||
.append("targetLongitude", getTargetLongitude())
|
||||
.append("targetLatitude", getTargetLatitude())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* 鸟类属对象 bird_genus
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdGenus")
|
||||
public class BirdGenus extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 属名
|
||||
*/
|
||||
@Excel(name = "属名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 拉丁文名
|
||||
*/
|
||||
@Excel(name = "拉丁文名")
|
||||
private String scientificName;
|
||||
|
||||
/**
|
||||
* 英文名称
|
||||
*/
|
||||
@Excel(name = "英文名称")
|
||||
private String englishName;
|
||||
|
||||
private Long catalogueId;
|
||||
|
||||
/**
|
||||
* 所属科id
|
||||
*/
|
||||
private Long familyId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 所属科名
|
||||
*/
|
||||
@Excel(name = "所属科名")
|
||||
private String familyName;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("scientificName", getScientificName())
|
||||
.append("englishName", getEnglishName())
|
||||
.append("familyId", getFamilyId())
|
||||
.append("description", getDescription())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 候鸟飞离和抵达时间对象 bird_leave_arrive_info
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-11-01
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdLeaveArriveInfo")
|
||||
public class BirdLeaveArriveInfo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保护区ID
|
||||
*/
|
||||
@Excel(name = "保护区ID")
|
||||
private Long areaId;
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 物种ID
|
||||
*/
|
||||
@Excel(name = "物种ID")
|
||||
private Long speciesId;
|
||||
|
||||
/**
|
||||
* 统计年度
|
||||
*/
|
||||
@Excel(name = "统计年度")
|
||||
private int statYear;
|
||||
|
||||
/**
|
||||
* 飞离日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "飞离日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date leaveDate;
|
||||
|
||||
private String strLeaveDate;
|
||||
|
||||
/**
|
||||
* 到达日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "到达日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date arriveDate;
|
||||
|
||||
private String strArriveDate;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Excel(name = "删除标记")
|
||||
private int isDeleted = 0;
|
||||
|
||||
public long getDiffDay() {
|
||||
if (arriveDate == null || leaveDate == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return (leaveDate.getTime() - arriveDate.getTime()) / 24 / 3600 / 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("areaId", getAreaId())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("statYear", getStatYear())
|
||||
.append("leaveDate", getLeaveDate())
|
||||
.append("arriveDate", getArriveDate())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* 鸟类媒体对象 bird_media
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-19
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdMedia")
|
||||
public class BirdMedia extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 物种id
|
||||
*/
|
||||
@Excel(name = "物种id")
|
||||
private Long speciesId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型")
|
||||
private String mediaType;
|
||||
|
||||
/**
|
||||
* url
|
||||
*/
|
||||
@Excel(name = "url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String description;
|
||||
|
||||
private Integer pcShow = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("name", getName())
|
||||
.append("mediaType", getMediaType())
|
||||
.append("url", getUrl())
|
||||
.append("description", getDescription())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package net.hzvtc.bird.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类种类对象 bird_species
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
@Data
|
||||
@Alias("BirdSpecies")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BirdSpecies extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 物种
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 中文名称
|
||||
*/
|
||||
@Excel(name = "中文名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 物种学名(拉丁文名)
|
||||
*/
|
||||
@Excel(name = "物种学名")
|
||||
private String scientificName;
|
||||
|
||||
/**
|
||||
* 物种英文名称
|
||||
*/
|
||||
@Excel(name = "物种英文名称")
|
||||
private String englishName;
|
||||
|
||||
/**
|
||||
* 形态描述
|
||||
*/
|
||||
@Excel(name = "形态描述")
|
||||
private String morphology;
|
||||
|
||||
/**
|
||||
* 生境信息
|
||||
*/
|
||||
@Excel(name = "生境信息")
|
||||
private String habitat;
|
||||
|
||||
/**
|
||||
* 鸣声描述
|
||||
*/
|
||||
@Excel(name = "鸣声描述")
|
||||
private String voice;
|
||||
|
||||
/**
|
||||
* 分布范围
|
||||
*/
|
||||
@Excel(name = "分布范围")
|
||||
private String distribution;
|
||||
|
||||
/**
|
||||
* 国外分布
|
||||
*/
|
||||
@Excel(name = "国外分布")
|
||||
private String overseasDistribution;
|
||||
|
||||
/**
|
||||
* 国内分布
|
||||
*/
|
||||
@Excel(name = "国内分布")
|
||||
private String domesticDistribution;
|
||||
|
||||
/**
|
||||
* 鸟种类头像图片url
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 国家保护等级
|
||||
*/
|
||||
@Excel(name = "国家保护等级", readConverterExp = "0=无保护等级,1=国家一级保护动物,2=国家二级保护动物")
|
||||
private String protectLevel;
|
||||
|
||||
private String protectLevelName;
|
||||
|
||||
/**
|
||||
* iucn红色名录
|
||||
*/
|
||||
@Excel(name = "iucn红色名录", readConverterExp = "EX=绝灭,EW=野外灭绝,CR=极危,EN=濒危,VU=易危,NT=近危,LC=无危,DD=数据缺乏,NE=未评估")
|
||||
private String iucn;
|
||||
|
||||
private String iucnName;
|
||||
|
||||
|
||||
/**
|
||||
* 居留类型
|
||||
*/
|
||||
@Excel(name = "居留类型", readConverterExp = "1=留鸟,2=夏侯鸟,3=冬候鸟,4=旅鸟,5=迷鸟")
|
||||
private String residenceType;
|
||||
|
||||
@Excel(name = "所属类型", readConverterExp = "")
|
||||
private String speciesType;
|
||||
|
||||
private String speciesTypeName;
|
||||
|
||||
/**
|
||||
* 目id
|
||||
*/
|
||||
private Long catalogueId;
|
||||
|
||||
private String catalogueName;
|
||||
|
||||
/**
|
||||
* 科id
|
||||
*/
|
||||
private Long familyId;
|
||||
|
||||
private String familyName;
|
||||
|
||||
private Integer position;
|
||||
|
||||
/**
|
||||
* 属id
|
||||
*/
|
||||
private Long genusId;
|
||||
|
||||
@Excel(name = "鸟类属")
|
||||
private String genusName;
|
||||
|
||||
private List<BirdMedia> mediaList;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("scientificName", getScientificName())
|
||||
.append("englishName", getEnglishName())
|
||||
.append("morphology", getMorphology())
|
||||
.append("habitat", getHabitat())
|
||||
.append("voice", getVoice())
|
||||
.append("distribution", getDistribution())
|
||||
.append("overseasDistribution", getOverseasDistribution())
|
||||
.append("domesticDistribution", getDomesticDistribution())
|
||||
.append("avatar", getAvatar())
|
||||
.append("protectLevel", getProtectLevel())
|
||||
.append("iucn", getIucn())
|
||||
.append("residenceType", getResidenceType())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("catalogueId", getCatalogueId())
|
||||
.append("familyId", getFamilyId())
|
||||
.append("genusId", getGenusId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdCatalogue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类目Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
public interface BirdCatalogueMapper {
|
||||
/**
|
||||
* 查询鸟类目
|
||||
*
|
||||
* @param id 鸟类目主键
|
||||
* @return 鸟类目
|
||||
*/
|
||||
public BirdCatalogue selectBirdCatalogueById(Long id);
|
||||
|
||||
public BirdCatalogue selectBirdCatalogueByName(String name);
|
||||
|
||||
/**
|
||||
* 查询鸟类目列表
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 鸟类目集合
|
||||
*/
|
||||
public List<BirdCatalogue> selectBirdCatalogueList(BirdCatalogue birdCatalogue);
|
||||
|
||||
List<BirdCatalogue> getBirdCatalogueSelectList();
|
||||
|
||||
/**
|
||||
* 新增鸟类目
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdCatalogue(BirdCatalogue birdCatalogue);
|
||||
|
||||
/**
|
||||
* 修改鸟类目
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdCatalogue(BirdCatalogue birdCatalogue);
|
||||
|
||||
/**
|
||||
* 删除鸟类目
|
||||
*
|
||||
* @param id 鸟类目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdCatalogueById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类目
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdCatalogueByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFamily;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类科Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
public interface BirdFamilyMapper {
|
||||
/**
|
||||
* 查询鸟类科
|
||||
*
|
||||
* @param id 鸟类科主键
|
||||
* @return 鸟类科
|
||||
*/
|
||||
public BirdFamily selectBirdFamilyById(Long id);
|
||||
|
||||
public BirdFamily selectBirdFamilyByName(String name);
|
||||
|
||||
/**
|
||||
* 查询鸟类科列表
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 鸟类科集合
|
||||
*/
|
||||
public List<BirdFamily> selectBirdFamilyList(BirdFamily birdFamily);
|
||||
|
||||
List<BirdFamily> getBirdFamilyListByCataId(Long catalogueId);
|
||||
|
||||
/**
|
||||
* 新增鸟类科
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdFamily(BirdFamily birdFamily);
|
||||
|
||||
/**
|
||||
* 修改鸟类科
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdFamily(BirdFamily birdFamily);
|
||||
|
||||
/**
|
||||
* 删除鸟类科
|
||||
*
|
||||
* @param id 鸟类科主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFamilyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类科
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFamilyByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFlyingInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类越冬飞行路线图Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-30
|
||||
*/
|
||||
public interface BirdFlyingInfoMapper {
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图
|
||||
*
|
||||
* @param id 鸟类越冬飞行路线图主键
|
||||
* @return 鸟类越冬飞行路线图
|
||||
*/
|
||||
public BirdFlyingInfo selectBirdFlyingInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图列表
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 鸟类越冬飞行路线图集合
|
||||
*/
|
||||
public List<BirdFlyingInfo> selectBirdFlyingInfoList(BirdFlyingInfo birdFlyingInfo);
|
||||
|
||||
public List<BirdFlyingInfo> getAllBirdFlyingInfoList();
|
||||
|
||||
/**
|
||||
* 新增鸟类越冬飞行路线图
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdFlyingInfo(BirdFlyingInfo birdFlyingInfo);
|
||||
|
||||
/**
|
||||
* 修改鸟类越冬飞行路线图
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdFlyingInfo(BirdFlyingInfo birdFlyingInfo);
|
||||
|
||||
/**
|
||||
* 删除鸟类越冬飞行路线图
|
||||
*
|
||||
* @param id 鸟类越冬飞行路线图主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFlyingInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类越冬飞行路线图
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFlyingInfoByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdGenus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类属Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
public interface BirdGenusMapper {
|
||||
/**
|
||||
* 查询鸟类属
|
||||
*
|
||||
* @param id 鸟类属主键
|
||||
* @return 鸟类属
|
||||
*/
|
||||
public BirdGenus selectBirdGenusById(Long id);
|
||||
|
||||
public BirdGenus selectBirdGenusByName(String name);
|
||||
|
||||
/**
|
||||
* 查询鸟类属列表
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 鸟类属集合
|
||||
*/
|
||||
public List<BirdGenus> selectBirdGenusList(BirdGenus birdGenus);
|
||||
|
||||
List<BirdGenus> getBirdGenusListByFamilyId(Long familyId);
|
||||
|
||||
/**
|
||||
* 新增鸟类属
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdGenus(BirdGenus birdGenus);
|
||||
|
||||
/**
|
||||
* 修改鸟类属
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdGenus(BirdGenus birdGenus);
|
||||
|
||||
/**
|
||||
* 删除鸟类属
|
||||
*
|
||||
* @param id 鸟类属主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdGenusById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类属
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdGenusByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdLeaveArriveInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 候鸟飞离和抵达时间Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-27
|
||||
*/
|
||||
public interface BirdLeaveArriveInfoMapper {
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间
|
||||
*
|
||||
* @param id 候鸟飞离和抵达时间主键
|
||||
* @return 候鸟飞离和抵达时间
|
||||
*/
|
||||
BirdLeaveArriveInfo selectBirdLeaveArriveInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间列表
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 候鸟飞离和抵达时间集合
|
||||
*/
|
||||
List<BirdLeaveArriveInfo> selectBirdLeaveArriveInfoList(BirdLeaveArriveInfo birdLeaveArriveInfo);
|
||||
|
||||
List<BirdLeaveArriveInfo> getBirdArrivalDateByParam(Map<String, Object> param);
|
||||
|
||||
List<BirdLeaveArriveInfo> getBirdLeaveDateByParam(Map<String, Object> param);
|
||||
|
||||
|
||||
/**
|
||||
* 新增候鸟飞离和抵达时间
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 结果
|
||||
*/
|
||||
int insertBirdLeaveArriveInfo(BirdLeaveArriveInfo birdLeaveArriveInfo);
|
||||
|
||||
int batchInsertBirdLeaveArriveInfo(List<BirdLeaveArriveInfo> list);
|
||||
|
||||
/**
|
||||
* 修改候鸟飞离和抵达时间
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 结果
|
||||
*/
|
||||
int updateBirdLeaveArriveInfo(BirdLeaveArriveInfo birdLeaveArriveInfo);
|
||||
|
||||
/**
|
||||
* 删除候鸟飞离和抵达时间
|
||||
*
|
||||
* @param id 候鸟飞离和抵达时间主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBirdLeaveArriveInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除候鸟飞离和抵达时间
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBirdLeaveArriveInfoByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import net.hzvtc.bird.domain.BirdMedia;
|
||||
|
||||
/**
|
||||
* 鸟类媒体Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-19
|
||||
*/
|
||||
public interface BirdMediaMapper
|
||||
{
|
||||
/**
|
||||
* 查询鸟类媒体
|
||||
*
|
||||
* @param id 鸟类媒体主键
|
||||
* @return 鸟类媒体
|
||||
*/
|
||||
public BirdMedia selectBirdMediaById(Long id);
|
||||
|
||||
/**
|
||||
* 查询鸟类媒体列表
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 鸟类媒体集合
|
||||
*/
|
||||
public List<BirdMedia> selectBirdMediaList(BirdMedia birdMedia);
|
||||
|
||||
/**
|
||||
* 新增鸟类媒体
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdMedia(BirdMedia birdMedia);
|
||||
|
||||
/**
|
||||
* 修改鸟类媒体
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdMedia(BirdMedia birdMedia);
|
||||
|
||||
/**
|
||||
* 删除鸟类媒体
|
||||
*
|
||||
* @param id 鸟类媒体主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdMediaById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类媒体
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdMediaByIds(Long[] ids);
|
||||
|
||||
String getBirdIconImageBySpeciesId(Long speciesId);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package net.hzvtc.bird.mapper;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 鸟类种类Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
public interface BirdSpeciesMapper {
|
||||
/**
|
||||
* 查询鸟类种类
|
||||
*
|
||||
* @param id 鸟类种类主键
|
||||
* @return 鸟类种类
|
||||
*/
|
||||
BirdSpecies selectBirdSpeciesById(Long id);
|
||||
|
||||
BirdSpecies selectBirdSpeciesByName(String name);
|
||||
|
||||
/**
|
||||
* 查询鸟类种类列表
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 鸟类种类集合
|
||||
*/
|
||||
List<BirdSpecies> selectBirdSpeciesList(BirdSpecies birdSpecies);
|
||||
|
||||
List<BirdSpecies> getBirdSpeciesListByQuery(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 新增鸟类种类
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 结果
|
||||
*/
|
||||
int insertBirdSpecies(BirdSpecies birdSpecies);
|
||||
|
||||
/**
|
||||
* 修改鸟类种类
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 结果
|
||||
*/
|
||||
int updateBirdSpecies(BirdSpecies birdSpecies);
|
||||
|
||||
/**
|
||||
* 删除鸟类种类
|
||||
*
|
||||
* @param id 鸟类种类主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBirdSpeciesById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类种类
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBirdSpeciesByIds(Long[] ids);
|
||||
|
||||
List<BirdSpecies> getBirdSpeciesInfoByName(String name);
|
||||
|
||||
BirdSpecies selectBirdSpeciesForEsById(Long id);
|
||||
|
||||
List<BirdSpecies> getSpeciesSelectListByParam(Map<String, Object> param);
|
||||
|
||||
String getSpeciesNameById(Long id);
|
||||
|
||||
int deleteSysSpeciesCode();
|
||||
|
||||
int insertSysSpeciesCode();
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdCatalogue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类目Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
public interface BirdCatalogueService {
|
||||
/**
|
||||
* 查询鸟类目
|
||||
*
|
||||
* @param id 鸟类目主键
|
||||
* @return 鸟类目
|
||||
*/
|
||||
public BirdCatalogue selectBirdCatalogueById(Long id);
|
||||
|
||||
public BirdCatalogue selectBirdCatalogueByName(String name);
|
||||
|
||||
/**
|
||||
* 查询鸟类目列表
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 鸟类目集合
|
||||
*/
|
||||
public List<BirdCatalogue> selectBirdCatalogueList(BirdCatalogue birdCatalogue);
|
||||
|
||||
List<BirdCatalogue> getBirdCatalogueSelectList();
|
||||
|
||||
/**
|
||||
* 新增鸟类目
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdCatalogue(BirdCatalogue birdCatalogue);
|
||||
|
||||
/**
|
||||
* 修改鸟类目
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdCatalogue(BirdCatalogue birdCatalogue);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类目
|
||||
*
|
||||
* @param ids 需要删除的鸟类目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdCatalogueByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除鸟类目信息
|
||||
*
|
||||
* @param id 鸟类目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdCatalogueById(Long id);
|
||||
|
||||
public String importData(List<BirdCatalogue> list, boolean isUpdateSupport);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFamily;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类科Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
public interface BirdFamilyService {
|
||||
/**
|
||||
* 查询鸟类科
|
||||
*
|
||||
* @param id 鸟类科主键
|
||||
* @return 鸟类科
|
||||
*/
|
||||
public BirdFamily selectBirdFamilyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询鸟类科列表
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 鸟类科集合
|
||||
*/
|
||||
public List<BirdFamily> selectBirdFamilyList(BirdFamily birdFamily);
|
||||
|
||||
List<BirdFamily> getBirdFamilyListByCataId(Long catalogueId);
|
||||
|
||||
/**
|
||||
* 新增鸟类科
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdFamily(BirdFamily birdFamily);
|
||||
|
||||
/**
|
||||
* 修改鸟类科
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdFamily(BirdFamily birdFamily);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类科
|
||||
*
|
||||
* @param ids 需要删除的鸟类科主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFamilyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除鸟类科信息
|
||||
*
|
||||
* @param id 鸟类科主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFamilyById(Long id);
|
||||
|
||||
public String importData(List<BirdFamily> list, boolean isUpdateSupport);
|
||||
|
||||
public BirdFamily selectBirdFamilyByName(String name);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFlyingInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类越冬飞行路线图Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-30
|
||||
*/
|
||||
public interface BirdFlyingInfoService {
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图
|
||||
*
|
||||
* @param id 鸟类越冬飞行路线图主键
|
||||
* @return 鸟类越冬飞行路线图
|
||||
*/
|
||||
public BirdFlyingInfo selectBirdFlyingInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图列表
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 鸟类越冬飞行路线图集合
|
||||
*/
|
||||
public List<BirdFlyingInfo> selectBirdFlyingInfoList(BirdFlyingInfo birdFlyingInfo);
|
||||
|
||||
public List<BirdFlyingInfo> getAllBirdFlyingInfoList();
|
||||
|
||||
/**
|
||||
* 新增鸟类越冬飞行路线图
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdFlyingInfo(BirdFlyingInfo birdFlyingInfo);
|
||||
|
||||
/**
|
||||
* 修改鸟类越冬飞行路线图
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdFlyingInfo(BirdFlyingInfo birdFlyingInfo);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类越冬飞行路线图
|
||||
*
|
||||
* @param ids 需要删除的鸟类越冬飞行路线图主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFlyingInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除鸟类越冬飞行路线图信息
|
||||
*
|
||||
* @param id 鸟类越冬飞行路线图主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdFlyingInfoById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdGenus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类属Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
public interface BirdGenusService {
|
||||
/**
|
||||
* 查询鸟类属
|
||||
*
|
||||
* @param id 鸟类属主键
|
||||
* @return 鸟类属
|
||||
*/
|
||||
public BirdGenus selectBirdGenusById(Long id);
|
||||
|
||||
/**
|
||||
* 查询鸟类属列表
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 鸟类属集合
|
||||
*/
|
||||
public List<BirdGenus> selectBirdGenusList(BirdGenus birdGenus);
|
||||
|
||||
/**
|
||||
* 新增鸟类属
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdGenus(BirdGenus birdGenus);
|
||||
|
||||
/**
|
||||
* 修改鸟类属
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdGenus(BirdGenus birdGenus);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类属
|
||||
*
|
||||
* @param ids 需要删除的鸟类属主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdGenusByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除鸟类属信息
|
||||
*
|
||||
* @param id 鸟类属主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdGenusById(Long id);
|
||||
|
||||
List<BirdGenus> getBirdGenusListByFamilyId(Long familyId);
|
||||
|
||||
public String importData(List<BirdGenus> list, boolean isUpdateSupport);
|
||||
|
||||
public BirdGenus selectBirdGenusByName(String name);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdLeaveArriveInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 候鸟飞离和抵达时间Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-27
|
||||
*/
|
||||
public interface BirdLeaveArriveInfoService {
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间
|
||||
*
|
||||
* @param id 候鸟飞离和抵达时间主键
|
||||
* @return 候鸟飞离和抵达时间
|
||||
*/
|
||||
public BirdLeaveArriveInfo selectBirdLeaveArriveInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间列表
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 候鸟飞离和抵达时间集合
|
||||
*/
|
||||
public List<BirdLeaveArriveInfo> selectBirdLeaveArriveInfoList(BirdLeaveArriveInfo birdLeaveArriveInfo);
|
||||
|
||||
/**
|
||||
* 新增候鸟飞离和抵达时间
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdLeaveArriveInfo(BirdLeaveArriveInfo birdLeaveArriveInfo);
|
||||
|
||||
/**
|
||||
* 修改候鸟飞离和抵达时间
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdLeaveArriveInfo(BirdLeaveArriveInfo birdLeaveArriveInfo);
|
||||
|
||||
/**
|
||||
* 批量删除候鸟飞离和抵达时间
|
||||
*
|
||||
* @param ids 需要删除的候鸟飞离和抵达时间主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdLeaveArriveInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除候鸟飞离和抵达时间信息
|
||||
*
|
||||
* @param id 候鸟飞离和抵达时间主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdLeaveArriveInfoById(Long id);
|
||||
|
||||
void calcBirdLeaveArriveInfoByParam();
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdMedia;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类媒体Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-19
|
||||
*/
|
||||
public interface BirdMediaService {
|
||||
/**
|
||||
* 查询鸟类媒体
|
||||
*
|
||||
* @param id 鸟类媒体主键
|
||||
* @return 鸟类媒体
|
||||
*/
|
||||
public BirdMedia selectBirdMediaById(Long id);
|
||||
|
||||
/**
|
||||
* 查询鸟类媒体列表
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 鸟类媒体集合
|
||||
*/
|
||||
public List<BirdMedia> selectBirdMediaList(BirdMedia birdMedia);
|
||||
|
||||
/**
|
||||
* 新增鸟类媒体
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdMedia(BirdMedia birdMedia);
|
||||
|
||||
/**
|
||||
* 修改鸟类媒体
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdMedia(BirdMedia birdMedia);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类媒体
|
||||
*
|
||||
* @param ids 需要删除的鸟类媒体主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdMediaByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除鸟类媒体信息
|
||||
*
|
||||
* @param id 鸟类媒体主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdMediaById(Long id);
|
||||
|
||||
public AjaxResult uploadFile(MultipartFile file);
|
||||
|
||||
String getBirdIconImageBySpeciesId(Long speciesId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.hzvtc.bird.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 鸟类种类Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
public interface BirdSpeciesService {
|
||||
/**
|
||||
* 查询鸟类种类
|
||||
*
|
||||
* @param id 鸟类种类主键
|
||||
* @return 鸟类种类
|
||||
*/
|
||||
public BirdSpecies selectBirdSpeciesById(Long id);
|
||||
|
||||
public BirdSpecies selectBirdSpeciesByName(String name);
|
||||
|
||||
/**
|
||||
* 查询鸟类种类列表
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 鸟类种类集合
|
||||
*/
|
||||
public List<BirdSpecies> selectBirdSpeciesList(BirdSpecies birdSpecies);
|
||||
|
||||
/**
|
||||
* 新增鸟类种类
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBirdSpecies(BirdSpecies birdSpecies);
|
||||
|
||||
/**
|
||||
* 修改鸟类种类
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBirdSpecies(BirdSpecies birdSpecies);
|
||||
|
||||
/**
|
||||
* 批量删除鸟类种类
|
||||
*
|
||||
* @param ids 需要删除的鸟类种类主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdSpeciesByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除鸟类种类信息
|
||||
*
|
||||
* @param id 鸟类种类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBirdSpeciesById(Long id);
|
||||
|
||||
String importData(List<BirdSpecies> list, boolean updateSupport);
|
||||
|
||||
List<ResultMedia> getResultMediaListByParam(JSONObject jsonObject);
|
||||
|
||||
int recoverResultMediaStateByParam(JSONObject jsonObject);
|
||||
|
||||
List<ResultMedia> getResultAudioMediaListByParam(JSONObject jsonObject);
|
||||
|
||||
List<ResultMedia> getBirdMediaListByParam(JSONObject jsonObject);
|
||||
|
||||
List<BirdSpecies> getBirdSpeciesListByQuery(Map<String, Object> map);
|
||||
|
||||
Long getBirdSpeciesInfoIdByName(String name);
|
||||
|
||||
BirdSpecies selectBirdSpeciesForEsById(Long id);
|
||||
|
||||
List<BirdSpecies> getSpeciesSelectListByParam(Map<String, Object> param);
|
||||
|
||||
String getSpeciesNameById(Long id);
|
||||
|
||||
int updateSysSpeciesCode();
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdCatalogue;
|
||||
import net.hzvtc.bird.mapper.BirdCatalogueMapper;
|
||||
import net.hzvtc.bird.service.BirdCatalogueService;
|
||||
import net.hzvtc.common.exception.ServiceException;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.common.utils.bean.BeanValidators;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 鸟类目Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
@Service
|
||||
public class BirdCatalogueServiceImpl implements BirdCatalogueService {
|
||||
private static final Logger log = LoggerFactory.getLogger(BirdCatalogueServiceImpl.class);
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
@Resource
|
||||
private BirdCatalogueMapper birdCatalogueMapper;
|
||||
|
||||
/**
|
||||
* 查询鸟类目
|
||||
*
|
||||
* @param id 鸟类目主键
|
||||
* @return 鸟类目
|
||||
*/
|
||||
@Override
|
||||
public BirdCatalogue selectBirdCatalogueById(Long id) {
|
||||
return birdCatalogueMapper.selectBirdCatalogueById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BirdCatalogue selectBirdCatalogueByName(String name) {
|
||||
return birdCatalogueMapper.selectBirdCatalogueByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类目列表
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 鸟类目
|
||||
*/
|
||||
@Override
|
||||
public List<BirdCatalogue> selectBirdCatalogueList(BirdCatalogue birdCatalogue) {
|
||||
return birdCatalogueMapper.selectBirdCatalogueList(birdCatalogue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdCatalogue> getBirdCatalogueSelectList() {
|
||||
return birdCatalogueMapper.getBirdCatalogueSelectList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类目
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdCatalogue(BirdCatalogue birdCatalogue) {
|
||||
return birdCatalogueMapper.insertBirdCatalogue(birdCatalogue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类目
|
||||
*
|
||||
* @param birdCatalogue 鸟类目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdCatalogue(BirdCatalogue birdCatalogue) {
|
||||
return birdCatalogueMapper.updateBirdCatalogue(birdCatalogue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除鸟类目
|
||||
*
|
||||
* @param ids 需要删除的鸟类目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdCatalogueByIds(Long[] ids) {
|
||||
return birdCatalogueMapper.deleteBirdCatalogueByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类目信息
|
||||
*
|
||||
* @param id 鸟类目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdCatalogueById(Long id) {
|
||||
return birdCatalogueMapper.deleteBirdCatalogueById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importData(List<BirdCatalogue> list, boolean isUpdateSupport) {
|
||||
if (StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入鸟类目数据不能为空!");
|
||||
}
|
||||
AtomicInteger[] successNum = {new AtomicInteger()};
|
||||
int[] failureNum = {0};
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
list.forEach(data -> {
|
||||
try {
|
||||
BirdCatalogue catalogue = birdCatalogueMapper.selectBirdCatalogueByName(data.getName());
|
||||
if (Objects.isNull(catalogue)) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setIsDeleted(0);
|
||||
insertBirdCatalogue(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟类目 " + data.getName() + " 导入成功");
|
||||
} else if (isUpdateSupport) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setId(catalogue.getId());
|
||||
updateBirdCatalogue(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟类目 " + data.getName() + " 更新成功");
|
||||
} else {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟类目 " + data.getName() + " 已存在");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum[0]++;
|
||||
String msg = "<br/>" + failureNum + "、鸟类目 " + data.getName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
});
|
||||
if (failureNum[0] > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum[0] + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdCatalogue;
|
||||
import net.hzvtc.bird.domain.BirdFamily;
|
||||
import net.hzvtc.bird.mapper.BirdFamilyMapper;
|
||||
import net.hzvtc.bird.service.BirdCatalogueService;
|
||||
import net.hzvtc.bird.service.BirdFamilyService;
|
||||
import net.hzvtc.common.exception.ServiceException;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.common.utils.bean.BeanValidators;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 鸟类科Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-16
|
||||
*/
|
||||
@Service
|
||||
public class BirdFamilyServiceImpl implements BirdFamilyService {
|
||||
private static final Logger log = LoggerFactory.getLogger(BirdFamilyServiceImpl.class);
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
@Resource
|
||||
private BirdFamilyMapper birdFamilyMapper;
|
||||
@Autowired
|
||||
private BirdCatalogueService catalogueService;
|
||||
|
||||
/**
|
||||
* 查询鸟类科
|
||||
*
|
||||
* @param id 鸟类科主键
|
||||
* @return 鸟类科
|
||||
*/
|
||||
@Override
|
||||
public BirdFamily selectBirdFamilyById(Long id) {
|
||||
return birdFamilyMapper.selectBirdFamilyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类科列表
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 鸟类科
|
||||
*/
|
||||
@Override
|
||||
public List<BirdFamily> selectBirdFamilyList(BirdFamily birdFamily) {
|
||||
return birdFamilyMapper.selectBirdFamilyList(birdFamily);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdFamily> getBirdFamilyListByCataId(Long catalogueId) {
|
||||
return birdFamilyMapper.getBirdFamilyListByCataId(catalogueId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类科
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdFamily(BirdFamily birdFamily) {
|
||||
return birdFamilyMapper.insertBirdFamily(birdFamily);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类科
|
||||
*
|
||||
* @param birdFamily 鸟类科
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdFamily(BirdFamily birdFamily) {
|
||||
return birdFamilyMapper.updateBirdFamily(birdFamily);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除鸟类科
|
||||
*
|
||||
* @param ids 需要删除的鸟类科主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdFamilyByIds(Long[] ids) {
|
||||
return birdFamilyMapper.deleteBirdFamilyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类科信息
|
||||
*
|
||||
* @param id 鸟类科主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdFamilyById(Long id) {
|
||||
return birdFamilyMapper.deleteBirdFamilyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importData(List<BirdFamily> list, boolean isUpdateSupport) {
|
||||
if (StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入鸟类科数据不能为空!");
|
||||
}
|
||||
AtomicInteger[] successNum = {new AtomicInteger()};
|
||||
int[] failureNum = {0};
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
list.forEach(data -> {
|
||||
try {
|
||||
BirdFamily birdFamily = birdFamilyMapper.selectBirdFamilyByName(data.getFamilyName());
|
||||
BirdCatalogue birdCatalogue = catalogueService.selectBirdCatalogueByName(data.getCatalogueName());
|
||||
if (Objects.isNull(birdCatalogue)) {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟目 " + data.getFamilyName() + " 不存在");
|
||||
} else {
|
||||
if (Objects.isNull(birdFamily)) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setIsDeleted(0);
|
||||
data.setCatalogueId(birdCatalogue.getId());
|
||||
insertBirdFamily(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟科 " + data.getFamilyName() + " 导入成功");
|
||||
} else if (isUpdateSupport) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setId(birdFamily.getId());
|
||||
data.setCatalogueId(birdCatalogue.getId());
|
||||
updateBirdFamily(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟科 " + data.getFamilyName() + " 更新成功");
|
||||
} else {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟科 " + data.getFamilyName() + " 已存在");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum[0]++;
|
||||
String msg = "<br/>" + failureNum + "、鸟科 " + data.getFamilyName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
});
|
||||
if (failureNum[0] > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum[0] + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BirdFamily selectBirdFamilyByName(String name) {
|
||||
return birdFamilyMapper.selectBirdFamilyByName(name);
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFlyingInfo;
|
||||
import net.hzvtc.bird.mapper.BirdFlyingInfoMapper;
|
||||
import net.hzvtc.bird.service.BirdFlyingInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类越冬飞行路线图Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-30
|
||||
*/
|
||||
@Service
|
||||
public class BirdFlyingInfoServiceImpl implements BirdFlyingInfoService {
|
||||
@Resource
|
||||
private BirdFlyingInfoMapper birdFlyingInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图
|
||||
*
|
||||
* @param id 鸟类越冬飞行路线图主键
|
||||
* @return 鸟类越冬飞行路线图
|
||||
*/
|
||||
@Override
|
||||
public BirdFlyingInfo selectBirdFlyingInfoById(Long id) {
|
||||
return birdFlyingInfoMapper.selectBirdFlyingInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类越冬飞行路线图列表
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 鸟类越冬飞行路线图
|
||||
*/
|
||||
@Override
|
||||
public List<BirdFlyingInfo> selectBirdFlyingInfoList(BirdFlyingInfo birdFlyingInfo) {
|
||||
return birdFlyingInfoMapper.selectBirdFlyingInfoList(birdFlyingInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdFlyingInfo> getAllBirdFlyingInfoList() {
|
||||
return birdFlyingInfoMapper.getAllBirdFlyingInfoList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类越冬飞行路线图
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdFlyingInfo(BirdFlyingInfo birdFlyingInfo) {
|
||||
return birdFlyingInfoMapper.insertBirdFlyingInfo(birdFlyingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类越冬飞行路线图
|
||||
*
|
||||
* @param birdFlyingInfo 鸟类越冬飞行路线图
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdFlyingInfo(BirdFlyingInfo birdFlyingInfo) {
|
||||
return birdFlyingInfoMapper.updateBirdFlyingInfo(birdFlyingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除鸟类越冬飞行路线图
|
||||
*
|
||||
* @param ids 需要删除的鸟类越冬飞行路线图主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdFlyingInfoByIds(Long[] ids) {
|
||||
return birdFlyingInfoMapper.deleteBirdFlyingInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类越冬飞行路线图信息
|
||||
*
|
||||
* @param id 鸟类越冬飞行路线图主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdFlyingInfoById(Long id) {
|
||||
return birdFlyingInfoMapper.deleteBirdFlyingInfoById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import net.hzvtc.bird.domain.BirdFamily;
|
||||
import net.hzvtc.bird.domain.BirdGenus;
|
||||
import net.hzvtc.bird.mapper.BirdGenusMapper;
|
||||
import net.hzvtc.bird.service.BirdFamilyService;
|
||||
import net.hzvtc.bird.service.BirdGenusService;
|
||||
import net.hzvtc.common.exception.ServiceException;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.common.utils.bean.BeanValidators;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 鸟类属Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
@Service
|
||||
public class BirdGenusServiceImpl implements BirdGenusService {
|
||||
private static final Logger log = LoggerFactory.getLogger(BirdGenusServiceImpl.class);
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
@Resource
|
||||
private BirdGenusMapper birdGenusMapper;
|
||||
@Autowired
|
||||
private BirdFamilyService familyService;
|
||||
|
||||
/**
|
||||
* 查询鸟类属
|
||||
*
|
||||
* @param id 鸟类属主键
|
||||
* @return 鸟类属
|
||||
*/
|
||||
@Override
|
||||
public BirdGenus selectBirdGenusById(Long id) {
|
||||
BirdGenus data = birdGenusMapper.selectBirdGenusById(id);
|
||||
if (data.getFamilyId() != null) {
|
||||
BirdFamily birdFamily = familyService.selectBirdFamilyById(data.getFamilyId());
|
||||
data.setCatalogueId(birdFamily.getCatalogueId());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类属列表
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 鸟类属
|
||||
*/
|
||||
@Override
|
||||
public List<BirdGenus> selectBirdGenusList(BirdGenus birdGenus) {
|
||||
return birdGenusMapper.selectBirdGenusList(birdGenus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类属
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdGenus(BirdGenus birdGenus) {
|
||||
return birdGenusMapper.insertBirdGenus(birdGenus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类属
|
||||
*
|
||||
* @param birdGenus 鸟类属
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdGenus(BirdGenus birdGenus) {
|
||||
return birdGenusMapper.updateBirdGenus(birdGenus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除鸟类属
|
||||
*
|
||||
* @param ids 需要删除的鸟类属主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdGenusByIds(Long[] ids) {
|
||||
return birdGenusMapper.deleteBirdGenusByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类属信息
|
||||
*
|
||||
* @param id 鸟类属主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdGenusById(Long id) {
|
||||
return birdGenusMapper.deleteBirdGenusById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdGenus> getBirdGenusListByFamilyId(Long familyId) {
|
||||
return birdGenusMapper.getBirdGenusListByFamilyId(familyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importData(List<BirdGenus> list, boolean isUpdateSupport) {
|
||||
if (StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入鸟类属数据不能为空!");
|
||||
}
|
||||
AtomicInteger[] successNum = {new AtomicInteger()};
|
||||
int[] failureNum = {0};
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
list.forEach(data -> {
|
||||
try {
|
||||
BirdGenus birdGenus = birdGenusMapper.selectBirdGenusByName(data.getName());
|
||||
BirdFamily birdFamily = familyService.selectBirdFamilyByName(data.getFamilyName());
|
||||
if (Objects.isNull(birdFamily)) {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟科 " + data.getFamilyName() + " 不存在");
|
||||
} else {
|
||||
if (Objects.isNull(birdGenus)) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setIsDeleted(0);
|
||||
data.setFamilyId(birdFamily.getId());
|
||||
insertBirdGenus(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟属 " + data.getFamilyName() + " 导入成功");
|
||||
} else if (isUpdateSupport) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setId(birdGenus.getId());
|
||||
data.setFamilyId(birdFamily.getId());
|
||||
updateBirdGenus(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟属 " + data.getFamilyName() + " 更新成功");
|
||||
} else {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟属 " + data.getFamilyName() + " 已存在");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum[0]++;
|
||||
String msg = "<br/>" + failureNum + "、鸟属 " + data.getFamilyName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
});
|
||||
if (failureNum[0] > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum[0] + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BirdGenus selectBirdGenusByName(String name) {
|
||||
return birdGenusMapper.selectBirdGenusByName(name);
|
||||
}
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.bird.domain.BirdLeaveArriveInfo;
|
||||
import net.hzvtc.bird.mapper.BirdLeaveArriveInfoMapper;
|
||||
import net.hzvtc.bird.service.BirdLeaveArriveInfoService;
|
||||
import net.hzvtc.data.check.service.ResultRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 候鸟飞离和抵达时间Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-03-27
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BirdLeaveArriveInfoServiceImpl implements BirdLeaveArriveInfoService {
|
||||
@Resource
|
||||
private BirdLeaveArriveInfoMapper birdLeaveArriveInfoMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ResultRecordService resultRecordService;
|
||||
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间
|
||||
*
|
||||
* @param id 候鸟飞离和抵达时间主键
|
||||
* @return 候鸟飞离和抵达时间
|
||||
*/
|
||||
@Override
|
||||
public BirdLeaveArriveInfo selectBirdLeaveArriveInfoById(Long id) {
|
||||
return birdLeaveArriveInfoMapper.selectBirdLeaveArriveInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询候鸟飞离和抵达时间列表
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 候鸟飞离和抵达时间
|
||||
*/
|
||||
@Override
|
||||
public List<BirdLeaveArriveInfo> selectBirdLeaveArriveInfoList(BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
return birdLeaveArriveInfoMapper.selectBirdLeaveArriveInfoList(birdLeaveArriveInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增候鸟飞离和抵达时间
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdLeaveArriveInfo(BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
return birdLeaveArriveInfoMapper.insertBirdLeaveArriveInfo(birdLeaveArriveInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改候鸟飞离和抵达时间
|
||||
*
|
||||
* @param birdLeaveArriveInfo 候鸟飞离和抵达时间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdLeaveArriveInfo(BirdLeaveArriveInfo birdLeaveArriveInfo) {
|
||||
return birdLeaveArriveInfoMapper.updateBirdLeaveArriveInfo(birdLeaveArriveInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除候鸟飞离和抵达时间
|
||||
*
|
||||
* @param ids 需要删除的候鸟飞离和抵达时间主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdLeaveArriveInfoByIds(Long[] ids) {
|
||||
return birdLeaveArriveInfoMapper.deleteBirdLeaveArriveInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除候鸟飞离和抵达时间信息
|
||||
*
|
||||
* @param id 候鸟飞离和抵达时间主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdLeaveArriveInfoById(Long id) {
|
||||
return birdLeaveArriveInfoMapper.deleteBirdLeaveArriveInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcBirdLeaveArriveInfoByParam() {
|
||||
Integer statYear = LocalDate.now().getYear() - 1;
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<Long> areaIds = resultRecordService.getResultAreaListByParam(map);
|
||||
List<BirdLeaveArriveInfo> allList = new ArrayList<>();
|
||||
areaIds.stream().forEach(areaId -> {
|
||||
map.put("areaId", areaId);
|
||||
map.put("statYear", statYear + 1);
|
||||
List<BirdLeaveArriveInfo> leaveList = birdLeaveArriveInfoMapper.getBirdLeaveDateByParam(map);
|
||||
|
||||
map.put("statYear", statYear);
|
||||
List<BirdLeaveArriveInfo> arriveList = birdLeaveArriveInfoMapper.getBirdArrivalDateByParam(map);
|
||||
|
||||
leaveList = concatList(leaveList, arriveList);
|
||||
if (leaveList != null) {
|
||||
leaveList.forEach(item -> {
|
||||
item.setAreaId(areaId);
|
||||
item.setStatYear(statYear);
|
||||
item.setIsDeleted(0);
|
||||
});
|
||||
allList.addAll(leaveList);
|
||||
}
|
||||
});
|
||||
if (!allList.isEmpty()) {
|
||||
birdLeaveArriveInfoMapper.batchInsertBirdLeaveArriveInfo(allList);
|
||||
}
|
||||
}
|
||||
|
||||
private List<BirdLeaveArriveInfo> concatList(List<BirdLeaveArriveInfo> leaveList, List<BirdLeaveArriveInfo> arriveList) {
|
||||
if (leaveList == null || leaveList.isEmpty()) {
|
||||
return arriveList;
|
||||
} else if (arriveList == null || arriveList.isEmpty()) {
|
||||
return leaveList;
|
||||
}
|
||||
|
||||
leaveList.forEach(item -> {
|
||||
List<BirdLeaveArriveInfo> sameList = arriveList.stream().filter(aitem -> aitem.getSpeciesId() == item.getSpeciesId()).collect(Collectors.toList());
|
||||
|
||||
if (!sameList.isEmpty()) {
|
||||
item.setArriveDate(sameList.get(0).getArriveDate());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
leaveList.forEach(item -> {
|
||||
List<BirdLeaveArriveInfo> sameList = leaveList.stream().filter(aitem -> aitem.getSpeciesId() == item.getSpeciesId()).collect(Collectors.toList());
|
||||
if (sameList == null || sameList.size() == 0) {
|
||||
leaveList.add(item);
|
||||
}
|
||||
});
|
||||
return leaveList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.hzvtc.bird.domain.BirdMedia;
|
||||
import net.hzvtc.bird.mapper.BirdMediaMapper;
|
||||
import net.hzvtc.bird.service.BirdMediaService;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.redis.RedisCache;
|
||||
import net.hzvtc.common.utils.DateUtils;
|
||||
import net.hzvtc.common.utils.file.FileUploadUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 鸟类媒体Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-19
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BirdMediaServiceImpl implements BirdMediaService {
|
||||
@Resource
|
||||
private BirdMediaMapper birdMediaMapper;
|
||||
|
||||
private final RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 查询鸟类媒体
|
||||
*
|
||||
* @param id 鸟类媒体主键
|
||||
* @return 鸟类媒体
|
||||
*/
|
||||
@Override
|
||||
public BirdMedia selectBirdMediaById(Long id) {
|
||||
return birdMediaMapper.selectBirdMediaById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类媒体列表
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 鸟类媒体
|
||||
*/
|
||||
@Override
|
||||
public List<BirdMedia> selectBirdMediaList(BirdMedia birdMedia) {
|
||||
return birdMediaMapper.selectBirdMediaList(birdMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类媒体
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdMedia(BirdMedia birdMedia) {
|
||||
birdMedia.setCreateTime(DateUtils.getNowDate());
|
||||
return birdMediaMapper.insertBirdMedia(birdMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类媒体
|
||||
*
|
||||
* @param birdMedia 鸟类媒体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdMedia(BirdMedia birdMedia) {
|
||||
return birdMediaMapper.updateBirdMedia(birdMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除鸟类媒体
|
||||
*
|
||||
* @param ids 需要删除的鸟类媒体主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdMediaByIds(Long[] ids) {
|
||||
return birdMediaMapper.deleteBirdMediaByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类媒体信息
|
||||
*
|
||||
* @param id 鸟类媒体主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdMediaById(Long id) {
|
||||
return birdMediaMapper.deleteBirdMediaById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult uploadFile(MultipartFile file) {
|
||||
String fileName = file.getOriginalFilename();
|
||||
String mediaType = getMediaType(fileName);
|
||||
String baseDir = FileUploadUtils.getBirdMediaPath() + "/" + mediaType;
|
||||
try {
|
||||
BirdMedia data = new BirdMedia();
|
||||
String path = FileUploadUtils.upload(baseDir, file);
|
||||
data.setMediaType(mediaType);
|
||||
data.setName(removeFileExt(fileName));
|
||||
data.setUrl(path);
|
||||
return AjaxResult.success(data);
|
||||
} catch (IOException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBirdIconImageBySpeciesId(Long speciesId) {
|
||||
String key = "birdIcon_" + speciesId;
|
||||
String str = redisCache.getCacheObject(key);
|
||||
if (str == null) {
|
||||
str = birdMediaMapper.getBirdIconImageBySpeciesId(speciesId);
|
||||
redisCache.setCacheObject(key, str);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
private String removeFileExt(String fileName) {
|
||||
int pos = fileName.lastIndexOf(".");
|
||||
if (pos == -1) {
|
||||
return fileName;
|
||||
} else {
|
||||
return fileName.substring(0, pos);
|
||||
}
|
||||
}
|
||||
|
||||
private String getMediaType(String fileName) {
|
||||
int pos = fileName.lastIndexOf(".");
|
||||
if (pos == -1) {
|
||||
return "";
|
||||
}
|
||||
String ext = fileName.substring(pos + 1);
|
||||
if (ext.equalsIgnoreCase("png") || ext.equalsIgnoreCase("jpg") || ext.equalsIgnoreCase("jpeg")) {
|
||||
return "images";
|
||||
} else if (ext.equalsIgnoreCase("mp3") || ext.equalsIgnoreCase("wav")) {
|
||||
return "audio";
|
||||
} else if (ext.equalsIgnoreCase("mp4") || ext.equalsIgnoreCase("mkv") || ext.equalsIgnoreCase("m4v") || ext.equalsIgnoreCase("wmv")) {
|
||||
return "video";
|
||||
} else {
|
||||
return "file";
|
||||
}
|
||||
}
|
||||
}
|
||||
+296
@@ -0,0 +1,296 @@
|
||||
package net.hzvtc.bird.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.bird.domain.BirdGenus;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.bird.mapper.BirdSpeciesMapper;
|
||||
import net.hzvtc.bird.service.BirdGenusService;
|
||||
import net.hzvtc.bird.service.BirdSpeciesService;
|
||||
import net.hzvtc.common.exception.ServiceException;
|
||||
import net.hzvtc.common.utils.DateUtils;
|
||||
import net.hzvtc.common.utils.SecurityUtils;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.common.utils.bean.BeanValidators;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import net.hzvtc.data.check.service.ResultMediaService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 鸟类种类Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-18
|
||||
*/
|
||||
@Service
|
||||
public class BirdSpeciesServiceImpl implements BirdSpeciesService {
|
||||
private static final Logger log = LoggerFactory.getLogger(BirdSpeciesServiceImpl.class);
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
@Resource
|
||||
private BirdSpeciesMapper birdSpeciesMapper;
|
||||
@Autowired
|
||||
private BirdGenusService genusService;
|
||||
@Autowired
|
||||
private ResultMediaService resultMediaService;
|
||||
|
||||
/**
|
||||
* 查询鸟类种类
|
||||
*
|
||||
* @param id 鸟类种类主键
|
||||
* @return 鸟类种类
|
||||
*/
|
||||
@Override
|
||||
public BirdSpecies selectBirdSpeciesById(Long id) {
|
||||
return birdSpeciesMapper.selectBirdSpeciesById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BirdSpecies selectBirdSpeciesByName(String name) {
|
||||
return birdSpeciesMapper.selectBirdSpeciesByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询鸟类种类列表
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 鸟类种类
|
||||
*/
|
||||
@Override
|
||||
public List<BirdSpecies> selectBirdSpeciesList(BirdSpecies birdSpecies) {
|
||||
return birdSpeciesMapper.selectBirdSpeciesList(birdSpecies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增鸟类种类
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBirdSpecies(BirdSpecies birdSpecies) {
|
||||
birdSpecies.setCreateTime(DateUtils.getNowDate());
|
||||
birdSpecies.setIsDeleted(0);
|
||||
birdSpecies.setCreateBy("admin");
|
||||
return birdSpeciesMapper.insertBirdSpecies(birdSpecies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改鸟类种类
|
||||
*
|
||||
* @param birdSpecies 鸟类种类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBirdSpecies(BirdSpecies birdSpecies) {
|
||||
birdSpecies.setUpdateTime(DateUtils.getNowDate());
|
||||
birdSpecies.setUpdateBy(SecurityUtils.getUsername());
|
||||
return birdSpeciesMapper.updateBirdSpecies(birdSpecies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除鸟类种类
|
||||
*
|
||||
* @param ids 需要删除的鸟类种类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdSpeciesByIds(Long[] ids) {
|
||||
return birdSpeciesMapper.deleteBirdSpeciesByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鸟类种类信息
|
||||
*
|
||||
* @param id 鸟类种类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBirdSpeciesById(Long id) {
|
||||
return birdSpeciesMapper.deleteBirdSpeciesById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importData(List<BirdSpecies> list, boolean updateSupport) {
|
||||
if (StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入鸟类数据不能为空!");
|
||||
}
|
||||
AtomicInteger[] successNum = {new AtomicInteger()};
|
||||
int[] failureNum = {0};
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
list.forEach(data -> {
|
||||
try {
|
||||
BirdSpecies birdSpecies = birdSpeciesMapper.selectBirdSpeciesByName(data.getName());
|
||||
BirdGenus birdGenus = genusService.selectBirdGenusByName(data.getGenusName());
|
||||
if (Objects.isNull(birdGenus)) {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟属 " + data.getGenusName() + " 不存在");
|
||||
} else {
|
||||
if (Objects.isNull(birdSpecies)) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setIsDeleted(0);
|
||||
data.setGenusId(birdGenus.getId());
|
||||
data.setFamilyId(birdGenus.getFamilyId());
|
||||
insertBirdSpecies(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟类 " + data.getName() + " 导入成功");
|
||||
} else if (updateSupport) {
|
||||
BeanValidators.validateWithException(validator, data);
|
||||
data.setId(birdSpecies.getId());
|
||||
data.setGenusId(birdGenus.getId());
|
||||
data.setFamilyId(birdGenus.getFamilyId());
|
||||
updateBirdSpecies(data);
|
||||
successNum[0].getAndIncrement();
|
||||
successMsg.append("<br/>" + successNum[0] + "、鸟类 " + data.getName() + " 更新成功");
|
||||
} else {
|
||||
failureNum[0]++;
|
||||
failureMsg.append("<br/>" + failureNum[0] + "、鸟类 " + data.getName() + " 已存在");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum[0]++;
|
||||
String msg = "<br/>" + failureNum + "、鸟类 " + data.getName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
});
|
||||
if (failureNum[0] > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum[0] + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getResultMediaListByParam(JSONObject jsonObject) {
|
||||
Long mediaId = jsonObject.getLong("mediaId");
|
||||
if (mediaId != null) {
|
||||
List<ResultMedia> list = new ArrayList<>();
|
||||
ResultMedia data = resultMediaService.getResultMediaListById(mediaId);
|
||||
list.add(data);
|
||||
return list;
|
||||
} else {
|
||||
return resultMediaService.getResultMediaListByParam(createQueryParameter(jsonObject));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recoverResultMediaStateByParam(JSONObject jsonObject) {
|
||||
return resultMediaService.recoverResultMediaStateByParam(createQueryParameter(jsonObject));
|
||||
}
|
||||
|
||||
private Map<String, Object> createQueryParameter(JSONObject jsonObject) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long mediaId = jsonObject.getLong("mediaId");
|
||||
map.put("mediaId", mediaId);
|
||||
|
||||
Long areaId = jsonObject.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
|
||||
String mediaType = jsonObject.getString("mediaType");
|
||||
map.put("mediaType", mediaType);
|
||||
|
||||
Long speciesId = jsonObject.getLong("speciesId");
|
||||
map.put("speciesId", speciesId);
|
||||
|
||||
Long deviceId = jsonObject.getLong("deviceId");
|
||||
map.put("deviceId", deviceId);
|
||||
|
||||
String mediaTypes = jsonObject.getString("mediaTypes");
|
||||
if (mediaTypes != null && !mediaTypes.isEmpty()) {
|
||||
String[] arr = mediaTypes.split(",");
|
||||
map.put("mediaTypes", arr);
|
||||
}
|
||||
Integer isDeleted = jsonObject.getInteger("isDeleted");
|
||||
map.put("isDeleted", isDeleted);
|
||||
String dateFrom = jsonObject.getString("dateFrom");
|
||||
map.put("dateFrom", dateFrom);
|
||||
String dateTo = jsonObject.getString("dateTo");
|
||||
map.put("dateTo", dateTo);
|
||||
Integer limit = jsonObject.getInteger("limit");
|
||||
map.put("limit", limit);
|
||||
Integer isCommon = jsonObject.getInteger("isCommon");
|
||||
map.put("isCommon", isCommon);
|
||||
// log.info("======map==={}", map);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getResultAudioMediaListByParam(JSONObject jsonObject) {
|
||||
return resultMediaService.getResultAudioMediaListByParam(createQueryParameter(jsonObject));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getBirdMediaListByParam(JSONObject jsonObject) {
|
||||
Map<String, Object> map = createQueryParameter(jsonObject);
|
||||
String dateFrom = jsonObject.getString("dateFrom");
|
||||
String dateTo = jsonObject.getString("dateTo");
|
||||
|
||||
// if (dateFrom == null && dateTo == null) {
|
||||
// LocalDate localDate = LocalDate.now();
|
||||
// dateTo = localDate.toString();
|
||||
// localDate = localDate.plusDays(-7);
|
||||
// dateFrom = localDate.toString();
|
||||
// }
|
||||
if (SecurityUtils.getDeptId() == 0) {
|
||||
map.put("userId", SecurityUtils.getUserId());
|
||||
}
|
||||
map.put("dateFrom", dateFrom);
|
||||
map.put("dateTo", dateTo);
|
||||
Integer recordType = jsonObject.getInteger("recordType");
|
||||
map.put("recordType", recordType);
|
||||
Integer recordTypeNot = jsonObject.getInteger("recordTypeNot");
|
||||
map.put("recordTypeNot", recordTypeNot);
|
||||
Integer pageLimit = jsonObject.getInteger("pageLimit");
|
||||
map.put("pageLimit", pageLimit);
|
||||
return resultMediaService.getBirdMediaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdSpecies> getBirdSpeciesListByQuery(Map<String, Object> map) {
|
||||
return birdSpeciesMapper.getBirdSpeciesListByQuery(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getBirdSpeciesInfoIdByName(String name) {
|
||||
List<BirdSpecies> list = birdSpeciesMapper.getBirdSpeciesInfoByName(name);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
return list.get(0).getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BirdSpecies selectBirdSpeciesForEsById(Long id) {
|
||||
return birdSpeciesMapper.selectBirdSpeciesForEsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdSpecies> getSpeciesSelectListByParam(Map<String, Object> param) {
|
||||
return birdSpeciesMapper.getSpeciesSelectListByParam(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSpeciesNameById(Long id) {
|
||||
return birdSpeciesMapper.getSpeciesNameById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateSysSpeciesCode() {
|
||||
birdSpeciesMapper.deleteSysSpeciesCode();
|
||||
birdSpeciesMapper.insertSysSpeciesCode();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package net.hzvtc.data.check.controller;
|
||||
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.check.domain.FavoriteMedia;
|
||||
import net.hzvtc.data.check.service.FavoriteMediaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收藏的视频Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/media/favorite")
|
||||
public class FavoriteMediaController extends BaseController {
|
||||
@Autowired
|
||||
private FavoriteMediaService favoriteMediaService;
|
||||
|
||||
/**
|
||||
* 查询收藏的视频列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('media:favorite:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FavoriteMedia favoriteMedia) {
|
||||
startPage();
|
||||
List<FavoriteMedia> list = favoriteMediaService.selectFavoriteMediaList(favoriteMedia);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出收藏的视频列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('media:favorite:export')")
|
||||
@Log(title = "收藏的视频", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FavoriteMedia favoriteMedia) {
|
||||
List<FavoriteMedia> list = favoriteMediaService.selectFavoriteMediaList(favoriteMedia);
|
||||
ExcelUtil<FavoriteMedia> util = new ExcelUtil<>(FavoriteMedia.class);
|
||||
util.exportExcel(response, list, "收藏的视频数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收藏的视频详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('media:favorite:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(favoriteMediaService.selectFavoriteMediaById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收藏的视频
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('media:favorite:add')")
|
||||
@Log(title = "收藏的视频", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FavoriteMedia favoriteMedia) {
|
||||
return toAjax(favoriteMediaService.insertFavoriteMedia(favoriteMedia));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收藏的视频
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('media:favorite:edit')")
|
||||
@Log(title = "收藏的视频", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FavoriteMedia favoriteMedia) {
|
||||
return toAjax(favoriteMediaService.updateFavoriteMedia(favoriteMedia));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收藏的视频
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('media:favorite:remove')")
|
||||
@Log(title = "收藏的视频", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(favoriteMediaService.deleteFavoriteMediaByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/byMediaId/{id}")
|
||||
public AjaxResult getFavoriteIdByMediaId(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(favoriteMediaService.getFavoriteMediaByMediaId(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getHeartId/{id}")
|
||||
public AjaxResult getHeartIdByMediaId(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(favoriteMediaService.getHeartMediaByMediaId(id));
|
||||
}
|
||||
|
||||
@PostMapping("/handle")
|
||||
public AjaxResult handleAction(@RequestBody FavoriteMedia favoriteMedia) {
|
||||
return AjaxResult.success(favoriteMediaService.handleAction(favoriteMedia));
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package net.hzvtc.data.check.controller;
|
||||
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.data.check.service.MediaItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dataCheck/mediaItem")
|
||||
public class MediaItemController extends BaseController {
|
||||
@Autowired
|
||||
private MediaItemService mediaItemService;
|
||||
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(mediaItemService.selectMediaItemById(id));
|
||||
}
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package net.hzvtc.data.check.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import net.hzvtc.data.check.service.ResultMediaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测结果附件Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-01-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataCheck/resultMedia")
|
||||
public class ResultMediaController extends BaseController {
|
||||
@Autowired
|
||||
private ResultMediaService resultMediaService;
|
||||
|
||||
/**
|
||||
* 查询监测结果附件列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:resultMedia:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ResultMedia resultMedia) {
|
||||
startPage();
|
||||
List<ResultMedia> list = resultMediaService.selectResultMediaListByParam(resultMedia);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出监测结果附件列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:resultMedia:export')")
|
||||
@Log(title = "监测结果附件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ResultMedia resultMedia) {
|
||||
List<ResultMedia> list = resultMediaService.selectResultMediaList(resultMedia);
|
||||
ExcelUtil<ResultMedia> util = new ExcelUtil<ResultMedia>(ResultMedia.class);
|
||||
util.exportExcel(response, list, "监测媒体数据");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增监测结果附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:resultMedia:add')")
|
||||
@Log(title = "监测结果附件", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ResultMedia resultMedia) {
|
||||
return toAjax(resultMediaService.insertResultMedia(resultMedia));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除监测结果附件
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:resultMedia:remove')")
|
||||
@Log(title = "监测结果附件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{mediaIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] mediaIds) {
|
||||
return toAjax(resultMediaService.deleteResultMediaByMediaIds(mediaIds));
|
||||
}
|
||||
|
||||
@PostMapping("/updateStatus")
|
||||
public AjaxResult updateStatus(@RequestBody ResultMedia param) {
|
||||
return AjaxResult.success(resultMediaService.updateResultMediaStatusByParam(param));
|
||||
}
|
||||
|
||||
@PostMapping("/favoriteList")
|
||||
public AjaxResult getFavoriteList(@RequestBody JSONObject object) {
|
||||
return AjaxResult.success(resultMediaService.getFavoriteVideoListByParam(object));
|
||||
}
|
||||
|
||||
@GetMapping("/mediaStatInfo")
|
||||
public JSONObject getStatAmount() {
|
||||
return resultMediaService.getResultMediaStatByParam();
|
||||
}
|
||||
|
||||
@GetMapping("/mediaListByItemId")
|
||||
public AjaxResult getResultMediaListByItemId(Long itemId){
|
||||
return AjaxResult.success(resultMediaService.getResultMediaListByItemId(itemId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
package net.hzvtc.data.check.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.file.FileUtils;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.check.domain.ResultRecord;
|
||||
import net.hzvtc.data.check.service.ResultRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测结果记录Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/dataCheck/checkRecord")
|
||||
public class ResultRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ResultRecordService resultRecordService;
|
||||
|
||||
/**
|
||||
* 查询监测结果记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:checkRecord:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ResultRecord resultRecord) {
|
||||
startPage();
|
||||
List<ResultRecord> list = resultRecordService.selectResultRecordList(resultRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出监测结果记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:checkRecord:export')")
|
||||
@Log(title = "监测结果记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ResultRecord resultRecord) {
|
||||
List<ResultRecord> list = resultRecordService.selectResultRecordList(resultRecord);
|
||||
ExcelUtil<ResultRecord> util = new ExcelUtil<ResultRecord>(ResultRecord.class);
|
||||
util.exportExcel(response, list, "监测结果记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监测结果记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:checkRecord:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId) {
|
||||
return AjaxResult.success(resultRecordService.selectResultRecordByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测结果记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:checkRecord:add')")
|
||||
@Log(title = "监测结果记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ResultRecord resultRecord) {
|
||||
return toAjax(resultRecordService.insertResultRecord(resultRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测结果记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:checkRecord:edit')")
|
||||
@Log(title = "监测结果记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ResultRecord resultRecord) {
|
||||
return toAjax(resultRecordService.updateResultRecord(resultRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监测结果记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataCheck:checkRecord:remove')")
|
||||
@Log(title = "监测结果记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds) {
|
||||
return toAjax(resultRecordService.deleteResultRecordByRecordIds(recordIds));
|
||||
}
|
||||
|
||||
@PostMapping("/getBirdStatData")
|
||||
public AjaxResult getBirdStatData(@RequestBody JSONObject object) {
|
||||
return AjaxResult.success(resultRecordService.getBirdDataStatByParam(object));
|
||||
}
|
||||
|
||||
@PostMapping("/getBirdWeeklyStatData")
|
||||
public AjaxResult getBirdWeeklyStatData(@RequestBody JSONObject object) {
|
||||
return AjaxResult.success(resultRecordService.getBirdDataWeeklyStatByParam(object));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/sendEmail")
|
||||
public AjaxResult sendEmail(@RequestBody JSONObject object) {
|
||||
return AjaxResult.success(resultRecordService.sendBirdDataStatEmail(object));
|
||||
}
|
||||
|
||||
@PostMapping("/sendWeeklyEmail")
|
||||
public AjaxResult sendWeeklyEmail(@RequestBody JSONObject object) {
|
||||
return AjaxResult.success(resultRecordService.sendBirdDataWeeklyStatEmail(object));
|
||||
}
|
||||
|
||||
@PostMapping("/downloadReport")
|
||||
public void downloadReport(@RequestParam Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("areaId", params.get("areaId"));
|
||||
obj.put("calcDate", params.get("calcDate"));
|
||||
String filePath = resultRecordService.getBirdDataStatFileByParam(obj);
|
||||
// System.out.println("========filePath============" + filePath);
|
||||
if (filePath != null) {
|
||||
try {
|
||||
String realFileName = System.currentTimeMillis() + ".xlsx";
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/downloadWeeklyReport")
|
||||
public void downloadWeeklyReport(@RequestParam Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("areaId", params.get("areaId"));
|
||||
obj.put("calcDate", params.get("calcDate"));
|
||||
String filePath = resultRecordService.getBirdDataWeeklyStatFileByParam(obj);
|
||||
if (filePath != null) {
|
||||
try {
|
||||
String realFileName = System.currentTimeMillis() + ".xlsx";
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package net.hzvtc.data.check.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.check.domain.ResultRecordDetails;
|
||||
import net.hzvtc.data.check.service.ResultRecordDetailsService;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测记录详细信息Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataCheck/checkDetails")
|
||||
public class ResultRecordDetailsController extends BaseController {
|
||||
@Autowired
|
||||
private ResultRecordDetailsService resultRecordDetailsService;
|
||||
|
||||
/**
|
||||
* 查询监测记录详细信息列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:checkDetails:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ResultRecordDetails resultRecordDetails) {
|
||||
startPage();
|
||||
List<ResultRecordDetails> list = resultRecordDetailsService.selectResultRecordDetailsList(resultRecordDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出监测记录详细信息列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:checkDetails:export')")
|
||||
@Log(title = "监测记录详细信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ResultRecordDetails resultRecordDetails) {
|
||||
List<ResultRecordDetails> list = resultRecordDetailsService.selectResultRecordDetailsList(resultRecordDetails);
|
||||
ExcelUtil<ResultRecordDetails> util = new ExcelUtil<>(ResultRecordDetails.class);
|
||||
util.exportExcel(response, list, "监测记录详细信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监测记录详细信息详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:checkDetails:query')")
|
||||
@GetMapping(value = "/{detailsId}")
|
||||
public AjaxResult getInfo(@PathVariable("detailsId") Long detailsId) {
|
||||
return AjaxResult.success(resultRecordDetailsService.selectResultRecordDetailsByDetailsId(detailsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测记录详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:checkDetails:add')")
|
||||
@Log(title = "监测记录详细信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ResultRecordDetails resultRecordDetails) {
|
||||
return toAjax(resultRecordDetailsService.insertResultRecordDetails(resultRecordDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测记录详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:checkDetails:edit')")
|
||||
@Log(title = "监测记录详细信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Long edit(@RequestBody ResultRecordDetails resultRecordDetails) {
|
||||
return resultRecordDetailsService.updateResultRecordDetails(resultRecordDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监测记录详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('dataCheck:checkDetails:remove')")
|
||||
@Log(title = "监测记录详细信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailsIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] detailsIds) {
|
||||
return toAjax(resultRecordDetailsService.deleteResultRecordDetailsByDetailsIds(detailsIds));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/areaSpeciesListByParam")
|
||||
public AjaxResult getSpeciesListByParam() {
|
||||
return AjaxResult.success(resultRecordDetailsService.getSpeciesListByParam());
|
||||
}
|
||||
|
||||
@PostMapping("/updateCheckState")
|
||||
public AjaxResult updateCheckedState(@RequestBody JSONObject params) {
|
||||
Long id = params.getLong("id");
|
||||
return AjaxResult.success(resultRecordDetailsService.updateResultRecordDetailsCheckState(id));
|
||||
}
|
||||
|
||||
@PostMapping("/delRecordDetails")
|
||||
public AjaxResult delRecordDetails(@RequestBody JSONObject obj) {
|
||||
return AjaxResult.success(resultRecordDetailsService.deleteResultRecordDetails(obj));
|
||||
}
|
||||
|
||||
@GetMapping("/speciesListByUserId")
|
||||
public AjaxResult getSpeciesListByUserId(Long areaId) {
|
||||
return AjaxResult.success(resultRecordDetailsService.getSpeciesListByUserId(areaId));
|
||||
}
|
||||
|
||||
@PostMapping("/speciesMediaList")
|
||||
public TableDataInfo getSpeciesMediaListByParam(@RequestBody JSONObject params) {
|
||||
Integer pageNum = params.getInteger("pageNum");
|
||||
Integer pageSize = params.getInteger("pageSize");
|
||||
startPage(pageNum == null ? 1 : pageNum, pageSize == null ? 10 : pageSize);
|
||||
List<BirdStatDataVo> list = resultRecordDetailsService.getSpeciesMediaListByParam(params);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/speciesHourAmount")
|
||||
public JSONArray getSpeciesHourAmountListByParam(@RequestBody JSONObject params) {
|
||||
return resultRecordDetailsService.getSpeciesHourAmountListByParam(params);
|
||||
}
|
||||
|
||||
@PostMapping("/speciesAudioAmountListByParam")
|
||||
public JSONObject getSpeciesAudioAmountReportByParam(@RequestBody JSONObject param) {
|
||||
return resultRecordDetailsService.getSpeciesAudioAmountReportByParam(param);
|
||||
}
|
||||
|
||||
@PostMapping("/modifyDetailsByParam")
|
||||
public AjaxResult modifyDetailsByParam(@RequestBody ResultRecordDetails data) {
|
||||
return AjaxResult.success(resultRecordDetailsService.modifyRecordDetails(data));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.hzvtc.data.check.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 收藏的视频对象 favorite_media
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@Data
|
||||
@Alias("FavoriteMedia")
|
||||
public class FavoriteMedia implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 视频ID
|
||||
*/
|
||||
@Excel(name = "视频ID")
|
||||
private Long mediaId;
|
||||
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
private Long speciesId;
|
||||
|
||||
private Integer type = 0;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private int isDeleted;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("mediaId", getMediaId())
|
||||
.append("userId", getUserId())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package net.hzvtc.data.check.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 视频(图像)状态参数对象 media_item
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@Data
|
||||
@Alias("MediaItem")
|
||||
public class MediaItem implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 相机ID
|
||||
*/
|
||||
@Excel(name = "相机ID")
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 相机电压
|
||||
*/
|
||||
@Excel(name = "相机电压")
|
||||
private double cameraVolt;
|
||||
|
||||
/**
|
||||
* 太阳能电压
|
||||
*/
|
||||
@Excel(name = "太阳能电压")
|
||||
private double solarVolt;
|
||||
|
||||
/**
|
||||
* 外接电压
|
||||
*/
|
||||
@Excel(name = "外接电压")
|
||||
private double extraVolt;
|
||||
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
@Excel(name = "温度")
|
||||
private double temperature;
|
||||
|
||||
/**
|
||||
* 湿度
|
||||
*/
|
||||
@Excel(name = "湿度")
|
||||
private double humidity;
|
||||
|
||||
/**
|
||||
* 大气压
|
||||
*/
|
||||
@Excel(name = "大气压")
|
||||
private double atmosphere;
|
||||
|
||||
/**
|
||||
* 维度
|
||||
*/
|
||||
@Excel(name = "维度")
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Excel(name = "经度")
|
||||
private String lon;
|
||||
|
||||
private String memory;
|
||||
|
||||
private int ontime;
|
||||
|
||||
private int nstatus;
|
||||
|
||||
private String astatus;
|
||||
|
||||
private double elevation;
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long parentId;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("cameraVolt", getCameraVolt())
|
||||
.append("solarVolt", getSolarVolt())
|
||||
.append("extraVolt", getExtraVolt())
|
||||
.append("temperature", getTemperature())
|
||||
.append("humidity", getHumidity())
|
||||
.append("atmosphere", getAtmosphere())
|
||||
.append("lat", getLat())
|
||||
.append("lon", getLon())
|
||||
.append("parentId", getParentId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package net.hzvtc.data.check.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测结果媒体对象 result_media
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-10-24
|
||||
*/
|
||||
@Data
|
||||
@Alias("ResultMedia")
|
||||
public class ResultMedia extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long mediaId;
|
||||
|
||||
private Long areaId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@Excel(name = "设备id")
|
||||
private Long deviceId;
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型")
|
||||
private Integer mediaType;
|
||||
/**
|
||||
* 媒体url
|
||||
*/
|
||||
@Excel(name = "媒体url")
|
||||
private String mediaUrl;
|
||||
/**
|
||||
* 元数据url,如xml或json格式
|
||||
*/
|
||||
@Excel(name = "视频及声音URL")
|
||||
private String metaUrl;
|
||||
|
||||
private List<BirdSpecies> speciesList;
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss")
|
||||
@Excel(name = "时间", width = 30, dateFormat = "yyyy年MM月dd日 HH时mm分ss秒")
|
||||
private Date time;
|
||||
private Integer width;
|
||||
private Integer height;
|
||||
private Long speciesId;
|
||||
private String speciesName;
|
||||
private Integer limit;
|
||||
private int isDeleted;
|
||||
private Long itemId;
|
||||
private String version;
|
||||
|
||||
public String getMediaTypeName() {
|
||||
if (mediaType == null) {
|
||||
return null;
|
||||
} else if (mediaType == 1) {
|
||||
return "audio";
|
||||
} else if (mediaType == 2) {
|
||||
return "image";
|
||||
} else if (mediaType == 3) {
|
||||
return "video";
|
||||
} else if (mediaType == 4) {
|
||||
return "real";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("mediaId", getMediaId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("mediaType", getMediaType())
|
||||
.append("mediaUrl", getMediaUrl())
|
||||
.append("metaUrl", getMetaUrl())
|
||||
.append("time", getTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.hzvtc.data.check.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测结果记录对象 result_record
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
@Data
|
||||
@Alias("ResultRecord")
|
||||
public class ResultRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@Excel(name = "设备id")
|
||||
private Long deviceId;
|
||||
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 保护区Id
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 监测时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "监测时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recordTime;
|
||||
|
||||
/**
|
||||
* 监测类型
|
||||
*/
|
||||
@Excel(name = "监测类型")
|
||||
private String recordType;
|
||||
|
||||
private String version;
|
||||
|
||||
private List<ResultRecordDetails> list;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("recordTime", getRecordTime())
|
||||
.append("recordType", getRecordType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package net.hzvtc.data.check.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 监测记录详细信息对象 result_record_details
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
@Data
|
||||
@Alias("ResultRecordDetails")
|
||||
public class ResultRecordDetails implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long detailsId;
|
||||
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
@Excel(name = "记录id")
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 物种id
|
||||
*/
|
||||
@Excel(name = "物种id")
|
||||
private Long speciesId;
|
||||
|
||||
@Excel(name = "物种名称")
|
||||
private String speciesName;
|
||||
|
||||
/**
|
||||
* 生境
|
||||
*/
|
||||
@Excel(name = "生境")
|
||||
private String habitat;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Excel(name = "数量")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
@Excel(name = "位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 置信度
|
||||
*/
|
||||
@Excel(name = "置信度")
|
||||
private double confidence;
|
||||
|
||||
/**
|
||||
* 媒体id
|
||||
*/
|
||||
@Excel(name = "媒体id")
|
||||
private Long mediaId;
|
||||
|
||||
/**
|
||||
* 位置横坐标
|
||||
*/
|
||||
@Excel(name = "位置横坐标")
|
||||
private String locationSiteX;
|
||||
|
||||
/**
|
||||
* 位置纵坐标
|
||||
*/
|
||||
@Excel(name = "位置纵坐标")
|
||||
private String locationSiteY;
|
||||
|
||||
private boolean checked;
|
||||
|
||||
private int isDeleted = 0;
|
||||
|
||||
private String boundbox;
|
||||
|
||||
private ResultMedia resultMedia;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("detailsId", getDetailsId())
|
||||
.append("recordId", getRecordId())
|
||||
.append("speciesId", getSpeciesId())
|
||||
.append("habitat", getHabitat())
|
||||
.append("count", getCount())
|
||||
.append("location", getLocation())
|
||||
.append("confidence", getConfidence())
|
||||
.append("mediaId", getMediaId())
|
||||
.append("locationSiteX", getLocationSiteX())
|
||||
.append("locationSiteY", getLocationSiteY())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.hzvtc.data.check.mapper;
|
||||
|
||||
import net.hzvtc.data.check.domain.FavoriteMedia;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 收藏的视频Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
public interface FavoriteMediaMapper {
|
||||
/**
|
||||
* 查询收藏的视频
|
||||
*
|
||||
* @param id 收藏的视频主键
|
||||
* @return 收藏的视频
|
||||
*/
|
||||
public FavoriteMedia selectFavoriteMediaById(Long id);
|
||||
|
||||
/**
|
||||
* 查询收藏的视频列表
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 收藏的视频集合
|
||||
*/
|
||||
public List<FavoriteMedia> selectFavoriteMediaList(FavoriteMedia favoriteMedia);
|
||||
|
||||
/**
|
||||
* 新增收藏的视频
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFavoriteMedia(FavoriteMedia favoriteMedia);
|
||||
|
||||
/**
|
||||
* 修改收藏的视频
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFavoriteMedia(FavoriteMedia favoriteMedia);
|
||||
|
||||
/**
|
||||
* 删除收藏的视频
|
||||
*
|
||||
* @param id 收藏的视频主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFavoriteMediaById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除收藏的视频
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFavoriteMediaByIds(Long[] ids);
|
||||
|
||||
Long getFavoriteMediaByMediaId(FavoriteMedia data);
|
||||
|
||||
int deleteFavoriteMediaByMediaId(Long mediaId);
|
||||
|
||||
List<FavoriteMedia> getFavoriteMediaAmountByParam(Map<String, Object> param);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package net.hzvtc.data.check.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import net.hzvtc.data.check.domain.MediaItem;
|
||||
|
||||
/**
|
||||
* 视频(图像)状态参数Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
public interface MediaItemMapper
|
||||
{
|
||||
/**
|
||||
* 查询视频(图像)状态参数
|
||||
*
|
||||
* @param id 视频(图像)状态参数主键
|
||||
* @return 视频(图像)状态参数
|
||||
*/
|
||||
public MediaItem selectMediaItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询视频(图像)状态参数列表
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 视频(图像)状态参数集合
|
||||
*/
|
||||
public List<MediaItem> selectMediaItemList(MediaItem mediaItem);
|
||||
|
||||
/**
|
||||
* 新增视频(图像)状态参数
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMediaItem(MediaItem mediaItem);
|
||||
|
||||
/**
|
||||
* 修改视频(图像)状态参数
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMediaItem(MediaItem mediaItem);
|
||||
|
||||
/**
|
||||
* 删除视频(图像)状态参数
|
||||
*
|
||||
* @param id 视频(图像)状态参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMediaItemById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除视频(图像)状态参数
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMediaItemByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.hzvtc.data.check.mapper;
|
||||
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测结果媒体Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-10-24
|
||||
*/
|
||||
public interface ResultMediaMapper {
|
||||
|
||||
/**
|
||||
* 查询监测结果媒体列表
|
||||
*
|
||||
* @param resultMedia 监测结果媒体
|
||||
* @return 监测结果媒体集合
|
||||
*/
|
||||
List<ResultMedia> selectResultMediaList(ResultMedia resultMedia);
|
||||
|
||||
List<ResultMedia> selectResultMediaListByParam(ResultMedia resultMedia);
|
||||
|
||||
List<ResultMedia> getResultMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getResultAudioMediaListByParam(Map<String, Object> map);
|
||||
|
||||
ResultMedia getResultMediaListById(Long id);
|
||||
|
||||
List<ResultMedia> getBirdMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getSpeciesMediaListForQuery(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getVideoMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getFavoriteVideoListByParam(Map<String, Object> map);
|
||||
|
||||
Integer getResultMediaStatAmountByParam(Map<String, Object> map);
|
||||
|
||||
int deleteResultRealMediaByParam(Long deviceId);
|
||||
|
||||
int insertResultMedia(ResultMedia data);
|
||||
|
||||
int batchInsertResultMedia(List<ResultMedia> list);
|
||||
|
||||
int deleteResultMediaByMediaIds(Long[] mediaIds);
|
||||
|
||||
ResultMedia getResultInfoForStatByParam(Map<String, Object> map);
|
||||
|
||||
int getResultMediaAmountByParam(Map<String, Object> map);
|
||||
|
||||
List<Long> getResultMediaDeviceListByParam(Map<String, Object> map);
|
||||
|
||||
int updateResultMediaStatusByParam(ResultMedia param);
|
||||
|
||||
int recoverResultMediaStateByParam(Map<String, Object> map);
|
||||
|
||||
int deleteResultMediaById(Long mediaId);
|
||||
|
||||
List<ResultMedia> getResultMediaListByItemId(Long itemId);
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package net.hzvtc.data.check.mapper;
|
||||
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.bird.domain.BirdSpecies;
|
||||
import net.hzvtc.data.check.domain.ResultRecordDetails;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测记录详细信息Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
public interface ResultRecordDetailsMapper {
|
||||
/**
|
||||
* 查询监测记录详细信息
|
||||
*
|
||||
* @param detailsId 监测记录详细信息主键
|
||||
* @return 监测记录详细信息
|
||||
*/
|
||||
public ResultRecordDetails selectResultRecordDetailsByDetailsId(Long detailsId);
|
||||
|
||||
/**
|
||||
* 查询监测记录详细信息列表
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 监测记录详细信息集合
|
||||
*/
|
||||
public List<ResultRecordDetails> selectResultRecordDetailsList(ResultRecordDetails resultRecordDetails);
|
||||
|
||||
/**
|
||||
* 新增监测记录详细信息
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertResultRecordDetails(ResultRecordDetails resultRecordDetails);
|
||||
|
||||
/**
|
||||
* 修改监测记录详细信息
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateResultRecordDetails(ResultRecordDetails resultRecordDetails);
|
||||
|
||||
int batchInsertResultRecordDetails(List<ResultRecordDetails> list);
|
||||
|
||||
List<Long> checkResultRecordsByParam(ResultRecordDetails param);
|
||||
|
||||
int updateResultRecordDetailsCheckState(Long id);
|
||||
|
||||
/**
|
||||
* 删除监测记录详细信息
|
||||
*
|
||||
* @param detailsId 监测记录详细信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteResultRecordDetailsByDetailsId(Long detailsId);
|
||||
|
||||
/**
|
||||
* 批量删除监测记录详细信息
|
||||
*
|
||||
* @param detailsIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteResultRecordDetailsByDetailsIds(Long[] detailsIds);
|
||||
|
||||
List<BirdStatDataVo> querySpeciesRecordListByParam(Map<String, Object> map);
|
||||
|
||||
List<BirdStatDataVo> getSpeciesMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<BirdStatDataVo> getResultMediaVideoListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultRecordDetails> getSpeciesListByParam();
|
||||
|
||||
List<ResultRecordDetails> getSpeciesListByUserId(Map<String, Object> map);
|
||||
|
||||
List<SpeciesAbnormalInfo> getSpeciesDateListByParam(Map<String, Object> map);
|
||||
|
||||
List<Long> checkIsNewSpeciesByParam(Map<String, Object> map);
|
||||
|
||||
List<SpeciesAbnormalInfo> getLevelOneSpeciesLitByParam(Map<String, Object> map);
|
||||
|
||||
List<SpeciesAbnormalInfo> getCrOrEnSpeciesLitByParam(Map<String, Object> map);
|
||||
|
||||
List<BirdStatDataVo> getSpeciesHourAmountListByParam(Map<String, Object> map);
|
||||
|
||||
List<BirdStatDataVo> getSpeciesAudioAmountReportByParam(Map<String, Object> map);
|
||||
|
||||
long getRecordDetailCountByDeviceId(long deviceId);
|
||||
|
||||
List<Long> getResultMediaByMediaId(Long mediaId);
|
||||
|
||||
List<BirdSpecies> getBirdSpeciesListByMediaId(Long mediaId);
|
||||
|
||||
int deleteByMediaId(Long mediaId);
|
||||
|
||||
Long getSpeciesIdByPram(Map<String, Object> map);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.hzvtc.data.check.mapper;
|
||||
|
||||
import net.hzvtc.data.check.domain.ResultRecord;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测结果记录Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
public interface ResultRecordMapper {
|
||||
/**
|
||||
* 查询监测结果记录
|
||||
*
|
||||
* @param recordId 监测结果记录主键
|
||||
* @return 监测结果记录
|
||||
*/
|
||||
public ResultRecord selectResultRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询监测结果记录列表
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 监测结果记录集合
|
||||
*/
|
||||
public List<ResultRecord> selectResultRecordList(ResultRecord resultRecord);
|
||||
|
||||
List<Long> getResultAreaListByParam(Map<String, Object> map);
|
||||
|
||||
List<Long> getResultRecordIdsByParam(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 新增监测结果记录
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertResultRecord(ResultRecord resultRecord);
|
||||
|
||||
/**
|
||||
* 修改监测结果记录
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateResultRecord(ResultRecord resultRecord);
|
||||
|
||||
/**
|
||||
* 删除监测结果记录
|
||||
*
|
||||
* @param recordId 监测结果记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteResultRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除监测结果记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteResultRecordByRecordIds(Long[] recordIds);
|
||||
|
||||
List<ResultRecord> getCurrentDateResultRecordList(Map<String, Object> map);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.hzvtc.data.check.service;
|
||||
|
||||
import net.hzvtc.data.check.domain.FavoriteMedia;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 收藏的视频Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
public interface FavoriteMediaService {
|
||||
/**
|
||||
* 查询收藏的视频
|
||||
*
|
||||
* @param id 收藏的视频主键
|
||||
* @return 收藏的视频
|
||||
*/
|
||||
public FavoriteMedia selectFavoriteMediaById(Long id);
|
||||
|
||||
/**
|
||||
* 查询收藏的视频列表
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 收藏的视频集合
|
||||
*/
|
||||
public List<FavoriteMedia> selectFavoriteMediaList(FavoriteMedia favoriteMedia);
|
||||
|
||||
/**
|
||||
* 新增收藏的视频
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFavoriteMedia(FavoriteMedia favoriteMedia);
|
||||
|
||||
/**
|
||||
* 修改收藏的视频
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFavoriteMedia(FavoriteMedia favoriteMedia);
|
||||
|
||||
/**
|
||||
* 批量删除收藏的视频
|
||||
*
|
||||
* @param ids 需要删除的收藏的视频主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFavoriteMediaByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除收藏的视频信息
|
||||
*
|
||||
* @param id 收藏的视频主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFavoriteMediaById(Long id);
|
||||
|
||||
Long getFavoriteMediaByMediaId(Long id);
|
||||
|
||||
Long getHeartMediaByMediaId(Long id);
|
||||
|
||||
Long handleAction(FavoriteMedia favoriteMedia);
|
||||
|
||||
List<FavoriteMedia> getFavoriteMediaListByParam(Map<String, Object> param);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.hzvtc.data.check.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.data.check.domain.MediaItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 视频(图像)状态参数Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
public interface MediaItemService {
|
||||
/**
|
||||
* 查询视频(图像)状态参数
|
||||
*
|
||||
* @param id 视频(图像)状态参数主键
|
||||
* @return 视频(图像)状态参数
|
||||
*/
|
||||
public MediaItem selectMediaItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询视频(图像)状态参数列表
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 视频(图像)状态参数集合
|
||||
*/
|
||||
public List<MediaItem> selectMediaItemList(MediaItem mediaItem);
|
||||
|
||||
/**
|
||||
* 新增视频(图像)状态参数
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMediaItem(MediaItem mediaItem);
|
||||
|
||||
/**
|
||||
* 修改视频(图像)状态参数
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMediaItem(MediaItem mediaItem);
|
||||
|
||||
/**
|
||||
* 批量删除视频(图像)状态参数
|
||||
*
|
||||
* @param ids 需要删除的视频(图像)状态参数主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMediaItemByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除视频(图像)状态参数信息
|
||||
*
|
||||
* @param id 视频(图像)状态参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteMediaItemById(Long id);
|
||||
|
||||
Long parserJsonObject(JSONObject jsonObject);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.hzvtc.data.check.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测结果媒体Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-10-24
|
||||
*/
|
||||
public interface ResultMediaService {
|
||||
|
||||
/**
|
||||
* 查询监测结果媒体列表
|
||||
*
|
||||
* @param resultMedia 监测结果媒体
|
||||
* @return 监测结果媒体集合
|
||||
*/
|
||||
List<ResultMedia> selectResultMediaList(ResultMedia resultMedia);
|
||||
|
||||
List<ResultMedia> getResultMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getResultAudioMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getBirdMediaListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> selectResultMediaListByParam(ResultMedia resultMedia);
|
||||
|
||||
List<ResultMedia> getSpeciesMediaListForQuery(JSONObject object);
|
||||
|
||||
int deleteResultRealMediaByParam(Long deviceId);
|
||||
|
||||
int insertResultMedia(ResultMedia data);
|
||||
|
||||
ResultMedia getResultMediaListById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除监测结果附件
|
||||
*
|
||||
* @param mediaIds 需要删除的监测结果附件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteResultMediaByMediaIds(Long[] mediaIds);
|
||||
|
||||
ResultMedia getResultInfoForStatByParam(Map<String, Object> map);
|
||||
|
||||
int updateResultMediaStatusByParam(ResultMedia param);
|
||||
|
||||
int recoverResultMediaStateByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getVideoMediaListByParam(Map<String, Object> map);
|
||||
|
||||
int getResultMediaAmountByParam(Map<String, Object> map);
|
||||
|
||||
List<Long> getResultMediaDeviceListByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultMedia> getFavoriteVideoListByParam(JSONObject object);
|
||||
|
||||
JSONObject getResultMediaStatByParam();
|
||||
|
||||
List<ResultMedia> getResultMediaListByItemId(Long itemId);
|
||||
|
||||
int batchInsertResultMedia(List<ResultMedia> list);
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package net.hzvtc.data.check.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.data.check.domain.ResultRecordDetails;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测记录详细信息Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
public interface ResultRecordDetailsService {
|
||||
/**
|
||||
* 查询监测记录详细信息
|
||||
*
|
||||
* @param detailsId 监测记录详细信息主键
|
||||
* @return 监测记录详细信息
|
||||
*/
|
||||
public ResultRecordDetails selectResultRecordDetailsByDetailsId(Long detailsId);
|
||||
|
||||
/**
|
||||
* 查询监测记录详细信息列表
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 监测记录详细信息集合
|
||||
*/
|
||||
public List<ResultRecordDetails> selectResultRecordDetailsList(ResultRecordDetails resultRecordDetails);
|
||||
|
||||
/**
|
||||
* 新增监测记录详细信息
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertResultRecordDetails(ResultRecordDetails resultRecordDetails);
|
||||
|
||||
/**
|
||||
* 修改监测记录详细信息
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 结果
|
||||
*/
|
||||
Long updateResultRecordDetails(ResultRecordDetails resultRecordDetails);
|
||||
|
||||
/**
|
||||
* 批量删除监测记录详细信息
|
||||
*
|
||||
* @param detailsIds 需要删除的监测记录详细信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteResultRecordDetailsByDetailsIds(Long[] detailsIds);
|
||||
|
||||
int deleteResultRecordDetails(JSONObject obj);
|
||||
|
||||
/**
|
||||
* 删除监测记录详细信息信息
|
||||
*
|
||||
* @param detailsId 监测记录详细信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteResultRecordDetailsByDetailsId(Long detailsId);
|
||||
|
||||
List<BirdStatDataVo> querySpeciesRecordListByParam(JSONObject obj);
|
||||
|
||||
List<BirdStatDataVo> getSpeciesMediaListByParam(JSONObject obj);
|
||||
|
||||
List<BirdStatDataVo> getResultMediaVideoListByParam(JSONObject obj);
|
||||
|
||||
JSONArray getSpeciesHourAmountListByParam(JSONObject param);
|
||||
|
||||
List<ResultRecordDetails> getSpeciesListByParam();
|
||||
|
||||
int updateResultRecordDetailsCheckState(Long id);
|
||||
|
||||
List<SpeciesAbnormalInfo> getLevelOneSpeciesLitByParam(Map<String, Object> map);
|
||||
|
||||
List<SpeciesAbnormalInfo> getCrOrEnSpeciesLitByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultRecordDetails> getSpeciesListByUserId(Long areaId);
|
||||
|
||||
List<SpeciesAbnormalInfo> getSpeciesDateListByParam(Map<String, Object> map);
|
||||
|
||||
List<Long> checkIsNewSpeciesByParam(Map<String, Object> map);
|
||||
|
||||
JSONObject getSpeciesAudioAmountReportByParam(JSONObject param);
|
||||
|
||||
long getRecordDetailCountByDeviceId(long deviceId);
|
||||
|
||||
int modifyRecordDetails(ResultRecordDetails data);
|
||||
|
||||
int batchInsertResultRecordDetails(List<ResultRecordDetails> list);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package net.hzvtc.data.check.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.data.check.domain.ResultRecord;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测结果记录Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
public interface ResultRecordService {
|
||||
/**
|
||||
* 查询监测结果记录
|
||||
*
|
||||
* @param recordId 监测结果记录主键
|
||||
* @return 监测结果记录
|
||||
*/
|
||||
ResultRecord selectResultRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询监测结果记录列表
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 监测结果记录集合
|
||||
*/
|
||||
List<ResultRecord> selectResultRecordList(ResultRecord resultRecord);
|
||||
|
||||
/**
|
||||
* 新增监测结果记录
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertResultRecord(ResultRecord resultRecord);
|
||||
|
||||
/**
|
||||
* 修改监测结果记录
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateResultRecord(ResultRecord resultRecord);
|
||||
|
||||
/**
|
||||
* 批量删除监测结果记录
|
||||
*
|
||||
* @param recordIds 需要删除的监测结果记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteResultRecordByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除监测结果记录信息
|
||||
*
|
||||
* @param recordId 监测结果记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteResultRecordByRecordId(Long recordId);
|
||||
|
||||
JSONObject getBirdDataStatByParam(JSONObject param);
|
||||
|
||||
String getBirdDataStatFileByParam(JSONObject param);
|
||||
|
||||
void sendBirdDataStatEmail();
|
||||
|
||||
void sendBirdDataWeeklyStatEmail();
|
||||
|
||||
boolean sendBirdDataStatEmail(JSONObject param);
|
||||
|
||||
boolean sendBirdDataWeeklyStatEmail(JSONObject param);
|
||||
|
||||
JSONObject getBirdDataWeeklyStatByParam(JSONObject param);
|
||||
|
||||
String getBirdDataWeeklyStatFileByParam(JSONObject param);
|
||||
|
||||
String getBirdDataMonthlyStatFileByParam(JSONObject param);
|
||||
|
||||
List<Long> getResultAreaListByParam(Map<String, Object> map);
|
||||
|
||||
List<Long> getResultRecordIdsByParam(Map<String, Object> map);
|
||||
|
||||
List<ResultRecord> getCurrentDateResultRecordList(JSONObject param);
|
||||
}
|
||||
|
||||
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package net.hzvtc.data.check.service.impl;
|
||||
|
||||
import net.hzvtc.common.utils.SecurityUtils;
|
||||
import net.hzvtc.data.check.domain.FavoriteMedia;
|
||||
import net.hzvtc.data.check.mapper.FavoriteMediaMapper;
|
||||
import net.hzvtc.data.check.service.FavoriteMediaService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 收藏的视频Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@Service
|
||||
public class FavoriteMediaServiceImpl implements FavoriteMediaService {
|
||||
@Resource
|
||||
private FavoriteMediaMapper favoriteMediaMapper;
|
||||
|
||||
/**
|
||||
* 查询收藏的视频
|
||||
*
|
||||
* @param id 收藏的视频主键
|
||||
* @return 收藏的视频
|
||||
*/
|
||||
@Override
|
||||
public FavoriteMedia selectFavoriteMediaById(Long id) {
|
||||
return favoriteMediaMapper.selectFavoriteMediaById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询收藏的视频列表
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 收藏的视频
|
||||
*/
|
||||
@Override
|
||||
public List<FavoriteMedia> selectFavoriteMediaList(FavoriteMedia favoriteMedia) {
|
||||
return favoriteMediaMapper.selectFavoriteMediaList(favoriteMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收藏的视频
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFavoriteMedia(FavoriteMedia favoriteMedia) {
|
||||
return favoriteMediaMapper.insertFavoriteMedia(favoriteMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收藏的视频
|
||||
*
|
||||
* @param favoriteMedia 收藏的视频
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFavoriteMedia(FavoriteMedia favoriteMedia) {
|
||||
return favoriteMediaMapper.updateFavoriteMedia(favoriteMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除收藏的视频
|
||||
*
|
||||
* @param ids 需要删除的收藏的视频主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFavoriteMediaByIds(Long[] ids) {
|
||||
return favoriteMediaMapper.deleteFavoriteMediaByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收藏的视频信息
|
||||
*
|
||||
* @param id 收藏的视频主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFavoriteMediaById(Long id) {
|
||||
return favoriteMediaMapper.deleteFavoriteMediaById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getFavoriteMediaByMediaId(Long id) {
|
||||
FavoriteMedia data = new FavoriteMedia();
|
||||
data.setType(0);
|
||||
data.setMediaId(id);
|
||||
return favoriteMediaMapper.getFavoriteMediaByMediaId(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getHeartMediaByMediaId(Long id) {
|
||||
FavoriteMedia data = new FavoriteMedia();
|
||||
data.setType(1);
|
||||
data.setUserId(SecurityUtils.getUserId());
|
||||
data.setMediaId(id);
|
||||
return favoriteMediaMapper.getFavoriteMediaByMediaId(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long handleAction(FavoriteMedia favoriteMedia) {
|
||||
if (favoriteMedia.getId() == null || favoriteMedia.getId() == 0L) {
|
||||
favoriteMedia.setUserId(SecurityUtils.getUserId());
|
||||
favoriteMedia.setCreateDate(new Date());
|
||||
favoriteMedia.setIsDeleted(0);
|
||||
favoriteMediaMapper.insertFavoriteMedia(favoriteMedia);
|
||||
return favoriteMedia.getId();
|
||||
} else {
|
||||
favoriteMediaMapper.deleteFavoriteMediaByMediaId(favoriteMedia.getMediaId());
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FavoriteMedia> getFavoriteMediaListByParam(Map<String, Object> param) {
|
||||
return favoriteMediaMapper.getFavoriteMediaAmountByParam(param);
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package net.hzvtc.data.check.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.common.core.redis.RedisCache;
|
||||
import net.hzvtc.common.utils.StringUtils;
|
||||
import net.hzvtc.data.check.domain.MediaItem;
|
||||
import net.hzvtc.data.check.mapper.MediaItemMapper;
|
||||
import net.hzvtc.data.check.service.MediaItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 视频(图像)状态参数Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@Service
|
||||
public class MediaItemServiceImpl implements MediaItemService {
|
||||
@Resource
|
||||
private MediaItemMapper mediaItemMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 查询视频(图像)状态参数
|
||||
*
|
||||
* @param id 视频(图像)状态参数主键
|
||||
* @return 视频(图像)状态参数
|
||||
*/
|
||||
@Override
|
||||
public MediaItem selectMediaItemById(Long id) {
|
||||
String key = "media_item_" + id;
|
||||
MediaItem data = redisCache.getCacheObject(key);
|
||||
if (data == null) {
|
||||
data = mediaItemMapper.selectMediaItemById(id);
|
||||
redisCache.setCacheObject(key, data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询视频(图像)状态参数列表
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 视频(图像)状态参数
|
||||
*/
|
||||
@Override
|
||||
public List<MediaItem> selectMediaItemList(MediaItem mediaItem) {
|
||||
return mediaItemMapper.selectMediaItemList(mediaItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增视频(图像)状态参数
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMediaItem(MediaItem mediaItem) {
|
||||
return mediaItemMapper.insertMediaItem(mediaItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改视频(图像)状态参数
|
||||
*
|
||||
* @param mediaItem 视频(图像)状态参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMediaItem(MediaItem mediaItem) {
|
||||
return mediaItemMapper.updateMediaItem(mediaItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除视频(图像)状态参数
|
||||
*
|
||||
* @param ids 需要删除的视频(图像)状态参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMediaItemByIds(Long[] ids) {
|
||||
return mediaItemMapper.deleteMediaItemByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除视频(图像)状态参数信息
|
||||
*
|
||||
* @param id 视频(图像)状态参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMediaItemById(Long id) {
|
||||
return mediaItemMapper.deleteMediaItemById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long parserJsonObject(JSONObject jsonObject) {
|
||||
MediaItem data = new MediaItem();
|
||||
JSONObject obj = jsonObject.getJSONObject("device");
|
||||
data.setDeviceId(jsonObject.getLong("id"));
|
||||
data.setCameraVolt(obj.getDouble("Battery1"));
|
||||
data.setSolarVolt(obj.getDouble("SPower"));
|
||||
data.setExtraVolt(obj.getDouble("EPower"));
|
||||
data.setMemory(obj.getString("Memory"));
|
||||
data.setOntime(obj.getInteger("ONTime"));
|
||||
data.setNstatus(obj.getInteger(("NStatus")));
|
||||
data.setAstatus(obj.getString("AStatus"));
|
||||
JSONObject gpsObj = StringUtils.parseWGS84Coordinate(obj.getString("GP"));
|
||||
if (gpsObj != null) {
|
||||
data.setLon(gpsObj.getString("longitude"));
|
||||
data.setLat(gpsObj.getString("latitude"));
|
||||
data.setElevation(gpsObj.getDouble("altitude"));
|
||||
}
|
||||
obj = jsonObject.getJSONObject("data");
|
||||
data.setTemperature(obj.getDouble("D_Temperature"));
|
||||
data.setHumidity(obj.getDouble("D_Humidity"));
|
||||
data.setAtmosphere(obj.getDouble("D_Atmos"));
|
||||
mediaItemMapper.insertMediaItem(data);
|
||||
return data.getId();
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
package net.hzvtc.data.check.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import net.hzvtc.data.check.mapper.ResultMediaMapper;
|
||||
import net.hzvtc.data.check.service.ResultMediaService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测结果媒体Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-10-24
|
||||
*/
|
||||
@Service
|
||||
public class ResultMediaServiceImpl implements ResultMediaService {
|
||||
@Resource
|
||||
private ResultMediaMapper resultMediaMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询监测结果媒体列表
|
||||
*
|
||||
* @param resultMedia 监测结果媒体
|
||||
* @return 监测结果媒体
|
||||
*/
|
||||
@Override
|
||||
public List<ResultMedia> selectResultMediaList(ResultMedia resultMedia) {
|
||||
return resultMediaMapper.selectResultMediaList(resultMedia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getResultMediaListByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getResultMediaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getResultAudioMediaListByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getResultAudioMediaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getBirdMediaListByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getBirdMediaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> selectResultMediaListByParam(ResultMedia resultMedia) {
|
||||
// if (resultMedia == null) {
|
||||
// resultMedia = new ResultMedia();
|
||||
// }
|
||||
return resultMediaMapper.selectResultMediaListByParam(resultMedia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getSpeciesMediaListForQuery(JSONObject object) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long areaId = object.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
Long deviceId = object.getLong("deviceId");
|
||||
map.put("deviceId", deviceId);
|
||||
String dateFrom = object.getString("dateFrom");
|
||||
map.put("dateFrom", dateFrom);
|
||||
String dateTo = object.getString("dateTo");
|
||||
map.put("dateTo", dateTo);
|
||||
String mediaTypes = object.getString("mediaTypes");
|
||||
if (mediaTypes != null && !mediaTypes.isEmpty()) {
|
||||
String arrs[] = mediaTypes.split(",");
|
||||
int[] arr = Arrays.asList(arrs).stream().mapToInt(Integer::parseInt).toArray();
|
||||
map.put("mediaTypes", arr);
|
||||
}
|
||||
Integer limit = object.getInteger("limit");
|
||||
map.put("limit", limit);
|
||||
return resultMediaMapper.getSpeciesMediaListForQuery(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteResultRealMediaByParam(Long deviceId) {
|
||||
return resultMediaMapper.deleteResultRealMediaByParam(deviceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertResultMedia(ResultMedia data) {
|
||||
return resultMediaMapper.insertResultMedia(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultMedia getResultMediaListById(Long id) {
|
||||
return resultMediaMapper.getResultMediaListById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除监测结果附件
|
||||
*
|
||||
* @param mediaIds 需要删除的监测结果附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteResultMediaByMediaIds(Long[] mediaIds) {
|
||||
return resultMediaMapper.deleteResultMediaByMediaIds(mediaIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultMedia getResultInfoForStatByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getResultInfoForStatByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateResultMediaStatusByParam(ResultMedia param) {
|
||||
return resultMediaMapper.updateResultMediaStatusByParam(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recoverResultMediaStateByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.recoverResultMediaStateByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getVideoMediaListByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getVideoMediaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getResultMediaAmountByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getResultMediaAmountByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getResultMediaDeviceListByParam(Map<String, Object> map) {
|
||||
return resultMediaMapper.getResultMediaDeviceListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getFavoriteVideoListByParam(JSONObject object) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
return resultMediaMapper.getFavoriteVideoListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getResultMediaStatByParam() {
|
||||
JSONObject result = new JSONObject();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("mediaType", 3);
|
||||
Integer count = resultMediaMapper.getResultMediaStatAmountByParam(map);
|
||||
result.put("videoAmount", count == null ? 0 : count);
|
||||
map.put("mediaType", 2);
|
||||
count = resultMediaMapper.getResultMediaStatAmountByParam(map);
|
||||
result.put("imageAmount", count == null ? 0 : count);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultMedia> getResultMediaListByItemId(Long itemId) {
|
||||
return resultMediaMapper.getResultMediaListByItemId(itemId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsertResultMedia(List<ResultMedia> list) {
|
||||
return resultMediaMapper.batchInsertResultMedia(list);
|
||||
}
|
||||
}
|
||||
+348
@@ -0,0 +1,348 @@
|
||||
package net.hzvtc.data.check.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.hzvtc.area.domain.SpeciesAbnormalInfo;
|
||||
import net.hzvtc.common.utils.SecurityUtils;
|
||||
import net.hzvtc.data.check.domain.ResultRecordDetails;
|
||||
import net.hzvtc.data.check.mapper.ResultMediaMapper;
|
||||
import net.hzvtc.data.check.mapper.ResultRecordDetailsMapper;
|
||||
import net.hzvtc.data.check.service.ResultRecordDetailsService;
|
||||
import net.hzvtc.device.service.DeviceInfoService;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
import net.hzvtc.web.stat.service.SpeciesDailyStatService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测记录详细信息Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ResultRecordDetailsServiceImpl implements ResultRecordDetailsService {
|
||||
@Resource
|
||||
private ResultRecordDetailsMapper resultRecordDetailsMapper;
|
||||
@Resource
|
||||
private ResultMediaMapper resultMediaMapper;
|
||||
// @Autowired
|
||||
// private ProtectedAreaService protectedAreaService;
|
||||
// @Autowired
|
||||
private final SpeciesDailyStatService speciesDailyStatService;
|
||||
|
||||
private final DeviceInfoService deviceInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询监测记录详细信息
|
||||
*
|
||||
* @param detailsId 监测记录详细信息主键
|
||||
* @return 监测记录详细信息
|
||||
*/
|
||||
@Override
|
||||
public ResultRecordDetails selectResultRecordDetailsByDetailsId(Long detailsId) {
|
||||
return resultRecordDetailsMapper.selectResultRecordDetailsByDetailsId(detailsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询监测记录详细信息列表
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 监测记录详细信息
|
||||
*/
|
||||
@Override
|
||||
public List<ResultRecordDetails> selectResultRecordDetailsList(ResultRecordDetails resultRecordDetails) {
|
||||
return resultRecordDetailsMapper.selectResultRecordDetailsList(resultRecordDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测记录详细信息
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertResultRecordDetails(ResultRecordDetails resultRecordDetails) {
|
||||
return resultRecordDetailsMapper.insertResultRecordDetails(resultRecordDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测记录详细信息
|
||||
*
|
||||
* @param resultRecordDetails 监测记录详细信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long updateResultRecordDetails(ResultRecordDetails resultRecordDetails) {
|
||||
resultRecordDetailsMapper.updateResultRecordDetails(resultRecordDetails);
|
||||
return 1L;
|
||||
// if (resultRecordDetails.getDetailsId() == 0) {
|
||||
// resultRecordDetails.setHabitat("");
|
||||
// resultRecordDetails.setIsDeleted(0);
|
||||
// resultRecordDetailsMapper.insertResultRecordDetails(resultRecordDetails);
|
||||
// return resultRecordDetails.getDetailsId();
|
||||
// } else {
|
||||
// List<Long> list = resultRecordDetailsMapper.checkResultRecordsByParam(resultRecordDetails);
|
||||
// if (list == null || list.isEmpty()) {
|
||||
// if (resultRecordDetails.getCount() == null) {
|
||||
// resultRecordDetails.setCount(1);
|
||||
// }
|
||||
// resultRecordDetailsMapper.updateResultRecordDetails(resultRecordDetails);
|
||||
// return 1L;
|
||||
// } else {
|
||||
// resultRecordDetailsMapper.deleteResultRecordDetailsByDetailsId(resultRecordDetails.getDetailsId());
|
||||
// return 1L;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除监测记录详细信息
|
||||
*
|
||||
* @param detailsIds 需要删除的监测记录详细信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteResultRecordDetailsByDetailsIds(Long[] detailsIds) {
|
||||
return resultRecordDetailsMapper.deleteResultRecordDetailsByDetailsIds(detailsIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteResultRecordDetails(JSONObject obj) {
|
||||
Long id = obj.getLong("id");
|
||||
Long mediaId = obj.getLong("mediaId");
|
||||
if (id != null) {
|
||||
int count = resultRecordDetailsMapper.deleteResultRecordDetailsByDetailsId(id);
|
||||
List<Long> list = resultRecordDetailsMapper.getResultMediaByMediaId(mediaId);
|
||||
if (list == null || list.isEmpty()) {
|
||||
resultMediaMapper.deleteResultMediaById(mediaId);
|
||||
}
|
||||
return count;
|
||||
} else {
|
||||
resultMediaMapper.deleteResultMediaById(mediaId);
|
||||
return resultRecordDetailsMapper.deleteByMediaId(mediaId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监测记录详细信息信息
|
||||
*
|
||||
* @param detailsId 监测记录详细信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteResultRecordDetailsByDetailsId(Long detailsId) {
|
||||
return resultRecordDetailsMapper.deleteResultRecordDetailsByDetailsId(detailsId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdStatDataVo> querySpeciesRecordListByParam(JSONObject obj) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
// if (SecurityUtils.getUserId() > 1L) {
|
||||
// map.put("deptId", SecurityUtils.getDeptId());
|
||||
// map.put("ancestors", deviceInfoService.getAncestorsById(SecurityUtils.getDeptId()));
|
||||
// }
|
||||
|
||||
Long speciesId = obj.getLong("speciesId");
|
||||
map.put("speciesId", speciesId);
|
||||
String dateFrom = obj.getString("dateFrom");
|
||||
String dateTo = obj.getString("dateTo");
|
||||
map.put("dateFrom", dateFrom);
|
||||
map.put("dateTo", dateTo);
|
||||
Long deviceId = obj.getLong("deviceId");
|
||||
map.put("deviceId", deviceId);
|
||||
String mediaType = obj.getString("mediaType");
|
||||
map.put("mediaType", mediaType);
|
||||
String mediaTypes = obj.getString("mediaTypes");
|
||||
if (mediaTypes != null && !mediaTypes.isEmpty()) {
|
||||
String[] arr = mediaTypes.split(",");
|
||||
map.put("mediaTypes", arr);
|
||||
}
|
||||
return resultRecordDetailsMapper.querySpeciesRecordListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdStatDataVo> getSpeciesMediaListByParam(JSONObject obj) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long areaId = obj.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
Integer mediaType = obj.getInteger("mediaType");
|
||||
map.put("mediaType", mediaType);
|
||||
Long deviceId = obj.getLong("deviceId");
|
||||
map.put("deviceId", deviceId);
|
||||
String dateFrom = obj.getString("dateFrom");
|
||||
map.put("dateFrom", dateFrom);
|
||||
String dateTo = obj.getString("dateTo");
|
||||
map.put("dateTo", dateTo);
|
||||
return resultRecordDetailsMapper.getSpeciesMediaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BirdStatDataVo> getResultMediaVideoListByParam(JSONObject obj) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long areaId = obj.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
Long deviceId = obj.getLong("deviceId");
|
||||
map.put("deviceId", deviceId);
|
||||
String dateFrom = obj.getString("dateFrom");
|
||||
map.put("dateFrom", dateFrom);
|
||||
String dateTo = obj.getString("dateTo");
|
||||
map.put("dateTo", dateTo);
|
||||
return resultRecordDetailsMapper.getResultMediaVideoListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getSpeciesHourAmountListByParam(JSONObject param) {
|
||||
JSONArray result = new JSONArray();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long areaId = param.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
Long deviceId = param.getLong("deviceId");
|
||||
map.put("deviceId", deviceId);
|
||||
if (deviceId == null && areaId == null) {
|
||||
return result;
|
||||
}
|
||||
Integer recordTypeNot = param.getInteger("recordTypeNot");
|
||||
map.put("recordTypeNot", recordTypeNot);
|
||||
Integer recordType = param.getInteger("recordType");
|
||||
map.put("recordType", recordType);
|
||||
Integer calcYear = param.getInteger("calcYear");
|
||||
if (calcYear == null) {
|
||||
calcYear = LocalDate.now().getYear();
|
||||
}
|
||||
map.put("calcYear", calcYear);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("name", (i + 1) + "季度");
|
||||
obj.put("code", i + 1);
|
||||
map.put("monthFrom", i * 3 + 1);
|
||||
map.put("monthTo", i * 3 + 3);
|
||||
List<BirdStatDataVo> list = resultRecordDetailsMapper.getSpeciesHourAmountListByParam(map);
|
||||
obj.put("list", list);
|
||||
result.add(obj);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultRecordDetails> getSpeciesListByParam() {
|
||||
// Long areaId = obj.getLong("areaId");
|
||||
// if (areaId == null) {
|
||||
// return null;
|
||||
// }
|
||||
return resultRecordDetailsMapper.getSpeciesListByParam();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateResultRecordDetailsCheckState(Long id) {
|
||||
return resultRecordDetailsMapper.updateResultRecordDetailsCheckState(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SpeciesAbnormalInfo> getLevelOneSpeciesLitByParam(Map<String, Object> map) {
|
||||
return resultRecordDetailsMapper.getLevelOneSpeciesLitByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SpeciesAbnormalInfo> getCrOrEnSpeciesLitByParam(Map<String, Object> map) {
|
||||
return resultRecordDetailsMapper.getCrOrEnSpeciesLitByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultRecordDetails> getSpeciesListByUserId(Long areaId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (areaId != null) {
|
||||
map.put("areaId", areaId);
|
||||
} else {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId == null) {
|
||||
userId = 0L;
|
||||
} else if (userId <= 1L) {
|
||||
userId = null;
|
||||
}
|
||||
map.put("userId", userId);
|
||||
}
|
||||
return resultRecordDetailsMapper.getSpeciesListByUserId(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SpeciesAbnormalInfo> getSpeciesDateListByParam(Map<String, Object> map) {
|
||||
return resultRecordDetailsMapper.getSpeciesDateListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> checkIsNewSpeciesByParam(Map<String, Object> map) {
|
||||
return resultRecordDetailsMapper.checkIsNewSpeciesByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getSpeciesAudioAmountReportByParam(JSONObject param) {
|
||||
JSONObject result = new JSONObject();
|
||||
Long areaId = param.getLong("areaId");
|
||||
Long deviceId = param.getLong("deviceId");
|
||||
if (areaId == null && deviceId == null) {
|
||||
return result;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("areaId", areaId);
|
||||
map.put("deviceId", deviceId);
|
||||
Integer calcYear = param.getInteger("calcYear");
|
||||
map.put("calcYear", calcYear);
|
||||
Integer calcMonth = param.getInteger("calcMonth");
|
||||
map.put("calcMonth", calcMonth);
|
||||
Integer monthFrom = param.getInteger("monthFrom");
|
||||
map.put("monthFrom", monthFrom);
|
||||
Integer monthTo = param.getInteger("monthTo");
|
||||
map.put("monthTo", monthTo);
|
||||
List<BirdStatDataVo> list = resultRecordDetailsMapper.getSpeciesAudioAmountReportByParam(map);
|
||||
result.put("list", list);
|
||||
result.put("catalogueAmount", speciesDailyStatService.getBirdCatalogueAmount());
|
||||
result.put("familyAmount", speciesDailyStatService.getBirdFamilyAmount());
|
||||
result.put("genusAmount", speciesDailyStatService.getBirdGenusAmount());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getRecordDetailCountByDeviceId(long deviceId) {
|
||||
return resultRecordDetailsMapper.getRecordDetailCountByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifyRecordDetails(ResultRecordDetails data) {
|
||||
resultRecordDetailsMapper.deleteByMediaId(data.getMediaId());
|
||||
String arr[] = data.getSpeciesName().split(",");
|
||||
List<ResultRecordDetails> list = new ArrayList<>();
|
||||
for (String str : arr) {
|
||||
ResultRecordDetails item = new ResultRecordDetails();
|
||||
item.setRecordId(data.getRecordId());
|
||||
item.setMediaId(data.getMediaId());
|
||||
item.setCount(1);
|
||||
item.setHabitat("1");
|
||||
item.setLocation("");
|
||||
item.setSpeciesId(Long.parseLong(str));
|
||||
item.setIsDeleted(0);
|
||||
list.add(item);
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
return resultRecordDetailsMapper.batchInsertResultRecordDetails(list);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsertResultRecordDetails(List<ResultRecordDetails> list) {
|
||||
return resultRecordDetailsMapper.batchInsertResultRecordDetails(list);
|
||||
}
|
||||
}
|
||||
+811
@@ -0,0 +1,811 @@
|
||||
package net.hzvtc.data.check.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.area.domain.ProtectedArea;
|
||||
import net.hzvtc.area.service.ProtectedAreaService;
|
||||
import net.hzvtc.common.config.AiBirdSysConfig;
|
||||
import net.hzvtc.common.utils.DateUtils;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import net.hzvtc.data.check.domain.ResultRecord;
|
||||
import net.hzvtc.data.check.mapper.ResultRecordMapper;
|
||||
import net.hzvtc.data.check.service.ResultMediaService;
|
||||
import net.hzvtc.data.check.service.ResultRecordService;
|
||||
import net.hzvtc.echart.domain.vo.BirdStatDataVo;
|
||||
import net.hzvtc.echart.service.BirdDataStatService;
|
||||
import net.hzvtc.email.service.EmailService;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 监测结果记录Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-08-22
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ResultRecordServiceImpl implements ResultRecordService {
|
||||
@Resource
|
||||
private ResultRecordMapper resultRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private BirdDataStatService birdDataStatService;
|
||||
|
||||
@Autowired
|
||||
private ProtectedAreaService protectedAreaService;
|
||||
|
||||
@Value("${hzvtc.dailyReportFilePath}")
|
||||
private String dailyReportFilePath;
|
||||
|
||||
@Value("${hzvtc.dailyReportFileOutPath}")
|
||||
private String dailyReportFileOutPath;
|
||||
|
||||
@Autowired
|
||||
private EmailService emailService;
|
||||
@Autowired
|
||||
private ResultMediaService resultMediaService;
|
||||
|
||||
/**
|
||||
* 查询监测结果记录
|
||||
*
|
||||
* @param recordId 监测结果记录主键
|
||||
* @return 监测结果记录
|
||||
*/
|
||||
@Override
|
||||
public ResultRecord selectResultRecordByRecordId(Long recordId) {
|
||||
return resultRecordMapper.selectResultRecordByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询监测结果记录列表
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 监测结果记录
|
||||
*/
|
||||
@Override
|
||||
public List<ResultRecord> selectResultRecordList(ResultRecord resultRecord) {
|
||||
return resultRecordMapper.selectResultRecordList(resultRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测结果记录
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertResultRecord(ResultRecord resultRecord) {
|
||||
return resultRecordMapper.insertResultRecord(resultRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测结果记录
|
||||
*
|
||||
* @param resultRecord 监测结果记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateResultRecord(ResultRecord resultRecord) {
|
||||
return resultRecordMapper.updateResultRecord(resultRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除监测结果记录
|
||||
*
|
||||
* @param recordIds 需要删除的监测结果记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteResultRecordByRecordIds(Long[] recordIds) {
|
||||
return resultRecordMapper.deleteResultRecordByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监测结果记录信息
|
||||
*
|
||||
* @param recordId 监测结果记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteResultRecordByRecordId(Long recordId) {
|
||||
return resultRecordMapper.deleteResultRecordByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getBirdDataStatByParam(JSONObject param) {
|
||||
JSONObject result = new JSONObject();
|
||||
Map<String, Object> map = new HashMap();
|
||||
String calcDate = param.getString("calcDate");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
map.put("calcDate", df.format(new Date()));
|
||||
} else {
|
||||
map.put("calcDate", calcDate);
|
||||
}
|
||||
String birdCode = param.getString("birdCode");
|
||||
if (birdCode != null && !birdCode.isEmpty()) {
|
||||
map.put("birdCode", birdCode);
|
||||
}
|
||||
|
||||
Long areaId = param.getLong("areaId");
|
||||
map.put("areaId", areaId);
|
||||
|
||||
String isCommon = param.getString("isCommon");
|
||||
if (isCommon != null && !isCommon.isEmpty()) {
|
||||
map.put("isCommon", Integer.parseInt(isCommon));
|
||||
} else {
|
||||
map.put("isCommon", 1);
|
||||
}
|
||||
map.put("limit", 8);
|
||||
|
||||
result.put("deviceData", birdDataStatService.getBirdCountInfoListByDevice(map));
|
||||
|
||||
//list = birdDataStatService.getBirdCountInfoListBySpeciesId(map);
|
||||
result.put("speciesData", birdDataStatService.getBirdCountInfoListBySpeciesId(map));
|
||||
|
||||
|
||||
//list = birdDataStatService.getBirdCountInfoListByHabit(map);
|
||||
result.put("habitatData", birdDataStatService.getBirdCountInfoListByHabit(map));
|
||||
|
||||
ResultMedia media = new ResultMedia();
|
||||
ProtectedArea protectedArea = protectedAreaService.selectProtectedAreaById(areaId);
|
||||
media.setAreaId(areaId);
|
||||
if (protectedArea.getPicWidth() > 0) {
|
||||
media.setWidth(protectedArea.getPicWidth());
|
||||
} else {
|
||||
media.setWidth(100);
|
||||
}
|
||||
if (protectedArea.getPicHeight() > 0) {
|
||||
media.setHeight(protectedArea.getPicHeight());
|
||||
} else {
|
||||
media.setHeight(100);
|
||||
}
|
||||
if (protectedArea.getPicNum() > 0) {
|
||||
media.setLimit(protectedArea.getPicNum());
|
||||
} else {
|
||||
media.setLimit(8);
|
||||
}
|
||||
media.setMediaType(2);
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
media.setTime(df.parse(calcDate));
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage());
|
||||
}
|
||||
//map.put("time", calcDate);
|
||||
|
||||
List<ResultMedia> mediaList = resultMediaService.selectResultMediaList(media);
|
||||
result.put("mediaList", mediaList);
|
||||
// emailService.sendSimpleEmail("邮件测试", "这是一封测试邮件", "935195927@qq.com");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBirdDataStatFileByParam(JSONObject param) {
|
||||
try {
|
||||
Long areaId = param.getLong("areaId");
|
||||
String areaCode = "";
|
||||
String areaName = "";
|
||||
|
||||
if (areaId != null) {
|
||||
ProtectedArea protectedArea = protectedAreaService.selectProtectedAreaById(areaId);
|
||||
areaCode = protectedArea.getCode();
|
||||
areaName = protectedArea.getName();
|
||||
} else {
|
||||
return "500";
|
||||
}
|
||||
|
||||
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(dailyReportFilePath + "daily_report_" + areaCode + ".xlsx"));
|
||||
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(dailyReportFilePath + "daily_report_tmpl.xlsx"));
|
||||
XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
|
||||
sheet.getRow(1).getCell(1).setCellValue(areaName + "鸟类监测日报");
|
||||
String calcDate = param.getString("calcDate");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calcDate = df.format(new Date());
|
||||
}
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
sheet.getRow(2).getCell(1).setCellValue("日期:" + calcDate);
|
||||
sheet.getRow(4).getCell(1).setCellValue(areaName + "每日鸟类智慧监测数据,包含鸟类监测总数,关键鸟类生境分布和关键物种分时监测数量");
|
||||
JSONObject result = getBirdDataStatByParam(param);
|
||||
// int baseDiffRow = 0;
|
||||
JSONArray array = result.getJSONArray("deviceData");
|
||||
int[] sum = {0, 0, 0};
|
||||
if (array != null) {
|
||||
AtomicInteger starRow = new AtomicInteger(8);
|
||||
//
|
||||
// int len = array.size();
|
||||
// if (len > 4) {
|
||||
// int diff = len - 4;
|
||||
// baseDiffRow += diff;
|
||||
// sheet.shiftRows(8, sheet.getLastRowNum(), diff);
|
||||
// for (int i = 0; i < diff; i++) {
|
||||
// Row newRow = sheet.createRow(8 + i);
|
||||
// for (int j = 0; j < 5; j++) {
|
||||
// newRow.createCell(j);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// List<Object> list;
|
||||
// if (array.size() > 4) {
|
||||
// list = array.subList(0, 4);
|
||||
// } else {
|
||||
// list = array.subList(0, array.size());
|
||||
// }
|
||||
|
||||
array.stream().forEach(data -> {
|
||||
JSONObject obj = (JSONObject) data;
|
||||
int cell = 1;
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(obj.getString("name"));
|
||||
JSONArray subarray = obj.getJSONArray("list");
|
||||
int[] value = {0, 0, 0};
|
||||
// int[] data2 = {0};
|
||||
// int[] data3 = {0};
|
||||
if (subarray != null) {
|
||||
subarray.stream().map(el -> (BirdStatDataVo) el).forEach(element -> {
|
||||
int hour = element.getHour();
|
||||
int count = element.getCount();
|
||||
if (hour <= 12) {
|
||||
if (value[0] < count) {
|
||||
value[0] = count;
|
||||
}
|
||||
} else {
|
||||
if (value[1] < count) {
|
||||
value[1] = count;
|
||||
}
|
||||
}
|
||||
value[2] = value[0] > value[1] ? value[0] : value[1];
|
||||
});
|
||||
}
|
||||
|
||||
for (int i = 0; i < sum.length; i++) {
|
||||
sum[i] += value[i];
|
||||
}
|
||||
for (int i = 0; i < value.length; i++) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(value[i]);
|
||||
}
|
||||
|
||||
starRow.getAndIncrement();
|
||||
});
|
||||
int cell = 2;
|
||||
for (int i = 0; i < sum.length; i++) {
|
||||
sheet.getRow(28).getCell(cell++).setCellValue(sum[i]);
|
||||
}
|
||||
for (int i = 0; i < 20 - array.size(); i++) {
|
||||
XSSFRow row = sheet.getRow(8 + array.size() + i);
|
||||
row.setZeroHeight(true);
|
||||
}
|
||||
}
|
||||
|
||||
array = result.getJSONArray("habitatData");
|
||||
if (array != null) {
|
||||
AtomicInteger starRow = new AtomicInteger(32);
|
||||
List<Object> list;
|
||||
if (array.size() > 8) {
|
||||
list = array.subList(0, 8);
|
||||
} else {
|
||||
list = array.subList(0, array.size());
|
||||
}
|
||||
array.stream().forEach(data -> {
|
||||
JSONObject obj = (JSONObject) data;
|
||||
int cell = 1;
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(obj.getString("name"));
|
||||
int[] value = {0, 0, 0, 0, 0};
|
||||
|
||||
JSONArray subArray = obj.getJSONArray("list");
|
||||
if (subArray != null) {
|
||||
subArray.stream().map(el -> (BirdStatDataVo) el).forEach(element -> {
|
||||
String code = element.getCode();
|
||||
if ("ground".equals(code)) {
|
||||
value[0] = element.getCount();
|
||||
} else if ("shoreside".equals(code)) {
|
||||
value[1] = element.getCount();
|
||||
} else if ("water".equals(code)) {
|
||||
value[2] = element.getCount();
|
||||
} else if ("tree".equals(code)) {
|
||||
value[3] = element.getCount();
|
||||
} else {
|
||||
value[4] = element.getCount();
|
||||
}
|
||||
});
|
||||
}
|
||||
for (int i = 0; i < value.length; i++) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(value[i]);
|
||||
}
|
||||
|
||||
starRow.getAndIncrement();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
array = result.getJSONArray("speciesData");
|
||||
if (array != null) {
|
||||
AtomicInteger starRow = new AtomicInteger(43);
|
||||
List<Object> list;
|
||||
if (array.size() > 8) {
|
||||
list = array.subList(0, 8);
|
||||
} else {
|
||||
list = array.subList(0, array.size());
|
||||
}
|
||||
list.forEach(data -> {
|
||||
JSONObject obj = (JSONObject) data;
|
||||
int cell = 1;
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(obj.getString("name"));
|
||||
int[] value = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
JSONArray subArray = obj.getJSONArray("list");
|
||||
if (subArray != null) {
|
||||
subArray.stream().map(el -> (BirdStatDataVo) el).forEach(element -> {
|
||||
int hour = element.getHour();
|
||||
int index = hour - 8;
|
||||
if (index >= 0 && index <= 11) {
|
||||
value[index] = element.getCount();
|
||||
}
|
||||
});
|
||||
}
|
||||
for (int i = 0; i < value.length; i++) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(value[i]);
|
||||
}
|
||||
//int max = Collections.max(Arrays.asList(value));
|
||||
Arrays.sort(value);
|
||||
int max = value[value.length - 1];
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(max);
|
||||
|
||||
starRow.getAndIncrement();
|
||||
});
|
||||
}
|
||||
array = result.getJSONArray("mediaList");
|
||||
if (array != null) {
|
||||
AtomicInteger starRow = new AtomicInteger(51);
|
||||
// AtomicInteger count = new AtomicInteger();
|
||||
// AtomicInteger col = new AtomicInteger(1);
|
||||
List<Object> list;
|
||||
if (array.size() > 8) {
|
||||
list = array.subList(0, 8);
|
||||
} else {
|
||||
list = array.subList(0, array.size());
|
||||
}
|
||||
array.stream().forEach(data -> {
|
||||
ResultMedia obj = (ResultMedia) data;
|
||||
String path = obj.getMediaUrl();
|
||||
if (path != null && !path.isEmpty()) {
|
||||
try {
|
||||
//InputStream is = new FileInputStream(AiBirdSysConfig.getBirdImagePath() + path);
|
||||
InputStream is = getFileInputStream(AiBirdSysConfig.getBirdImagePath() + path);
|
||||
if (is != null) {
|
||||
byte[] bytes = IOUtils.toByteArray(is);
|
||||
int pictureIdx = xssfWorkbook.addPicture(bytes, xssfWorkbook.PICTURE_TYPE_JPEG);
|
||||
is.close();
|
||||
CreationHelper helper = xssfWorkbook.getCreationHelper();
|
||||
ClientAnchor anchor = helper.createClientAnchor();
|
||||
Drawing drawing = sheet.createDrawingPatriarch();
|
||||
sheet.getRow(starRow.get()).setHeightInPoints(obj.getHeight());
|
||||
anchor.setCol1(1);
|
||||
anchor.setRow1(starRow.get());
|
||||
Picture pict = drawing.createPicture(anchor, pictureIdx);
|
||||
pict.resize();
|
||||
starRow.getAndIncrement();
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
String outfile = dailyReportFileOutPath + areaName + "鸟类监测日报(日期" + calcDate + ")" + ".xlsx";
|
||||
FileOutputStream fileOut = new FileOutputStream(outfile);
|
||||
xssfWorkbook.write(fileOut);
|
||||
xssfWorkbook.close();
|
||||
fileOut.close();
|
||||
// emailService.sendEmailWithAttachment("这个是一份带附件的测试邮件", "附件为文件,请查收", outfile, "935195927@qq.com");
|
||||
return outfile;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private InputStream getFileInputStream(String filePath) {
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
Path path = file.toPath().toRealPath();
|
||||
boolean flag = !path.equals(file.toPath());
|
||||
if (flag) {
|
||||
InputStream is = new FileInputStream(path.toFile());
|
||||
return is;
|
||||
} else {
|
||||
InputStream is = new FileInputStream(filePath);
|
||||
return is;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBirdDataStatEmail() {
|
||||
List<ProtectedArea> list = protectedAreaService.getProtectedAreaEmailList();
|
||||
JSONObject obj = new JSONObject();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String calcDate = df.format(new Date());
|
||||
obj.put("calcDate", calcDate);
|
||||
if (list != null && list.size() > 0) {
|
||||
list.forEach(data -> {
|
||||
obj.put("areaCode", data.getCode());
|
||||
obj.put("areaId", data.getId());
|
||||
String filePath = getBirdDataStatFileByParam(obj);
|
||||
if (filePath != null && !filePath.isEmpty()) {
|
||||
emailService.sendEmailWithAttachment(data.getName() + "鸟类监测日报,检测时间:" + calcDate, "附件为鸟类监测日报,请查收", filePath, data.getEmail());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBirdDataWeeklyStatEmail() {
|
||||
List<ProtectedArea> list = protectedAreaService.getProtectedAreaEmailList();
|
||||
JSONObject obj = new JSONObject();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String calcDate = df.format(new Date());
|
||||
obj.put("calcDate", calcDate);
|
||||
if (list != null && list.size() > 0) {
|
||||
list.forEach(data -> {
|
||||
obj.put("areaCode", data.getCode());
|
||||
obj.put("areaId", data.getId());
|
||||
String dateBegin = DateUtils.getFirstDayOfWeek(calcDate);
|
||||
String dateEnd = DateUtils.getLastDayOfWeek(calcDate);
|
||||
String filePath = getBirdDataWeeklyStatFileByParam(obj);
|
||||
if (filePath != null && !filePath.isEmpty()) {
|
||||
emailService.sendEmailWithAttachment(data.getName() + "鸟类监测周报,检测时间:" + dateBegin + "~" + dateEnd, "附件为鸟类监测周报,检测时间为:" + dateBegin + "~" + dateEnd + ",请查收!", filePath, data.getEmail());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendBirdDataStatEmail(JSONObject param) {
|
||||
String areaId = param.getString("areaId");
|
||||
String calcDate = param.getString("calcDate");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calcDate = df.format(new Date());
|
||||
}
|
||||
ProtectedArea data = null;
|
||||
if (areaId != null && !areaId.isEmpty()) {
|
||||
data = protectedAreaService.selectProtectedAreaById(Long.parseLong(areaId));
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
String filePath = getBirdDataStatFileByParam(param);
|
||||
|
||||
if (filePath != null && !filePath.isEmpty()) {
|
||||
emailService.sendEmailWithAttachment(data.getName() + "鸟类监测日报,检测时间:" + calcDate, "附件为鸟类监测日报,请查收", filePath, data.getEmail());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendBirdDataWeeklyStatEmail(JSONObject param) {
|
||||
String areaId = param.getString("areaId");
|
||||
String calcDate = param.getString("calcDate");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calcDate = df.format(new Date());
|
||||
}
|
||||
String areaCode = "";
|
||||
ProtectedArea data = null;
|
||||
if (areaId != null && !areaId.isEmpty()) {
|
||||
data = protectedAreaService.selectProtectedAreaById(Long.parseLong(areaId));
|
||||
areaCode = data.getCode();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
param.put("areaCode", areaCode);
|
||||
String dateBegin = DateUtils.getFirstDayOfWeek(calcDate);
|
||||
String dateEnd = DateUtils.getLastDayOfWeek(calcDate);
|
||||
|
||||
String filePath = getBirdDataWeeklyStatFileByParam(param);
|
||||
if (filePath != null && !filePath.isEmpty()) {
|
||||
emailService.sendEmailWithAttachment(data.getName() + "鸟类监测周报,检测时间:" + dateBegin + "~" + dateEnd, "附件为鸟类监测周报,检测时间为:" + dateBegin + "~" + dateEnd + ",请查收!", filePath, data.getEmail());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getBirdDataWeeklyStatByParam(JSONObject param) {
|
||||
JSONObject result = new JSONObject();
|
||||
Map<String, Object> map = new HashMap();
|
||||
String calcDate = param.getString("calcDate");
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
calcDate = df.format(new Date());
|
||||
}
|
||||
map.put("dateBegin", DateUtils.getFirstDayOfWeek(calcDate));
|
||||
map.put("dateEnd", DateUtils.getLastDayOfWeek(calcDate));
|
||||
String areaId = param.getString("areaId");
|
||||
if (areaId != null && !areaId.isEmpty()) {
|
||||
map.put("areaId", Long.parseLong(areaId));
|
||||
}
|
||||
map.put("isCommon", param.getInteger("isCommon"));
|
||||
result.put("areaData", birdDataStatService.getBirdWeeklyStatByDeviceParam(map));
|
||||
|
||||
|
||||
//List<BirdStatDataVo> list = birdDataStatService.getBirdWeeklyStatBySpecies(map);
|
||||
result.put("speciesData", birdDataStatService.getBirdWeeklyStatBySpecies(map));
|
||||
|
||||
//List<BirdStatDataVo> list = birdDataStatService.getBirdWeeklyStatByHabit(map);
|
||||
result.put("habitatData", birdDataStatService.getBirdWeeklyStatByHabit(map));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private int getBirdCount(String count) {
|
||||
if (count != null && !count.isEmpty()) {
|
||||
return Integer.parseInt(count);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBirdDataWeeklyStatFileByParam(JSONObject param) {
|
||||
try {
|
||||
String areaId = param.getString("areaId");
|
||||
// String areaCode = param.getString("areaCode");
|
||||
String areaName = "";
|
||||
|
||||
// if (areaCode == null || areaCode.isEmpty()) {
|
||||
//
|
||||
// }
|
||||
if (areaId != null && !areaId.isEmpty()) {
|
||||
ProtectedArea protectedArea = protectedAreaService.selectProtectedAreaById(Long.parseLong(areaId));
|
||||
// areaCode = protectedArea.getCode();
|
||||
areaName = protectedArea.getName();
|
||||
} else {
|
||||
return "500";
|
||||
}
|
||||
|
||||
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(dailyReportFilePath + "weekly_report_tmpl.xlsx"));
|
||||
XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
|
||||
sheet.getRow(1).getCell(1).setCellValue(areaName + "鸟类监测周报");
|
||||
String calcDate = param.getString("calcDate");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calcDate = df.format(new Date());
|
||||
}
|
||||
String dateBegin = DateUtils.getFirstDayOfWeek(calcDate);
|
||||
String dateEnd = DateUtils.getLastDayOfWeek(calcDate);
|
||||
|
||||
//SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
sheet.getRow(2).getCell(1).setCellValue("日期:" + dateBegin + "~" + dateEnd);
|
||||
sheet.getRow(4).getCell(1).setCellValue(areaName + "每周鸟类智慧监测数据,包含鸟类监测总数,关键鸟类生境分布和关键物种监测数量");
|
||||
param.put("dateBegin", dateBegin);
|
||||
param.put("dateEnd", dateEnd);
|
||||
param.put("limit", 8);
|
||||
param.put("isCommon", 1);
|
||||
|
||||
// XSSFChart chart;
|
||||
// XSSFDrawing drawingPatriarch = sheet.getDrawingPatriarch();
|
||||
// List<XSSFChart> charts = drawingPatriarch.getCharts();
|
||||
// CTChart ctChart = null;
|
||||
// CTPlotArea plotArea = null;
|
||||
|
||||
JSONObject result = getBirdDataWeeklyStatByParam(param);
|
||||
JSONArray array = result.getJSONArray("areaData");
|
||||
// int baseDiffRow = 0;
|
||||
if (array != null) {
|
||||
int[] sum = new int[8];
|
||||
AtomicInteger starRow = new AtomicInteger(8);
|
||||
// int diff = appendSheetRow(array.size(), 4, 9, sheet);
|
||||
// baseDiffRow += diff;
|
||||
// List<Object> list;
|
||||
// if (array.size() > 4) {
|
||||
// list = array.subList(0, 4);
|
||||
// } else {
|
||||
// list = array.subList(0, array.size());
|
||||
// }
|
||||
array.stream().forEach(data -> {
|
||||
JSONObject obj = (JSONObject) data;
|
||||
int cell = 1;
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(obj.getString("name"));
|
||||
JSONArray subarray = obj.getJSONArray("list");
|
||||
int counts[] = new int[7];
|
||||
if (subarray != null) {
|
||||
subarray.stream().map(el -> (BirdStatDataVo) el).forEach(element -> {
|
||||
counts[element.getWeekDay()] = element.getCount();
|
||||
});
|
||||
}
|
||||
int i = 0;
|
||||
for (int val : counts) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(val);
|
||||
sum[i++] += val;
|
||||
}
|
||||
Arrays.sort(counts);
|
||||
int max = counts[counts.length - 1];
|
||||
sum[i] += max;
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(max);
|
||||
starRow.getAndIncrement();
|
||||
});
|
||||
int cell = 2;
|
||||
starRow.set(28);
|
||||
for (int val : sum) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(val);
|
||||
}
|
||||
int start = 9 + array.size();
|
||||
log.info("============start===={}", start);
|
||||
for (int i = 0; i < 20 - array.size(); i++) {
|
||||
XSSFRow row = sheet.getRow(start + i);
|
||||
row.setZeroHeight(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
array = result.getJSONArray("speciesData");
|
||||
if (array != null) {
|
||||
AtomicInteger starRow = new AtomicInteger(43);
|
||||
List<Object> list;
|
||||
if (array.size() > 8) {
|
||||
list = array.subList(0, 8);
|
||||
} else {
|
||||
list = array.subList(0, array.size());
|
||||
}
|
||||
list.forEach(data -> {
|
||||
JSONObject obj = (JSONObject) data;
|
||||
int cell = 1;
|
||||
// log.info("=====name==={}", obj.getString("name"));
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(obj.getString("name"));
|
||||
JSONArray subarray = obj.getJSONArray("list");
|
||||
int counts[] = new int[7];
|
||||
if (subarray != null) {
|
||||
subarray.stream().map(el -> (BirdStatDataVo) el).forEach(element -> {
|
||||
counts[element.getWeekDay()] = element.getCount();
|
||||
});
|
||||
}
|
||||
for (int val : counts) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(val);
|
||||
}
|
||||
Arrays.sort(counts);
|
||||
int max = counts[counts.length - 1];
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(max);
|
||||
starRow.getAndIncrement();
|
||||
});
|
||||
}
|
||||
|
||||
array = result.getJSONArray("habitatData");
|
||||
if (array != null) {
|
||||
AtomicInteger starRow = new AtomicInteger(67);
|
||||
// int diff = appendSheetRow(array.size(), 8, 52 + baseDiffRow, sheet);
|
||||
// baseDiffRow += diff;
|
||||
List<Object> list;
|
||||
if (array.size() > 8) {
|
||||
list = array.subList(0, 8);
|
||||
} else {
|
||||
list = array.subList(0, array.size());
|
||||
}
|
||||
list.forEach(data -> {
|
||||
JSONObject obj = (JSONObject) data;
|
||||
int cell = 1;
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(obj.getString("name"));
|
||||
int counts[] = new int[5];
|
||||
JSONArray subarray = obj.getJSONArray("list");
|
||||
if (subarray != null) {
|
||||
subarray.stream().map(el -> (BirdStatDataVo) el).forEach(element -> {
|
||||
//counts[element.getWeekDay()] = element.getCount();
|
||||
if ("ground".equals(element.getCode())) {
|
||||
counts[0] = element.getCount();
|
||||
} else if ("shoreside".equals(element.getCode())) {
|
||||
counts[1] = element.getCount();
|
||||
} else if ("water".equals(element.getCode())) {
|
||||
counts[2] = element.getCount();
|
||||
} else if ("tree".equals(element.getCode())) {
|
||||
counts[3] = element.getCount();
|
||||
} else {
|
||||
counts[4] = element.getCount();
|
||||
}
|
||||
});
|
||||
}
|
||||
for (int val : counts) {
|
||||
sheet.getRow(starRow.get()).getCell(cell++).setCellValue(val);
|
||||
}
|
||||
starRow.getAndIncrement();
|
||||
});
|
||||
|
||||
// chart = charts.get(0);
|
||||
// ctChart = chart.getCTChart();
|
||||
// plotArea = ctChart.getPlotArea();
|
||||
// CTBarSer barSer = plotArea.getBarChartArray(0).getSerArray(0);
|
||||
// String formula = String.format("周报!$B$%d:$F$%d", (52 + baseDiffRow), (52 + baseDiffRow + array.size()));
|
||||
// barSer.getVal().getNumRef().setF(formula);
|
||||
}
|
||||
String outfile = dailyReportFileOutPath + areaName + "鸟类监测周报(日期" + dateBegin + "-" + dateEnd + ")" + ".xlsx";
|
||||
FileOutputStream fileOut = new FileOutputStream(outfile);
|
||||
xssfWorkbook.write(fileOut);
|
||||
xssfWorkbook.close();
|
||||
fileOut.close();
|
||||
// emailService.sendEmailWithAttachment("这个是一份带附件的测试邮件", "附件为文件,请查收", outfile, "935195927@qq.com");
|
||||
return outfile;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBirdDataMonthlyStatFileByParam(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getResultAreaListByParam(Map<String, Object> map) {
|
||||
return resultRecordMapper.getResultAreaListByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getResultRecordIdsByParam(Map<String, Object> map) {
|
||||
return resultRecordMapper.getResultRecordIdsByParam(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultRecord> getCurrentDateResultRecordList(JSONObject param) {
|
||||
Long areaId = param.getLong("areaId");
|
||||
if (areaId == null) {
|
||||
return null;
|
||||
}
|
||||
Map<String, Object> map = new HashMap();
|
||||
map.put("areaId", areaId);
|
||||
String calcDate = param.getString("calcDate");
|
||||
if (calcDate == null || calcDate.isEmpty()) {
|
||||
calcDate = LocalDate.now().toString();
|
||||
}
|
||||
map.put("calcDate", calcDate);
|
||||
// map.put("calcDate", "2023-10-14");
|
||||
return resultRecordMapper.getCurrentDateResultRecordList(map);
|
||||
}
|
||||
|
||||
private int appendSheetRow(int len, int size, int startRow, XSSFSheet sheet) {
|
||||
//int len = array.size();
|
||||
int diff = 0;
|
||||
if (len > size) {
|
||||
diff = len - size;
|
||||
sheet.shiftRows(startRow, sheet.getLastRowNum(), diff);
|
||||
for (int i = 0; i < diff; i++) {
|
||||
Row newRow = sheet.createRow(startRow + i);
|
||||
// for (int j = 0; j < 10; j++) {
|
||||
// newRow.createCell(j);
|
||||
// }
|
||||
sheet.copyRows(startRow - 1, startRow - 1, startRow + i, new CellCopyPolicy());
|
||||
}
|
||||
|
||||
}
|
||||
return diff;
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package net.hzvtc.data.job.controller;
|
||||
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.data.job.domain.TableStatInfo;
|
||||
import net.hzvtc.data.job.service.TableStatInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* job生成数据Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stat/tableStat")
|
||||
public class TableStatInfoController extends BaseController {
|
||||
@Autowired
|
||||
private TableStatInfoService tableStatInfoService;
|
||||
|
||||
/**
|
||||
* 查询job生成数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stat:tableStat:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TableStatInfo tableStatInfo) {
|
||||
startPage();
|
||||
List<TableStatInfo> list = tableStatInfoService.selectTableStatInfoList(tableStatInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出job生成数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stat:tableStat:export')")
|
||||
@Log(title = "job生成数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TableStatInfo tableStatInfo) {
|
||||
List<TableStatInfo> list = tableStatInfoService.selectTableStatInfoList(tableStatInfo);
|
||||
ExcelUtil<TableStatInfo> util = new ExcelUtil<TableStatInfo>(TableStatInfo.class);
|
||||
util.exportExcel(response, list, "job生成数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取job生成数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stat:tableStat:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(tableStatInfoService.selectTableStatInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增job生成数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stat:tableStat:add')")
|
||||
@Log(title = "job生成数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TableStatInfo tableStatInfo) {
|
||||
return toAjax(tableStatInfoService.insertTableStatInfo(tableStatInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改job生成数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stat:tableStat:edit')")
|
||||
@Log(title = "job生成数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TableStatInfo tableStatInfo) {
|
||||
return toAjax(tableStatInfoService.updateTableStatInfo(tableStatInfo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package net.hzvtc.data.job.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* job生成数据对象 table_stat_info
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-17
|
||||
*/
|
||||
@Data
|
||||
@Alias("TableStatInfo")
|
||||
public class TableStatInfo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 目前统计Id
|
||||
*/
|
||||
@Excel(name = "目前统计Id")
|
||||
private Long tableId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型")
|
||||
private int type;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("tableId", getTableId())
|
||||
.append("type", getType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.hzvtc.data.job.mapper;
|
||||
|
||||
import net.hzvtc.data.job.domain.TableStatInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* job生成数据Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-17
|
||||
*/
|
||||
public interface TableStatInfoMapper {
|
||||
/**
|
||||
* 查询job生成数据
|
||||
*
|
||||
* @param id job生成数据主键
|
||||
* @return job生成数据
|
||||
*/
|
||||
public TableStatInfo selectTableStatInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询job生成数据列表
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return job生成数据集合
|
||||
*/
|
||||
public List<TableStatInfo> selectTableStatInfoList(TableStatInfo tableStatInfo);
|
||||
|
||||
/**
|
||||
* 新增job生成数据
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTableStatInfo(TableStatInfo tableStatInfo);
|
||||
|
||||
/**
|
||||
* 修改job生成数据
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTableStatInfo(TableStatInfo tableStatInfo);
|
||||
|
||||
/**
|
||||
* 删除job生成数据
|
||||
*
|
||||
* @param id job生成数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTableStatInfoById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.hzvtc.data.job.service;
|
||||
|
||||
import net.hzvtc.data.job.domain.TableStatInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* job生成数据Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-17
|
||||
*/
|
||||
public interface TableStatInfoService {
|
||||
/**
|
||||
* 查询job生成数据
|
||||
*
|
||||
* @param id job生成数据主键
|
||||
* @return job生成数据
|
||||
*/
|
||||
TableStatInfo selectTableStatInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询job生成数据列表
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return job生成数据集合
|
||||
*/
|
||||
List<TableStatInfo> selectTableStatInfoList(TableStatInfo tableStatInfo);
|
||||
|
||||
/**
|
||||
* 新增job生成数据
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTableStatInfo(TableStatInfo tableStatInfo);
|
||||
|
||||
/**
|
||||
* 修改job生成数据
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTableStatInfo(TableStatInfo tableStatInfo);
|
||||
|
||||
/**
|
||||
* 删除job生成数据信息
|
||||
*
|
||||
* @param id job生成数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTableStatInfoById(Long id);
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package net.hzvtc.data.job.service.impl;
|
||||
|
||||
import net.hzvtc.data.job.domain.TableStatInfo;
|
||||
import net.hzvtc.data.job.mapper.TableStatInfoMapper;
|
||||
import net.hzvtc.data.job.service.TableStatInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* job生成数据Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @date 2023-08-17
|
||||
*/
|
||||
@Service
|
||||
public class TableStatInfoServiceImpl implements TableStatInfoService {
|
||||
@Resource
|
||||
private TableStatInfoMapper tableStatInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询job生成数据
|
||||
*
|
||||
* @param id job生成数据主键
|
||||
* @return job生成数据
|
||||
*/
|
||||
@Override
|
||||
public TableStatInfo selectTableStatInfoById(Long id) {
|
||||
return tableStatInfoMapper.selectTableStatInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询job生成数据列表
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return job生成数据
|
||||
*/
|
||||
@Override
|
||||
public List<TableStatInfo> selectTableStatInfoList(TableStatInfo tableStatInfo) {
|
||||
return tableStatInfoMapper.selectTableStatInfoList(tableStatInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增job生成数据
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTableStatInfo(TableStatInfo tableStatInfo) {
|
||||
return tableStatInfoMapper.insertTableStatInfo(tableStatInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改job生成数据
|
||||
*
|
||||
* @param tableStatInfo job生成数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTableStatInfo(TableStatInfo tableStatInfo) {
|
||||
return tableStatInfoMapper.updateTableStatInfo(tableStatInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除job生成数据信息
|
||||
*
|
||||
* @param id job生成数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTableStatInfoById(Long id) {
|
||||
return tableStatInfoMapper.deleteTableStatInfoById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package net.hzvtc.device.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.device.domain.DeviceInfo;
|
||||
import net.hzvtc.device.domain.DevicePerson;
|
||||
import net.hzvtc.device.service.DeviceInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/baseInfo")
|
||||
public class DeviceInfoController extends BaseController {
|
||||
@Autowired
|
||||
private DeviceInfoService deviceInfoService;
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('device:baseInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DeviceInfo deviceInfo) {
|
||||
// if (deviceInfo.getDeptId() != null) {
|
||||
// if (deviceInfo.getDeptId() != 0L) {
|
||||
// deviceInfo.getParams().put("ancestors",deviceInfoService.getAncestorsById(deviceInfo.getDeptId()));
|
||||
// } else {
|
||||
// deviceInfo.setDeptId(null);
|
||||
// }
|
||||
// }
|
||||
// System.out.println(SecurityUtils.getLoginUser().getDeptId());
|
||||
|
||||
deviceInfo = deviceInfoService.getDeviceInfoQueryParam(deviceInfo);
|
||||
startPage();
|
||||
List<DeviceInfo> list = deviceInfoService.selectDeviceInfoList(deviceInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listByParam")
|
||||
public AjaxResult getListByParam(DeviceInfo deviceInfo) {
|
||||
return AjaxResult.success(deviceInfoService.getDeviceInfoListForPage(deviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:baseInfo:export')")
|
||||
@Log(title = "设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInfo deviceInfo) {
|
||||
List<DeviceInfo> list = deviceInfoService.selectDeviceInfoList(deviceInfo);
|
||||
ExcelUtil<DeviceInfo> util = new ExcelUtil<>(DeviceInfo.class);
|
||||
util.exportExcel(response, list, "设备数据");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/exportPerson")
|
||||
public void exportPerson(HttpServletResponse response, DeviceInfo deviceInfo) {
|
||||
List<DevicePerson> list = deviceInfoService.getPersonInfoListByParam(deviceInfo);
|
||||
ExcelUtil<DevicePerson> util = new ExcelUtil<>(DevicePerson.class);
|
||||
util.exportExcel(response, list, "人员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:baseInfo:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(deviceInfoService.selectDeviceInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:baseInfo:add')")
|
||||
@Log(title = "设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DeviceInfo deviceInfo) {
|
||||
return toAjax(deviceInfoService.insertDeviceInfo(deviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:baseInfo:edit')")
|
||||
@Log(title = "设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DeviceInfo deviceInfo) {
|
||||
return toAjax(deviceInfoService.updateDeviceInfo(deviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:baseInfo:remove')")
|
||||
@Log(title = "设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(deviceInfoService.deleteDeviceInfoByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<DeviceInfo> util = new ExcelUtil<>(DeviceInfo.class);
|
||||
List<DeviceInfo> list = util.importExcel(file.getInputStream());
|
||||
String message = deviceInfoService.importData(list, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DeviceInfo> util = new ExcelUtil<>(DeviceInfo.class);
|
||||
util.importTemplateExcel(response, "设备信息");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/list/ByUserId")
|
||||
public AjaxResult getCameraListByUserId() {
|
||||
return AjaxResult.success(deviceInfoService.getDeviceStatInfoByParam());
|
||||
}
|
||||
|
||||
@PostMapping(value = "/list/ByParam")
|
||||
public AjaxResult getCameraListByParameter(@RequestBody(required = false) JSONObject jsonObject) {
|
||||
return AjaxResult.success(deviceInfoService.getDeviceInfoListByParam(jsonObject));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/listByDept/{deptId}")
|
||||
public AjaxResult getDeviceListByDeptId(@PathVariable("deptId") Long deptId) {
|
||||
return AjaxResult.success(deviceInfoService.getDeviceInfoListByDeptId(deptId));
|
||||
}
|
||||
|
||||
@GetMapping("/listForSelect")
|
||||
public List<DeviceInfo> getDeviceListForSelect() {
|
||||
return deviceInfoService.getDeviceInfoListForSel();
|
||||
}
|
||||
|
||||
@GetMapping("/listForMap")
|
||||
public List<DeviceInfo> getDeviceListForGisMap() {
|
||||
return deviceInfoService.getDeviceInfoListForGisMap();
|
||||
}
|
||||
|
||||
@PostMapping("/updateRate")
|
||||
public AjaxResult updateRate(@RequestBody DeviceInfo deviceInfo) {
|
||||
return AjaxResult.success(deviceInfoService.updateDeviceRate(deviceInfo));
|
||||
}
|
||||
|
||||
@GetMapping("/statInfo")
|
||||
public AjaxResult getDeviceStatInfo(DeviceInfo deviceInfo) {
|
||||
return AjaxResult.success(deviceInfoService.getDeviceStatInfoByParam(deviceInfo));
|
||||
}
|
||||
|
||||
@GetMapping("/updateEvalator")
|
||||
public AjaxResult updateEvalator() {
|
||||
deviceInfoService.updateDeviceEvalator();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package net.hzvtc.device.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.device.domain.DeviceItem;
|
||||
import net.hzvtc.device.service.DeviceItemService;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 相机参数Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-08-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/item")
|
||||
public class DeviceItemController extends BaseController {
|
||||
@Autowired
|
||||
private DeviceItemService deviceItemService;
|
||||
|
||||
/**
|
||||
* 查询相机参数列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('item:item:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DeviceItem deviceItem) {
|
||||
startPage();
|
||||
List<DeviceItem> list = deviceItemService.selectDeviceItemList(deviceItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出相机参数列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('item:item:export')")
|
||||
@Log(title = "相机参数", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceItem deviceItem) {
|
||||
List<DeviceItem> list = deviceItemService.selectDeviceItemList(deviceItem);
|
||||
ExcelUtil<DeviceItem> util = new ExcelUtil<DeviceItem>(DeviceItem. class);
|
||||
util.exportExcel(response, list, "相机参数数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取相机参数详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('item:item:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(deviceItemService.selectDeviceItemById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增相机参数
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('item:item:add')")
|
||||
@Log(title = "相机参数", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DeviceItem deviceItem) {
|
||||
return toAjax(deviceItemService.insertDeviceItem(deviceItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改相机参数
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('item:item:edit')")
|
||||
@Log(title = "相机参数", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DeviceItem deviceItem) {
|
||||
return toAjax(deviceItemService.updateDeviceItem(deviceItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除相机参数
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('item:item:remove')")
|
||||
@Log(title = "相机参数", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(deviceItemService.deleteDeviceItemByIds(ids));
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package net.hzvtc.device.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.device.domain.DevicePerson;
|
||||
import net.hzvtc.device.service.DevicePersonService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/device/person")
|
||||
public class DevicePersonController extends BaseController {
|
||||
@Autowired
|
||||
private DevicePersonService devicePersonService;
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult addDevicePerson(@RequestBody DevicePerson data) {
|
||||
return AjaxResult.success(devicePersonService.addDevicePerson(data));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult updateDevicePerson(@RequestBody DevicePerson data) {
|
||||
return AjaxResult.success(devicePersonService.updateDevicePerson(data));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteDevicePerson(@PathVariable Long id) {
|
||||
return AjaxResult.success(devicePersonService.deleteDevicePersonById(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package net.hzvtc.device.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.hzvtc.common.annotation.Log;
|
||||
import net.hzvtc.common.core.controller.BaseController;
|
||||
import net.hzvtc.common.core.domain.AjaxResult;
|
||||
import net.hzvtc.common.core.page.TableDataInfo;
|
||||
import net.hzvtc.common.enums.BusinessType;
|
||||
import net.hzvtc.common.utils.poi.ExcelUtil;
|
||||
import net.hzvtc.device.domain.HeatmapInfo;
|
||||
import net.hzvtc.device.service.HeatmapInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 热力图配置Controller
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-11-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/heatmap/heatmapInfo")
|
||||
public class HeatmapInfoController extends BaseController {
|
||||
@Autowired
|
||||
private HeatmapInfoService heatmapInfoService;
|
||||
|
||||
/**
|
||||
* 查询热力图配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('heatmap:heatmapInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HeatmapInfo heatmapInfo) {
|
||||
startPage();
|
||||
List<HeatmapInfo> list = heatmapInfoService.selectHeatmapInfoList(heatmapInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出热力图配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('heatmap:heatmapInfo:export')")
|
||||
@Log(title = "热力图配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HeatmapInfo heatmapInfo) {
|
||||
List<HeatmapInfo> list = heatmapInfoService.selectHeatmapInfoList(heatmapInfo);
|
||||
ExcelUtil<HeatmapInfo> util = new ExcelUtil<HeatmapInfo>(HeatmapInfo.class);
|
||||
util.exportExcel(response, list, "热力图配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热力图配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('heatmap:heatmapInfo:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(heatmapInfoService.selectHeatmapInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增热力图配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('heatmap:heatmapInfo:add')")
|
||||
@Log(title = "热力图配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HeatmapInfo heatmapInfo) {
|
||||
return toAjax(heatmapInfoService.insertHeatmapInfo(heatmapInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改热力图配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('heatmap:heatmapInfo:edit')")
|
||||
@Log(title = "热力图配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HeatmapInfo heatmapInfo) {
|
||||
return toAjax(heatmapInfoService.updateHeatmapInfo(heatmapInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除热力图配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('heatmap:heatmapInfo:remove')")
|
||||
@Log(title = "热力图配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(heatmapInfoService.deleteHeatmapInfoByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/heatmapListByParam")
|
||||
public AjaxResult getBirdHeatmapList(@RequestBody JSONObject obj) {
|
||||
return AjaxResult.success(heatmapInfoService.getBirdHeatmapListByParam(obj));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package net.hzvtc.device.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import net.hzvtc.data.check.domain.ResultMedia;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备对象 device_info
|
||||
*
|
||||
* @author admin
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
@Data
|
||||
@Alias("DeviceInfo")
|
||||
public class DeviceInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备名
|
||||
*/
|
||||
@Excel(name = "设备名")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
@Excel(name = "设备PID")
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@Excel(name = "设备DUID")
|
||||
private String duid;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Excel(name = "经度")
|
||||
private double longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Excel(name = "纬度")
|
||||
private double latitude;
|
||||
|
||||
/**
|
||||
* 网格划分信息
|
||||
*/
|
||||
private double evalator;
|
||||
|
||||
/**
|
||||
* 状态:0-异常,1-正常
|
||||
*/
|
||||
@Excel(name = "状态:0-异常,1-正常")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 设备ip
|
||||
*/
|
||||
@Excel(name = "设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
private double rate;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@Excel(name = "设备类型", readConverterExp = "1=单机,2=网络")
|
||||
private Integer deviceType;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
private String deptName;
|
||||
|
||||
private String deptFullName;
|
||||
|
||||
//监测记录数
|
||||
private long recordCount;
|
||||
|
||||
private ResultMedia resultMedia;
|
||||
|
||||
private List<DevicePerson> manager;
|
||||
|
||||
private int mainAnimal = 0;
|
||||
|
||||
private Integer habitatType;
|
||||
|
||||
private String habitatTypeName;
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package net.hzvtc.device.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.hzvtc.common.annotation.Excel;
|
||||
import net.hzvtc.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
/**
|
||||
* 相机参数对象 device_item
|
||||
*
|
||||
* @author admin
|
||||
* @date 2024-08-14
|
||||
*/
|
||||
@Data
|
||||
@Alias("DeviceItem")
|
||||
public class DeviceItem extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 拍摄模式
|
||||
*/
|
||||
@Excel(name = "拍摄模式")
|
||||
private String shotMode;
|
||||
|
||||
/**
|
||||
* 图片大小
|
||||
*/
|
||||
@Excel(name = "图片大小")
|
||||
private String imageSize;
|
||||
|
||||
/**
|
||||
* 连拍
|
||||
*/
|
||||
@Excel(name = "连拍")
|
||||
private Long burstShot;
|
||||
|
||||
/**
|
||||
* 视频大小
|
||||
*/
|
||||
@Excel(name = "视频大小")
|
||||
private String videoSize;
|
||||
|
||||
/**
|
||||
* 视频长度(秒)
|
||||
*/
|
||||
@Excel(name = "视频长度(秒)")
|
||||
private Long videoLength;
|
||||
|
||||
/**
|
||||
* 拍摄限制(次)
|
||||
*/
|
||||
@Excel(name = "拍摄限制(次)")
|
||||
private Long shotLimit;
|
||||
|
||||
/**
|
||||
* 时间服务器地址
|
||||
*/
|
||||
@Excel(name = "时间服务器地址")
|
||||
private String timerServer;
|
||||
|
||||
/**
|
||||
* 时间服务器端口
|
||||
*/
|
||||
@Excel(name = "时间服务器端口")
|
||||
private Long timerPort;
|
||||
|
||||
/**
|
||||
* 存储服务器地址
|
||||
*/
|
||||
@Excel(name = "存储服务器地址")
|
||||
private String storeServer;
|
||||
|
||||
/**
|
||||
* 存储服务器端口
|
||||
*/
|
||||
@Excel(name = "存储服务器端口")
|
||||
private Long storePort;
|
||||
|
||||
/**
|
||||
* 上级设备PID
|
||||
*/
|
||||
@Excel(name = "上级设备PID")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 上级设备IP地址
|
||||
*/
|
||||
@Excel(name = "上级设备IP地址")
|
||||
private String parentIp;
|
||||
|
||||
/**
|
||||
* 断链时长(秒)
|
||||
*/
|
||||
@Excel(name = "断链时长(秒)")
|
||||
private Long dislinkTime;
|
||||
|
||||
/**
|
||||
* 心跳间隔(秒)
|
||||
*/
|
||||
@Excel(name = "心跳间隔(秒)")
|
||||
private Long heartbeatTime;
|
||||
|
||||
/**
|
||||
* PIR开关
|
||||
*/
|
||||
@Excel(name = "PIR开关")
|
||||
private Long pirSwitcher;
|
||||
|
||||
/**
|
||||
* PIR灵敏度
|
||||
*/
|
||||
@Excel(name = "PIR灵敏度")
|
||||
private String pirSensitivity;
|
||||
|
||||
/**
|
||||
* 触发时间间隔
|
||||
*/
|
||||
@Excel(name = "触发时间间隔")
|
||||
private String pirInterval;
|
||||
|
||||
/**
|
||||
* 定时拍摄
|
||||
*/
|
||||
@Excel(name = "定时拍摄")
|
||||
private Long shotTimer;
|
||||
|
||||
/**
|
||||
* 循环拍摄间隔
|
||||
*/
|
||||
@Excel(name = "循环拍摄间隔")
|
||||
private String shotInterval;
|
||||
|
||||
/**
|
||||
* 时间段1(时:分)
|
||||
*/
|
||||
@Excel(name = "时间段1(时:分)")
|
||||
private String shotTimer1From;
|
||||
|
||||
/**
|
||||
* 时间段1(时:分)
|
||||
*/
|
||||
@Excel(name = "时间段1(时:分)")
|
||||
private String shotTimer1To;
|
||||
|
||||
/**
|
||||
* 时间段2(时:分)
|
||||
*/
|
||||
@Excel(name = "时间段2(时:分)")
|
||||
private String shotTimer2From;
|
||||
|
||||
/**
|
||||
* 时间段2(时:分)
|
||||
*/
|
||||
@Excel(name = "时间段2(时:分)")
|
||||
private String shotTimer2To;
|
||||
|
||||
/**
|
||||
* 时间段3(时:分)
|
||||
*/
|
||||
@Excel(name = "时间段3(时:分)")
|
||||
private String shotTimer3From;
|
||||
|
||||
/**
|
||||
* 时间段3(时:分)
|
||||
*/
|
||||
@Excel(name = "时间段3(时:分)")
|
||||
private String shotTimer3To;
|
||||
|
||||
/**
|
||||
* 周重复
|
||||
*/
|
||||
@Excel(name = "周重复")
|
||||
private String shotTimerRepeater;
|
||||
|
||||
/**
|
||||
* 信息戳记
|
||||
*/
|
||||
@Excel(name = "信息戳记")
|
||||
private Long snapshot;
|
||||
|
||||
/**
|
||||
* 自动覆盖
|
||||
*/
|
||||
@Excel(name = "自动覆盖")
|
||||
private Long overwriter;
|
||||
|
||||
/**
|
||||
* 小生境
|
||||
*/
|
||||
@Excel(name = "小生境")
|
||||
private String habitat;
|
||||
|
||||
/**
|
||||
* 坡向
|
||||
*/
|
||||
@Excel(name = "坡向")
|
||||
private String aspect;
|
||||
|
||||
/**
|
||||
* 坡位
|
||||
*/
|
||||
@Excel(name = "坡位")
|
||||
private String slopePostion;
|
||||
|
||||
/**
|
||||
* 坡度
|
||||
*/
|
||||
@Excel(name = "坡度")
|
||||
private String gradient;
|
||||
|
||||
/**
|
||||
* 栖息地类型
|
||||
*/
|
||||
@Excel(name = "栖息地类型")
|
||||
private String habitatType;
|
||||
|
||||
/**
|
||||
* 干扰类型
|
||||
*/
|
||||
@Excel(name = "干扰类型")
|
||||
private String interfereType;
|
||||
|
||||
/**
|
||||
* 干扰强度
|
||||
*/
|
||||
@Excel(name = "干扰强度")
|
||||
private String interfereLevel;
|
||||
|
||||
/**
|
||||
* 在线状态
|
||||
*/
|
||||
@Excel(name = "在线状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@Excel(name = "设备ID")
|
||||
private Long pid;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("shot mode", getShotMode())
|
||||
.append("imageSize", getImageSize())
|
||||
.append("burstShot", getBurstShot())
|
||||
.append("videoSize", getVideoSize())
|
||||
.append("videoLength", getVideoLength())
|
||||
.append("shotLimit", getShotLimit())
|
||||
.append("timerServer", getTimerServer())
|
||||
.append("timerPort", getTimerPort())
|
||||
.append("storeServer", getStoreServer())
|
||||
.append("storePort", getStorePort())
|
||||
.append("parentId", getParentId())
|
||||
.append("parentIp", getParentIp())
|
||||
.append("dislinkTime", getDislinkTime())
|
||||
.append("heartbeatTime", getHeartbeatTime())
|
||||
.append("pirSwitcher", getPirSwitcher())
|
||||
.append("pirSensitivity", getPirSensitivity())
|
||||
.append("pirInterval", getPirInterval())
|
||||
.append("shotTimer", getShotTimer())
|
||||
.append("shotInterval", getShotInterval())
|
||||
.append("shotTimer1From", getShotTimer1From())
|
||||
.append("shotTimer1To", getShotTimer1To())
|
||||
.append("shotTimer2From", getShotTimer2From())
|
||||
.append("shotTimer2To", getShotTimer2To())
|
||||
.append("shotTimer3From", getShotTimer3From())
|
||||
.append("shotTimer3To", getShotTimer3To())
|
||||
.append("shotTimerRepeater", getShotTimerRepeater())
|
||||
.append("snapshot", getSnapshot())
|
||||
.append("overwriter", getOverwriter())
|
||||
.append("habitat", getHabitat())
|
||||
.append("aspect", getAspect())
|
||||
.append("slopePostion", getSlopePostion())
|
||||
.append("gradient", getGradient())
|
||||
.append("habitatType", getHabitatType())
|
||||
.append("interfereType", getInterfereType())
|
||||
.append("interfereLevel", getInterfereLevel())
|
||||
.append("status", getStatus())
|
||||
.append("pid", getPid())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
Loaded 100 of 381 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user