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
8bd62c86
Commit
8bd62c86
authored
Jul 05, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
9460cd2c
350e7a65
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1810 additions
and
98 deletions
+1810
-98
IdCardUtil.java
...com/yifu/cloud/plus/v1/yifu/archives/util/IdCardUtil.java
+123
-0
EmployeeContractExportVO.java
...ud/plus/v1/yifu/archives/vo/EmployeeContractExportVO.java
+183
-0
EmployeeProjectVO.java
...ifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectVO.java
+1
-1
EmployeeConstants.java
...ud/plus/v1/yifu/archives/Constants/EmployeeConstants.java
+9
-0
FddAutoConfigue.java
...u/cloud/plus/v1/yifu/archives/config/FddAutoConfigue.java
+14
-0
FddContractAttachInfoController.java
.../archives/controller/FddContractAttachInfoController.java
+141
-3
FddContractTemplateController.java
...fu/archives/controller/FddContractTemplateController.java
+74
-14
FddController.java
...cloud/plus/v1/yifu/archives/controller/FddController.java
+35
-47
TEmployeeContractInfoController.java
.../archives/controller/TEmployeeContractInfoController.java
+6
-8
TEmployeeContractInfoMapper.java
.../v1/yifu/archives/mapper/TEmployeeContractInfoMapper.java
+3
-0
FddContractAttachInfoService.java
...1/yifu/archives/service/FddContractAttachInfoService.java
+12
-0
FddContractInfoService.java
...plus/v1/yifu/archives/service/FddContractInfoService.java
+2
-0
FddContractTemplateService.java
.../v1/yifu/archives/service/FddContractTemplateService.java
+46
-0
TEmployeeContractInfoService.java
...1/yifu/archives/service/TEmployeeContractInfoService.java
+26
-0
FddContractAttachInfoServiceImpl.java
...chives/service/impl/FddContractAttachInfoServiceImpl.java
+513
-2
FddContractInfoServiceImpl.java
...ifu/archives/service/impl/FddContractInfoServiceImpl.java
+97
-3
FddContractTemplateServiceImpl.java
...archives/service/impl/FddContractTemplateServiceImpl.java
+152
-2
FddSealInfoServiceImpl.java
...v1/yifu/archives/service/impl/FddSealInfoServiceImpl.java
+44
-0
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+19
-12
FddUtil.java
...a/com/yifu/cloud/plus/v1/yifu/archives/utils/FddUtil.java
+1
-2
spring.factories
...archives-biz/src/main/resources/META-INF/spring.factories
+2
-0
TEmployeeContractInfoMapper.xml
...src/main/resources/mapper/TEmployeeContractInfoMapper.xml
+57
-1
pom.xml
yifu-common/yifu-common-core/pom.xml
+5
-0
ExcelAttributeConstants.java
...v1/yifu/common/core/constant/ExcelAttributeConstants.java
+2
-1
ExcelException.java
...ud.plus.v1/yifu/common/core/exception/ExcelException.java
+22
-0
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+207
-0
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+14
-1
SysDictItemMapper.java
...fu.cloud.plus.v1/yifu/admin/mapper/SysDictItemMapper.java
+0
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/util/IdCardUtil.java
0 → 100644
View file @
8bd62c86
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
util
;
import
lombok.extern.slf4j.Slf4j
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
static
java
.
util
.
regex
.
Pattern
.
compile
;
/**
* 身份证处理
* @Author fxj
* @Date 2019-11-15
* @return
**/
@Slf4j
public
class
IdCardUtil
{
public
static
int
IdNOToAge
(
String
IdNO
){
int
leh
=
IdNO
.
length
();
Date
dates
=
null
;
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy"
);
String
year
=
df
.
format
(
new
Date
());
dates
=
getBirthdate
(
IdNO
);
int
u
=
Integer
.
parseInt
(
year
)-
Integer
.
parseInt
(
df
.
format
(
dates
));
return
u
;
}
/**
* 提取身份证中的出生日期,身份证非法则返回空
* @param idNum
* @return
*/
public
static
Date
getBirthdate
(
String
idNum
){
Pattern
idNumPattern
=
null
;
Matcher
idNumMatcher
=
null
;
Date
date
=
null
;
//定义判别用户身份证号的正则表达式(要么是15位,要么是18位,最后一位可以为字母)
idNumPattern
=
compile
(
"(\\d{14}[0-9a-zA-Z])|(\\d{17}[0-9a-zA-Z])"
);
//通过Pattern获得Matcher
idNumMatcher
=
idNumPattern
.
matcher
(
idNum
);
//判断用户输入是否为身份证号
if
(
idNumMatcher
.
matches
()){
Pattern
birthDatePattern
=
null
;
Matcher
birthDateMather
=
null
;
String
year
=
null
;
if
(
idNum
.
length
()==
18
){
//如果是,定义正则表达式提取出身份证中的出生日期
birthDatePattern
=
compile
(
"\\d{6}(\\d{4})(\\d{2})(\\d{2}).*"
);
//身份证上的前6位以及出生年月日
//通过Pattern获得Matcher
birthDateMather
=
birthDatePattern
.
matcher
(
idNum
);
}
else
if
(
idNum
.
length
()==
15
){
//如果是,定义正则表达式提取出身份证中的出生日期
birthDatePattern
=
compile
(
"\\d{6}(\\d{2})(\\d{2})(\\d{2}).*"
);
//身份证上的前6位以及出生年月日
//通过Pattern获得Matcher
birthDateMather
=
birthDatePattern
.
matcher
(
idNum
);
}
//通过Matcher获得用户的出生年月日
if
(
birthDateMather
.
find
()){
if
(
idNum
.
length
()==
18
){
year
=
birthDateMather
.
group
(
1
);
}
else
if
(
idNum
.
length
()==
15
){
year
=
"19"
+
birthDateMather
.
group
(
1
);
}
String
month
=
birthDateMather
.
group
(
2
);
String
datetemp
=
birthDateMather
.
group
(
3
);
String
dateStr
=
year
+
"-"
+
month
+
"-"
+
datetemp
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
shijian
=
null
;
try
{
shijian
=
sdf
.
parse
(
dateStr
);
String
temp
=
sdf
.
format
(
shijian
);
if
(
dateStr
.
equals
(
temp
)){
//输出用户的出生年月日
date
=
shijian
;
}
}
catch
(
ParseException
e
)
{
//数据有误
}
}
}
return
date
;
}
/**
* 获取身份证的性别
* @Author fxj
* @Date 2019-12-25
* @param idNum
* @return
**/
public
static
String
getSex
(
String
idNum
){
Pattern
idNumPattern
=
null
;
Matcher
idNumMatcher
=
null
;
Date
date
=
null
;
//定义判别用户身份证号的正则表达式(要么是15位,要么是18位,最后一位可以为字母)
idNumPattern
=
compile
(
"(\\d{14}[0-9a-zA-Z])|(\\d{17}[0-9a-zA-Z])"
);
//通过Pattern获得Matcher
idNumMatcher
=
idNumPattern
.
matcher
(
idNum
);
//判断用户输入是否为身份证号
String
sex
=
null
;
if
(
idNumMatcher
.
matches
())
{
if
(
idNum
.
length
()
==
18
)
{
if
(
Integer
.
parseInt
(
idNum
.
substring
(
16
).
substring
(
0
,
1
))
%
2
==
0
)
{
// 判断性别
sex
=
"2"
;
}
else
{
sex
=
"1"
;
}
}
else
if
(
idNum
.
length
()
==
15
)
{
if
(
Integer
.
parseInt
(
idNum
.
substring
(
14
,
15
))
%
2
==
0
)
{
sex
=
"2"
;
}
else
{
sex
=
"1"
;
}
}
}
return
sex
;
}
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeContractExportVO.java
0 → 100644
View file @
8bd62c86
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Set
;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
@Data
@ColumnWidth
(
10
)
public
class
EmployeeContractExportVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Schema
(
description
=
"申请编号"
)
private
String
applyNo
;
@Length
(
max
=
32
,
message
=
"员工编码不能超过32个字符"
)
@ExcelAttribute
(
name
=
"员工编码"
,
isNotEmpty
=
true
,
errorInfo
=
"员工编码不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"员工编码"
,
name
=
"empNo"
)
private
String
empNo
;
@Length
(
max
=
32
,
message
=
"员工姓名不能超过32个字符"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
maxLength
=
32
,
needExport
=
true
)
@Schema
(
description
=
"员工姓名"
,
name
=
"empName"
)
private
String
empName
;
@Length
(
max
=
32
,
message
=
"身份证号不能超过32个字符"
)
@ExcelAttribute
(
name
=
"身份证号"
,
maxLength
=
32
,
isIdCard
=
true
,
needExport
=
true
)
@Schema
(
description
=
"身份证号"
,
name
=
"empIdcard"
)
private
String
empIdcard
;
@NotBlank
(
message
=
"合同起始日期不能为空"
)
@ExcelAttribute
(
name
=
"合同起始日期"
,
isNotEmpty
=
true
,
errorInfo
=
"合同起始日期不能为空"
)
@Schema
(
description
=
"合同起始日期"
,
name
=
"contractStart"
)
private
LocalDate
contractStart
;
@ExcelAttribute
(
name
=
"合同截止日期"
,
needExport
=
true
)
@Schema
(
description
=
"合同截止日期"
,
name
=
"contractEnd"
)
private
LocalDate
contractEnd
;
@ExcelAttribute
(
name
=
"档案-省"
,
maxLength
=
32
,
isDataId
=
true
,
isArea
=
true
,
parentField
=
""
)
@Schema
(
description
=
"档案-省"
,
name
=
"fileProvince"
)
private
String
fileProvince
;
@ExcelAttribute
(
name
=
"档案-市"
,
maxLength
=
32
,
isDataId
=
true
,
isArea
=
true
,
parentField
=
"fileProvince"
)
@Schema
(
description
=
"档案-市"
,
name
=
"fileCity"
)
private
String
fileCity
;
@ExcelAttribute
(
name
=
"档案-县"
,
maxLength
=
32
,
isDataId
=
true
,
isArea
=
true
,
parentField
=
"fileCity"
)
@Schema
(
description
=
"档案-县"
,
name
=
"fileTown"
)
private
String
fileTown
;
@Length
(
max
=
128
,
message
=
"项目名称不能超过128个字符"
)
@ExcelAttribute
(
name
=
"项目名称"
,
maxLength
=
128
)
@Schema
(
description
=
"项目名称"
,
name
=
"subjectDepart"
)
private
String
subjectDepart
;
@Schema
(
description
=
"项目编码"
)
private
String
deptNo
;
@ExcelAttribute
(
name
=
"员工类型"
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMP_NATRUE
)
@Schema
(
description
=
"员工类型(字典值,0外包1派遣2代理)"
)
private
String
empNatrue
;
@NotBlank
(
message
=
"合同类型不能为空"
)
@Length
(
max
=
32
,
message
=
"合同类型不能超过32个字符"
)
@ExcelAttribute
(
name
=
"合同类型"
,
isNotEmpty
=
true
,
errorInfo
=
"合同类型不能为空"
,
maxLength
=
32
,
needExport
=
true
)
@Schema
(
description
=
"合同类型"
,
name
=
"contractName"
)
private
String
contractName
;
@NotBlank
(
message
=
"业务细分不能为空"
)
@Length
(
max
=
32
,
message
=
"业务细分不能超过32个字符"
)
@ExcelAttribute
(
name
=
"业务细分"
,
maxLength
=
32
,
needExport
=
true
)
@Schema
(
description
=
"业务细分"
,
name
=
"contractName"
)
private
String
contractSubName
;
@NotBlank
(
message
=
"签订类型不能为空"
)
@Length
(
max
=
1
,
message
=
"签订类型不能超过1个字符"
)
@ExcelAttribute
(
name
=
"签订类型"
,
isNotEmpty
=
true
,
errorInfo
=
"签订类型不能为空"
,
maxLength
=
100
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMPLOYEE_SITUATION_TYPE
)
@Schema
(
description
=
"签订类型"
,
name
=
"situation"
)
private
String
situation
;
/**
* 签订期限employee_contract_type
* 0 已完成一定工作任务为期限
* 1 固定期限
* 2 无固定期限
*/
@NotBlank
(
message
=
"签订期限不能为空"
)
@Length
(
max
=
32
,
message
=
"签订期限不能超过32个字符"
)
@ExcelAttribute
(
name
=
"签订期限"
,
isNotEmpty
=
true
,
errorInfo
=
"签订期限不能为空"
,
maxLength
=
32
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMPLOYEE_CONTRACT_TYPE
,
needExport
=
true
)
@Schema
(
description
=
"签订期限"
,
name
=
"contractType"
)
private
String
contractType
;
@ExcelAttribute
(
name
=
"合同甲方"
)
@Schema
(
description
=
"合同甲方"
)
@Size
(
max
=
50
,
message
=
"合同甲方不可超过50位"
)
private
String
contractParty
;
@Length
(
max
=
128
,
message
=
"客户名称不能超过128个字符"
)
@ExcelAttribute
(
name
=
"客户名称"
,
maxLength
=
128
)
@Schema
(
description
=
"客户名称"
,
name
=
"subjectUnit"
)
private
String
subjectUnit
;
@ExcelAttribute
(
name
=
"审核状态"
,
readConverterExp
=
"0=待提交,1=待审核,2=审核通过,3=审核不通过"
)
@Schema
(
description
=
"审核状态"
)
private
String
auditStatus
;
@ExcelAttribute
(
name
=
"合同状态"
,
readConverterExp
=
"0=可用,1=不可用"
)
@Schema
(
description
=
"合同状态"
,
name
=
"inUse"
)
private
String
inUse
;
@ExcelAttribute
(
name
=
"附件状态"
)
@Schema
(
description
=
"附件状态"
,
name
=
"isFile"
)
private
String
files
;
@ExcelAttribute
(
name
=
"归档状态"
,
readConverterExp
=
"0=已归档,1=未归档"
)
@Schema
(
description
=
"归档状态"
,
name
=
"isFile"
)
private
String
isFile
;
@ExcelProperty
(
"创建人"
)
private
String
createName
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ExcelProperty
(
"累计签订次数"
)
private
String
createNum
;
@ExcelProperty
(
"首签日期"
)
private
String
startDate
;
@ExcelProperty
(
"最晚到期日期"
)
private
String
endDate
;
@ExcelProperty
(
"历次记录"
)
private
String
history
;
@TableField
(
exist
=
false
)
@Schema
(
description
=
"选中的idList"
)
private
List
<
String
>
idList
;
@TableField
(
exist
=
false
)
@Schema
(
description
=
"导出的表头的Set"
)
private
Set
<
String
>
exportFields
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectVO.java
View file @
8bd62c86
...
...
@@ -96,7 +96,7 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
*/
@NotNull
(
message
=
"合同类型不能为空"
)
@ExcelProperty
(
value
=
"合同类型"
)
@ExcelAttribute
(
name
=
"合同类型"
,
isNotEmpty
=
true
,
errorInfo
=
"合同类型不能为空"
,
maxLength
=
10
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMPLOYEE_CONTRACT
_TYPE
)
@ExcelAttribute
(
name
=
"合同类型"
,
isNotEmpty
=
true
,
errorInfo
=
"合同类型不能为空"
,
maxLength
=
10
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
PERSONNEL
_TYPE
)
private
String
contractType
;
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/Constants/EmployeeConstants.java
View file @
8bd62c86
...
...
@@ -9,5 +9,14 @@ public class EmployeeConstants {
public
static
final
String
REMARL_LENGTH
=
"备注长度超过200"
;
public
static
final
String
POST_LENGTH
=
"就职岗位长度超过20"
;
public
static
final
String
DEPT_NO_LENGTH
=
"项目编码长度超过20"
;
/**
* 无数据可更新
**/
public
static
final
String
NO_DATA_UPDATE
=
"无数据可更新"
;
/**
* 数据更新是失败
**/
public
static
final
String
DATA_UPDATE_FAIL
=
"数据更新失败!"
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/config/FddAutoConfigue.java
0 → 100644
View file @
8bd62c86
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
config
;
import
com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
FddAutoConfigue
{
@Bean
public
FddUtil
getFddUtils
()
{
return
new
FddUtil
();
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddContractAttachInfoController.java
View file @
8bd62c86
...
...
@@ -17,12 +17,21 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem
;
import
com.yifu.cloud.plus.v1.yifu.archives.Constants.EmployeeConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddContractAttachInfoService
;
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.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
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.common.log.annotation.SysLog
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
...
...
@@ -31,6 +40,11 @@ import lombok.RequiredArgsConstructor;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.web.bind.annotation.*
;
import
java.net.URLDecoder
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 法大大合同附属信息表
...
...
@@ -43,10 +57,14 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping
(
"/fddcontractattachinfo"
)
@Tag
(
name
=
"法大大合同附属信息表管理"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
@Slf4j
@EnableConfigurationProperties
(
DaprUpmsProperties
.
class
)
public
class
FddContractAttachInfoController
{
private
final
FddContractAttachInfoService
fddContractAttachInfoService
;
private
final
DaprUpmsProperties
daprUpmsProperties
;
/**
* 分页查询
* @param page 分页对象
...
...
@@ -55,7 +73,6 @@ public class FddContractAttachInfoController {
*/
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@GetMapping
(
"/page"
)
@PreAuthorize
(
"@pms.hasPermission('demo_fddcontractattachinfo_get')"
)
public
R
getFddContractAttachInfoPage
(
Page
page
,
FddContractAttachInfo
fddContractAttachInfo
)
{
return
R
.
ok
(
fddContractAttachInfoService
.
getFddContractAttachInfoPage
(
page
,
fddContractAttachInfo
));
}
...
...
@@ -67,7 +84,6 @@ public class FddContractAttachInfoController {
*/
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('demo_fddcontractattachinfo_get')"
)
@GetMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('demo_fddcontractattachinfo_get')"
)
public
R
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
R
.
ok
(
fddContractAttachInfoService
.
getById
(
id
));
}
...
...
@@ -111,4 +127,126 @@ public class FddContractAttachInfoController {
return
R
.
ok
(
fddContractAttachInfoService
.
removeById
(
id
));
}
/**
* @param jsonString
* @Author: huyc
* @Date: 2022/6/30
* @Description: 法大大合同基础信息更新
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
**/
@Operation
(
summary
=
"法大大合同基础信息新增"
,
description
=
"法大大合同基础信息新增"
)
@SysLog
(
"法大大合同基础信息新增"
)
@PostMapping
(
"/batchAddFddEmpInfo"
)
public
R
batchAddFddEmpInfo
(
@RequestBody
String
jsonString
)
{
R
<
List
<
SysDictItem
>>
res
=
null
;
ExcelUtil
<
FddContractAttachInfo
>
util1
=
null
;
try
{
// 调用字典服务,渲染字典值
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/dict/inner/getDictList"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
String
>
dicMap
=
new
HashMap
<>();
if
(
null
!=
res
.
getData
())
{
for
(
SysDictItem
dict
:
res
.
getData
())
{
dicMap
.
put
(
dict
.
getType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
dict
.
getLabel
(),
dict
.
getValue
());
}
}
jsonString
=
URLDecoder
.
decode
(
jsonString
,
CommonConstants
.
UTF8
).
replace
(
"="
,
""
);
util1
=
new
ExcelUtil
<>(
FddContractAttachInfo
.
class
);
//传参字典数据MAP具体见方法实现
util1
.
getJsonStringToList
(
jsonString
,
dicMap
);
if
(
null
!=
util1
.
getErrorInfo
()
&&
!
util1
.
getErrorInfo
().
isEmpty
())
{
return
R
.
failed
(
util1
.
getErrorInfo
(),
"数据异常"
);
}
else
{
if
(
null
!=
util1
.
getEntityList
())
{
List
<
ErrorMessage
>
errorInfo
=
fddContractAttachInfoService
.
batchAdd
(
util1
.
getEntityList
());
Map
<
String
,
Object
>
variableMap
=
new
HashMap
<>();
Map
<
Integer
,
Object
>
map
=
new
HashMap
<>();
boolean
allExitContract
=
errorInfo
.
stream
().
allMatch
(
e
->
e
.
getMessage
().
equals
(
"存在“在用”的合同"
));
if
(
allExitContract
)
{
variableMap
.
put
(
"allMatch"
,
"true"
);
for
(
ErrorMessage
errorMessage
:
errorInfo
){
map
.
put
(
errorMessage
.
getLineNum
(),
util1
.
getEntityList
().
get
(
errorMessage
.
getLineNum
()-
2
));
}
variableMap
.
put
(
"data"
,
map
);
}
return
R
.
ok
(
variableMap
);
}
else
{
return
R
.
ok
(
null
,
"无数据可导入"
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
R
.
failed
(
"导入数据失败"
);
}
}
/**
* @param jsonString
* @Author: huyc
* @Date: 2022/6/30
* @Description: 法大大合同基础信息更新
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
**/
@Operation
(
summary
=
"法大大合同基础信息更新"
,
description
=
"法大大合同基础信息更新"
)
@SysLog
(
"法大大合同基础信息更新"
)
@PostMapping
(
"/batchUpdateFddEmpInfo"
)
public
R
batchUpdateFddEmpInfo
(
@RequestBody
String
jsonString
)
{
R
<
List
<
SysDictItem
>>
res
=
null
;
ExcelUtil
<
FddContractAttachInfo
>
util1
=
null
;
try
{
// 调用字典服务,渲染字典值
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/dict/inner/getDictList"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
String
>
dicMap
=
new
HashMap
<>();
if
(
null
!=
res
.
getData
())
{
for
(
SysDictItem
dict
:
res
.
getData
())
{
dicMap
.
put
(
dict
.
getType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
dict
.
getLabel
(),
dict
.
getValue
());
}
}
jsonString
=
URLDecoder
.
decode
(
jsonString
,
CommonConstants
.
UTF8
).
replace
(
"="
,
""
);
util1
=
new
ExcelUtil
<>(
FddContractAttachInfo
.
class
);
//传参字典数据MAP具体见方法实现
util1
.
getJsonStringToList
(
jsonString
,
dicMap
);
if
(
null
!=
util1
.
getErrorInfo
()
&&
!
util1
.
getErrorInfo
().
isEmpty
())
{
return
R
.
failed
(
util1
.
getErrorInfo
(),
""
);
}
else
{
if
(
null
!=
util1
.
getEntityList
())
{
List
<
ErrorMessage
>
errorInfo
=
fddContractAttachInfoService
.
batchUpdate
(
util1
.
getEntityList
());
return
R
.
ok
(
errorInfo
,
"数据导入解析成功!"
);
}
else
{
return
R
.
ok
(
null
,
EmployeeConstants
.
NO_DATA_UPDATE
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
R
.
failed
(
EmployeeConstants
.
DATA_UPDATE_FAIL
);
}
}
/**
* @param entityList
* @Author: huyc
* @Date: 2022/06/30
* @Description: 批量发送法大大电子合同定稿任务
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"批量发送法大大电子合同定稿任务"
,
description
=
"批量发送法大大电子合同定稿任务"
)
@SysLog
(
"批量发送法大大电子合同定稿任务"
)
@PostMapping
(
"/sendTask"
)
public
R
sendTask
(
@RequestBody
List
<
FddContractAttachInfo
>
entityList
)
{
if
(
null
==
entityList
)
{
return
R
.
failed
(
"数据为空!"
);
}
List
<
ErrorMessage
>
errorInfo
=
fddContractAttachInfoService
.
sendTask
(
entityList
);
return
R
.
ok
(
errorInfo
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddContractTemplateController.java
View file @
8bd62c86
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractTemplate
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddContractTemplateService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
@@ -31,6 +32,11 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.validation.Valid
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
/**
...
...
@@ -73,19 +79,6 @@ public class FddContractTemplateController {
return
R
.
ok
(
fddContractTemplateService
.
getById
(
id
));
}
/**
* 新增法大大员工合同模板
* @param fddContractTemplate 法大大员工合同模板
* @return R
*/
@Operation
(
summary
=
"新增法大大员工合同模板"
,
description
=
"新增法大大员工合同模板:hasPermission('demo_fddcontracttemplate_add')"
)
@SysLog
(
"新增法大大员工合同模板"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('demo_fddcontracttemplate_add')"
)
public
R
save
(
@RequestBody
FddContractTemplate
fddContractTemplate
)
{
return
R
.
ok
(
fddContractTemplateService
.
save
(
fddContractTemplate
));
}
/**
* 修改法大大员工合同模板
* @param fddContractTemplate 法大大员工合同模板
...
...
@@ -96,7 +89,7 @@ public class FddContractTemplateController {
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('demo_fddcontracttemplate_edit')"
)
public
R
updateById
(
@RequestBody
FddContractTemplate
fddContractTemplate
)
{
return
R
.
ok
(
fddContractTemplateService
.
updateById
(
fddContractTemplate
));
return
R
.
ok
(
fddContractTemplateService
.
changeInfo
(
fddContractTemplate
));
}
/**
...
...
@@ -112,4 +105,71 @@ public class FddContractTemplateController {
return
R
.
ok
(
fddContractTemplateService
.
removeById
(
id
));
}
/**
* 新增合同模板
* @param fddContractTemplate
* @return R
*/
@Operation
(
summary
=
"新增合同模板"
,
description
=
"新增合同模板"
)
@SysLog
(
"新增合同模板"
)
@PostMapping
public
R
save
(
@Valid
@RequestBody
FddContractTemplate
fddContractTemplate
)
{
return
fddContractTemplateService
.
saveInfo
(
fddContractTemplate
);
}
/**
* @param file
* @Author: huyc
* @Date: 2022/6/30
* @Description: 法大大模板上传
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"法大大模板上传"
,
description
=
"法大大模板上传"
)
@SysLog
(
"法大大模板上传"
)
@PostMapping
(
"/upload"
)
public
R
<
String
>
upload
(
@RequestBody
MultipartFile
file
,
@RequestParam
String
id
)
throws
ApiException
,
IOException
{
return
fddContractTemplateService
.
upload
(
file
,
id
);
}
/**
* @Author: huyc
* @Date: 2022/6/30
* @Description: 模板文件删除
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"模板文件删除"
,
description
=
"模板文件删除"
)
@SysLog
(
"模板文件删除"
)
@PostMapping
(
"/del"
)
public
R
<
String
>
delCompanyTemplateFile
(
@RequestParam
String
id
)
throws
ApiException
{
return
fddContractTemplateService
.
delCompanyTemplateFile
(
id
);
}
/**
* @Author: huyc
* @Date: 2022/6/30
* @Description: 获取模板维护地址
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"获取模板维护地址"
,
description
=
"获取模板维护地址"
)
@SysLog
(
"获取模板维护地址"
)
@GetMapping
(
"/getTemplateMainUrl"
)
public
R
<
String
>
getTemplateMainUrl
(
@RequestParam
String
id
)
throws
ApiException
{
return
fddContractTemplateService
.
getTemplateMainUrl
(
id
);
}
/**
* @Author: huyc
* @Date: 2022/6/30
* @Description: 获取模板文件预览地址
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"获取模板文件预览地址"
,
description
=
"获取模板文件预览地址"
)
@SysLog
(
"获取模板文件预览地址"
)
@GetMapping
(
"/getCompanyTemplatePreviewUrl"
)
public
R
<
String
>
getCompanyTemplatePreviewUrl
(
@RequestParam
String
id
)
throws
ApiException
{
return
fddContractTemplateService
.
getCompanyTemplatePreviewUrl
(
id
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddController.java
View file @
8bd62c86
...
...
@@ -18,14 +18,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -58,8 +55,8 @@ public class FddController {
private
FddCompanyInfoService
fddCompanyInfoService
;
@Autowired
private
FddContractAttachInfoService
fddContractAttachInfoService
;
//
@Autowired
//
private TEmployeeContractInfoService employeeContractInfoService;
@Autowired
private
TEmployeeContractInfoService
employeeContractInfoService
;
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
10
);
...
...
@@ -168,31 +165,22 @@ public class FddController {
//实名认证成功发送电子合同
executorService
.
submit
(()
->
{
try
{
// //先查询下有没有没发送这个员工没发送的电子合同。如果有则发送
// List<FddContractAttachInfo> attachInfos = fddContractAttachInfoService.getListByNoInfoByEmpIdcard(entity.getIdCard());
// //自动创建定稿任务.查看是否有未定稿的数据。有的话自动发送
// if (attachInfos.size() == CommonConstants.ZERO_INT) {
// return;
// }
// FddContractAttachInfo fddContractAttachInfo = attachInfos.get(CommonConstants.ZERO_INT);
// TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getById(fddContractAttachInfo.getContractId());
// TEmployeeInfo employeeInfo = employeeInfoService.getById(employeeContractInfo.getEmpId());
//获取合同创建人
// String createUserId = fddContractAttachInfo.getCreateUserId();
// FeginExtendUser feginExtendUser = new FeginExtendUser();
// R<List<SysUser>> remoteUserServiceSimpleUser = remoteUserService.getAllUserInfoByUserIds(createUserId, SecurityConstants.FROM_IN);
// SysUser sysUser = remoteUserServiceSimpleUser.getData().get(CommonConstants.ZERO_INT);
// feginExtendUser.setPhone(sysUser.getPhone());
// feginExtendUser.setNickName(sysUser.getNickname());
// R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo, feginExtendUser);
// if (returnR != null) {
// //记录返回信息
// if(returnR.getCode()== CommonConstants.SUCCESS){
// fddContractAttachInfo.setRemark("成功");
// }else {
// fddContractAttachInfo.setRemark(returnR.getMsg());
// }
// }
//先查询下有没有没发送这个员工没发送的电子合同。如果有则发送
List
<
FddContractAttachInfo
>
attachInfos
=
fddContractAttachInfoService
.
getListByNoInfoByEmpIdcard
(
entity
.
getIdCard
());
//自动创建定稿任务.查看是否有未定稿的数据。有的话自动发送
if
(
attachInfos
.
size
()
==
CommonConstants
.
ZERO_INT
)
{
return
;
}
FddContractAttachInfo
fddContractAttachInfo
=
attachInfos
.
get
(
CommonConstants
.
ZERO_INT
);
R
<
String
>
returnR
=
fddContractInfoService
.
saveEmpContract
(
fddContractAttachInfo
);
if
(
returnR
!=
null
)
{
//记录返回信息
if
(
returnR
.
getCode
()==
CommonConstants
.
SUCCESS
){
fddContractAttachInfo
.
setRemark
(
"成功"
);
}
else
{
fddContractAttachInfo
.
setRemark
(
returnR
.
getMsg
());
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -216,16 +204,16 @@ public class FddController {
executorService
.
submit
(()
->
{
try
{
//自动创建定稿任务
//
R<String> returnR = fddContractInfoService.createTaskByDraftId(fddContractInfo);
//
if(returnR!=null){
//
//记录返回信息
//
if(returnR.getCode()==CommonConstants.SUCCESS){
//
fddContractInfo.setRemark("成功");
//
}else {
//
fddContractInfo.setRemark(returnR.getMsg());
//
}
//
fddContractInfoService.updateById(fddContractInfo);
//
}
R
<
String
>
returnR
=
fddContractInfoService
.
createTaskByDraftId
(
fddContractInfo
);
if
(
returnR
!=
null
){
//记录返回信息
if
(
returnR
.
getCode
()==
CommonConstants
.
SUCCESS
){
fddContractInfo
.
setRemark
(
"成功"
);
}
else
{
fddContractInfo
.
setRemark
(
returnR
.
getMsg
());
}
fddContractInfoService
.
updateById
(
fddContractInfo
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -263,14 +251,14 @@ public class FddController {
// 2021-3-15 16:24 hgw 全部签名成功,更新合同的状态:
if
(
CommonConstants
.
TWO_STRING
.
equals
(
fddContractInfo
.
getSendSignStatus
())
&&
CommonConstants
.
TWO_STRING
.
equals
(
fddContractInfo
.
getReceiveSignStatus
()))
{
//
fddContractAttachInfoService.saveEmpAndAttarch(fddContractInfo);
fddContractAttachInfoService
.
saveEmpAndAttarch
(
fddContractInfo
);
//
TEmployeeContractInfo ec = employeeContractInfoService.getById(fddContractInfo.getContractId());
//
// 如果合同的状态是待电子签,则变更为已电子签
//
if (ec != null && ec.getIsSign() != null && ec.getIsSign() == CommonConstants.ONE_INT) {
//
ec.setIsSign(CommonConstants.ZERO_INT);
//
employeeContractInfoService.updateById(ec);
//
}
TEmployeeContractInfo
ec
=
employeeContractInfoService
.
getById
(
fddContractInfo
.
getContractId
());
// 如果合同的状态是待电子签,则变更为已电子签
if
(
ec
!=
null
&&
ec
.
getIsSign
()
!=
null
&&
ec
.
getIsSign
()
==
CommonConstants
.
ONE_INT
)
{
ec
.
setIsSign
(
CommonConstants
.
ZERO_INT
);
employeeContractInfoService
.
updateById
(
ec
);
}
}
return
R
.
ok
();
}
else
if
(
StringUtils
.
equals
(
fddEvent
,
"notifyUrlVerify"
))
{
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeContractInfoController.java
View file @
8bd62c86
...
...
@@ -20,23 +20,17 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
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.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.SneakyThrows
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -55,13 +49,13 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/temployeecontractinfo"
)
@Tag
(
name
=
"员工合同管理"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
TEmployeeContractInfoController
{
private
final
TEmployeeContractInfoService
tEmployeeContractInfoService
;
/**
* 申请、归档分页查询
*
* @param page 分页对象
* @param tEmployeeContractInfo 员工合同
* @return
...
...
@@ -115,7 +109,7 @@ public class TEmployeeContractInfoController {
**/
@Operation
(
summary
=
"根据参数返回list"
,
description
=
"根据参数返回list"
)
@PostMapping
(
"/getListByParam"
)
public
R
<
List
<
TEmployeeContractInfo
>>
getListByParam
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
public
R
<
List
<
TEmployeeContractInfo
>>
getListByParam
(
@RequestBody
TEmployeeContractInfo
tEmployeeContractInfo
)
{
return
new
R
<>(
tEmployeeContractInfoService
.
getTEmployeeContractList
(
tEmployeeContractInfo
));
}
...
...
@@ -190,6 +184,7 @@ public class TEmployeeContractInfoController {
/**
* 审核员工合同
* 审核通过后,变为在用,项目内其他的合同不再用
*
* @param tEmployeeContractInfo 员工合同
* @return R
*/
...
...
@@ -210,6 +205,7 @@ public class TEmployeeContractInfoController {
/**
* 审核员工合同
* 审核通过后,变为在用,项目内其他的合同不再用
*
* @param tEmployeeContractInfo 员工合同
* @return R
*/
...
...
@@ -223,6 +219,7 @@ public class TEmployeeContractInfoController {
/**
* 批量申请-合同
*
* @param file
* @return
* @Author hgw
...
...
@@ -239,6 +236,7 @@ public class TEmployeeContractInfoController {
/**
* 批量更新-合同
*
* @param file
* @return
* @Author hgw
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmployeeContractInfoMapper.java
View file @
8bd62c86
...
...
@@ -21,6 +21,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.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -45,6 +46,8 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
,
@Param
(
"tEmployeeContractInfo"
)
TEmployeeContractInfo
tEmployeeContractInfo
);
List
<
TEmployeeContractInfo
>
getTEmployeeContractList
(
@Param
(
"tEmployeeContractInfo"
)
TEmployeeContractInfo
tEmployeeContractInfo
);
List
<
EmployeeContractExportVO
>
getTEmployeeContractExport
(
@Param
(
"tEmployeeContractInfo"
)
TEmployeeContractInfo
tEmployeeContractInfo
);
List
<
EmployeeContractExportVO
>
getTEmployeeContractExportHistory
(
@Param
(
"tEmployeeContractInfo"
)
TEmployeeContractInfo
tEmployeeContractInfo
);
TEmployeeContractInfo
getOneContractByApplyNo
(
@Param
(
"applyNo"
)
String
applyNo
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FddContractAttachInfoService.java
View file @
8bd62c86
...
...
@@ -22,7 +22,11 @@ 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.FddContractAttachInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.io.InputStream
;
import
java.util.List
;
/**
...
...
@@ -46,4 +50,12 @@ public interface FddContractAttachInfoService extends IService<FddContractAttach
* @return
*/
List
<
FddContractAttachInfo
>
getListByNoInfoByEmpIdcard
(
String
empIdcard
);
List
<
ErrorMessage
>
sendTask
(
List
<
FddContractAttachInfo
>
entityList
);
R
<
String
>
saveEmpAndAttarch
(
FddContractInfo
fddContractInfo
);
List
<
ErrorMessage
>
batchAdd
(
List
<
FddContractAttachInfo
>
entityList
);
List
<
ErrorMessage
>
batchUpdate
(
List
<
FddContractAttachInfo
>
entityList
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FddContractInfoService.java
View file @
8bd62c86
...
...
@@ -110,4 +110,6 @@ public interface FddContractInfoService extends IService<FddContractInfo> {
* @return: R
**/
R
<
String
>
moveFileToEmpConcat
(
FddContractInfo
fddContractInfo
,
HttpServletResponse
response
)
throws
ApiException
,
IOException
;
R
<
String
>
generalEmployeeParam
(
FddContractAttachInfo
attachInfo
,
boolean
signFlag
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FddContractTemplateService.java
View file @
8bd62c86
...
...
@@ -23,6 +23,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractTemplate
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
/**
* 法大大员工合同模板
...
...
@@ -39,4 +43,46 @@ public interface FddContractTemplateService extends IService<FddContractTemplate
*/
IPage
<
FddContractTemplate
>
getFddContractTemplatePage
(
Page
<
FddContractTemplate
>
page
,
FddContractTemplate
fddContractTemplate
)
throws
ApiException
;
/**
* 保存合同模板
* @param fddContractTemplate 法大大员工合同模板
* @return
*/
R
saveInfo
(
FddContractTemplate
fddContractTemplate
);
/**
* 修改合同模板
* @param fddContractTemplate 法大大员工合同模板
* @return
*/
R
changeInfo
(
FddContractTemplate
fddContractTemplate
);
/**
* 法大大模板上传
* @param file 文件
* @param id 模板id
* @return
*/
R
<
String
>
upload
(
MultipartFile
file
,
String
id
)
throws
ApiException
,
IOException
;
/**
* 获取模板维护地址
* @param id 模板id
* @return
*/
R
<
String
>
getTemplateMainUrl
(
String
id
)
throws
ApiException
;
/**
* 获取模板文件预览地址
* @param id 模板id
* @return
*/
R
<
String
>
getCompanyTemplatePreviewUrl
(
String
id
)
throws
ApiException
;
/**
* 模板文件删除
* @param id 模板id
* @return
*/
R
<
String
>
delCompanyTemplateFile
(
String
id
)
throws
ApiException
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeContractInfoService.java
View file @
8bd62c86
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO
;
...
...
@@ -49,8 +50,33 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
*/
IPage
<
TEmployeeContractInfo
>
getTEmployeeContractInfoPage
(
Page
<
TEmployeeContractInfo
>
page
,
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* @param tEmployeeContractInfo
* @Description: list
* @Author: hgw
* @Date: 2022/7/4 20:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo>
**/
List
<
TEmployeeContractInfo
>
getTEmployeeContractList
(
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* @param tEmployeeContractInfo
* @Description: 导出
* @Author: hgw
* @Date: 2022/7/4 20:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO>
**/
List
<
EmployeeContractExportVO
>
getTEmployeeContractExport
(
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* @param tEmployeeContractInfo
* @Description: 导出历史合并
* @Author: hgw
* @Date: 2022/7/4 20:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO>
**/
List
<
EmployeeContractExportVO
>
getTEmployeeContractExportHistory
(
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* @param tEmployeeContractInfo
* @Description: 新增
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractAttachInfoServiceImpl.java
View file @
8bd62c86
This diff is collapsed.
Click to expand it.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractInfoServiceImpl.java
View file @
8bd62c86
...
...
@@ -49,6 +49,7 @@ import com.fadada.api.client.SignTaskClient;
import
com.fadada.api.exception.ApiException
;
import
com.google.common.collect.Maps
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractAttachInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil
;
...
...
@@ -105,7 +106,7 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
@Autowired
private
FddSealPersonAuthService
fddSealPersonAuthService
;
@Autowired
private
FddContractAttachInfo
Service
fddContractAttachInfoService
;
private
FddContractAttachInfo
Mapper
fddContractAttachInfoMapper
;
// @Autowired
// private TEmployeeContractInfoService employeeContractInfoService;
// @Autowired
...
...
@@ -284,7 +285,7 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
return
R
.
failed
(
"合同签署任务已完成,不能作废重签"
);
}
YifuUser
user
=
SecurityUtils
.
getUser
();
FddContractAttachInfo
fddContractAttachInfo
=
fddContractAttachInfo
Service
.
ge
tOne
(
Wrappers
.<
FddContractAttachInfo
>
query
().
lambda
()
FddContractAttachInfo
fddContractAttachInfo
=
fddContractAttachInfo
Mapper
.
selec
tOne
(
Wrappers
.<
FddContractAttachInfo
>
query
().
lambda
()
.
eq
(
FddContractAttachInfo:
:
getContractId
,
entity
.
getContractId
()));
if
(!
user
.
getId
().
equals
(
fddContractAttachInfo
.
getCreateBy
()))
{
return
R
.
failed
(
"当前用户不是电子合同导入用户,不能操作"
);
...
...
@@ -768,6 +769,99 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
}
}
@Override
public
R
<
String
>
generalEmployeeParam
(
FddContractAttachInfo
attachInfo
,
boolean
signFlag
)
{
JSONObject
paramter
=
new
JSONObject
();
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getEmpName
()))
{
return
R
.
failed
(
"姓名为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"name"
,
attachInfo
.
getEmpName
());
Date
date
=
IdcardUtil
.
getBirthDate
(
attachInfo
.
getEmpIdcard
());
if
(
LocalDateTimeUtils
.
convertDateToLDT
(
date
)
==
null
)
{
return
R
.
failed
(
"出生年月为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"birth"
,
DateUtil
.
format
(
LocalDateTimeUtils
.
convertDateToLDT
(
date
),
DatePattern
.
NORM_DATE_PATTERN
));
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getEmpIdcard
()))
{
return
R
.
failed
(
"身份证号为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"id_card"
,
attachInfo
.
getEmpIdcard
());
int
sex
=
IdcardUtil
.
getGenderByIdCard
(
attachInfo
.
getEmpIdcard
());
if
(
sex
==
0
)
{
paramter
.
put
(
"sex"
,
"女"
);
}
else
if
(
sex
==
1
)
{
paramter
.
put
(
"sex"
,
"男"
);
}
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getEmpPhone
()))
{
return
R
.
failed
(
"手机号为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"mobile"
,
attachInfo
.
getEmpPhone
());
//固定期限
paramter
.
put
(
"contractType"
,
"一"
);
paramter
.
put
(
"fcontractStartY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getContractStart
()),
"yyyy"
));
paramter
.
put
(
"fcontractStartM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getContractStart
()),
"MM"
));
paramter
.
put
(
"fcontractStartD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getContractStart
()),
"dd"
));
paramter
.
put
(
"fcontractEndY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getContractEnd
()),
"yyyy"
));
paramter
.
put
(
"fcontractEndM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getContractEnd
()),
"MM"
));
paramter
.
put
(
"fcontractEndD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getContractEnd
()),
"dd"
));
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
if
(!
signFlag
)
{
if
(
attachInfo
.
getPeriodStart
()
==
null
)
{
return
R
.
failed
(
"新签试用期开始时间为空"
);
}
paramter
.
put
(
"fPeriodStartY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()),
"yyyy"
));
paramter
.
put
(
"fPeriodStartM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()),
"MM"
));
paramter
.
put
(
"fPeriodStartD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()),
"dd"
));
if
(
attachInfo
.
getPeriodEnd
()
==
null
)
{
return
R
.
failed
(
"新签试用期结束时间为空"
);
}
paramter
.
put
(
"fPeriodEndY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()),
"yyyy"
));
paramter
.
put
(
"fPeriodEndM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()),
"MM"
));
paramter
.
put
(
"fPeriodEndD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()),
"dd"
));
if
(
attachInfo
.
getPeriodSalaryPerMonth
()
==
null
)
{
return
R
.
failed
(
"新签试用期工资为空"
);
}
paramter
.
put
(
"periodSalaryPerMonth"
,
attachInfo
.
getPeriodSalaryPerMonth
());
}
//工作地点和岗位填充
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getPost
()))
{
return
R
.
failed
(
"员工岗位为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"post"
,
attachInfo
.
getPost
());
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getWorkSpace
()))
{
return
R
.
failed
(
"员工工作地点为空"
);
}
paramter
.
put
(
"workSpace"
,
attachInfo
.
getWorkSpace
());
//工时制
paramter
.
put
(
"workingHours"
,
""
);
//工资标准
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getSalaryType
())){
return
R
.
failed
(
"工资形式不能为空"
);
}
String
salaryTypeKey
=
"salaryType"
;
if
(
StringUtils
.
equals
(
CommonConstants
.
ONE_STRING
,
attachInfo
.
getSalaryType
()))
{
paramter
.
put
(
salaryTypeKey
,
CommonConstants
.
ONE_STRING
);
//计时工资
if
(
attachInfo
.
getSalaryStandardPerHour
()==
null
)
{
return
R
.
failed
(
"计时工资为空"
);
}
paramter
.
put
(
"salaryStrandPh"
,
String
.
valueOf
(
attachInfo
.
getSalaryStandardPerHour
()));
}
else
if
(
StringUtils
.
equals
(
CommonConstants
.
TWO_STRING
,
attachInfo
.
getSalaryType
()))
{
paramter
.
put
(
salaryTypeKey
,
CommonConstants
.
TWO_STRING
);
if
(
attachInfo
.
getSalaryStandardPerPiece
()==
null
)
{
return
R
.
failed
(
"计件工资为空"
);
}
//计月工资
paramter
.
put
(
"salaryStrandPp"
,
String
.
valueOf
(
attachInfo
.
getSalaryStandardPerPiece
()));
}
else
if
(
StringUtils
.
equals
(
CommonConstants
.
THREE_STRING
,
attachInfo
.
getSalaryType
()))
{
paramter
.
put
(
salaryTypeKey
,
CommonConstants
.
THREE_STRING
);
}
else
{
return
R
.
failed
(
"未知的工资标准类型"
);
}
return
new
R
<>(
paramter
.
toJSONString
());
}
public
static
Date
localDate2Date
(
LocalDate
localDate
)
{
if
(
null
==
localDate
)
{
return
null
;
...
...
@@ -789,7 +883,7 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
if
(
reviseTaskDetailR
.
getCode
()
!=
CommonConstants
.
SUCCESS
)
{
return
R
.
failed
(
reviseTaskDetailR
.
getMsg
());
}
FddContractAttachInfo
attachInfo
=
fddContractAttachInfo
Service
.
ge
tOne
(
Wrappers
.<
FddContractAttachInfo
>
query
().
lambda
().
eq
(
FddContractAttachInfo:
:
getContractId
,
entity
.
getContractId
()));
FddContractAttachInfo
attachInfo
=
fddContractAttachInfo
Mapper
.
selec
tOne
(
Wrappers
.<
FddContractAttachInfo
>
query
().
lambda
().
eq
(
FddContractAttachInfo:
:
getContractId
,
entity
.
getContractId
()));
int
status
=
reviseTaskDetailR
.
getData
();
CancelReviseTaskReq
req
=
new
CancelReviseTaskReq
();
if
(
status
==
CommonConstants
.
ZERO_INT
||
status
==
CommonConstants
.
ONE_INT
)
{
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractTemplateServiceImpl.java
View file @
8bd62c86
...
...
@@ -20,9 +20,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
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.fadada.api.bean.req.template.
GetTemplateDetailReq
;
import
com.fadada.api.bean.req.template.
*
;
import
com.fadada.api.bean.rsp.BaseRsp
;
import
com.fadada.api.bean.rsp.template.GetCompanyTemplatePreviewUrlRsp
;
import
com.fadada.api.bean.rsp.template.GetTemplateDetailRsp
;
import
com.fadada.api.bean.rsp.template.GetTemplateMainUrlRsp
;
import
com.fadada.api.bean.rsp.template.UploadCompanyTemplateFileRsp
;
import
com.fadada.api.client.TemplateClient
;
import
com.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractTemplate
;
...
...
@@ -30,13 +33,17 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractTemplateFile;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractTemplateMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddContractTemplateFileService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddContractTemplateService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.util.List
;
/**
...
...
@@ -51,7 +58,8 @@ public class FddContractTemplateServiceImpl extends ServiceImpl<FddContractTempl
@Autowired
private
FddUtil
fddUtil
;
@Autowired
private
FddReqLogService
reqLogService
;
@Autowired
private
FddContractTemplateFileService
templateFileService
;
...
...
@@ -84,4 +92,146 @@ public class FddContractTemplateServiceImpl extends ServiceImpl<FddContractTempl
}
return
fddContractTemplatePage
;
}
@Override
public
R
saveInfo
(
FddContractTemplate
fddContractTemplate
)
{
long
count
=
this
.
count
(
Wrappers
.<
FddContractTemplate
>
query
().
lambda
()
.
eq
(
FddContractTemplate:
:
getLocalName
,
fddContractTemplate
.
getLocalName
())
);
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
"已存在相同模板名称记录"
);
}
boolean
save
=
this
.
save
(
fddContractTemplate
);
if
(
save
)
{
return
R
.
ok
();
}
return
R
.
failed
(
"失败"
);
}
@Override
public
R
<
Boolean
>
changeInfo
(
FddContractTemplate
fddContractTemplate
)
{
long
count
=
this
.
count
(
Wrappers
.<
FddContractTemplate
>
query
().
lambda
()
.
eq
(
FddContractTemplate:
:
getLocalName
,
fddContractTemplate
.
getLocalName
())
.
notIn
(
FddContractTemplate:
:
getId
,
fddContractTemplate
.
getId
()));
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
"已存在相同模板名称记录"
);
}
return
new
R
<>(
this
.
updateById
(
fddContractTemplate
));
}
@Override
public
R
<
String
>
upload
(
MultipartFile
file
,
String
id
)
throws
ApiException
,
IOException
{
FddContractTemplate
entity
=
this
.
getById
(
id
);
if
(
entity
==
null
)
{
return
R
.
failed
(
"未查询到相关记录"
);
}
if
(
StringUtils
.
isNotEmpty
(
entity
.
getFddTemplateId
()))
{
return
R
.
failed
(
"已上传法大大模板"
);
}
//发送请求
UploadCompanyTemplateFileReq
req
=
new
UploadCompanyTemplateFileReq
();
req
.
setToken
(
fddUtil
.
getToken
());
req
.
setFileType
(
CommonConstants
.
ONE_INT
,
null
);
TemplateClient
client
=
new
TemplateClient
(
fddUtil
.
getFadadaApiClient
());
BaseRsp
<
UploadCompanyTemplateFileRsp
>
rsp
=
client
.
uploadCompanyTemplateFile
(
req
,
FddSealInfoServiceImpl
.
multipartFileToFile
(
file
));
reqLogService
.
saveLog
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getClassName
(),
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
(),
req
,
rsp
);
//校验参数
if
(
StringUtils
.
equals
(
rsp
.
getCode
(),
FddUtil
.
SUCCESS
))
{
entity
.
setFddTemplateId
(
rsp
.
getData
().
getTemplateId
());
this
.
updateById
(
entity
);
//生成文件模板记录
FddContractTemplateFile
templateFile
=
new
FddContractTemplateFile
();
templateFile
.
setFddTemplateId
(
entity
.
getFddTemplateId
());
templateFile
.
setFddFileId
(
rsp
.
getData
().
getFileId
());
templateFileService
.
save
(
templateFile
);
return
R
.
ok
();
}
else
{
return
R
.
failed
(
"上传失败"
);
}
}
@Override
public
R
<
String
>
delCompanyTemplateFile
(
String
id
)
throws
ApiException
{
FddContractTemplate
entity
=
this
.
getById
(
id
);
if
(
entity
==
null
)
{
return
R
.
failed
(
"未查询到相关记录"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getFddTemplateId
()))
{
return
R
.
failed
(
"法大大模板未上传"
);
}
//发送请求
DelCompanyTemplateFileReq
req
=
new
DelCompanyTemplateFileReq
();
req
.
setToken
(
fddUtil
.
getToken
());
DelCompanyTemplateFileReq
.
TemplateInfo
templateInfo
=
new
DelCompanyTemplateFileReq
.
TemplateInfo
();
templateInfo
.
setTemplateId
(
entity
.
getFddTemplateId
());
req
.
setTemplateInfo
(
templateInfo
);
TemplateClient
client
=
new
TemplateClient
(
fddUtil
.
getFadadaApiClient
());
BaseRsp
<
UploadCompanyTemplateFileRsp
>
rsp
=
client
.
delCompanyTemplateFile
(
req
);
reqLogService
.
saveLog
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getClassName
(),
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
(),
req
,
rsp
);
//校验参数
if
(
StringUtils
.
equals
(
rsp
.
getCode
(),
FddUtil
.
SUCCESS
))
{
baseMapper
.
updateTeFddTemplateNull
(
entity
.
getId
());
//删除附件
templateFileService
.
remove
(
Wrappers
.<
FddContractTemplateFile
>
query
().
lambda
().
eq
(
FddContractTemplateFile:
:
getFddTemplateId
,
entity
.
getFddTemplateId
()));
return
R
.
ok
();
}
else
{
return
R
.
failed
(
"删除失败"
);
}
}
@Override
public
R
<
String
>
getTemplateMainUrl
(
String
id
)
throws
ApiException
{
FddContractTemplate
entity
=
this
.
getById
(
id
);
if
(
entity
==
null
)
{
return
R
.
failed
(
"未查询到相关记录"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getFddTemplateId
()))
{
return
R
.
failed
(
"法大大模板未上传"
);
}
//发送请求
GetTemplateMainUrlReq
req
=
new
GetTemplateMainUrlReq
();
req
.
setToken
(
fddUtil
.
getToken
());
GetTemplateMainUrlReq
.
TemplateInfo
templateInfo
=
new
GetTemplateMainUrlReq
.
TemplateInfo
();
templateInfo
.
setTemplateId
(
entity
.
getFddTemplateId
());
req
.
setTemplateInfo
(
templateInfo
);
TemplateClient
client
=
new
TemplateClient
(
fddUtil
.
getFadadaApiClient
());
BaseRsp
<
GetTemplateMainUrlRsp
>
rsp
=
client
.
getTemplateMainUrl
(
req
);
reqLogService
.
saveLog
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getClassName
(),
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
(),
req
,
rsp
);
//校验参数
if
(
StringUtils
.
equals
(
rsp
.
getCode
(),
FddUtil
.
SUCCESS
))
{
entity
.
setModifyUploadStatus
(
CommonConstants
.
ONE_STRING
);
this
.
updateById
(
entity
);
return
new
R
<>(
rsp
.
getData
().
getEditTemplateUrl
());
}
else
{
return
R
.
failed
(
"获取失败"
);
}
}
@Override
public
R
<
String
>
getCompanyTemplatePreviewUrl
(
String
id
)
throws
ApiException
{
FddContractTemplate
entity
=
this
.
getById
(
id
);
if
(
entity
==
null
)
{
return
R
.
failed
(
"未查询到相关记录"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getFddTemplateId
()))
{
return
R
.
failed
(
"法大大模板未上传"
);
}
//发送请求
GetEditCompanyTemplateUrlReq
req
=
new
GetEditCompanyTemplateUrlReq
();
req
.
setToken
(
fddUtil
.
getToken
());
GetEditCompanyTemplateUrlReq
.
TemplateInfo
templateInfo
=
new
GetEditCompanyTemplateUrlReq
.
TemplateInfo
();
templateInfo
.
setTemplateId
(
entity
.
getFddTemplateId
());
req
.
setTemplateInfo
(
templateInfo
);
TemplateClient
client
=
new
TemplateClient
(
fddUtil
.
getFadadaApiClient
());
BaseRsp
<
GetCompanyTemplatePreviewUrlRsp
>
rsp
=
client
.
getCompanyTemplatePreviewUrl
(
req
);
reqLogService
.
saveLog
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getClassName
(),
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
(),
req
,
rsp
);
//校验参数
if
(
StringUtils
.
equals
(
rsp
.
getCode
(),
FddUtil
.
SUCCESS
))
{
return
new
R
<>(
rsp
.
getData
().
getTemplatePreviewUrl
());
}
else
{
return
R
.
failed
(
rsp
.
getMsg
());
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddSealInfoServiceImpl.java
View file @
8bd62c86
...
...
@@ -42,7 +42,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.*
;
import
java.util.List
;
/**
...
...
@@ -222,4 +224,46 @@ public class FddSealInfoServiceImpl extends ServiceImpl<FddSealInfoMapper, FddSe
reqLogService
.
saveLog
(
this
.
getClass
().
getName
(),
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
(),
req
,
rsp
);
return
rsp
;
}
/**
* @param file
* @Author: huyc
* @Date: 2022/6/30
* @Description: MultipartFile转file
* @return: java.io.File
**/
public
static
File
multipartFileToFile
(
MultipartFile
file
)
throws
IOException
{
File
toFile
;
InputStream
ins
;
ins
=
file
.
getInputStream
();
toFile
=
new
File
(
file
.
getOriginalFilename
());
inputStreamToFile
(
ins
,
toFile
);
ins
.
close
();
return
toFile
;
}
/**
* @param ins
* @param file
* @Author: huyc
* @Date: 2022/6/30
* @Description: 获取流文件
* @return: void
**/
private
static
void
inputStreamToFile
(
InputStream
ins
,
File
file
)
throws
IOException
{
try
{
OutputStream
os
=
new
FileOutputStream
(
file
);
int
bytesRead
;
int
byteLength
=
8192
;
byte
[]
buffer
=
new
byte
[
byteLength
];
while
((
bytesRead
=
ins
.
read
(
buffer
,
0
,
byteLength
))
!=
-
1
)
{
os
.
write
(
buffer
,
0
,
bytesRead
);
}
os
.
close
();
ins
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
e
;
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
8bd62c86
...
...
@@ -30,10 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.Constants.EmployeeContractConstants;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeExportVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
...
...
@@ -104,6 +101,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return
baseMapper
.
getTEmployeeContractList
(
tEmployeeContractInfo
);
}
@Override
public
List
<
EmployeeContractExportVO
>
getTEmployeeContractExport
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
return
baseMapper
.
getTEmployeeContractExport
(
tEmployeeContractInfo
);
}
@Override
public
List
<
EmployeeContractExportVO
>
getTEmployeeContractExportHistory
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
return
baseMapper
.
getTEmployeeContractExportHistory
(
tEmployeeContractInfo
);
}
@Override
public
R
<
List
<
ErrorMessage
>>
saveNewContract
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
try
{
...
...
@@ -697,19 +704,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
/**
*
获取导出的人员档案列表
*
导出
*/
@Override
public
void
exportContractInfo
(
TEmployeeContractInfo
contractInfo
,
HttpServletResponse
response
)
{
if
(
contractInfo
!=
null
&&
contractInfo
.
getExportFields
()
!=
null
&&
!
contractInfo
.
getExportFields
().
isEmpty
())
{
String
fileName
=
"员工合同批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
TEmployeeContractInfo
>
list
=
baseMapper
.
getTEmployeeContractList
(
contractInfo
);
List
<
EmployeeContractExportVO
>
list
=
baseMapper
.
getTEmployeeContractExportHistory
(
contractInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
try
{
ExcelUtil
<
TEmployeeContractInfo
>
util
=
new
ExcelUtil
<>(
TEmployeeContractInfo
.
class
);
for
(
TEmployeeContractInfo
vo
:
list
)
{
ExcelUtil
<
EmployeeContractExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeContractExportVO
.
class
);
for
(
EmployeeContractExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
out
=
response
.
getOutputStream
();
...
...
@@ -736,19 +743,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
/**
*
获取导出的人员档案列表
*
导出历史合并
*/
@Override
public
void
exportContractInfoHistory
(
TEmployeeContractInfo
contractInfo
,
HttpServletResponse
response
)
{
if
(
contractInfo
!=
null
&&
contractInfo
.
getExportFields
()
!=
null
&&
!
contractInfo
.
getExportFields
().
isEmpty
())
{
String
fileName
=
"员工合同批量导出[合并]"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
TEmployeeContractInfo
>
list
=
baseMapper
.
getTEmployeeContractList
(
contractInfo
);
List
<
EmployeeContractExportVO
>
list
=
baseMapper
.
getTEmployeeContractExportHistory
(
contractInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
try
{
ExcelUtil
<
TEmployeeContractInfo
>
util
=
new
ExcelUtil
<>(
TEmployeeContractInfo
.
class
);
for
(
TEmployeeContractInfo
vo
:
list
)
{
ExcelUtil
<
EmployeeContractExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeContractExportVO
.
class
);
for
(
EmployeeContractExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
out
=
response
.
getOutputStream
();
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/FddUtil.java
View file @
8bd62c86
...
...
@@ -6,6 +6,7 @@ import com.fadada.api.bean.rsp.BaseRsp;
import
com.fadada.api.bean.rsp.oauth2.AccessTokenRsp
;
import
com.fadada.api.client.Oauth2Client
;
import
com.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem
;
import
com.yifu.cloud.plus.v1.yifu.archives.config.FddConfigProperties
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService
;
...
...
@@ -96,6 +97,4 @@ public class FddUtil {
}
return
accessToken
;
}
}
yifu-archives/yifu-archives-biz/src/main/resources/META-INF/spring.factories
0 → 100644
View file @
8bd62c86
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.archives.config.FddAutoConfigue
\ No newline at end of file
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeContractInfoMapper.xml
View file @
8bd62c86
...
...
@@ -82,6 +82,40 @@
<result
property=
"auditTimeLast"
column=
"AUDIT_TIME_LAST"
/>
</resultMap>
<!-- 合同导出 -->
<resultMap
id=
"tEmployeeContrctInfoExportMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO"
>
<result
property=
"applyNo"
column=
"APPLY_NO"
/>
<result
property=
"empNo"
column=
"EMP_NO"
/>
<result
property=
"empName"
column=
"EMP_NAME"
/>
<result
property=
"empIdcard"
column=
"EMP_IDCARD"
/>
<result
property=
"contractStart"
column=
"CONTRACT_START"
/>
<result
property=
"contractEnd"
column=
"CONTRACT_END"
/>
<result
property=
"fileProvince"
column=
"FILE_PROVINCE"
/>
<result
property=
"fileCity"
column=
"FILE_CITY"
/>
<result
property=
"fileTown"
column=
"FILE_TOWN"
/>
<result
property=
"subjectDepart"
column=
"SUBJECT_DEPART"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
/>
<result
property=
"empNatrue"
column=
"EMP_NATRUE"
/>
<result
property=
"contractName"
column=
"CONTRACT_NAME"
/>
<result
property=
"contractSubName"
column=
"CONTRACT_SUB_NAME"
/>
<result
property=
"situation"
column=
"SITUATION"
/>
<result
property=
"contractType"
column=
"CONTRACT_TYPE"
/>
<result
property=
"contractParty"
column=
"CONTRACT_PARTY"
/>
<result
property=
"subjectUnit"
column=
"SUBJECT_UNIT"
/>
<result
property=
"auditStatus"
column=
"AUDIT_STATUS"
/>
<result
property=
"inUse"
column=
"IN_USE"
/>
<result
property=
"files"
column=
"FILES"
/>
<result
property=
"isFile"
column=
"IS_FILE"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"createNum"
column=
"CREATE_NUM"
/>
<result
property=
"startDate"
column=
"START_DATE"
/>
<result
property=
"endDate"
column=
"END_DATE"
/>
<result
property=
"history"
column=
"HISTORY"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.ID,
a.EMP_NO,
...
...
@@ -319,7 +353,7 @@
</where>
</select>
<!--
tEmployeeContractInfo简单分页查询
-->
<!--
list
-->
<select
id=
"getTEmployeeContractList"
resultMap=
"tEmployeeContrctInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
...
...
@@ -330,6 +364,28 @@
</where>
</select>
<!--导出-->
<select
id=
"getTEmployeeContractExport"
resultMap=
"tEmployeeContrctInfoExportMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0
<include
refid=
"tEmployeeContractInfo_where"
/>
</where>
</select>
<!--导出历史合并-->
<select
id=
"getTEmployeeContractExportHistory"
resultMap=
"tEmployeeContrctInfoExportMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0
<include
refid=
"tEmployeeContractInfo_where"
/>
</where>
</select>
<!--tEmployeeContractInfo简单分页查询-->
<select
id=
"getOneContractByApplyNo"
resultMap=
"tEmployeeContrctInfoMap"
>
SELECT
...
...
yifu-common/yifu-common-core/pom.xml
View file @
8bd62c86
...
...
@@ -71,6 +71,11 @@
<artifactId>
commons-lang
</artifactId>
<version>
2.6
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.35
</version>
</dependency>
<!-- aliyun-sdk-oss -->
<dependency>
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/ExcelAttributeConstants.java
View file @
8bd62c86
...
...
@@ -34,8 +34,9 @@ public class ExcelAttributeConstants {
//员工合同类型
public
static
final
String
EMPLOYEE_CONTRACT_TYPE
=
"contract_type"
;
//员工合同工时制 1标准工时 2 综合工时 3不定时工时制
public
static
final
String
WORKING_HOURS
=
"
contract_
working_hours"
;
public
static
final
String
WORKING_HOURS
=
"working_hours"
;
//员工合同续签情况
public
static
final
String
EMPLOYEE_SITUATION_TYPE
=
"situation_type"
;
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ExcelException.java
0 → 100644
View file @
8bd62c86
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
exception
;
import
lombok.NoArgsConstructor
;
@NoArgsConstructor
//@NoArgsConstructor: 自动生成无参数构造函数。
public
class
ExcelException
extends
RuntimeException
{
public
ExcelException
(
String
message
)
{
super
(
message
);
}
public
ExcelException
(
Throwable
cause
)
{
super
(
cause
);
}
public
ExcelException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
ExcelException
(
String
message
,
Throwable
cause
,
boolean
enableSuppression
,
boolean
writableStackTrace
)
{
super
(
message
,
cause
,
enableSuppression
,
writableStackTrace
);
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
8bd62c86
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ValidityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ExcelException
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -32,6 +34,11 @@ public class ExcelUtil <T> implements Serializable {
private
HashMap
<
Integer
,
ErrorMessage
>
errorMessageHashMap
;
/**
* 用于返回实体
*/
private
List
<
T
>
entityList
;
public
ExcelUtil
(
Class
<
T
>
clazz
)
{
this
.
clazz
=
clazz
;
this
.
fields
=
clazz
.
getDeclaredFields
();
...
...
@@ -730,4 +737,204 @@ public class ExcelUtil <T> implements Serializable {
}
return
errorMessageHashMap
;
}
/**
* 将JSONSTRING数据源的数据导入到list
*
* @param jsonStr 接收的对象JSON串
* @param dicMap HashMap<dateType_value,dataValue_dataId> 如 {EMPTYPE_兼职工伤,ID}
* @author fxj
* @date 2019/08/01
*/
public
void
getJsonStringToList
(
String
jsonStr
,
Map
<
String
,
String
>
dicMap
)
{
List
<
HashMap
>
list
=
null
;
List
<
T
>
listt
=
new
ArrayList
<
T
>();
list
=
JSONObject
.
parseArray
(
jsonStr
,
HashMap
.
class
);
List
<
ErrorMessage
>
errorList
=
new
ArrayList
<
ErrorMessage
>();
HashMap
<
Integer
,
ErrorMessage
>
errorMessageHashMap
=
new
HashMap
<
Integer
,
ErrorMessage
>();
try
{
// 得到数据的条数
int
rows
=
list
.
size
();
// 有数据时才处理
if
(
rows
>
0
)
{
// 得到类的所有field
Field
[]
allFields
=
clazz
.
getDeclaredFields
();
Field
field
;
// 定义一个map用于存放列的序号和field
Map
<
Integer
,
Field
>
fieldsMap
=
new
HashMap
<
Integer
,
Field
>();
for
(
int
i
=
0
,
index
=
0
;
i
<
allFields
.
length
;
i
++)
{
field
=
allFields
[
i
];
// 将有注解的field存放到map中
if
(
field
.
isAnnotationPresent
(
ExcelAttribute
.
class
))
{
// 设置类的私有字段属性可访问
field
.
setAccessible
(
true
);
fieldsMap
.
put
(
index
,
field
);
index
++;
}
}
//存储错误数据
String
error
=
""
;
//临时存储单元格数据
String
tempStr
=
""
;
// 从第1行开始取数据
T
entity
=
null
;
HashMap
temp
;
ExcelAttribute
attr
;
String
c
=
null
;
Class
<?>
fieldType
;
ErrorMessage
errorTemp
=
null
;
for
(
int
i
=
0
;
i
<
rows
;
i
++)
{
// 得到一行中的所有单元格对象.
temp
=
list
.
get
(
i
);
entity
=
clazz
.
newInstance
();
for
(
int
j
=
0
;
j
<
fieldsMap
.
size
();
j
++)
{
// 从map中得到对应列的field
field
=
fieldsMap
.
get
(
j
);
//获取属性对应的注解属性
attr
=
field
.
getAnnotation
(
ExcelAttribute
.
class
);
// 单元格中的内容.
c
=
getStringValByObject
(
getFieldValueByName
(
attr
.
name
(),
temp
));
if
(
c
!=
null
)
{
c
=
c
.
trim
();
}
//校验字段是否符合要求 返回错误信息
error
=
validateUtil
(
c
,
attr
,
i
+
2
);
if
(
null
!=
error
)
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
error
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
error
),
errorTemp
);
continue
;
}
if
(
field
==
null
)
{
continue
;
}
//单元格数据为空不需要处理了
if
(!
StringUtils
.
isNotBlank
(
c
))
{
continue
;
}
//如果是需要从字典表取值数据的话在这里处理即可
if
(
attr
.
isDataId
()
&&
null
!=
dicMap
)
{
if
(
Common
.
isNotNull
(
attr
.
dataType
()))
{
//非区域字段处理
if
(
Common
.
isNotNull
(
attr
.
parentField
())){
tempStr
=
dicMap
.
get
(
attr
.
dataType
()
+
"_"
+
c
.
trim
()
+
"_"
+
getFieldValueByName
(
attr
.
parentField
(),
entity
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
));
}
else
{
tempStr
=
dicMap
.
get
(
attr
.
dataType
()
+
"_"
+
c
.
trim
());
}
}
else
{
if
(
attr
.
isArea
())
{
//区域字段处理
if
(
Common
.
isEmpty
(
attr
.
parentField
()))
{
tempStr
=
dicMap
.
get
(
c
.
trim
()
+
"_0"
);
}
else
{
tempStr
=
dicMap
.
get
(
c
.
trim
()
+
"_"
+
getFieldValueByName
(
attr
.
parentField
(),
entity
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
));
}
}
else
{
//直接按值去找数据
tempStr
=
dicMap
.
get
(
c
.
trim
());
}
}
if
(!
StringUtils
.
isNotBlank
(
tempStr
))
{
if
(
attr
.
isOrgan
())
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
"未找到:"
+
c
+
"的单位或结算主体数据,请确认存在结算主体权限"
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
"未找到:"
+
c
+
"的单位或结算主体数据,请确认存在结算主体权限"
),
errorTemp
);
}
if
(
attr
.
isArea
())
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
"未找到:"
+
c
+
"的区域数据"
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
"未找到:"
+
c
+
"的区域数据"
),
errorTemp
);
}
else
{
if
(
Common
.
isNotNull
(
attr
.
errorInfoImport
()))
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
"数据'"
+
c
+
"':"
+
attr
.
errorInfoImport
()));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
"数据'"
+
c
+
"':"
+
attr
.
errorInfoImport
()),
errorTemp
);
}
else
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
"未找到:"
+
c
+
"的字典数据"
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
"未找到:"
+
c
+
"的字典数据"
),
errorTemp
);
}
}
continue
;
}
else
{
c
=
tempStr
;
}
}
// 取得类型,并根据对象类型设置值.
fieldType
=
field
.
getType
();
if
(
fieldType
==
null
)
{
continue
;
}
if
(
String
.
class
==
fieldType
)
{
field
.
set
(
entity
,
c
);
}
else
if
(
BigDecimal
.
class
==
fieldType
)
{
c
=
c
.
indexOf
(
'%'
)
!=
-
1
?
c
.
replace
(
"%"
,
""
)
:
c
;
field
.
set
(
entity
,
BigDecimal
.
valueOf
(
Double
.
valueOf
(
c
)));
}
else
if
(
Date
.
class
==
fieldType
&&
Common
.
isNotNull
(
c
.
trim
()))
{
field
.
set
(
entity
,
DateUtil
.
stringToDate
(
c
.
trim
(),
Common
.
isEmpty
(
attr
.
dateFormat
())
?
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
:
attr
.
dateFormat
()));
}
else
if
((
Integer
.
TYPE
==
fieldType
)
||
(
Integer
.
class
==
fieldType
))
{
field
.
set
(
entity
,
Integer
.
parseInt
(
c
));
}
else
if
((
Long
.
TYPE
==
fieldType
)
||
(
Long
.
class
==
fieldType
))
{
field
.
set
(
entity
,
Long
.
valueOf
(
c
));
}
else
if
((
Float
.
TYPE
==
fieldType
)
||
(
Float
.
class
==
fieldType
))
{
field
.
set
(
entity
,
Float
.
valueOf
(
c
));
}
else
if
((
Short
.
TYPE
==
fieldType
)
||
(
Short
.
class
==
fieldType
))
{
field
.
set
(
entity
,
Short
.
valueOf
(
c
));
}
else
if
((
Double
.
TYPE
==
fieldType
)
||
(
Double
.
class
==
fieldType
))
{
field
.
set
(
entity
,
Double
.
valueOf
(
c
));
}
else
if
(
Character
.
TYPE
==
fieldType
)
{
if
((
c
!=
null
)
&&
(
c
.
length
()
>
0
))
{
field
.
set
(
entity
,
Character
.
valueOf
(
c
.
charAt
(
0
)));
}
}
else
if
(
LocalDateTime
.
class
==
fieldType
&&
Common
.
isNotNull
(
c
.
trim
()))
{
String
dc
=
c
.
trim
().
replace
(
CommonConstants
.
CENTER_SPLIT_LINE_STRING
,
""
)
.
replace
(
CommonConstants
.
SLASH_SPLIT_LINE_STRING
,
""
);
try
{
if
(
dc
.
length
()
>
CommonConstants
.
EIGHT_INT
)
{
field
.
set
(
entity
,
LocalDateTimeUtils
.
convertDateToLDT
(
DateUtil
.
stringToDate
(
dc
,
DateUtil
.
DATETIME_PATTERN_CONTAINS
)));
}
else
{
field
.
set
(
entity
,
LocalDateTimeUtils
.
convertDateToLDT
(
DateUtil
.
stringToDate
(
dc
,
DateUtil
.
ISO_DATE_FORMAT
)));
}
}
catch
(
Exception
e
)
{
if
(
dc
.
length
()
>
CommonConstants
.
EIGHT_INT
)
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"应满足时间格式:"
+
DateUtil
.
DATETIME_PATTERN_SECOND
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"应满足时间格式:"
+
DateUtil
.
DATETIME_PATTERN_SECOND
),
errorTemp
);
continue
;
}
else
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"应满足时间格式:"
+
DateUtil
.
ISO_DATE_FORMAT
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"应满足时间格式:"
+
DateUtil
.
ISO_DATE_FORMAT
),
errorTemp
);
continue
;
}
}
}
else
if
(
LocalDate
.
class
==
fieldType
&&
!
Common
.
isEmpty
(
c
.
trim
()))
{
try
{
field
.
set
(
entity
,
LocalDate
.
parse
(
c
.
trim
().
replace
(
CommonConstants
.
CENTER_SPLIT_LINE_STRING
,
""
),
DateTimeFormatter
.
ofPattern
(
DateUtil
.
ISO_DATE_FORMAT
)));
}
catch
(
Exception
e
)
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"应满足时间格式:"
+
DateUtil
.
ISO_DATE_FORMAT
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"应满足时间格式:"
+
DateUtil
.
ISO_DATE_FORMAT
),
errorTemp
);
continue
;
}
}
}
if
(
null
==
error
)
{
if
(
entity
!=
null
)
{
listt
.
add
(
entity
);
}
}
else
{
continue
;
}
}
}
}
catch
(
Exception
e
)
{
throw
new
ExcelException
(
"将jsonString数据源的数据导入到list异常:"
+
e
.
getMessage
(),
e
);
}
this
.
setEntityList
(
listt
);
this
.
setErrorInfo
(
errorList
);
this
.
setErrorMessageHashMap
(
errorMessageHashMap
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
8bd62c86
...
...
@@ -335,5 +335,18 @@ public class DictController {
return
sysDictItemService
.
getLableFronValue
(
value
,
type
);
}
/**
* @Description: itemType 获取对应的字典数据
* @Author: hgw
* @Date: 2022/6/22 18:19
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>>
**/
@Inner
@PostMapping
(
"/inner/getDictList"
)
public
R
<
List
<
SysDictItem
>>
getDictList
(
@RequestParam
(
value
=
"itemType"
,
required
=
false
)
String
itemType
)
{
List
<
SysDictItem
>
allList
=
sysDictItemService
.
list
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
in
(
SysDictItem:
:
getType
,
itemType
)
.
eq
(
SysDictItem:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
));
return
new
R
<>(
allList
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/mapper/SysDictItemMapper.java
View file @
8bd62c86
...
...
@@ -27,5 +27,4 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
SysDictItemMapper
extends
BaseMapper
<
SysDictItem
>
{
}
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