bug修改
This commit is contained in:
parent
ad13f5e8af
commit
8ee129e88b
@ -1,6 +1,8 @@
|
||||
package com.zhgd.xmgl.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -537,5 +539,42 @@ public class ParamEnum {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用状态:1正常2初级超标3中级超标4高级超标5异常
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum ConcreteMixStationDataUseStatusEnum implements BaseEnum {
|
||||
NORMAL(1, "正常"),
|
||||
PRIMARY_LEVEL_EXCEEDS_STANDARD(2, "初级超标"),
|
||||
INTERMEDIATE_LEVEL_EXCEEDS_STANDARD(3, "中级超标"),
|
||||
ADVANCED_EXCEEDING_STANDARD(4, "高级超标"),
|
||||
ABNORMAL(5, "异常"),
|
||||
;
|
||||
|
||||
ConcreteMixStationDataUseStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
private Integer value;
|
||||
private String desc;
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.concretemixstation.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationData;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.vo.CountConcreteMixStationDataVo;
|
||||
@ -146,9 +147,31 @@ public class ConcreteMixStationDataController {
|
||||
@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"),
|
||||
})
|
||||
@PostMapping(value = "/countConcreteMixStationData")
|
||||
public Result<CountConcreteMixStationDataVo> countConcreteMixStationData(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(concreteMixStationDataService.countConcreteMixStationData(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"),
|
||||
})
|
||||
@PostMapping(value = "/countUseStatus")
|
||||
public Result<SectorVo> countUseStatus(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(concreteMixStationDataService.countUseStatus(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 = "/countPowerLevel")
|
||||
public Result<SectorVo> countPowerLevel(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(concreteMixStationDataService.countPowerLevel(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.zhgd.xmgl.modules.concretemixstation.controller;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.service.IConcreteMixStationMaterialDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -136,4 +139,14 @@ public class ConcreteMixStationMaterialDataController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@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 = "/countMaterialName")
|
||||
public Result<SectorVo> countMaterialName(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(concreteMixStationMaterialDataService.countMaterialName(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@ public class CountConcreteMixStationDataVo {
|
||||
@ApiModelProperty(value = "总产量")
|
||||
private java.lang.Double totalOutput;
|
||||
@ApiModelProperty(value = "日盘数")
|
||||
private java.lang.Double dayNumber;
|
||||
private java.lang.Integer dayNumber;
|
||||
@ApiModelProperty(value = "总盘数")
|
||||
private java.lang.Double totalNumber;
|
||||
private java.lang.Integer totalNumber;
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package com.zhgd.xmgl.modules.concretemixstation.mapper;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationData;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.vo.CountConcreteMixStationDataVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@ -21,4 +23,8 @@ public interface ConcreteMixStationDataMapper extends BaseMapper<ConcreteMixStat
|
||||
List<TrendOneVo> countConcreteMixStationDataTrend(HashMap<String, Object> paramMap);
|
||||
|
||||
CountConcreteMixStationDataVo countConcreteMixStationData(HashMap<String, Object> paramMap);
|
||||
|
||||
ArrayList<SectorOneVo> countUseStatus(HashMap<String, Object> paramMap);
|
||||
|
||||
ArrayList<SectorOneVo> countPowerLevel(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
package com.zhgd.xmgl.modules.concretemixstation.mapper;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationMaterialData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 混凝土拌合站材料用量数据
|
||||
* @author: pds
|
||||
@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@Mapper
|
||||
public interface ConcreteMixStationMaterialDataMapper extends BaseMapper<ConcreteMixStationMaterialData> {
|
||||
|
||||
List<SectorOneVo> countMaterialName(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -32,11 +32,52 @@
|
||||
|
||||
<select id="countConcreteMixStationData"
|
||||
resultType="com.zhgd.xmgl.modules.concretemixstation.entity.vo.CountConcreteMixStationDataVo">
|
||||
select *
|
||||
select ifnull(sum(if(discharge_time > current_date, actual_quantity, 0)), 0) dailyOutput,
|
||||
ifnull(sum(actual_quantity), 0) totalOutput,
|
||||
ifnull(sum(if(discharge_time > current_date, 1, 0)), 0) dayNumber,
|
||||
count(*) totalNumber
|
||||
from concrete_mix_station_data
|
||||
where 1 = 1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countUseStatus" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select count(*) count,use_status enumType
|
||||
from concrete_mix_station_data
|
||||
where 1=1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
group by use_status
|
||||
</select>
|
||||
|
||||
<select id="countPowerLevel" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select power_level name,ifnull(sum(actual_quantity),0) count
|
||||
from concrete_mix_station_data
|
||||
where 1=1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
<if test="type == '1'.toString()">
|
||||
and discharge_time > current_date
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
and discharge_time > date_sub(discharge_time,interval 6 day)
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
and discharge_time > date_sub(discharge_time,interval 29 day)
|
||||
</if>
|
||||
group by power_level
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,4 +1,26 @@
|
||||
<?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.concretemixstation.mapper.ConcreteMixStationMaterialDataMapper">
|
||||
<select id="countMaterialName" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select material_name name,ifnull(sum(actual_amount),0) count
|
||||
from concrete_mix_station_material_data
|
||||
where 1=1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="devSn != null and devSn != ''">
|
||||
and dev_sn = #{devSn}
|
||||
</if>
|
||||
<if test="type == '1'.toString()">
|
||||
and create_date > current_date
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
and create_date > date_sub(create_date,interval 6 day)
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
and create_date > date_sub(create_date,interval 29 day)
|
||||
</if>
|
||||
group by material_name
|
||||
order by count desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.concretemixstation.service;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -28,4 +29,8 @@ public interface IConcreteMixStationDataService extends IService<ConcreteMixStat
|
||||
List<TrendVo> countConcreteMixStationDataTrend(HashMap<String, Object> paramMap);
|
||||
|
||||
CountConcreteMixStationDataVo countConcreteMixStationData(HashMap<String, Object> paramMap);
|
||||
|
||||
SectorVo countUseStatus(HashMap<String, Object> paramMap);
|
||||
|
||||
SectorVo countPowerLevel(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.concretemixstation.service;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationMaterialData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -22,4 +23,6 @@ public interface IConcreteMixStationMaterialDataService extends IService<Concret
|
||||
void add(ConcreteMixStationMaterialData concreteMixStationMaterialData);
|
||||
|
||||
void edit(ConcreteMixStationMaterialData concreteMixStationMaterialData);
|
||||
|
||||
SectorVo countMaterialName(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -6,8 +6,11 @@ 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.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.enums.ParamEnum;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationData;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationDev;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.vo.CountConcreteMixStationDataVo;
|
||||
@ -22,6 +25,7 @@ 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;
|
||||
@ -106,4 +110,16 @@ public class ConcreteMixStationDataServiceImpl extends ServiceImpl<ConcreteMixSt
|
||||
public CountConcreteMixStationDataVo countConcreteMixStationData(HashMap<String, Object> paramMap) {
|
||||
return baseMapper.countConcreteMixStationData(paramMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countUseStatus(HashMap<String, Object> paramMap) {
|
||||
ArrayList<SectorOneVo> list = baseMapper.countUseStatus(paramMap);
|
||||
return SectorVo.getSectorVoByEnum(list, ParamEnum.ConcreteMixStationDataUseStatusEnum.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countPowerLevel(HashMap<String, Object> paramMap) {
|
||||
ArrayList<SectorOneVo> list = baseMapper.countPowerLevel(paramMap);
|
||||
return SectorVo.getSectorVo(list);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.concretemixstation.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.entity.ConcreteMixStationMaterialData;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.mapper.ConcreteMixStationMaterialDataMapper;
|
||||
import com.zhgd.xmgl.modules.concretemixstation.service.IConcreteMixStationMaterialDataService;
|
||||
@ -66,4 +68,10 @@ public class ConcreteMixStationMaterialDataServiceImpl extends ServiceImpl<Concr
|
||||
public void edit(ConcreteMixStationMaterialData concreteMixStationMaterialData) {
|
||||
baseMapper.updateById(concreteMixStationMaterialData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countMaterialName(HashMap<String, Object> paramMap) {
|
||||
List<SectorOneVo> list = baseMapper.countMaterialName(paramMap);
|
||||
return SectorVo.getSectorVo(list);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user