From 3dbb2476ecc5ba5ee5dbca6113e458449fc62036 Mon Sep 17 00:00:00 2001 From: guo Date: Thu, 25 Jan 2024 17:43:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=97=E5=8E=8B=E6=8A=97=E6=8A=98=E4=B8=80?= =?UTF-8?q?=E4=BD=93=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zhgd/xmgl/enums/ParamEnum.java | 50 +++++++++++++++- .../AntiPressureFoldManageController.java | 33 ++++++++++ .../vo/CountAntiPressureFoldManageVo.java | 12 ++++ .../mapper/AntiPressureFoldManageMapper.java | 10 ++++ .../xml/AntiPressureFoldManageMapper.xml | 60 +++++++++++++++++++ .../IAntiPressureFoldManageService.java | 9 +++ .../AntiPressureFoldManageServiceImpl.java | 38 ++++++++++++ 7 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/antipressurefold/entity/vo/CountAntiPressureFoldManageVo.java diff --git a/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java b/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java index a12294a0e..37d7eed15 100644 --- a/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java +++ b/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java @@ -1,8 +1,6 @@ package com.zhgd.xmgl.enums; -import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; import lombok.experimental.UtilityClass; import java.util.Arrays; @@ -576,5 +574,53 @@ public class ParamEnum { } } + /** + * 试验类型:1混凝土试件抗压强度试验,2钢筋试验,3钢筋焊接接头试验,4钢筋机械连接接头试验,5水泥砂浆立方体抗压强度试验,6水泥砂浆立方体抗压强度试验(建筑),7水泥净浆物理性能试验,8水泥胶砂强度试验,9水泥胶砂抗折试验,10水泥净浆抗折试验,11水泥混凝土圆柱体轴心抗压强度试验,12后张预应力孔道压浆抗压强度试验,13后张预应力孔道压浆抗折强度试验,14无机结合料稳定材料无侧限抗压强度试验,15复检钢筋焊接接头试验,16复检钢筋机械连接接头试验 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum UniversalTestManageTestTypeEnum implements BaseEnum { + HNTSJKYQDSY(1, "混凝土试件抗压强度试验"), + GJSY(2, "钢筋试验"), + GJHJJTSY(3, "钢筋焊接接头试验"), + GJJXLJJTSY(4, "钢筋机械连接接头试验"), + SNSJLFTKYQDSY(5, "水泥砂浆立方体抗压强度试验"), + SNSJLFTKYQDSYJZ(6, "水泥砂浆立方体抗压强度试验(建筑)"), + SNJJWLXNSY(7, "水泥净浆物理性能试验"), + SNJSQDSY(8, "水泥胶砂强度试验"), + SNJSKZSY(9, "水泥胶砂抗折试验"), + SNJJKZSY(10, "水泥净浆抗折试验"), + SNHNTYZTZXKYQDSY(11, "水泥混凝土圆柱体轴心抗压强度试验"), + HZYYLKDYJKYQDSY(12, "后张预应力孔道压浆抗压强度试验"), + HZYYLKDYJKZQDSY(13, "后张预应力孔道压浆抗折强度试验"), + WJJHLWDCLWZXKYQDSY(14, "无机结合料稳定材料无侧限抗压强度试验"), + FJGJHJJTSY(15, "复检钢筋焊接接头试验"), + FJGJJXLJJTSY(16, "复检钢筋机械连接接头试验"), + ; + + UniversalTestManageTestTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + private Integer value; + private String desc; + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/controller/AntiPressureFoldManageController.java b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/controller/AntiPressureFoldManageController.java index 511178ded..412b1fd0b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/controller/AntiPressureFoldManageController.java +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/controller/AntiPressureFoldManageController.java @@ -1,5 +1,8 @@ package com.zhgd.xmgl.modules.antipressurefold.controller; +import com.zhgd.xmgl.base.entity.vo.SectorVo; +import com.zhgd.xmgl.base.entity.vo.TrendOneVo; +import com.zhgd.xmgl.modules.antipressurefold.entity.vo.CountAntiPressureFoldManageVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -182,4 +185,34 @@ public class AntiPressureFoldManageController { return mv; } + @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"), + @ApiImplicitParam(name = "status", value = "状态:1合格2不合格3未判定", paramType = "body", required = false, dataType = "Integer"), + }) + @PostMapping(value = "/countStatus") + public Result> countStatus(@ApiIgnore @RequestBody HashMap paramMap) { + return Result.success(antiPressureFoldManageService.countStatus(paramMap)); + } + + @ApiOperation(value = "统计试验类型(今日试验类型)", notes = "统计试验类型(今日试验类型)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "devSn", value = "设备sn", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "type", value = "1今日2、7日3、30日", paramType = "body", required = true, dataType = "Integer"), + }) + @PostMapping(value = "/countTestType") + public Result countTestType(@ApiIgnore @RequestBody HashMap paramMap) { + return Result.success(antiPressureFoldManageService.countTestType(paramMap)); + } + + @ApiOperation(value = "统计抗压抗折一体机-管理(实时监测)", notes = "统计抗压抗折一体机-管理(实时监测)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + }) + @PostMapping(value = "/countAntiPressureFoldManage") + public Result countAntiPressureFoldManage(@ApiIgnore @RequestBody HashMap paramMap) { + return Result.success(antiPressureFoldManageService.countAntiPressureFoldManage(paramMap)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/entity/vo/CountAntiPressureFoldManageVo.java b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/entity/vo/CountAntiPressureFoldManageVo.java new file mode 100644 index 000000000..07b1fbfe0 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/entity/vo/CountAntiPressureFoldManageVo.java @@ -0,0 +1,12 @@ +package com.zhgd.xmgl.modules.antipressurefold.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class CountAntiPressureFoldManageVo { + @ApiModelProperty(value = "今日试验次数") + private java.lang.Integer testTodayNum; + @ApiModelProperty(value = "累计试验次数") + private java.lang.Integer testTotalNum; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/AntiPressureFoldManageMapper.java b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/AntiPressureFoldManageMapper.java index c2df9e34e..e0daf1d2a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/AntiPressureFoldManageMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/AntiPressureFoldManageMapper.java @@ -4,11 +4,15 @@ 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.antipressurefold.entity.AntiPressureFoldManage; +import com.zhgd.xmgl.modules.antipressurefold.entity.vo.CountAntiPressureFoldManageVo; import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; +import java.util.HashMap; import java.util.List; /** @@ -23,4 +27,10 @@ public interface AntiPressureFoldManageMapper extends BaseMapper queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + List countStatus(HashMap paramMap); + + List countTestType(HashMap paramMap); + + CountAntiPressureFoldManageVo countAntiPressureFoldManage(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/xml/AntiPressureFoldManageMapper.xml b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/xml/AntiPressureFoldManageMapper.xml index 47c77f131..2bda5ecee 100644 --- a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/xml/AntiPressureFoldManageMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/mapper/xml/AntiPressureFoldManageMapper.xml @@ -6,4 +6,64 @@ join anti_pressure_fold_dev apfd on apfd.dev_sn=apfm.dev_sn ${ew.customSqlSegment} + + + + + diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/IAntiPressureFoldManageService.java b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/IAntiPressureFoldManageService.java index 58ce58af6..9f163d550 100644 --- a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/IAntiPressureFoldManageService.java +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/IAntiPressureFoldManageService.java @@ -1,8 +1,11 @@ package com.zhgd.xmgl.modules.antipressurefold.service; +import com.zhgd.xmgl.base.entity.vo.SectorVo; +import com.zhgd.xmgl.base.entity.vo.TrendOneVo; import com.zhgd.xmgl.modules.antipressurefold.entity.AntiPressureFoldManage; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.xmgl.modules.antipressurefold.entity.vo.CountAntiPressureFoldManageVo; import java.util.HashMap; import java.util.List; @@ -18,4 +21,10 @@ public interface IAntiPressureFoldManageService extends IService queryPageList(HashMap paramMap); List queryList(HashMap paramMap); + + List countStatus(HashMap paramMap); + + SectorVo countTestType(HashMap paramMap); + + CountAntiPressureFoldManageVo countAntiPressureFoldManage(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java index fbc2f3575..fd89243c6 100644 --- a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java @@ -5,15 +5,22 @@ 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.system.query.QueryGenerator; +import com.zhgd.xmgl.base.entity.vo.SectorVo; +import com.zhgd.xmgl.base.entity.vo.TrendOneVo; +import com.zhgd.xmgl.enums.ParamEnum; import com.zhgd.xmgl.modules.antipressurefold.entity.AntiPressureFoldManage; +import com.zhgd.xmgl.modules.antipressurefold.entity.vo.CountAntiPressureFoldManageVo; import com.zhgd.xmgl.modules.antipressurefold.mapper.AntiPressureFoldManageMapper; import com.zhgd.xmgl.modules.antipressurefold.service.IAntiPressureFoldManageService; +import com.zhgd.xmgl.util.DateUtils; import com.zhgd.xmgl.util.PageUtil; import com.zhgd.xmgl.util.RefUtil; +import org.apache.commons.collections.MapUtils; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; +import java.util.Objects; /** * @Description: 抗压抗折一体机-管理 @@ -38,6 +45,37 @@ public class AntiPressureFoldManageServiceImpl extends ServiceImpl countStatus(HashMap paramMap) { + Integer type = MapUtils.getInteger(paramMap, "type"); + String format = null; + List dateTimeStrList = null; + if (Objects.equals(type, 1)) { + format = "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 list = baseMapper.countStatus(paramMap); + return TrendOneVo.fillTrendVos(list, dateTimeStrList, format); + } + + @Override + public SectorVo countTestType(HashMap paramMap) { + return SectorVo.getSectorVoByEnum(baseMapper.countTestType(paramMap), ParamEnum.UniversalTestManageTestTypeEnum.values()); + } + + @Override + public CountAntiPressureFoldManageVo countAntiPressureFoldManage(HashMap paramMap) { + return baseMapper.countAntiPressureFoldManage(paramMap); + } + private QueryWrapper getQueryWrapper(HashMap paramMap) { String alias = "apfm."; QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(AntiPressureFoldManage.class, paramMap, alias);