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
4d017d12
Commit
4d017d12
authored
Dec 13, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工资条
parent
07e7d18e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
461 additions
and
25 deletions
+461
-25
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+23
-0
R.java
.../java/com/yifu/cloud/plus/v1/yifu/common/core/util/R.java
+4
-0
RandomUtil.java
.../yifu/cloud/plus/v1/yifu/common/core/util/RandomUtil.java
+37
-0
AccountForWxVo.java
...com/yifu/cloud/plus/v1/yifu/salary/vo/AccountForWxVo.java
+30
-0
TSalaryAccountPhoneController.java
...yifu/salary/controller/TSalaryAccountPhoneController.java
+219
-0
SysUser.java
...com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysUser.java
+5
-0
UserController.java
...u/cloud/plus/v1/yifu/admin/controller/UserController.java
+89
-25
SysUserService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
+13
-0
SysUserServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
+41
-0
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
4d017d12
...
@@ -507,4 +507,27 @@ public interface CommonConstants {
...
@@ -507,4 +507,27 @@ public interface CommonConstants {
public
static
final
String
A_CREATE_BY
=
"a.CREATE_BY"
;
public
static
final
String
A_CREATE_BY
=
"a.CREATE_BY"
;
String
SETTLE_DOMAIN_GET_ERROR
=
"获取结算主体信息失败!"
;
String
SETTLE_DOMAIN_GET_ERROR
=
"获取结算主体信息失败!"
;
/**
* c端机构节点 code
* @Author hgw
* @Date 2022-12-13 11:05:24
**/
public
static
final
String
WX_C_ORG_CODE
=
"00294"
;
/**
* c端机构节点 id
* @Author hgw
* @Date 2022-12-13 11:05:33
**/
public
static
final
long
WX_C_ORG_ID
=
294
;
/**
* c端机构节点 name
* @Author hgw
* @Date 2022-12-13 11:05:33
**/
public
static
final
String
WX_C_ORG_NAME
=
"C端用户"
;
// C端前缀
public
static
final
String
C_PREFIX
=
CacheConstants
.
DEFAULT_CODE_KEY
.
concat
(
"_C_"
);
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/R.java
View file @
4d017d12
...
@@ -88,6 +88,10 @@ public class R<T> implements Serializable {
...
@@ -88,6 +88,10 @@ public class R<T> implements Serializable {
return
restResult
(
data
,
CommonConstants
.
FAIL
,
msg
);
return
restResult
(
data
,
CommonConstants
.
FAIL
,
msg
);
}
}
public
static
<
T
>
R
<
T
>
other
(
int
code
,
String
msg
)
{
return
restResult
(
null
,
code
,
msg
);
}
private
static
<
T
>
R
<
T
>
restResult
(
T
data
,
int
code
,
String
msg
)
{
private
static
<
T
>
R
<
T
>
restResult
(
T
data
,
int
code
,
String
msg
)
{
R
<
T
>
apiResult
=
new
R
<>();
R
<
T
>
apiResult
=
new
R
<>();
apiResult
.
setCode
(
code
);
apiResult
.
setCode
(
code
);
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/RandomUtil.java
0 → 100644
View file @
4d017d12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
lombok.extern.slf4j.Slf4j
;
import
java.security.SecureRandom
;
import
java.util.Random
;
/**
* @description: 随机数工具
* @author: hgw
* @create: 2022-12-12 17:51:35
**/
@Slf4j
public
class
RandomUtil
{
private
RandomUtil
()
{
throw
new
IllegalStateException
(
"Utility class"
);
}
/**
* 获取六位随机数
*
* @return
* @Author pwang
* @Date 2020-08-24 17:26
**/
public
static
String
getSix
()
{
log
.
info
(
"获取随机数开始>>>>>>>>>"
);
Random
rad
=
new
SecureRandom
();
log
.
info
(
"获取随机数结束<<<<<<<<<"
);
String
result
=
rad
.
nextInt
(
1000000
)
+
""
;
if
(
result
.
length
()
!=
6
)
{
return
getSix
();
}
return
result
;
}
}
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/vo/AccountForWxVo.java
0 → 100644
View file @
4d017d12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description: c端工资报账包装类
* @Author: hgw
* @Date: 2022/12/12 16:46
**/
@Schema
(
description
=
"c端工资报账包装类"
)
@Data
public
class
AccountForWxVo
implements
Serializable
{
/**
* 明细
**/
@Schema
(
description
=
"普通薪资明细"
)
private
List
<
TSalaryAccount
>
standAccount
;
/**
*键值
**/
@Schema
(
description
=
"键值"
)
Map
<
String
,
Object
>
standAccountSumMap
;
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryAccountPhoneController.java
0 → 100644
View file @
4d017d12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
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.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RandomUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.SmsUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.*
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.AccountForWxVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalarySetVo
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/salaryEmployeeSelect"
)
@Tag
(
name
=
"c端员工查询接口工资表"
)
@EnableConfigurationProperties
(
DaprUpmsProperties
.
class
)
public
class
TSalaryAccountPhoneController
{
private
final
TSalaryAccountService
salaryAccountService
;
private
final
TSalaryAccountItemService
salaryAccountItemService
;
private
final
TSalaryStandardSetService
tSalaryStandardSetService
;
private
final
TSalaryStandardSetDetailService
tSalaryStandardSetDetailService
;
private
final
TSalaryEmployeeService
tSalaryEmployeeService
;
// 验证码存缓存里
private
final
RedisUtil
redisUtil
;
private
final
DaprUpmsProperties
daprUpmsProperties
;
private
static
final
String
SORT_COL
=
"order by SALARY_MONTH desc,id desc"
;
private
static
final
String
ITEM_SORT_COL
=
"order by JAVA_FIED_NAME desc,id"
;
/**
* 只查普通薪资
*
* @param idNumber 身份证不能为空
* @param year 年为空查最新一条返回集合
* @return
* @Author hgw
* @Date 2022-12-12 16:51:13
**/
@Operation
(
description
=
"获取工资报账信息"
)
@GetMapping
(
"/getSalaryAccount"
)
public
R
<
AccountForWxVo
>
getSalaryAccount
(
@RequestParam
String
idNumber
,
String
year
)
{
AccountForWxVo
result
=
new
AccountForWxVo
();
//处理身份证防止小写干扰
idNumber
=
idNumber
.
toUpperCase
();
//空的查最新一条
List
<
Map
<
String
,
Object
>>
sumByAccountId
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
Common
.
isEmpty
(
year
))
{
List
<
TSalaryAccount
>
list
=
salaryAccountService
.
list
(
Wrappers
.<
TSalaryAccount
>
lambdaQuery
()
.
eq
(
TSalaryAccount:
:
getEmpIdcard
,
idNumber
)
.
eq
(
TSalaryAccount:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TSalaryAccount:
:
getDistributionFlag
,
CommonConstants
.
ONE_STRING
)
.
last
(
SORT_COL
.
concat
(
CommonConstants
.
LAST_ONE_SQL
)));
//查实发工资
if
(
Common
.
isNotNull
(
list
))
{
sumByAccountId
=
salaryAccountItemService
.
getSumByAccountId
(
list
);
getMap
(
sumByAccountId
,
map
);
result
.
setStandAccountSumMap
(
map
);
result
.
setStandAccount
(
list
);
}
}
else
{
List
<
TSalaryAccount
>
list
=
salaryAccountService
.
list
(
Wrappers
.<
TSalaryAccount
>
lambdaQuery
()
.
eq
(
TSalaryAccount:
:
getEmpIdcard
,
idNumber
)
.
eq
(
TSalaryAccount:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TSalaryAccount:
:
getDistributionFlag
,
CommonConstants
.
ONE_STRING
)
.
likeRight
(
TSalaryAccount:
:
getSalaryMonth
,
year
).
last
(
SORT_COL
));
//查实发工资
if
(
Common
.
isNotNull
(
list
))
{
sumByAccountId
=
salaryAccountItemService
.
getSumByAccountId
(
list
);
getMap
(
sumByAccountId
,
map
);
result
.
setStandAccountSumMap
(
map
);
result
.
setStandAccount
(
list
);
}
}
return
new
R
<>(
result
);
}
private
void
getMap
(
List
<
Map
<
String
,
Object
>>
sumByAccountId
,
Map
<
String
,
Object
>
map
)
{
if
(
Common
.
isNotNull
(
sumByAccountId
))
{
for
(
Map
<
String
,
Object
>
thisMap
:
sumByAccountId
)
{
map
.
put
((
String
)
thisMap
.
get
(
"key"
),
thisMap
.
get
(
"value"
));
}
}
}
/**
* @param id 主表id
* @param type 查询类型 0 普通工资 1 工程工资
* @return
* @Author pwang
* @Date 2020-08-10 23:26
**/
@Operation
(
description
=
"获取工资明细信息"
)
@GetMapping
(
"/getSalaryAccountForm"
)
public
R
<
TSalarySetVo
>
getSalaryAccountForm
(
@RequestParam
String
id
,
Integer
type
)
{
//类型判断
if
(
null
==
type
)
{
return
R
.
failed
(
"查询类型不能为空"
);
}
//普通薪资查询
if
(
CommonConstants
.
dingleDigitIntArray
[
0
]
==
type
)
{
TSalaryAccount
account
=
salaryAccountService
.
getById
(
id
);
TSalarySetVo
setVo
=
new
TSalarySetVo
();
if
(
account
!=
null
)
{
List
<
TSalaryAccountItem
>
allTSalaryAccountItem
=
salaryAccountItemService
.
list
(
Wrappers
.<
TSalaryAccountItem
>
lambdaQuery
()
.
eq
(
TSalaryAccountItem:
:
getSalaryAccountId
,
id
).
last
(
ITEM_SORT_COL
));
TSalaryStandardSet
ss
=
tSalaryStandardSetService
.
lambdaQuery
()
.
eq
(
TSalaryStandardSet:
:
getSalaryId
,
account
.
getSalaryFormId
()).
last
(
CommonConstants
.
LAST_ONE_SQL
).
one
();
if
(
ss
!=
null
&&
Common
.
isNotNull
(
ss
.
getId
()))
{
List
<
TSalaryStandardSetDetail
>
detail
=
tSalaryStandardSetDetailService
.
list
(
Wrappers
.<
TSalaryStandardSetDetail
>
query
().
lambda
().
eq
(
TSalaryStandardSetDetail:
:
getSetId
,
ss
.
getId
())
.
last
(
" order by order_line asc "
));
ss
.
setDetailList
(
detail
);
}
setVo
.
setSalarySet
(
ss
);
setVo
.
setItemList
(
allTSalaryAccountItem
);
}
return
new
R
<>(
setVo
);
}
else
if
(
CommonConstants
.
dingleDigitIntArray
[
1
]
==
type
)
{
//工程工资查询 -- c端暂不要求
return
R
.
failed
(
"暂不支持查工程工资敬请期待"
);
}
else
{
return
R
.
failed
(
"查询类型错误"
);
}
}
/**
* 根据手机号获取员工信息
* hgw 2021-3-9 17:00:04
*
* @return
*/
@Operation
(
description
=
"根据手机号获取员工信息"
)
@GetMapping
(
"/info/{empPhone}"
)
public
R
<
TSalaryEmployee
>
getWxEmployeeInfo
(
@PathVariable
String
empPhone
)
{
if
(
Common
.
isEmpty
(
empPhone
))
{
return
R
.
failed
(
"手机号不能为空"
);
}
//查询员工信息
TSalaryEmployee
employee
=
tSalaryEmployeeService
.
getOne
(
Wrappers
.<
TSalaryEmployee
>
lambdaQuery
()
.
eq
(
TSalaryEmployee:
:
getEmpPhone
,
empPhone
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
//判断是查到员工信息
if
(
Common
.
isNotNull
(
employee
)
&&
Common
.
isNotNull
(
employee
.
getEmpIdcard
()))
{
return
this
.
getUserCount
(
employee
);
}
else
{
return
R
.
failed
(
"未查到信息,请核实手机号!"
);
}
}
/**
* @Description: 查询身份证是否已被占用
* @Author: hgw
* @Date: 2022/12/13 15:14
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee>
**/
private
R
<
TSalaryEmployee
>
getUserCount
(
TSalaryEmployee
em
)
{
R
<
Integer
>
userCount
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/user/inner/getCountByIdCard"
,
em
.
getEmpIdcard
(),
Integer
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
userCount
!=
null
&&
userCount
.
getData
()
!=
null
&&
userCount
.
getData
()
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
other
(
CommonConstants
.
TWO_INT
,
"该身份已被绑定,请联系客服热线:0551 - 63535213!!"
);
}
return
R
.
ok
(
em
);
}
/**
* @param phone 手机号
* @Description: 发送C端验证码
* @Author: hgw
* @Date: 2021/3/9 16:48
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@PostMapping
(
"/sendCCode"
)
@ResponseBody
public
R
<
String
>
sendCCode
(
@RequestParam
String
phone
)
{
// 获取验证码
String
code
;
if
(
null
!=
redisUtil
.
get
(
CommonConstants
.
C_PREFIX
.
concat
(
phone
)))
{
code
=
(
String
)
redisUtil
.
get
(
CommonConstants
.
C_PREFIX
.
concat
(
phone
));
}
else
{
code
=
RandomUtil
.
getSix
();
}
// 发短信
AliSmsResult
result
=
SmsUtil
.
sendSms
(
phone
,
code
);
// 验证码存缓存
if
(
AliSmsResult
.
SUCCESS_CODE
.
equals
(
result
.
getCode
()))
{
redisUtil
.
set
(
CommonConstants
.
C_PREFIX
.
concat
(
phone
),
code
,
(
long
)
300
);
return
R
.
ok
(
null
,
"验证码已发送"
);
}
else
{
return
R
.
failed
(
null
==
result
.
getMessage
()
?
"获取验证码错误,告知管理员,阿里云短信配置错误!"
:
result
.
getMessage
());
}
}
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysUser.java
View file @
4d017d12
...
@@ -133,6 +133,11 @@ public class SysUser extends BaseEntity {
...
@@ -133,6 +133,11 @@ public class SysUser extends BaseEntity {
@TableLogic
@TableLogic
private
String
delFlag
;
private
String
delFlag
;
/**
* 微信公众号的openid(工资条使用)
*/
private
String
wxOpenid
;
/**
/**
* LDAP_DN
* LDAP_DN
*/
*/
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserController.java
View file @
4d017d12
...
@@ -27,13 +27,16 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
...
@@ -27,13 +27,16 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -52,7 +55,7 @@ import java.util.Set;
...
@@ -52,7 +55,7 @@ import java.util.Set;
* @author lengleng
* @author lengleng
* @date 2019/2/1
* @date 2019/2/1
*/
*/
@Tag
(
name
=
"用户管理模块"
,
description
=
"用户管理"
)
@Tag
(
name
=
"用户管理模块"
,
description
=
"用户管理"
)
@RestController
@RestController
@RequiredArgsConstructor
@RequiredArgsConstructor
@RequestMapping
(
"/user"
)
@RequestMapping
(
"/user"
)
...
@@ -60,12 +63,16 @@ public class UserController {
...
@@ -60,12 +63,16 @@ public class UserController {
private
final
SysUserService
userService
;
private
final
SysUserService
userService
;
// 验证码存缓存里
private
final
RedisUtil
redisUtil
;
/**
/**
* 获取当前用户全部信息
* 获取当前用户全部信息
*
* @return 用户信息
* @return 用户信息
*/
*/
@Operation
(
summary
=
"获取当前用户全部信息"
,
description
=
"获取当前用户全部信息"
)
@Operation
(
summary
=
"获取当前用户全部信息"
,
description
=
"获取当前用户全部信息"
)
@GetMapping
(
value
=
{
"/info"
})
@GetMapping
(
value
=
{
"/info"
})
public
R
<
UserInfoVO
>
info
()
{
public
R
<
UserInfoVO
>
info
()
{
String
username
=
SecurityUtils
.
getUser
().
getUsername
();
String
username
=
SecurityUtils
.
getUser
().
getUsername
();
SysUser
user
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUsername
,
username
));
SysUser
user
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUsername
,
username
));
...
@@ -82,6 +89,7 @@ public class UserController {
...
@@ -82,6 +89,7 @@ public class UserController {
/**
/**
* 获取指定用户全部信息
* 获取指定用户全部信息
*
* @return 用户信息
* @return 用户信息
*/
*/
@Inner
@Inner
...
@@ -95,13 +103,14 @@ public class UserController {
...
@@ -95,13 +103,14 @@ public class UserController {
}
}
@GetMapping
(
"/getInfoByUsername"
)
@GetMapping
(
"/getInfoByUsername"
)
public
UserInfo
infoAPI
(
@RequestParam
(
required
=
true
,
name
=
"username"
)
String
username
)
{
public
UserInfo
infoAPI
(
@RequestParam
(
required
=
true
,
name
=
"username"
)
String
username
)
{
SysUser
user
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUsername
,
username
));
SysUser
user
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUsername
,
username
));
return
userService
.
getUserInfo
(
user
);
return
userService
.
getUserInfo
(
user
);
}
}
/**
/**
* 根据部门id,查询对应的用户 id 集合
* 根据部门id,查询对应的用户 id 集合
*
* @param deptIds 部门id 集合
* @param deptIds 部门id 集合
* @return 用户 id 集合
* @return 用户 id 集合
*/
*/
...
@@ -113,6 +122,7 @@ public class UserController {
...
@@ -113,6 +122,7 @@ public class UserController {
/**
/**
* 通过ID查询用户信息
* 通过ID查询用户信息
*
* @param id ID
* @param id ID
* @return 用户信息
* @return 用户信息
*/
*/
...
@@ -123,6 +133,7 @@ public class UserController {
...
@@ -123,6 +133,7 @@ public class UserController {
/**
/**
* 根据用户名查询用户信息
* 根据用户名查询用户信息
*
* @param username 用户名
* @param username 用户名
* @return
* @return
*/
*/
...
@@ -135,6 +146,7 @@ public class UserController {
...
@@ -135,6 +146,7 @@ public class UserController {
/**
/**
* 删除用户信息
* 删除用户信息
*
* @param id ID
* @param id ID
* @return R
* @return R
*/
*/
...
@@ -143,7 +155,7 @@ public class UserController {
...
@@ -143,7 +155,7 @@ public class UserController {
@PreAuthorize
(
"@pms.hasPermission('sys_user_del')"
)
@PreAuthorize
(
"@pms.hasPermission('sys_user_del')"
)
public
R
<
Boolean
>
userDel
(
@PathVariable
Long
id
)
{
public
R
<
Boolean
>
userDel
(
@PathVariable
Long
id
)
{
SysUser
sysUser
=
userService
.
getById
(
id
);
SysUser
sysUser
=
userService
.
getById
(
id
);
if
(
null
==
sysUser
){
if
(
null
==
sysUser
)
{
return
R
.
failed
(
Boolean
.
FALSE
);
return
R
.
failed
(
Boolean
.
FALSE
);
}
}
return
R
.
ok
(
userService
.
removeUserById
(
sysUser
));
return
R
.
ok
(
userService
.
removeUserById
(
sysUser
));
...
@@ -151,6 +163,7 @@ public class UserController {
...
@@ -151,6 +163,7 @@ public class UserController {
/**
/**
* 添加用户
* 添加用户
*
* @param userDto 用户信息
* @param userDto 用户信息
* @return success/false
* @return success/false
*/
*/
...
@@ -163,6 +176,7 @@ public class UserController {
...
@@ -163,6 +176,7 @@ public class UserController {
/**
/**
* 更新用户信息
* 更新用户信息
*
* @param userDto 用户信息
* @param userDto 用户信息
* @return R
* @return R
*/
*/
...
@@ -175,6 +189,7 @@ public class UserController {
...
@@ -175,6 +189,7 @@ public class UserController {
/**
/**
* 修改密码
* 修改密码
*
* @param vo 用户信息
* @param vo 用户信息
* @return R
* @return R
*/
*/
...
@@ -186,6 +201,7 @@ public class UserController {
...
@@ -186,6 +201,7 @@ public class UserController {
/**
/**
* 分页查询用户
* 分页查询用户
*
* @param page 参数集
* @param page 参数集
* @param userDTO 查询参数列表
* @param userDTO 查询参数列表
* @return 用户集合
* @return 用户集合
...
@@ -197,6 +213,7 @@ public class UserController {
...
@@ -197,6 +213,7 @@ public class UserController {
/**
/**
* 修改个人信息
* 修改个人信息
*
* @param userDto userDto
* @param userDto userDto
* @return success/false
* @return success/false
*/
*/
...
@@ -217,6 +234,7 @@ public class UserController {
...
@@ -217,6 +234,7 @@ public class UserController {
/**
/**
* 导出excel 表格
* 导出excel 表格
*
* @param userDTO 查询条件
* @param userDTO 查询条件
* @return
* @return
*/
*/
...
@@ -229,6 +247,7 @@ public class UserController {
...
@@ -229,6 +247,7 @@ public class UserController {
/**
/**
* 导入用户
* 导入用户
*
* @param excelVOList 用户列表
* @param excelVOList 用户列表
* @param bindingResult 错误信息列表
* @param bindingResult 错误信息列表
* @return R
* @return R
...
@@ -241,6 +260,7 @@ public class UserController {
...
@@ -241,6 +260,7 @@ public class UserController {
/**
/**
* 从ldap中获取用户
* 从ldap中获取用户
*
* @return R
* @return R
*/
*/
@SysLog
(
"从ldap中获取用户"
)
@SysLog
(
"从ldap中获取用户"
)
...
@@ -251,6 +271,7 @@ public class UserController {
...
@@ -251,6 +271,7 @@ public class UserController {
/**
/**
* 从ldap中获取用户
* 从ldap中获取用户
*
* @return R
* @return R
*/
*/
@SysLog
(
"从ldap中获取用户"
)
@SysLog
(
"从ldap中获取用户"
)
...
@@ -262,12 +283,13 @@ public class UserController {
...
@@ -262,12 +283,13 @@ public class UserController {
/**
/**
* 从ldap中验证登录用户
* 从ldap中验证登录用户
*
* @return R
* @return R
*/
*/
@SysLog
(
"登录验证"
)
@SysLog
(
"登录验证"
)
@PostMapping
(
"/ldapLogin"
)
@PostMapping
(
"/ldapLogin"
)
public
R
<
Boolean
>
loginAuthentication
(
@RequestParam
String
userName
,
@RequestParam
String
password
)
throws
NoSuchAlgorithmException
{
public
R
<
Boolean
>
loginAuthentication
(
@RequestParam
String
userName
,
@RequestParam
String
password
)
throws
NoSuchAlgorithmException
{
return
userService
.
loginAuthentication
(
userName
,
password
);
return
userService
.
loginAuthentication
(
userName
,
password
);
}
}
/**
/**
...
@@ -284,45 +306,46 @@ public class UserController {
...
@@ -284,45 +306,46 @@ public class UserController {
}
}
/**
/**
* @return
* @Author fxj
* @Author fxj
* @Description 获取所有用户极
* @Description 获取所有用户极
* @Date 18:20 2022/8/16
* @Date 18:20 2022/8/16
* @Param
* @Param
* @return
**/
**/
@Inner
@Inner
@PostMapping
(
value
=
{
"/inner/getAllUserName"
})
@PostMapping
(
value
=
{
"/inner/getAllUserName"
})
public
AllUserNaVo
getAllUserDTO
()
{
public
AllUserNaVo
getAllUserDTO
()
{
AllUserNaVo
naVo
=
new
AllUserNaVo
();
AllUserNaVo
naVo
=
new
AllUserNaVo
();
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
());
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
());
if
(
Common
.
isNotEmpty
(
sysUsers
)){
if
(
Common
.
isNotEmpty
(
sysUsers
))
{
HashMap
<
String
,
String
>
nameMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
nameMap
=
new
HashMap
<>();
for
(
SysUser
u
:
sysUsers
)
{
for
(
SysUser
u
:
sysUsers
)
{
nameMap
.
put
(
u
.
getUserId
(),
u
.
getNickname
());
nameMap
.
put
(
u
.
getUserId
(),
u
.
getNickname
());
}
}
naVo
.
setUserNames
(
nameMap
);
naVo
.
setUserNames
(
nameMap
);
}
}
return
naVo
;
return
naVo
;
}
}
/**
/**
* @return
* @Author fxj
* @Author fxj
* @Description 获取所有用户-- 指定用户名
* @Description 获取所有用户-- 指定用户名
* @Date 18:20 2022/8/16
* @Date 18:20 2022/8/16
* @Param
* @Param
* @return
**/
**/
@Inner
@Inner
@PostMapping
(
value
=
{
"/inner/getUserIdsByUserNames"
})
@PostMapping
(
value
=
{
"/inner/getUserIdsByUserNames"
})
public
SysUserListVo
getUserIdsByUserNames
(
@RequestBody
String
usernames
)
{
public
SysUserListVo
getUserIdsByUserNames
(
@RequestBody
String
usernames
)
{
SysUserListVo
naVo
=
new
SysUserListVo
();
SysUserListVo
naVo
=
new
SysUserListVo
();
if
(
Common
.
isEmpty
(
usernames
)){
if
(
Common
.
isEmpty
(
usernames
))
{
return
naVo
;
return
naVo
;
}
}
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
()
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
()
.
in
(
SysUser:
:
getUsername
,
Common
.
getList
(
usernames
)));
.
in
(
SysUser:
:
getUsername
,
Common
.
getList
(
usernames
)));
if
(
Common
.
isNotEmpty
(
sysUsers
)){
if
(
Common
.
isNotEmpty
(
sysUsers
))
{
List
<
String
>
userIds
=
new
ArrayList
<>();
List
<
String
>
userIds
=
new
ArrayList
<>();
for
(
SysUser
u
:
sysUsers
)
{
for
(
SysUser
u
:
sysUsers
)
{
userIds
.
add
(
u
.
getUserId
());
userIds
.
add
(
u
.
getUserId
());
}
}
naVo
.
setUserIds
(
userIds
);
naVo
.
setUserIds
(
userIds
);
...
@@ -330,6 +353,7 @@ public class UserController {
...
@@ -330,6 +353,7 @@ public class UserController {
}
}
return
naVo
;
return
naVo
;
}
}
/**
/**
* @Author hgw
* @Author hgw
* @Description 获取部门下的用户id
* @Description 获取部门下的用户id
...
@@ -342,8 +366,8 @@ public class UserController {
...
@@ -342,8 +366,8 @@ public class UserController {
if
(
Common
.
isNotNull
(
deptIds
))
{
if
(
Common
.
isNotNull
(
deptIds
))
{
List
<
String
>
list
=
Common
.
initStrToList
(
deptIds
,
","
);
List
<
String
>
list
=
Common
.
initStrToList
(
deptIds
,
","
);
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
().
in
(
SysUser:
:
getDeptId
,
list
));
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
().
in
(
SysUser:
:
getDeptId
,
list
));
if
(
Common
.
isNotEmpty
(
sysUsers
)){
if
(
Common
.
isNotEmpty
(
sysUsers
))
{
for
(
SysUser
u
:
sysUsers
)
{
for
(
SysUser
u
:
sysUsers
)
{
userIds
.
append
(
",'"
).
append
(
u
.
getUserId
()).
append
(
"'"
);
userIds
.
append
(
",'"
).
append
(
u
.
getUserId
()).
append
(
"'"
);
}
}
}
}
...
@@ -363,8 +387,8 @@ public class UserController {
...
@@ -363,8 +387,8 @@ public class UserController {
if
(
Common
.
isNotNull
(
deptIds
))
{
if
(
Common
.
isNotNull
(
deptIds
))
{
List
<
String
>
list
=
Common
.
initStrToList
(
deptIds
,
","
);
List
<
String
>
list
=
Common
.
initStrToList
(
deptIds
,
","
);
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
().
in
(
SysUser:
:
getDeptId
,
list
));
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
().
in
(
SysUser:
:
getDeptId
,
list
));
if
(
Common
.
isNotEmpty
(
sysUsers
)){
if
(
Common
.
isNotEmpty
(
sysUsers
))
{
for
(
SysUser
u
:
sysUsers
)
{
for
(
SysUser
u
:
sysUsers
)
{
userIds
.
append
(
",'"
).
append
(
u
.
getUsername
()).
append
(
"'"
);
userIds
.
append
(
",'"
).
append
(
u
.
getUsername
()).
append
(
"'"
);
}
}
}
}
...
@@ -388,4 +412,44 @@ public class UserController {
...
@@ -388,4 +412,44 @@ public class UserController {
return
R
.
ok
(
sysUserList
);
return
R
.
ok
(
sysUserList
);
}
}
/**
* @param idCard
* @Description: 获取C端用户是否存在
* @Author: hgw
* @Date: 2022/12/13 14:50
* @return: java.lang.Integer
**/
@Inner
@GetMapping
(
"/inner/getCountByIdCard"
)
public
Integer
getCountByIdCard
(
@RequestParam
String
idCard
)
{
return
(
int
)
userService
.
count
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getUsername
,
idCard
)
.
eq
(
SysUser:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
)
.
isNotNull
(
SysUser:
:
getWxOpenid
));
}
/**
* C端用户信息注册
*
* @return
*/
@Operation
(
description
=
"c端用户信息注册"
)
@PostMapping
(
"/employee/registration"
)
public
R
<
String
>
registration
(
@RequestBody
TSalaryEmployee
employeeInfo
,
String
openId
,
String
headImgUrl
,
String
cCode
)
{
if
(
null
==
employeeInfo
||
Common
.
isEmpty
(
employeeInfo
.
getEmpIdcard
())
||
Common
.
isEmpty
(
employeeInfo
.
getEmpPhone
()))
{
return
R
.
failed
(
"身份证和手机号不能为空"
);
}
if
(
Common
.
isEmpty
(
openId
))
{
return
R
.
failed
(
"openId不能为空!"
);
}
if
(
null
!=
redisUtil
.
get
(
CommonConstants
.
C_PREFIX
.
concat
(
employeeInfo
.
getEmpPhone
())))
{
String
code
=
(
String
)
redisUtil
.
get
(
CommonConstants
.
C_PREFIX
.
concat
(
employeeInfo
.
getEmpPhone
()));
if
(!
code
.
equals
(
cCode
))
{
return
R
.
failed
(
"验证码错误,请核实"
);
}
}
else
{
return
R
.
failed
(
"未找到手机号对应的验证码或验证码已超时,请重新获取"
);
}
userService
.
saveCUser
(
employeeInfo
.
getEmpIdcard
(),
employeeInfo
.
getEmpName
(),
employeeInfo
.
getEmpPhone
(),
openId
,
headImgUrl
);
return
R
.
ok
();
}
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
View file @
4d017d12
...
@@ -145,4 +145,17 @@ public interface SysUserService extends IService<SysUser> {
...
@@ -145,4 +145,17 @@ public interface SysUserService extends IService<SysUser> {
*/
*/
R
<
Boolean
>
loginAuthentication
(
String
userName
,
String
password
)
throws
NoSuchAlgorithmException
;
R
<
Boolean
>
loginAuthentication
(
String
userName
,
String
password
)
throws
NoSuchAlgorithmException
;
/**
* @param empIdCard 身份证
* @param empName 姓名
* @param empPhone 手机号
* @param openId 微信的openId,工资条使用的
* @param headImgUrl 头像
* @Description: 保存C端用户
* @Author: hgw
* @Date: 2022/12/13 11:54
* @return: boolean
**/
boolean
saveCUser
(
String
empIdCard
,
String
empName
,
String
empPhone
,
String
openId
,
String
headImgUrl
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
View file @
4d017d12
...
@@ -551,4 +551,45 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -551,4 +551,45 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
}
return
R
.
failed
(
"验证不通过"
);
return
R
.
failed
(
"验证不通过"
);
}
}
/**
* @param empIdCard 身份证
* @param empName 姓名
* @param empPhone 手机号
* @param openId 微信的openId,工资条使用的
* @param headImgUrl 头像
* @Description: 保存C端用户
* @Author: hgw
* @Date: 2022/12/13 11:54
* @return: boolean
**/
@Override
public
boolean
saveCUser
(
String
empIdCard
,
String
empName
,
String
empPhone
,
String
openId
,
String
headImgUrl
)
{
SysUser
user
=
this
.
getOne
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getUsername
,
empIdCard
)
.
eq
(
SysUser:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
//用户信息封装
if
(
user
==
null
)
{
user
=
new
SysUser
();
user
.
setPassword
(
ENCODER
.
encode
(
"123456"
));
user
.
setUsername
(
empIdCard
);
user
.
setNickname
(
empName
);
user
.
setPost
(
"C端用户"
);
user
.
setLockFlag
(
CommonConstants
.
STATUS_NORMAL
);
user
.
setDelFlag
(
CommonConstants
.
STATUS_NORMAL
);
user
.
setCreateTime
(
LocalDateTime
.
now
());
user
.
setPhone
(
empPhone
);
//使用根节点
user
.
setDeptId
(
CommonConstants
.
WX_C_ORG_ID
);
user
.
setDeptName
(
CommonConstants
.
WX_C_ORG_NAME
);
user
.
setUserGroup
(
CommonConstants
.
ONE_STRING
);
user
.
setEmail
(
empPhone
+
"@193.com"
);
user
.
setSystemFlag
(
CommonConstants
.
ONE_STRING
);
user
.
setAvatar
(
headImgUrl
);
}
else
{
user
.
setUpdateTime
(
LocalDateTime
.
now
());
user
.
setUpdateBy
(
"C端"
);
}
user
.
setWxOpenid
(
openId
);
return
this
.
saveOrUpdate
(
user
);
}
}
}
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