张拉大屏

This commit is contained in:
guo 2024-01-24 17:14:43 +08:00
parent 579927c32c
commit c92e251e69
13 changed files with 274 additions and 16 deletions

View File

@ -22,7 +22,7 @@ import java.util.stream.Collectors;
@AllArgsConstructor
@NoArgsConstructor
public class SectorVo {
@ApiModelProperty("")
@ApiModelProperty("")
private String count;
private List<SectorOneVo> data;

View File

@ -155,4 +155,7 @@ public class HangBasketDetectData implements Serializable {
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private java.lang.String projectSn;
@ApiModelProperty(value = "倾角")
private Double inclination;
}

View File

@ -1,8 +1,11 @@
package com.zhgd.xmgl.modules.smarttension.controller;
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
import com.zhgd.xmgl.base.entity.vo.SectorVo;
import com.zhgd.xmgl.base.entity.vo.TrendVo;
import com.zhgd.xmgl.modules.smartgrout.entity.vo.CountSmartGroutDataVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionData;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataRealTimeVo;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataVo;
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionDataService;
import io.swagger.annotations.Api;
@ -12,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParams;
import java.util.HashMap;
import org.glassfish.jersey.message.internal.Qualified;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ -162,7 +166,7 @@ public class SmartTensionDataController {
return Result.success(smartTensionDataService.countStatus(paramMap));
}
@ApiOperation(value = "统计张拉情况", notes = "统计张拉情况", httpMethod = "POST")
@ApiOperation(value = "统计张拉情况(钢束)", notes = "统计张拉情况(钢束)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
})
@ -171,6 +175,34 @@ public class SmartTensionDataController {
return Result.success(smartTensionDataService.countSmartTensionData(paramMap));
}
@ApiOperation(value = "梁张拉合格率统计趋势", notes = "梁张拉合格率统计趋势", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "type", value = "1今日2、7日3、30日", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/countQualifiedTrend")
public Result<List<TrendVo>> countQualifiedTrend(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(smartTensionDataService.countQualifiedTrend(paramMap));
}
@ApiOperation(value = "统计智能张拉-数据(实时监测)", notes = "统计智能张拉-数据(实时监测)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/countSmartTensionDataRealTime")
public Result<CountSmartTensionDataRealTimeVo> countSmartTensionDataRealTime(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(smartTensionDataService.countSmartTensionDataRealTime(paramMap));
}
@ApiOperation(value = "统计各梁型张拉情况", notes = "统计各梁型张拉情况", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/countBeamType")
public Result<SectorVo> countBeamType(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(smartTensionDataService.countBeamType(paramMap));
}
}

View File

@ -7,6 +7,7 @@ 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.base.entity.vo.FlexibleBigScreenVo;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionSteelBeamDataService;
import io.swagger.annotations.Api;
@ -160,4 +161,13 @@ public class SmartTensionSteelBeamDataController {
return Result.success(smartTensionSteelBeamDataService.countStatus(paramMap));
}
@ApiOperation(value = "统计钢束张拉合格率", notes = "统计钢束张拉合格率", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "type", value = "1今日2、7日3、30日", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/countStatusTrend")
public Result<List<TrendOneVo>> countStatusTrend(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(smartTensionSteelBeamDataService.countStatusTrend(paramMap));
}
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.smarttension.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CountSmartTensionDataRealTimeVo {
@ApiModelProperty("日张拉次数")
private Integer tensionsPerDayNum;
@ApiModelProperty("累计张拉次数")
private Integer cumulativeTensionNum;
@ApiModelProperty("当日张拉合格率")
private Double tensionPassRate;
@ApiModelProperty("超标闭合率")
private Double excessiveClosureRate;
}

View File

@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionData;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataRealTimeVo;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -29,4 +33,10 @@ public interface SmartTensionDataMapper extends BaseMapper<SmartTensionData> {
CountSmartTensionDataVo countSmartTensionData(HashMap<String, Object> paramMap);
List<HashMap<String, Object>> countStatus(HashMap<String, Object> paramMap);
List<TrendOneVo> countQualifiedTrend(HashMap<String, Object> paramMap);
CountSmartTensionDataRealTimeVo countSmartTensionDataRealTime(HashMap<String, Object> paramMap);
ArrayList<SectorOneVo> countBeamType(HashMap<String, Object> paramMap);
}

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.smarttension.mapper;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -17,4 +18,6 @@ import java.util.List;
public interface SmartTensionSteelBeamDataMapper extends BaseMapper<SmartTensionSteelBeamData> {
List<HashMap<String, Object>> countStatus(HashMap<String, Object> paramMap);
List<TrendOneVo> countStatusTrend(HashMap<String, Object> paramMap);
}

View File

@ -2,7 +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.smarttension.mapper.SmartTensionDataMapper">
<select id="queryList" resultType="com.zhgd.xmgl.modules.smarttension.entity.SmartTensionData">
select std.*,s.device_name from smart_tension_data std
select std.*, s.device_name
from smart_tension_data std
join smart_tension_dev s on std.dev_sn = s.dev_sn
${ew.customSqlSegment}
</select>
@ -11,18 +12,101 @@
resultType="com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataVo">
select count(distinct smart_tension_data.id) count,
count(sgsbd.id) beamCount,
ifnull(sum(if(sgsbd.status=1,1,0)),0) qualifiedBeamCount,
ifnull(sum(if(sgsbd.status=2,1,0)),0) notQualifiedBeamCount
ifnull(sum(if(sgsbd.status = 1, 1, 0)), 0) qualifiedBeamCount,
ifnull(sum(if(sgsbd.status = 2, 1, 0)), 0) notQualifiedBeamCount
from smart_tension_data
left join smart_tension_steel_beam_data sgsbd on smart_tension_data.id = sgsbd.smart_tension_data_id
where smart_tension_data.project_sn = #{projectSn}
</select>
<select id="countStatus" resultType="java.util.HashMap">
select date_format(tension_time, '%Y-%m') 月份, ifnull(sum(if(status=1,1,0)),0)
合格,ifnull(sum(if(status=2,1,0)),0) 不合格
select date_format(tension_time, '%Y-%m') 月份,
ifnull(sum(if(status = 1, 1, 0)), 0)
合格,
ifnull(sum(if(status = 2, 1, 0)), 0) 不合格
from smart_tension_data
where project_sn = #{projectSn}
group by date_format(tension_time, '%Y-%m')
</select>
<select id="countQualifiedTrend" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
select
<if test="type == '1'.toString()">
date_format(tension_time, '%Y-%m-%d %H:00') x,
</if>
<if test="type == '2'.toString()">
date_format(tension_time, '%Y-%m-%d') x,
</if>
<if test="type == '3'.toString()">
date_format(tension_time, '%Y-%m-%d') x,
</if>
count(*) y,
1 sn
from smart_tension_data
where project_sn = #{projectSn}
<if test="type == '1'.toString()">
and tension_time > current_date
</if>
<if test="type == '2'.toString()">
and tension_time > date_sub(tension_time, interval 6 day)
</if>
<if test="type == '3'.toString()">
and tension_time > date_sub(tension_time, interval 29 day)
</if>
group by x
union all
select
<if test="type == '1'.toString()">
date_format(tension_time, '%Y-%m-%d %H:00') x,
</if>
<if test="type == '2'.toString()">
date_format(tension_time, '%Y-%m-%d') x,
</if>
<if test="type == '3'.toString()">
date_format(tension_time, '%Y-%m-%d') x,
</if>
ifnull(round(sum(if(status = 1, 1, 0)) / count(*) * 100, 2), 0) y,
2 sn
from smart_tension_data
where project_sn = #{projectSn}
<if test="type == '1'.toString()">
and tension_time > current_date
</if>
<if test="type == '2'.toString()">
and tension_time > date_sub(tension_time, interval 6 day)
</if>
<if test="type == '3'.toString()">
and tension_time > date_sub(tension_time, interval 29 day)
</if>
group by x
</select>
<select id="countSmartTensionDataRealTime"
resultType="com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataRealTimeVo">
select ifnull(sum(if(tension_time > current_date, 1, 0)), 0) tensionsPerDayNum,
count(*) cumulativeTensionNum,
ifnull(round(sum(if(tension_time > current_date and status = 1, 1, 0)) /
sum(if(tension_time > current_date, 1, 0)) * 100, 2),0) tensionPassRate,
ifnull(round(sum(if(status = 2, 1, 0)) / count(*) * 100, 2),0) excessiveClosureRate
from smart_tension_data
where 1 = 1
<if test="projectSn != null and projectSn != ''">
and project_sn = #{projectSn}
</if>
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
</select>
<select id="countBeamType" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
select beam_type name, count(*) count
from smart_tension_data
where 1 = 1
<if test="projectSn != null and projectSn != ''">
and project_sn = #{projectSn}
</if>
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
group by beam_type
</select>
</mapper>

View File

@ -1,12 +1,39 @@
<?xml version="1.0" encoding="UTF-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.smarttension.mapper.SmartTensionSteelBeamDataMapper">
<select id="countStatus" resultType="java.util.HashMap">
select date_format(create_date, '%Y-%m') 月份, ifnull(sum(if(status=1,1,0)),0)
合格,ifnull(sum(if(status=2,1,0)),0) 不合格
<select id="countStatus" resultType="java.util.HashMap">
select date_format(create_date, '%Y-%m') 月份,
ifnull(sum(if(status = 1, 1, 0)), 0)
合格,
ifnull(sum(if(status = 2, 1, 0)), 0) 不合格
from smart_tension_steel_beam_data
where project_sn = #{projectSn}
group by date_format(create_date, '%Y-%m')
</select>
<select id="countStatusTrend" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
select
<if test="type == '1'.toString()">
date_format(tension_time, '%Y-%m-%d %H:00') x,
</if>
<if test="type == '2'.toString()">
date_format(tension_time, '%Y-%m-%d') x,
</if>
<if test="type == '3'.toString()">
date_format(tension_time, '%Y-%m-%d') x,
</if>
ifnull(round(sum(if(status = 1, 1, 0))/count(*)*100,2), 0) y
from smart_tension_steel_beam_data
where project_sn = #{projectSn}
<if test="type == '1'.toString()">
and tension_time > current_date
</if>
<if test="type == '2'.toString()">
and tension_time > date_sub(tension_time, interval 6 day)
</if>
<if test="type == '3'.toString()">
and tension_time > date_sub(tension_time, interval 29 day)
</if>
group by x
</select>
</mapper>

View File

@ -1,9 +1,12 @@
package com.zhgd.xmgl.modules.smarttension.service;
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
import com.zhgd.xmgl.base.entity.vo.SectorVo;
import com.zhgd.xmgl.base.entity.vo.TrendVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataRealTimeVo;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataVo;
import java.util.HashMap;
@ -26,4 +29,10 @@ public interface ISmartTensionDataService extends IService<SmartTensionData> {
CountSmartTensionDataVo countSmartTensionData(HashMap<String, Object> paramMap);
FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap);
List<TrendVo> countQualifiedTrend(HashMap<String, Object> paramMap);
CountSmartTensionDataRealTimeVo countSmartTensionDataRealTime(HashMap<String, Object> paramMap);
SectorVo countBeamType(HashMap<String, Object> paramMap);
}

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.smarttension.service;
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -21,4 +22,6 @@ public interface ISmartTensionSteelBeamDataService extends IService<SmartTension
List<SmartTensionSteelBeamData> queryList(HashMap<String, Object> paramMap);
FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap);
List<TrendOneVo> countStatusTrend(HashMap<String, Object> paramMap);
}

