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.service.IBimfaceConfigService;
import com.zhgd.xmgl.modules.bimface.service.IProjectBimfaceService;
import com.zhgd.xmgl.modules.stablewater.entity.StableWaterMixStationData;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -262,4 +261,14 @@ public class BimfaceController {
projectBimfaceService.updateById(stableWaterMixStationData);
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 getEnableModel(HashMap<String, Object> paramMap);
}

View File

@ -181,6 +181,29 @@ public class ProjectBimfaceServiceImpl extends ServiceImpl<ProjectBimfaceMapper,
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
public String getFileStatus(BimfaceClient bimfaceClient, Long fileId) {
String status = null;

View File

@ -144,7 +144,7 @@ public class SmartBeamFieldMaintainDataController {
@ApiOperation(value = "查询智慧梁场-智能养护数据平均温度和湿度信息", notes = "查询智慧梁场-智能养护数据平均温度和湿度信息", httpMethod = "GET")
@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"),
})
@GetMapping(value = "/getAvgData")

View File

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

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.smartbeamfield.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;
@ -11,25 +12,29 @@ import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
/**
* @Description: 智慧梁场-存梁区
* @author pds
* @date 2023-12-05
* @date 2023-12-05
* @version V1.0
*/
@Data
@TableName("smart_beam_field_save_beam_district")
@ApiModel(value="SmartBeamFieldSaveBeamDistrict实体类",description="SmartBeamFieldSaveBeamDistrict")
@ApiModel(value = "SmartBeamFieldSaveBeamDistrict实体类", description = "SmartBeamFieldSaveBeamDistrict")
public class SmartBeamFieldSaveBeamDistrict implements Serializable {
private static final long serialVersionUID = 1L;
/**主键id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="主键id")
private java.lang.Long id ;
/**存梁区名称*/
@Excel(name = "存梁区名称", width = 15)
@ApiModelProperty(value="存梁区名称")
@ApiModelProperty(value = "存梁区名称")
@NotBlank
private java.lang.String saveBeamDistrictName ;
/**项目sn*/
@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">
<mapper namespace="com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldMaintainDataMapper">
<select id="countCustomData" resultType="java.util.HashMap">
select date_format(create_date, '%H:00') time, round(ifnull(avg(temperature),0),2) temperature,
round(ifnull(avg(humidity),0),2) humidity
select date_format(create_date, '%H:00') time, round(ifnull(avg(temperature),0),2) 温度,
round(ifnull(avg(humidity),0),2) 湿度
from smart_beam_field_maintain_data
where make_beam_pedestal_sn = #{makeBeamPedestalSn}
<if test="type == '1'.toString()">
@ -15,7 +15,10 @@
<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
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()">
and create_date >= concat(date_format(create_date, '%Y-%m-%d'),' 00:00:00')
</if>

View File

@ -88,8 +88,8 @@ public class SmartBeamFieldMaintainDataServiceImpl extends ServiceImpl<SmartBeam
List<HashMap<String, Object>> source = baseMapper.countCustomData(paramMap);
List<String> dimensions = new ArrayList<>();
dimensions.add("time");
dimensions.add("temperature");
dimensions.add("humidity");
dimensions.add("温度");
dimensions.add("湿度");
flexibleBigScreenVo.setDimensions(dimensions);
flexibleBigScreenVo.setSource(source);
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.extension.plugins.pagination.Page;
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.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam;
import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToSaveBeamPedestal;
@ -72,12 +73,27 @@ public class SmartBeamFieldSaveBeamDistrictServiceImpl extends ServiceImpl<Smart
@Override
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);
baseMapper.insert(smartBeamFieldSaveBeamDistrict);
}
@Override
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);
}

View File

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