Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
relation
Commits
69b5f68e
"...git@gitlab.ruzhoukj.com:wujipeng/practical_train.git" did not exist on "98e0a708575a16c8dc5c48239f331fb861dc3ced"
Commit
69b5f68e
authored
Jul 31, 2025
by
wujipeng
Browse files
解析数据增加用户数据录入
parent
470890de
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/model/entity/UserAccountEntity.java
View file @
69b5f68e
...
@@ -3,10 +3,16 @@ package com.platform.model.entity;
...
@@ -3,10 +3,16 @@ package com.platform.model.entity;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Data
@TableName
(
"user_account"
)
@TableName
(
"user_account"
)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
UserAccountEntity
{
public
class
UserAccountEntity
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
...
...
src/main/java/com/platform/model/entity/UserEntity.java
View file @
69b5f68e
...
@@ -3,10 +3,16 @@ package com.platform.model.entity;
...
@@ -3,10 +3,16 @@ package com.platform.model.entity;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Data
@TableName
(
"user"
)
@TableName
(
"user"
)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
UserEntity
{
public
class
UserEntity
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
...
...
src/main/java/com/platform/service/impl/AnalysisServiceImpl.java
View file @
69b5f68e
...
@@ -3,13 +3,12 @@ package com.platform.service.impl;
...
@@ -3,13 +3,12 @@ package com.platform.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.ExcelTemplateEntity
;
import
com.platform.model.entity.ExcelTemplateEntity
;
import
com.platform.model.entity.UserAccountEntity
;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
import
com.platform.model.vo.FileUploadVO
;
import
com.platform.model.vo.FileUploadVO
;
import
com.platform.model.vo.TableHeaderVO
;
import
com.platform.model.vo.TableHeaderVO
;
import
com.platform.service.AnalysisService
;
import
com.platform.service.*
;
import
com.platform.service.ExcelDataService
;
import
com.platform.service.ExcelTemplateService
;
import
com.platform.service.FileUploadService
;
import
com.platform.utils.DateUtils
;
import
com.platform.utils.DateUtils
;
import
com.platform.utils.StringUtils
;
import
com.platform.utils.StringUtils
;
import
org.apache.commons.compress.utils.Lists
;
import
org.apache.commons.compress.utils.Lists
;
...
@@ -48,9 +47,12 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -48,9 +47,12 @@ public class AnalysisServiceImpl implements AnalysisService {
private
ExcelTemplateService
excelTemplateService
;
private
ExcelTemplateService
excelTemplateService
;
@Resource
@Resource
private
ExcelDataService
excelDataService
;
private
ExcelDataService
excelDataService
;
@Resource
@Resource
private
FileUploadService
fileUploadService
;
private
FileUploadService
fileUploadService
;
@Resource
private
UserService
userService
;
@Resource
private
UserAccountService
userAccountService
;
private
static
final
String
[]
EXCEL_EXTENSIONS
=
{
".xlsx"
,
".xls"
};
private
static
final
String
[]
EXCEL_EXTENSIONS
=
{
".xlsx"
,
".xls"
};
...
@@ -199,6 +201,16 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -199,6 +201,16 @@ public class AnalysisServiceImpl implements AnalysisService {
ExcelDataEntity
excelDataEntity
=
handleExcelData
(
tableHeaderList
,
row
,
folderName
,
fileId
,
caseId
);
ExcelDataEntity
excelDataEntity
=
handleExcelData
(
tableHeaderList
,
row
,
folderName
,
fileId
,
caseId
);
excelData
.
add
(
excelDataEntity
);
excelData
.
add
(
excelDataEntity
);
}
}
if
(
StringUtils
.
isNotEmpty
(
folderName
)){
String
userName
=
trimChineseNameFromFilename
(
folderName
);
userService
.
save
(
UserEntity
.
builder
().
userName
(
userName
).
build
());
if
(!
excelData
.
isEmpty
()){
List
<
String
>
paymentBankNames
=
excelData
.
stream
().
map
(
ExcelDataEntity:
:
getPaymentBankName
).
distinct
().
collect
(
Collectors
.
toList
());
userAccountService
.
saveBatch
(
paymentBankNames
.
stream
().
map
(
paymentBankName
->
UserAccountEntity
.
builder
().
userName
(
userName
).
account
(
paymentBankName
).
build
()).
collect
(
Collectors
.
toList
()));
}
}
//保存excel数据
//保存excel数据
excelDataService
.
saveBatch
(
excelData
);
excelDataService
.
saveBatch
(
excelData
);
}
}
...
...
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