Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
3fc8a6e7
Commit
3fc8a6e7
authored
Aug 26, 2024
by
位宇华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
东欢坨工资代码提交
parent
b328c658
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
267 additions
and
1 deletion
+267
-1
ruoyi-wages/src/main/java/com/ruoyi/system/controller/SalaryController.java
...in/java/com/ruoyi/system/controller/SalaryController.java
+25
-1
ruoyi-wages/src/main/java/com/ruoyi/system/listener/LjtExcelListener.java
...main/java/com/ruoyi/system/listener/LjtExcelListener.java
+41
-0
ruoyi-wages/src/main/java/com/ruoyi/system/model/salary/LjtSalaryModel.java
...in/java/com/ruoyi/system/model/salary/LjtSalaryModel.java
+153
-0
ruoyi-wages/src/main/java/com/ruoyi/system/service/LjtSalaryService.java
.../main/java/com/ruoyi/system/service/LjtSalaryService.java
+8
-0
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/LjtSalaryServiceImpl.java
...a/com/ruoyi/system/service/impl/LjtSalaryServiceImpl.java
+40
-0
No files found.
ruoyi-wages/src/main/java/com/ruoyi/system/controller/SalaryController.java
View file @
3fc8a6e7
...
...
@@ -3,8 +3,10 @@ package com.ruoyi.system.controller;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.model.salary.LxSalaryModel
;
import
com.ruoyi.system.service.DhtSalaryService
;
import
com.ruoyi.system.service.LjtSalaryService
;
import
com.ruoyi.system.service.LxSalaryService
;
import
com.ruoyi.system.service.TsSalarySaveService
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -17,12 +19,15 @@ public class SalaryController {
private
final
DhtSalaryService
dhtSalaryService
;
private
final
LjtSalaryService
ljtSalaryService
;
private
final
TsSalarySaveService
salarySaveService
;
public
SalaryController
(
TsSalarySaveService
salarySaveService
,
LxSalaryService
lxSalaryService
,
DhtSalaryService
dhtSalaryService
)
{
public
SalaryController
(
TsSalarySaveService
salarySaveService
,
LxSalaryService
lxSalaryService
,
DhtSalaryService
dhtSalaryService
,
LjtSalaryService
ljtSalaryService
)
{
this
.
salarySaveService
=
salarySaveService
;
this
.
lxSalaryService
=
lxSalaryService
;
this
.
dhtSalaryService
=
dhtSalaryService
;
this
.
ljtSalaryService
=
ljtSalaryService
;
}
/**
...
...
@@ -47,8 +52,27 @@ public class SalaryController {
return
lxSalaryService
.
lxSave
(
multipartFile
,
salaryDate
);
}
/**
* 东欢坨
*
* @param multipartFile
* @param salaryDate
* @return
*/
@PostMapping
(
"/dht/salary"
)
public
AjaxResult
dhtSave
(
@RequestParam
(
"multipartFile"
)
MultipartFile
multipartFile
,
@RequestParam
(
"salaryDate"
)
String
salaryDate
)
{
return
dhtSalaryService
.
dhtSave
(
multipartFile
,
salaryDate
);
}
/**
* 吕家坨
*
* @param multipartFile
* @param salaryDate
* @return
*/
@PostMapping
(
"/ljt/salary"
)
public
AjaxResult
ljtSave
(
@RequestParam
(
"multipartFile"
)
MultipartFile
multipartFile
,
@RequestParam
(
"salaryDate"
)
String
salaryDate
)
{
return
ljtSalaryService
.
ljtSave
(
multipartFile
,
salaryDate
);
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/listener/LjtExcelListener.java
0 → 100644
View file @
3fc8a6e7
package
com.ruoyi.system.listener
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.ruoyi.system.model.salary.LjtSalaryModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
LjtExcelListener
<
T
>
extends
AnalysisEventListener
<
T
>
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
LjtExcelListener
.
class
);
private
final
List
<
LjtSalaryModel
>
ljtSalaryModelList
=
new
ArrayList
<>();
private
int
endRow
;
@Override
public
void
invoke
(
T
t
,
AnalysisContext
analysisContext
)
{
LjtSalaryModel
ljtSalaryModel
=
(
LjtSalaryModel
)
t
;
if
(
StringUtils
.
equals
(
"合计"
,
ljtSalaryModel
.
getOrg
()))
{
endRow
=
analysisContext
.
getCurrentRowNum
();
}
int
count
=
analysisContext
.
getCurrentRowNum
();
if
(
endRow
==
0
||
(
endRow
-
1
>=
count
))
{
ljtSalaryModelList
.
add
(
ljtSalaryModel
);
}
}
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
analysisContext
)
{
logger
.
info
(
"解析完成!"
);
}
public
List
<
LjtSalaryModel
>
getLjtSalaryModelList
()
{
return
ljtSalaryModelList
;
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/model/salary/LjtSalaryModel.java
0 → 100644
View file @
3fc8a6e7
package
com.ruoyi.system.model.salary
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
java.io.Serializable
;
@ExcelIgnoreUnannotated
public
class
LjtSalaryModel
implements
Serializable
{
@ExcelProperty
(
"单位"
)
private
String
org
;
@ExcelProperty
(
"医疗保险"
)
private
String
medicalInsurance
;
@ExcelProperty
(
"养老保险"
)
private
String
oldInsurance
;
@ExcelProperty
(
"失业保险"
)
private
String
unemploymentInsurance
;
@ExcelProperty
(
"住房公积金"
)
private
String
houseFund
;
@ExcelProperty
(
"会费"
)
private
String
laborUnionDues
;
@ExcelProperty
(
"年金"
)
private
String
annuity
;
@ExcelProperty
(
"扣取暖"
)
private
String
warmSubsidy
;
@ExcelProperty
(
"工资总额"
)
private
String
sumSalary
;
@ExcelProperty
(
"班餐"
)
private
String
lunch
;
@ExcelProperty
(
"计育"
)
private
String
oneChild
;
@ExcelProperty
(
"医贴"
)
private
String
medicalSubsidy
;
@ExcelProperty
(
"培训费随资"
)
private
String
edufFees
;
public
String
getOrg
()
{
return
org
;
}
public
void
setOrg
(
String
org
)
{
this
.
org
=
org
;
}
public
String
getMedicalInsurance
()
{
return
medicalInsurance
;
}
public
void
setMedicalInsurance
(
String
medicalInsurance
)
{
this
.
medicalInsurance
=
medicalInsurance
;
}
public
String
getOldInsurance
()
{
return
oldInsurance
;
}
public
void
setOldInsurance
(
String
oldInsurance
)
{
this
.
oldInsurance
=
oldInsurance
;
}
public
String
getUnemploymentInsurance
()
{
return
unemploymentInsurance
;
}
public
void
setUnemploymentInsurance
(
String
unemploymentInsurance
)
{
this
.
unemploymentInsurance
=
unemploymentInsurance
;
}
public
String
getHouseFund
()
{
return
houseFund
;
}
public
void
setHouseFund
(
String
houseFund
)
{
this
.
houseFund
=
houseFund
;
}
public
String
getLaborUnionDues
()
{
return
laborUnionDues
;
}
public
void
setLaborUnionDues
(
String
laborUnionDues
)
{
this
.
laborUnionDues
=
laborUnionDues
;
}
public
String
getAnnuity
()
{
return
annuity
;
}
public
void
setAnnuity
(
String
annuity
)
{
this
.
annuity
=
annuity
;
}
public
String
getWarmSubsidy
()
{
return
warmSubsidy
;
}
public
void
setWarmSubsidy
(
String
warmSubsidy
)
{
this
.
warmSubsidy
=
warmSubsidy
;
}
public
String
getSumSalary
()
{
return
sumSalary
;
}
public
void
setSumSalary
(
String
sumSalary
)
{
this
.
sumSalary
=
sumSalary
;
}
public
String
getLunch
()
{
return
lunch
;
}
public
void
setLunch
(
String
lunch
)
{
this
.
lunch
=
lunch
;
}
public
String
getOneChild
()
{
return
oneChild
;
}
public
void
setOneChild
(
String
oneChild
)
{
this
.
oneChild
=
oneChild
;
}
public
String
getMedicalSubsidy
()
{
return
medicalSubsidy
;
}
public
void
setMedicalSubsidy
(
String
medicalSubsidy
)
{
this
.
medicalSubsidy
=
medicalSubsidy
;
}
public
String
getEdufFees
()
{
return
edufFees
;
}
public
void
setEdufFees
(
String
edufFees
)
{
this
.
edufFees
=
edufFees
;
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/LjtSalaryService.java
0 → 100644
View file @
3fc8a6e7
package
com.ruoyi.system.service
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
org.springframework.web.multipart.MultipartFile
;
public
interface
LjtSalaryService
{
AjaxResult
ljtSave
(
MultipartFile
multipartFile
,
String
salaryDate
);
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/LjtSalaryServiceImpl.java
0 → 100644
View file @
3fc8a6e7
package
com.ruoyi.system.service.impl
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.fastjson.JSON
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.listener.LjtExcelListener
;
import
com.ruoyi.system.mapper.SalaryMapper
;
import
com.ruoyi.system.model.salary.LjtSalaryModel
;
import
com.ruoyi.system.service.LjtSalaryService
;
import
lombok.SneakyThrows
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.InputStream
;
import
java.util.List
;
@Service
public
class
LjtSalaryServiceImpl
implements
LjtSalaryService
{
private
final
SalaryMapper
salaryMapper
;
public
LjtSalaryServiceImpl
(
SalaryMapper
salaryMapper
)
{
this
.
salaryMapper
=
salaryMapper
;
}
@Override
@SneakyThrows
public
AjaxResult
ljtSave
(
MultipartFile
multipartFile
,
String
salaryDate
)
{
InputStream
inputStream
=
multipartFile
.
getInputStream
();
LjtExcelListener
<
LjtSalaryModel
>
ljtExcelListener
=
new
LjtExcelListener
<>();
//工资分析表
EasyExcel
.
read
(
inputStream
,
LjtSalaryModel
.
class
,
ljtExcelListener
).
sheet
(
0
).
headRowNumber
(
1
).
doRead
();
List
<
LjtSalaryModel
>
ljtSalaryModelList
=
ljtExcelListener
.
getLjtSalaryModelList
();
System
.
err
.
println
(
JSON
.
toJSONString
(
ljtSalaryModelList
));
return
null
;
}
}
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