bug修复

This commit is contained in:
guo 2023-12-12 09:43:15 +08:00
parent c989b8744a
commit e1980f0dd6
10 changed files with 71 additions and 12 deletions

View File

@ -13,7 +13,6 @@ import com.zhgd.xmgl.modules.bimface.entity.vo.ConfigVO;
import com.zhgd.xmgl.modules.bimface.entity.vo.ProjectBimfaceListVO; import com.zhgd.xmgl.modules.bimface.entity.vo.ProjectBimfaceListVO;
import com.zhgd.xmgl.modules.bimface.service.IBimfaceConfigService; import com.zhgd.xmgl.modules.bimface.service.IBimfaceConfigService;
import com.zhgd.xmgl.modules.bimface.service.IProjectBimfaceService; import com.zhgd.xmgl.modules.bimface.service.IProjectBimfaceService;
import com.zhgd.xmgl.modules.stablewater.entity.StableWaterMixStationData;
import com.zhgd.xmgl.util.MessageUtil; import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -262,4 +261,14 @@ public class BimfaceController {
projectBimfaceService.updateById(stableWaterMixStationData); projectBimfaceService.updateById(stableWaterMixStationData);
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "查询启用的模型和token", notes = "查询启用的模型和token")
@GetMapping(value = "/getEnableModel")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", dataType = "string"),
})
public Result<ProjectBimface> getEnableModel(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
return Result.success(projectBimfaceService.getEnableModel(paramMap));
}
} }

View File

@ -67,4 +67,5 @@ public interface IProjectBimfaceService extends IService<ProjectBimface> {
ProjectBimface getDetailsByFileIdAndProjectSn(HashMap<String, Object> paramMap); ProjectBimface getDetailsByFileIdAndProjectSn(HashMap<String, Object> paramMap);
ProjectBimface getEnableModel(HashMap<String, Object> paramMap);
} }

View File

@ -181,6 +181,29 @@ public class ProjectBimfaceServiceImpl extends ServiceImpl<ProjectBimfaceMapper,
return projectBimface; return projectBimface;
} }
@Override
public ProjectBimface getEnableModel(HashMap<String, Object> paramMap) {
String projectSn = MapUtils.getString(paramMap, "projectSn");
ProjectBimface projectBimface = projectBimfaceMapper.selectOne(new LambdaQueryWrapper<ProjectBimface>()
.eq(ProjectBimface::getProjectSn, projectSn)
.eq(ProjectBimface::getIsEnable, 1)
);
BimfaceClient bimfaceClient = this.getBimfaceClientByProjectSn(projectSn);
Long fileId = projectBimface.getFileId();
String status = this.getFileStatus(bimfaceClient, fileId);
if (status == null) {
try {
projectBimface.setViewToken(bimfaceClient.getViewTokenByFileId(fileId));
} catch (BimfaceException e) {
e.printStackTrace();
log.error("err:", e);
}
} else {
log.error(status);
}
return projectBimface;
}
@Override @Override
public String getFileStatus(BimfaceClient bimfaceClient, Long fileId) { public String getFileStatus(BimfaceClient bimfaceClient, Long fileId) {
String status = null; String status = null;

View File

@ -144,7 +144,7 @@ public class SmartBeamFieldMaintainDataController {
@ApiOperation(value = "查询智慧梁场-智能养护数据平均温度和湿度信息", notes = "查询智慧梁场-智能养护数据平均温度和湿度信息", httpMethod = "GET") @ApiOperation(value = "查询智慧梁场-智能养护数据平均温度和湿度信息", notes = "查询智慧梁场-智能养护数据平均温度和湿度信息", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "makeBeamPedestalSn", value = "制梁台座编号", paramType = "query", required = true, dataType = "String"), @ApiImplicitParam(name = "makeBeamPedestalSn", value = "制梁台座编号", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "type", value = "类型1今日", paramType = "query", required = true, dataType = "Integer"), @ApiImplicitParam(name = "type", value = "类型1今日", paramType = "query", required = true, dataType = "Integer"),
}) })
@GetMapping(value = "/getAvgData") @GetMapping(value = "/getAvgData")

