Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety-progress
Commits
3e34d9c1
Commit
3e34d9c1
authored
Aug 25, 2023
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
气瓶统计
parent
155c72ef
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
151 additions
and
3 deletions
+151
-3
TGasBottleInfoController.java
...b/controller/gasBottleTrack/TGasBottleInfoController.java
+15
-0
BottleStatistics.java
.../main/java/com/zehong/system/domain/BottleStatistics.java
+77
-0
TGasBottleInfoMapper.java
...n/java/com/zehong/system/mapper/TGasBottleInfoMapper.java
+10
-1
ITGasBottleInfoService.java
...ava/com/zehong/system/service/ITGasBottleInfoService.java
+10
-1
TGasBottleInfoServiceImpl.java
...zehong/system/service/impl/TGasBottleInfoServiceImpl.java
+11
-0
TGasBottleInfoMapper.xml
...src/main/resources/mapper/system/TGasBottleInfoMapper.xml
+27
-0
TGasStorageStationInfoMapper.xml
.../resources/mapper/system/TGasStorageStationInfoMapper.xml
+1
-1
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/gasBottleTrack/TGasBottleInfoController.java
View file @
3e34d9c1
...
...
@@ -6,6 +6,7 @@ import com.zehong.common.core.domain.AjaxResult;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.system.domain.BottleStatistics
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
com.zehong.system.service.ITGasBottleInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -119,4 +120,18 @@ public class TGasBottleInfoController extends BaseController
ExcelUtil
<
TGasBottleInfo
>
util
=
new
ExcelUtil
<>(
TGasBottleInfo
.
class
);
return
util
.
importTemplateExcel
(
"气瓶数据"
);
}
@GetMapping
(
"/bottleStatistics"
)
public
TableDataInfo
bottleStatistics
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
Long
stationId
){
startPage
();
return
getDataTable
(
tGasBottleInfoService
.
bottleStatistics
(
stationId
));
}
@GetMapping
(
"/bottleStatisticsExport"
)
public
AjaxResult
bottleStatisticsExport
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
Long
stationId
)
{
List
<
BottleStatistics
>
statistics
=
tGasBottleInfoService
.
bottleStatistics
(
stationId
);
ExcelUtil
<
BottleStatistics
>
util
=
new
ExcelUtil
<>(
BottleStatistics
.
class
);
return
util
.
exportExcel
(
statistics
,
"气瓶信息数据"
);
}
}
gassafetyprogress-system/src/main/java/com/zehong/system/domain/BottleStatistics.java
0 → 100644
View file @
3e34d9c1
package
com
.
zehong
.
system
.
domain
;
import
com.zehong.common.annotation.Excel
;
public
class
BottleStatistics
{
/** 储配站主键*/
private
Long
stationId
;
/** 储配站*/
@Excel
(
name
=
"储配站"
)
private
String
stationName
;
/** 气瓶数量*/
@Excel
(
name
=
"气瓶数量"
)
private
Integer
totalNum
;
/** 正常数量*/
@Excel
(
name
=
"正常数量"
)
private
Integer
normalNum
;
/** 逾期数量*/
@Excel
(
name
=
"逾期数量"
)
private
Integer
overNum
;
/** 报废数量*/
@Excel
(
name
=
"报废数量"
)
private
Integer
junkNum
;
public
Long
getStationId
()
{
return
stationId
;
}
public
void
setStationId
(
Long
stationId
)
{
this
.
stationId
=
stationId
;
}
public
String
getStationName
()
{
return
stationName
;
}
public
void
setStationName
(
String
stationName
)
{
this
.
stationName
=
stationName
;
}
public
Integer
getTotalNum
()
{
return
totalNum
;
}
public
void
setTotalNum
(
Integer
totalNum
)
{
this
.
totalNum
=
totalNum
;
}
public
Integer
getNormalNum
()
{
return
normalNum
;
}
public
void
setNormalNum
(
Integer
normalNum
)
{
this
.
normalNum
=
normalNum
;
}
public
Integer
getOverNum
()
{
return
overNum
;
}
public
void
setOverNum
(
Integer
overNum
)
{
this
.
overNum
=
overNum
;
}
public
Integer
getJunkNum
()
{
return
junkNum
;
}
public
void
setJunkNum
(
Integer
junkNum
)
{
this
.
junkNum
=
junkNum
;
}
}
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TGasBottleInfoMapper.java
View file @
3e34d9c1
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.BottleStatistics
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
java.util.List
;
/**
* 气瓶信息Mapper接口
*
...
...
@@ -58,4 +60,11 @@ public interface TGasBottleInfoMapper
* @return 结果
*/
public
int
deleteTGasBottleInfoByIds
(
Long
[]
bottleIds
);
/**
* 气瓶统计
* @param stationId 储配站id
* @return
*/
List
<
BottleStatistics
>
bottleStatistics
(
Long
stationId
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/ITGasBottleInfoService.java
View file @
3e34d9c1
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.BottleStatistics
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
java.util.List
;
/**
* 气瓶信息Service接口
*
...
...
@@ -66,4 +68,11 @@ public interface ITGasBottleInfoService
* @return
*/
String
importTGasBottleInfo
(
List
<
TGasBottleInfo
>
tGasBottleInfoList
,
Boolean
isUpdateSupport
);
/**
* 气瓶统计
* @param stationId 储配站id
* @return
*/
List
<
BottleStatistics
>
bottleStatistics
(
Long
stationId
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/impl/TGasBottleInfoServiceImpl.java
View file @
3e34d9c1
...
...
@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import
com.zehong.common.exception.CustomException
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.BottleStatistics
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
com.zehong.system.domain.TGasStorageStationInfo
;
import
com.zehong.system.mapper.TGasBottleInfoMapper
;
...
...
@@ -174,4 +175,14 @@ public class TGasBottleInfoServiceImpl implements ITGasBottleInfoService
}
return
successMsg
.
toString
();
}
/**
* 气瓶统计
* @param stationId 储配站id
* @return
*/
@Override
public
List
<
BottleStatistics
>
bottleStatistics
(
Long
stationId
){
return
tGasBottleInfoMapper
.
bottleStatistics
(
stationId
);
}
}
gassafetyprogress-system/src/main/resources/mapper/system/TGasBottleInfoMapper.xml
View file @
3e34d9c1
...
...
@@ -213,4 +213,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{bottleId}
</foreach>
</delete>
<select
id=
"bottleStatistics"
parameterType=
"java.lang.Long"
resultType=
"com.zehong.system.domain.BottleStatistics"
>
select
(select station_name from t_gas_storage_station_info info where info.station_id = final.station_id) as stationName,
sum(final.totalNum) as totalNum,
sum(final.normalNum) as normalNum,
sum(final.overNum) as overNum,
sum(final.junkNum) as junkNum
from(
select
base.station_id,
count(1) as totalNum,
case bottle_status when '1' then count(1) else 0 end as normalNum,
case bottle_status when '2' then count(1) else 0 end as overNum,
case bottle_status when '3' then count(1) else 0 end as junkNum
from
t_gas_bottle_info base
<where>
<if
test=
"stationId != null"
>
base.station_id = #{stationId}
</if>
</where>
group by
base.station_id,base.bottle_status
)final
group by final.station_id
</select>
</mapper>
\ No newline at end of file
gassafetyprogress-system/src/main/resources/mapper/system/TGasStorageStationInfoMapper.xml
View file @
3e34d9c1
...
...
@@ -119,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select
id=
"baseInfoStatistics"
parameterType=
"java.lang.
Stri
ng"
resultType=
"com.zehong.system.domain.BaseInfoStatistics"
>
<select
id=
"baseInfoStatistics"
parameterType=
"java.lang.
Lo
ng"
resultType=
"com.zehong.system.domain.BaseInfoStatistics"
>
SELECT
station.station_name as stationName,
(SELECT COUNT(1) FROM t_gas_bottle_info bottle WHERE bottle.station_id = station.station_id)as totalBottle,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment