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
6a277d40
Commit
6a277d40
authored
Oct 16, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.0' into MVP1.7.0
parents
8bd38009
4604a0f6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
249 additions
and
3 deletions
+249
-3
EmpMainToCVo.java
...com/yifu/cloud/plus/v1/yifu/archives/vo/EmpMainToCVo.java
+33
-0
TPreEmpMainController.java
...us/v1/yifu/archives/controller/TPreEmpMainController.java
+59
-0
TPreEmpMainService.java
...oud/plus/v1/yifu/archives/service/TPreEmpMainService.java
+36
-0
TPreEmpMainServiceImpl.java
...v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
+115
-1
TEmployeeInfoMapper.xml
...ves-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
+1
-2
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+5
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpMainToCVo.java
0 → 100644
View file @
6a277d40
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* C端登录处查系统用户数据
* @author chenyuxi
* @date 2024/10/15
* @since mvp1.7.0
*/
@Data
public
class
EmpMainToCVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Schema
(
description
=
"预入职审核状态(0草稿;1待完善;2待审核;3审核不通过;4审核通过;5初始未保存)"
)
private
String
preStatus
;
@Schema
(
description
=
"员工姓名"
)
private
String
empName
;
@Schema
(
description
=
"身份证号"
)
private
String
empIdcard
;
@Schema
(
description
=
"手机号码"
)
private
String
empPhone
;
@Schema
(
description
=
"来源(0:在档,1:预入职,2:不在系统)"
)
private
String
empFrom
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TPreEmpMainController.java
View file @
6a277d40
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpMainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpMainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
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.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
...
@@ -263,4 +264,62 @@ public class TPreEmpMainController {
...
@@ -263,4 +264,62 @@ public class TPreEmpMainController {
return
tPreEmpMainService
.
uploadPreEmp
(
file
,
vo
);
return
tPreEmpMainService
.
uploadPreEmp
(
file
,
vo
);
}
}
/**
* 根据身份证与姓名查询用户手机号和来源
*
* @param empIdCard 身份证
* @param empName 姓名
* @return R<EmpMainToCVo>
*
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*
**/
@Operation
(
summary
=
"根据身份证与姓名查询用户手机号和来源"
,
description
=
"根据身份证与姓名查询用户手机号和来源"
)
@GetMapping
(
"/getPhoneByCardAndName"
)
public
R
<
EmpMainToCVo
>
getPhoneByCardAndName
(
@Param
(
"empIdCard"
)
String
empIdCard
,
@Param
(
"empName"
)
String
empName
)
{
return
tPreEmpMainService
.
getPhoneByCardAndName
(
empIdCard
,
empName
);
}
/**
* 发送手机验证码
*
* @param empPhone 手机号
* @return R<String>
*
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
@PostMapping
(
"/sendCode"
)
public
R
<
String
>
sendCode
(
@Param
(
"empPhone"
)
String
empPhone
)
{
if
(
Common
.
isEmpty
(
empPhone
))
{
return
R
.
failed
(
"手机号不能为空"
);
}
return
tPreEmpMainService
.
sendCode
(
empPhone
);
}
/**
* 校验手机验证码
*
* @param empPhone 手机号
* @param verifyCode 验证码
* @return R<String>
*
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
@PostMapping
(
"/checkCode"
)
public
R
<
String
>
checkCode
(
@Param
(
"empPhone"
)
String
empPhone
,
@Param
(
"verifyCode"
)
String
verifyCode
)
{
if
(
Common
.
isEmpty
(
empPhone
))
{
return
R
.
failed
(
"手机号不能为空"
);
}
if
(
Common
.
isEmpty
(
verifyCode
))
{
return
R
.
failed
(
"验证码不能为空"
);
}
return
tPreEmpMainService
.
checkCode
(
empPhone
,
verifyCode
);
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TPreEmpMainService.java
View file @
6a277d40
...
@@ -95,4 +95,40 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> {
...
@@ -95,4 +95,40 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> {
**/
**/
R
<
List
<
PreUploadEmpImportVo
>>
uploadPreEmp
(
MultipartFile
file
,
PreUploadImportParamVo
vo
)
throws
Exception
;
R
<
List
<
PreUploadEmpImportVo
>>
uploadPreEmp
(
MultipartFile
file
,
PreUploadImportParamVo
vo
)
throws
Exception
;
/**
* 根据身份证与姓名查询用户手机号和来源
* @param empIdCard 身份证
* @param empName 姓名
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
* @return EmpMainToCVo
**/
R
<
EmpMainToCVo
>
getPhoneByCardAndName
(
String
empIdCard
,
String
empName
);
/**
* 发送手机验证码
*
* @param empPhone 手机号
* @return R<String>
*
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
R
<
String
>
sendCode
(
String
empPhone
);
/**
* 校验手机验证码
*
* @param empPhone 手机号
* @param verifyCode 验证码
* @return R<String>
*
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
R
<
String
>
checkCode
(
String
empPhone
,
String
verifyCode
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
View file @
6a277d40
...
@@ -44,6 +44,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
...
@@ -44,6 +44,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
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.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties
;
...
@@ -153,6 +155,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
...
@@ -153,6 +155,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
public
static
final
String
taxMonthRegex
=
"^2\\d{5}"
;
public
static
final
String
taxMonthRegex
=
"^2\\d{5}"
;
private
final
RedisUtil
redisUtil
;
/**
/**
* 预入职-主表简单分页查询
* 预入职-主表简单分页查询
*
*
...
@@ -4003,4 +4007,114 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
...
@@ -4003,4 +4007,114 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return
content
.
matches
(
"^.*\\d{14}.*$"
);
return
content
.
matches
(
"^.*\\d{14}.*$"
);
}
}
/**
* 根据身份证与姓名查询用户手机号和来源
*
* @param empIdCard 身份证
* @param empName 姓名
* @return EmpMainToCVo
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
@Override
public
R
<
EmpMainToCVo
>
getPhoneByCardAndName
(
String
empIdCard
,
String
empName
)
{
if
(
Common
.
isEmpty
(
empIdCard
)
||
Common
.
isEmpty
(
empName
)){
return
R
.
failed
(
"身份证、姓名都要必填"
);
}
EmpMainToCVo
empMainToCVo
=
new
EmpMainToCVo
();
// 默认不在系统
empMainToCVo
.
setEmpFrom
(
CommonConstants
.
TWO_STRING
);
empMainToCVo
.
setEmpPhone
(
""
);
empMainToCVo
.
setPreStatus
(
""
);
// 用身份证先查是否在【在档人员】里
TEmployeeInfo
employee
=
tEmployeeInfoService
.
getInfoByIdcard
(
empIdCard
);
if
(
employee
!=
null
)
{
// 在档人员
if
(!
empName
.
equals
(
employee
.
getEmpName
()))
{
return
R
.
failed
(
"在档人员里找不到身份证对应的人员"
);
}
else
{
empMainToCVo
.
setEmpFrom
(
CommonConstants
.
ZERO_STRING
);
empMainToCVo
.
setEmpPhone
(
employee
.
getEmpPhone
());
empMainToCVo
.
setPreStatus
(
""
);
return
R
.
ok
(
empMainToCVo
);
}
}
else
{
// 用身份证先查是否在【预入职】里
TPreEmpMain
preEmpMain
=
baseMapper
.
selectOne
(
Wrappers
.<
TPreEmpMain
>
query
().
lambda
()
.
eq
(
TPreEmpMain:
:
getEmpIdcard
,
empIdCard
)
.
ne
(
TPreEmpMain:
:
getStatus
,
CommonConstants
.
FIVE_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
preEmpMain
!=
null
)
{
// 在档人员
if
(!
empName
.
equals
(
preEmpMain
.
getEmpName
()))
{
return
R
.
failed
(
"预入职里找不到身份证对应的人员"
);
}
else
{
empMainToCVo
.
setEmpFrom
(
CommonConstants
.
ONE_STRING
);
empMainToCVo
.
setEmpPhone
(
preEmpMain
.
getEmpPhone
());
empMainToCVo
.
setPreStatus
(
preEmpMain
.
getStatus
());
return
R
.
ok
(
empMainToCVo
);
}
}
}
return
R
.
ok
(
empMainToCVo
);
}
/**
* 发送手机验证码
*
* @param empPhone 手机号
* @return R<String>
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
@Override
public
R
<
String
>
sendCode
(
String
empPhone
)
{
//获取验证码
String
code
=
RandomUtil
.
getSix
();
String
phoneCodeKey
=
CacheConstants
.
MVP_TOC_PHONE_CODE_PREFIX
.
concat
(
empPhone
);
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
phoneCodeKey
)))
{
code
=
(
String
)
redisUtil
.
get
(
phoneCodeKey
);
}
//发短信
AliSmsResult
result
=
SmsUtil
.
sendSms
(
empPhone
,
code
);
//验证码存缓存
if
(
AliSmsResult
.
SUCCESS_CODE
.
equals
(
result
.
getCode
()))
{
redisUtil
.
set
(
phoneCodeKey
,
code
,
300L
);
return
R
.
ok
(
"验证码已发送"
);
}
else
{
return
R
.
failed
(
null
==
result
.
getMessage
()
?
"获取验证码错误,告知管理员,阿里云短信配置错误!"
:
result
.
getMessage
());
}
}
/**
* 校验手机验证码
*
* @param empPhone 手机号
* @param verifyCode 验证码
* @return R<String>
*
* @author chenyuxi
* @date 2024-10-24 16:01:47
* @since mvp1.7.0
*/
@Override
public
R
<
String
>
checkCode
(
String
empPhone
,
String
verifyCode
)
{
String
phoneCodeKey
=
CacheConstants
.
MVP_TOC_PHONE_CODE_PREFIX
.
concat
(
empPhone
);
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
phoneCodeKey
)))
{
String
code
=
(
String
)
redisUtil
.
get
(
phoneCodeKey
);
if
(!
verifyCode
.
equals
(
code
))
{
return
R
.
failed
(
"验证码错误!"
);
}
}
else
{
return
R
.
failed
(
"验证码过期!"
);
}
// 校验通过移除已使用的验证码
redisUtil
.
remove
(
phoneCodeKey
);
return
R
.
ok
(
"验证码通过"
);
}
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
View file @
6a277d40
...
@@ -1052,7 +1052,7 @@
...
@@ -1052,7 +1052,7 @@
WHEN a.FILE_SOURCE =4 THEN "档案新建"
WHEN a.FILE_SOURCE =4 THEN "档案新建"
WHEN a.FILE_SOURCE =5 THEN "批量导入"
WHEN a.FILE_SOURCE =5 THEN "批量导入"
ELSE a.FILE_SOURCE END as "FILE_SOURCE", # 1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
ELSE a.FILE_SOURCE END as "FILE_SOURCE", # 1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
a.PROJECT_NUM,
/*a.PROJECT_NUM,*/
a.CONTRACT_STATUS,
a.CONTRACT_STATUS,
a.INSURANCE_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
a.SOCIAL_STATUS,
...
@@ -1102,7 +1102,6 @@
...
@@ -1102,7 +1102,6 @@
select
select
count(1)
count(1)
from t_employee_info a
from t_employee_info a
LEFT JOIN view_project p on a.EMP_IDCARD=p.EMP_IDCARD
<where>
<where>
a.DELETE_FLAG = '0'
a.DELETE_FLAG = '0'
<include
refid=
"employeeInfo_where_export"
/>
<include
refid=
"employeeInfo_where_export"
/>
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
6a277d40
...
@@ -183,4 +183,9 @@ public interface CacheConstants {
...
@@ -183,4 +183,9 @@ public interface CacheConstants {
* 登录用户最近一次选择的收入证明单位名称
* 登录用户最近一次选择的收入证明单位名称
*/
*/
public
static
final
String
WXHR_LAST_SELECT_COMPANY_NAME
=
"wxhr_last_select_company_name"
;
public
static
final
String
WXHR_LAST_SELECT_COMPANY_NAME
=
"wxhr_last_select_company_name"
;
/**
* C端发验证码前缀
*/
public
static
final
String
MVP_TOC_PHONE_CODE_PREFIX
=
"MVP_TOC_PHONE_CODE_"
;
}
}
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