View File

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
@ -67,7 +68,7 @@ public class SmartBeamFieldSaveBeamDistrictController {
*/ */
@ApiOperation(value = "添加智慧梁场-存梁区信息", notes = "添加智慧梁场-存梁区信息", httpMethod = "POST") @ApiOperation(value = "添加智慧梁场-存梁区信息", notes = "添加智慧梁场-存梁区信息", httpMethod = "POST")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<SmartBeamFieldSaveBeamDistrict> add(@RequestBody SmartBeamFieldSaveBeamDistrict smartBeamFieldSaveBeamDistrict) { public Result<SmartBeamFieldSaveBeamDistrict> add(@RequestBody @Validated SmartBeamFieldSaveBeamDistrict smartBeamFieldSaveBeamDistrict) {
smartBeamFieldSaveBeamDistrictService.add(smartBeamFieldSaveBeamDistrict); smartBeamFieldSaveBeamDistrictService.add(smartBeamFieldSaveBeamDistrict);
return Result.ok(); return Result.ok();
} }

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.smartbeamfield.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@ -11,25 +12,29 @@ import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
/** /**
* @Description: 智慧梁场-存梁区 * @Description: 智慧梁场-存梁区
* @author pds * @author pds
* @date 2023-12-05 * @date 2023-12-05
* @version V1.0 * @version V1.0
*/ */
@Data @Data
@TableName("smart_beam_field_save_beam_district") @TableName("smart_beam_field_save_beam_district")
@ApiModel(value="SmartBeamFieldSaveBeamDistrict实体类",description="SmartBeamFieldSaveBeamDistrict") @ApiModel(value = "SmartBeamFieldSaveBeamDistrict实体类", description = "SmartBeamFieldSaveBeamDistrict")
public class SmartBeamFieldSaveBeamDistrict implements Serializable { public class SmartBeamFieldSaveBeamDistrict implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键id*/ /**主键id*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="主键id") @ApiModelProperty(value="主键id")
private java.lang.Long id ; private java.lang.Long id ;
/**存梁区名称*/ /**存梁区名称*/
@Excel(name = "存梁区名称", width = 15) @Excel(name = "存梁区名称", width = 15)
@ApiModelProperty(value="存梁区名称") @ApiModelProperty(value = "存梁区名称")
@NotBlank
private java.lang.String saveBeamDistrictName ; private java.lang.String saveBeamDistrictName ;
/**项目sn*/ /**项目sn*/
@Excel(name = "项目sn", width = 15) @Excel(name = "项目sn", width = 15)

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldMaintainDataMapper"> <mapper namespace="com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldMaintainDataMapper">
<select id="countCustomData" resultType="java.util.HashMap"> <select id="countCustomData" resultType="java.util.HashMap">
select date_format(create_date, '%H:00') time, round(ifnull(avg(temperature),0),2) temperature, select date_format(create_date, '%H:00') time, round(ifnull(avg(temperature),0),2) 温度,
round(ifnull(avg(humidity),0),2) humidity round(ifnull(avg(humidity),0),2) 湿度
from smart_beam_field_maintain_data from smart_beam_field_maintain_data
where make_beam_pedestal_sn = #{makeBeamPedestalSn} where make_beam_pedestal_sn = #{makeBeamPedestalSn}
<if test="type == '1'.toString()"> <if test="type == '1'.toString()">
@ -15,7 +15,10 @@
<select id="getAvgData" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldMaintainData"> <select id="getAvgData" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldMaintainData">
select round(ifnull(avg(temperature),0),2) temperature, round(ifnull(avg(humidity),0),2) humidity select round(ifnull(avg(temperature),0),2) temperature, round(ifnull(avg(humidity),0),2) humidity
from smart_beam_field_maintain_data from smart_beam_field_maintain_data
where make_beam_pedestal_sn = #{makeBeamPedestalSn} where 1=1
<if test="makeBeamPedestalSn != null and makeBeamPedestalSn != ''">
and make_beam_pedestal_sn = #{make_beam_pedestal_sn}
</if>
<if test="type == '1'.toString()"> <if test="type == '1'.toString()">
and create_date >= concat(date_format(create_date, '%Y-%m-%d'),' 00:00:00') and create_date >= concat(date_format(create_date, '%Y-%m-%d'),' 00:00:00')
</if> </if>

View File

@ -88,8 +88,8 @@ public class SmartBeamFieldMaintainDataServiceImpl extends ServiceImpl<SmartBeam
List<HashMap<String, Object>> source = baseMapper.countCustomData(paramMap); List<HashMap<String, Object>> source = baseMapper.countCustomData(paramMap);
List<String> dimensions = new ArrayList<>(); List<String> dimensions = new ArrayList<>();
dimensions.add("time"); dimensions.add("time");
dimensions.add("temperature"); dimensions.add("温度");
dimensions.add("humidity"); dimensions.add("湿度");
flexibleBigScreenVo.setDimensions(dimensions); flexibleBigScreenVo.setDimensions(dimensions);
flexibleBigScreenVo.setSource(source); flexibleBigScreenVo.setSource(source);
List<String> strList = DateUtils.getDateStrList(100, "HH:00"); List<String> strList = DateUtils.getDateStrList(100, "HH:00");

View File

@ -5,6 +5,7 @@ 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.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.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator; import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam;
import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToSaveBeamPedestal; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToSaveBeamPedestal;
@ -72,12 +73,27 @@ public class SmartBeamFieldSaveBeamDistrictServiceImpl extends ServiceImpl<Smart
@Override @Override
public void add(SmartBeamFieldSaveBeamDistrict smartBeamFieldSaveBeamDistrict) { public void add(SmartBeamFieldSaveBeamDistrict smartBeamFieldSaveBeamDistrict) {
SmartBeamFieldSaveBeamDistrict d = smartBeamFieldSaveBeamDistrictMapper.selectOne(new LambdaQueryWrapper<SmartBeamFieldSaveBeamDistrict>()
.eq(SmartBeamFieldSaveBeamDistrict::getProjectSn, smartBeamFieldSaveBeamDistrict.getProjectSn())
.eq(SmartBeamFieldSaveBeamDistrict::getSaveBeamDistrictName, smartBeamFieldSaveBeamDistrict.getSaveBeamDistrictName())
);
if (d != null) {
throw new OpenAlertException("存梁区名称已存在");
}
smartBeamFieldSaveBeamDistrict.setId(null); smartBeamFieldSaveBeamDistrict.setId(null);
baseMapper.insert(smartBeamFieldSaveBeamDistrict); baseMapper.insert(smartBeamFieldSaveBeamDistrict);
} }
@Override @Override
public void edit(SmartBeamFieldSaveBeamDistrict smartBeamFieldSaveBeamDistrict) { public void edit(SmartBeamFieldSaveBeamDistrict smartBeamFieldSaveBeamDistrict) {
SmartBeamFieldSaveBeamDistrict d = smartBeamFieldSaveBeamDistrictMapper.selectOne(new LambdaQueryWrapper<SmartBeamFieldSaveBeamDistrict>()
.eq(SmartBeamFieldSaveBeamDistrict::getProjectSn, smartBeamFieldSaveBeamDistrict.getProjectSn())
.eq(SmartBeamFieldSaveBeamDistrict::getSaveBeamDistrictName, smartBeamFieldSaveBeamDistrict.getSaveBeamDistrictName())
.ne(SmartBeamFieldSaveBeamDistrict::getId, smartBeamFieldSaveBeamDistrict.getId())
);
if (d != null) {
throw new OpenAlertException("存梁区名称已存在");
}
baseMapper.updateById(smartBeamFieldSaveBeamDistrict); baseMapper.updateById(smartBeamFieldSaveBeamDistrict);
} }

View File

@ -269,6 +269,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/xmgl/smartBeamFieldMaintainData/page").permitAll() .antMatchers("/xmgl/smartBeamFieldMaintainData/page").permitAll()
.antMatchers("/xmgl/smartBeamFieldMaintainData/countCustomData").permitAll() .antMatchers("/xmgl/smartBeamFieldMaintainData/countCustomData").permitAll()
.antMatchers("/xmgl/smartBeamFieldMaintainData/getAvgData").permitAll() .antMatchers("/xmgl/smartBeamFieldMaintainData/getAvgData").permitAll()
.antMatchers("/xmgl/smartBeamFieldMakeBeamPedestal/list").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
.anyRequest().authenticated() // 剩下所有的验证都需要验证 .anyRequest().authenticated() // 剩下所有的验证都需要验证
.and() .and()