张拉大屏接口
This commit is contained in:
parent
756052e705
commit
0a74952cdd
@ -1,6 +1,9 @@
|
||||
package com.zhgd.xmgl.modules.smarttension.controller;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
|
||||
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.CountSmartTensionDataVo;
|
||||
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -149,37 +152,25 @@ public class SmartTensionDataController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel智能张拉-数据信息", notes = "导出excel智能张拉-数据信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<SmartTensionData> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
SmartTensionData smartTensionData = JSON.parseObject(deString, SmartTensionData.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(smartTensionData, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SmartTensionData> pageList = smartTensionDataService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "智能张拉-数据列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SmartTensionData.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("智能张拉-数据列表数据", "导出人:Jeecg", "导出信息"));
|
||||
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(smartTensionDataService.countStatus(paramMap));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计张拉情况", notes = "统计张拉情况", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countSmartTensionData")
|
||||
public Result<CountSmartTensionDataVo> countSmartTensionData(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(smartTensionDataService.countSmartTensionData(paramMap));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.modules.smarttension.entity.SmartTensionSteelBeamData;
|
||||
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionSteelBeamDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -149,37 +150,14 @@ public class SmartTensionSteelBeamDataController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel智能张拉-钢束数据信息", notes = "导出excel智能张拉-钢束数据信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<SmartTensionSteelBeamData> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
SmartTensionSteelBeamData smartTensionSteelBeamData = JSON.parseObject(deString, SmartTensionSteelBeamData.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(smartTensionSteelBeamData, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SmartTensionSteelBeamData> pageList = smartTensionSteelBeamDataService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "智能张拉-钢束数据列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SmartTensionSteelBeamData.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("智能张拉-钢束数据列表数据", "导出人:Jeecg", "导出信息"));
|
||||
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(smartTensionSteelBeamDataService.countStatus(paramMap));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.smarttension.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CountSmartTensionDataVo {
|
||||
@ApiModelProperty("智能张拉梁数")
|
||||
private Integer count;
|
||||
@ApiModelProperty("智能张拉孔数")
|
||||
private Integer beamCount;
|
||||
@ApiModelProperty("智能张拉合格孔数")
|
||||
private Integer qualifiedBeamCount;
|
||||
@ApiModelProperty("智能张拉不合格孔数")
|
||||
private Integer notQualifiedBeamCount;
|
||||
}
|
||||
@ -5,10 +5,12 @@ 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.smarttension.entity.SmartTensionData;
|
||||
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.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -23,4 +25,8 @@ public interface SmartTensionDataMapper extends BaseMapper<SmartTensionData> {
|
||||
IPage<SmartTensionData> queryList(Page<SmartTensionData> page, @Param(Constants.WRAPPER) QueryWrapper<SmartTensionData> queryWrapper);
|
||||
|
||||
List<SmartTensionData> queryList(@Param(Constants.WRAPPER) QueryWrapper<SmartTensionData> queryWrapper);
|
||||
|
||||
CountSmartTensionDataVo countSmartTensionData(HashMap<String, Object> paramMap);
|
||||
|
||||
List<HashMap<String, Object>> countStatus(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -4,6 +4,9 @@ import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
|
||||
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 SmartTensionSteelBeamDataMapper extends BaseMapper<SmartTensionSteelBeamData> {
|
||||
|
||||
List<HashMap<String, Object>> countStatus(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -6,4 +6,23 @@
|
||||
join smart_tension_dev s on std.dev_sn = s.dev_sn
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="countSmartTensionData"
|
||||
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
|
||||
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) 不合格
|
||||
from smart_tension_data
|
||||
where project_sn = #{projectSn}
|
||||
group by date_format(tension_time, '%Y-%m')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -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.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) 不合格
|
||||
from smart_tension_steel_beam_data
|
||||
where project_sn = #{projectSn}
|
||||
group by date_format(create_date, '%Y-%m')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.zhgd.xmgl.modules.smarttension.service;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
|
||||
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.CountSmartTensionDataVo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -20,4 +22,8 @@ public interface ISmartTensionDataService extends IService<SmartTensionData> {
|
||||
List<SmartTensionData> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(SmartTensionData smartTensionData);
|
||||
|
||||
CountSmartTensionDataVo countSmartTensionData(HashMap<String, Object> paramMap);
|
||||
|
||||
FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.smarttension.service;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.FlexibleBigScreenVo;
|
||||
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -18,4 +19,6 @@ public interface ISmartTensionSteelBeamDataService extends IService<SmartTension
|
||||
IPage<SmartTensionSteelBeamData> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<SmartTensionSteelBeamData> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
FlexibleBigScreenVo countStatus(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -9,21 +9,27 @@ 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.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.CountSmartTensionDataVo;
|
||||
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionDataMapper;
|
||||
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionDevMapper;
|
||||
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionSteelBeamDataMapper;
|
||||
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionDataService;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 智能张拉-数据
|
||||
@ -85,6 +91,30 @@ public class SmartTensionDataServiceImpl extends ServiceImpl<SmartTensionDataMap
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CountSmartTensionDataVo countSmartTensionData(HashMap<String, Object> paramMap) {
|
||||
return baseMapper.countSmartTensionData(paramMap);
|
||||
}
|
||||
|
||||
@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<SmartTensionData> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "std.";
|
||||
QueryWrapper<SmartTensionData> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartTensionData.class, paramMap, alias);
|
||||
|
||||
@ -8,16 +8,21 @@ 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.FlexibleBigScreenVo;
|
||||
import com.zhgd.xmgl.modules.smarttension.entity.SmartTensionSteelBeamData;
|
||||
import com.zhgd.xmgl.modules.smarttension.mapper.SmartTensionSteelBeamDataMapper;
|
||||
import com.zhgd.xmgl.modules.smarttension.service.ISmartTensionSteelBeamDataService;
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 智能张拉-钢束数据
|
||||
@ -43,6 +48,25 @@ public class SmartTensionSteelBeamDataServiceImpl extends ServiceImpl<SmartTensi
|
||||
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<SmartTensionSteelBeamData> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<SmartTensionSteelBeamData> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartTensionSteelBeamData.class, paramMap);
|
||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(SmartTensionSteelBeamData::getId));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user