View File

@ -9,10 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gexin.fastjson.JSON;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
import com.zhgd.xmgl.base.entity.vo.*;
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationDev;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionData;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionDev;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataRealTimeVo;
import com.zhgd.xmgl.modules.smarttension.entity.vo.CountSmartTensionDataVo;
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionDataMapper;
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionDevMapper;
@ -30,6 +32,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Description: 智能张拉-数据
@ -115,6 +118,42 @@ public class SmartTensionDataServiceImpl extends ServiceImpl<SmartTensionDataMap
return null;
}
@Override
public List<TrendVo> countQualifiedTrend(HashMap<String, Object> paramMap) {
String projectSn = MapUtils.getString(paramMap, "projectSn");
Integer type = MapUtils.getInteger(paramMap, "type");
List<TrendVo> trendVos = new ArrayList<>();
trendVos.add(new TrendVo("张拉次数", "1"));
trendVos.add(new TrendVo("合格率", "2"));
List<TrendOneVo> list = baseMapper.countQualifiedTrend(paramMap);
if (Objects.equals(type, 1)) {
List<String> dateTimeStrList = DateUtils.getDateTimeStrList(100, "HH:00");
String format = "HH:00";
return TrendVo.getTrendVos(trendVos, list, dateTimeStrList, format);
} else if (Objects.equals(type, 2)) {
List<String> dateTimeStrList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd");
String format = "yyyy-MM-dd";
return TrendVo.getTrendVos(trendVos, list, dateTimeStrList, format);
} else if (Objects.equals(type, 3)) {
List<String> dateTimeStrList = DateUtils.getDateTimeStrList(80, "yyyy-MM-dd");
String format = "yyyy-MM-dd";
return TrendVo.getTrendVos(trendVos, list, dateTimeStrList, format);
} else {
return null;
}
}
@Override
public CountSmartTensionDataRealTimeVo countSmartTensionDataRealTime(HashMap<String, Object> paramMap) {
return baseMapper.countSmartTensionDataRealTime(paramMap);
}
@Override
public SectorVo countBeamType(HashMap<String, Object> paramMap) {
ArrayList<SectorOneVo> list = baseMapper.countBeamType(paramMap);
return SectorVo.getSectorVo(list);
}
private QueryWrapper<SmartTensionData> getQueryWrapper(HashMap<String, Object> paramMap) {
String alias = "std.";
QueryWrapper<SmartTensionData> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartTensionData.class, paramMap, alias);

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionSteelBeamDataMapper;
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionSteelBeamDataService;
@ -67,6 +68,27 @@ public class SmartTensionSteelBeamDataServiceImpl extends ServiceImpl<SmartTensi
return null;
}
@Override
public List<TrendOneVo> countStatusTrend(HashMap<String, Object> paramMap) {
Integer type = MapUtils.getInteger(paramMap, "type");
String format = null;
List<String> dateTimeStrList = null;
if (Objects.equals(type, 1)) {
format = "yyyy-MM-dd HH:00";
dateTimeStrList = DateUtils.getDateTimeStrList(100, "yyyy-MM-dd HH:00");
} else if (Objects.equals(type, 2)) {
format = "yyyy-MM-dd";
dateTimeStrList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd");
} else if (Objects.equals(type, 3)) {
format = "yyyy-MM-dd";
dateTimeStrList = DateUtils.getDateTimeStrList(80, "yyyy-MM-dd");
} else {
return null;
}
List<TrendOneVo> list = baseMapper.countStatusTrend(paramMap);
return TrendOneVo.fillTrendVos(list, dateTimeStrList, format);
}
private QueryWrapper<SmartTensionSteelBeamData> getQueryWrapper(HashMap<String, Object> paramMap) {
QueryWrapper<SmartTensionSteelBeamData> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartTensionSteelBeamData.class, paramMap);
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(SmartTensionSteelBeamData::getId));