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
84c72702
Commit
84c72702
authored
Apr 12, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.2-工资原表识别-主逻辑提交
parent
a4b7790d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
25 deletions
+29
-25
TSalaryStandardOriginalController.java
.../salary/controller/TSalaryStandardOriginalController.java
+28
-24
TSalaryStandardOriginalMapper.xml
...c/main/resources/mapper/TSalaryStandardOriginalMapper.xml
+1
-1
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryStandardOriginalController.java
View file @
84c72702
...
...
@@ -132,20 +132,35 @@ public class TSalaryStandardOriginalController {
@Transactional
public
R
<
Boolean
>
updateById
(
@RequestBody
TSalaryStandardOriginal
tSalaryStandardOriginal
)
{
List
<
TSalaryStandardOriginalDetail
>
detailList
=
tSalaryStandardOriginal
.
getDetailList
();
if
(
detailList
==
null
||
detailList
.
isEmpty
())
{
return
R
.
failed
(
"请传配置表头list"
);
}
// 先删除关系
tSalaryStandardOriginalDetailService
.
deleteByOrgId
(
tSalaryStandardOriginal
.
getId
());
for
(
TSalaryStandardOriginalDetail
detail
:
detailList
)
{
detail
.
setOriginalId
(
tSalaryStandardOriginal
.
getId
());
if
(
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getId
())
&&
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getDeptId
())
&&
Common
.
isNotNull
(
tSalaryStandardOriginal
.
getSetName
())){
List
<
TSalaryStandardOriginalDetail
>
detailList
=
tSalaryStandardOriginal
.
getDetailList
();
if
(
detailList
==
null
||
detailList
.
isEmpty
())
{
return
R
.
failed
(
"请传配置表头list"
);
}
// 判重
TSalaryStandardOriginal
isCur
=
new
TSalaryStandardOriginal
();
isCur
.
setId
(
tSalaryStandardOriginal
.
getId
());
isCur
.
setDeptId
(
tSalaryStandardOriginal
.
getDeptId
());
isCur
.
setSetName
(
tSalaryStandardOriginal
.
getSetName
());
List
<
TSalaryStandardOriginal
>
curList
=
tSalaryStandardOriginalService
.
getTSalaryStandardOriginalList
(
isCur
);
if
(
curList
!=
null
&&
!
curList
.
isEmpty
())
{
return
R
.
failed
(
"该项目下已存在此原表类型,请修改!"
);
}
// 先删除关系
tSalaryStandardOriginalDetailService
.
deleteByOrgId
(
tSalaryStandardOriginal
.
getId
());
for
(
TSalaryStandardOriginalDetail
detail
:
detailList
)
{
detail
.
setOriginalId
(
tSalaryStandardOriginal
.
getId
());
}
// 再新增权限
tSalaryStandardOriginalDetailService
.
saveBatch
(
detailList
);
// 再保存
tSalaryStandardOriginalService
.
updateById
(
tSalaryStandardOriginal
);
return
R
.
ok
(
true
);
}
else
{
return
R
.
failed
(
"请传参!"
);
}
// 再新增权限
tSalaryStandardOriginalDetailService
.
saveBatch
(
detailList
);
// 再保存
tSalaryStandardOriginalService
.
updateById
(
tSalaryStandardOriginal
);
return
R
.
ok
(
true
);
}
/**
...
...
@@ -231,17 +246,6 @@ public class TSalaryStandardOriginalController {
}
}
public
static
MultipartFile
convert
(
String
data
,
String
filename
,
String
contentType
)
throws
Exception
{
byte
[]
bytes
=
data
.
getBytes
();
InputStream
inputStream
=
new
ByteArrayInputStream
(
bytes
);
FileItem
fileItem
=
new
DiskFileItem
(
"file"
,
contentType
,
false
,
filename
,
bytes
.
length
,
new
File
(
"/originalTmp"
));
fileItem
.
getOutputStream
().
write
(
bytes
);
return
new
CommonsMultipartFile
(
fileItem
);
}
/**
* @Description: 获取表头等信息
* @Author: hgw
...
...
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TSalaryStandardOriginalMapper.xml
View file @
84c72702
...
...
@@ -64,7 +64,7 @@
<sql
id=
"TSalaryStandardOriginal_where"
>
<if
test=
"tSalaryStandardOriginal != null"
>
<if
test=
"tSalaryStandardOriginal.id != null and tSalaryStandardOriginal.id.trim() != ''"
>
AND a.ID = #{tSalaryStandardOriginal.id}
AND a.ID
!
= #{tSalaryStandardOriginal.id}
</if>
<if
test=
"tSalaryStandardOriginal.deptId != null and tSalaryStandardOriginal.deptId.trim() != ''"
>
AND a.DEPT_ID = #{tSalaryStandardOriginal.deptId}
...
...
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