diff --git a/src/main/java/com/zhgd/xmgl/base/entity/vo/FlexibleBigScreenVo.java b/src/main/java/com/zhgd/xmgl/base/entity/vo/FlexibleBigScreenVo.java index fe8785dfe..f8487650c 100644 --- a/src/main/java/com/zhgd/xmgl/base/entity/vo/FlexibleBigScreenVo.java +++ b/src/main/java/com/zhgd/xmgl/base/entity/vo/FlexibleBigScreenVo.java @@ -4,10 +4,7 @@ import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import lombok.Data; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -65,20 +62,20 @@ public class FlexibleBigScreenVo { vo.put(key, 0); } } - vo.put(timeKey, DateUtil.format(parse(vo.get(timeKey).toString(), format), format)); + vo.put(timeKey, DateUtil.format(parse(vo.get(timeKey).toString()), format)); rtList.add(vo); } + rtVo.setSource(rtList); return rtVo; } /** * @param str - * @param format * @return */ - private static DateTime parse(String str, String format) { - if ("yyyy-MM".equals(format)) { - return DateUtil.parse(str, format); + private static DateTime parse(String str) { + if (Objects.equals(str.length(),7)) { + return DateUtil.parse(str, "yyyy-MM"); } return DateUtil.parse(str); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartgrout/controller/SmartGroutDataController.java b/src/main/java/com/zhgd/xmgl/modules/smartgrout/controller/SmartGroutDataController.java index a63e5dbd0..f89bf86b0 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartgrout/controller/SmartGroutDataController.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartgrout/controller/SmartGroutDataController.java @@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.smartgrout.controller; import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo; import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutData; +import com.zhgd.xmgl.modules.smartgrout.entity.vo.CountSmartGroutDataVo; import com.zhgd.xmgl.modules.smartgrout.service.ISmartGroutDataService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -148,4 +149,15 @@ public class SmartGroutDataController { return Result.success(smartGroutDataService.countStatus(paramMap)); } + @ApiOperation(value = "统计压浆情况", notes = "统计压浆情况", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"), + }) + @PostMapping(value = "/countSmartGroutData") + public Result countSmartGroutData(@ApiIgnore @RequestBody HashMap paramMap) { + return Result.success(smartGroutDataService.countSmartGroutData(paramMap)); + } + + + } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartgrout/entity/vo/CountSmartGroutDataVo.java b/src/main/java/com/zhgd/xmgl/modules/smartgrout/entity/vo/CountSmartGroutDataVo.java new file mode 100644 index 000000000..fa6d50740 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/smartgrout/entity/vo/CountSmartGroutDataVo.java @@ -0,0 +1,17 @@ +package com.zhgd.xmgl.modules.smartgrout.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class CountSmartGroutDataVo { + @ApiModelProperty("智能压浆梁数") + private Integer count; + @ApiModelProperty("智能压浆孔数") + private Integer beamCount; + @ApiModelProperty("智能压浆合格孔数") + private Integer qualifiedBeamCount; + @ApiModelProperty("智能压浆不合格孔数") + private Integer notQualifiedBeamCount; + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/SmartGroutDataMapper.java b/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/SmartGroutDataMapper.java index 776c952ba..146428cd3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/SmartGroutDataMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/SmartGroutDataMapper.java @@ -5,6 +5,7 @@ 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.modules.smartgrout.entity.SmartGroutData; +import com.zhgd.xmgl.modules.smartgrout.entity.vo.CountSmartGroutDataVo; import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; @@ -26,4 +27,6 @@ public interface SmartGroutDataMapper extends BaseMapper { IPage queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); List> countStatus(HashMap paramMap); + + CountSmartGroutDataVo countSmartGroutData(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/xml/SmartGroutDataMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/xml/SmartGroutDataMapper.xml index 583fcc7c6..c1966a5ce 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/xml/SmartGroutDataMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/smartgrout/mapper/xml/SmartGroutDataMapper.xml @@ -15,4 +15,14 @@ where project_sn = #{projectSn} group by date_format(tension_grout_time, '%Y-%m') + + diff --git a/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/ISmartGroutDataService.java b/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/ISmartGroutDataService.java index 54e6c67b9..8657f3d4d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/ISmartGroutDataService.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/ISmartGroutDataService.java @@ -4,6 +4,7 @@ import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo; import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutData; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.xmgl.modules.smartgrout.entity.vo.CountSmartGroutDataVo; import java.util.HashMap; import java.util.List; @@ -23,4 +24,6 @@ public interface ISmartGroutDataService extends IService { void add(SmartGroutData smartGroutData); FlexibleBigScreenVo countStatus(HashMap paramMap); + + CountSmartGroutDataVo countSmartGroutData(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/impl/SmartGroutDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/impl/SmartGroutDataServiceImpl.java index f6ed05781..c29b6598e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/impl/SmartGroutDataServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartgrout/service/impl/SmartGroutDataServiceImpl.java @@ -9,9 +9,11 @@ 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.modules.smartgrout.entity.SmartGroutData; import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutDev; import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutSteelBeamData; +import com.zhgd.xmgl.modules.smartgrout.entity.vo.CountSmartGroutDataVo; import com.zhgd.xmgl.modules.smartgrout.mapper.SmartGroutDataMapper; import com.zhgd.xmgl.modules.smartgrout.mapper.SmartGroutDevMapper; import com.zhgd.xmgl.modules.smartgrout.mapper.SmartGroutSteelBeamDataMapper; @@ -98,13 +100,18 @@ public class SmartGroutDataServiceImpl extends ServiceImpl strList = DateUtils.getDateStrList(500, "月份M"); + List strList = DateUtils.getDateStrList(500, "yyyy-MM"); FlexibleBigScreenVo.fillTrendVos(flexibleBigScreenVo, strList, "月份M"); return flexibleBigScreenVo; } return null; } + @Override + public CountSmartGroutDataVo countSmartGroutData(HashMap paramMap) { + return baseMapper.countSmartGroutData(paramMap); + } + private QueryWrapper getQueryWrapper(HashMap paramMap) { String alias = "sgd."; QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(SmartGroutData.class, paramMap, alias);