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
9b6098c3
Commit
9b6098c3
authored
Dec 20, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工资查询优化-fxj
parent
e879a7d2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
32 deletions
+94
-32
TQuestionFeedbackInfo.java
...oud/plus/v1/yifu/salary/entity/TQuestionFeedbackInfo.java
+1
-1
TSalaryAccountPhoneController.java
...yifu/salary/controller/TSalaryAccountPhoneController.java
+18
-2
TSalaryAttaServiceImpl.java
...s/v1/yifu/salary/service/impl/TSalaryAttaServiceImpl.java
+44
-26
application.yml
...salary/yifu-salary-biz/src/main/resources/application.yml
+6
-3
UserController.java
...u/cloud/plus/v1/yifu/admin/controller/UserController.java
+25
-0
No files found.
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TQuestionFeedbackInfo.java
View file @
9b6098c3
...
...
@@ -61,7 +61,7 @@ public class TQuestionFeedbackInfo extends BaseEntity {
/**
* 手机号码
*/
@ExcelAttribute
(
name
=
"手机号码"
,
isNotEmpty
=
true
,
errorInfo
=
"手机号码不能为空"
,
maxLength
=
20
)
@ExcelAttribute
(
name
=
"手机号码"
,
isPhone
=
true
,
isNotEmpty
=
true
,
errorInfo
=
"手机号码不能为空"
,
maxLength
=
20
)
@NotBlank
(
message
=
"手机号码不能为空"
)
@Length
(
max
=
20
,
message
=
"手机号码不能超过20个字符"
)
@ExcelProperty
(
"手机号码"
)
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryAccountPhoneController.java
View file @
9b6098c3
...
...
@@ -65,7 +65,11 @@ public class TSalaryAccountPhoneController {
**/
@Operation
(
description
=
"获取工资报账信息"
)
@GetMapping
(
"/getSalaryAccount"
)
public
R
<
AccountForWxVo
>
getSalaryAccount
(
@RequestParam
String
idNumber
,
String
year
)
{
public
R
<
AccountForWxVo
>
getSalaryAccount
(
@RequestParam
String
idNumber
,
String
year
,
String
openId
)
{
//校验openId,openId 不对直接返回
if
(!
checkOpenId
(
openId
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
AccountForWxVo
result
=
new
AccountForWxVo
();
//处理身份证防止小写干扰
idNumber
=
idNumber
.
toUpperCase
();
...
...
@@ -122,7 +126,11 @@ public class TSalaryAccountPhoneController {
**/
@Operation
(
description
=
"获取工资明细信息"
)
@GetMapping
(
"/getSalaryAccountForm"
)
public
R
<
TSalarySetVo
>
getSalaryAccountForm
(
@RequestParam
String
id
,
Integer
type
)
{
public
R
<
TSalarySetVo
>
getSalaryAccountForm
(
@RequestParam
String
id
,
Integer
type
,
String
openId
)
{
//校验openId,openId 不对直接返回
if
(!
checkOpenId
(
openId
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
//类型判断
if
(
null
==
type
)
{
return
R
.
failed
(
"查询类型不能为空"
);
...
...
@@ -242,4 +250,12 @@ public class TSalaryAccountPhoneController {
}
}
private
boolean
checkOpenId
(
String
openId
){
R
<
Boolean
>
r
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/user/inner/checkWxUserByOpenId"
,
openId
,
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isNotNull
(
r
)){
return
r
.
getData
().
booleanValue
();
}
return
false
;
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryAttaServiceImpl.java
View file @
9b6098c3
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
...
...
@@ -55,6 +56,7 @@ import java.io.InputStream;
import
java.net.URL
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* 薪资结算附件表
...
...
@@ -72,6 +74,8 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
private
final
TSalaryStandardService
tSalaryStandardService
;
private
final
TSalaryAccountService
tSalaryAccountService
;
private
final
AtomicInteger
atomicInteger
=
new
AtomicInteger
(
0
);
/**
* 薪资结算附件表简单分页查询
*
...
...
@@ -139,35 +143,49 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
@Override
public
R
<
FileVo
>
uploadAtta
(
@RequestBody
MultipartFile
file
,
String
filePath
,
String
linkId
,
Integer
linkType
,
Integer
engineerType
,
String
printRemark
,
String
recordId
)
throws
IOException
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
file
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String
key
=
""
;
if
(!
Common
.
isNotNull
(
filePath
))
{
key
=
fileName
;
}
else
{
key
=
filePath
+
"/"
+
fileName
;
}
boolean
flag
=
ossUtil
.
uploadFileByStream
(
file
.
getInputStream
(),
key
,
null
);
FileVo
fileVo
;
TSalaryAtta
salaryAtta
;
URL
url
=
null
;
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
salaryAtta
=
this
.
saveTSalaryAtta
(
fileName
,
key
,
file
.
getSize
(),
linkId
,
linkType
,
engineerType
,
printRemark
,
recordId
);
//初始化附件上传队列上限值
int
maxLimit
=
5
;
if
(
atomicInteger
.
incrementAndGet
()
<=
maxLimit
){
try
{
this
.
save
(
salaryAtta
);
}
catch
(
Exception
e
)
{
log
.
error
(
"OSS文件上传接口异常:"
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"failed:"
+
e
.
getMessage
());
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
file
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String
key
=
""
;
if
(!
Common
.
isNotNull
(
filePath
))
{
key
=
fileName
;
}
else
{
key
=
filePath
+
"/"
+
fileName
;
}
boolean
flag
=
ossUtil
.
uploadFileByStream
(
file
.
getInputStream
(),
key
,
null
);
FileVo
fileVo
;
TSalaryAtta
salaryAtta
;
URL
url
=
null
;
if
(
flag
)
{
salaryAtta
=
this
.
saveTSalaryAtta
(
fileName
,
key
,
file
.
getSize
(),
linkId
,
linkType
,
engineerType
,
printRemark
,
recordId
);
try
{
this
.
save
(
salaryAtta
);
}
catch
(
Exception
e
)
{
log
.
error
(
"OSS文件上传接口异常:"
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"failed:"
+
e
.
getMessage
());
}
url
=
ossUtil
.
getObjectUrl
(
null
,
salaryAtta
.
getAttaSrc
());
fileVo
=
new
FileVo
(
salaryAtta
.
getId
(),
salaryAtta
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
);
}
else
{
return
R
.
failed
(
"failed:上传至存储空间失败"
);
}
}
catch
(
Exception
e
){
log
.
error
(
"附件上传异常:"
,
e
);
}
finally
{
atomicInteger
.
decrementAndGet
();
}
url
=
ossUtil
.
getObjectUrl
(
null
,
salaryAtta
.
getAttaSrc
());
fileVo
=
new
FileVo
(
salaryAtta
.
getId
(),
salaryAtta
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
);
}
else
{
return
R
.
failed
(
"failed:上传至存储空间失败"
);
}
else
{
atomicInteger
.
decrementAndGet
();
log
.
error
(
"超出阈值:"
+
ResultConstants
.
FILE_UPLOADING_DATA
);
return
R
.
failed
(
ResultConstants
.
FILE_UPLOADING_DATA
);
}
return
null
;
}
/**
...
...
yifu-salary/yifu-salary-biz/src/main/resources/application.yml
View file @
9b6098c3
...
...
@@ -44,9 +44,12 @@ security:
-
/tsalaryemployee/inner/getEmpTaxMonth
-
/tsalaryemployee/inner/getSalaryEmployee
-
/tsalaryemployee/inner/savePreNewEmpInfo
-
/tmobilechangeinfo/add
-
/tquestionfeedbackinfo/add
-
/tsalaryatta/**
-
/tmobilechangeinfo/add
# 工资条换号申请不需要token
-
/tquestionfeedbackinfo/add
# 工资条问题反馈不需要token
-
/salaryEmployeeSelect/getSalaryAccountForm
# 工资条查询通过openId控制
-
/salaryEmployeeSelect/getSalaryAccount
# 工资条查询明细通过openId控制
-
/tsalaryatta/ossUploadFile
# 工资条查询附件上传 无token
-
/tsalaryatta/ossFileDelete/**
# 工资条查询附件上传删除 无token
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserController.java
View file @
9b6098c3
...
...
@@ -496,6 +496,31 @@ public class UserController {
return
null
;
}
/**
* @Author fxj
* @Description 通过openId验证是否存在用户
* @Date 11:35 2024/12/20
* @Param
* @return
**/
@Inner
@PostMapping
(
"/inner/checkWxUserByOpenId"
)
public
Boolean
checkWxUserByOpenId
(
@RequestBody
String
openId
)
{
try
{
if
(
Common
.
isNotNull
(
openId
)){
int
count
=
(
int
)
userService
.
count
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getWxOpenid
,
openId
)
.
eq
(
SysUser:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
count
>
0
){
return
true
;
}
}
}
catch
(
Exception
e
){
log
.
error
(
"通过openId:{}验证微信用户异常:{}"
,
openId
,
e
);
return
false
;
}
return
false
;
}
/**
* C端用户信息注册
*
...
...
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