Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
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
poc
poc-api
Commits
88754a48
Commit
88754a48
authored
Jan 21, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:【【POE】-【应用-发布】-API调用发布导出文件的表头字段需要修改】
--bug==1009801
parent
613a6ab9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
6 deletions
+113
-6
ApiChannelReportENEntity.java
...n/com/poc/formreport/entity/ApiChannelReportENEntity.java
+1
-3
ApiChannelReportZHCNEntity.java
...com/poc/formreport/entity/ApiChannelReportZHCNEntity.java
+35
-0
ApiChannelReportZHTWEntity.java
...com/poc/formreport/entity/ApiChannelReportZHTWEntity.java
+35
-0
AgentDataAnalyzeApiChannelFormReportStrategy.java
...trategy/AgentDataAnalyzeApiChannelFormReportStrategy.java
+42
-3
No files found.
src/main/java/cn/com/poc/formreport/entity/ApiChannelReportEntity.java
→
src/main/java/cn/com/poc/formreport/entity/ApiChannelReportE
NE
ntity.java
View file @
88754a48
...
...
@@ -4,14 +4,12 @@ import com.alibaba.excel.annotation.ExcelProperty;
import
com.alibaba.excel.annotation.write.style.ContentStyle
;
import
com.alibaba.excel.enums.poi.HorizontalAlignmentEnum
;
import
java.util.Date
;
/**
* @author alex.yao
* @date 2024/12/20
*/
@ContentStyle
(
horizontalAlignment
=
HorizontalAlignmentEnum
.
LEFT
)
public
class
ApiChannelReportEntity
{
public
class
ApiChannelReportE
NE
ntity
{
@ExcelProperty
(
value
=
"date"
,
index
=
0
)
private
String
dateTime
;
...
...
src/main/java/cn/com/poc/formreport/entity/ApiChannelReportZHCNEntity.java
0 → 100644
View file @
88754a48
package
cn
.
com
.
poc
.
formreport
.
entity
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ContentStyle
;
import
com.alibaba.excel.enums.poi.HorizontalAlignmentEnum
;
/**
* @author alex.yao
* @date 2024/12/20
*/
@ContentStyle
(
horizontalAlignment
=
HorizontalAlignmentEnum
.
LEFT
)
public
class
ApiChannelReportZHCNEntity
{
@ExcelProperty
(
value
=
"调用时间"
,
index
=
0
)
private
String
dateTime
;
@ExcelProperty
(
value
=
"消耗积分"
,
index
=
1
)
private
Double
count
;
public
String
getDateTime
()
{
return
dateTime
;
}
public
void
setDateTime
(
String
dateTime
)
{
this
.
dateTime
=
dateTime
;
}
public
Double
getCount
()
{
return
count
;
}
public
void
setCount
(
Double
count
)
{
this
.
count
=
count
;
}
}
src/main/java/cn/com/poc/formreport/entity/ApiChannelReportZHTWEntity.java
0 → 100644
View file @
88754a48
package
cn
.
com
.
poc
.
formreport
.
entity
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ContentStyle
;
import
com.alibaba.excel.enums.poi.HorizontalAlignmentEnum
;
/**
* @author alex.yao
* @date 2024/12/20
*/
@ContentStyle
(
horizontalAlignment
=
HorizontalAlignmentEnum
.
LEFT
)
public
class
ApiChannelReportZHTWEntity
{
@ExcelProperty
(
value
=
"調用時間"
,
index
=
0
)
private
String
dateTime
;
@ExcelProperty
(
value
=
"消耗積分"
,
index
=
1
)
private
Double
count
;
public
String
getDateTime
()
{
return
dateTime
;
}
public
void
setDateTime
(
String
dateTime
)
{
this
.
dateTime
=
dateTime
;
}
public
Double
getCount
()
{
return
count
;
}
public
void
setCount
(
Double
count
)
{
this
.
count
=
count
;
}
}
src/main/java/cn/com/poc/formreport/strategy/AgentDataAnalyzeApiChannelFormReportStrategy.java
View file @
88754a48
package
cn
.
com
.
poc
.
formreport
.
strategy
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.data_analyze.entity.AgentDataAnalyzeApiChannelEntity
;
import
cn.com.poc.expose.aggregate.AgentDataAnalyzeService
;
import
cn.com.poc.formreport.FormReportRequest
;
import
cn.com.poc.formreport.entity.ApiChannelReportEntity
;
import
cn.com.poc.formreport.entity.ApiChannelReportENEntity
;
import
cn.com.poc.formreport.entity.ApiChannelReportZHCNEntity
;
import
cn.com.poc.formreport.entity.ApiChannelReportZHTWEntity
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
...
...
@@ -12,6 +15,8 @@ import java.math.RoundingMode;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
static
cn
.
com
.
poc
.
common
.
constant
.
XLangConstant
.*;
/**
* Agent应用 API渠道-积分使用数据
*
...
...
@@ -27,18 +32,52 @@ public class AgentDataAnalyzeApiChannelFormReportStrategy extends AbstractFormRe
@Override
public
List
<
Object
>
getFormReportData
(
FormReportRequest
reportRequest
)
throws
Exception
{
String
lang
=
BlContext
.
getCurrentLocaleLanguageToLowerCase
();
List
<
AgentDataAnalyzeApiChannelEntity
>
analyzeApiChannelEntities
=
agentDataAnalyzeService
.
getAgentApiChannelPointCount
(
reportRequest
.
getAgentId
(),
reportRequest
.
getTimeRange
());
switch
(
lang
)
{
case
ZH_CN:
return
analyzeApiChannelEntities
.
stream
().
map
(
value
->
{
ApiChannelReportZHCNEntity
apiChannelReportEntity
=
new
ApiChannelReportZHCNEntity
();
apiChannelReportEntity
.
setDateTime
(
value
.
getDateTime
());
apiChannelReportEntity
.
setCount
(
BigDecimal
.
valueOf
(
value
.
getCount
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
doubleValue
());
return
apiChannelReportEntity
;
}).
collect
(
Collectors
.
toList
());
case
EN:
return
analyzeApiChannelEntities
.
stream
().
map
(
value
->
{
ApiChannelReportENEntity
apiChannelReportEntity
=
new
ApiChannelReportENEntity
();
apiChannelReportEntity
.
setDateTime
(
value
.
getDateTime
());
apiChannelReportEntity
.
setCount
(
BigDecimal
.
valueOf
(
value
.
getCount
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
doubleValue
());
return
apiChannelReportEntity
;
}).
collect
(
Collectors
.
toList
());
case
ZH_TW:
return
analyzeApiChannelEntities
.
stream
().
map
(
value
->
{
ApiChannelReportZHTWEntity
apiChannelReportEntity
=
new
ApiChannelReportZHTWEntity
();
apiChannelReportEntity
.
setDateTime
(
value
.
getDateTime
());
apiChannelReportEntity
.
setCount
(
BigDecimal
.
valueOf
(
value
.
getCount
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
doubleValue
());
return
apiChannelReportEntity
;
}).
collect
(
Collectors
.
toList
());
}
return
analyzeApiChannelEntities
.
stream
().
map
(
value
->
{
ApiChannelReportE
ntity
apiChannelReportEntity
=
new
ApiChannelReport
Entity
();
ApiChannelReportE
NEntity
apiChannelReportEntity
=
new
ApiChannelReportEN
Entity
();
apiChannelReportEntity
.
setDateTime
(
value
.
getDateTime
());
apiChannelReportEntity
.
setCount
(
BigDecimal
.
valueOf
(
value
.
getCount
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
doubleValue
());
return
apiChannelReportEntity
;
}).
collect
(
Collectors
.
toList
());
}
@Override
public
Class
getExcelEntityClass
()
{
return
ApiChannelReportEntity
.
class
;
String
lang
=
BlContext
.
getCurrentLocaleLanguageToLowerCase
();
switch
(
lang
)
{
case
ZH_CN:
return
ApiChannelReportZHCNEntity
.
class
;
case
EN:
return
ApiChannelReportENEntity
.
class
;
case
ZH_TW:
return
ApiChannelReportZHTWEntity
.
class
;
}
return
ApiChannelReportENEntity
.
class
;
}
@Override
...
...
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