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
e2c1b315
Commit
e2c1b315
authored
Apr 16, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.2-工资原表识别-优化
parent
67e44669
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
152 additions
and
7 deletions
+152
-7
EkpQiwiChuchai.java
.../cloud/plus/v1/yifu/permission/entity/EkpQiwiChuchai.java
+2
-0
QiWeiServiceImpl.java
...oud/plus/v1/permission/service/impl/QiWeiServiceImpl.java
+8
-0
EkpQiweiChuchaiMapper.xml
...n-biz/src/main/resources/mapper/EkpQiweiChuchaiMapper.xml
+2
-0
TSalaryStandardOriginalServiceImpl.java
...lary/service/impl/TSalaryStandardOriginalServiceImpl.java
+140
-7
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/EkpQiwiChuchai.java
View file @
e2c1b315
...
...
@@ -57,6 +57,8 @@ public class EkpQiwiChuchai {
private
String
fdPerson
;
@Schema
(
description
=
"出差地点"
)
private
String
fdAddress
;
@Schema
(
description
=
"出发地点"
)
private
String
fdOldAddress
;
@Schema
(
description
=
"出行工具"
)
private
String
fdTools
;
@Schema
(
description
=
"出差地点级别"
)
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/QiWeiServiceImpl.java
View file @
e2c1b315
...
...
@@ -338,6 +338,8 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
String
person
=
null
;
// 出差地点
String
address
=
null
;
// 出发地点
String
oldAddress
=
null
;
// 出行工具
String
tools
=
""
;
for
(
HashMap
content
:
contentList
)
{
...
...
@@ -378,6 +380,11 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
if
(
Common
.
isNotNull
(
value
))
{
address
=
value
.
getString
(
"text"
);
}
}
else
if
(
"出发地点"
.
equals
(((
JSONObject
)
title
.
get
(
0
)).
get
(
"text"
)))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
if
(
Common
.
isNotNull
(
value
))
{
oldAddress
=
value
.
getString
(
"text"
);
}
}
else
if
(
"出差地点级别"
.
equals
(((
JSONObject
)
title
.
get
(
0
)).
get
(
"text"
)))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
if
(
Common
.
isNotNull
(
value
))
{
...
...
@@ -442,6 +449,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
reimburse
.
setFdRenShu
(
renShu
);
reimburse
.
setFdPerson
(
person
);
reimburse
.
setFdAddress
(
address
);
reimburse
.
setFdOldAddress
(
oldAddress
);
reimburse
.
setFdTools
(
tools
);
reimburse
.
setFdAddressLevel
(
addressLevel
);
reimburse
.
setFdJiaoTong
(
jiaoTong
);
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/EkpQiweiChuchaiMapper.xml
View file @
e2c1b315
...
...
@@ -15,6 +15,7 @@
<result
property=
"fdReason"
column=
"FD_REASON"
/>
<result
property=
"fdPerson"
column=
"FD_PERSON"
/>
<result
property=
"fdAddress"
column=
"FD_ADDRESS"
/>
<result
property=
"fdOldAddress"
column=
"FD_OLD_ADDRESS"
/>
<result
property=
"fdTools"
column=
"FD_TOOLS"
/>
<result
property=
"fdAddressLevel"
column=
"FD_ADDRESS_LEVEL"
/>
<result
property=
"fdJiaoTong"
column=
"FD_JIAO_TONG"
/>
...
...
@@ -36,6 +37,7 @@
a.FD_REASON,
a.FD_PERSON,
a.FD_ADDRESS,
a.FD_OLD_ADDRESS,
a.FD_TOOLS,
a.FD_ADDRESS_LEVEL,
a.FD_JIAO_TONG,
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardOriginalServiceImpl.java
View file @
e2c1b315
...
...
@@ -181,6 +181,17 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
String
cellValue
;
// 内容行
int
dataRow
;
// 身份证所在列
int
idCardColumn
=
-
1
;
// 空白列起始号
int
nullColumn
=
-
1
;
// 上一个空白行
int
preNullColumn
=
-
1
;
// 空白列数(一旦数量达到 maxNullColumNum,将停止循环列,并删除title list与content)
int
nullColumnNum
=
0
;
// 极限空白列,超过阈值,将不继续循环列
int
maxNullColumNum
=
10
;
String
idCardValue
=
null
;
// 数据行是否被确认,true否
boolean
dataRowFlag
;
HSSFCell
cell
;
...
...
@@ -198,6 +209,12 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
dataRowFlag
=
true
;
// 循环当前sheet的每行内容
for
(
int
rowNum
=
0
;
rowNum
<=
sheetAt
.
getLastRowNum
();
rowNum
++)
{
nullColumn
=
-
1
;
preNullColumn
=
-
1
;
nullColumnNum
=
0
;
idCardValue
=
null
;
contentMap
=
new
HashMap
<>();
columnList
=
new
ArrayList
<>();
row
=
sheetAt
.
getRow
(
rowNum
);
...
...
@@ -229,18 +246,20 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
else
if
(
CellType
.
BOOLEAN
==
cell
.
getCellType
())
{
cellValue
=
String
.
valueOf
(
row
.
getCell
(
cellNum
).
getBooleanCellValue
());
}
else
{
cell
.
setCellType
(
CellType
.
STRING
);
cellValue
=
row
.
getCell
(
cellNum
).
getStringCellValue
();
}
}
}
catch
(
Exception
e
)
{
cellValue
=
""
;
//sheetVo.setErrorInfo("请注意单元格格式,第" + (i + 1) + "个sheet,第" + (rowNum + 1) + "行第" + (cellNum + 1) + "列。" + e.getMessage())
//return sheetVo
}
if
(
Common
.
isNotNull
(
cellValue
)
&&
dataRowFlag
&&
(((
cellValue
.
length
()
==
15
||
cellValue
.
length
()
==
18
)
&&
regIdCard
(
cellValue
))
// 特殊身份证允许识别
||
regSpecialIdCard
(
cellValue
,
specialIdCardList
)))
{
dataRow
=
rowNum
;
idCardColumn
=
cellNum
;
dataRowFlag
=
false
;
}
columnVo
.
setLineNum
(
cellNum
);
...
...
@@ -250,10 +269,51 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
contentMap
.
put
(
String
.
valueOf
(
cellNum
),
cellValue
);
if
(
dataRowFlag
)
{
if
(
Common
.
isEmpty
(
cellValue
)
&&
titleMap
.
get
(
String
.
valueOf
(
cellNum
))
!=
null
)
{
columnVo
.
setContent
(
titleMap
.
get
(
String
.
valueOf
(
cellNum
)));
if
(
Common
.
isEmpty
(
cellValue
))
{
if
(
titleMap
.
get
(
String
.
valueOf
(
cellNum
))
!=
null
)
{
columnVo
.
setContent
(
titleMap
.
get
(
String
.
valueOf
(
cellNum
)));
}
else
{
if
(
preNullColumn
==
-
1
||
preNullColumn
+
1
==
cellNum
)
{
if
(
nullColumn
==
-
1
)
{
nullColumn
=
cellNum
;
}
preNullColumn
=
cellNum
;
nullColumnNum
++;
}
columnVo
.
setContent
(
"空白列"
+
cellNum
);
}
}
else
{
nullColumn
=
-
1
;
preNullColumn
=
-
1
;
nullColumnNum
=
0
;
}
columnList
.
add
(
columnVo
);
}
else
{
if
(
Common
.
isEmpty
(
cellValue
))
{
if
(
preNullColumn
==
-
1
||
preNullColumn
+
1
==
cellNum
)
{
if
(
nullColumn
==
-
1
)
{
nullColumn
=
cellNum
;
}
preNullColumn
=
cellNum
;
nullColumnNum
++;
}
}
else
{
nullColumn
=
-
1
;
preNullColumn
=
-
1
;
nullColumnNum
=
0
;
}
}
if
(
nullColumnNum
>=
maxNullColumNum
)
{
for
(
int
num
=
maxNullColumNum
-
1
;
num
>=
0
;
num
--)
{
if
(
dataRowFlag
)
{
columnList
.
remove
(
nullColumn
+
num
);
}
contentMap
.
remove
(
String
.
valueOf
(
nullColumn
+
num
));
}
break
;
}
if
(
idCardColumn
!=
-
1
&&
cellNum
==
idCardColumn
)
{
idCardValue
=
cellValue
;
}
}
if
(!
dataRowFlag
)
{
...
...
@@ -268,6 +328,13 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
if
(
titleFlag
&&
!
dataRowFlag
)
{
break
;
}
// 阻断空白行
if
(
idCardColumn
!=
-
1
&&
Common
.
isEmpty
(
idCardValue
))
{
if
(!
contentList
.
isEmpty
()
&&
contentList
.
size
()
>
1
)
{
contentList
.
remove
(
contentList
.
size
()
-
1
);
}
break
;
}
}
if
(
dataRowFlag
)
{
return
R
.
failed
(
"未找到身份证所在的数据行,请检查表数据!!"
);
...
...
@@ -324,6 +391,17 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
String
cellValue
;
// 内容行
int
dataRow
;
// 身份证所在列
int
idCardColumn
=
-
1
;
// 空白列起始号
int
nullColumn
=
-
1
;
// 上一个空白行
int
preNullColumn
=
-
1
;
// 空白列数(一旦数量达到 maxNullColumNum,将停止循环列,并删除title list与content)
int
nullColumnNum
=
0
;
// 极限空白列,超过阈值,将不继续循环列
int
maxNullColumNum
=
10
;
String
idCardValue
=
null
;
// 数据行是否被确认,true否
boolean
dataRowFlag
;
XSSFCell
cell
;
...
...
@@ -341,6 +419,12 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
dataRowFlag
=
true
;
// 循环当前sheet的每行内容
for
(
int
rowNum
=
0
;
rowNum
<=
sheetAt
.
getLastRowNum
();
rowNum
++)
{
nullColumn
=
-
1
;
preNullColumn
=
-
1
;
nullColumnNum
=
0
;
idCardValue
=
null
;
contentMap
=
new
HashMap
<>();
columnList
=
new
ArrayList
<>();
row
=
sheetAt
.
getRow
(
rowNum
);
...
...
@@ -377,14 +461,15 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
}
catch
(
Exception
e
)
{
cellValue
=
""
;
//sheetVo.setErrorInfo("请注意单元格格式,第" + (i + 1) + "个sheet,第" + (rowNum + 1) + "行第" + (cellNum + 1) + "列。" + e.getMessage())
;
//return sheetVo
;
//sheetVo.setErrorInfo("请注意单元格格式,第" + (i + 1) + "个sheet,第" + (rowNum + 1) + "行第" + (cellNum + 1) + "列。" + e.getMessage())
//return sheetVo
}
if
(
Common
.
isNotNull
(
cellValue
)
&&
dataRowFlag
&&
(((
cellValue
.
length
()
==
15
||
cellValue
.
length
()
==
18
)
&&
regIdCard
(
cellValue
))
// 特殊身份证允许识别
||
regSpecialIdCard
(
cellValue
,
specialIdCardList
)))
{
dataRow
=
rowNum
;
idCardColumn
=
cellNum
;
dataRowFlag
=
false
;
}
columnVo
.
setLineNum
(
cellNum
);
...
...
@@ -394,10 +479,51 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
contentMap
.
put
(
String
.
valueOf
(
cellNum
),
cellValue
);
if
(
dataRowFlag
)
{
if
(
Common
.
isEmpty
(
cellValue
)
&&
titleMap
.
get
(
String
.
valueOf
(
cellNum
))
!=
null
)
{
columnVo
.
setContent
(
titleMap
.
get
(
String
.
valueOf
(
cellNum
)));
if
(
Common
.
isEmpty
(
cellValue
))
{
if
(
titleMap
.
get
(
String
.
valueOf
(
cellNum
))
!=
null
)
{
columnVo
.
setContent
(
titleMap
.
get
(
String
.
valueOf
(
cellNum
)));
}
else
{
if
(
preNullColumn
==
-
1
||
preNullColumn
+
1
==
cellNum
)
{
if
(
nullColumn
==
-
1
)
{
nullColumn
=
cellNum
;
}
preNullColumn
=
cellNum
;
nullColumnNum
++;
}
columnVo
.
setContent
(
"空白列"
+
cellNum
);
}
}
else
{
nullColumn
=
-
1
;
preNullColumn
=
-
1
;
nullColumnNum
=
0
;
}
columnList
.
add
(
columnVo
);
}
else
{
if
(
Common
.
isEmpty
(
cellValue
))
{
if
(
preNullColumn
==
-
1
||
preNullColumn
+
1
==
cellNum
)
{
if
(
nullColumn
==
-
1
)
{
nullColumn
=
cellNum
;
}
preNullColumn
=
cellNum
;
nullColumnNum
++;
}
}
else
{
nullColumn
=
-
1
;
preNullColumn
=
-
1
;
nullColumnNum
=
0
;
}
}
if
(
nullColumnNum
>=
maxNullColumNum
)
{
for
(
int
num
=
maxNullColumNum
-
1
;
num
>=
0
;
num
--)
{
if
(
dataRowFlag
)
{
columnList
.
remove
(
nullColumn
+
num
);
}
contentMap
.
remove
(
String
.
valueOf
(
nullColumn
+
num
));
}
break
;
}
if
(
idCardColumn
!=
-
1
&&
cellNum
==
idCardColumn
)
{
idCardValue
=
cellValue
;
}
}
if
(!
dataRowFlag
)
{
...
...
@@ -412,6 +538,13 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
if
(
titleFlag
&&
!
dataRowFlag
)
{
break
;
}
// 阻断空白行
if
(
idCardColumn
!=
-
1
&&
Common
.
isEmpty
(
idCardValue
))
{
if
(!
contentList
.
isEmpty
()
&&
contentList
.
size
()
>
1
)
{
contentList
.
remove
(
contentList
.
size
()
-
1
);
}
break
;
}
}
if
(
dataRowFlag
)
{
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