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
df043978
Commit
df043978
authored
Jun 30, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
f8aa486a
827b9246
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
604 additions
and
60 deletions
+604
-60
FddContractAttachInfo.java
...d/plus/v1/yifu/archives/entity/FddContractAttachInfo.java
+5
-4
FddTemplateFieldInfo.java
...ud/plus/v1/yifu/archives/entity/FddTemplateFieldInfo.java
+7
-1
TEmpBadRecord.java
...ifu/cloud/plus/v1/yifu/archives/entity/TEmpBadRecord.java
+8
-1
EmployeeExportVO.java
...yifu/cloud/plus/v1/yifu/archives/vo/EmployeeExportVO.java
+3
-3
pom.xml
yifu-archives/yifu-archives-biz/pom.xml
+5
-0
FddContractInfoController.java
...1/yifu/archives/controller/FddContractInfoController.java
+14
-0
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+16
-2
FddContractInfoService.java
...plus/v1/yifu/archives/service/FddContractInfoService.java
+3
-0
FddTemplateFieldInfoService.java
...v1/yifu/archives/service/FddTemplateFieldInfoService.java
+3
-0
TEmployeeProjectService.java
...lus/v1/yifu/archives/service/TEmployeeProjectService.java
+17
-1
FddContractInfoServiceImpl.java
...ifu/archives/service/impl/FddContractInfoServiceImpl.java
+384
-2
FddTemplateFieldInfoServiceImpl.java
...rchives/service/impl/FddTemplateFieldInfoServiceImpl.java
+16
-0
TEmpBadRecordServiceImpl.java
.../yifu/archives/service/impl/TEmpBadRecordServiceImpl.java
+13
-2
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+61
-5
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+4
-0
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+42
-35
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+1
-0
DictItemRedisInit.java
...yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
+2
-4
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/FddContractAttachInfo.java
View file @
df043978
...
...
@@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
...
...
@@ -55,25 +56,25 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同试用期开始时间
*/
@Schema
(
description
=
"合同试用期开始时间"
)
private
LocalDate
Time
periodStart
;
private
LocalDate
periodStart
;
/**
* 合同试用期结束时间
*/
@Schema
(
description
=
"合同试用期结束时间"
)
private
LocalDate
Time
periodEnd
;
private
LocalDate
periodEnd
;
/**
* 合同起始时间
*/
@Schema
(
description
=
"合同起始时间"
)
private
LocalDate
Time
contractStart
;
private
LocalDate
contractStart
;
/**
* 合同到期时间
*/
@Schema
(
description
=
"合同到期时间"
)
private
LocalDate
Time
contractEnd
;
private
LocalDate
contractEnd
;
/**
* 试用期工资 元/月
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/FddTemplateFieldInfo.java
View file @
df043978
...
...
@@ -17,6 +17,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
...
...
@@ -61,5 +62,10 @@ public class FddTemplateFieldInfo extends BaseEntity {
@Schema
(
description
=
"模板ID"
)
private
String
templateId
;
/**
* 对应法大大模板字段值
*/
@Schema
(
description
=
"对应法大大模板字段值"
)
@TableField
(
exist
=
false
)
private
String
fieldValue
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmpBadRecord.java
View file @
df043978
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
...
...
@@ -122,5 +123,11 @@ public class TEmpBadRecord extends BaseEntity {
@ExcelProperty
(
"其他损失"
)
private
BigDecimal
loseFeeOther
;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField
(
exist
=
false
)
private
String
attaIds
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeExportVO.java
View file @
df043978
...
...
@@ -75,15 +75,15 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty
(
value
=
"邮箱"
)
private
String
empEmail
;
@ExcelAttribute
(
name
=
"户籍所在省"
,
is
DataId
=
true
,
is
Area
=
true
)
@ExcelAttribute
(
name
=
"户籍所在省"
,
isArea
=
true
)
@ExcelProperty
(
value
=
"户籍所在省"
)
private
String
idProvince
;
@ExcelAttribute
(
name
=
"户籍所在市"
,
isDataId
=
true
,
isArea
=
true
,
parentField
=
"idProvince"
)
@ExcelAttribute
(
name
=
"户籍所在市"
,
isArea
=
true
,
parentField
=
"idProvince"
)
@ExcelProperty
(
value
=
"户籍所在市"
)
private
String
idCity
;
@ExcelAttribute
(
name
=
"户籍所在县"
,
isDataId
=
true
,
isArea
=
true
,
parentField
=
"idCity"
)
@ExcelAttribute
(
name
=
"户籍所在县"
,
isArea
=
true
,
parentField
=
"idCity"
)
@ExcelProperty
(
value
=
"户籍所在县"
)
private
String
idTown
;
...
...
yifu-archives/yifu-archives-biz/pom.xml
View file @
df043978
...
...
@@ -67,6 +67,11 @@
<version>
1.8.0
</version>
<artifactId>
fadada-java-sdk-api3
</artifactId>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<version>
5.8.0
</version>
<artifactId>
hutool-all
</artifactId>
</dependency>
</dependencies>
<build>
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddContractInfoController.java
View file @
df043978
...
...
@@ -19,6 +19,7 @@ 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.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -111,4 +112,17 @@ public class FddContractInfoController {
return
R
.
ok
(
fddContractInfoService
.
removeById
(
id
));
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 发送法大大电子合同定稿任务
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"发送法大大电子合同定稿任务"
,
description
=
"发送法大大电子合同定稿任务"
)
@SysLog
(
"发送法大大电子合同定稿任务"
)
@PostMapping
(
"/send"
)
public
R
<
String
>
send
(
FddContractInfo
fddContractInfo
)
throws
ApiException
{
return
fddContractInfoService
.
saveEmpContract
(
fddContractInfo
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
df043978
...
...
@@ -81,7 +81,6 @@ public class TEmployeeProjectController {
return
R
.
ok
(
tEmployeeProjectService
.
getTEmployeeProjectInfoPage
(
page
,
tEmployeeProject
));
}
/**
* 通过id查询项目档案表
* @param id id
...
...
@@ -142,7 +141,7 @@ public class TEmployeeProjectController {
@Operation
(
summary
=
"新增项目档案校验"
,
description
=
"新增项目档案校验"
)
@SysLog
(
"新增项目档案校验"
)
@PostMapping
(
"/check"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_add
check
')"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_add')"
)
public
R
addCheck
(
@RequestBody
TEmployeeProject
tEmployeeProject
)
{
return
R
.
ok
(
tEmployeeProjectService
.
addCheck
(
tEmployeeProject
));
}
...
...
@@ -176,6 +175,21 @@ public class TEmployeeProjectController {
return
R
.
ok
(
tEmployeeProjectService
.
deleteEmpPro
(
tEmployeeProject
));
}
/**
* 减项
* @param excelVOList
* @param bindingResult
* @Author huyc
* @Date 2022-06-20
*/
@Operation
(
summary
=
"批量减项"
,
description
=
"批量减项"
)
@SysLog
(
"批量减项"
)
@PostMapping
(
"/batchDeleteEmpPro"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_batchdelempproinfo')"
)
public
R
<
List
<
ErrorMessage
>>
batchDeleteEmpPro
(
@RequestExcel
List
<
EmployeeProjectVO
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmployeeProjectService
.
batchDeleteEmpPro
(
excelVOList
,
bindingResult
);
}
/**
* 批量新增项目档案信息
*
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FddContractInfoService.java
View file @
df043978
...
...
@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
/**
* 法大大合同与员工合同信息
...
...
@@ -29,4 +31,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
*/
public
interface
FddContractInfoService
extends
IService
<
FddContractInfo
>
{
R
<
String
>
saveEmpContract
(
FddContractInfo
fddContractInfo
)
throws
ApiException
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FddTemplateFieldInfoService.java
View file @
df043978
...
...
@@ -21,6 +21,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo
;
import
java.util.List
;
/**
* 法大大字段对应信息表
*
...
...
@@ -28,5 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
* @date 2022-06-28 16:24:12
*/
public
interface
FddTemplateFieldInfoService
extends
IService
<
FddTemplateFieldInfo
>
{
List
<
FddTemplateFieldInfo
>
getFddFields
(
String
templateId
,
String
type
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectService.java
View file @
df043978
...
...
@@ -45,8 +45,24 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R
reEmpInfo
(
JSONObject
jsonObject
);
/**
* @param tEmployeeProject
* @Description: 减项
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
deleteEmpPro
(
TEmployeeProject
tEmployeeProject
);
/**
* @param list
* @Description: 批量减项
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
<
List
<
ErrorMessage
>>
batchDeleteEmpPro
(
List
<
EmployeeProjectVO
>
list
,
BindingResult
bindingResult
);
/**
* @param excelVOList
* @param bindingResult
...
...
@@ -91,7 +107,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
/**
* @param ids
* @Description: 批量删除项目档案
* @Author: h
gw
* @Author: h
uyc
* @Date: 2022/6/22 12:30
* @return: R
**/
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractInfoServiceImpl.java
View file @
df043978
...
...
@@ -16,13 +16,42 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo
;
import
com.fadada.api.bean.req.account.NoticeReq
;
import
com.fadada.api.bean.req.revise.CreateReviseTaskReq
;
import
com.fadada.api.bean.rsp.BaseRsp
;
import
com.fadada.api.bean.rsp.revise.CreateReviseTaskRsp
;
import
com.fadada.api.client.ReviseTaskClient
;
import
com.fadada.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.*
;
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.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
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.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 法大大合同与员工合同信息
*
...
...
@@ -31,6 +60,359 @@ import org.springframework.stereotype.Service;
*/
@Service
@RequiredArgsConstructor
@Slf4j
public
class
FddContractInfoServiceImpl
extends
ServiceImpl
<
FddContractInfoMapper
,
FddContractInfo
>
implements
FddContractInfoService
{
public
static
final
String
FILL_FILE_ID_NULL
=
"定稿任务id为空"
;
public
static
final
String
NOT_FOUND_FDD_USER
=
"未获取到当前登录用户对应的组织下实名法大大用户"
;
@Autowired
private
FddUtil
fddUtil
;
@Autowired
private
FddReqLogService
reqLogService
;
@Autowired
private
FddContractTemplateService
fddContractTemplateService
;
@Autowired
private
FddPersonAccountService
fddPersonAccountService
;
@Autowired
private
FddContractTemplateFileService
fddContractTemplateFileService
;
@Autowired
private
FddContractInfoService
fddContractInfoService
;
@Autowired
private
FddCompanyInfoService
fddCompanyInfoService
;
@Autowired
private
FddSealPersonAuthService
fddSealPersonAuthService
;
@Autowired
private
FddContractAttachInfoService
fddContractAttachInfoService
;
// @Autowired
// private TEmployeeContractInfoService employeeContractInfoService;
@Autowired
private
TEmployeeInfoService
employeeInfoService
;
@Autowired
private
FddTemplateFieldInfoService
fieldInfoService
;
// 阿里云文件上传服务
@Autowired
private
OSSUtil
ossUtil
;
// // 附件表
// @Autowired
// private TEmpAttaService empAttaService;
// // 附件-合同,关联表
// @Autowired
// private MEmpContractAttaService mempContractAttaService;
@Autowired
private
TSettleDomainService
tSettleDomainService
;
@Override
public
R
<
String
>
saveEmpContract
(
FddContractInfo
fddContractInfo
)
throws
ApiException
{
FddContractAttachInfo
fddContractAttachInfo
=
fddContractAttachInfoService
.
getById
(
fddContractInfo
.
getId
());
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(!
user
.
getId
().
equals
(
fddContractAttachInfo
.
getCreateBy
()))
{
return
R
.
failed
(
"当前用户不是电子合同导入用户,不能操作"
);
}
//法大大合同模板
TSettleDomain
settleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
().
eq
(
TSettleDomain:
:
getDepartNo
,
fddContractAttachInfo
.
getDepartNo
()));
if
(
settleDomain
==
null
)
{
return
R
.
failed
(
"未获取到对应的结算主体"
);
}
List
<
FddContractTemplate
>
fddContractTemplateList
=
fddContractTemplateService
.
list
(
Wrappers
.<
FddContractTemplate
>
query
().
lambda
()
.
eq
(
FddContractTemplate:
:
getModifyUploadStatus
,
CommonConstants
.
dingleDigitStrArray
[
1
])
.
eq
(
FddContractTemplate:
:
getFddTemplateId
,
fddContractAttachInfo
.
getFddTemplateId
()));
//如果模板存在则生成法大大电子合同数据
if
(
fddContractTemplateList
.
size
()
==
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
"未获取到有效的合同模板"
);
}
if
(
fddContractTemplateList
.
size
()
!=
CommonConstants
.
ONE_INT
)
{
return
R
.
failed
(
"法大大合同有效合同模板存在多条"
);
}
//校验登录用户和法大大实名用户是否名称和手机号一致
FddPersonAccount
fddCompanyPersonAccount
=
fddPersonAccountService
.
getOne
(
Wrappers
.<
FddPersonAccount
>
query
().
lambda
().
eq
(
FddPersonAccount:
:
getMoblie
,
user
.
getPhone
())
.
eq
(
FddPersonAccount:
:
getRealStatus
,
CommonConstants
.
ONE_STRING
).
eq
(
FddPersonAccount:
:
getSystemFlag
,
CommonConstants
.
ZERO_STRING
).
isNotNull
(
FddPersonAccount:
:
getCompanyInfoId
));
if
(
fddCompanyPersonAccount
==
null
)
{
return
R
.
failed
(
NOT_FOUND_FDD_USER
);
}
//获取员工法大大用户id
FddPersonAccount
fddEmpAccount
=
fddPersonAccountService
.
getOne
(
Wrappers
.<
FddPersonAccount
>
query
().
lambda
().
eq
(
FddPersonAccount:
:
getMoblie
,
fddContractAttachInfo
.
getEmpPhone
())
.
eq
(
FddPersonAccount:
:
getRealStatus
,
CommonConstants
.
ONE_STRING
).
eq
(
FddPersonAccount:
:
getSystemFlag
,
CommonConstants
.
ONE_STRING
));
if
(
fddEmpAccount
==
null
)
{
return
R
.
failed
(
NOT_FOUND_FDD_USER
);
}
if
(!
StringUtils
.
equals
(
CommonConstants
.
ONE_STRING
,
fddEmpAccount
.
getRealStatus
()))
{
return
R
.
failed
(
"当前用户未实名通过"
);
}
//获取法大大组织
List
<
String
>
companyInfoIdList
=
Arrays
.
asList
(
fddCompanyPersonAccount
.
getCompanyInfoId
().
split
(
","
));
List
<
FddCompanyInfo
>
fddCompanyInfo
=
fddCompanyInfoService
.
list
(
Wrappers
.<
FddCompanyInfo
>
query
().
lambda
().
in
(
FddCompanyInfo:
:
getId
,
companyInfoIdList
));
if
(
fddCompanyInfo
==
null
)
{
return
R
.
failed
(
"未获取到对应法大大组织"
);
}
FddContractTemplate
fddContractTemplate
=
fddContractTemplateList
.
get
(
CommonConstants
.
ZERO_INT
);
//获取法大大模板下附件
FddContractTemplateFile
fddContractTemplateFile
=
fddContractTemplateFileService
.
getOne
(
Wrappers
.<
FddContractTemplateFile
>
query
().
lambda
().
eq
(
FddContractTemplateFile:
:
getFddTemplateId
,
fddContractTemplate
.
getFddTemplateId
()));
ReviseTaskClient
reviseTaskClient
=
new
ReviseTaskClient
(
fddUtil
.
getFadadaApiClient
());
CreateReviseTaskReq
req
=
new
CreateReviseTaskReq
();
req
.
setTemplateId
(
fddContractTemplate
.
getFddTemplateId
());
req
.
setTaskSubject
(
"员工合同"
);
req
.
setFinalizeWay
(
1
);
req
.
setSort
(
1
);
//定义persion角色开始
CreateReviseTaskReq
.
FillRoleInfo
persionFillRoleInfo
=
new
CreateReviseTaskReq
.
FillRoleInfo
();
persionFillRoleInfo
.
setRoleName
(
FddUtil
.
PERSON
);
NoticeReq
perSionNoticeReq
=
new
NoticeReq
();
perSionNoticeReq
.
setNotifyWay
(
1
);
perSionNoticeReq
.
setNotifyAddress
(
fddContractAttachInfo
.
getEmpPhone
());
persionFillRoleInfo
.
setNotice
(
perSionNoticeReq
);
persionFillRoleInfo
.
setUnionId
(
fddEmpAccount
.
getUnionid
());
//文件参数预先填充
List
<
CreateReviseTaskReq
.
FillTemplateFileInfo
>
fileInfoList
=
new
ArrayList
<>();
CreateReviseTaskReq
.
FillTemplateFileInfo
fileInfo
=
new
CreateReviseTaskReq
.
FillTemplateFileInfo
();
fileInfo
.
setFileId
(
fddContractTemplateFile
.
getFddFileId
());
//员工填充数据
//FddEmployeeContractFillVo fddEmployeeContractFillVo = new FddEmployeeContractFillVo();
//fileInfo.setFormFields(JSON.toJSONString(fddEmployeeContractFillVo));
List
<
FddTemplateFieldInfo
>
personFields
=
fieldInfoService
.
getFddFields
(
fddContractTemplate
.
getFddTemplateId
(),
CommonConstants
.
ZERO_STRING
);
if
(
Common
.
isNotNull
(
personFields
)){
initPersonFields
(
fddContractAttachInfo
,
personFields
);
fileInfo
.
setFormFields
(
JSON
.
toJSONString
(
personFields
.
stream
().
collect
(
HashMap:
:
new
,
(
m
,
v
)->
m
.
put
(
v
.
getFiledName
(),
v
.
getFieldValue
()),
HashMap:
:
putAll
)));
}
fileInfoList
.
add
(
fileInfo
);
persionFillRoleInfo
.
setFillTemplateFiles
(
fileInfoList
);
//定义persion角色结束
//定义company角色开始
CreateReviseTaskReq
.
FillRoleInfo
companyFillRoleInfo
=
new
CreateReviseTaskReq
.
FillRoleInfo
();
companyFillRoleInfo
.
setRoleName
(
FddUtil
.
COMPANY
);
NoticeReq
companyionNoticeReq
=
new
NoticeReq
();
companyionNoticeReq
.
setNotifyWay
(
1
);
companyionNoticeReq
.
setNotifyAddress
(
fddCompanyPersonAccount
.
getMoblie
());
companyFillRoleInfo
.
setNotice
(
companyionNoticeReq
);
companyFillRoleInfo
.
setUnionId
(
fddCompanyPersonAccount
.
getUnionid
());
//文件参数预先填充
List
<
CreateReviseTaskReq
.
FillTemplateFileInfo
>
companyFileInfoList
=
new
ArrayList
<>();
CreateReviseTaskReq
.
FillTemplateFileInfo
companyFileInfo
=
new
CreateReviseTaskReq
.
FillTemplateFileInfo
();
companyFileInfo
.
setFileId
(
fddContractTemplateFile
.
getFddFileId
());
//公司填充数据
List
<
FddTemplateFieldInfo
>
compamyFields
=
fieldInfoService
.
getFddFields
(
fddContractTemplate
.
getFddTemplateId
(),
CommonConstants
.
ONE_STRING
);
if
(
Common
.
isNotNull
(
compamyFields
)){
Map
<
String
,
String
>
companyFieldMap
=
compamyFields
.
stream
().
collect
(
Collectors
.
toMap
(
k
->
k
.
getFiledName
(),
k
->
k
.
getFiledName
()));
R
<
String
>
employeeParamR
=
generalEmployeeParamNew
(
fddContractAttachInfo
,
companyFieldMap
);
if
(
Common
.
isEmpty
(
employeeParamR
)
||
employeeParamR
.
getCode
()
==
CommonConstants
.
FAIL
.
intValue
()){
return
employeeParamR
;
}
companyFileInfo
.
setFormFields
(
employeeParamR
.
getData
());
}
companyFileInfoList
.
add
(
companyFileInfo
);
companyFillRoleInfo
.
setFillTemplateFiles
(
companyFileInfoList
);
//定义company角色结束
//文件id
List
<
CreateReviseTaskReq
.
TemplateFileInfo
>
templateFileInfos
=
new
ArrayList
<>();
CreateReviseTaskReq
.
TemplateFileInfo
templateFileInfo
=
new
CreateReviseTaskReq
.
TemplateFileInfo
();
templateFileInfo
.
setFileId
(
fddContractTemplateFile
.
getFddFileId
());
templateFileInfo
.
setFileName
(
"员工合同"
);
templateFileInfos
.
add
(
templateFileInfo
);
req
.
setTemplateFiles
(
templateFileInfos
);
//发送请求
List
<
CreateReviseTaskReq
.
FillRoleInfo
>
fillRoles
=
new
ArrayList
<>();
fillRoles
.
add
(
persionFillRoleInfo
);
fillRoles
.
add
(
companyFillRoleInfo
);
req
.
setFillRoles
(
fillRoles
);
//设置token
req
.
setToken
(
fddUtil
.
getToken
());
BaseRsp
<
CreateReviseTaskRsp
>
rsp
=
reviseTaskClient
.
createReviseTask
(
req
);
//保存日志
reqLogService
.
saveLog
(
this
.
getClass
().
getName
(),
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
(),
req
,
rsp
);
//校验参数
if
(
StringUtils
.
equals
(
rsp
.
getCode
(),
FddUtil
.
SUCCESS
))
{
CreateReviseTaskRsp
rspData
=
rsp
.
getData
();
//法大大员工合同记录生成
FddContractInfo
fddContractInfoNew
=
new
FddContractInfo
();
fddContractInfoNew
.
setContractId
(
fddContractAttachInfo
.
getContractId
());
fddContractInfoNew
.
setFddPersonAccountSendId
(
fddCompanyPersonAccount
.
getId
());
fddContractInfoNew
.
setFddPersonAccountReceiveId
(
fddEmpAccount
.
getId
());
fddContractInfoNew
.
setSendUnionid
(
fddCompanyPersonAccount
.
getUnionid
());
fddContractInfoNew
.
setReceiveUnionid
(
fddEmpAccount
.
getUnionid
());
fddContractInfoNew
.
setFddTemplateId
(
fddContractTemplate
.
getId
());
this
.
save
(
fddContractInfoNew
);
fddContractInfoNew
.
setTaskId
(
rspData
.
getTaskId
());
fddContractInfoNew
.
setFileId
(
rspData
.
getTaskFiles
().
get
(
CommonConstants
.
ZERO_INT
).
getFileId
());
this
.
updateById
(
fddContractInfoNew
);
return
new
R
<>(
"创建模板定稿任务成功"
);
}
else
{
log
.
error
(
"请求数据:{}"
,
JSON
.
toJSONString
(
req
));
log
.
error
(
"返回数据:{}"
,
JSON
.
toJSONString
(
rsp
));
return
R
.
failed
(
rsp
.
getMsg
());
}
}
public
R
<
String
>
generalEmployeeParamNew
(
FddContractAttachInfo
attachInfo
,
Map
<
String
,
String
>
companyFieldMap
)
{
JSONObject
paramter
=
new
JSONObject
();
if
(
Common
.
isNotNull
(
companyFieldMap
)){
R
<
String
>
res
=
getValuesOfKey
(
paramter
,
attachInfo
,
companyFieldMap
);
if
(
Common
.
isNotNull
(
res
)
&&
res
.
getCode
()
==
CommonConstants
.
FAIL
.
intValue
()){
return
res
;
}
}
return
new
R
<>(
paramter
.
toJSONString
());
}
private
R
<
String
>
getValuesOfKey
(
JSONObject
paramter
,
FddContractAttachInfo
attachInfo
,
Map
<
String
,
String
>
companyFieldMap
)
{
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"name"
))){
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getEmpName
()))
{
return
R
.
failed
(
"姓名为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"name"
,
attachInfo
.
getEmpName
());
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"birth"
))){
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
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"id_card"
))){
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getEmpIdcard
()))
{
return
R
.
failed
(
"身份证号为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"id_card"
,
attachInfo
.
getEmpIdcard
());
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"sex"
))){
int
sex
=
IdcardUtil
.
getGenderByIdCard
(
attachInfo
.
getEmpIdcard
());
if
(
sex
==
0
)
{
paramter
.
put
(
"sex"
,
"女"
);
}
else
if
(
sex
==
1
)
{
paramter
.
put
(
"sex"
,
"男"
);
}
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"mobile"
))){
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getEmpPhone
()))
{
return
R
.
failed
(
"手机号为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"mobile"
,
attachInfo
.
getEmpPhone
());
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"contractType"
))){
//固定期限
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
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"fPeriodStartY"
))){
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
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
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"fPeriodEndY"
))){
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
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"periodSalaryPerMonth"
))){
if
(
attachInfo
.
getPeriodSalaryPerMonth
()
==
null
)
{
return
R
.
failed
(
"新签试用期工资为空"
);
}
paramter
.
put
(
"pSalaryPerMon"
,
attachInfo
.
getPeriodSalaryPerMonth
());
}
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"post"
))){
//工作地点和岗位填充
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getPost
()))
{
return
R
.
failed
(
"员工岗位为空,请去档案补充对应信息!"
);
}
paramter
.
put
(
"post"
,
attachInfo
.
getPost
());
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"workSpace"
))){
if
(
StringUtils
.
isEmpty
(
attachInfo
.
getWorkSpace
()))
{
return
R
.
failed
(
"员工工作地点为空"
);
}
paramter
.
put
(
"workSpace"
,
attachInfo
.
getWorkSpace
());
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"workingHours"
))){
paramter
.
put
(
"workingHours"
,
""
);
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"salaryType"
))){
//工资标准
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
(
"计时工资为空"
);
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"salaryStrandPh"
))){
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
(
"计件工资为空"
);
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"salaryStrandPp"
))){
//计月工资
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
());
}
private
void
initPersonFields
(
FddContractAttachInfo
fddContractAttachInfo
,
List
<
FddTemplateFieldInfo
>
personFields
)
{
if
(
Common
.
isNotNull
(
fddContractAttachInfo
)
&&
Common
.
isNotNull
(
personFields
)){
for
(
FddTemplateFieldInfo
field:
personFields
){
if
(
field
.
getFiledName
().
equals
(
"empNameRecord"
)){
field
.
setFieldValue
(
fddContractAttachInfo
.
getEmpName
());
}
if
(
field
.
getFiledName
().
equals
(
"empSexRecord"
)){
int
sex
=
IdcardUtil
.
getGenderByIdCard
(
fddContractAttachInfo
.
getEmpIdcard
());
if
(
sex
==
0
)
{
field
.
setFieldValue
(
"女"
);
}
else
if
(
sex
==
1
)
{
field
.
setFieldValue
(
"男"
);
}
}
if
(
field
.
getFiledName
().
equals
(
"empBirthRecord"
)){
Date
date
=
IdcardUtil
.
getBirthDate
(
fddContractAttachInfo
.
getEmpIdcard
());
if
(
LocalDateTimeUtils
.
convertDateToLDT
(
date
)
!=
null
){
field
.
setFieldValue
(
DateUtil
.
format
(
LocalDateTimeUtils
.
convertDateToLDT
(
date
),
DatePattern
.
NORM_DATE_PATTERN
));
}
}
if
(
field
.
getFiledName
().
equals
(
"empIdCardRecord"
)){
field
.
setFieldValue
(
fddContractAttachInfo
.
getEmpIdcard
());
}
if
(
field
.
getFiledName
().
equals
(
"empMobileRecord"
)){
field
.
setFieldValue
(
fddContractAttachInfo
.
getEmpPhone
());
}
}
}
}
public
static
Date
localDate2Date
(
LocalDate
localDate
)
{
if
(
null
==
localDate
)
{
return
null
;
}
ZonedDateTime
zonedDateTime
=
localDate
.
atStartOfDay
(
ZoneId
.
systemDefault
());
return
Date
.
from
(
zonedDateTime
.
toInstant
());
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddTemplateFieldInfoServiceImpl.java
View file @
df043978
...
...
@@ -16,6 +16,7 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.FddTemplateFieldInfoMapper
;
...
...
@@ -23,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FddTemplateFieldInfoService;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 法大大字段对应信息表
*
...
...
@@ -33,4 +36,17 @@ import org.springframework.stereotype.Service;
@RequiredArgsConstructor
public
class
FddTemplateFieldInfoServiceImpl
extends
ServiceImpl
<
FddTemplateFieldInfoMapper
,
FddTemplateFieldInfo
>
implements
FddTemplateFieldInfoService
{
/**
* @ClassName: com.yifu.cloud.v1.hr.basicArchives.service.impl.FddTemplateFieldInfoServiceImpl.java
* @author huyc
* @date 2022/6/30
* @Description 按模板和角色获取具体字段参数
* @param templateId: 模板ID type:0 个人角色 1 公司角色
*/
@Override
public
List
<
FddTemplateFieldInfo
>
getFddFields
(
String
templateId
,
String
type
)
{
return
baseMapper
.
selectList
(
Wrappers
.<
FddTemplateFieldInfo
>
query
().
lambda
()
.
eq
(
FddTemplateFieldInfo:
:
getType
,
type
)
.
eq
(
FddTemplateFieldInfo:
:
getTemplateId
,
templateId
));
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpBadRecordServiceImpl.java
View file @
df043978
...
...
@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpBadRecordMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper
;
...
...
@@ -66,7 +67,7 @@ import java.util.List;
@RequiredArgsConstructor
@Service
public
class
TEmpBadRecordServiceImpl
extends
ServiceImpl
<
TEmpBadRecordMapper
,
TEmpBadRecord
>
implements
TEmpBadRecordService
{
private
final
TAttaInfoMapper
attaInfoMapper
;
private
final
TEmployeeInfoMapper
employeeInfoMapper
;
private
final
TEmployeeProjectMapper
projectMapper
;
...
...
@@ -128,7 +129,17 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
@Override
public
R
<
Boolean
>
saveDiy
(
TEmpBadRecord
tEmpBadRecord
)
{
return
R
.
ok
(
baseMapper
.
insert
(
tEmpBadRecord
)
>
0
);
int
res
=
baseMapper
.
insert
(
tEmpBadRecord
);
if
(
res
<
0
){
return
R
.
failed
();
}
//更新附件信息
List
<
String
>
ids
;
if
(
Common
.
isNotNull
(
tEmpBadRecord
.
getAttaIds
())){
ids
=
Common
.
initStrToList
(
tEmpBadRecord
.
getAttaIds
(),
CommonConstants
.
COMMA_STRING
);
attaInfoMapper
.
updateDomainId
(
tEmpBadRecord
.
getId
(),
ids
);
}
return
R
.
ok
();
}
private
void
importEmpBadRecord
(
List
<
EmpBadRecordVo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
df043978
...
...
@@ -189,7 +189,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getEmpId
,
tEmployeeProject
.
getEmpId
())
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
]));
if
(
count
.
compareTo
(
CommonConstants
.
DEPT_TREE_ROOT_ID
)
>
0
)
{
return
R
.
failed
(
"
该人员存在其他进行中的项目,禁止同步减档!
"
);
return
R
.
failed
(
"
人员在该项目下存在进行中/未完结的服务
"
);
}
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
...
...
@@ -203,6 +203,60 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return
R
.
failed
(
"传参为空!"
);
}
@Override
public
R
<
List
<
ErrorMessage
>>
batchDeleteEmpPro
(
List
<
EmployeeProjectVO
>
excelVOList
,
BindingResult
bindingResult
)
{
// 通用校验获取失败的数据
List
<
ErrorMessage
>
errorMessageList
=
(
List
<
ErrorMessage
>)
bindingResult
.
getTarget
();
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
errorMessageList
)){
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
// 执行数据插入操作 组装 PostDto
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
EmployeeProjectVO
excel
=
excelVOList
.
get
(
i
);
Set
<
String
>
errorMsg
=
new
HashSet
<>();
// 已有验证报错直接下一个
if
(
Common
.
isNotNull
(
errorMsgMap
.
get
(
i
+
2
)))
{
continue
;
}
//根据身份证和项目编码获取项目档案
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
if
(
tEmployeeProject
.
getIsLeaveEmployee
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
Long
count
=
this
.
count
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpId
,
tEmployeeProject
.
getEmpId
())
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
]));
if
(
count
.
compareTo
(
CommonConstants
.
DEPT_TREE_ROOT_ID
)
>
0
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
));
}
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
this
.
updateById
(
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeProjectOld
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeInfoOld
,
tEmployeeProject
);
}
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
errorMessageList
.
add
(
new
ErrorMessage
((
long
)
(
i
+
2
),
errorMsg
));
}
}
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
return
R
.
failed
(
errorMessageList
);
}
return
R
.
ok
();
}
/**
* 新增档案操作记录
* @param excelVOList
...
...
@@ -228,6 +282,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 获取身份证、手机号列表,批量查询档案
Map
<
String
,
Integer
>
idCardMap
=
new
HashMap
<>();
String
idCard
;
String
deptNo
;
// 执行数据插入操作 组装 PostDto
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
...
...
@@ -240,10 +295,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
idCard
=
excel
.
getEmpIdcard
();
if
(
idCardMap
.
get
(
idCard
)
!=
null
)
{
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行身份证号与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
));
deptNo
=
excel
.
getDeptNo
();
if
(
idCardMap
.
get
(
idCard
.
concat
(
deptNo
))
!=
null
)
{
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行身份证号+项目编码与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
));
}
else
{
idCardMap
.
put
(
idCard
,
i
+
2
);
idCardMap
.
put
(
idCard
.
concat
(
deptNo
)
,
i
+
2
);
}
//根据身份证获取人员档案
...
...
@@ -734,7 +790,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdCard
));
Map
<
String
,
String
>
projectMap
=
new
HashMap
<>();
if
(
Common
.
is
Empty
(
projects
)){
if
(
Common
.
is
NotNull
(
projects
)){
for
(
TEmployeeProject
project:
projects
){
projectMap
.
put
(
project
.
getDeptName
(),
project
.
getDeptNo
());
}
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
df043978
...
...
@@ -283,4 +283,8 @@ public interface ErrorCodes {
* 对应项目编码无项目档案信息,请核实后导入
*/
String
ARCHIVES_PROJECT_EMP_NOT_EXIST
=
"archives.project.emp.not.exist"
;
/**
* 人员在该项目下存在进行中/未完结的服务
*/
String
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
=
"archives.project.change.not.exist"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
df043978
...
...
@@ -39,6 +39,8 @@ public class ExcelUtil <T> implements Serializable {
private
Field
[]
fields
;
public
void
convertEntity
(
T
vo
,
String
[]
exportFields
,
Map
<
String
,
String
>
diyDicMap
,
String
dateFormat
)
{
String
provinceTemp
;
String
cityTemp
;
// 得到所有定义字段
Field
[]
allFields
=
clazz
.
getDeclaredFields
();
List
<
Field
>
fields
=
new
ArrayList
<>();
...
...
@@ -129,12 +131,7 @@ public class ExcelUtil <T> implements Serializable {
}
}
else
if
(
attr
.
isArea
()){
//区域字段处理 TODO
if
(!
Common
.
isNotNull
(
attr
.
parentField
()))
{
value
=
getAreaLabel
(
"area_"
+
field
.
get
(
vo
)
+
"_0"
,
attr
);
}
else
{
// TODO
value
=
getAreaLabel
(
"area_"
+
field
.
get
(
vo
)+
"_"
+
getFieldValueByName
(
attr
.
parentField
(),
vo
,
null
),
attr
);
}
value
=
getAreaLabel
(
"area_"
+
field
.
get
(
vo
));
}
field
.
set
(
vo
,
Common
.
isNotNull
(
value
)?
value:
field
.
get
(
vo
));
}
catch
(
Exception
e
){
...
...
@@ -224,6 +221,7 @@ public class ExcelUtil <T> implements Serializable {
String
tempStr
=
""
;
ErrorMessage
errorTemp
=
null
;
errorMessageHashMap
=
new
HashMap
<>();
Map
<
String
,
Field
>
mapArea
=
new
HashMap
<>();
// 参数校验
ExcelAttribute
attr
=
null
;
try
{
...
...
@@ -272,7 +270,8 @@ public class ExcelUtil <T> implements Serializable {
tempStr = dicMap.get(attr.dataType() + "_" + c.trim());
}*/
}
else
{
}
}
else
{
if
(
attr
.
isArea
())
{
//区域字段处理 TODO
if
(!
Common
.
isNotNull
(
attr
.
parentField
()))
{
...
...
@@ -303,14 +302,17 @@ public class ExcelUtil <T> implements Serializable {
}
if
(
Common
.
isNotNull
(
tempStr
)){
c
=
tempStr
;
}
mapArea
.
put
(
tempStr
,
field
);
}
// 取得类型,并根据对象类型设置值.
fieldType
=
field
.
getType
();
if
(
fieldType
==
null
)
{
continue
;
}
if
(
String
.
class
==
fieldType
)
{
if
(
attr
.
isArea
()){
// 区域字段单独处理
continue
;
}
else
if
(
String
.
class
==
fieldType
)
{
field
.
set
(
data
,
c
);
}
else
if
(
BigDecimal
.
class
==
fieldType
)
{
c
=
c
.
indexOf
(
'%'
)
!=
-
1
?
c
.
replace
(
"%"
,
""
)
:
c
;
...
...
@@ -363,6 +365,11 @@ public class ExcelUtil <T> implements Serializable {
}
}
}
if
(
Common
.
isNotNull
(
mapArea
)){
for
(
Map
.
Entry
<
String
,
Field
>
entry:
mapArea
.
entrySet
()){
entry
.
getValue
().
set
(
data
,
entry
.
getKey
());
}
}
}
catch
(
Exception
e
){
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
rowNum
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"校验异常,请联系管理人员"
),
errorTemp
);
}
finally
{
...
...
@@ -432,12 +439,12 @@ public class ExcelUtil <T> implements Serializable {
}
return
propertyValue
;
}
private
String
getAreaLabel
(
String
c
,
ExcelAttribute
attr
)
{
private
String
getAreaLabel
(
String
c
)
{
return
(
String
)
RedisUtil
.
redis
.
opsForValue
().
get
(
c
);
}
private
String
getAreaValue
(
String
c
,
String
tempStr
,
ExcelAttribute
attr
,
Integer
rowNum
,
ErrorMessage
errorTemp
)
{
tempStr
=
(
String
)
RedisUtil
.
redis
.
opsForValue
().
get
(
c
);
tempStr
=
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
c
)
);
if
(
Common
.
isEmpty
(
tempStr
)){
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
rowNum
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"校验异常,请联系管理人员"
),
errorTemp
);
return
CommonConstants
.
EMPTY_STRING
;
...
...
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
df043978
...
...
@@ -87,6 +87,7 @@ import.file.type.error=\u5BFC\u5165\u7684\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u7
archives.project.emp.not.exist
=
\u
5BF9
\u
5E94
\u9879\u
76EE
\u
7F16
\u7801\u
65E0
\u9879\u
76EE
\u6863\u6848\u
4FE1
\u
606F
\u
FF0C
\u
8BF7
\u6838\u
5B9E
\u
540E
\u
5BFC
\u5165
archives.project.change.not.exist
=
\u
4EBA
\u5458\u5728\u
8BE5
\u9879\u
76EE
\u
4E0B
\u
5B58
\u5728\u
8FDB
\u
884C
\u
4E2D/
\u
672A
\u
5B8C
\u
7ED3
\u7684\u
670D
\u
52A1
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
View file @
df043978
...
...
@@ -49,15 +49,13 @@ public class DictItemRedisInit {
if
(
Common
.
isNotNull
(
allAreas
)){
Map
<
String
,
SysArea
>
areaMap
=
new
HashMap
<>();
for
(
SysArea
area:
allAreas
){
redisUtil
.
set
(
"area_"
+
area
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+(
Common
.
isEmpty
(
area
.
getParentId
())?
"0"
:
area
.
getParentId
()),
area
.
getAreaName
());
redisUtil
.
set
(
"area_"
+
area
.
getId
(),
area
.
getAreaName
());
areaMap
.
put
(
area
.
getId
().
toString
(),
area
);
}
SysArea
temp
;
for
(
SysArea
area:
allAreas
){
if
(
Common
.
isNotNull
(
area
.
getParentId
())
&&
area
.
getParentId
().
intValue
()
>
0
){
temp
=
areaMap
.
get
(
area
.
getParentId
());
temp
=
areaMap
.
get
(
area
.
getParentId
()
.
toString
()
);
redisUtil
.
set
(
"area_"
+
area
.
getAreaName
()
+
CommonConstants
.
DOWN_LINE_STRING
+(
Common
.
isNotNull
(
temp
)?
temp
.
getAreaName
():
""
),
area
.
getId
());
...
...
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