压力试验机
This commit is contained in:
parent
822122c754
commit
a68423703d
@ -1,5 +1,8 @@
|
||||
package com.zhgd.xmgl.modules.pressuretest.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 com.zhgd.xmgl.modules.pressuretest.service.IPressureTestMachineManageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -174,4 +177,35 @@ public class PressureTestMachineManageController {
|
||||
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<List<TrendOneVo>> countStatus(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(pressureTestMachineManageService.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<SectorVo> countTestType(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(pressureTestMachineManageService.countTestType(paramMap));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计压力试验机-管理(实时监测)", notes = "统计压力试验机-管理(实时监测)", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countPressureTestMachineManage")
|
||||
public Result<CountAntiPressureFoldManageVo> countPressureTestMachineManage(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(pressureTestMachineManageService.countPressureTestMachineManage(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.vo.CountAntiPressureFoldManageVo;
|
||||
import com.zhgd.xmgl.modules.pressuretest.entity.PressureTestMachineManage;
|
||||
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 PressureTestMachineManageMapper extends BaseMapper<PressureTest
|
||||
List<PressureTestMachineManage> queryList(@Param(Constants.WRAPPER) QueryWrapper<PressureTestMachineManage> queryWrapper);
|
||||
|
||||
IPage<PressureTestMachineManage> queryList(Page<PressureTestMachineManage> page, @Param(Constants.WRAPPER) QueryWrapper<PressureTestMachineManage> queryWrapper);
|
||||
|
||||
List<TrendOneVo> countStatus(HashMap<String, Object> paramMap);
|
||||
|
||||
List<SectorOneVo> countTestType(HashMap<String, Object> paramMap);
|
||||
|
||||
CountAntiPressureFoldManageVo countPressureTestMachineManage(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -6,4 +6,65 @@
|
||||
join pressure_test_machine_dev ptmd on ptmd.dev_sn=ptmm.dev_sn
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="countStatus" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
|
||||
select
|
||||
<if test="type == '1'.toString()">
|
||||
date_format(test_time,'%Y-%m-%d %H:00') x,
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
date_format(test_time,'%Y-%m-%d') x,
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
date_format(test_time,'%Y-%m-%d') x,
|
||||
</if>
|
||||
count(*) y from pressure_test_machine_manage
|
||||
where project_sn=#{projectSn}
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
<if test="type == '1'.toString()">
|
||||
and test_time > current_date
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
and test_time > date_sub(test_time,interval 6 day)
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
and test_time > date_sub(test_time,interval 29 day)
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
group by x
|
||||
</select>
|
||||
|
||||
<select id="countTestType" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select test_type enumType,count(*) count
|
||||
from pressure_test_machine_manage
|
||||
where project_sn=#{projectSn}
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
<if test="type == '1'.toString()">
|
||||
and test_time > current_date
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
and test_time > date_sub(test_time,interval 6 day)
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
and test_time > date_sub(test_time,interval 29 day)
|
||||
</if>
|
||||
group by test_type
|
||||
</select>
|
||||
|
||||
<select id="countPressureTestMachineManage"
|
||||
resultType="com.zhgd.xmgl.modules.antipressurefold.entity.vo.CountAntiPressureFoldManageVo">
|
||||
select count(*) testTotalNum,
|
||||
ifnull(sum(if(test_time>current_date,1,0)),0) testTodayNum
|
||||
from pressure_test_machine_manage
|
||||
where project_sn=#{projectSn}
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.zhgd.xmgl.modules.pressuretest.service;
|
||||
|
||||
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 com.zhgd.xmgl.modules.pressuretest.entity.PressureTestMachineManage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -20,4 +23,10 @@ public interface IPressureTestMachineManageService extends IService<PressureTest
|
||||
List<PressureTestMachineManage> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
PressureTestMachineManage queryById(String id);
|
||||
|
||||
List<TrendOneVo> countStatus(HashMap<String, Object> paramMap);
|
||||
|
||||
SectorVo countTestType(HashMap<String, Object> paramMap);
|
||||
|
||||
CountAntiPressureFoldManageVo countPressureTestMachineManage(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -6,6 +6,10 @@ 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.vo.CountAntiPressureFoldManageVo;
|
||||
import com.zhgd.xmgl.modules.pressuretest.entity.PressureTestMachineManage;
|
||||
import com.zhgd.xmgl.modules.pressuretest.entity.PressureTestMachineManageBlockData;
|
||||
import com.zhgd.xmgl.modules.pressuretest.entity.PressureTestMachineManageBlockNumber;
|
||||
@ -13,14 +17,17 @@ import com.zhgd.xmgl.modules.pressuretest.mapper.PressureTestMachineManageBlockD
|
||||
import com.zhgd.xmgl.modules.pressuretest.mapper.PressureTestMachineManageBlockNumberMapper;
|
||||
import com.zhgd.xmgl.modules.pressuretest.mapper.PressureTestMachineManageMapper;
|
||||
import com.zhgd.xmgl.modules.pressuretest.service.IPressureTestMachineManageService;
|
||||
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.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 试验检测管理
|
||||
@ -63,6 +70,37 @@ public class PressureTestMachineManageServiceImpl extends ServiceImpl<PressureTe
|
||||
return manage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrendOneVo> countStatus(HashMap<String, Object> paramMap) {
|
||||
Integer type = MapUtils.getInteger(paramMap, "type");
|
||||
String format = null;
|
||||
List<String> 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<TrendOneVo> list = baseMapper.countStatus(paramMap);
|
||||
return TrendOneVo.fillTrendVos(list, dateTimeStrList, format);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countTestType(HashMap<String, Object> paramMap) {
|
||||
return SectorVo.getSectorVoByEnum(baseMapper.countTestType(paramMap), ParamEnum.UniversalTestManageTestTypeEnum.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CountAntiPressureFoldManageVo countPressureTestMachineManage(HashMap<String, Object> paramMap) {
|
||||
return baseMapper.countPressureTestMachineManage(paramMap);
|
||||
}
|
||||
|
||||
private QueryWrapper<PressureTestMachineManage> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "ptmm.";
|
||||
QueryWrapper<PressureTestMachineManage> queryWrapper = QueryGenerator.initPageQueryWrapper(PressureTestMachineManage.class, paramMap, alias);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user