Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
97d8641c
Commit
97d8641c
authored
Apr 12, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.2-工资原表识别-主逻辑提交
parent
ea09b65b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
TSalaryStandardOriginalController.java
.../salary/controller/TSalaryStandardOriginalController.java
+1
-11
TSalaryStandardOriginalServiceImpl.java
...lary/service/impl/TSalaryStandardOriginalServiceImpl.java
+9
-6
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryStandardOriginalController.java
View file @
97d8641c
...
...
@@ -17,7 +17,6 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
...
...
@@ -34,25 +33,16 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalDetailService
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalService
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.ExcelSheetVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryOriginalVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadOriginalParamVo
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.fileupload.FileItem
;
import
org.apache.commons.fileupload.disk.DiskFileItem
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
java.io.ByteArrayInputStream
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -134,7 +124,7 @@ public class TSalaryStandardOriginalController {
if
(
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getId
())
&&
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getDeptId
())
&&
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getSetName
())){
&&
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getSetName
()))
{
List
<
TSalaryStandardOriginalDetail
>
detailList
=
tSalaryStandardOriginal
.
getDetailList
();
if
(
detailList
==
null
||
detailList
.
isEmpty
())
{
return
R
.
failed
(
"请传配置表头list"
);
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardOriginalServiceImpl.java
View file @
97d8641c
...
...
@@ -17,7 +17,6 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -32,7 +31,10 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.SalaryUploadService;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalDetailService
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalService
;
import
com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.ExcelColumnVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.ExcelSheetVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadOriginalParamVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadParamVo
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.poi.hssf.usermodel.*
;
...
...
@@ -80,6 +82,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
public
IPage
<
TSalaryStandardOriginal
>
getTSalaryStandardOriginalPage
(
Page
<
TSalaryStandardOriginal
>
page
,
TSalaryStandardOriginal
tSalaryStandardOriginal
)
{
return
baseMapper
.
getTSalaryStandardOriginalPage
(
page
,
tSalaryStandardOriginal
);
}
/**
* @Description: 分页查询
* @Author: hgw
...
...
@@ -210,7 +213,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
cellValue
=
row
.
getCell
(
cellNum
).
getStringCellValue
();
}
}
catch
(
Exception
e
)
{
sheetVo
.
setErrorInfo
(
"请注意单元格格式,第"
+(
i
+
1
)
+
"个sheet,第"
+(
rowNum
+
1
)+
"行第"
+(
cellNum
+
1
)+
"列。"
+
e
.
getMessage
());
sheetVo
.
setErrorInfo
(
"请注意单元格格式,第"
+
(
i
+
1
)
+
"个sheet,第"
+
(
rowNum
+
1
)
+
"行第"
+
(
cellNum
+
1
)
+
"列。"
+
e
.
getMessage
());
return
sheetVo
;
}
if
(
Common
.
isNotNull
(
cellValue
))
{
...
...
@@ -333,7 +336,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
cellValue
=
row
.
getCell
(
cellNum
).
getStringCellValue
();
}
}
catch
(
Exception
e
)
{
sheetVo
.
setErrorInfo
(
"请注意单元格格式,第"
+(
i
+
1
)
+
"个sheet,第"
+(
rowNum
+
1
)+
"行第"
+(
cellNum
+
1
)+
"列。"
+
e
.
getMessage
());
sheetVo
.
setErrorInfo
(
"请注意单元格格式,第"
+
(
i
+
1
)
+
"个sheet,第"
+
(
rowNum
+
1
)
+
"行第"
+
(
cellNum
+
1
)
+
"列。"
+
e
.
getMessage
());
return
sheetVo
;
}
if
(
Common
.
isNotNull
(
cellValue
))
{
...
...
@@ -503,7 +506,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
Map
<
String
,
String
>
newRowMap
;
String
value
;
String
oldValue
;
int
i
=
0
;
int
i
=
0
;
for
(
Map
<
String
,
String
>
rowMap
:
vo
.
getContentList
())
{
i
++;
newRowMap
=
new
HashMap
<>();
...
...
@@ -521,7 +524,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
));
}
}
catch
(
NumberFormatException
e
)
{
return
R
.
failed
(
"第 "
+
i
+
" 行,第 "
+
(
Integer
.
parseInt
(
column
.
getKey
())+
1
)
+
" 列 不是金额,不可以进行加减计算!"
);
return
R
.
failed
(
"第 "
+
i
+
" 行,第 "
+
(
Integer
.
parseInt
(
column
.
getKey
())
+
1
)
+
" 列 不是金额,不可以进行加减计算!"
);
}
newRowMap
.
put
(
detail
.
getModelName
(),
value
);
}
...
...
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