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
1455e78c
Commit
1455e78c
authored
Apr 17, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.2-工资原表识别-优化
parent
4e68f989
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
36 deletions
+41
-36
pom.xml
yifu-salary/yifu-salary-api/pom.xml
+6
-0
SalaryUploadParamVo.java
...ifu/cloud/plus/v1/yifu/salary/vo/SalaryUploadParamVo.java
+3
-0
TSalaryStandardOriginalController.java
.../salary/controller/TSalaryStandardOriginalController.java
+2
-1
TSalaryStandardOriginalService.java
...1/yifu/salary/service/TSalaryStandardOriginalService.java
+2
-1
TSalaryStandardOriginalServiceImpl.java
...lary/service/impl/TSalaryStandardOriginalServiceImpl.java
+28
-34
No files found.
yifu-salary/yifu-salary-api/pom.xml
View file @
1455e78c
...
...
@@ -48,5 +48,11 @@
<version>
1.0.0
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-check-api
</artifactId>
<version>
1.0.0
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/vo/SalaryUploadParamVo.java
View file @
1455e78c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
vo
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckIdCard
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardIssueRes
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -35,4 +36,6 @@ public class SalaryUploadParamVo {
// 代发户的配置list
List
<
TSalaryStandardIssueRes
>
resList
;
List
<
TCheckIdCard
>
checkList
;
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryStandardOriginalController.java
View file @
1455e78c
...
...
@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalDetailS
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.SalaryUploadOriginalParamVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadParamVo
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -262,7 +263,7 @@ public class TSalaryStandardOriginalController {
@SysLog
(
"新版原表识别导入"
)
@Operation
(
description
=
"新版原表识别导入"
)
@PostMapping
(
"/salaryUploadByOriginal"
)
public
R
<
List
<
ErrorMessage
>
>
salaryUploadByOriginal
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
vo
)
{
public
R
<
SalaryUploadParamVo
>
salaryUploadByOriginal
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
vo
)
{
return
tSalaryStandardOriginalService
.
salaryUploadByOriginal
(
file
,
vo
);
}
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryStandardOriginalService.java
View file @
1455e78c
...
...
@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal
;
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
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
...
...
@@ -62,6 +63,6 @@ public interface TSalaryStandardOriginalService extends IService<TSalaryStandard
* @Date: 2024/4/8 18:05
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
R
<
List
<
ErrorMessage
>
>
salaryUploadByOriginal
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
excelVo
);
R
<
SalaryUploadParamVo
>
salaryUploadByOriginal
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
excelVo
);
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardOriginalServiceImpl.java
View file @
1455e78c
...
...
@@ -622,25 +622,8 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
@Override
public
R
<
List
<
ErrorMessage
>>
salaryUploadByOriginal
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
excelVo
)
{
R
<
String
>
contR
=
this
.
getExcelContent
(
file
,
excelVo
);
if
(
contR
!=
null
)
{
if
(
CommonConstants
.
SUCCESS
.
equals
(
contR
.
getCode
()))
{
SalaryUploadParamVo
vo
=
new
SalaryUploadParamVo
();
vo
.
setJsonString
(
contR
.
getData
());
vo
.
setSalaryType
(
excelVo
.
getSalaryType
());
vo
.
setConfigId
(
excelVo
.
getConfigId
());
vo
.
setIsIssue
(
excelVo
.
getIsIssue
());
vo
.
setOrderId
(
excelVo
.
getOrderId
());
vo
.
setResList
(
excelVo
.
getResList
());
vo
.
setSettleDepart
(
excelVo
.
getSettleDepart
());
return
salaryUploadService
.
salaryUpload
(
vo
);
}
else
{
return
R
.
failed
(
contR
.
getMsg
());
}
}
else
{
return
R
.
failed
(
"原表识别无数据!请准备原表,联系管理员"
);
}
public
R
<
SalaryUploadParamVo
>
salaryUploadByOriginal
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
excelVo
)
{
return
this
.
getExcelContent
(
file
,
excelVo
);
}
/**
...
...
@@ -650,14 +633,14 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
* @Date: 2024-4-8 18:20:22
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.salary.vo.ExcelVo>
**/
private
R
<
String
>
getExcelContent
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
excelVo
)
{
String
sheetName
=
excelVo
.
getSheetName
();
// 配置
String
originalId
=
excelVo
.
getOriginalId
();
// 特殊身份证允许识别为数据行
List
<
String
>
specialIdCardList
=
baseMapper
.
getSpecialIdCardList
();
private
R
<
SalaryUploadParamVo
>
getExcelContent
(
MultipartFile
file
,
SalaryUploadOriginalParamVo
excelVo
)
{
try
{
String
sheetName
=
excelVo
.
getSheetName
();
// 配置
String
originalId
=
excelVo
.
getOriginalId
();
// 特殊身份证允许识别为数据行
List
<
String
>
specialIdCardList
=
baseMapper
.
getSpecialIdCardList
();
//对前端传递的文件进行校验
if
(
Common
.
isEmpty
(
originalId
))
{
return
R
.
failed
(
"识别配置为空,请选择识别配置!"
);
...
...
@@ -743,7 +726,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
int
i
=
0
;
List
<
TCheckIdCard
>
checkList
=
new
ArrayList
<>();
TCheckIdCard
check
;
StringBuilder
errMsg
=
new
StringBuilder
();
// StringBuilder errMsg = new StringBuilder()
for
(
Map
<
String
,
String
>
rowMap
:
vo
.
getContentList
())
{
i
++;
newRowMap
=
new
HashMap
<>();
...
...
@@ -781,7 +764,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
// 调用校验服务
String
pre
=
"姓名与身份证验证:"
;
/*
String pre = "姓名与身份证验证:";
R<TCheckIdCard> checkListR = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckidcard/inner/checkIdCardSingle", check, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
...
...
@@ -793,14 +776,14 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
} else {
errMsg.append("第 ").append(i).append(" 行:").append(check.getIdCard()).append(pre).append("校验服务器未返回,请联系管理员!!");
}
}
*/
checkList
.
add
(
check
);
contentList
.
add
(
newRowMap
);
}
if
(
Common
.
isNotNull
(
errMsg
)
&&
Common
.
isNotNull
(
errMsg
.
toString
()))
{
/*
if (Common.isNotNull(errMsg) && Common.isNotNull(errMsg.toString())) {
return R.failed(errMsg.toString());
}
}
*/
/*// 调用校验服务
CheckIdCardListVo checkVo = new CheckIdCardListVo();
...
...
@@ -830,13 +813,24 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
// 最后转化为jsonString
jsonString
=
JSON
.
toJSON
(
contentList
).
toString
();
SalaryUploadParamVo
returnVo
=
new
SalaryUploadParamVo
();
returnVo
.
setCheckList
(
checkList
);
returnVo
.
setJsonString
(
jsonString
);
returnVo
.
setSalaryType
(
excelVo
.
getSalaryType
());
returnVo
.
setConfigId
(
excelVo
.
getConfigId
());
returnVo
.
setIsIssue
(
excelVo
.
getIsIssue
());
returnVo
.
setOrderId
(
excelVo
.
getOrderId
());
returnVo
.
setResList
(
excelVo
.
getResList
());
returnVo
.
setSettleDepart
(
excelVo
.
getSettleDepart
());
//数据保存
return
R
.
ok
(
returnVo
);
}
//数据保存
return
R
.
ok
(
jsonString
);
return
R
.
failed
(
"无法识别数据!请联系管理员"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
return
R
.
failed
(
"无法识别数据!请联系管理员!"
)
;
}
}
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