增加区域管理
This commit is contained in:
parent
3bc55c6151
commit
5b8d1d0091
@ -211,29 +211,29 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeUpdate(Executor executor, MappedStatement ms, Object parameter) throws SQLException {
|
public void beforeUpdate(Executor executor, MappedStatement ms, Object parameter) throws SQLException {
|
||||||
try {
|
// try {
|
||||||
if (Objects.equals(ThreadLocalUtil.getByKey(Cts.TL_IS_FROM_WEB, Boolean.class), true)) {
|
// if (Objects.equals(ThreadLocalUtil.getByKey(Cts.TL_IS_FROM_WEB, Boolean.class), true)) {
|
||||||
SqlCommandType sct = ms.getSqlCommandType();
|
// SqlCommandType sct = ms.getSqlCommandType();
|
||||||
if (sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) {
|
// if (sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) {
|
||||||
String sql = this.getShowSql(ms.getConfiguration(), ms.getBoundSql(parameter));
|
// String sql = this.getShowSql(ms.getConfiguration(), ms.getBoundSql(parameter));
|
||||||
String whereSql = StrUtil.subAfter(sql, "WHERE", true);
|
// String whereSql = StrUtil.subAfter(sql, "WHERE", true);
|
||||||
saveQueryResult(StrUtil.sub(ms.getId(), 0, StringUtils.lastIndexOf(ms.getId(), ".")), whereSql);
|
// saveQueryResult(StrUtil.sub(ms.getId(), 0, StringUtils.lastIndexOf(ms.getId(), ".")), whereSql);
|
||||||
} else if (sct == SqlCommandType.INSERT) {
|
// } else if (sct == SqlCommandType.INSERT) {
|
||||||
List<OperLogInsertChange> paramList = ThreadLocalUtil.getByKey(Cts.TL_INSERT_BEFORE_PARAM, List.class);
|
// List<OperLogInsertChange> paramList = ThreadLocalUtil.getByKey(Cts.TL_INSERT_BEFORE_PARAM, List.class);
|
||||||
if (paramList == null) {
|
// if (paramList == null) {
|
||||||
paramList = new ArrayList<>();
|
// paramList = new ArrayList<>();
|
||||||
ThreadLocalUtil.addInKey(Cts.TL_INSERT_BEFORE_PARAM, paramList);
|
// ThreadLocalUtil.addInKey(Cts.TL_INSERT_BEFORE_PARAM, paramList);
|
||||||
}
|
// }
|
||||||
OperLogInsertChange operLogInsertChange = new OperLogInsertChange();
|
// OperLogInsertChange operLogInsertChange = new OperLogInsertChange();
|
||||||
operLogInsertChange.setMapperName(StrUtil.sub(ms.getId(), 0, StringUtils.lastIndexOf(ms.getId(), ".")));
|
// operLogInsertChange.setMapperName(StrUtil.sub(ms.getId(), 0, StringUtils.lastIndexOf(ms.getId(), ".")));
|
||||||
operLogInsertChange.setResult(new ArrayList<>(Arrays.asList(parameter)));
|
// operLogInsertChange.setResult(new ArrayList<>(Arrays.asList(parameter)));
|
||||||
operLogInsertChange.setTimestamp(System.currentTimeMillis());
|
// operLogInsertChange.setTimestamp(System.currentTimeMillis());
|
||||||
paramList.add(operLogInsertChange);
|
// paramList.add(operLogInsertChange);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
log.error("前后数据变化错误", e);
|
// log.error("前后数据变化错误", e);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveQueryResult(String mapperName, String whereSql) throws ClassNotFoundException {
|
private void saveQueryResult(String mapperName, String whereSql) throws ClassNotFoundException {
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package com.zhgd.xmgl.modules.mulei.controller;
|
package com.zhgd.xmgl.modules.mulei.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zhgd.annotation.OperLog;
|
import com.zhgd.annotation.OperLog;
|
||||||
@ -99,10 +102,23 @@ public class MlHoistController {
|
|||||||
Long videoItemId = FlowUtil.getPullDownLong(map, "videoItemId");
|
Long videoItemId = FlowUtil.getPullDownLong(map, "videoItemId");
|
||||||
String num = FlowUtil.getString(map, "num");
|
String num = FlowUtil.getString(map, "num");
|
||||||
String projectSn = FlowUtil.getString(map, "projectSn");
|
String projectSn = FlowUtil.getString(map, "projectSn");
|
||||||
|
String code = FlowUtil.getString(map, "code");
|
||||||
|
String unit = FlowUtil.getString(map, "unit");
|
||||||
|
String teamName = FlowUtil.getString(map, "teamName");
|
||||||
|
String commander = FlowUtil.getString(map, "commander");
|
||||||
|
JSONArray planTime = JSONArray.parseArray(FlowUtil.getString(map, "planTime"));
|
||||||
MlHoist hoist = new MlHoist();
|
MlHoist hoist = new MlHoist();
|
||||||
hoist.setVideoItemId(videoItemId);
|
hoist.setVideoItemId(videoItemId);
|
||||||
hoist.setNum(num);
|
hoist.setNum(num);
|
||||||
hoist.setProjectSn(projectSn);
|
hoist.setProjectSn(projectSn);
|
||||||
|
hoist.setCode(code);
|
||||||
|
hoist.setUnit(unit);
|
||||||
|
hoist.setTeamName(teamName);
|
||||||
|
hoist.setCommander(commander);
|
||||||
|
if (planTime != null && planTime.size() > 0) {
|
||||||
|
hoist.setStartTime(DateUtil.parseDateTime(planTime.getString(0)));
|
||||||
|
hoist.setEndTime(DateUtil.parseDateTime(planTime.getString(1)));
|
||||||
|
}
|
||||||
mlHoistService.add(hoist);
|
mlHoistService.add(hoist);
|
||||||
VideoItem item = new VideoItem();
|
VideoItem item = new VideoItem();
|
||||||
item.setItemId(videoItemId);
|
item.setItemId(videoItemId);
|
||||||
|
|||||||
@ -34,6 +34,9 @@ public class MlHoist implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "视频设备列表id")
|
@ApiModelProperty(value = "视频设备列表id")
|
||||||
private java.lang.Long videoItemId;
|
private java.lang.Long videoItemId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "视频设备序列号")
|
||||||
|
private java.lang.String serialNumber;
|
||||||
/**
|
/**
|
||||||
* 编号
|
* 编号
|
||||||
*/
|
*/
|
||||||
@ -56,4 +59,45 @@ public class MlHoist implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
private java.util.Date updateDate;
|
private java.util.Date updateDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "编号")
|
||||||
|
private java.lang.String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工单位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "施工单位")
|
||||||
|
private java.lang.String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 吊装班组
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "吊装班组")
|
||||||
|
private java.lang.String teamName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作负责人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工作负责人")
|
||||||
|
private java.lang.String commander;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划工作开始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计划工作开始时间")
|
||||||
|
private java.util.Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划工作结束时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计划工作结束时间")
|
||||||
|
private java.util.Date endTime;
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件路径")
|
||||||
|
private java.lang.String fileUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,7 @@ public class MlHoistServiceImpl extends ServiceImpl<MlHoistMapper, MlHoist> impl
|
|||||||
@Override
|
@Override
|
||||||
public void add(MlHoist mlHoist) {
|
public void add(MlHoist mlHoist) {
|
||||||
mlHoist.setId(null);
|
mlHoist.setId(null);
|
||||||
|
mlHoist.setNum(mlHoist.getCode());
|
||||||
baseMapper.insert(mlHoist);
|
baseMapper.insert(mlHoist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -119,6 +119,11 @@ public class QualityRegionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperLog(operModul = "区域管理", operType = "查询", operDesc = "查询区域人数")
|
||||||
|
@ApiOperation(value = "查询区域人数", notes = "查询区域人数", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/queryRegionWorker")
|
||||||
|
public Result<Object> queryRegionWorker(QualityRegion qualityRegion) {
|
||||||
|
return Result.success(qualityRegionService.queryRegionWorker(qualityRegion));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,203 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.controller;
|
||||||
|
|
||||||
|
import com.zhgd.annotation.OperLog;
|
||||||
|
import com.zhgd.xmgl.util.PageUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionConfig;
|
||||||
|
import com.zhgd.xmgl.modules.quality.service.IRegionConfigService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title: Controller
|
||||||
|
* @Description: 项目区域配置
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/xmgl/regionConfig")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "项目区域配置管理")
|
||||||
|
public class RegionConfigController {
|
||||||
|
@Autowired
|
||||||
|
private IRegionConfigService regionConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "分页查询", operDesc = "分页列表查询项目区域配置信息")
|
||||||
|
@ApiOperation(value = " 分页列表查询项目区域配置信息", notes = "分页列表查询项目区域配置信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/page")
|
||||||
|
public Result<IPage<RegionConfig>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||||
|
QueryWrapper<RegionConfig> queryWrapper = QueryGenerator.initPageQueryWrapper(RegionConfig.class, map);
|
||||||
|
Page<RegionConfig> page = PageUtil.getPage(map);
|
||||||
|
IPage<RegionConfig> pageList = regionConfigService.page(page, queryWrapper);
|
||||||
|
return Result.success(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @param regionConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "列表查询", operDesc = "列表查询项目区域配置信息")
|
||||||
|
@ApiOperation(value = " 列表查询项目区域配置信息", notes = "列表查询项目区域配置信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/list")
|
||||||
|
public Result<List<RegionConfig>> queryList(@RequestBody RegionConfig regionConfig) {
|
||||||
|
QueryWrapper<RegionConfig> queryWrapper = QueryGenerator.initQueryWrapper(regionConfig);
|
||||||
|
List<RegionConfig> list = regionConfigService.list(queryWrapper);
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param regionConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "新增", operDesc = "添加项目区域配置信息")
|
||||||
|
@ApiOperation(value = " 添加项目区域配置信息", notes = "添加项目区域配置信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<Object> add(@RequestBody RegionConfig regionConfig) {
|
||||||
|
Result<RegionConfig> result = new Result<RegionConfig>();
|
||||||
|
regionConfigService.save(regionConfig);
|
||||||
|
return Result.success("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param regionConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "修改", operDesc = "编辑项目区域配置信息")
|
||||||
|
@ApiOperation(value = "编辑项目区域配置信息", notes = "编辑项目区域配置信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<RegionConfig> edit(@RequestBody RegionConfig regionConfig) {
|
||||||
|
Result<RegionConfig> result = new Result<RegionConfig>();
|
||||||
|
RegionConfig regionConfigEntity = regionConfigService.getById(regionConfig.getId());
|
||||||
|
if (regionConfigEntity == null) {
|
||||||
|
result.error500("未找到对应实体");
|
||||||
|
} else {
|
||||||
|
boolean ok = regionConfigService.updateById(regionConfig);
|
||||||
|
if (ok) {
|
||||||
|
result.success("修改成功!");
|
||||||
|
} else {
|
||||||
|
result.success("操作失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "删除", operDesc = "删除项目区域配置信息")
|
||||||
|
@ApiOperation(value = "删除项目区域配置信息", notes = "删除项目区域配置信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "项目区域配置ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
|
@PostMapping(value = "/delete")
|
||||||
|
public Result<RegionConfig> delete(@RequestBody RegionConfig regionConfig) {
|
||||||
|
Result<RegionConfig> result = new Result<RegionConfig>();
|
||||||
|
RegionConfig regionConfigEntity = regionConfigService.getById(regionConfig.getId());
|
||||||
|
if (regionConfigEntity == null) {
|
||||||
|
result.error500("未找到对应实体");
|
||||||
|
} else {
|
||||||
|
boolean ok = regionConfigService.removeById(regionConfig.getId());
|
||||||
|
if (ok) {
|
||||||
|
result.success("删除成功!");
|
||||||
|
} else {
|
||||||
|
result.success("操作失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "批量删除", operDesc = "批量删除项目区域配置信息")
|
||||||
|
@ApiOperation(value = "批量删除项目区域配置信息", notes = "批量删除项目区域配置信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "项目区域配置ID字符串", paramType = "body", required = true, dataType = "String")
|
||||||
|
@PostMapping(value = "/deleteBatch")
|
||||||
|
public Result<RegionConfig> deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||||
|
Result<RegionConfig> result = new Result<RegionConfig>();
|
||||||
|
String ids = MapUtils.getString(map, "ids");
|
||||||
|
if (ids == null || "".equals(ids.trim())) {
|
||||||
|
result.error500("参数不识别!");
|
||||||
|
} else {
|
||||||
|
this.regionConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
result.success("删除成功!");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@OperLog(operModul = "项目区域配置管理", operType = "查询", operDesc = "通过id查询项目区域配置信息")
|
||||||
|
@ApiOperation(value = "通过id查询项目区域配置信息", notes = "通过id查询项目区域配置信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "项目区域配置ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
|
@PostMapping(value = "/queryById")
|
||||||
|
public Result<RegionConfig> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||||
|
Result<RegionConfig> result = new Result<RegionConfig>();
|
||||||
|
RegionConfig regionConfig = regionConfigService.getById(MapUtils.getString(map, "id"));
|
||||||
|
if (regionConfig == null) {
|
||||||
|
result.error500("未找到对应实体");
|
||||||
|
} else {
|
||||||
|
result.setResult(regionConfig);
|
||||||
|
result.setSuccess(true);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -90,6 +90,12 @@ public class QualityRegion implements Serializable {
|
|||||||
private java.lang.String ancestors;
|
private java.lang.String ancestors;
|
||||||
@ApiModelProperty(value = "区域的项目子账号id")
|
@ApiModelProperty(value = "区域的项目子账号id")
|
||||||
private java.lang.Long belongUserId;
|
private java.lang.Long belongUserId;
|
||||||
|
@ApiModelProperty(value = "区域配置信息")
|
||||||
|
private java.lang.String regionValue;
|
||||||
|
@ApiModelProperty(value = "区域范围信息")
|
||||||
|
private String fenceShape;
|
||||||
|
@ApiModelProperty(value = "绑定的视频监控")
|
||||||
|
private java.lang.String areaVideoData;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<QualityRegion> children;
|
private List<QualityRegion> children;
|
||||||
@ -114,4 +120,8 @@ public class QualityRegion implements Serializable {
|
|||||||
@ApiModelProperty(value = "AI分析硬件设备名称(逗号分割)")
|
@ApiModelProperty(value = "AI分析硬件设备名称(逗号分割)")
|
||||||
private java.lang.String aiAnalyseHardName;
|
private java.lang.String aiAnalyseHardName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "区域设备")
|
||||||
|
private List<RegionDev> regionDevList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,52 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 项目区域配置
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("region_config")
|
||||||
|
@ApiModel(value = "RegionConfig实体类", description = "RegionConfig")
|
||||||
|
public class RegionConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "区域ID")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 区域名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "区域名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "区域名称")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 项目sn
|
||||||
|
*/
|
||||||
|
@Excel(name = "项目sn", width = 15)
|
||||||
|
@ApiModelProperty(value = "项目sn")
|
||||||
|
private String projectSn;
|
||||||
|
/**
|
||||||
|
* 配置信息
|
||||||
|
*/
|
||||||
|
@Excel(name = "配置信息", width = 15)
|
||||||
|
@ApiModelProperty(value = "配置信息")
|
||||||
|
private String configValue;
|
||||||
|
}
|
||||||
@ -0,0 +1,189 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 区域设备
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("region_dev")
|
||||||
|
@ApiModel(value = "RegionDev实体类", description = "RegionDev")
|
||||||
|
public class RegionDev implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gltf模型ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "gltf模型ID")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 设备编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "设备编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "设备编号")
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* glTF模型的URI
|
||||||
|
*/
|
||||||
|
@Excel(name = "glTF模型的URI", width = 15)
|
||||||
|
@ApiModelProperty(value = "glTF模型的URI")
|
||||||
|
private String url;
|
||||||
|
/**
|
||||||
|
* 比例,默认1.0
|
||||||
|
*/
|
||||||
|
@Excel(name = "比例,默认1.0", width = 15)
|
||||||
|
@ApiModelProperty(value = "比例,默认1.0")
|
||||||
|
private java.math.BigDecimal scale;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Excel(name = "经度", width = 15)
|
||||||
|
@ApiModelProperty(value = "经度")
|
||||||
|
private String lng;
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Excel(name = "纬度", width = 15)
|
||||||
|
@ApiModelProperty(value = "纬度")
|
||||||
|
private String lat;
|
||||||
|
/**
|
||||||
|
* 高度(单位:米)
|
||||||
|
*/
|
||||||
|
@Excel(name = "高度(单位:米)", width = 15)
|
||||||
|
@ApiModelProperty(value = "高度(单位:米)")
|
||||||
|
private String alt;
|
||||||
|
/**
|
||||||
|
* 颜色
|
||||||
|
*/
|
||||||
|
@Excel(name = "颜色", width = 15)
|
||||||
|
@ApiModelProperty(value = "颜色")
|
||||||
|
private String color;
|
||||||
|
/**
|
||||||
|
* 最小像素大小
|
||||||
|
*/
|
||||||
|
@Excel(name = "最小像素大小", width = 15)
|
||||||
|
@ApiModelProperty(value = "最小像素大小")
|
||||||
|
private java.math.BigDecimal minimumPixelSize;
|
||||||
|
/**
|
||||||
|
* 旋转方向, true逆时针,false顺时针
|
||||||
|
*/
|
||||||
|
@Excel(name = "旋转方向, true逆时针,false顺时针", width = 15)
|
||||||
|
@ApiModelProperty(value = "旋转方向, true逆时针,false顺时针")
|
||||||
|
private Integer direction;
|
||||||
|
/**
|
||||||
|
* 飞行一周所需时间(单位 秒),控制速度
|
||||||
|
*/
|
||||||
|
@Excel(name = "飞行一周所需时间(单位 秒),控制速度", width = 15)
|
||||||
|
@ApiModelProperty(value = "飞行一周所需时间(单位 秒),控制速度")
|
||||||
|
private Integer time;
|
||||||
|
/**
|
||||||
|
* 方向角
|
||||||
|
*/
|
||||||
|
@Excel(name = "方向角", width = 15)
|
||||||
|
@ApiModelProperty(value = "方向角")
|
||||||
|
private Float heading;
|
||||||
|
/**
|
||||||
|
* 俯仰角
|
||||||
|
*/
|
||||||
|
@Excel(name = "俯仰角", width = 15)
|
||||||
|
@ApiModelProperty(value = "俯仰角")
|
||||||
|
private Float pitch;
|
||||||
|
/**
|
||||||
|
* 翻滚角
|
||||||
|
*/
|
||||||
|
@Excel(name = "翻滚角", width = 15)
|
||||||
|
@ApiModelProperty(value = "翻滚角")
|
||||||
|
private Float roll;
|
||||||
|
/**
|
||||||
|
* 是否轮廓
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否轮廓", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否轮廓")
|
||||||
|
private Integer silhouette;
|
||||||
|
/**
|
||||||
|
* 轮廓颜色
|
||||||
|
*/
|
||||||
|
@Excel(name = "轮廓颜色", width = 15)
|
||||||
|
@ApiModelProperty(value = "轮廓颜色")
|
||||||
|
private String silhouetteColor;
|
||||||
|
/**
|
||||||
|
* 轮廓宽度
|
||||||
|
*/
|
||||||
|
@Excel(name = "轮廓宽度", width = 15)
|
||||||
|
@ApiModelProperty(value = "轮廓宽度")
|
||||||
|
private Float silhouetteSize;
|
||||||
|
/**
|
||||||
|
* 是否阴影
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否阴影", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否阴影")
|
||||||
|
private Integer hasShadows;
|
||||||
|
/**
|
||||||
|
* 是否贴地
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否贴地", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否贴地")
|
||||||
|
private Integer clampToGround;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
/**
|
||||||
|
* 是否显示
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否显示", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否显示")
|
||||||
|
private Integer isShow;
|
||||||
|
/**
|
||||||
|
* 项目SN
|
||||||
|
*/
|
||||||
|
@Excel(name = "项目SN", width = 15)
|
||||||
|
@ApiModelProperty(value = "项目SN")
|
||||||
|
private String projectSn;
|
||||||
|
/**
|
||||||
|
* 设备类型(1:风机;2:光伏; 3:储能)
|
||||||
|
*/
|
||||||
|
@Excel(name = "设备类型(1:风机;2:光伏; 3:储能)", width = 15)
|
||||||
|
@ApiModelProperty(value = "设备类型(1:风机;2:光伏; 3:储能)")
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 区域ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "区域ID", width = 15)
|
||||||
|
@ApiModelProperty(value = "区域ID")
|
||||||
|
private Long qualityRegionId;
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionConfig;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 项目区域配置
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RegionConfigMapper extends BaseMapper<RegionConfig> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionDev;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 区域设备
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RegionDevMapper extends BaseMapper<RegionDev> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -320,6 +320,12 @@
|
|||||||
<if test="param.verifyManId != null and param.verifyManId != ''">
|
<if test="param.verifyManId != null and param.verifyManId != ''">
|
||||||
and a.verify_man_id = #{param.verifyManId}
|
and a.verify_man_id = #{param.verifyManId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.verifyManName != null and param.verifyManName != ''">
|
||||||
|
and f.real_name like concat('%', #{param.verifyManName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.changeName != null and param.changeName != ''">
|
||||||
|
and d.real_name like concat('%', #{param.changeName}, '%')
|
||||||
|
</if>
|
||||||
<if test="param.creatorId != null and param.creatorId != ''">
|
<if test="param.creatorId != null and param.creatorId != ''">
|
||||||
and a.creator_id = #{param.creatorId}
|
and a.creator_id = #{param.creatorId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -64,4 +64,6 @@ public interface IQualityRegionService extends IService<QualityRegion> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
QualityRegion queryBindRegion();
|
QualityRegion queryBindRegion();
|
||||||
|
|
||||||
|
int queryRegionWorker(QualityRegion qualityRegion);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.service;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionConfig;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 项目区域配置
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IRegionConfigService extends IService<RegionConfig> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.service;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionDev;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 区域设备
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IRegionDevService extends IService<RegionDev> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -7,26 +7,28 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
|
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
import com.zhgd.xmgl.modules.quality.entity.*;
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegionToAiAnalyseHard;
|
import com.zhgd.xmgl.modules.quality.mapper.*;
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegionToEnterprise;
|
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegionToUser;
|
|
||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
|
|
||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionToAiAnalyseHardMapper;
|
|
||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionToEnterpriseMapper;
|
|
||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionToUserMapper;
|
|
||||||
import com.zhgd.xmgl.modules.quality.service.IQualityRegionService;
|
import com.zhgd.xmgl.modules.quality.service.IQualityRegionService;
|
||||||
|
import com.zhgd.xmgl.modules.quality.service.IRegionDevService;
|
||||||
|
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData;
|
||||||
|
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatFence;
|
||||||
|
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDataMapper;
|
||||||
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareRecord;
|
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareRecord;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
|
import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
|
||||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||||
import com.zhgd.xmgl.util.ListUtils;
|
import com.zhgd.xmgl.util.ListUtils;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
|
import com.zhgd.xmgl.util.RegionUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -55,11 +57,20 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
|||||||
@Autowired
|
@Autowired
|
||||||
private QualityRegionMapper qualityRegionMapper;
|
private QualityRegionMapper qualityRegionMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IRegionDevService regionDevService;
|
||||||
|
@Autowired
|
||||||
private EnterpriseInfoServiceImpl enterpriseInfoService;
|
private EnterpriseInfoServiceImpl enterpriseInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SafetyHatDataMapper safetyHatDataMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QualityRegion> selectQualityRegionList(Map<String, Object> map) {
|
public List<QualityRegion> selectQualityRegionList(Map<String, Object> map) {
|
||||||
List<QualityRegion> list = qualityRegionMapper.selectQualityRegionList(map);
|
List<QualityRegion> list = qualityRegionMapper.selectQualityRegionList(map);
|
||||||
|
List<RegionDev> regiionDevList = regionDevService.list(Wrappers.<RegionDev>lambdaQuery().eq(RegionDev::getProjectSn, MapUtils.getString(map, "projectSn")));
|
||||||
|
list.forEach(l -> {
|
||||||
|
l.setRegionDevList(regiionDevList.stream().filter(r -> r.getQualityRegionId().toString().equals(l.getId().toString())).collect(Collectors.toList()));
|
||||||
|
});
|
||||||
list = postList(list);
|
list = postList(list);
|
||||||
return BeanUtil.copyToList(ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(list)), "id", "parentRegion", "children"), QualityRegion.class);
|
return BeanUtil.copyToList(ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(list)), "id", "parentRegion", "children"), QualityRegion.class);
|
||||||
}
|
}
|
||||||
@ -223,6 +234,13 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
|||||||
toAiAnalyseHardMapper.insert(entity);
|
toAiAnalyseHardMapper.insert(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
regionDevService.remove(Wrappers.<RegionDev>lambdaQuery().eq(RegionDev::getQualityRegionId, qualityRegion.getId()));
|
||||||
|
List<RegionDev> regionDevList = qualityRegion.getRegionDevList();
|
||||||
|
for (RegionDev regionDev : regionDevList) {
|
||||||
|
regionDev.setQualityRegionId(qualityRegion.getId());
|
||||||
|
regionDev.setProjectSn(qualityRegion.getProjectSn());
|
||||||
|
}
|
||||||
|
regionDevService.saveBatch(regionDevList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -282,6 +300,35 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
|||||||
return qualityRegions.size() == 0 ? null : qualityRegions.get(0);
|
return qualityRegions.size() == 0 ? null : qualityRegions.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int queryRegionWorker(QualityRegion qualityRegion) {
|
||||||
|
QualityRegion byId = this.getById(qualityRegion.getId());
|
||||||
|
List<SafetyHatData> dataList = safetyHatDataMapper.getNewestDataGroupByProjectSn(byId.getProjectSn());
|
||||||
|
int workerNum = 0;
|
||||||
|
if (CollUtil.isNotEmpty(dataList)) {
|
||||||
|
for (SafetyHatData d : dataList) {
|
||||||
|
boolean inFence = false;
|
||||||
|
String fenceShape = byId.getFenceShape();
|
||||||
|
if (StrUtil.isNotBlank(fenceShape)) {
|
||||||
|
String[] couples = StringUtils.split(fenceShape, ",");
|
||||||
|
Double[] lon = new Double[couples.length];
|
||||||
|
Double[] lat = new Double[couples.length];
|
||||||
|
for (int i = 0; i < couples.length; i++) {
|
||||||
|
String couple = couples[i];
|
||||||
|
String[] two = StringUtils.split(couple, "|");
|
||||||
|
lon[i] = Double.valueOf(two[0]);
|
||||||
|
lat[i] = Double.valueOf(two[1]);
|
||||||
|
}
|
||||||
|
inFence = RegionUtil.isInPolygon(d.getLongitude(), d.getLatitude(), lon, lat);
|
||||||
|
}
|
||||||
|
if (inFence) {
|
||||||
|
workerNum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return workerNum;
|
||||||
|
}
|
||||||
|
|
||||||
private void deleteRegion(Long id) {
|
private void deleteRegion(Long id) {
|
||||||
QueryWrapper<QualityRegion> queryWrapper = new QueryWrapper();
|
QueryWrapper<QualityRegion> queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.lambda().eq(QualityRegion::getParentRegion, id);
|
queryWrapper.lambda().eq(QualityRegion::getParentRegion, id);
|
||||||
@ -296,5 +343,6 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
|||||||
.eq(QualityRegionToEnterprise::getQualityRegionId, id));
|
.eq(QualityRegionToEnterprise::getQualityRegionId, id));
|
||||||
qualityRegionToUserMapper.delete(new LambdaQueryWrapper<QualityRegionToUser>()
|
qualityRegionToUserMapper.delete(new LambdaQueryWrapper<QualityRegionToUser>()
|
||||||
.eq(QualityRegionToUser::getQualityRegionId, id));
|
.eq(QualityRegionToUser::getQualityRegionId, id));
|
||||||
|
regionDevService.remove(Wrappers.<RegionDev>lambdaQuery().eq(RegionDev::getQualityRegionId, id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.service.impl;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionConfig;
|
||||||
|
import com.zhgd.xmgl.modules.quality.mapper.RegionConfigMapper;
|
||||||
|
import com.zhgd.xmgl.modules.quality.service.IRegionConfigService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 项目区域配置
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RegionConfigServiceImpl extends ServiceImpl<RegionConfigMapper, RegionConfig> implements IRegionConfigService {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.quality.service.impl;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.quality.entity.RegionDev;
|
||||||
|
import com.zhgd.xmgl.modules.quality.mapper.RegionDevMapper;
|
||||||
|
import com.zhgd.xmgl.modules.quality.service.IRegionDevService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 区域设备
|
||||||
|
* @author: pengj
|
||||||
|
* @date: 2024-09-25
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RegionDevServiceImpl extends ServiceImpl<RegionDevMapper, RegionDev> implements IRegionDevService {
|
||||||
|
|
||||||
|
}
|
||||||
@ -29,4 +29,6 @@ public interface ISafetyHatFenceService extends IService<SafetyHatFence> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SafetyHatFence> queryList(HashMap<String, Object> paramMap);
|
List<SafetyHatFence> queryList(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
String getWorkerInFence(String qualityRegionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
@ -21,10 +22,8 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
import java.util.stream.Collectors;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 智能安全帽-围栏
|
* @Description: 智能安全帽-围栏
|
||||||
@ -52,6 +51,23 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl<SafetyHatFenceMapper,
|
|||||||
return dealList(baseMapper.queryList(queryWrapper), paramMap);
|
return dealList(baseMapper.queryList(queryWrapper), paramMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getWorkerInFence(String qualityRegionId) {
|
||||||
|
StringBuilder workerIds = new StringBuilder();
|
||||||
|
List<SafetyHatFence> safetyHatFenceList = this.list(Wrappers.<SafetyHatFence>lambdaQuery().eq(SafetyHatFence::getQualityRegionId, qualityRegionId));
|
||||||
|
if (safetyHatFenceList.size() > 0) {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("projectSn", safetyHatFenceList.get(0).getProjectSn());
|
||||||
|
List<SafetyHatFence> safetyHatFenceList1 = dealList(safetyHatFenceList, map);
|
||||||
|
for (SafetyHatFence safetyHatFence : safetyHatFenceList1) {
|
||||||
|
List<WorkerInfo> workerListInFence = safetyHatFence.getWorkerListInFence();
|
||||||
|
workerIds.append(workerListInFence.stream().map(w -> w.getId().toString()).collect(Collectors.joining(",")));
|
||||||
|
workerIds.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return workerIds.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private QueryWrapper<SafetyHatFence> getQueryWrapper(HashMap<String, Object> paramMap) {
|
private QueryWrapper<SafetyHatFence> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||||
String alias = "t.";
|
String alias = "t.";
|
||||||
QueryWrapper<SafetyHatFence> queryWrapper = QueryGenerator.initPageQueryWrapper(SafetyHatFence.class, paramMap, alias);
|
QueryWrapper<SafetyHatFence> queryWrapper = QueryGenerator.initPageQueryWrapper(SafetyHatFence.class, paramMap, alias);
|
||||||
@ -90,6 +106,7 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl<SafetyHatFenceMapper,
|
|||||||
if (inFence) {
|
if (inFence) {
|
||||||
workerNum++;
|
workerNum++;
|
||||||
WorkerInfo workerInfo = new WorkerInfo();
|
WorkerInfo workerInfo = new WorkerInfo();
|
||||||
|
workerInfo.setId(d.getWorkerInfoId());
|
||||||
workerInfo.setWorkerName(d.getWorkerName());
|
workerInfo.setWorkerName(d.getWorkerName());
|
||||||
workerInfo.setIdCard(d.getIdCard());
|
workerInfo.setIdCard(d.getIdCard());
|
||||||
workerInfos.add(workerInfo);
|
workerInfos.add(workerInfo);
|
||||||
|
|||||||
@ -396,4 +396,23 @@ public class VideoItemController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据视频设备监控点编号抓拍图片", notes = "根据视频设备监控点编号抓拍图片", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "serialNumber", value = "视频设备监控点编号", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping("/manualCapture")
|
||||||
|
public Result<String> manualCapture(@RequestBody Map<String, Object> map) {
|
||||||
|
return Result.success(videoItemService.manualCapture(map));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据视频设备监控点编号对讲URL", notes = "根据视频设备监控点编号对讲URL", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "serialNumber", value = "视频设备监控点编号", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping("/getTalkURLs")
|
||||||
|
public Result<String> getTalkURLs(@RequestBody Map<String, Object> map) {
|
||||||
|
return Result.success(videoItemService.getTalkURLs(map));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -261,4 +261,8 @@ public interface IVideoItemService extends IService<VideoItem> {
|
|||||||
|
|
||||||
String searchCameraFromHk(Map<String, Object> param);
|
String searchCameraFromHk(Map<String, Object> param);
|
||||||
|
|
||||||
|
String manualCapture(Map<String, Object> param);
|
||||||
|
|
||||||
|
String getTalkURLs(Map<String, Object> param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -786,4 +786,30 @@ public class VideoItemServiceImpl extends ServiceImpl<VideoItemMapper, VideoItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String manualCapture(Map<String, Object> param) {
|
||||||
|
ProjectVideoConfig projectVideoConfig = getEnableProjectVideoConfigByProjectSn(param);
|
||||||
|
if (Objects.equals(projectVideoConfig.getVideoType(), ProjectVideoConfigVideoTypeEnum.ISC.getValue())) {
|
||||||
|
JSONObject result = HikVideoUtil.manualCapture(MapUtils.getString(param, "serialNumber")
|
||||||
|
, projectVideoConfig.getAccount(), projectVideoConfig.getPassword(), projectVideoConfig.getAppId(), projectVideoConfig.getAppSecret());
|
||||||
|
System.out.println("===============" + result);
|
||||||
|
return JSON.toJSONString(result);
|
||||||
|
} else {
|
||||||
|
throw new OpenAlertException(MessageUtil.get("paramErr"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTalkURLs(Map<String, Object> param) {
|
||||||
|
ProjectVideoConfig projectVideoConfig = getEnableProjectVideoConfigByProjectSn(param);
|
||||||
|
if (Objects.equals(projectVideoConfig.getVideoType(), ProjectVideoConfigVideoTypeEnum.ISC.getValue())) {
|
||||||
|
JSONObject result = HikVideoUtil.getTalkURLs(MapUtils.getString(param, "serialNumber")
|
||||||
|
, projectVideoConfig.getAccount(), projectVideoConfig.getPassword(), projectVideoConfig.getAppId(), projectVideoConfig.getAppSecret());
|
||||||
|
System.out.println("===============" + result);
|
||||||
|
return JSON.toJSONString(result);
|
||||||
|
} else {
|
||||||
|
throw new OpenAlertException(MessageUtil.get("paramErr"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -415,6 +415,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/xmgl/safetyHatData/getNewestList1").permitAll()
|
.antMatchers("/xmgl/safetyHatData/getNewestList1").permitAll()
|
||||||
.antMatchers("/xmgl/safetyHatData/allList").permitAll()
|
.antMatchers("/xmgl/safetyHatData/allList").permitAll()
|
||||||
.antMatchers("/xmgl/api/saveHardWareAlarm").permitAll()
|
.antMatchers("/xmgl/api/saveHardWareAlarm").permitAll()
|
||||||
|
.antMatchers("/xmgl/safetyHatData/exportUseHistory").permitAll()
|
||||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
||||||
.and()
|
.and()
|
||||||
|
|||||||
@ -506,6 +506,38 @@ public class HikVideoUtil {
|
|||||||
return JSONObject.parseObject(result);
|
return JSONObject.parseObject(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static JSONObject manualCapture(String cameraIndexCode, String Ip, String port, String appke, String appSecret) {
|
||||||
|
final String playbackURLs = ARTEMIS_PATH + "/api/video/v1/manualCapture";
|
||||||
|
Map<String, Object> paramMap = new HashMap<String, Object>();// post请求Form表单参数
|
||||||
|
paramMap.put("cameraIndexCode", cameraIndexCode);
|
||||||
|
String body = JSON.toJSON(paramMap).toString();
|
||||||
|
Map<String, String> path = new HashMap<String, String>(2) {
|
||||||
|
{
|
||||||
|
put("https://", playbackURLs);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
String host = Ip + ":" + port;
|
||||||
|
log.info("调用获取监控点抓拍图片>>>监控点唯一标识(cameraIndexCode):{}", cameraIndexCode);
|
||||||
|
String result = doPostStringArtemis(host, path, body, null, null, "application/json", appke, appSecret);
|
||||||
|
return JSONObject.parseObject(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject getTalkURLs(String cameraIndexCode, String Ip, String port, String appke, String appSecret) {
|
||||||
|
final String playbackURLs = ARTEMIS_PATH + "/api/video/v1/cameras/talkURLs";
|
||||||
|
Map<String, Object> paramMap = new HashMap<String, Object>();// post请求Form表单参数
|
||||||
|
paramMap.put("cameraIndexCode", cameraIndexCode);
|
||||||
|
String body = JSON.toJSON(paramMap).toString();
|
||||||
|
Map<String, String> path = new HashMap<String, String>(2) {
|
||||||
|
{
|
||||||
|
put("https://", playbackURLs);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
String host = Ip + ":" + port;
|
||||||
|
log.info("调用获取监控点对讲URL>>>监控点唯一标识(cameraIndexCode):{}", cameraIndexCode);
|
||||||
|
String result = doPostStringArtemis(host, path, body, null, null, "application/json", appke, appSecret);
|
||||||
|
return JSONObject.parseObject(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取监控点回放取流URL V2, 尝试先中心存储,没有记录再设备存储
|
* 获取监控点回放取流URL V2, 尝试先中心存储,没有记录再设备存储
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user