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
92f2bcb4
Commit
92f2bcb4
authored
Apr 08, 2026
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.21-优化
parent
8852a331
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
71 deletions
+102
-71
TSalaryZeroVo.java
.../com/yifu/cloud/plus/v1/yifu/salary/vo/TSalaryZeroVo.java
+1
-1
TSalaryZeroServiceImpl.java
...s/v1/yifu/salary/service/impl/TSalaryZeroServiceImpl.java
+100
-70
SalaryConstants.java
.../yifu/cloud/plus/v1/yifu/salary/util/SalaryConstants.java
+1
-0
No files found.
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/vo/TSalaryZeroVo.java
View file @
92f2bcb4
...
...
@@ -89,7 +89,7 @@ public class TSalaryZeroVo extends RowIndex implements Serializable {
@ExcelAttribute
(
name
=
"减除费用"
,
isNotEmpty
=
true
,
errorInfo
=
"减除费用不能为空"
)
@Schema
(
description
=
"减除费用"
)
@ExcelProperty
(
"减除费用"
)
private
BigDecimal
costReduction
;
private
String
costReduction
;
/**
* 计税月份
*/
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryZeroServiceImpl.java
View file @
92f2bcb4
...
...
@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
com.yifu.cloud.plus.v1.yifu.salary.config.WxConfig
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryZeroMapper
;
...
...
@@ -61,6 +62,8 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
* 0申报
...
...
@@ -273,7 +276,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
/**
* 单次缓存的数据量
*/
public
static
final
int
MAX_ROWS
=
5
;
public
static
final
int
MAX_ROWS
=
5
00
;
private
int
rowCount
=
CommonConstants
.
ZERO_INT
;
/**
*临时存储
...
...
@@ -314,22 +317,29 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
codeList
.
add
(
data
.
getDeptNo
());
}
if
(
Common
.
isNotNull
(
data
.
getEmpPhone
()))
{
phoneList
.
add
(
data
.
getEmpPhone
());
}
if
(
Common
.
isNotNull
(
data
.
getEmpIdcard
()))
{
cardList
.
add
(
data
.
getEmpIdcard
());
if
(
cardRepeatMap
.
get
(
data
.
getEmpIdcard
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
data
.
getRowIndex
(),
"该身份证在本次导入表中有重复,请检查并修改后重新导入"
,
data
));
if
(!
ValidityUtil
.
validateEmpPhone
(
data
.
getEmpPhone
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
data
.
getRowIndex
(),
"手机号码格式错误,请检查并修改后重新导入"
,
data
));
}
else
{
cardRepeatMap
.
put
(
data
.
getEmpIdcard
(),
CommonConstants
.
ONE_INT
);
idCardCheck
=
new
TCheckIdCard
();
idCardCheck
.
setIdCard
(
data
.
getEmpIdcard
());
idCardCheck
.
setName
(
data
.
getEmpName
());
idCardCheck
.
setCreateUser
(
userId
);
idCardCheck
.
setReason
(
nickName
);
checkList
.
add
(
idCardCheck
);
cachedDataList
.
add
(
data
);
phoneList
.
add
(
data
.
getEmpPhone
());
if
(
Common
.
isNotNull
(
data
.
getEmpIdcard
()))
{
if
(
regIdCard
(
data
.
getEmpIdcard
()))
{
cardList
.
add
(
data
.
getEmpIdcard
());
if
(
cardRepeatMap
.
get
(
data
.
getEmpIdcard
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
data
.
getRowIndex
(),
"该身份证在本次导入表中有重复,请检查并修改后重新导入"
,
data
));
}
else
{
cardRepeatMap
.
put
(
data
.
getEmpIdcard
(),
CommonConstants
.
ONE_INT
);
idCardCheck
=
new
TCheckIdCard
();
idCardCheck
.
setIdCard
(
data
.
getEmpIdcard
());
idCardCheck
.
setName
(
data
.
getEmpName
());
idCardCheck
.
setCreateUser
(
userId
);
idCardCheck
.
setReason
(
nickName
);
checkList
.
add
(
idCardCheck
);
cachedDataList
.
add
(
data
);
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
data
.
getRowIndex
(),
"该身份证号基本格式不正确,请检查并修改后重新导入"
,
data
));
}
}
}
}
}
...
...
@@ -416,6 +426,16 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
}
}
private
static
boolean
regIdCard
(
String
content
)
{
boolean
flag
=
false
;
Pattern
p
=
Pattern
.
compile
(
"\\d{18}|\\d{17}X|\\d{15}|\\d{14}X"
);
Matcher
m
=
p
.
matcher
(
content
);
if
(
m
.
matches
())
{
flag
=
true
;
}
return
flag
;
}
private
void
importTSalaryZero
(
List
<
TSalaryZeroVo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
,
String
settleMonth
,
String
invoiceTitle
,
String
userName
,
Map
<
String
,
ProjectSetInfoVo
>
projectVoMap
,
Map
<
String
,
Integer
>
accountMap
,
Map
<
String
,
Boolean
>
idCardMap
,
Map
<
String
,
Boolean
>
phoneMap
...
...
@@ -444,74 +464,84 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
}
String
idCard
;
Boolean
resultB
;
BigDecimal
costReduction
;
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
excel
=
excelVOList
.
get
(
i
);
if
(
Common
.
isEmpty
(
excel
.
getCostReduction
())
||
excel
.
getCostReduction
().
remainder
(
SalaryConstants
.
COST_MONEY
).
compareTo
(
BigDecimal
.
ZERO
)
!=
CommonConstants
.
ZERO_INT
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
MONEY_ERROR
,
excel
));
}
else
{
if
(
Common
.
isNotNull
(
excel
.
getDeptNo
())
&&
projectVoMap
.
get
(
excel
.
getDeptNo
())
!=
null
)
{
if
(
accountMap
.
get
(
excel
.
getEmpIdcard
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
HAVE_ACCOUNT
,
excel
));
}
else
{
if
(
zeroMap
.
get
(
excel
.
getEmpIdcard
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
HAVE_ZERO
,
excel
));
if
(
Common
.
isNotNull
(
excel
.
getCostReduction
()))
{
try
{
costReduction
=
new
BigDecimal
(
excel
.
getCostReduction
());
}
catch
(
Exception
e
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
MONEY_NUM_ERROR
,
excel
));
continue
;
}
if
(
costReduction
.
compareTo
(
SalaryConstants
.
COST_MONEY
)
<
CommonConstants
.
ZERO_INT
||
costReduction
.
compareTo
(
SalaryConstants
.
MAX_COST_MONEY
)
>
CommonConstants
.
ZERO_INT
||
costReduction
.
remainder
(
SalaryConstants
.
COST_MONEY
).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
MONEY_ERROR
,
excel
));
}
else
{
if
(
Common
.
isNotNull
(
excel
.
getDeptNo
())
&&
projectVoMap
.
get
(
excel
.
getDeptNo
())
!=
null
)
{
if
(
accountMap
.
get
(
excel
.
getEmpIdcard
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
HAVE_ACCOUNT
,
excel
));
}
else
{
idCard
=
excel
.
getEmpIdcard
();
if
(
idCardFlag
==
0
)
{
if
(
Common
.
isNotNull
(
idCard
))
{
resultB
=
idCardMap
.
get
(
idCard
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getEmpName
());
if
(
resultB
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
resultB
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"姓名&身份证号不一致,请检查并修改后重新导入"
,
excel
));
if
(
zeroMap
.
get
(
excel
.
getEmpIdcard
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
HAVE_ZERO
,
excel
));
}
else
{
idCard
=
excel
.
getEmpIdcard
();
if
(
idCardFlag
==
0
)
{
if
(
Common
.
isNotNull
(
idCard
))
{
resultB
=
idCardMap
.
get
(
idCard
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getEmpName
());
if
(
resultB
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
resultB
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"姓名&身份证号不一致,请检查并修改后重新导入"
,
excel
));
continue
;
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"姓名&身份证号不一致,请检查并修改后重新导入!"
,
excel
));
continue
;
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"姓名&身份证号不一致,请检查并修改后重新导入!"
,
excel
));
}
}
else
if
(
idCardFlag
==
2
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"姓名&身份证号不一致,请检查并修改后重新导入!!"
,
excel
));
continue
;
}
resultB
=
phoneMap
.
get
(
excel
.
getEmpPhone
());
if
(
resultB
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
resultB
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"手机号校验不通过,请更改手机号后重试"
,
excel
));
continue
;
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"手机号校验不通过,请更改手机号后重试!"
,
excel
));
continue
;
}
}
else
if
(
idCardFlag
==
2
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"姓名&身份证号不一致,请检查并修改后重新导入!!"
,
excel
));
continue
;
}
resultB
=
phoneMap
.
get
(
excel
.
getEmpPhone
());
if
(
resultB
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
resultB
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"手机号校验不通过,请更改手机号后重试"
,
excel
));
if
(
judgeTaxMonth
(
excel
.
getTaxMonth
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"计税月份格式不正确!"
,
excel
));
continue
;
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"手机号校验不通过,请更改手机号后重试!"
,
excel
));
continue
;
}
insert
=
new
TSalaryZero
();
BeanUtil
.
copyProperties
(
excel
,
insert
);
insert
.
setSettleMonth
(
settleMonth
);
insert
.
setInvoiceTitle
(
invoiceTitle
);
insert
.
setDataSource
(
CommonConstants
.
THREE_STRING
);
insert
.
setImporterName
(
userName
);
insert
.
setCreateTime
(
now
);
dept
=
projectVoMap
.
get
(
excel
.
getDeptNo
());
if
(
dept
!=
null
)
{
insert
.
setDeptId
(
dept
.
getId
());
insert
.
setDeptName
(
dept
.
getDepartName
());
insert
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
insertList
.
add
(
insert
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_SUCCESS
,
excel
));
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
DEPT_ERROR
,
excel
));
}
if
(
judgeTaxMonth
(
excel
.
getTaxMonth
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"计税月份格式不正确!"
,
excel
));
continue
;
}
insert
=
new
TSalaryZero
();
BeanUtil
.
copyProperties
(
excel
,
insert
);
insert
.
setSettleMonth
(
settleMonth
);
insert
.
setInvoiceTitle
(
invoiceTitle
);
insert
.
setDataSource
(
CommonConstants
.
THREE_STRING
);
insert
.
setImporterName
(
userName
);
insert
.
setCreateTime
(
now
);
dept
=
projectVoMap
.
get
(
excel
.
getDeptNo
());
if
(
dept
!=
null
)
{
insert
.
setDeptId
(
dept
.
getId
());
insert
.
setDeptName
(
dept
.
getDepartName
());
insert
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
insertList
.
add
(
insert
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_SUCCESS
,
excel
));
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
DEPT_ERROR
,
excel
));
}
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
DEPT_ERROR
,
excel
));
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
SalaryConstants
.
DEPT_ERROR
,
excel
));
}
}
}
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/util/SalaryConstants.java
View file @
92f2bcb4
...
...
@@ -208,6 +208,7 @@ public class SalaryConstants {
public
static
final
String
VIEW_DAY_NAME_PRE
=
"view_salary_zero_day_"
;
public
static
final
String
MONEY_ERROR
=
"减除费用金额仅限5000~60000且是5000的倍数"
;
public
static
final
String
MONEY_NUM_ERROR
=
"减除费用只能是金额,不能是汉字等其他字符"
;
public
static
final
String
DEPT_ERROR
=
"根据项目编码未找到项目信息"
;
public
static
final
BigDecimal
COST_MONEY
=
new
BigDecimal
(
"5000"
);
// 最大减除费用
...
...
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