Commit 796609fc authored by 耿迪迪's avatar 耿迪迪

充装统计

parent c8b4a711
...@@ -2,7 +2,10 @@ package com.zehong.web.controller.gasBottleTrack; ...@@ -2,7 +2,10 @@ package com.zehong.web.controller.gasBottleTrack;
import java.util.List; import java.util.List;
import com.zehong.system.domain.AirChargeOperatorStatistics;
import com.zehong.system.domain.AirChargeStationStatistics;
import com.zehong.system.domain.TGasUserInfo; import com.zehong.system.domain.TGasUserInfo;
import com.zehong.system.domain.vo.AirChargeStatisticsVo;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -127,4 +130,40 @@ public class TAirChargeRecordController extends BaseController ...@@ -127,4 +130,40 @@ public class TAirChargeRecordController extends BaseController
ExcelUtil<TAirChargeRecord> util = new ExcelUtil<>(TAirChargeRecord.class); ExcelUtil<TAirChargeRecord> util = new ExcelUtil<>(TAirChargeRecord.class);
return util.importTemplateExcel("充装记录数据"); return util.importTemplateExcel("充装记录数据");
} }
/**
* 储配站充装统计
* @param airChargeStatisticsVo 统计实体
* @return
*/
@GetMapping("/airChargeStationStatistics")
public TableDataInfo airChargeStationStatistics(AirChargeStatisticsVo airChargeStatisticsVo){
startPage();
return getDataTable(tAirChargeRecordService.airChargeStationStatistics(airChargeStatisticsVo));
}
@GetMapping("/airChargeStationStatisticExport")
public AjaxResult airChargeStationStatisticExport(AirChargeStatisticsVo airChargeStatisticsVo){
List<AirChargeStationStatistics> list = tAirChargeRecordService.airChargeStationStatistics(airChargeStatisticsVo);
ExcelUtil<AirChargeStationStatistics> util = new ExcelUtil<>(AirChargeStationStatistics.class);
return util.exportExcel(list, "充装统计数据");
}
/**
* 充装人员统计
* @param airChargeStatisticsVo 统计
* @return
*/
@GetMapping("/airChargeOperatorStatistics")
public TableDataInfo airChargeOperatorStatistics(AirChargeStatisticsVo airChargeStatisticsVo){
startPage();
return getDataTable(tAirChargeRecordService.airChargeOperatorStatistics(airChargeStatisticsVo));
}
@GetMapping("/airChargeOperatorStatisticsExport")
public AjaxResult airChargeOperatorStatisticsExport(AirChargeStatisticsVo airChargeStatisticsVo){
List<AirChargeOperatorStatistics> list = tAirChargeRecordService.airChargeOperatorStatistics(airChargeStatisticsVo);
ExcelUtil<AirChargeOperatorStatistics> util = new ExcelUtil<>(AirChargeOperatorStatistics.class);
return util.exportExcel(list, "充装统计数据");
}
} }
package com.zehong.system.domain;
import com.zehong.common.annotation.Excel;
/**
* @author geng
* 充装人员统计
*/
public class AirChargeOperatorStatistics extends AirChargeStationStatistics {
/**充装人*/
@Excel(name = "充装人")
private String operator;
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
}
package com.zehong.system.domain;
import com.zehong.common.annotation.Excel;
/**
* @author geng
* 充装储配站统计
*/
public class AirChargeStationStatistics {
private Long StationId;
/**储配站*/
@Excel(name = "储配站")
private String stationName;
/**充装气瓶数*/
@Excel(name = "充装气瓶数")
private Integer bottleNum;
/**充装总量*/
@Excel(name = "充装总量")
private Integer chargeMeasure;
/**充装统计类型*/
private String statisticsType;
public Long getStationId() {
return StationId;
}
public void setStationId(Long stationId) {
StationId = stationId;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public Integer getBottleNum() {
return bottleNum;
}
public void setBottleNum(Integer bottleNum) {
this.bottleNum = bottleNum;
}
public Integer getChargeMeasure() {
return chargeMeasure;
}
public void setChargeMeasure(Integer chargeMeasure) {
this.chargeMeasure = chargeMeasure;
}
public String getStatisticsType() {
return statisticsType;
}
public void setStatisticsType(String statisticsType) {
this.statisticsType = statisticsType;
}
}
package com.zehong.system.domain.vo;
import java.util.Date;
public class AirChargeStatisticsVo {
private Long StationId;
/**充装人*/
private String operator;
private String statisticsType;
private Date operateBeginTime;
private Date operateEndTime;
public Long getStationId() {
return StationId;
}
public void setStationId(Long stationId) {
StationId = stationId;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public String getStatisticsType() {
return statisticsType;
}
public void setStatisticsType(String statisticsType) {
this.statisticsType = statisticsType;
}
public Date getOperateBeginTime() {
return operateBeginTime;
}
public void setOperateBeginTime(Date operateBeginTime) {
this.operateBeginTime = operateBeginTime;
}
public Date getOperateEndTime() {
return operateEndTime;
}
public void setOperateEndTime(Date operateEndTime) {
this.operateEndTime = operateEndTime;
}
}
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import com.zehong.system.domain.AirChargeOperatorStatistics;
import com.zehong.system.domain.AirChargeStationStatistics;
import com.zehong.system.domain.TAirChargeRecord; import com.zehong.system.domain.TAirChargeRecord;
import com.zehong.system.domain.vo.AirChargeStatisticsVo;
import java.util.List;
/** /**
* 充装记录Mapper接口 * 充装记录Mapper接口
...@@ -58,4 +62,18 @@ public interface TAirChargeRecordMapper ...@@ -58,4 +62,18 @@ public interface TAirChargeRecordMapper
* @return 结果 * @return 结果
*/ */
public int deleteTAirChargeRecordByIds(Long[] chargeRecordIds); public int deleteTAirChargeRecordByIds(Long[] chargeRecordIds);
/**
* 储配站充装统计
* @param airChargeStatisticsVo 统计实体
* @return
*/
List<AirChargeStationStatistics> airChargeStationStatistics(AirChargeStatisticsVo airChargeStatisticsVo);
/**
* 充装人员统计
* @param airChargeStatisticsVo 统计
* @return
*/
List<AirChargeOperatorStatistics> airChargeOperatorStatistics(AirChargeStatisticsVo airChargeStatisticsVo);
} }
package com.zehong.system.service; package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.AirChargeOperatorStatistics;
import com.zehong.system.domain.AirChargeStationStatistics;
import com.zehong.system.domain.TAirChargeRecord; import com.zehong.system.domain.TAirChargeRecord;
import com.zehong.system.domain.vo.AirChargeStatisticsVo;
/** /**
* 充装记录Service接口 * 充装记录Service接口
...@@ -66,4 +70,18 @@ public interface ITAirChargeRecordService ...@@ -66,4 +70,18 @@ public interface ITAirChargeRecordService
* @return * @return
*/ */
String importAirChargeRecordInfo(List<TAirChargeRecord> airChargeRecordList, boolean isUpdateSupport); String importAirChargeRecordInfo(List<TAirChargeRecord> airChargeRecordList, boolean isUpdateSupport);
/**
* 储配站充装统计
* @param airChargeStatisticsVo 统计实体
* @return
*/
List<AirChargeStationStatistics> airChargeStationStatistics(AirChargeStatisticsVo airChargeStatisticsVo);
/**
* 充装人员统计
* @param airChargeStatisticsVo 统计
* @return
*/
List<AirChargeOperatorStatistics> airChargeOperatorStatistics(AirChargeStatisticsVo airChargeStatisticsVo);
} }
...@@ -3,10 +3,8 @@ package com.zehong.system.service.impl; ...@@ -3,10 +3,8 @@ package com.zehong.system.service.impl;
import com.zehong.common.exception.CustomException; import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TAirChargeRecord; import com.zehong.system.domain.*;
import com.zehong.system.domain.TGasBottleInfo; import com.zehong.system.domain.vo.AirChargeStatisticsVo;
import com.zehong.system.domain.TGasStorageStationInfo;
import com.zehong.system.domain.TPractitionerInfo;
import com.zehong.system.mapper.TAirChargeRecordMapper; import com.zehong.system.mapper.TAirChargeRecordMapper;
import com.zehong.system.mapper.TGasBottleInfoMapper; import com.zehong.system.mapper.TGasBottleInfoMapper;
import com.zehong.system.mapper.TGasStorageStationInfoMapper; import com.zehong.system.mapper.TGasStorageStationInfoMapper;
...@@ -191,4 +189,24 @@ public class TAirChargeRecordServiceImpl implements ITAirChargeRecordService ...@@ -191,4 +189,24 @@ public class TAirChargeRecordServiceImpl implements ITAirChargeRecordService
} }
return successMsg.toString(); return successMsg.toString();
} }
/**
* 储配站充装统计
* @param airChargeStatisticsVo 统计实体
* @return
*/
@Override
public List<AirChargeStationStatistics> airChargeStationStatistics(AirChargeStatisticsVo airChargeStatisticsVo){
return tAirChargeRecordMapper.airChargeStationStatistics(airChargeStatisticsVo);
}
/**
* 充装人员统计
* @param airChargeStatisticsVo 统计
* @return
*/
@Override
public List<AirChargeOperatorStatistics> airChargeOperatorStatistics(AirChargeStatisticsVo airChargeStatisticsVo){
return tAirChargeRecordMapper.airChargeOperatorStatistics(airChargeStatisticsVo);
}
} }
...@@ -117,4 +117,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -117,4 +117,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{chargeRecordId} #{chargeRecordId}
</foreach> </foreach>
</delete> </delete>
<select id="airChargeStationStatistics" parameterType="com.zehong.system.domain.vo.AirChargeStatisticsVo" resultType="com.zehong.system.domain.AirChargeStationStatistics">
select
station.station_name as stationName,
count(air.charge_record_id)as bottleNum,
sum(air.charge_measure) as chargeMeasure
from
t_air_charge_record air
left join t_gas_storage_station_info station on station.station_id = air.station_id
left join t_gas_bottle_info bottle on bottle.bottle_id = air.bottle_id
left join t_practitioner_info pr ON pr.practitioner_id = air.charge_operator
<where>
<if test="stationId != null">
and air.station_id = #{stationId}
</if>
<if test="operator != null">
and pr.name like concat('%', #{operator}, '%')
</if>
<if test="operateBeginTime != null and operateEndTime != null" >
and air.charge_date between #{operateBeginTime} and #{operateEndTime}
</if>
</where>
group by air.station_id
</select>
<select id="airChargeOperatorStatistics" parameterType="com.zehong.system.domain.vo.AirChargeStatisticsVo" resultType="com.zehong.system.domain.AirChargeOperatorStatistics">
select
station.station_name as stationName,
count(air.charge_record_id)as bottleNum,
sum(air.charge_measure) as chargeMeasure,
pr.name as operator
from
t_air_charge_record air
left join t_gas_storage_station_info station on station.station_id = air.station_id
left join t_gas_bottle_info bottle on bottle.bottle_id = air.bottle_id
left join t_practitioner_info pr ON pr.practitioner_id = air.charge_operator
<where>
<if test="stationId != null">
and air.station_id = #{stationId}
</if>
<if test="operator != null">
and pr.name like concat('%', #{operator}, '%')
</if>
<if test="operateBeginTime != null and operateEndTime != null" >
and air.charge_date between #{operateBeginTime} and #{operateEndTime}
</if>
</where>
group by air.station_id,air.charge_operator
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment