Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
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
wangweidong
patzn-cloud-service-hmhj
Commits
81133afa
Commit
81133afa
authored
Jul 15, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
相关大屏统计查询;
parent
7ab18466
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
328 additions
and
17 deletions
+328
-17
NoticeAnnouncementController.java
...ce/lims/hmhj/controller/NoticeAnnouncementController.java
+7
-1
StatisticsController.java
...ud/service/lims/hmhj/controller/StatisticsController.java
+93
-2
NoticeAnnouncementMapper.java
...ud/service/lims/hmhj/mapper/NoticeAnnouncementMapper.java
+14
-1
StatisticsMapper.java
...atzn/cloud/service/lims/hmhj/mapper/StatisticsMapper.java
+45
-2
INoticeAnnouncementService.java
...service/lims/hmhj/service/INoticeAnnouncementService.java
+2
-0
IStatisticsService.java
...n/cloud/service/lims/hmhj/service/IStatisticsService.java
+24
-1
NoticeAnnouncementServiceImpl.java
...lims/hmhj/service/impl/NoticeAnnouncementServiceImpl.java
+6
-1
StatisticsServiceImpl.java
...service/lims/hmhj/service/impl/StatisticsServiceImpl.java
+125
-9
NoticeAnnouncementMapper.xml
src/main/resources/mapper/hmhj/NoticeAnnouncementMapper.xml
+12
-0
StatisticsMapper.xml
src/main/resources/mapper/hmhj/StatisticsMapper.xml
+0
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/NoticeAnnouncementController.java
View file @
81133afa
...
...
@@ -81,9 +81,15 @@ public class NoticeAnnouncementController extends ServiceController {
})
@PostMapping
(
"/recent/"
)
public
RestResult
<
List
<
NoticeAnnouncement
>>
recent
(
@RequestParam
(
value
=
"count"
,
required
=
false
)
Integer
count
)
{
@RequestParam
(
value
=
"count"
,
required
=
false
)
Integer
count
)
{
if
(
count
==
null
)
count
=
3
;
return
success
(
noticeAnnouncementService
.
recent
(
count
));
}
@ApiOperation
(
"显示最新 N 条通知公告"
)
@PostMapping
(
"/latest"
)
public
RestResult
<
List
<
NoticeAnnouncement
>>
latestNotices
(
Integer
limit
)
{
return
success
(
noticeAnnouncementService
.
latestNotices
(
limit
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/StatisticsController.java
View file @
81133afa
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.kisso.annotation.Action
;
import
com.baomidou.kisso.annotation.Login
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.commons.toolkit.DateUtils
;
import
com.patzn.cloud.service.hmhj.dto.LedgerQueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.RangeStatsQueryDTO
;
...
...
@@ -14,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -32,17 +36,40 @@ public class StatisticsController extends ServiceController {
}
@ApiOperation
(
"阳极检查量统计"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/anode_inspection_quantity"
)
public
RestResult
<
List
<
Statistics
>
>
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
)
{
public
RestResult
<
Integer
>
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getAnodeInspectionQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取阳极检查量合格率"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/anode_inspection_done_quantity"
)
public
RestResult
<
Statistics
>
getAnodeInspectionDoneQuantity
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getAnodeInspectionDoneQuantity
(
queryDTO
));
}
@ApiOperation
(
"报告发放量统计"
)
@PostMapping
(
"/report_send_quantity"
)
@Login
(
action
=
Action
.
Skip
)
public
RestResult
<
Map
<
String
,
Object
>>
getReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
return
success
(
statsService
.
getReportSendQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取报告发放量数据统计"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/month_report_send_quantity"
)
public
RestResult
<
Map
<
String
,
Object
>>
getMonthReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
return
success
(
statsService
.
getMonthReportSendQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取报告发放量同比环比数据"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/sames_chain_report_send_quantity"
)
public
RestResult
<
Statistics
>
getSamesChainReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
return
success
(
statsService
.
getSamesChainReportSendQuantity
(
queryDTO
));
}
@ApiOperation
(
"检测项目数量统计"
)
@PostMapping
(
"/item_quantity"
)
...
...
@@ -52,11 +79,47 @@ public class StatisticsController extends ServiceController {
@ApiOperation
(
"取样量统计"
)
@PostMapping
(
"/sampling_quantity"
)
@Login
(
action
=
Action
.
Skip
)
public
RestResult
<
List
<
Statistics
>>
getSamplingQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
return
success
(
statsService
.
getSamplingQuantity
(
queryDTO
));
}
@ApiOperation
(
"外检完成量统计"
)
@ApiOperation
(
"获取取样量统计数据"
)
@PostMapping
(
"/total_sampling_quantity"
)
@Login
(
action
=
Action
.
Skip
)
public
RestResult
<
Integer
>
getTotalSamplingQuantity
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getTotalSamplingQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取铝成品检查数量"
)
@PostMapping
(
"/al_pro_inspection_quantity"
)
@Login
(
action
=
Action
.
Skip
)
public
RestResult
<
Integer
>
getAlProductInspectionQuantity
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getAlProductInspectionQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取铝成品检查量合格率数据"
)
@PostMapping
(
"/al_pro_inspection_quantity_rate"
)
@Login
(
action
=
Action
.
Skip
)
public
RestResult
<
Statistics
>
getAlProductInspectionQuantityRate
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getAlProductInspectionQuantityRate
(
queryDTO
));
}
@ApiOperation
(
"获取验收工作量同比环比数据"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/accept_sames_chain_quantity"
)
public
RestResult
<
Statistics
>
getAcceptSamesChainQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
return
success
(
statsService
.
getAcceptSamesChainQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取项目委托量同比环比数据"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/item_sames_chain_quantity"
)
public
RestResult
<
Statistics
>
getItemSamesChainQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
return
success
(
statsService
.
getItemSamesChainQuantity
(
queryDTO
));
}
@ApiOperation
(
"获取外检完成量数据"
)
@PostMapping
(
"/out_test_finish_quantity"
)
public
RestResult
<
Statistics
>
getOutTestFinishQuantity
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getOutTestFinishQuantity
(
queryDTO
));
...
...
@@ -80,6 +143,20 @@ public class StatisticsController extends ServiceController {
return
success
(
statsService
.
getCurWeekAcceptanceQualified
(
queryDTO
));
}
@ApiOperation
(
"上周验收合格情况"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/prev_week_acceptance_qualified"
)
public
RestResult
<
List
<
Statistics
>>
getPrevWeekAcceptanceQualified
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getPrevWeekAcceptanceQualified
(
queryDTO
));
}
@ApiOperation
(
"获取某个时间段验收合格情况"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/frame_acceptance_qualified"
)
public
RestResult
<
Statistics
>
getFrameAcceptanceQualified
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getAcceptanceQualifiedByTimeFrame
(
queryDTO
));
}
@ApiOperation
(
"本周自产炭块质量统计"
)
@PostMapping
(
"/cur_week_carbon_blocks"
)
public
RestResult
<
List
<
Statistics
>>
getCurWeekCarbonBlocks
(
QueryDTO
queryDTO
)
{
...
...
@@ -92,6 +169,14 @@ public class StatisticsController extends ServiceController {
return
success
(
statsService
.
getAlBrandsRate
(
queryDTO
));
}
@ApiOperation
(
"昨日原铝质量统计"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/prev_al_brands_rate"
)
public
RestResult
<
List
<
Statistics
>>
getPrevAlBrandsRate
(
QueryDTO
queryDTO
)
{
queryDTO
.
setQueryDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
1
));
return
success
(
statsService
.
getPrevAlBrandsRate
(
queryDTO
));
}
@ApiOperation
(
"原铝品味台账"
)
@PostMapping
(
"/al_grade_ledger"
)
public
RestResult
<
List
<
Map
>>
getAlGradeLedger
(
LedgerQueryDTO
ledgerQueryDTO
)
{
...
...
@@ -129,4 +214,10 @@ public class StatisticsController extends ServiceController {
return
success
(
statsService
.
getSummaryLedgerStats
(
ledgerQueryDTO
));
}
@ApiOperation
(
"获取检测项目委托量统计数据"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/test_item_quantity_stats"
)
public
RestResult
<
Statistics
>
getTestItemQuantityStats
(
QueryDTO
queryDTO
)
{
return
success
(
statsService
.
getTestItemQuantityStats
(
queryDTO
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/NoticeAnnouncementMapper.java
View file @
81133afa
...
...
@@ -16,6 +16,19 @@ import java.util.List;
*/
public
interface
NoticeAnnouncementMapper
extends
BatchMapper
<
NoticeAnnouncement
>
{
/* 最近的count条数据 */
/**
* 最近的count条数据 .
*
* @param count the count
* @return the list
*/
List
<
NoticeAnnouncement
>
recent
(
@Param
(
"count"
)
Integer
count
);
/**
* Select last notices list.
*
* @param limit the limit
* @return the list
*/
List
<
NoticeAnnouncement
>
selectLatestNotices
(
@Param
(
"limit"
)
Integer
limit
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/StatisticsMapper.java
View file @
81133afa
...
...
@@ -13,26 +13,52 @@ import java.util.List;
public
interface
StatisticsMapper
extends
BatchMapper
<
Statistics
>
{
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectAlBrandsRateStats
(
@Param
(
"vo"
)
QueryDTO
dto
);
@SqlParser
(
filter
=
true
)
Integer
selectAlBrandLowFeStats
(
@Param
(
"vo"
)
QueryDTO
dto
);
@SqlParser
(
filter
=
true
)
Statistics
selectOutTestFinishQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectCurWeekCarbonBlocks
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
List
<
Statistics
>
selectCurWeekAcceptanceQualified
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectAcceptanceQualifiedByDate
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectAcceptanceQualifiedByTimeFrame
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectWorkloadQuantity
(
@Param
(
"vo"
)
RangeStatsQueryDTO
workloadStatsQueryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectOutTestItemQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectSamplingQuantity
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Integer
selectTotalSamplingQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Integer
selectAlProductInspectionQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectItemQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectReportSendQuantityMonth
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
Statistics
selectReportSendQuantity
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectReportSendQuantitySamesChain
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Integer
selectReportSendQuantityTotal
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
List
<
Statistics
>
selectEntrustedQuantity
(
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
...
...
@@ -50,4 +76,21 @@ public interface StatisticsMapper extends BatchMapper<Statistics> {
@SqlParser
(
filter
=
true
)
List
<
DailyStatsLedgerVO
>
selectAlImpurityLedgerStats
(
@Param
(
"vo"
)
LedgerQueryDTO
ledgerQueryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectTestItemQuantityStats
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectAcceptSamesChainQuantity
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectItemSamesChainQuantity
(
@Param
(
"vo"
)
RangeStatsQueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Integer
selectAnodeInspectionQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectAnodeInspectionDoneQuantity
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
@SqlParser
(
filter
=
true
)
Statistics
selectAlProductInspectionQuantityRate
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/INoticeAnnouncementService.java
View file @
81133afa
...
...
@@ -21,4 +21,6 @@ public interface INoticeAnnouncementService extends IBaseService<NoticeAnnouncem
boolean
updateAndRecord
(
NoticeAnnouncement
noticeAnnouncement
);
List
<
NoticeAnnouncement
>
recent
(
Integer
count
);
List
<
NoticeAnnouncement
>
latestNotices
(
Integer
limit
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IStatisticsService.java
View file @
81133afa
...
...
@@ -15,16 +15,26 @@ public interface IStatisticsService extends IBaseService<Statistics> {
*/
List
<
Statistics
>
getAlBrandsRate
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getPrevAlBrandsRate
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getEntrustedQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
);
Integer
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
);
Statistics
getAnodeInspectionDoneQuantity
(
QueryDTO
queryDTO
);
Map
<
String
,
Object
>
getReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
);
Map
<
String
,
Object
>
getMonthReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
);
Statistics
getSamesChainReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
);
List
<
Statistics
>
getItemQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getSamplingQuantity
(
RangeStatsQueryDTO
queryDTO
);
Statistics
getItemSamesChainQuantity
(
RangeStatsQueryDTO
queryDTO
);
Statistics
getOutTestFinishQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getOutTestItemQuantity
(
QueryDTO
queryDTO
);
...
...
@@ -33,6 +43,10 @@ public interface IStatisticsService extends IBaseService<Statistics> {
List
<
Statistics
>
getCurWeekAcceptanceQualified
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getPrevWeekAcceptanceQualified
(
QueryDTO
queryDTO
);
Statistics
getAcceptanceQualifiedByTimeFrame
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getCurWeekCarbonBlocks
(
QueryDTO
queryDTO
);
List
<
Map
>
getAlGradeLedger
(
LedgerQueryDTO
ledgerQueryDTO
);
...
...
@@ -47,4 +61,13 @@ public interface IStatisticsService extends IBaseService<Statistics> {
List
<
Map
>
getSummaryLedgerStats
(
LedgerQueryDTO
ledgerQueryDTO
);
Statistics
getTestItemQuantityStats
(
QueryDTO
queryDTO
);
Statistics
getAcceptSamesChainQuantity
(
RangeStatsQueryDTO
queryDTO
);
Integer
getTotalSamplingQuantity
(
QueryDTO
queryDTO
);
Integer
getAlProductInspectionQuantity
(
QueryDTO
queryDTO
);
Statistics
getAlProductInspectionQuantityRate
(
QueryDTO
queryDTO
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/NoticeAnnouncementServiceImpl.java
View file @
81133afa
...
...
@@ -60,7 +60,6 @@ public class NoticeAnnouncementServiceImpl extends BaseServiceImpl<NoticeAnnounc
}
/**
*
* @param count 查询最近修改的几条数据
* @return
*/
...
...
@@ -68,4 +67,10 @@ public class NoticeAnnouncementServiceImpl extends BaseServiceImpl<NoticeAnnounc
public
List
<
NoticeAnnouncement
>
recent
(
Integer
count
)
{
return
baseMapper
.
recent
(
count
);
}
@Override
public
List
<
NoticeAnnouncement
>
latestNotices
(
Integer
limit
)
{
limit
=
null
==
limit
?
2
:
limit
;
return
baseMapper
.
selectLatestNotices
(
limit
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/StatisticsServiceImpl.java
View file @
81133afa
...
...
@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.hmhj.service.impl;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.toolkit.BigDecimalUtils
;
import
com.patzn.cloud.service.hmhj.dto.LedgerQueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.RangeStatsQueryDTO
;
...
...
@@ -15,6 +16,7 @@ import org.apache.commons.lang.time.DateUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
...
...
@@ -46,11 +48,7 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
private
void
handleQueryTimeRange
(
RangeStatsQueryDTO
queryDTO
)
{
handleQueryTime
(
queryDTO
);
queryDTO
.
setLastYearTimeS
(
DateUtils
.
addYears
(
queryDTO
.
getTimeS
(),
-
1
));
queryDTO
.
setLastYearTimeE
(
DateUtils
.
addYears
(
queryDTO
.
getTimeE
(),
-
1
));
Integer
days
=
DateKit
.
monthsBetweenTwoDates
(
queryDTO
.
getTimeS
(),
queryDTO
.
getTimeE
());
queryDTO
.
setPrevTimeS
(
DateUtils
.
addDays
(
queryDTO
.
getTimeS
(),
-
days
));
queryDTO
.
setPrevTimeE
(
queryDTO
.
getTimeS
());
handleTimeRange
(
queryDTO
);
}
private
List
<
Statistics
>
handleMonthData
(
QueryDTO
queryDTO
,
List
<
Statistics
>
statistics
)
{
...
...
@@ -82,10 +80,37 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
@Override
public
List
<
Statistics
>
getAlBrandsRate
(
QueryDTO
queryDTO
)
{
if
(
null
==
queryDTO
.
getQueryDate
())
{
queryDTO
.
setQueryDate
(
new
Date
());
}
return
baseMapper
.
selectAlBrandsRateStats
(
queryDTO
);
}
@Override
public
List
<
Statistics
>
getPrevAlBrandsRate
(
QueryDTO
queryDTO
)
{
List
<
Statistics
>
statistics
=
getAlBrandsRate
(
queryDTO
);
if
(
CollectionUtils
.
isEmpty
(
statistics
))
{
return
statistics
;
}
queryDTO
.
setType
(
"Al99.70"
);
Integer
total
=
statistics
.
get
(
0
).
getTotal
();
Integer
num
=
baseMapper
.
selectAlBrandLowFeStats
(
queryDTO
);
num
=
null
==
num
?
0
:
num
;
Statistics
lowFe
=
new
Statistics
();
lowFe
.
setBrand
(
queryDTO
.
getType
()
+
"低铁"
);
lowFe
.
setTotal
(
total
);
lowFe
.
setBrandNum
(
num
);
if
(
null
==
total
||
0
==
total
)
{
lowFe
.
setRatio
(
0.0000
);
}
else
{
double
def
=
1.0000
;
lowFe
.
setRatio
(
BigDecimalUtils
.
div
(
new
BigDecimal
(
def
*
num
),
new
BigDecimal
(
def
*
total
),
4
).
doubleValue
());
}
statistics
.
add
(
lowFe
);
return
statistics
;
}
@Override
public
List
<
Statistics
>
getEntrustedQuantity
(
QueryDTO
queryDTO
)
{
handleQueryTime
(
queryDTO
);
List
<
String
>
sampleNameList
=
Arrays
.
asList
(
"电解质"
,
"硅铁"
,
"磷铁"
,
"锰铁"
,
"水"
,
"纯铝"
,
"铝合金"
,
"石灰石"
);
...
...
@@ -113,8 +138,13 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
}
@Override
public
List
<
Statistics
>
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
public
Integer
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectAnodeInspectionQuantity
(
queryDTO
);
}
@Override
public
Statistics
getAnodeInspectionDoneQuantity
(
QueryDTO
queryDTO
){
return
baseMapper
.
selectAnodeInspectionDoneQuantity
(
queryDTO
);
}
@Override
...
...
@@ -124,12 +154,29 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
List
<
Statistics
>
monthList
=
baseMapper
.
selectReportSendQuantityMonth
(
queryDTO
);
monthList
=
handleMonthData
(
queryDTO
,
monthList
);
result
.
put
(
"monthList"
,
monthList
);
Statistics
statistics
=
baseMapper
.
selectReportSendQuantity
(
queryDTO
);
Statistics
statistics
=
baseMapper
.
selectReportSendQuantity
SamesChain
(
queryDTO
);
result
.
put
(
"statsData"
,
statistics
);
return
result
;
}
@Override
public
Map
<
String
,
Object
>
getMonthReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
handleQueryTimeRange
(
queryDTO
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
Statistics
>
monthList
=
baseMapper
.
selectReportSendQuantityMonth
(
queryDTO
);
monthList
=
handleMonthData
(
queryDTO
,
monthList
);
result
.
put
(
"total"
,
baseMapper
.
selectReportSendQuantityTotal
(
queryDTO
));
result
.
put
(
"monthList"
,
monthList
);
return
result
;
}
@Override
public
Statistics
getSamesChainReportSendQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
handleSamesChainTimeRange
(
queryDTO
);
return
baseMapper
.
selectReportSendQuantitySamesChain
(
queryDTO
);
}
@Override
public
List
<
Statistics
>
getItemQuantity
(
QueryDTO
queryDTO
)
{
handleQueryTime
(
queryDTO
);
return
baseMapper
.
selectItemQuantity
(
queryDTO
);
...
...
@@ -142,6 +189,54 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
}
@Override
public
Statistics
getAcceptSamesChainQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
handleSamesChainTimeRange
(
queryDTO
);
return
baseMapper
.
selectAcceptSamesChainQuantity
(
queryDTO
);
}
@Override
public
Integer
getTotalSamplingQuantity
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectTotalSamplingQuantity
(
queryDTO
);
}
@Override
public
Integer
getAlProductInspectionQuantity
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectAlProductInspectionQuantity
(
queryDTO
);
}
@Override
public
Statistics
getAlProductInspectionQuantityRate
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectAlProductInspectionQuantityRate
(
queryDTO
);
}
@Override
public
Statistics
getItemSamesChainQuantity
(
RangeStatsQueryDTO
queryDTO
)
{
handleSamesChainTimeRange
(
queryDTO
);
return
baseMapper
.
selectItemSamesChainQuantity
(
queryDTO
);
}
private
void
handleSamesChainTimeRange
(
RangeStatsQueryDTO
queryDTO
)
{
RestAssert
.
fail
(
Objects
.
isNull
(
queryDTO
.
getQueryDate
()),
"查询日期不能为空!"
);
String
queryDateStr
=
com
.
patzn
.
cloud
.
commons
.
toolkit
.
DateUtils
.
toYearMonthDay
(
queryDTO
.
getQueryDate
());
queryDTO
.
setTimeS
(
com
.
patzn
.
cloud
.
commons
.
toolkit
.
DateUtils
.
getYearMonthStart
(
queryDateStr
));
queryDTO
.
setTimeE
(
com
.
patzn
.
cloud
.
commons
.
toolkit
.
DateUtils
.
getYearMonthEnd
(
queryDateStr
));
handleTimeRange
(
queryDTO
);
}
/**
* 根据当前时间区域,处理其他时间区域
*
* @param queryDTO
*/
private
void
handleTimeRange
(
RangeStatsQueryDTO
queryDTO
)
{
queryDTO
.
setLastYearTimeS
(
DateUtils
.
addYears
(
queryDTO
.
getTimeS
(),
-
1
));
queryDTO
.
setLastYearTimeE
(
DateUtils
.
addYears
(
queryDTO
.
getTimeE
(),
-
1
));
Integer
days
=
DateKit
.
monthsBetweenTwoDates
(
queryDTO
.
getTimeS
(),
queryDTO
.
getTimeE
());
queryDTO
.
setPrevTimeS
(
DateUtils
.
addDays
(
queryDTO
.
getTimeS
(),
-
days
));
queryDTO
.
setPrevTimeE
(
queryDTO
.
getTimeS
());
}
@Override
public
Statistics
getOutTestFinishQuantity
(
QueryDTO
queryDTO
)
{
handleQueryTime
(
queryDTO
);
return
baseMapper
.
selectOutTestFinishQuantity
(
queryDTO
);
...
...
@@ -163,7 +258,23 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
@Override
public
List
<
Statistics
>
getCurWeekAcceptanceQualified
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectCurWeekAcceptanceQualified
(
queryDTO
);
// 由于map.xml文件中是取上一周的数据
// 默认查询的话,查询本周的数据,需要天数+7
if
(
null
==
queryDTO
.
getQueryDate
())
{
queryDTO
.
setQueryDate
(
DateUtils
.
addDays
(
new
Date
(),
7
));
}
return
baseMapper
.
selectAcceptanceQualifiedByDate
(
queryDTO
);
}
@Override
public
List
<
Statistics
>
getPrevWeekAcceptanceQualified
(
QueryDTO
queryDTO
)
{
queryDTO
.
setQueryDate
(
new
Date
());
return
baseMapper
.
selectAcceptanceQualifiedByDate
(
queryDTO
);
}
@Override
public
Statistics
getAcceptanceQualifiedByTimeFrame
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectAcceptanceQualifiedByTimeFrame
(
queryDTO
);
}
@Override
...
...
@@ -269,6 +380,11 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
return
null
;
}
@Override
public
Statistics
getTestItemQuantityStats
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectTestItemQuantityStats
(
queryDTO
);
}
private
String
getDataLabel
(
String
label
,
List
<
String
>
names
)
{
if
(
StringUtils
.
isBlank
(
label
)
||
CollectionUtils
.
isEmpty
(
names
)
||
null
==
names
.
get
(
0
))
{
return
label
;
...
...
src/main/resources/mapper/hmhj/NoticeAnnouncementMapper.xml
View file @
81133afa
...
...
@@ -8,4 +8,16 @@
ORDER BY ltime DESC
LIMIT #{count}
</select>
<!--查询最新发布的 N 条数据-->
<select
id=
"selectLatestNotices"
resultType=
"com.patzn.cloud.service.hmhj.entity.NoticeAnnouncement"
>
SELECT
na."content",
na.creator,
na.ctime
FROM
notice_announcement na
ORDER BY
na.ctime DESC
LIMIT #{limit}
</select>
</mapper>
src/main/resources/mapper/hmhj/StatisticsMapper.xml
View file @
81133afa
This diff is collapsed.
Click to expand it.
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