bug修复
This commit is contained in:
parent
46ab8d0748
commit
a1269e5545
@ -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);
|
||||
}
|
||||
|
||||
@ -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<CountSmartGroutDataVo> countSmartGroutData(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(smartGroutDataService.countSmartGroutData(paramMap));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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<SmartGroutData> {
|
||||
IPage<SmartGroutData> queryList(Page<SmartGroutData> page, @Param(Constants.WRAPPER) QueryWrapper<SmartGroutData> queryWrapper);
|
||||
|
||||
List<HashMap<String, Object>> countStatus(HashMap<String, Object> paramMap);
|
||||
|
||||
CountSmartGroutDataVo countSmartGroutData(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -15,4 +15,14 @@
|
||||
where project_sn = #{projectSn}
|
||||
group by date_format(tension_grout_time, '%Y-%m')
|
||||
</select>
|
||||
|
||||
<select id="countSmartGroutData" resultType="com.zhgd.xmgl.modules.smartgrout.entity.vo.CountSmartGroutDataVo">
|
||||
select count(distinct smart_grout_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
|
||||
from smart_grout_data
|
||||
left join smart_grout_steel_beam_data sgsbd on smart_grout_data.id = sgsbd.smart_grout_data_id
|
||||
where smart_grout_data.project_sn = #{projectSn}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -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<SmartGroutData> {
|
||||
void add(SmartGroutData smartGroutData);
|
||||
|
||||
FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap);
|
||||
|
||||
CountSmartGroutDataVo countSmartGroutData(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -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<SmartGroutDataMapper,
|
||||
dimensions.add("不合格");
|
||||
flexibleBigScreenVo.setDimensions(dimensions);
|
||||
flexibleBigScreenVo.setSource(source);
|
||||
List<String> strList = DateUtils.getDateStrList(500, "月份M");
|
||||
List<String> strList = DateUtils.getDateStrList(500, "yyyy-MM");
|
||||
FlexibleBigScreenVo.fillTrendVos(flexibleBigScreenVo, strList, "月份M");
|
||||
return flexibleBigScreenVo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CountSmartGroutDataVo countSmartGroutData(HashMap<String, Object> paramMap) {
|
||||
return baseMapper.countSmartGroutData(paramMap);
|
||||
}
|
||||
|
||||
private QueryWrapper<SmartGroutData> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "sgd.";
|
||||
QueryWrapper<SmartGroutData> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartGroutData.class, paramMap, alias);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user