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
5b0899d4
Commit
5b0899d4
authored
Jan 14, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预入职下载-fxj
parent
7ad6ca9e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
246 additions
and
6 deletions
+246
-6
TSettleDomain.java
...ifu/cloud/plus/v1/yifu/archives/entity/TSettleDomain.java
+2
-2
TAttaInfoVo.java
.../com/yifu/cloud/plus/v1/yifu/archives/vo/TAttaInfoVo.java
+35
-0
TSettleDomainEkpVo.java
...fu/cloud/plus/v1/yifu/archives/vo/TSettleDomainEkpVo.java
+2
-2
TPreEmpMainController.java
...us/v1/yifu/archives/controller/TPreEmpMainController.java
+33
-0
TAttaInfoMapper.java
...u/cloud/plus/v1/yifu/archives/mapper/TAttaInfoMapper.java
+4
-0
TAttaInfoService.java
...cloud/plus/v1/yifu/archives/service/TAttaInfoService.java
+4
-0
TPreEmpMainService.java
...oud/plus/v1/yifu/archives/service/TPreEmpMainService.java
+3
-0
TAttaInfoServiceImpl.java
...s/v1/yifu/archives/service/impl/TAttaInfoServiceImpl.java
+10
-0
TPreEmpMainServiceImpl.java
...v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
+123
-0
TAttaInfoMapper.xml
...rchives-biz/src/main/resources/mapper/TAttaInfoMapper.xml
+28
-1
YifuWxLoginSuccessHandler.java
.../plus/v1/yifu/auth/handler/YifuWxLoginSuccessHandler.java
+0
-1
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+2
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TSettleDomain.java
View file @
5b0899d4
...
...
@@ -529,9 +529,9 @@ public class TSettleDomain extends BaseEntity {
private
String
secondIndicatorBelong
;
/**
* 是否含
险金
fxj 2025-01-10 v1.7.5
* 是否含
风险
fxj 2025-01-10 v1.7.5
*/
@Schema
(
description
=
"是否含
险金
"
,
name
=
"hasContainRisks"
)
@Schema
(
description
=
"是否含
风险
"
,
name
=
"hasContainRisks"
)
private
String
hasContainRisks
;
/**
* 事业部条线 fxj 2025-01-10 v1.7.5
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TAttaInfoVo.java
0 → 100644
View file @
5b0899d4
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
/**
* @Author fxj
* @Description 附件信息表
* @Date 11:07 2022/6/22
**/
@Data
public
class
TAttaInfoVo
extends
TAttaInfo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 其他分租名称
*/
@TableField
(
exist
=
false
)
private
String
groupName
;
/**
* 姓名
*/
@Schema
(
description
=
"姓名"
)
private
String
empName
;
/**
* 身份证
*/
@Schema
(
description
=
"身份证"
)
private
String
empIdcard
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TSettleDomainEkpVo.java
View file @
5b0899d4
...
...
@@ -449,9 +449,9 @@ public class TSettleDomainEkpVo implements Serializable {
private
String
secondIndicatorBelong
;
/**
* 是否含
险金
* 是否含
风险
*/
@Schema
(
description
=
"是否含
险金
"
,
name
=
"hasContainRisks"
)
@Schema
(
description
=
"是否含
风险
"
,
name
=
"hasContainRisks"
)
private
String
hasContainRisks
;
/**
* 事业部条线
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TPreEmpMainController.java
View file @
5b0899d4
...
...
@@ -322,5 +322,38 @@ public class TPreEmpMainController {
}
return
tPreEmpMainService
.
checkCode
(
empPhone
,
verifyCode
);
}
/**
* @Author fxj
* @Description 预入职C端签名图盘打包下载
* @Date 14:07 2025/1/10
* @Param
* @return
**/
@Operation
(
summary
=
"预入职C端签名图盘打包下载ZIP包"
,
description
=
"预入职C端签名图盘打包下载ZIP包"
)
@SysLog
(
"预入职C端签名图盘打包下载ZIP包"
)
@GetMapping
(
"/preEmpExport"
)
public
void
preEmpExport
(
@RequestParam
(
value
=
"departNo"
,
required
=
true
)
String
departNo
,
@RequestParam
(
value
=
"departName"
,
required
=
true
)
String
departName
,
@RequestParam
(
value
=
"startDate"
,
required
=
true
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
true
)
String
endDate
,
HttpServletResponse
response
)
throws
Exception
{
tPreEmpMainService
.
exportEmpsFile
(
departName
,
departNo
,
startDate
,
endDate
,
response
);
}
/**
* @Author fxj
* @Description 预入职C端签名图盘打包下载 count
* @Date 14:07 2025/1/10
* @Param
* @return
**/
@Operation
(
summary
=
"预入职C端签名图盘打包下载ZIP包count"
,
description
=
"预入职C端签名图盘打包下载ZIP包count"
)
@SysLog
(
"预入职C端签名图盘打包下载ZIP包count"
)
@GetMapping
(
"/preEmpCount"
)
public
R
preEmpCount
(
@RequestParam
(
value
=
"departNo"
,
required
=
true
)
String
departNo
,
@RequestParam
(
value
=
"startDate"
,
required
=
true
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
true
)
String
endDate
,
HttpServletResponse
response
)
throws
Exception
{
return
tPreEmpMainService
.
preEmpCount
(
departNo
,
startDate
,
endDate
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TAttaInfoMapper.java
View file @
5b0899d4
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAttaInfoVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -51,4 +52,7 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
// 删除学历与职业资格之外的附件
void
deleteByDomainIdAndOther
(
@Param
(
"domainId"
)
String
domainId
);
List
<
TAttaInfoVo
>
getAttInfoByParam
(
@Param
(
"departNo"
)
String
departNo
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
int
getAttInfoCountByParam
(
@Param
(
"departNo"
)
String
departNo
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TAttaInfoService.java
View file @
5b0899d4
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAttaInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.time.LocalDateTime
;
...
...
@@ -83,4 +84,7 @@ public interface TAttaInfoService extends IService<TAttaInfo> {
void
deleteByDomainIdAndType
(
String
domainId
,
int
relationType
);
List
<
TAttaInfoVo
>
getAttInfoByParam
(
String
departNo
,
String
startDate
,
String
endDate
);
int
getAttInfoCountByParam
(
String
departNo
,
String
startDate
,
String
endDate
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TPreEmpMainService.java
View file @
5b0899d4
...
...
@@ -131,4 +131,7 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> {
*/
R
<
String
>
checkCode
(
String
empPhone
,
String
verifyCode
);
void
exportEmpsFile
(
String
departName
,
String
departNo
,
String
startDate
,
String
endDate
,
HttpServletResponse
response
);
R
preEmpCount
(
String
departNo
,
String
startDate
,
String
endDate
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TAttaInfoServiceImpl.java
View file @
5b0899d4
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAttaInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -154,4 +155,13 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo
}
}
@Override
public
List
<
TAttaInfoVo
>
getAttInfoByParam
(
String
departNo
,
String
startDate
,
String
endDate
)
{
return
baseMapper
.
getAttInfoByParam
(
departNo
,
startDate
,
endDate
);
}
@Override
public
int
getAttInfoCountByParam
(
String
departNo
,
String
startDate
,
String
endDate
)
{
return
baseMapper
.
getAttInfoCountByParam
(
departNo
,
startDate
,
endDate
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
View file @
5b0899d4
...
...
@@ -61,8 +61,17 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TBankNameMapVo
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.compress.archivers.zip.ZipArchiveEntry
;
import
org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
;
import
org.apache.commons.compress.utils.Lists
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.authority.AuthorityUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -164,6 +173,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
private
final
AtomicInteger
preImportAtomicInteger
=
new
AtomicInteger
(
0
);
private
final
AtomicInteger
preExportAtomicInteger
=
new
AtomicInteger
(
0
);
private
final
AtomicInteger
zipAtomicInteger
=
new
AtomicInteger
(
0
);
/**
* 预入职-主表简单分页查询
*
...
...
@@ -4283,5 +4294,117 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return
R
.
ok
(
"验证码通过"
);
}
@Override
public
R
preEmpCount
(
String
departNo
,
String
startDate
,
String
endDate
){
if
(
Common
.
isEmpty
(
departNo
)
||
Common
.
isEmpty
(
startDate
)
||
Common
.
isEmpty
(
endDate
)
||
DateUtil
.
isDate
(
startDate
)
||
DateUtil
.
isDate
(
endDate
))
{
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
return
R
.
ok
(
tAttaInfoService
.
getAttInfoCountByParam
(
departNo
,
startDate
,
endDate
));
}
/**
* @Author fxj
* @Description 预入职C端签名图盘打包下载
* @Date 14:07 2025/1/10
* @Param
* @return
**/
@Override
public
void
exportEmpsFile
(
String
departName
,
String
departNo
,
String
startDate
,
String
endDate
,
HttpServletResponse
response
)
{
if
(
zipAtomicInteger
.
incrementAndGet
()
<=
1
)
{
try
{
extracted
(
departName
,
departNo
,
startDate
,
endDate
,
response
);
}
catch
(
Exception
e
)
{
log
.
error
(
"导出异常:"
,
e
);
}
finally
{
zipAtomicInteger
.
decrementAndGet
();
}
}
else
{
// 前面做了+1(atomicInteger.incrementAndGet())这里也要-1
zipAtomicInteger
.
decrementAndGet
();
log
.
error
(
"预入职签名文件导出超出阈值:"
+
ResultConstants
.
FILE_DOWN_LOAD_DATA
);
exportError
(
response
,
ResultConstants
.
FILE_DOWN_LOAD_DATA
);
}
}
private
void
extracted
(
String
departName
,
String
departNo
,
String
startDate
,
String
endDate
,
HttpServletResponse
response
)
{
if
(
Common
.
isEmpty
(
departNo
)
||
Common
.
isEmpty
(
startDate
)
||
Common
.
isEmpty
(
endDate
)
||
DateUtil
.
isDate
(
startDate
)
||
DateUtil
.
isDate
(
endDate
))
{
throw
new
RuntimeException
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
List
<
TAttaInfoVo
>
handles
=
tAttaInfoService
.
getAttInfoByParam
(
departNo
,
startDate
,
endDate
);
if
(
Common
.
isEmpty
(
handles
))
{
throw
new
RuntimeException
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
// 判断文件大小 超出100M 104,857,600 直接提示重新筛选条件
long
size
=
0
;
if
(
Common
.
isNotNull
(
handles
)){
for
(
TAttaInfoVo
vo:
handles
){
size
=
size
+
vo
.
getAttaSize
();
}
if
(
size
>
104857600
){
exportError
(
response
,
CommonConstants
.
DATA_TOO_LARGER_FOR_DOWN
);
}
}
HttpGet
httpGet
;
try
{
//初始化导出 response
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"content-type"
,
"application/octet-stream"
);
response
.
setHeader
(
HttpHeaders
.
CONTENT_DISPOSITION
,
"attachment; filename="
+
URLEncoder
.
encode
(
departName
+
departNo
,
"UTF-8"
)
+
".zip"
);
ZipArchiveOutputStream
zipOutput
=
null
;
zipOutput
=
new
ZipArchiveOutputStream
(
response
.
getOutputStream
());
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
// 获取人员档案所有的附件信息
getFilesInfo
(
handles
);
// 处理附件 压缩并下载
if
(
Common
.
isNotNull
(
handles
))
{
try
{
CloseableHttpResponse
response1
;
HttpEntity
entity
;
byte
[]
data
;
ZipArchiveEntry
entry
;
for
(
TAttaInfoVo
fileAtta
:
handles
)
{
if
(
Common
.
isNotNull
(
fileAtta
.
getAttaUrl
())){
httpGet
=
new
HttpGet
(
fileAtta
.
getAttaUrl
());
response1
=
httpClient
.
execute
(
httpGet
);
entity
=
response1
.
getEntity
();
data
=
EntityUtils
.
toByteArray
(
entity
);
entry
=
new
ZipArchiveEntry
(
fileAtta
.
getEmpName
()
+
fileAtta
.
getEmpIdcard
()
+
".png"
);
zipOutput
.
putArchiveEntry
(
entry
);
zipOutput
.
write
(
data
);
zipOutput
.
closeArchiveEntry
();
}
}
zipOutput
.
finish
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
private
void
getFilesInfo
(
List
<
TAttaInfoVo
>
handles
)
{
URL
url
;
// 获取其他附件以外的附件如身份证正反面
if
(
Common
.
isNotNull
(
handles
))
{
for
(
TAttaInfoVo
atta
:
handles
)
{
if
(
CommonConstants
.
TWENTY_THREE_STRING
.
equals
(
atta
.
getRelationType
()))
{
url
=
ossUtil
.
getObjectUrl
(
null
,
atta
.
getAttaSrc
());
atta
.
setAttaUrl
(
url
.
toString
().
replace
(
"http"
,
"https"
));
}
}
}
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TAttaInfoMapper.xml
View file @
5b0899d4
...
...
@@ -134,5 +134,32 @@
<delete
id=
"deleteByDomainIdAndOther"
>
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('0','2','26','27')
</delete>
<select
id=
"getAttInfoByParam"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.vo.TAttaInfoVo"
>
SELECT
b.id,
b.atta_name,
b.atta_src,
b.atta_size,
b.atta_type,
b.create_by,
b.create_time,
b.relation_type,
b.domain_id, a.EMP_NAME,a.EMP_IDCARD
from (select id,EMP_NAME,EMP_IDCARD from t_pre_emp_main where `STATUS`='4' and SOUR_TYPE='0'
and DEPT_NO=#{departNo}
and AUDIT_TIME >= #{startDate}
and AUDIT_TIME
<![CDATA[ <= ]]>
#{endDate}) a
LEFT JOIN (select * from t_atta_info where RELATION_TYPE ='23' GROUP BY DOMAIN_ID ) b on a.id=b.DOMAIN_ID
where b.DOMAIN_ID is not null LIMIT 100
</select>
<select
id=
"getAttInfoCountByParam"
resultType=
"java.lang.Integer"
>
SELECT
count(1)
from (select id from t_pre_emp_main where `STATUS`='4' and SOUR_TYPE='0'
and DEPT_NO = #{departNo}
and AUDIT_TIME >= #{startDate}
and AUDIT_TIME
<![CDATA[ <= ]]>
#{endDate}) a
LEFT JOIN (select * from t_atta_info where RELATION_TYPE ='23' GROUP BY DOMAIN_ID ) b on a.id=b.DOMAIN_ID
where b.DOMAIN_ID is not null
</select>
</mapper>
yifu-auth/src/main/java/com/yifu/cloud/plus/v1/yifu/auth/handler/YifuWxLoginSuccessHandler.java
View file @
5b0899d4
...
...
@@ -126,7 +126,6 @@ public class YifuWxLoginSuccessHandler implements AuthenticationSuccessHandler {
response
.
setStatus
(
HttpStatus
.
HTTP_OK
);
PrintWriter
printWriter
=
response
.
getWriter
();
printWriter
.
append
(
objectMapper
.
writeValueAsString
(
result
));
log
.
info
(
"登录成功返回结果1111111:"
+
objectMapper
.
writeValueAsString
(
result
));
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
5b0899d4
...
...
@@ -343,6 +343,8 @@ public interface CommonConstants {
String
NO_DATA_TO_HANDLE
=
"无数据可操作!"
;
String
DATA_TOO_LARGER_FOR_DOWN
=
"下载数据超出100M,请重现选择下载条件!"
;
String
PLEASE_LOG_IN
=
"请登录!"
;
String
SEX_MAN
=
"1"
;
...
...
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