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
ff2715fd
Commit
ff2715fd
authored
Apr 16, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.2-工资原表识别-优化
parent
aecf5217
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
240 additions
and
78 deletions
+240
-78
EkpQiwiChuchai.java
.../cloud/plus/v1/yifu/permission/entity/EkpQiwiChuchai.java
+20
-12
QiWeiUserVo.java
...om/yifu/cloud/plus/v1/yifu/permission/vo/QiWeiUserVo.java
+23
-0
EkpQiweiChuchaiMapper.java
...loud/plus/v1/permission/mapper/EkpQiweiChuchaiMapper.java
+3
-0
QiWeiServiceImpl.java
...oud/plus/v1/permission/service/impl/QiWeiServiceImpl.java
+100
-27
EkpQiweiChuchaiMapper.xml
...n-biz/src/main/resources/mapper/EkpQiweiChuchaiMapper.xml
+25
-12
TSalaryStandardOriginalDetail.java
.../v1/yifu/salary/entity/TSalaryStandardOriginalDetail.java
+1
-2
TSalaryStandardOriginalServiceImpl.java
...lary/service/impl/TSalaryStandardOriginalServiceImpl.java
+51
-24
TSalaryStandardOriginalMapper.xml
...c/main/resources/mapper/TSalaryStandardOriginalMapper.xml
+17
-1
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/EkpQiwiChuchai.java
View file @
ff2715fd
...
...
@@ -32,38 +32,46 @@ public class EkpQiwiChuchai {
@Schema
(
description
=
"审批编号"
)
@NotBlank
(
message
=
"审批编号不能为空"
)
private
String
s
pNo
;
private
String
fdS
pNo
;
@Schema
(
description
=
"申请人姓名"
)
@NotBlank
(
message
=
"申请人姓名不能为空"
)
private
String
a
pplyUserName
;
private
String
fdA
pplyUserName
;
@Schema
(
description
=
"申请人部门"
)
@NotBlank
(
message
=
"申请人部门不能为空"
)
private
String
a
pplyUserDept
;
private
String
fdA
pplyUserDept
;
@Schema
(
description
=
"申请日期"
)
@NotNull
(
message
=
"申请日期不能为空"
)
private
LocalDateTime
a
pplyDate
;
private
LocalDateTime
fdA
pplyDate
;
@Schema
(
description
=
"开始日期"
)
private
LocalDate
n
ewBegin
;
private
LocalDate
fdN
ewBegin
;
@Schema
(
description
=
"结束日期"
)
private
LocalDate
n
ewEnd
;
private
LocalDate
fdN
ewEnd
;
@Schema
(
description
=
"出差事由"
)
private
String
r
eason
;
private
String
fdR
eason
;
@Schema
(
description
=
"随行人员"
)
private
String
p
erson
;
private
String
fdP
erson
;
@Schema
(
description
=
"出差地点"
)
private
String
a
ddress
;
private
String
fdA
ddress
;
@Schema
(
description
=
"出行工具"
)
private
String
tools
;
private
String
fdTools
;
@Schema
(
description
=
"出差地点级别"
)
private
String
fdAddressLevel
;
@Schema
(
description
=
"交通补助"
)
private
String
fdJiaoTong
;
@Schema
(
description
=
"餐饮补助"
)
private
String
fdCanYin
;
@Schema
(
description
=
"人数"
)
private
Integer
fdRenShu
;
// status 0 初始;1已结算;
@Schema
(
description
=
"结算状态"
)
private
String
s
tatus
;
private
String
fdS
tatus
;
@Schema
(
description
=
"关联结算ID"
)
private
String
s
ettleFormId
;
private
String
fdS
ettleFormId
;
@Schema
(
description
=
"创建时间"
)
private
LocalDateTime
createTime
;
...
...
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/QiWeiUserVo.java
0 → 100644
View file @
ff2715fd
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
permission
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author hgw
* @Date 2024-4-16 15:04:11
* @Description 企业微信用户vo
* @Version 1.0
*/
@Data
public
class
QiWeiUserVo
implements
Serializable
{
@Schema
(
description
=
"用户id"
)
private
String
userId
;
@Schema
(
description
=
"用户姓名"
)
private
String
userName
;
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/EkpQiweiChuchaiMapper.java
View file @
ff2715fd
...
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.permission.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiChuchai
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.QiWeiUserVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -23,6 +24,8 @@ public interface EkpQiweiChuchaiMapper extends BaseMapper<EkpQiwiChuchai> {
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.salary.TStatisticsProjectReimburse>
**/
List
<
EkpQiwiChuchai
>
getAllInfo
(
@Param
(
"status"
)
String
status
);
List
<
QiWeiUserVo
>
getQiYeWeiXinUserList
();
}
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/QiWeiServiceImpl.java
View file @
ff2715fd
...
...
@@ -12,6 +12,7 @@ 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.R
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiChuchai
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.QiWeiUserVo
;
import
lombok.AllArgsConstructor
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
...
...
@@ -75,6 +76,8 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
// 已被拉取的Map
Map
<
String
,
String
>
cpMap
=
this
.
getAllMap
();
// 企微姓名Map
Map
<
String
,
String
>
userMap
=
this
.
getUserMap
();
// 一个月的全量数据
List
<
EkpQiwiChuchai
>
cpAllList
=
new
ArrayList
<>();
List
<
EkpQiwiChuchai
>
returnCpList
=
new
ArrayList
<>();
...
...
@@ -82,21 +85,30 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
this
.
getCostPaymentListByMonth
(
startTime
,
endTime
,
cpAllList
);
if
(!
cpAllList
.
isEmpty
())
{
for
(
EkpQiwiChuchai
cp
:
cpAllList
)
{
if
(
cpMap
.
get
(
cp
.
getSpNo
())
==
null
)
{
if
(
cpMap
.
get
(
cp
.
get
Fd
SpNo
())
==
null
)
{
returnCpList
.
add
(
cp
);
}
}
}
returnCpList
=
new
ArrayList
<>();
EkpQiwiChuchai
cp
=
new
EkpQiwiChuchai
();
cp
.
setFdSpNo
(
"202404160069"
);
returnCpList
.
add
(
cp
);
cp
=
new
EkpQiwiChuchai
();
cp
.
setFdSpNo
(
"202404160075"
);
returnCpList
.
add
(
cp
);
// 填充详情
if
(!
returnCpList
.
isEmpty
())
{
log
.
error
(
"拉取企业微信出差数据:"
+
returnCpList
.
size
()+
" 条,开始循环拉取明细!"
);
this
.
getTStatisticsProjectReimburseDetail
(
returnCpList
);
this
.
getTStatisticsProjectReimburseDetail
(
returnCpList
,
userMap
);
log
.
error
(
"拉取企业微信出差数据结束"
);
}
// 填充基础数据并保存:
if
(!
returnCpList
.
isEmpty
())
{
this
.
saveBatch
(
returnCpList
);
}
cpMap
.
clear
();
userMap
.
clear
();
return
new
R
<>(
returnCpList
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -188,7 +200,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
* @Date: 2024-4-12 16:55:00
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TStatisticsProjectReimburse>
**/
private
R
<
List
<
EkpQiwiChuchai
>>
getTStatisticsProjectReimburseDetail
(
List
<
EkpQiwiChuchai
>
list
)
{
private
R
<
List
<
EkpQiwiChuchai
>>
getTStatisticsProjectReimburseDetail
(
List
<
EkpQiwiChuchai
>
list
,
Map
<
String
,
String
>
userMap
)
{
String
accessToken
=
wxConfig
.
getReimbursementToken
(
restTemplate
);
int
i
=
1
;
JSONObject
jsonDetail
;
...
...
@@ -205,7 +217,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
for
(
EkpQiwiChuchai
r
:
list
)
{
log
.
error
(
"企业微信出差【"
+
i
+
"/"
+
""
+
list
.
size
()+
"】条"
);
jsonDetail
=
new
JSONObject
();
jsonDetail
.
put
(
"sp_no"
,
r
.
getSpNo
());
jsonDetail
.
put
(
"sp_no"
,
r
.
get
Fd
SpNo
());
formEntityDetail
=
new
HttpEntity
<>(
jsonDetail
.
toString
(),
headers
);
dataResultDetail
=
restTemplate
.
postForEntity
(
SecurityConstants
.
WX_GET_APPROVAL_DETAIL
,
formEntityDetail
,
String
.
class
,
accessToken
).
getBody
();
if
(
Common
.
isEmpty
(
dataResultDetail
))
{
...
...
@@ -219,7 +231,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
}
// 详细信息
info
=
jsonObject
.
getString
(
"info"
);
this
.
setTStatisticsProjectReimburseDetail
(
info
,
r
);
this
.
setTStatisticsProjectReimburseDetail
(
info
,
r
,
userMap
);
if
(
i
++
>=
600
)
{
// 企业微信频率限制:接口频率限制 600次/分钟
try
{
...
...
@@ -242,11 +254,20 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
List
<
EkpQiwiChuchai
>
cpHistoryList
=
baseMapper
.
getAllInfo
(
null
);
Map
<
String
,
String
>
cpMap
=
new
HashMap
<>();
for
(
EkpQiwiChuchai
cpHis
:
cpHistoryList
)
{
cpMap
.
put
(
cpHis
.
getSpNo
(),
"0"
);
cpMap
.
put
(
cpHis
.
get
Fd
SpNo
(),
"0"
);
}
return
cpMap
;
}
private
Map
<
String
,
String
>
getUserMap
()
{
List
<
QiWeiUserVo
>
userList
=
baseMapper
.
getQiYeWeiXinUserList
();
Map
<
String
,
String
>
userMap
=
new
HashMap
<>();
for
(
QiWeiUserVo
cpHis
:
userList
)
{
userMap
.
put
(
cpHis
.
getUserId
(),
cpHis
.
getUserName
());
}
return
userMap
;
}
/**
* @param jsonObject
* @param cpList
...
...
@@ -262,10 +283,10 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
List
<
String
>
dataList
=
JSON
.
parseArray
(
data
,
String
.
class
);
for
(
String
datas
:
dataList
)
{
cp
=
new
EkpQiwiChuchai
();
cp
.
setApplyDate
(
LocalDateTime
.
now
());
cp
.
setApplyUserName
(
"张三"
);
cp
.
setSpNo
(
datas
);
cp
.
setStatus
(
CommonConstants
.
ZERO_STRING
);
cp
.
set
Fd
ApplyDate
(
LocalDateTime
.
now
());
cp
.
set
Fd
ApplyUserName
(
"张三"
);
cp
.
set
Fd
SpNo
(
datas
);
cp
.
set
Fd
Status
(
CommonConstants
.
ZERO_STRING
);
cpList
.
add
(
cp
);
}
}
...
...
@@ -278,14 +299,19 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
* @Date: 2024-4-12 17:01:35
* @return: void
**/
private
void
setTStatisticsProjectReimburseDetail
(
String
info
,
EkpQiwiChuchai
reimburse
)
{
private
void
setTStatisticsProjectReimburseDetail
(
String
info
,
EkpQiwiChuchai
reimburse
,
Map
<
String
,
String
>
userMap
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
info
);
if
(
Common
.
isNotNull
(
info
))
{
reimburse
.
setCreateTime
(
LocalDateTime
.
now
());
reimburse
.
setApplyUserName
(((
JSONObject
)
jsonObject
.
get
(
"applyer"
)).
getString
(
"userid"
));
reimburse
.
setApplyUserDept
(((
JSONObject
)
jsonObject
.
get
(
"applyer"
)).
getString
(
"partyid"
));
reimburse
.
setSpNo
(
jsonObject
.
getString
(
"sp_no"
));
reimburse
.
setApplyDate
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochSecond
(
Long
.
parseLong
(
String
.
valueOf
(
jsonObject
.
get
(
"apply_time"
)))),
ZoneId
.
systemDefault
()));
String
userId
=
((
JSONObject
)
jsonObject
.
get
(
"applyer"
)).
getString
(
"userid"
);
if
(
Common
.
isNotNull
(
userId
)
&&
userMap
.
get
(
userId
)
!=
null
)
{
reimburse
.
setFdApplyUserName
(
userMap
.
get
(
userId
));
}
else
{
reimburse
.
setFdApplyUserName
(
userId
);
}
reimburse
.
setFdApplyUserDept
(((
JSONObject
)
jsonObject
.
get
(
"applyer"
)).
getString
(
"partyid"
));
reimburse
.
setFdSpNo
(
jsonObject
.
getString
(
"sp_no"
));
reimburse
.
setFdApplyDate
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochSecond
(
Long
.
parseLong
(
String
.
valueOf
(
jsonObject
.
get
(
"apply_time"
)))),
ZoneId
.
systemDefault
()));
// 核心数据
JSONObject
applyData
=
(
JSONObject
)
jsonObject
.
get
(
"apply_data"
);
String
contents
=
applyData
.
getString
(
"contents"
);
...
...
@@ -294,16 +320,23 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
JSONObject
value
;
JSONObject
attendance
;
JSONObject
dateRange
;
//JSONObject selector;
//JSONArray options;
JSONObject
selector
;
JSONArray
options
;
JSONObject
options0
;
JSONArray
options0value
;
JSONObject
options0value0
;
// 开始时间
LocalDate
newBegin
=
null
;
// 结束时间
LocalDate
newEnd
=
null
;
// 出差时长
//String newDuration;
// 岗位级别
//String post;
// 出差地点级别
String
addressLevel
=
null
;
// 交通补助
String
jiaoTong
=
null
;
// 餐饮补助
String
canYin
=
null
;
// 业务条线归属
//String lineType;
// 出差事由
...
...
@@ -313,7 +346,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
// 出差地点
String
address
=
null
;
// 出行工具
String
tools
=
null
;
String
tools
=
""
;
for
(
HashMap
content
:
contentList
)
{
title
=
(
JSONArray
)
content
.
get
(
"title"
);
if
(
"出差"
.
equals
(((
JSONObject
)
title
.
get
(
0
)).
get
(
"text"
)))
{
...
...
@@ -346,17 +379,57 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
}
else
if
(
"出差地点"
.
equals
(((
JSONObject
)
title
.
get
(
0
)).
get
(
"text"
)))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
address
=
value
.
getString
(
"text"
);
}
else
if
(
"出差地点级别"
.
equals
(((
JSONObject
)
title
.
get
(
0
)).
get
(
"text"
)))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
selector
=
(
JSONObject
)
value
.
get
(
"selector"
);
options
=
(
JSONArray
)
selector
.
get
(
"options"
);
options0
=
(
JSONObject
)
options
.
get
(
0
);
options0value
=
(
JSONArray
)
options0
.
get
(
VALUESTR
);
options0value0
=
(
JSONObject
)
options0value
.
get
(
0
);
addressLevel
=
options0value0
.
getString
(
"text"
);
}
else
if
(((
JSONObject
)
title
.
get
(
0
)).
getString
(
"text"
).
contains
(
"交通补助"
))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
if
(
Common
.
isNotNull
(
value
.
getString
(
"text"
)))
{
jiaoTong
=
value
.
getString
(
"text"
);
}
}
else
if
(((
JSONObject
)
title
.
get
(
0
)).
getString
(
"text"
).
contains
(
"餐饮补助"
))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
if
(
Common
.
isNotNull
(
value
.
getString
(
"text"
)))
{
canYin
=
value
.
getString
(
"text"
);
}
}
else
if
(
"出行工具"
.
equals
(((
JSONObject
)
title
.
get
(
0
)).
get
(
"text"
)))
{
value
=
(
JSONObject
)
content
.
get
(
VALUESTR
);
tools
=
value
.
getString
(
"text"
);
selector
=
(
JSONObject
)
value
.
get
(
"selector"
);
options
=
(
JSONArray
)
selector
.
get
(
"options"
);
for
(
int
j
=
0
;
j
<
options
.
size
();
j
++)
{
options0
=
(
JSONObject
)
options
.
get
(
j
);
options0value
=
(
JSONArray
)
options0
.
get
(
VALUESTR
);
options0value0
=
(
JSONObject
)
options0value
.
get
(
0
);
addressLevel
=
options0value0
.
getString
(
"text"
);
tools
+=
options0value0
.
getString
(
"text"
)
+
";"
;
}
}
}
reimburse
.
setFdNewBegin
(
newBegin
);
reimburse
.
setFdNewEnd
(
newEnd
);
reimburse
.
setFdReason
(
reason
);
int
renShu
=
1
;
if
(
Common
.
isNotNull
(
person
))
{
int
renShu1
=
person
.
split
(
","
).
length
;
int
renShu2
=
person
.
split
(
","
).
length
;
if
(
renShu1
>
renShu2
)
{
renShu
+=
renShu1
;
}
else
{
renShu
+=
renShu2
;
}
}
reimburse
.
setNewBegin
(
newBegin
);
reimburse
.
setNewEnd
(
newEnd
);
reimburse
.
setReason
(
reason
);
reimburse
.
setPerson
(
person
);
reimburse
.
setAddress
(
address
);
reimburse
.
setTools
(
tools
);
reimburse
.
setFdRenShu
(
renShu
);
reimburse
.
setFdPerson
(
person
);
reimburse
.
setFdAddress
(
address
);
reimburse
.
setFdTools
(
tools
);
reimburse
.
setFdAddressLevel
(
addressLevel
);
reimburse
.
setFdJiaoTong
(
jiaoTong
);
reimburse
.
setFdCanYin
(
canYin
);
}
}
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/EkpQiweiChuchaiMapper.xml
View file @
ff2715fd
...
...
@@ -6,18 +6,22 @@
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiChuchai"
>
<id
property=
"fdId"
column=
"fd_ID"
/>
<result
property=
"spNo"
column=
"FD_SP_NO"
/>
<result
property=
"applyUserName"
column=
"FD_APPLY_USER_NAME"
/>
<result
property=
"applyUserDept"
column=
"FD_APPLY_USER_DEPT"
/>
<result
property=
"applyDate"
column=
"FD_APPLY_DATE"
/>
<result
property=
"newBegin"
column=
"FD_NEW_BEGIN"
/>
<result
property=
"newEnd"
column=
"FD_NEW_END"
/>
<result
property=
"reason"
column=
"FD_REASON"
/>
<result
property=
"person"
column=
"FD_PERSON"
/>
<result
property=
"address"
column=
"FD_ADDRESS"
/>
<result
property=
"tools"
column=
"FD_TOOLS"
/>
<result
property=
"status"
column=
"FD_STATUS"
/>
<result
property=
"settleFormId"
column=
"FD_SETTLE_FORM_ID"
/>
<result
property=
"fdSpNo"
column=
"FD_SP_NO"
/>
<result
property=
"fdApplyUserName"
column=
"FD_APPLY_USER_NAME"
/>
<result
property=
"fdApplyUserDept"
column=
"FD_APPLY_USER_DEPT"
/>
<result
property=
"fdApplyDate"
column=
"FD_APPLY_DATE"
/>
<result
property=
"fdNewBegin"
column=
"FD_NEW_BEGIN"
/>
<result
property=
"fdNewEnd"
column=
"FD_NEW_END"
/>
<result
property=
"fdReason"
column=
"FD_REASON"
/>
<result
property=
"fdPerson"
column=
"FD_PERSON"
/>
<result
property=
"fdAddress"
column=
"FD_ADDRESS"
/>
<result
property=
"fdTools"
column=
"FD_TOOLS"
/>
<result
property=
"fdAddressLevel"
column=
"FD_ADDRESS_LEVEL"
/>
<result
property=
"fdJiaoTong"
column=
"FD_JIAO_TONG"
/>
<result
property=
"fdCanYin"
column=
"FD_CAN_YIN"
/>
<result
property=
"fdRenShu"
column=
"FD_REN_SHU"
/>
<result
property=
"fdStatus"
column=
"FD_STATUS"
/>
<result
property=
"fdSettleFormId"
column=
"FD_SETTLE_FORM_ID"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
...
...
@@ -33,6 +37,10 @@
a.FD_PERSON,
a.FD_ADDRESS,
a.FD_TOOLS,
a.FD_ADDRESS_LEVEL,
a.FD_JIAO_TONG,
a.FD_CAN_YIN,
a.FD_REN_SHU,
a.FD_STATUS,
a.FD_SETTLE_FORM_ID,
a.create_time
...
...
@@ -50,4 +58,9 @@
</where>
</select>
<!--获取全部的,用来: 拉取企业微信时,不覆盖数据 -->
<select
id=
"getQiYeWeiXinUserList"
resultType=
"com.yifu.cloud.plus.v1.yifu.permission.vo.QiWeiUserVo"
>
SELECT USER_ID as userId,USER_NAME as userName FROM ekp_qiwei_user
</select>
</mapper>
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TSalaryStandardOriginalDetail.java
View file @
ff2715fd
...
...
@@ -51,9 +51,8 @@ public class TSalaryStandardOriginalDetail {
/**
* 原表表头
*/
@NotBlank
(
message
=
"原表表头不能为空"
)
@Length
(
max
=
50
,
message
=
"原表表头不能超过50个字符"
)
@ExcelAttribute
(
name
=
"原表表头"
,
isNotEmpty
=
true
,
errorInfo
=
"原表表头不能为空"
,
maxLength
=
50
)
@ExcelAttribute
(
name
=
"原表表头"
,
maxLength
=
50
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"原表表头"
)
private
String
excelName
;
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardOriginalServiceImpl.java
View file @
ff2715fd
...
...
@@ -122,13 +122,19 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
if
(!(
filename
.
endsWith
(
".xls"
)
||
filename
.
endsWith
(
".xlsx"
)))
{
return
R
.
failed
(
"文件名称格式有误,请重新上传!"
+
filename
);
}
ExcelSheetVo
vo
;
R
<
ExcelSheetVo
>
voR
;
ExcelSheetVo
vo
=
null
;
InputStream
inputStream
=
file
.
getInputStream
();
//根据文件格式 对应不同的api解析
if
(
filename
.
endsWith
(
".xlsx"
))
{
vo
=
readXlsx
(
inputStream
,
specialIdCardList
,
true
,
sheetName
);
vo
R
=
readXlsx
(
inputStream
,
specialIdCardList
,
true
,
sheetName
);
}
else
{
vo
=
readXls
(
inputStream
,
specialIdCardList
,
true
,
sheetName
);
voR
=
readXls
(
inputStream
,
specialIdCardList
,
true
,
sheetName
);
}
if
(
voR
!=
null
&&
voR
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
vo
=
voR
.
getData
();
}
else
{
return
R
.
failed
(
voR
==
null
?
"识别表格异常!"
:
voR
.
getMsg
());
}
//数据保存
if
(
Common
.
isNotNull
(
vo
.
getErrorInfo
()))
{
...
...
@@ -137,7 +143,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
return
R
.
ok
(
vo
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
log
.
error
(
"解析表头失败!"
+
e
.
getMessage
());
log
.
error
(
"解析表头失败!"
+
e
.
getMessage
());
}
return
R
.
failed
(
"解析表头失败"
);
}
...
...
@@ -151,7 +157,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
* @Date: 2024/4/8 17:02
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.ExcelVo
**/
private
ExcelSheetVo
readXls
(
InputStream
inputStream
,
List
<
String
>
specialIdCardList
,
boolean
titleFlag
private
R
<
ExcelSheetVo
>
readXls
(
InputStream
inputStream
,
List
<
String
>
specialIdCardList
,
boolean
titleFlag
,
String
sheetName
)
throws
IOException
{
HSSFWorkbook
sheets
=
null
;
ExcelSheetVo
sheetVo
=
new
ExcelSheetVo
();
...
...
@@ -223,13 +229,12 @@ 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
))
...
...
@@ -257,14 +262,20 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
titleList
=
new
ArrayList
<>(
columnList
);
}
}
if
(
rowNum
>=
50
&&
dataRowFlag
)
{
return
R
.
failed
(
"未找到身份证所在的数据行,请检查表数据!"
);
}
if
(
titleFlag
&&
!
dataRowFlag
)
{
break
;
}
}
if
(
dataRowFlag
)
{
return
R
.
failed
(
"未找到身份证所在的数据行,请检查表数据!!"
);
}
sheetVo
.
setDataNum
(
dataRow
);
sheetVo
.
setTitleList
(
titleList
);
sheetVo
.
setContentList
(
contentList
);
return
sheetVo
;
return
R
.
ok
(
sheetVo
)
;
}
}
}
catch
(
IOException
e
)
{
...
...
@@ -277,7 +288,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
sheets
.
close
();
}
}
return
sheetVo
;
return
R
.
ok
(
sheetVo
)
;
}
/**
...
...
@@ -289,7 +300,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
* @Date: 2024/4/8 17:02
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.ExcelVo
**/
private
ExcelSheetVo
readXlsx
(
InputStream
inputStream
,
List
<
String
>
specialIdCardList
,
boolean
titleFlag
private
R
<
ExcelSheetVo
>
readXlsx
(
InputStream
inputStream
,
List
<
String
>
specialIdCardList
,
boolean
titleFlag
,
String
sheetName
)
throws
IOException
{
XSSFWorkbook
sheets
=
null
;
ExcelSheetVo
sheetVo
=
new
ExcelSheetVo
();
...
...
@@ -395,14 +406,20 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
titleList
=
new
ArrayList
<>(
columnList
);
}
}
if
(
rowNum
>=
50
&&
dataRowFlag
)
{
return
R
.
failed
(
"未找到身份证所在的数据行,请检查表数据!"
);
}
if
(
titleFlag
&&
!
dataRowFlag
)
{
break
;
}
}
if
(
dataRowFlag
)
{
return
R
.
failed
(
"未找到身份证所在的数据行,请检查表数据!!"
);
}
sheetVo
.
setDataNum
(
dataRow
);
sheetVo
.
setTitleList
(
titleList
);
sheetVo
.
setContentList
(
contentList
);
return
sheetVo
;
return
R
.
ok
(
sheetVo
)
;
}
}
}
catch
(
IOException
e
)
{
...
...
@@ -415,7 +432,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
sheets
.
close
();
}
}
return
sheetVo
;
return
R
.
ok
(
sheetVo
)
;
}
/**
...
...
@@ -526,19 +543,26 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
}
String
jsonString
=
null
;
InputStream
inputStream
=
file
.
getInputStream
();
ExcelSheetVo
vo
;
R
<
ExcelSheetVo
>
voR
;
ExcelSheetVo
vo
=
null
;
//根据文件格式 对应不同的api解析
if
(
filename
.
endsWith
(
".xlsx"
))
{
vo
=
readXlsx
(
inputStream
,
specialIdCardList
,
false
,
sheetName
);
vo
R
=
readXlsx
(
inputStream
,
specialIdCardList
,
false
,
sheetName
);
}
else
{
vo
=
readXls
(
inputStream
,
specialIdCardList
,
false
,
sheetName
);
voR
=
readXls
(
inputStream
,
specialIdCardList
,
false
,
sheetName
);
}
if
(
voR
!=
null
&&
voR
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
vo
=
voR
.
getData
();
}
else
{
return
R
.
failed
(
voR
==
null
?
"识别表格异常!"
:
voR
.
getMsg
());
}
if
(
vo
.
getTitleList
()
!=
null
&&
!
vo
.
getTitleList
().
isEmpty
())
{
ExcelColumnVo
title
;
for
(
int
i
=
0
;
i
<
vo
.
getTitleList
().
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
vo
.
getTitleList
().
size
();
i
++)
{
title
=
vo
.
getTitleList
().
get
(
i
);
if
(
Common
.
isNotNull
(
title
.
getContent
()))
{
if
(
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
()))
==
null
)
{
return
R
.
failed
(
"表头与导入的不一致,第"
+
title
.
getLineNum
()+
"列表头【"
+
title
.
getContent
()+
"】未找到配置,请先配置表头!"
);
return
R
.
failed
(
"表头与导入的不一致,第"
+
title
.
getLineNum
()
+
"列表头【"
+
title
.
getContent
()
+
"】未找到配置,请先配置表头!"
);
}
else
if
(!
title
.
getContent
().
equals
(
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
())).
getExcelName
())
&&
(!
"是否新员工(默认否)"
.
equals
(
title
.
getContent
())
||
!
"开户行总行"
.
equals
(
title
.
getContent
())
...
...
@@ -549,7 +573,10 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
||
!
"手机号码"
.
equals
(
title
.
getContent
())
||
!
"计税月份"
.
equals
(
title
.
getContent
()))
)
{
return
R
.
failed
(
"表头与导入的不一致,第"
+(
i
+
1
)+
"列应为【"
+
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
())).
getExcelName
()+
"】,实际为【"
+
title
.
getContent
()+
"】"
);
return
R
.
failed
(
"表头与导入的不一致,第"
+
(
i
+
1
)
+
"列应为【"
+
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
())).
getExcelName
()
+
"】,实际为【"
+
title
.
getContent
()
+
"】"
);
}
}
else
if
(
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
()))
!=
null
&&
Common
.
isNotNull
(
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
())).
getExcelName
()))
{
return
R
.
failed
(
"表头与导入的不一致,第"
+
(
i
+
1
)
+
"列应为【"
+
detailMap
.
get
(
String
.
valueOf
(
title
.
getLineNum
())).
getExcelName
()
+
"】,实际为空!"
);
}
}
}
else
{
...
...
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TSalaryStandardOriginalMapper.xml
View file @
ff2715fd
...
...
@@ -118,7 +118,23 @@
FROM
t_salary_standard_original a
<where>
a.DELETE_FLAG = 0
<include
refid=
"TSalaryStandardOriginal_where"
/>
<if
test=
"tSalaryStandardOriginal != null"
>
<if
test=
"tSalaryStandardOriginal.id != null and tSalaryStandardOriginal.id.trim() != ''"
>
AND a.ID != #{tSalaryStandardOriginal.id}
</if>
<if
test=
"tSalaryStandardOriginal.deptId != null and tSalaryStandardOriginal.deptId.trim() != ''"
>
AND a.DEPT_ID = #{tSalaryStandardOriginal.deptId}
</if>
<if
test=
"tSalaryStandardOriginal.deptName != null and tSalaryStandardOriginal.deptName.trim() != ''"
>
AND a.DEPT_NAME = #{tSalaryStandardOriginal.deptName}
</if>
<if
test=
"tSalaryStandardOriginal.deptNo != null and tSalaryStandardOriginal.deptNo.trim() != ''"
>
AND a.DEPT_NO = #{tSalaryStandardOriginal.deptNo}
</if>
<if
test=
"tSalaryStandardOriginal.setName != null and tSalaryStandardOriginal.setName.trim() != ''"
>
AND a.SET_NAME = #{tSalaryStandardOriginal.setName}
</if>
</if>
</where>
ORDER BY a.CREATE_TIME asc
</select>
...
...
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