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
4e68f989
Commit
4e68f989
authored
Apr 16, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.2-工资原表识别-优化
parent
ec9092bb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
1 deletion
+129
-1
CheckIdCardListVo.java
...va/com/yifu/cloud/plus/v1/check/vo/CheckIdCardListVo.java
+22
-0
TCheckIdCardController.java
...loud/plus/v1/check/controller/TCheckIdCardController.java
+33
-0
TSalaryStandardOriginalServiceImpl.java
...lary/service/impl/TSalaryStandardOriginalServiceImpl.java
+72
-0
SalaryConstants.java
.../yifu/cloud/plus/v1/yifu/salary/util/SalaryConstants.java
+2
-1
No files found.
yifu-check/yifu-check-api/src/main/java/com/yifu/cloud/plus/v1/check/vo/CheckIdCardListVo.java
0 → 100644
View file @
4e68f989
package
com
.
yifu
.
cloud
.
plus
.
v1
.
check
.
vo
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckIdCard
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @Author hgw
* @Date 2024-4-16 19:39:51
*/
@Data
public
class
CheckIdCardListVo
implements
Serializable
{
// 200:成功; 其他:失败
private
int
code
;
// 错误信息
private
String
errorMsg
;
// 其他内容
private
List
<
TCheckIdCard
>
checkList
=
new
ArrayList
<>();
}
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/controller/TCheckIdCardController.java
View file @
4e68f989
...
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckIdCard
;
import
com.yifu.cloud.plus.v1.check.service.TCheckIdCardService
;
import
com.yifu.cloud.plus.v1.check.vo.CheckIdCardListVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
...
...
@@ -176,4 +178,35 @@ public class TCheckIdCardController {
public
R
<
List
<
TCheckIdCard
>>
checkSalaryIdCard
(
@RequestBody
List
<
TCheckIdCard
>
checkList
)
{
return
tCheckIdCardService
.
checkSalaryIdCard
(
checkList
);
}
/**
* @Description: 批量校验姓名身份证
* @Author: hgw
* @Date: 2024-4-16 19:47:20
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Operation
(
description
=
"批量校验姓名身份证"
)
@SysLog
(
"批量校验姓名身份证"
)
@Inner
@PostMapping
(
"/inner/checkIdCardList"
)
public
CheckIdCardListVo
checkIdCardList
(
@RequestBody
CheckIdCardListVo
vo
)
{
CheckIdCardListVo
returnVo
=
new
CheckIdCardListVo
();
R
<
List
<
TCheckIdCard
>>
checkR
=
tCheckIdCardService
.
checkSalaryIdCard
(
vo
.
getCheckList
());
if
(
checkR
!=
null
)
{
if
(
checkR
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
returnVo
.
setCode
(
CommonConstants
.
SUCCESS
);
return
returnVo
;
}
else
{
returnVo
.
setCode
(
checkR
.
getCode
());
returnVo
.
setErrorMsg
(
checkR
.
getMsg
());
returnVo
.
setCheckList
(
checkR
.
getData
());
return
returnVo
;
}
}
else
{
returnVo
.
setCode
(
CommonConstants
.
FAIL
);
returnVo
.
setErrorMsg
(
"校验服务无返回!"
);
return
returnVo
;
}
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardOriginalServiceImpl.java
View file @
4e68f989
...
...
@@ -20,10 +20,15 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckIdCard
;
import
com.yifu.cloud.plus.v1.check.vo.CheckIdCardListVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardOriginalMapper
;
...
...
@@ -43,6 +48,8 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -66,9 +73,11 @@ import java.util.regex.Pattern;
@Log4j2
@Service
@AllArgsConstructor
@EnableConfigurationProperties
({
DaprCheckProperties
.
class
})
public
class
TSalaryStandardOriginalServiceImpl
extends
ServiceImpl
<
TSalaryStandardOriginalMapper
,
TSalaryStandardOriginal
>
implements
TSalaryStandardOriginalService
{
private
DaprCheckProperties
checkProperties
;
private
final
SalaryUploadService
salaryUploadService
;
private
final
TSalaryStandardOriginalDetailService
tSalaryStandardOriginalDetailService
;
...
...
@@ -732,9 +741,13 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
String
value
;
String
oldValue
;
int
i
=
0
;
List
<
TCheckIdCard
>
checkList
=
new
ArrayList
<>();
TCheckIdCard
check
;
StringBuilder
errMsg
=
new
StringBuilder
();
for
(
Map
<
String
,
String
>
rowMap
:
vo
.
getContentList
())
{
i
++;
newRowMap
=
new
HashMap
<>();
check
=
new
TCheckIdCard
();
for
(
Map
.
Entry
<
String
,
String
>
column
:
rowMap
.
entrySet
())
{
detail
=
detailMap
.
get
(
column
.
getKey
());
if
(
detail
!=
null
&&
Common
.
isNotNull
(
detail
.
getModelName
()))
{
...
...
@@ -752,10 +765,69 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
return
R
.
failed
(
"第 "
+
i
+
" 行,第 "
+
(
Integer
.
parseInt
(
column
.
getKey
())
+
1
)
+
" 列 不是金额,不可以进行加减计算!"
);
}
newRowMap
.
put
(
detail
.
getModelName
(),
value
);
if
(
SalaryConstants
.
ID_NUMBER
.
equals
(
detail
.
getModelName
()))
{
check
.
setIdCard
(
value
);
}
if
(
SalaryConstants
.
EMP_NAME2
.
equals
(
detail
.
getModelName
()))
{
check
.
setName
(
value
);
}
}
}
if
(
Common
.
isEmpty
(
check
.
getIdCard
()))
{
return
R
.
failed
(
"第 "
+
i
+
" 行,无身份证号!"
);
}
if
(
Common
.
isEmpty
(
check
.
getName
()))
{
return
R
.
failed
(
"第 "
+
i
+
" 行,无员工姓名!"
);
}
// 调用校验服务
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
)
{
TCheckIdCard
checkR
=
checkListR
.
getData
();
if
(
checkR
==
null
||
Common
.
isEmpty
(
checkR
.
getIsTrue
()))
{
errMsg
.
append
(
"第 "
).
append
(
i
).
append
(
" 行:"
).
append
(
check
.
getIdCard
()).
append
(
pre
).
append
(
"校验服务器未返回,请联系管理员!"
);
}
else
if
(
checkR
.
getIsTrue
()
==
CommonConstants
.
ZERO_INT
)
{
errMsg
.
append
(
"第 "
).
append
(
i
).
append
(
" 行:"
).
append
(
check
.
getIdCard
()).
append
(
pre
).
append
(
check
.
getReason
());
}
}
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
()))
{
return
R
.
failed
(
errMsg
.
toString
());
}
/*// 调用校验服务
CheckIdCardListVo checkVo = new CheckIdCardListVo();
checkVo.setCheckList(checkList);
R<CheckIdCardListVo> checkListR = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckidcard/inner/checkIdCardList", checkVo, CheckIdCardListVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckIdCardListVo checkReturnVo = checkListR.getData();
if (checkReturnVo.getCode() != CommonConstants.SUCCESS) {
if (checkReturnVo.getCheckList() != null && !checkReturnVo.getCheckList().isEmpty()) {
int cardRow = 0;
StringBuilder errMsg = new StringBuilder();
for (TCheckIdCard card : checkReturnVo.getCheckList()) {
cardRow++;
if (card.getIsTrue() == 0) {
errMsg.append(" 第").append(cardRow).append("行:").append(card.getIdCard()).append(",姓名身份证校验错误! ");
}
}
return R.failed(errMsg.toString());
} else {
return R.failed(checkReturnVo.getErrorMsg());
}
}
} else {
return R.failed("原表识别校验姓名身份证,但是校验服务器未返回,请联系管理员!");
}*/
// 最后转化为jsonString
jsonString
=
JSON
.
toJSON
(
contentList
).
toString
();
}
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/util/SalaryConstants.java
View file @
4e68f989
...
...
@@ -39,6 +39,7 @@ public class SalaryConstants {
//模板列必填
public
static
final
String
IS_MUST
=
"1"
;
public
static
final
String
EMP_NAME
=
"姓名"
;
public
static
final
String
EMP_NAME2
=
"员工姓名"
;
public
static
final
String
IF_NEW_EMPLOYEE
=
"是否新员工(默认否)"
;
public
static
final
String
IS_NEW_EMPLOYEE
=
"是否新员工"
;
public
static
final
String
IS_NEW
=
"是"
;
...
...
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