bug修复
This commit is contained in:
parent
a1269e5545
commit
756052e705
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.smartgrout.controller;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
|
||||
import com.zhgd.xmgl.modules.smartgrout.service.ISmartGroutSteelBeamDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -181,4 +182,14 @@ public class SmartGroutSteelBeamDataController {
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计压浆孔合格情况", notes = "统计压浆孔合格情况", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "type", value = "类型:1每月", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countStatus")
|
||||
public Result<FlexibleBigScreenVo> countStatus(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(smartGroutSteelBeamDataService.countStatus(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,9 @@ import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutSteelBeamData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 智能压浆-钢束数据
|
||||
* @author: pds
|
||||
@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@Mapper
|
||||
public interface SmartGroutSteelBeamDataMapper extends BaseMapper<SmartGroutSteelBeamData> {
|
||||
|
||||
List<HashMap<String, Object>> countStatus(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
<?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.smartgrout.mapper.SmartGroutSteelBeamDataMapper">
|
||||
|
||||
<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_grout_steel_beam_data
|
||||
where project_sn = #{projectSn}
|
||||
group by date_format(create_date, '%Y-%m')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.smartgrout.service;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
|
||||
import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutSteelBeamData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -18,4 +19,6 @@ public interface ISmartGroutSteelBeamDataService extends IService<SmartGroutStee
|
||||
IPage<SmartGroutSteelBeamData> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<SmartGroutSteelBeamData> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -2,11 +2,14 @@ package com.zhgd.xmgl.modules.smartgrout.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
|
||||
import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutData;
|
||||
import com.zhgd.xmgl.modules.smartgrout.entity.SmartGroutSteelBeamData;
|
||||
import com.zhgd.xmgl.modules.smartgrout.mapper.SmartGroutSteelBeamDataMapper;
|
||||
import com.zhgd.xmgl.modules.smartgrout.service.ISmartGroutSteelBeamDataService;
|
||||
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
|
||||
import com.zhgd.xmgl.util.DateUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -15,8 +18,10 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -45,6 +50,25 @@ public class SmartGroutSteelBeamDataServiceImpl extends ServiceImpl<SmartGroutSt
|
||||
return dealList(this.list(queryWrapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap) {
|
||||
Integer type = MapUtils.getInteger(paramMap, "type");
|
||||
if (Objects.equals(1, type)) {
|
||||
FlexibleBigScreenVo flexibleBigScreenVo = new FlexibleBigScreenVo();
|
||||
List<HashMap<String, Object>> source = baseMapper.countStatus(paramMap);
|
||||
List<String> dimensions = new ArrayList<>();
|
||||
dimensions.add("月份");
|
||||
dimensions.add("合格");
|
||||
dimensions.add("不合格");
|
||||
flexibleBigScreenVo.setDimensions(dimensions);
|
||||
flexibleBigScreenVo.setSource(source);
|
||||
List<String> strList = DateUtils.getDateStrList(500, "yyyy-MM");
|
||||
FlexibleBigScreenVo.fillTrendVos(flexibleBigScreenVo, strList, "月份M");
|
||||
return flexibleBigScreenVo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private QueryWrapper<SmartGroutSteelBeamData> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<SmartGroutSteelBeamData> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartGroutSteelBeamData.class, paramMap);
|
||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(SmartGroutSteelBeamData::getId));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user