Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-script
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 72353148
authored
Dec 18, 2025
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:1047852:d+后台事项新增,我的事项列表
1 parent
8f99cabc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
16 deletions
src/main/java/cn/com/glsx/dj/script/converter/excel/BiMatterStatusConverter.java
src/main/java/cn/com/glsx/dj/script/converter/excel/YearMonthConverter.java
src/main/java/cn/com/glsx/dj/script/dto/excel/BiMatterExcelDTO.java
src/main/java/cn/com/glsx/dj/script/service/BiAnalyseBackgroundService.java
src/main/java/cn/com/glsx/dj/script/converter/excel/BiMatterStatusConverter.java
0 → 100644
View file @
7235314
package
cn
.
com
.
glsx
.
dj
.
script
.
converter
.
excel
;
import
cn.com.glsx.dj.peanalysis.enums.MerchantBiMatterStatusEnum
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.excel.converters.Converter
;
import
com.alibaba.excel.enums.CellDataTypeEnum
;
import
com.alibaba.excel.metadata.CellData
;
import
com.alibaba.excel.metadata.GlobalConfiguration
;
import
com.alibaba.excel.metadata.property.ExcelContentProperty
;
import
java.util.Objects
;
/**
* BI 事项处理转换器
* @see MerchantBiMatterStatusEnum
* @author yangwei
* @version 1.0
* @since 2025/12/17 20:15
*/
public
class
BiMatterStatusConverter
implements
Converter
<
Integer
>
{
@Override
public
Class
<?>
supportJavaTypeKey
()
{
return
Integer
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
return
CellDataTypeEnum
.
STRING
;
}
@Override
public
Integer
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
contentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
return
null
;
}
@Override
public
CellData
<?>
convertToExcelData
(
Integer
value
,
ExcelContentProperty
contentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
String
desc
=
MerchantBiMatterStatusEnum
.
getDescByCode
(
value
);
return
new
CellData
<>(
StrUtil
.
isNotBlank
(
desc
)
?
Objects
.
requireNonNull
(
desc
)
:
StrUtil
.
EMPTY
);
}
}
src/main/java/cn/com/glsx/dj/script/converter/excel/YearMonthConverter.java
View file @
7235314
...
@@ -19,6 +19,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty;
...
@@ -19,6 +19,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty;
* @since 2025/12/16 09:46
* @since 2025/12/16 09:46
*/
*/
public
class
YearMonthConverter
implements
Converter
<
String
>
{
public
class
YearMonthConverter
implements
Converter
<
String
>
{
@Override
@Override
public
Class
<?>
supportJavaTypeKey
()
{
public
Class
<?>
supportJavaTypeKey
()
{
return
String
.
class
;
return
String
.
class
;
...
...
src/main/java/cn/com/glsx/dj/script/dto/excel/BiMatterExcelDTO.java
View file @
7235314
package
cn
.
com
.
glsx
.
dj
.
script
.
dto
.
excel
;
package
cn
.
com
.
glsx
.
dj
.
script
.
dto
.
excel
;
import
cn.com.glsx.dj.script.converter.excel.BusinessTypeConverter
;
import
cn.com.glsx.dj.script.converter.excel.BiMatterStatusConverter
;
import
cn.com.glsx.dj.script.converter.excel.YearMonthConverter
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.format.NumberFormat
;
import
com.alibaba.excel.annotation.write.style.*
;
import
com.alibaba.excel.annotation.write.style.*
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -16,8 +14,6 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
...
@@ -16,8 +14,6 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
import
org.apache.poi.ss.usermodel.VerticalAlignment
;
import
org.apache.poi.ss.usermodel.VerticalAlignment
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -47,24 +43,41 @@ import java.util.Date;
...
@@ -47,24 +43,41 @@ import java.util.Date;
@ContentFontStyle
(
fontName
=
"宋体"
,
fontHeightInPoints
=
12
)
@ContentFontStyle
(
fontName
=
"宋体"
,
fontHeightInPoints
=
12
)
public
class
BiMatterExcelDTO
implements
Serializable
{
public
class
BiMatterExcelDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6241795238964931077
L
;
private
static
final
long
serialVersionUID
=
-
15758845555616005
L
;
@ExcelProperty
(
value
=
"4S门店"
,
index
=
0
)
@ExcelProperty
(
value
=
"4S门店"
,
index
=
0
)
@ColumnWidth
(
41
)
@ColumnWidth
(
41
)
private
String
storeName
;
private
String
storeName
;
@ExcelProperty
(
value
=
"
业务类型"
,
index
=
1
,
converter
=
BusinessTypeConverter
.
class
)
@ExcelProperty
(
value
=
"
事项描述"
,
index
=
1
)
private
String
businessType
;
private
String
description
;
@ExcelProperty
(
value
=
"
所属月份"
,
index
=
2
,
converter
=
YearMonthConverter
.
class
)
@ExcelProperty
(
value
=
"
线上运营"
,
index
=
2
)
private
String
monthYea
r
;
private
String
onlineOperatorSt
r
;
@ExcelProperty
(
value
=
"毛利额"
,
index
=
3
)
@ExcelProperty
(
value
=
"区域运营"
,
index
=
3
)
@NumberFormat
(
value
=
"0.00"
,
roundingMode
=
RoundingMode
.
HALF_UP
)
private
String
areaOperatorStr
;
private
BigDecimal
profitAmount
;
@ExcelProperty
(
value
=
"
导入
时间"
,
index
=
4
)
@ExcelProperty
(
value
=
"
创建
时间"
,
index
=
4
)
@DateTimeFormat
(
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createdAt
;
private
Date
createdAt
;
@ExcelProperty
(
value
=
"创建人"
,
index
=
5
)
private
String
creator
;
@ExcelProperty
(
value
=
"状态"
,
index
=
6
,
converter
=
BiMatterStatusConverter
.
class
)
private
Integer
status
;
@ExcelProperty
(
value
=
"处理人"
,
index
=
7
)
private
String
handler
;
@ExcelProperty
(
value
=
"处理时间"
,
index
=
8
)
@DateTimeFormat
(
"yyyy-MM-dd HH:mm:ss"
)
private
Date
handledAt
;
@ExcelProperty
(
value
=
"处理策略"
,
index
=
9
)
@ColumnWidth
(
60
)
private
String
handlingStrategy
;
}
}
src/main/java/cn/com/glsx/dj/script/service/BiAnalyseBackgroundService.java
View file @
7235314
...
@@ -347,6 +347,7 @@ public class BiAnalyseBackgroundService {
...
@@ -347,6 +347,7 @@ public class BiAnalyseBackgroundService {
excelWriter
=
EasyExcel
.
write
(
outfile
,
BiMatterExcelDTO
.
class
).
build
();
excelWriter
=
EasyExcel
.
write
(
outfile
,
BiMatterExcelDTO
.
class
).
build
();
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"sheet1"
).
build
();
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"sheet1"
).
build
();
// 查询bi事项数据
RpcPagination
<
MerchantBiMatterBaseQryDTO
>
rpcPagination
=
CommonUtil
.
getRpcPagination
(
MerchantBiMatterBaseQryDTO
.
class
);
RpcPagination
<
MerchantBiMatterBaseQryDTO
>
rpcPagination
=
CommonUtil
.
getRpcPagination
(
MerchantBiMatterBaseQryDTO
.
class
);
rpcPagination
.
setPageNum
(-
1
);
rpcPagination
.
setPageNum
(-
1
);
MerchantBiMatterBaseQryDTO
condition
=
BeanUtil
.
copyProperties
(
merchantBiMatterBaseQryReq
,
MerchantBiMatterBaseQryDTO
.
class
);
MerchantBiMatterBaseQryDTO
condition
=
BeanUtil
.
copyProperties
(
merchantBiMatterBaseQryReq
,
MerchantBiMatterBaseQryDTO
.
class
);
...
@@ -357,10 +358,28 @@ public class BiAnalyseBackgroundService {
...
@@ -357,10 +358,28 @@ public class BiAnalyseBackgroundService {
if
(
response
.
isFailed
())
{
if
(
response
.
isFailed
())
{
throw
new
RpcServiceException
(
response
.
getError
(),
response
.
getMessage
());
throw
new
RpcServiceException
(
response
.
getError
(),
response
.
getMessage
());
}
}
// 对象转换处理区域运营
List
<
MerchantBiMatterDTO
>
list
=
Optional
.
ofNullable
(
result
.
getList
()).
filter
(
CollUtil:
:
isNotEmpty
).
orElseGet
(
ArrayList:
:
new
);
List
<
MerchantBiMatterDTO
>
list
=
Optional
.
ofNullable
(
result
.
getList
()).
filter
(
CollUtil:
:
isNotEmpty
).
orElseGet
(
ArrayList:
:
new
);
List
<
BiMatterExcelDTO
>
excelDtoList
=
merchantBiMatterConvert
.
biMatterDtoList2ExcelDtoList
(
list
);
List
<
BiMatterExcelDTO
>
excelDtoList
=
list
.
stream
().
map
(
item
->
{
excelWriter
.
write
(
excelDtoList
,
writeSheet
);
BiMatterExcelDTO
biMatterExcelDTO
=
merchantBiMatterConvert
.
biMatterDto2ExcelDto
(
item
);
List
<
MerchantBiMatterDTO
.
OperatorDTO
>
onlineOperator
=
item
.
getOnlineOperator
();
if
(
CollUtil
.
isNotEmpty
(
onlineOperator
))
{
biMatterExcelDTO
.
setOnlineOperatorStr
(
onlineOperator
.
stream
()
.
map
(
MerchantBiMatterDTO
.
OperatorDTO
::
getUsername
)
.
collect
(
Collectors
.
joining
(
SymbolConstants
.
SLASH
)));
}
List
<
MerchantBiMatterDTO
.
OperatorDTO
>
areaOperator
=
item
.
getAreaOperator
();
if
(
CollUtil
.
isNotEmpty
(
areaOperator
))
{
biMatterExcelDTO
.
setAreaOperatorStr
(
areaOperator
.
stream
()
.
map
(
MerchantBiMatterDTO
.
OperatorDTO
::
getUsername
)
.
collect
(
Collectors
.
joining
(
SymbolConstants
.
SLASH
)));
}
return
biMatterExcelDTO
;
}).
collect
(
Collectors
.
toList
());
excelWriter
.
write
(
excelDtoList
,
writeSheet
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"写出excel异常"
,
e
);
log
.
error
(
"写出excel异常"
,
e
);
throw
new
RpcServiceException
(
RopErrorEnum
.
AYSNC_EXPORT_ERROR
,
"导出excel失败"
);
throw
new
RpcServiceException
(
RopErrorEnum
.
AYSNC_EXPORT_ERROR
,
"导出excel失败"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment