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
44b3b966
Commit
44b3b966
authored
Dec 29, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门管理初版提交
parent
aa550bd4
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2130 additions
and
14 deletions
+2130
-14
TBusinessEmployeeExtendInfo.java
.../v1/yifu/archives/entity/TBusinessEmployeeExtendInfo.java
+154
-0
BusinessEmployeeExtendByLeave.java
...us/v1/yifu/archives/vo/BusinessEmployeeExtendByLeave.java
+55
-0
BusinessEmployeeExtendVO.java
...ud/plus/v1/yifu/archives/vo/BusinessEmployeeExtendVO.java
+127
-0
UpdateBusinessEmployeeExtendDTO.java
.../v1/yifu/archives/vo/UpdateBusinessEmployeeExtendDTO.java
+145
-0
UpdateEmployeeExtendRedundancyDTO.java
...1/yifu/archives/vo/UpdateEmployeeExtendRedundancyDTO.java
+70
-0
EmployeeBusinessController.java
.../yifu/archives/controller/EmployeeBusinessController.java
+396
-0
TBusinessEmployeeExtendInfoMapper.java
...fu/archives/mapper/TBusinessEmployeeExtendInfoMapper.java
+37
-0
TBusinessEmployeeExtendInfoService.java
.../archives/service/TBusinessEmployeeExtendInfoService.java
+95
-0
TBusinessEmployeeExtendInfoServiceImpl.java
.../service/impl/TBusinessEmployeeExtendInfoServiceImpl.java
+436
-0
TBusinessEmployeeExtendInfoMapper.xml
...in/resources/mapper/TBusinessEmployeeExtendInfoMapper.xml
+147
-0
TBusDeptController.java
...lus/v1/business/controller/system/TBusDeptController.java
+390
-0
TBusDeptMapper.xml
...business-biz/src/main/resources/mapper/TBusDeptMapper.xml
+1
-1
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+9
-0
ArchivesDaprUtil.java
...cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
+15
-0
daprConfig.properties
...yifu-common-dapr/src/main/resources/daprConfig.properties
+53
-13
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TBusinessEmployeeExtendInfo.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
java.time.LocalDate
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
*
* @TableName t_business_employee_extend_info
*/
@TableName
(
value
=
"t_business_employee_extend_info"
)
@Data
@ToString
public
class
TBusinessEmployeeExtendInfo
extends
Model
<
TBusinessEmployeeExtendInfo
>
{
/**
* 主键
*/
@TableId
private
String
id
;
/**
* 身份证号码
*/
private
String
empIdcard
;
/**
* 姓名
*/
private
String
empName
;
/**
* 部门名称
*/
private
String
departName
;
/**
* 部门id
*/
private
Integer
departId
;
/**
* 部门编码 对应部门实体中的TreeLogo
*/
private
String
departCode
;
/**
* b端岗位
*/
private
String
businessPost
;
/**
* b端员工工号
*/
private
String
businessTelecomNumber
;
/**
* 标签,字典值(英文逗号分割)
*/
private
String
employeeTags
;
/**
* 第一学历和专业
*/
private
String
firstDegreeAndMajor
;
/**
* 第一学历院校
*/
private
String
firstDegreeGraduateSchool
;
/**
* 最高学历和专业
*/
private
String
highestDegreeAndMajor
;
/**
* 最高学历院校
*/
private
String
highestDegreeGraduateSchool
;
/**
* 联系方式
*/
private
String
contactInfo
;
/**
* 档案所在地
*/
private
String
archivesAddr
;
/**
* 0在职 1离职 3 临时
*/
private
String
businessWorkingStatus
;
/**
* B端维护的离职时间
*/
private
LocalDate
businessLeaveDate
;
/**
* B端维护的入职时间
*/
private
LocalDate
businessEnjoinDate
;
/**
* B端维护的离职原因
*/
private
String
businessLeaveReason
;
/**
* 0未删除 1已删除
*/
@TableLogic
private
String
deleteFlag
;
/**
* 证件类型
*/
private
String
documentType
;
/**
* @description: dto转实体
* @param dtoList
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo>
* @author: wangweiguo
* @date: 2021/8/10
*/
public
static
List
<
TBusinessEmployeeExtendInfo
>
covertDtoListToList
(
Collection
<?>
dtoList
)
{
return
dtoList
.
stream
().
map
(
o
->
{
TBusinessEmployeeExtendInfo
entity
=
new
TBusinessEmployeeExtendInfo
();
BeanUtil
.
copyProperties
(
o
,
entity
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
return
entity
;
}).
collect
(
Collectors
.
toList
());
}
@TableField
(
exist
=
false
)
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/BusinessEmployeeExtendByLeave.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
java.io.Serializable
;
/**
* @Author hgw
* @Date 2021-8-18 16:32:44
**/
@Getter
@Setter
@ToString
public
class
BusinessEmployeeExtendByLeave
implements
Serializable
{
/**
* b端员工工号
*/
private
String
businessTelecomNumber
;
/**
* 员工姓名
*/
private
String
empName
;
/**
* 身份证号码
*/
private
String
empIdcard
;
/**
* 部门名称
*/
private
String
departName
;
/**
* 部门id
*/
private
Integer
departId
;
/**
* b端岗位
*/
private
String
businessPost
;
/**
* 0在职 1离职 3 临时
*/
private
String
businessWorkingStatus
;
// B端部门treelogo
private
String
departCode
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/BusinessEmployeeExtendVO.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* @Author wangweiguo
* @Description BusinessEmployeeExtendVO
* @Date 21:15 2021/8/17
**/
@Getter
@Setter
@ToString
public
class
BusinessEmployeeExtendVO
implements
Serializable
{
/**
* 主键
*/
private
String
id
;
/**
* 员工姓名
*/
private
String
empName
;
/**
* 身份证号码
*/
private
String
empIdcard
;
/**
* 部门名称
*/
private
String
departName
;
/**
* 部门id
*/
private
Integer
departId
;
/**
* 部门编码 对应部门实体中的TreeLogo
*/
private
String
departCode
;
/**
* b端岗位
*/
private
String
businessPost
;
/**
* b端员工工号
*/
private
String
businessTelecomNumber
;
/**
* 标签,字典值(英文逗号分割)
*/
private
String
employeeTags
;
/**
* 第一学历和专业
*/
private
String
firstDegreeAndMajor
;
/**
* 第一学历院校
*/
private
String
firstDegreeGraduateSchool
;
/**
* 最高学历和专业
*/
private
String
highestDegreeAndMajor
;
/**
* 最高学历院校
*/
private
String
highestDegreeGraduateSchool
;
/**
* 联系方式
*/
private
String
contactInfo
;
/**
* 档案所在地
*/
private
String
archivesAddr
;
/**
* 0在职 1离职 3 临时
*/
private
String
businessWorkingStatus
;
/**
* B端维护的离职时间
*/
private
LocalDateTime
businessLeaveDate
;
/**
* B端维护的入职时间
*/
private
LocalDateTime
businessEnjoinDate
;
/**
* B端维护的离职原因
*/
private
String
businessLeaveReason
;
/**
* 0未删除 1已删除
*/
@TableLogic
private
String
deleteFlag
;
/**
* 证件类型
*/
private
String
documentType
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/UpdateBusinessEmployeeExtendDTO.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
/**
* @description: 更新人员信息拓展表dto
* @author: wangweiguo
* @date: 2021/8/10
*/
@Getter
@Setter
@ToString
public
class
UpdateBusinessEmployeeExtendDTO
implements
Serializable
{
/**
* 拓展表id
*/
@Schema
(
description
=
"拓展表id"
)
private
String
extendId
;
/**
* 身份证号码
*/
@Schema
(
description
=
"身份证号码"
)
@NotBlank
(
message
=
"身份证号码不能为空"
)
private
String
empIdcard
;
/**
* 姓名
*/
@Schema
(
description
=
"姓名"
)
private
String
empName
;
/**
* 部门名称
*/
@Schema
(
description
=
"部门名称"
)
@NotBlank
(
message
=
"部门名称不能为空"
)
@Length
(
max
=
50
,
message
=
"部门名称长度不超过50字符"
)
private
String
departName
;
/**
* 部门id
*/
@Schema
(
description
=
"部门id"
)
private
Integer
departId
;
/**
* 部门编码
*/
@Schema
(
description
=
"部门编码"
)
private
String
departCode
;
/**
* b端岗位
*/
@Schema
(
description
=
"b端岗位"
)
@Length
(
max
=
50
,
message
=
"岗位长度不超过50字符"
)
private
String
businessPost
;
/**
* b端员工工号
*/
@Schema
(
description
=
"电信工号"
)
@Length
(
max
=
20
,
message
=
"电信工号长度不超过20字符"
)
@NotBlank
(
message
=
"电信工号不能为空"
)
private
String
businessTelecomNumber
;
/**
* 标签,字典值(英文逗号分割)
*/
@Schema
(
description
=
"标签,字典值(英文逗号分割)"
)
private
String
employeeTags
;
/**
* 第一学历和专业
*/
@Schema
(
description
=
"第一学历和专业"
)
@Length
(
max
=
20
,
message
=
"第一学历和专业长度不超过20字符"
)
private
String
firstDegreeAndMajor
;
/**
* 第一学历院校
*/
@Schema
(
description
=
"第一学历院校"
)
@Length
(
max
=
20
,
message
=
"第一学历院校长度不超过20字符"
)
private
String
firstDegreeGraduateSchool
;
/**
* 最高学历和专业
*/
@Schema
(
description
=
"最高学历和专业"
)
@Length
(
max
=
20
,
message
=
"最高学历和专业长度不超过20字符"
)
private
String
highestDegreeAndMajor
;
/**
* 最高学历院校
*/
@Schema
(
description
=
"最高学历院校"
)
@Length
(
max
=
20
,
message
=
"最高学历院校长度不超过20字符"
)
private
String
highestDegreeGraduateSchool
;
/**
* 联系方式
*/
@Schema
(
description
=
"联系方式"
)
@Length
(
max
=
11
,
message
=
"联系方式长度不超过11字符"
)
@Pattern
(
regexp
=
"(?:(?:\\+|00)86)?1\\d{10}"
,
message
=
"联系方式格式错误"
)
@NotBlank
(
message
=
"联系方式不能为空"
)
private
String
contactInfo
;
/**
* 档案托管地
*/
@Schema
(
description
=
"档案托管地"
)
@Length
(
max
=
20
,
message
=
"档案托管地长度不超过20字符"
)
private
String
archivesAddr
;
/**
* B端维护的离职时间
*/
@Schema
(
description
=
"B端维护的离职时间"
)
private
LocalDate
businessLeaveDate
;
/**
* B端维护的入职时间
*/
@Schema
(
description
=
"B端维护的入职时间"
)
@NotNull
(
message
=
"入职时间不能为空"
)
private
LocalDate
businessEnjoinDate
;
@TableField
(
exist
=
false
)
private
static
final
long
serialVersionUID
=
1L
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/UpdateEmployeeExtendRedundancyDTO.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
/**
* @description: 更新人员信息冗余字段DTO
* @author: wangweiguo
* @date: 2021/8/12
*/
@Getter
@Setter
@ToString
public
class
UpdateEmployeeExtendRedundancyDTO
implements
Serializable
{
/**
* 身份证号
*/
private
String
empIdcard
;
/**
* 标签名称,英文逗号分割
*/
private
String
employeeTags
;
/**
* 离职日期
*/
private
LocalDate
businessLeaveDate
;
/**
* 离职原因
*/
private
String
businessLeaveReason
;
/**
* 在职状态 0在职 1离职 3临时
*/
private
String
businessWorkingStatus
;
/**
* 证件类型,英文逗号分割
*/
private
String
documentType
;
/**
* 部门id
*/
private
Integer
departId
;
/**
* 部门名称
*/
private
String
departName
;
/**
* 部门treeLogo
*/
private
String
treeLogo
;
/**
* 部门id真实值
*/
private
Integer
departIdVal
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/EmployeeBusinessController.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* B端员工档案相关接口
* @Author fxj
* @Date 2020-08-25
* @return
**/
@RestController
@AllArgsConstructor
@RequestMapping
(
value
=
"/customerBusiness/temployeeBusiness"
)
@Tag
(
name
=
"员工档案B端接口"
)
@Slf4j
public
class
EmployeeBusinessController
{
private
final
TEmployeeInfoService
tEmployeeInfoService
;
private
final
TEmployeeContractInfoService
tEmployeeContractInfoService
;
private
final
TBusinessEmployeeExtendInfoService
businessEmployeeExtendInfoService
;
// @ApiOperation(value = "B端花名册简单分页查询")
// @GetMapping("/page")
// public R<IPage<BusinessEmployeeExtendListVO>> getTEmployeeBusinessPage(Page page, THroBusinessUserQuery query) {
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail("请登录!");
// }
// if (!R.isSuccess(businessPowerCheck(query))) {
// return R.fail(businessPowerCheck(query).getMsg());
// }
// return new R<>(tEmployeeInfoService.getTEmployeeBusinessPage(page, query));
// }
//
// /**
// * 通过id查询单条记录
// *
// * @param id
// * @return R
// */
// @ApiOperation(value = "B端获取员工的相关信息")
// @GetMapping("/getEmployeeBusinessInfoById")
// public R<EmployeeBusinessDetailVo> getEmployeeBusinessInfoById(@RequestParam(value = "id",required = true) String id, @RequestParam("settleDomain") String settleDomain) {
// if (!Common.isNotKong(id)){
// return R.fail("员工ID不可为空!");
// }
// return new R<>(tEmployeeInfoService.getEmployeeBusinessInfoById(id, settleDomain));
// }
//
// /**
// * 通过id查询单条记录
// *
// * @param id
// * @return R
// */
// @ApiOperation(value = "B端获取员工及B端附属信息")
// @GetMapping("/getEmployeeBusinessVoById")
// public R<EmployeeBusinessVo> getEmployeeBusinessVoById(@RequestParam(value = "id",required = true) String id) {
// if (!Common.isNotKong(id)){
// return R.fail("员工ID不可为空!");
// }
// return tEmployeeInfoService.getEmployeeBusinessVoById(id);
// }
//
// /**
// * b端人员信息编辑拓展信息
// * @description: b端人员信息编辑拓展信息
// * @param dto
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @ApiOperation(value = "编辑:b端人员信息编辑拓展信息")
// @PutMapping("/updateEmployInfoByExtendId")
// public R<Boolean> updateEmployInfoByExtendId(@RequestBody @Valid UpdateBusinessEmployeeExtendDTO dto) {
// TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.getDataById(dto.getExtendId());
// if (null == tBusinessEmployeeExtendInfo) {
// tBusinessEmployeeExtendInfo = new TBusinessEmployeeExtendInfo();
// }
// tBusinessEmployeeExtendInfo.setId(dto.getExtendId());
// BeanUtil.copyProperties(dto, tBusinessEmployeeExtendInfo, CopyOptions.create().setIgnoreNullValue(true));
// if (StringUtils.isBlank(tBusinessEmployeeExtendInfo.getEmpName())) {
// TEmployeeInfo employeeInfo = this.tEmployeeInfoService.lambdaQuery().eq(TEmployeeInfo::getEmpIdcard, dto.getEmpIdcard()).last(CommonConstants.SQL_LIMIT_ONE).one();
// if (null != employeeInfo) {
// tBusinessEmployeeExtendInfo.setEmpName(employeeInfo.getEmpName());
// }
// }
// return businessEmployeeExtendInfoService.saveOrUpdateData(tBusinessEmployeeExtendInfo);
// }
//
// /**
// * b端人员信息批量导入更新人员信息拓展表
// * @description: 批量更新:b端人员信息批量导入更新人员信息拓展表
// * @param jsonStr
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @ApiOperation(value = "批量更新:b端人员信息批量导入更新人员信息拓展表")
// @PutMapping("/batchUpdateEmployeeExtendByJsonStr")
// public R<Boolean> batchUpdateEmployeeExtendByJsonStr(@RequestBody String jsonStr) {
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail(CommonConstants.USER_FAIL);
// }
// if (CollUtil.isEmpty(user.getSettleIdList())) {
// return R.fail(BasicCommonErrorMsg.NO_SETTLE_DOMAIN_AUTH);
// }
// List<TEmployeeInfo> employeeInfoList = tEmployeeInfoService.lambdaQuery().in(TEmployeeInfo::getSettleDomain, user.getSettleIdList()).list();
// if (CollUtil.isEmpty(employeeInfoList)) {
// return R.fail(HRO_EMPLOYEE_NULL);
// }
//
// HashMap<String, TEmployeeInfo> empInfoMap = Common.listToHashMapByKey(employeeInfoList, "empIdcard");
// return businessEmployeeExtendInfoService.batchUpdateEmployeeExtendByJsonStr(jsonStr, empInfoMap);
// }
//
// /**
// * b端人员信息导出
// * @description: 导出:b端人员信息导出
// * @param query
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @ApiOperation(value = "导出:b端人员信息导出")
// @GetMapping("/exportByParams")
// public R<List<BusinessEmployeeExtentExcelVO>> exportByParams(THroBusinessUserQuery query) {
// if (!R.isSuccess(businessPowerCheck(query))) {
// return R.fail(businessPowerCheck(query).getMsg());
// }
// return this.tEmployeeInfoService.exportByParams(query);
// }
/**
* 更新人员信息冗余字段
* @description: 更新人员信息冗余字段
* @param dto
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.List<ErrorMessage>>
* @author: wangweiguo
* @date: 2021/8/12
*/
@Inner
@PostMapping
(
"/inner/updateEmployeeExtendRedundancy"
)
public
Boolean
updateEmployeeExtendRedundancy
(
@RequestBody
UpdateEmployeeExtendRedundancyDTO
dto
)
{
return
this
.
businessEmployeeExtendInfoService
.
updateEmployeeExtendRedundancy
(
dto
);
}
// /**
// * 按身份证单个更新证件冗余信息
// * @author: fxj
// * @date 2021-08-23
// * @param dto
// * @return
// */
// @Inner
// @PostMapping("/inner/updateEmpExtendCertInfo")
// public R<String> updateEmpExtendCertInfo(@RequestBody UpdateEmployeeExtendRedundancyDTO dto) {
// return this.businessEmployeeExtendInfoService.updateEmpExtendCertInfo(dto);
// }
//
// /**
// * 根据身份证号获取拓展信息列表
// * @description: 根据身份证号获取拓展信息列表
// * @param idcardList
// * @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/16
// */
// @Inner
// @PostMapping("/inner/getListByIdcartList")
// public R<List<TBusinessEmployeeExtendInfo>> getListByIdcartList(@RequestBody List<String> idcardList) {
// if (CollUtil.isEmpty(idcardList)) {
// return R.fail("身份证号列表为空");
// }
// return this.businessEmployeeExtendInfoService.getListByIdcartList(idcardList);
// }
//
// /**
// * 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
// * @author: wangweiguo
// * @date: 2021/8/17
// */
// @Inner
// @GetMapping("/inner/getNotLeaveExtendList")
// public R<List<BusinessEmployeeExtendVO>> getNotLeaveExtendList() {
// return this.businessEmployeeExtendInfoService.getNotLeaveExtendList();
// }
//
// /**
// * 查询-列表:内部服务调用,获取所有员工拓展表信息
// * @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @return: R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/25
// */
// @Inner
// @GetMapping("/inner/getAllExtendList")
// public R<List<TBusinessEmployeeExtendInfo>> getAllExtendList() {
// List<TBusinessEmployeeExtendInfo> list = this.businessEmployeeExtendInfoService.list();
// return R.success(CommonConstants.SEARCH_SUCCESS, list);
// }
//
// /**
// * 查询-列表:内部服务调用,根据电工编号查询扩展表信息
// * @return: R<TBusinessEmployeeExtendInfo>
// * @author: wangweiguo
// * @date: 2021/8/31
// */
// @GetMapping("/inner/getExtendByBusinessTelecomNumber")
// R<TBusinessEmployeeExtendInfo> getExtendByBusinessTelecomNumber(@RequestParam("businessTelecomNumber") String businessTelecomNumber) {
// TBusinessEmployeeExtendInfo businessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.lambdaQuery()
// .eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber)
// .last(CommonConstants.SQL_LIMIT_ONE)
// .one();
// return R.success(CommonConstants.SEARCH_SUCCESS, businessEmployeeExtendInfo);
// }
//
// /**
// * @param
// * @Description: 获取所有附属信息
// * @Author: hgw
// * @Date: 2021/8/18 16:46
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
// **/
// @Inner
// @GetMapping("/inner/getInfoByLeaveMap")
// public R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap() {
// return this.businessEmployeeExtendInfoService.getInfoByLeaveMap();
// }
//
//
// /**
// * @description: 校验数据权限
// * @param query
// * @return: com.yifu.cloud.v1.common.core.util.R
// * @author: wangweiguo
// * @date: 2021/8/11
// */
// private R businessPowerCheck(THroBusinessUserQuery query) {
// ExtendUser user = SecurityUtils.getUser();
// if (null == query){
// query = new THroBusinessUserQuery();
// }
// // 如果有姓名 按姓名查询 清空结算主体(产品要求结算主体和姓名查询互斥)
// // hrob2.0 去掉该判断,因为能查到不是b端的人员信息 --wwg 2021-08-12
//// if (Common.isNotKong(query.getEmpName())){
//// query.setSettleDomainId(null);
//// return R.success("success");
//// }
// List<String> settleDomainIds = new ArrayList<>();
// boolean flag = !SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user);
// if (flag){
// settleDomainIds = user.getSettleIdList();
// if (Common.isEmpty(settleDomainIds)) {
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// query.setSettleDomainIds(settleDomainIds);
// if (Common.isNotKong(query.getSettleDomainId())){
// // 无权限提示 有权限 按结算主体/项目ID 查询
// if (ServiceUtil.checkUserAuth(query.getSettleDomainId(),settleDomainIds)){
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// }
// // 管理员权限特殊处理
// }else {
// if (Common.isEmpty(query.getSettleDomainId()) && Common.isEmpty(query.getDepartId())){
// return R.fail("项目和部门不可同时为空");
// }
// }
// if (Common.isNotKong(settleDomainIds)){
// query.setSettleDomainIds(settleDomainIds);
// }
// return R.success("success");
// }
//
// /**
// * B端合同列表查询接口
// * @Author fxj
// * @Date 2020-08-25
// * @param page
// * @param contractBusinessPageVo
// * @param flag 0 按3个月内到期提醒 1 不安提醒查询
// * @return
// * @see com.yifu.cloud.v1.hr.basicArchives.controller
// **/
// @ApiOperation(value = "B端合同列表查询接口(flag: 0-按3个月内到期提醒 1-不安提醒查询)")
// @GetMapping("/getContractBusinessPage")
// public R<IPage<EmpContractBusinessPageVo>> getContractBusinessPage(Page<EmpContractBusinessPageVo> page, EmpContractBusinessPageVo contractBusinessPageVo, Integer flag) {
// if (null == flag){
// flag = 1;
// }
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail("请登录!");
// }
// if (null == contractBusinessPageVo){
// contractBusinessPageVo = new EmpContractBusinessPageVo();
// }
// contractBusinessPageVo.setIsObsolete(CommonConstants.ZERO);
// // 如果有姓名 按姓名查询 清空结算主体(产品要求结算主体和姓名查询互斥)
// if (Common.isNotKong(contractBusinessPageVo.getEmpName())){
// contractBusinessPageVo.setSettleDomain(null);
// }
// List<String> settleDomainIds = new ArrayList<>();
// if (!SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user)){
// settleDomainIds = user.getSettleIdList();
// if (Common.isEmpty(settleDomainIds)) {
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// if (Common.isNotKong(contractBusinessPageVo.getSettleDomain())){
// // 无权限提示 有权限 按结算主体/项目ID 查询
// if (ServiceUtil.checkUserAuth(contractBusinessPageVo.getSettleDomain(),settleDomainIds)){
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// settleDomainIds = null;
// }
// // 管理员权限特殊处理
// }else {
// if (Common.isEmpty(contractBusinessPageVo.getSettleDomain())){
// return new R<>(null);
// }
// }
// return new R<>(tEmployeeContractInfoService.getContractBusinessPage(page, contractBusinessPageVo, settleDomainIds, flag));
// }
//
// /**
// * B端查询合同到期提醒数(查询3个月内到期的合同)
// * @Author fxj
// * @Date 2020-08-25
// * @param
// * @return
// * @see com.yifu.cloud.v1.hr.basicArchives.controller
// **/
// @ApiOperation(value = "B端查询合同到期提醒数(查询3个月内到期的合同)")
// @GetMapping("/getContractBusinessAlertCount")
// public R<Integer> getContractBusinessAlertCount() {
// ExtendUser user = SecurityUtils.getUser();
// if (user == null) {
// return R.fail("请登录!");
// }
// List<String> settleDomainIds = new ArrayList<>();
// if (!SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user)){
// settleDomainIds = user.getSettleIdList();
// if (settleDomainIds == null || settleDomainIds.isEmpty()) {
// return R.fail(EmpBusinessConstants.noSettleDomainAuth);
// }
// }
// return new R<>(tEmployeeContractInfoService.getContractBusinessAlertCount(settleDomainIds));
// }
//
// /**
// * B端查询对应员工指定合同ID之外的其他合同信息
// * @Author fxj
// * @Date 2020-08-25
// * @param empId
// * @param contractId
// * @return
// * @see com.yifu.cloud.v1.hr.basicArchives.controller
// **/
// @ApiOperation(value = "B端查询对应员工指定合同ID之外的其他合同信息")
// @GetMapping("/getOtherContractBusinessInfo")
// public R<List<EmpContractBusinessPageVo>> getOtherContractBusinessInfo(@RequestParam(value = "empId",required = true)String empId,@RequestParam(value = "contractId", required = true)String contractId) {
// return new R<>(tEmployeeContractInfoService.getOtherContractBusinessInfo(empId,contractId));
// }
//
// /**
// * @param businessTelecomNumber
// * @Description: 根据电信编号,获取附属信息
// * @Author: hgw
// * @Date: 2021/8/18 17:06
// * @return: com.yifu.cloud.v1.common.core.util.R<com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo>
// **/
// @ApiOperation(value = "根据电信编号,获取附属信息")
// @GetMapping("/getByBusinessTelecomNumber")
// public R<TBusinessEmployeeExtendInfo> getByBusinessTelecomNumber(@RequestParam String businessTelecomNumber) {
// return new R<>(businessEmployeeExtendInfoService.getByBusinessTelecomNumber(businessTelecomNumber));
// }
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TBusinessEmployeeExtendInfoMapper.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendByLeave
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendVO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @description: b端员工信息拓展信息 mapper
* @author: wangweiguo
* @date: 2021/8/6
* @Entity com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
*/
public
interface
TBusinessEmployeeExtendInfoMapper
extends
BaseMapper
<
TBusinessEmployeeExtendInfo
>
{
List
<
BusinessEmployeeExtendVO
>
getNotLeaveExtendList
();
/**
* @param
* @Description: 获取所有扩展信息
* @Author: hgw
* @Date: 2021/8/18 16:41
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>
**/
List
<
BusinessEmployeeExtendByLeave
>
getInfoByLeaveList
();
TBusinessEmployeeExtendInfo
getDataByEmpIdcard
(
@Param
(
"empIdcard"
)
String
empIdcard
);
TBusinessEmployeeExtendInfo
getDataById
(
@Param
(
"extendId"
)
String
extendId
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TBusinessEmployeeExtendInfoService.java
0 → 100644
View file @
44b3b966
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.TBusinessEmployeeExtendInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO
;
/**
* @description: b端员工信息拓展信息 service
* @author: wangweiguo
* @date: 2021/8/6
*/
public
interface
TBusinessEmployeeExtendInfoService
extends
IService
<
TBusinessEmployeeExtendInfo
>
{
// /**
// * @description: 根据身份证号查询人员拓展表信息
// * @param empIdcard 身份证号
// * @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// TBusinessEmployeeExtendInfo getByEmpIdCard(String empIdcard);
//
// /**
// * @param businessTelecomNumber
// * @Description: 根据工号返回附属信息
// * @Author: hgw
// * @Date: 2021/8/18 17:03
// * @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
// **/
// TBusinessEmployeeExtendInfo getByBusinessTelecomNumber(String businessTelecomNumber);
//
// /**
// * 根据jsonStr批量更新人员信息拓展表信息
// * @description:
// * @param jsonStr
// * @param empInfoMap
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// R<Boolean> batchUpdateEmployeeExtendByJsonStr(String jsonStr, HashMap<String, TEmployeeInfo> empInfoMap);
/**
* 更新人员信息冗余字段
* @description: 更新人员信息冗余字段
* @param dto
* @return: Boolean
* @author: wangweiguo
* @date: 2021/8/12
*/
Boolean
updateEmployeeExtendRedundancy
(
UpdateEmployeeExtendRedundancyDTO
dto
);
// /**
// * 根据身份证号获取拓展信息列表
// * @description: 根据身份证号获取拓展信息列表
// * @param idcardList
// * @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/16
// */
// R<List<TBusinessEmployeeExtendInfo>> getListByIdcartList(List<String> idcardList);
//
// /**
// * 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
// * @author: wangweiguo
// * @date: 2021/8/17
// */
// R<List<BusinessEmployeeExtendVO>> getNotLeaveExtendList();
//
// /**
// * @param
// * @Description: 获取所有附属信息
// * @Author: hgw
// * @Date: 2021/8/18 16:45
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
// **/
// R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap();
//
// /**
// * b端人员信息编辑拓展信息
// * @description: b端人员信息编辑拓展信息
// * @param tBusinessEmployeeExtendInfo 实体
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/19
// */
// R<Boolean> saveOrUpdateData(TBusinessEmployeeExtendInfo tBusinessEmployeeExtendInfo);
//
// R<String> updateEmpExtendCertInfo(UpdateEmployeeExtendRedundancyDTO dto);
//
// TBusinessEmployeeExtendInfo getDataById(String extendId);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TBusinessEmployeeExtendInfoServiceImpl.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TBusinessEmployeeExtendInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.AllArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @description: b端员工信息拓展信息 service实现
* @author: wangweiguo
* @date: 2021/8/6
*/
@Service
@AllArgsConstructor
public
class
TBusinessEmployeeExtendInfoServiceImpl
extends
ServiceImpl
<
TBusinessEmployeeExtendInfoMapper
,
TBusinessEmployeeExtendInfo
>
implements
TBusinessEmployeeExtendInfoService
{
// private final ObjectMapper objectMapper;
// /**
// * @description: 根据身份证号查询人员拓展表信息
// * @param empIdcard 身份证号
// * @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @Override
// public TBusinessEmployeeExtendInfo getByEmpIdCard(String empIdcard) {
// if (StringUtils.isNotBlank(empIdcard)) {
// return this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getEmpIdcard, empIdcard).last(CommonConstants.SQL_LIMIT_ONE).one();
// }
// return null;
// }
//
// /**
// * @param businessTelecomNumber
// * @Description: 根据电信工号获取详情
// * @Author: hgw
// * @Date: 2021/8/18 17:04
// * @return: com.yifu.cloud.v1.hrms.api.entity.basic.TBusinessEmployeeExtendInfo
// **/
// @Override
// public TBusinessEmployeeExtendInfo getByBusinessTelecomNumber(String businessTelecomNumber) {
// if (StringUtils.isNotBlank(businessTelecomNumber)) {
// return this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber).last(CommonConstants.SQL_LIMIT_ONE).one();
// }
// return null;
// }
//
// /**
// * 根据jsonStr批量更新人员信息拓展表信息
// * @description:
// * @param jsonStr
// * @param empInfoMap
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/10
// */
// @Override
// public R<Boolean> batchUpdateEmployeeExtendByJsonStr(String jsonStr, HashMap<String, TEmployeeInfo> empInfoMap) {
// List<UpdateBusinessEmployeeExtendDTO> list = null;
// List<ErrorMessage> errorMessageList = new ArrayList<>();
// try {
// list = objectMapper.readValue(jsonStr, new TypeReference<List<UpdateBusinessEmployeeExtendDTO>>(){});
// } catch (InvalidFormatException e) {
// e.printStackTrace();
// if (e.getCause().toString().contains("DateTimeParseException")) {
// errorMessageList.add(new ErrorMessage(e.getPath().get(0).getIndex() + 2, JSON_DATE_RESOLVER_ERROR.concat("错误值:" + e.getValue().toString())));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// errorMessageList.add(new ErrorMessage(e.getPath().get(0).getIndex() + 2, JSON_RESOLVER_ERROR.concat(e.getCause().toString())));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// } catch (Exception e) {
// e.printStackTrace();
// errorMessageList.add(new ErrorMessage(null, e.getCause().toString()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (!CollUtil.isEmpty(list)) {
// List<TBusinessEmployeeExtendInfo> dtoList = new ArrayList<>();
// R<List<TBusDept>> busDeptListR = remoteBusDeptService.getTBusDeptList(SecurityConstants.FROM_IN);
// R<List<TBusLable>> busLableListR = remoteBusLableService.getTBusLableList(SecurityConstants.FROM_IN);
// if (!R.isSuccess(busDeptListR)) {
// errorMessageList.add(new ErrorMessage(null, busDeptListR.getMsg()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (!R.isSuccess(busLableListR)) {
// errorMessageList.add(new ErrorMessage(null,busLableListR.getMsg()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (CollUtil.isEmpty(busDeptListR.getData())) {
// errorMessageList.add(new ErrorMessage(null, DEPT_LIST_IS_NULL));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
// if (CollUtil.isEmpty(busLableListR.getData())) {
// errorMessageList.add(new ErrorMessage(null, LABEL_LIST_IS_NULL));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL,false , errorMessageList);
// }
//
// List<ErrorMessage> beforeErrorMessageList = Common.commonImportErrorMessage(list);
// HashMap<String, TBusDept> busDeptMap = Common.listToHashMapByKey(busDeptListR.getData(), "name");
// HashMap<String, TBusLable> busLableMap = Common.listToHashMapByKey(busLableListR.getData(), "name");
// HashMap<String, ErrorMessage> errorMessageHashMap = Common.listToHashMapByKey(beforeErrorMessageList, "line");
//
// List<TBusinessEmployeeExtendInfo> employeeExtendInfoList = TBusinessEmployeeExtendInfo.covertDtoListToList(list);
// // 导入数据校验
// errorMessageList.addAll(beforeErrorMessageList);
// // 数据导入
// for (int i = 0; i < employeeExtendInfoList.size(); i++) {
// boolean isSave = true;
// int line = i + 2;
// TBusinessEmployeeExtendInfo v = employeeExtendInfoList.get(i);
// TBusinessEmployeeExtendInfo entity = this.baseMapper.getDataByEmpIdcard(v.getEmpIdcard());
// if (null != entity) {
// v.setId(entity.getId());
// v.setEmpName(entity.getEmpName());
// }
// if (busDeptMap.containsKey(v.getDepartName())) {
// TBusDept busDept = busDeptMap.get(v.getDepartName());
// v.setDepartCode(busDept.getTreeLogo());
// v.setDepartId(busDept.getId());
// }
// ErrorMessage errorMessage = errorMessageHashMap.get(line + "");
// if (errorMessage != null) {
// continue;
// }
// // 部门是否存在判断
// if (!busDeptMap.containsKey(v.getDepartName())) {
// errorMessageList.add(new ErrorMessage(line, DEPT_NAME_IS_NOT_EXIST));
// isSave = false;
// }
// // 身份证是否存在hro系统判断
// if (!empInfoMap.containsKey(v.getEmpIdcard())) {
// errorMessageList.add(new ErrorMessage(line, ID_CARD_IS_NOT_EXIST));
// isSave = false;
// }
//
// // 标签判断,并处理
// if (StringUtils.isNotBlank(v.getEmployeeTags())) {
// List<String> tagList = new ArrayList<>();
// String[] tags = v.getEmployeeTags().split(",");
// for (String tag : tags) {
// TBusLable tBusLable = busLableMap.get(tag);
// if (null != tBusLable) {
// if (tBusLable.getStatus() != 0) {
// errorMessageList.add(new ErrorMessage(line, "[" + tBusLable.getName() + "]" + TAG_IS_BANED));
// isSave = false;
// }
// if (tBusLable.getStatus() == 0) {
// tagList.add(String.valueOf(tBusLable.getId()));
// } else {
// tagList.clear();
// }
// } else {
// errorMessageList.add(new ErrorMessage(line, "[" + tag + "]" + TAG_IS_NOT_EXIST));
// isSave = false;
// }
// }
//
// if (!CollUtil.isEmpty(tagList) && tagList.size() > 10) {
// errorMessageList.add(new ErrorMessage(line, EMPLOYEE_TAGS_EXCEED));
// isSave = false;
// }
// // 处理标签格式化
// List<String> tagFormatList = new ArrayList<>();
// if (!CollUtil.isEmpty(tagList)) {
// tagList.forEach(tag -> tagFormatList.add(String.format("%04d", Integer.valueOf(tag))));
// v.setEmployeeTags(StringUtils.join(tagFormatList, ","));
// } else if (null != entity){
// v.setEmployeeTags(entity.getEmployeeTags());
// }
// }
// try {
// // 校验电信编号是否重复
// if (existBusinessTelecomNumber(v)) {
// errorMessageList.add(new ErrorMessage(line, TELECOMNUMBER_IS_EXIST));
// continue;
// }
// // 冗余的字段,岗位,工号变更要同步过去
// if (null != entity && isUpdateRedundancy(v, entity)) {
// dtoList.add(v);
// }
// if (!isSave) {
// continue;
// }
// boolean isSuccess = this.saveOrUpdate(v);
// if (!isSuccess) {
// errorMessageList.add(new ErrorMessage(line, CommonConstants.DATA_UPDATE_FAIL));
// } else {
// errorMessageList.add(new ErrorMessage(line, CommonConstants.UPDATE_DATA_SUCCESS, CommonConstants.GREEN));
// }
// } catch (Exception e) {
// errorMessageList.add(new ErrorMessage(null, BATCH_USER_EXTEND_DATA_ERROR + ":" + e.getCause().toString()));
// return R.fail(CommonConstants.DATA_UPDATE_FAIL, BATCH_USER_EXTEND_DATA_ERROR + ":" + e.getCause().toString());
// }
// }
// this.updateRedundancyEmployeeFields(dtoList);
// }
// if (CollUtil.isEmpty(errorMessageList)) {
// return R.success(CommonConstants.NO_DATA_TO_HANDLE, true, errorMessageList);
// }
// return R.success(CommonConstants.RESULT_DATA_SUCCESS, true, errorMessageList);
// }
//
// /**
// * 是否更新冗余字段
// * @param v 当前值
// * @param entity 原有值
// * @return boolean
// */
// private boolean isUpdateRedundancy(TBusinessEmployeeExtendInfo v, TBusinessEmployeeExtendInfo entity) {
// if (!StringUtils.equals(v.getBusinessTelecomNumber(), entity.getBusinessTelecomNumber())
// || !StringUtils.equals(v.getBusinessPost(), entity.getBusinessPost())
// || !StringUtils.equals(v.getEmpName(), entity.getEmpName())
// || !(Objects.equals(v.getDepartId(), entity.getDepartId()))
// ){
// return true;
// }
// return false;
// }
/**
* 更新人员信息冗余字段
* @description: 更新人员信息冗余字段
* @param v
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.List<ErrorMessage>>
* @author: wangweiguo
* @date: 2021/8/12
*/
@Override
public
Boolean
updateEmployeeExtendRedundancy
(
UpdateEmployeeExtendRedundancyDTO
v
)
{
if
(
Common
.
isEmpty
(
v
))
{
return
false
;
}
// 根据部门id更新冗余的部门信息
if
(
null
!=
v
.
getDepartId
())
{
this
.
lambdaUpdate
()
.
eq
(
TBusinessEmployeeExtendInfo:
:
getDepartId
,
v
.
getDepartId
())
.
set
(
TBusinessEmployeeExtendInfo:
:
getDepartName
,
v
.
getDepartName
())
.
set
(
TBusinessEmployeeExtendInfo:
:
getDepartCode
,
v
.
getTreeLogo
())
.
set
(
TBusinessEmployeeExtendInfo:
:
getDepartId
,
v
.
getDepartIdVal
())
.
update
();
}
else
{
if
(
StringUtils
.
isBlank
(
v
.
getEmpIdcard
()))
{
return
false
;
}
v
.
setEmployeeTags
(
formatLabelId
(
v
.
getEmployeeTags
()));
// 身份证号更新冗余的离职,标签,证件相关信息
this
.
lambdaUpdate
()
.
eq
(
TBusinessEmployeeExtendInfo:
:
getEmpIdcard
,
v
.
getEmpIdcard
())
.
set
(
null
!=
v
.
getEmployeeTags
(),
TBusinessEmployeeExtendInfo:
:
getEmployeeTags
,
v
.
getEmployeeTags
())
.
set
(
null
!=
v
.
getBusinessLeaveReason
(),
TBusinessEmployeeExtendInfo:
:
getBusinessLeaveReason
,
v
.
getBusinessLeaveReason
())
.
set
(
null
!=
v
.
getBusinessWorkingStatus
(),
TBusinessEmployeeExtendInfo:
:
getBusinessWorkingStatus
,
v
.
getBusinessWorkingStatus
())
.
set
(
null
!=
v
.
getDocumentType
(),
TBusinessEmployeeExtendInfo:
:
getDocumentType
,
v
.
getDocumentType
())
.
set
(
null
!=
v
.
getBusinessLeaveDate
(),
TBusinessEmployeeExtendInfo:
:
getBusinessLeaveDate
,
v
.
getBusinessLeaveDate
())
.
update
();
}
return
true
;
}
// /**
// * 根据身份证号获取拓展信息列表
// * @description: 根据身份证号获取拓展信息列表
// * @param idcardList
// * @return: com.yifu.cloud.v1.common.core.util.R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo
// * @date: 2021/8/16
// */
// @Override
// public R<List<TBusinessEmployeeExtendInfo>> getListByIdcartList(List<String> idcardList) {
// List<TBusinessEmployeeExtendInfo> list = this.lambdaQuery().in(TBusinessEmployeeExtendInfo::getEmpIdcard, idcardList).list();
// return R.success(CommonConstants.SEARCH_SUCCESS, list);
// }
//
// /**
// * 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendVO>>
// * @author: wangweiguo
// * @date: 2021/8/17
// */
// @Override
// public R<List<BusinessEmployeeExtendVO>> getNotLeaveExtendList() {
// List<BusinessEmployeeExtendVO> list = this.baseMapper.getNotLeaveExtendList();
// return R.success(CommonConstants.SEARCH_SUCCESS, list);
// }
//
// /**
// * @param
// * @Description: 获取所有扩展信息-不要离职的
// * @Author: hgw
// * @Date: 2021/8/18 16:41
// * @return: com.yifu.cloud.v1.common.core.util.R<java.util.Map < java.lang.String, com.yifu.cloud.v1.hrms.api.vo.basic.BusinessEmployeeExtendByLeave>>
// **/
// @Override
// public R<Map<String, BusinessEmployeeExtendByLeave>> getInfoByLeaveMap() {
// List<BusinessEmployeeExtendByLeave> list = this.baseMapper.getInfoByLeaveList();
// Map<String, BusinessEmployeeExtendByLeave> leaveMap = new HashMap<>();
// if (list != null && !list.isEmpty()) {
// for (BusinessEmployeeExtendByLeave leave : list) {
// leaveMap.put(leave.getBusinessTelecomNumber(), leave);
// }
// }
// return new R<>(leaveMap);
// }
//
// /**
// * b端人员信息编辑拓展信息
// * @description: b端人员信息编辑拓展信息
// * @param entity 实体
// * @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
// * @author: wangweiguo
// * @date: 2021/8/19
// */
// @Override
// public R<Boolean> saveOrUpdateData(TBusinessEmployeeExtendInfo entity) {
// if (existBusinessTelecomNumber(entity)) {
// return R.fail(TELECOMNUMBER_IS_EXIST);
// }
//
// // 标签id格式化
// entity.setEmployeeTags(BusinessCommonUtils.formatLabelId(entity.getEmployeeTags()));
// int tagSize = StringUtils.split(entity.getEmployeeTags(), ",").length;
// if (tagSize > 10) {
// return R.fail(EMPLOYEE_TAGS_EXCEED);
// }
// boolean isSuccess = this.saveOrUpdate(entity);
// if (isSuccess) {
// this.updateRedundancyEmployeeFields(CollUtil.newArrayList(entity));
// }
// return R.success(CommonConstants.RESULT_DATA_SUCCESS, isSuccess);
// }
//
// @LcnTransaction
// @Override
// public R<String> updateEmpExtendCertInfo(UpdateEmployeeExtendRedundancyDTO v) {
// if (Common.isEmpty(v)) {
// return R.fail(CommonConstants.NO_DATA_TO_HANDLE);
// }
// // 根据部门id更新冗余的部门信息
// if (null != v.getDepartId()) {
// this.lambdaUpdate()
// .eq(TBusinessEmployeeExtendInfo::getDepartId, v.getDepartId())
// .set(TBusinessEmployeeExtendInfo::getDepartName, v.getDepartName())
// .set(TBusinessEmployeeExtendInfo::getDepartCode, v.getTreeLogo())
// .update();
// } else {
// if (StringUtils.isBlank(v.getEmpIdcard())) {
// return R.fail(ID_CARD_IS_NULL);
// }
// // 身份证号更新冗余的离职,标签,证件相关信息
// boolean isSuccess = this.lambdaUpdate()
// .eq(TBusinessEmployeeExtendInfo::getEmpIdcard, v.getEmpIdcard())
// .set(TBusinessEmployeeExtendInfo::getDocumentType, v.getDocumentType())
// .update();
// if (!isSuccess) {
// return R.fail(CommonConstants.UPDATE_DATA_FAIL);
// }
// }
// return R.success(CommonConstants.RESULT_DATA_SUCCESS);
// }
//
// @Override
// public TBusinessEmployeeExtendInfo getDataById(String extendId) {
// return this.baseMapper.getDataById(extendId);
// }
//
// /**
// * @description: 是否存在电信编号
// * @param info 实体
// * @return: boolean
// * @author: wangweiguo
// * @date: 2021/8/19
// */
// private boolean existBusinessTelecomNumber(TBusinessEmployeeExtendInfo info) {
// TBusinessEmployeeExtendInfo entity = this.lambdaQuery().eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, info.getBusinessTelecomNumber()).last(CommonConstants.SQL_LIMIT_ONE).one();
// if (null != entity && !StringUtils.equals(entity.getId(), info.getId())) {
// return true;
// }
// return false;
// }
//
// /**
// * @description: 更新其他表冗余字段
// * @param list
// * @return: void
// * @author: wangweiguo
// * @date: 2021/8/23
// */
// private void updateRedundancyEmployeeFields(List<TBusinessEmployeeExtendInfo> list) {
// List<UpdateVacationRedundancyDTO> dtoList = new ArrayList<>();
// if (!CollUtil.isEmpty(list)) {
// list.forEach(v -> {
// UpdateVacationRedundancyDTO dto = new UpdateVacationRedundancyDTO(v.getEmpIdcard(), v.getEmpName(), v.getBusinessTelecomNumber(), v.getBusinessPost(), v.getDepartId(),v.getEmployeeTags());
// dtoList.add(dto);
// });
// this.remoteVacationMonitorService.updateRedundancyEmployeeFields(dtoList, SecurityConstants.FROM_IN);
// this.remoteVacationInfoService.updateRedundancyEmployeeFields(dtoList, SecurityConstants.FROM_IN);
// remoteBusCertService.updateRedundancyEmpOfCert(dtoList,SecurityConstants.FROM_IN);
// }
// }
/**
* 格式化标签id
*
* @param employeeTags 标签字符串,英文逗号分割
* @return: java.lang.String
* @author: wangweiguo
* @date: 2021/8/19
*/
public
static
String
formatLabelId
(
String
employeeTags
)
{
// 标签id格式化处理
String
[]
tags
=
StringUtils
.
split
(
employeeTags
,
","
);
List
<
String
>
tagList
=
new
ArrayList
<>();
if
(
null
!=
tags
)
{
for
(
String
tag
:
tags
)
{
tagList
.
add
(
String
.
format
(
CommonConstants
.
TAG_FROMAT
,
Integer
.
valueOf
(
tag
)));
}
}
return
StringUtils
.
join
(
tagList
,
","
);
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TBusinessEmployeeExtendInfoMapper.xml
0 → 100644
View file @
44b3b966
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.archives.mapper.TBusinessEmployeeExtendInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendVO"
>
<id
property=
"id"
column=
"ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"empIdcard"
column=
"EMP_IDCARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"empName"
column=
"EMP_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"departName"
column=
"DEPART_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"departId"
column=
"DEPART_ID"
jdbcType=
"INTEGER"
/>
<result
property=
"departCode"
column=
"DEPART_CODE"
jdbcType=
"VARCHAR"
/>
<result
property=
"businessPost"
column=
"BUSINESS_POST"
jdbcType=
"VARCHAR"
/>
<result
property=
"businessTelecomNumber"
column=
"BUSINESS_TELECOM_NUMBER"
jdbcType=
"VARCHAR"
/>
<result
property=
"employeeTags"
column=
"EMPLOYEE_TAGS"
jdbcType=
"VARCHAR"
/>
<result
property=
"firstDegreeAndMajor"
column=
"FIRST_DEGREE_AND_MAJOR"
jdbcType=
"VARCHAR"
/>
<result
property=
"firstDegreeGraduateSchool"
column=
"FIRST_DEGREE_GRADUATE_SCHOOL"
jdbcType=
"VARCHAR"
/>
<result
property=
"highestDegreeAndMajor"
column=
"HIGHEST_DEGREE_AND_MAJOR"
jdbcType=
"VARCHAR"
/>
<result
property=
"highestDegreeGraduateSchool"
column=
"HIGHEST_DEGREE_GRADUATE_SCHOOL"
jdbcType=
"VARCHAR"
/>
<result
property=
"contactInfo"
column=
"CONTACT_INFO"
jdbcType=
"VARCHAR"
/>
<result
property=
"archivesAddr"
column=
"ARCHIVES_ADDR"
jdbcType=
"VARCHAR"
/>
<result
property=
"businessWorkingStatus"
column=
"BUSINESS_WORKING_STATUS"
jdbcType=
"CHAR"
/>
<result
property=
"documentType"
column=
"DOCUMENT_TYPE"
jdbcType=
"VARCHAR"
/>
<result
property=
"businessLeaveDate"
column=
"BUSINESS_LEAVE_DATE"
/>
<result
property=
"businessEnjoinDate"
column=
"BUSINESS_ENJOIN_DATE"
/>
<result
property=
"businessLeaveReason"
column=
"BUSINESS_LEAVE_REASON"
jdbcType=
"VARCHAR"
/>
<result
property=
"deleteFlag"
column=
"DELETE_FLAG"
jdbcType=
"CHAR"
/>
</resultMap>
<!-- 离职信息导入获取 -->
<resultMap
id=
"LeaveResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.vo.BusinessEmployeeExtendByLeave"
>
<result
property=
"businessTelecomNumber"
column=
"BUSINESS_TELECOM_NUMBER"
jdbcType=
"VARCHAR"
/>
<result
property=
"empIdcard"
column=
"EMP_IDCARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"empName"
column=
"EMP_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"departName"
column=
"DEPART_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"departId"
column=
"DEPART_ID"
jdbcType=
"INTEGER"
/>
<result
property=
"businessPost"
column=
"BUSINESS_POST"
jdbcType=
"VARCHAR"
/>
<result
property=
"businessWorkingStatus"
column=
"BUSINESS_WORKING_STATUS"
jdbcType=
"CHAR"
/>
<result
property=
"departCode"
column=
"DEPART_CODE"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.ID,
a.EMP_IDCARD,
a.EMP_NAME,
a.DEPART_NAME,
a.DEPART_ID,
a.BUSINESS_POST,
a.BUSINESS_TELECOM_NUMBER,
a.BUSINESS_ENJOIN_DATE,
a.EMPLOYEE_TAGS,
a.FIRST_DEGREE_AND_MAJOR,
a.FIRST_DEGREE_GRADUATE_SCHOOL,
a.BUSINESS_LEAVE_DATE,
a.BUSINESS_LEAVE_REASON,
a.HIGHEST_DEGREE_AND_MAJOR,
a.HIGHEST_DEGREE_GRADUATE_SCHOOL,
a.CONTACT_INFO,
a.BUSINESS_WORKING_STATUS,
a.DOCUMENT_TYPE,
a.ARCHIVES_ADDR
</sql>
<select
id=
"getNotLeaveExtendList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from hrms.t_business_employee_extend_info a
<where>
1=1
and a.BUSINESS_WORKING_STATUS
<![CDATA[<>]]>
'1'
and a.DELETE_FLAG = '0'
</where>
</select>
<!-- hgw 2021-8-18 16:41:01 获取所有扩展信息 -->
<select
id=
"getInfoByLeaveList"
resultMap=
"LeaveResultMap"
>
select
a.BUSINESS_TELECOM_NUMBER,
a.EMP_IDCARD,
a.EMP_NAME,
a.DEPART_NAME,
a.DEPART_ID,
a.BUSINESS_POST,
a.BUSINESS_WORKING_STATUS,
a.DEPART_CODE
from t_business_employee_extend_info a
where a.BUSINESS_TELECOM_NUMBER is not null
GROUP BY a.BUSINESS_TELECOM_NUMBER
</select>
<select
id=
"getDataByEmpIdcard"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo"
>
select
a.ID,
a.EMP_IDCARD,
b.EMP_NAME,
a.DEPART_NAME,
a.DEPART_ID,
a.BUSINESS_POST,
a.BUSINESS_TELECOM_NUMBER,
a.BUSINESS_ENJOIN_DATE,
a.EMPLOYEE_TAGS,
a.FIRST_DEGREE_AND_MAJOR,
a.FIRST_DEGREE_GRADUATE_SCHOOL,
a.BUSINESS_LEAVE_DATE,
a.BUSINESS_LEAVE_REASON,
a.HIGHEST_DEGREE_AND_MAJOR,
a.HIGHEST_DEGREE_GRADUATE_SCHOOL,
a.CONTACT_INFO,
a.BUSINESS_WORKING_STATUS,
a.DOCUMENT_TYPE,
a.ARCHIVES_ADDR
from hrms.t_business_employee_extend_info a
left join hrms.t_employee_info b on a.EMP_IDCARD = b.EMP_IDCARD
where 1=1
and a.EMP_IDCARD = #{empIdcard}
and b.DELETE_FLAG = '0'
limit 1
</select>
<select
id=
"getDataById"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo"
>
select
a.ID,
a.EMP_IDCARD,
b.EMP_NAME,
a.DEPART_NAME,
a.DEPART_ID,
a.BUSINESS_POST,
a.BUSINESS_TELECOM_NUMBER,
a.BUSINESS_ENJOIN_DATE,
a.EMPLOYEE_TAGS,
a.FIRST_DEGREE_AND_MAJOR,
a.FIRST_DEGREE_GRADUATE_SCHOOL,
a.BUSINESS_LEAVE_DATE,
a.BUSINESS_LEAVE_REASON,
a.HIGHEST_DEGREE_AND_MAJOR,
a.HIGHEST_DEGREE_GRADUATE_SCHOOL,
a.CONTACT_INFO,
a.BUSINESS_WORKING_STATUS,
a.DOCUMENT_TYPE,
a.ARCHIVES_ADDR
from hrms.t_business_employee_extend_info a
left join hrms.t_employee_info b on a.EMP_IDCARD = b.EMP_IDCARD
where 1=1
and a.ID = #{extendId}
and b.DELETE_FLAG = '0'
limit 1
</select>
</mapper>
yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/controller/system/TBusDeptController.java
0 → 100644
View file @
44b3b966
package
com
.
yifu
.
cloud
.
plus
.
v1
.
business
.
controller
.
system
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.business.entity.system.TBusDept
;
import
com.yifu.cloud.plus.v1.business.service.system.TBusDeptService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO
;
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.dapr.util.ArchivesDaprUtil
;
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.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* B端部门表
*
* @author hgw
* @date 2021-08-10 10:38:44
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/tbusdept"
)
@Tag
(
name
=
"B端部门表"
)
public
class
TBusDeptController
{
private
final
TBusDeptService
tBusDeptService
;
private
final
ArchivesDaprUtil
archivesDaprUtil
;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tBusDept B端部门表
* @return
*/
@Operation
(
summary
=
"简单分页查询"
,
description
=
"简单分页查询"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
TBusDept
>>
getTBusDeptPage
(
Page
<
TBusDept
>
page
,
TBusDept
tBusDept
)
{
return
new
R
<>(
tBusDeptService
.
getTBusDeptPage
(
page
,
tBusDept
));
}
/**
* 检查名称是否重复,false:不重复,可以使用的名称
* @param name 名称
* @return
*/
private
boolean
getDeptByName
(
Integer
id
,
String
name
)
{
List
<
TBusDept
>
list
=
tBusDeptService
.
getDeptByName
(
id
,
name
);
return
(
list
!=
null
&&
!
list
.
isEmpty
());
}
/**
* 查询父级的平级list
* @return
*/
@Operation
(
summary
=
"查询父级的平级list"
,
description
=
"查询父级的平级list"
)
@GetMapping
(
"/getParentList"
)
public
R
<
List
<
TBusDept
>>
getParentList
(
Integer
pid
)
{
if
(
Common
.
isNotNull
(
pid
))
{
TBusDept
parent
=
tBusDeptService
.
getById
(
pid
);
if
(
parent
!=
null
&&
Common
.
isNotNull
(
parent
.
getLevel
()))
{
TBusDept
parentDept
=
new
TBusDept
();
parentDept
.
setLevel
(
parent
.
getLevel
());
return
new
R
<>(
tBusDeptService
.
getTBusDeptList
(
parentDept
));
}
}
return
new
R
<>();
}
/**
* 查询所有的list
* @param tBusDept B端部门表
* @return
*/
@Operation
(
summary
=
"查询所有的list"
,
description
=
"查询所有的list"
)
@GetMapping
(
"/getTBusDeptList"
)
public
R
<
List
<
TBusDept
>>
getTBusDeptList
(
TBusDept
tBusDept
)
{
return
new
R
<>(
tBusDeptService
.
getTBusDeptList
(
tBusDept
));
}
/**
* 查询所有的list 包含删除
* @param tBusDept B端部门表
* @return
*/
@Operation
(
summary
=
"查询所有的list"
,
description
=
"查询所有的list"
)
@GetMapping
(
"/getTBusDeptListAsso"
)
public
R
<
List
<
TBusDept
>>
getTBusDeptListAsso
(
TBusDept
tBusDept
)
{
return
new
R
<>(
tBusDeptService
.
getTBusDeptListAsso
(
tBusDept
));
}
/**
* 查询部门树
* @param rootDept B端部门表,id是想要查询的顶级节点
* @return
*/
@Operation
(
summary
=
"查询tree"
,
description
=
"查询tree"
)
@GetMapping
(
"/getTBusDeptTree"
)
public
R
<
TBusDept
>
getTBusDeptTree
(
TBusDept
rootDept
)
{
if
(
rootDept
==
null
||
rootDept
.
getId
()
==
null
)
{
rootDept
=
tBusDeptService
.
getById
(
1
);
}
else
{
rootDept
=
tBusDeptService
.
getById
(
rootDept
.
getId
());
}
List
<
TBusDept
>
deptList
=
tBusDeptService
.
getTBusDeptSubList
(
rootDept
.
getId
(),
rootDept
.
getTreeLogo
());
this
.
getSubList
(
rootDept
,
deptList
);
return
new
R
<>(
rootDept
);
}
/**
* @param rootDept 上级部门
* @param deptList 所有部门信息
* @Description:
* @Author: hgw
* @Date: 2021/8/10 15:49
* @return: com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusDept
**/
private
void
getSubList
(
TBusDept
rootDept
,
List
<
TBusDept
>
deptList
)
{
List
<
TBusDept
>
deptListCopy
=
new
ArrayList
<>(
deptList
);
List
<
TBusDept
>
subList
;
for
(
TBusDept
dept
:
deptList
)
{
if
(
dept
.
getPid
().
equals
(
rootDept
.
getId
()))
{
subList
=
rootDept
.
getChildren
();
if
(
subList
==
null
)
{
subList
=
new
ArrayList
<>();
}
deptListCopy
.
remove
(
dept
);
// 递归塞子集
if
(!
deptListCopy
.
isEmpty
())
{
getSubList
(
dept
,
deptListCopy
);
}
subList
.
add
(
dept
);
rootDept
.
setChildren
(
subList
);
}
}
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation
(
summary
=
"id查询"
,
description
=
"id查询"
)
@GetMapping
(
"/{id}"
)
public
R
<
TBusDept
>
getById
(
@PathVariable
(
"id"
)
Integer
id
)
{
return
new
R
<>(
tBusDeptService
.
getById
(
id
));
}
/**
* 新增记录
*
* @param tBusDept
* @return R
*/
@Operation
(
summary
=
"新增(yifu-mvp-business:tbusdept_add)"
,
description
=
"新增(yifu-mvp-business:tbusdept_add)"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('yifu-hro-business:tbusdept_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
TBusDept
tBusDept
)
{
String
error
;
if
(
Common
.
isNotNull
(
tBusDept
.
getName
()))
{
boolean
flag
=
this
.
getDeptByName
(
null
,
tBusDept
.
getName
());
if
(
flag
)
{
return
R
.
failed
(
"部门名称不可重复"
);
}
}
else
{
return
R
.
failed
(
"部门名称不可为空"
);
}
if
(
tBusDept
.
getPid
()
!=
null
)
{
TBusDept
parentDept
=
tBusDeptService
.
getById
(
tBusDept
.
getPid
());
if
(
parentDept
!=
null
&&
parentDept
.
getId
()
!=
null
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
!=
null
&&
user
.
getId
()
!=
null
)
{
tBusDept
.
setCreateTime
(
LocalDateTime
.
now
());
tBusDept
.
setCreateUserId
(
String
.
valueOf
(
user
.
getId
()));
tBusDept
.
setCreateUserName
(
user
.
getNickname
());
tBusDept
.
setLevel
(
parentDept
.
getLevel
()
+
CommonConstants
.
ONE_INT
);
tBusDeptService
.
save
(
tBusDept
);
tBusDept
.
setTreeLogo
(
parentDept
.
getTreeLogo
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
tBusDept
.
getId
());
boolean
flag
=
tBusDeptService
.
updateById
(
tBusDept
);
return
new
R
<>(
flag
);
}
else
{
error
=
"未获取到登录人信息!"
;
}
}
else
{
error
=
"根据pid,未获取到上级信息!"
;
}
}
else
{
error
=
"pid不可为空!"
;
}
return
R
.
failed
(
error
);
}
/**
* 修改记录
*
* @param tBusDept
* @return R
*/
@Operation
(
summary
=
"修改(yifu-hro-business:tbusdept_edit)"
,
description
=
"修改(yifu-hro-business:tbusdept_edit)"
)
@SysLog
(
"修改B端部门表"
)
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('yifu-hro-business:tbusdept_edit')"
)
public
R
<
Boolean
>
update
(
@RequestBody
TBusDept
tBusDept
)
{
if
(
Common
.
isNotNull
(
tBusDept
.
getName
())
&&
Common
.
isNotNull
(
tBusDept
.
getId
()))
{
boolean
flag
=
this
.
getDeptByName
(
tBusDept
.
getId
(),
tBusDept
.
getName
());
if
(
flag
)
{
return
R
.
failed
(
"部门名称不可重复"
);
}
TBusDept
deptOld
=
tBusDeptService
.
getById
(
tBusDept
.
getId
());
if
(
deptOld
!=
null
&&
Common
.
isNotNull
(
tBusDept
.
getPid
())
&&
!
deptOld
.
getPid
().
equals
(
tBusDept
.
getPid
()))
{
TBusDept
parentDept
=
tBusDeptService
.
getById
(
tBusDept
.
getPid
());
if
(
parentDept
!=
null
&&
parentDept
.
getId
()
!=
null
)
{
String
oldLogo
=
deptOld
.
getTreeLogo
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
;
String
newLogo
=
parentDept
.
getTreeLogo
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
tBusDept
.
getId
();
tBusDept
.
setTreeLogo
(
newLogo
);
newLogo
+=
CommonConstants
.
CENTER_SPLIT_LINE_STRING
;
tBusDeptService
.
updateAllTreeLogo
(
oldLogo
,
newLogo
);
}
else
{
return
R
.
failed
(
"根据pid,未获取到上级信息!"
);
}
}
}
else
{
return
R
.
failed
(
"部门id、名称不可为空"
);
}
boolean
isSuccess
=
tBusDeptService
.
updateById
(
tBusDept
);
//更新人员表冗余字段
if
(
isSuccess
)
{
UpdateEmployeeExtendRedundancyDTO
dto
=
new
UpdateEmployeeExtendRedundancyDTO
();
dto
.
setDepartId
(
tBusDept
.
getId
());
dto
.
setDepartName
(
tBusDept
.
getName
());
dto
.
setTreeLogo
(
tBusDept
.
getTreeLogo
());
dto
.
setDepartIdVal
(
tBusDept
.
getId
());
archivesDaprUtil
.
updateEmployeeExtendRedundancy
(
dto
);
}
return
new
R
<>(
isSuccess
);
}
/**
* 通过id删除一条记录
*
* @param id
* @return R
*/
@Operation
(
summary
=
"假删除(yifu-hro-business:tbusdept_del)"
,
description
=
"假删除(yifu-hro-business:tbusdept_del)"
)
@SysLog
(
"假删除B端部门表"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('yifu-hro-business:tbusdept_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
Integer
id
)
{
TBusDept
tBusDept
=
new
TBusDept
();
tBusDept
.
setPid
(
id
);
List
<
TBusDept
>
list
=
tBusDeptService
.
getTBusDeptList
(
tBusDept
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
return
R
.
failed
(
"部门下有部门,请先删除!"
);
}
tBusDept
=
new
TBusDept
();
tBusDept
.
setId
(
id
);
tBusDept
.
setDeleteFlag
(
1
);
boolean
isSuccess
=
tBusDeptService
.
updateById
(
tBusDept
);
// 更新人员表冗余字段,设置为空值
if
(
isSuccess
)
{
UpdateEmployeeExtendRedundancyDTO
dto
=
new
UpdateEmployeeExtendRedundancyDTO
();
dto
.
setDepartId
(
tBusDept
.
getId
());
dto
.
setDepartName
(
null
);
dto
.
setTreeLogo
(
null
);
dto
.
setDepartIdVal
(
null
);
archivesDaprUtil
.
updateEmployeeExtendRedundancy
(
dto
);
}
return
new
R
<>(
isSuccess
);
}
/**
* 导入
* @return R
*/
@Operation
(
summary
=
"导入"
,
description
=
"导入"
)
@PostMapping
(
"/importDept"
)
public
R
<
List
<
ErrorMessage
>>
importDept
(
@RequestBody
List
<
TBusDept
>
deptList
)
{
if
(
deptList
==
null
||
deptList
.
isEmpty
())
{
return
R
.
failed
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
String
error
;
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
user
.
getId
()
==
null
)
{
return
R
.
failed
(
"未获取到登录人信息!"
);
}
String
userId
=
String
.
valueOf
(
user
.
getId
());
String
userName
=
user
.
getNickname
();
LocalDateTime
nows
=
LocalDateTime
.
now
();
List
<
ErrorMessage
>
errorList
=
new
ArrayList
<>();
int
i
=
1
;
for
(
TBusDept
dept
:
deptList
)
{
i
++;
if
(
Common
.
isNotNull
(
dept
.
getName
()))
{
boolean
flag
=
this
.
getDeptByName
(
null
,
dept
.
getName
());
if
(!
flag
)
{
this
.
doSaveInfo
(
userId
,
userName
,
nows
,
errorList
,
i
,
dept
);
}
else
{
error
=
"已存在此部门:"
+
dept
.
getName
();
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
}
}
else
{
error
=
"部门名称不可为空!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
}
}
return
R
.
ok
(
errorList
);
}
/**
* @param userId
* @param userName
* @param nows
* @param errorList
* @param i
* @param dept
* @Description: 保存信息
* @Author: hgw
* @Date: 2021/8/11 16:39
* @return: void
**/
private
void
doSaveInfo
(
String
userId
,
String
userName
,
LocalDateTime
nows
,
List
<
ErrorMessage
>
errorList
,
int
i
,
TBusDept
dept
)
{
String
error
;
if
(
dept
.
getName
().
length
()
<=
50
)
{
if
(
dept
.
getParentName
()
!=
null
)
{
List
<
TBusDept
>
parentDeptList
=
tBusDeptService
.
getDeptByName
(
null
,
dept
.
getParentName
());
if
(
parentDeptList
!=
null
&&
!
parentDeptList
.
isEmpty
())
{
TBusDept
parentDept
=
parentDeptList
.
get
(
CommonConstants
.
ZERO_INT
);
dept
.
setPid
(
parentDept
.
getId
());
dept
.
setCreateTime
(
nows
);
dept
.
setCreateUserId
(
userId
);
dept
.
setCreateUserName
(
userName
);
dept
.
setLevel
(
parentDept
.
getLevel
()
+
CommonConstants
.
ONE_INT
);
tBusDeptService
.
save
(
dept
);
dept
.
setTreeLogo
(
parentDept
.
getTreeLogo
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
dept
.
getId
());
tBusDeptService
.
updateById
(
dept
);
}
else
{
error
=
"部门:"
+
dept
.
getName
()
+
",未找到上级部门:"
+
dept
.
getParentName
();
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
}
}
else
{
error
=
"部门:"
+
dept
.
getName
()
+
",上级部门不可为空!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
}
}
else
{
error
=
"部门名称长度不允许超过50:"
+
dept
.
getName
();
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
}
}
/**
* 根据部门父id或等级查询部门列表
* @param pid 部门pid
* @param level 部门等级
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusDept>>
* @author: wangweiguo
* @date: 2021/9/7
* @since hrob2.1
*/
@Operation
(
summary
=
"根据部门父id或等级查询部门列表"
,
description
=
"根据部门父id或等级查询部门列表"
)
@GetMapping
(
"/getBusDepartByLevelOrPid"
)
public
R
<
List
<
TBusDept
>>
getBusDepartByLevelOrPid
(
@Parameter
(
description
=
"部门父id选填,如果需要获取指定部门下面所有的部门须填写"
)
@RequestParam
(
name
=
"pid"
,
required
=
false
)
Integer
pid
,
@Parameter
(
description
=
"部门等级 1:一级部门 2:二级部门,以此类推"
)
@RequestParam
(
name
=
"level"
)
Integer
level
)
{
return
this
.
tBusDeptService
.
getBusDepartByLevelOrPid
(
pid
,
level
);
}
}
yifu-business/yifu-business-biz/src/main/resources/mapper/TBusDeptMapper.xml
View file @
44b3b966
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
44b3b966
...
...
@@ -304,6 +304,15 @@ public interface CommonConstants {
String
UPDATE_SUCCESS
=
"更新成功!"
;
/**
* update fail
* @Author fxj
* @Date 2020-08-25
**/
String
UPDATE_DATA_FAIL
=
"更新失败!"
;
String
ID_CARD_IS_NULL
=
"身份证号为空"
;
String
PARAM_IS_NOT_EMPTY
=
"参数不可为空"
;
String
DATA_CAN_NOT_EMPTY
=
"数据不可为空"
;
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
View file @
44b3b966
...
...
@@ -299,6 +299,21 @@ public class ArchivesDaprUtil {
return
res
;
}
/**
* @Author fxj
* @Description 校验手机号码重复
* @Date 22:11 2022/8/4
* @Param
* @return
**/
public
R
<
Boolean
>
updateEmployeeExtendRedundancy
(
UpdateEmployeeExtendRedundancyDTO
dto
)
{
R
<
Boolean
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/customerBusiness/temployeeBusiness/inner/updateEmployeeExtendRedundancy"
,
JSON
.
toJSONString
(
dto
),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"更新-对应身份证的冗余信息失败!"
);
}
return
res
;
}
/**
* @Author fxj
* @Description 更新项目档案和人员档案的社保公积金状态
...
...
yifu-common/yifu-common-dapr/src/main/resources/daprConfig.properties
View file @
44b3b966
#\u6D4B\u8BD5\u73AF\u5883-\u7BA1\u7406\u540E\u53F0
dapr.upms.appUrl
=
http://yifu-upms.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u6D4B\u8BD5\u73AF\u5883
#\u67E5\u8BE2\u5730\u5740\u6559\u7A0B\uFF1A cd home/data/nginx-mvp-image/mvp/
# vim Default.conf
# \u627E\u5230\u5BF9\u5E94\u7684\u670D\u52A1\u5730\u5740
#dapr.upms.appUrl=http://yifu-auth.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u672C\u5730
dapr.upms.appUrl
=
http://localhost:3500/v1.0/invoke/
dapr.upms.appId
=
yifu-upms
dapr.upms.appPort
=
4000
dapr.upms.httpPort
=
3500
dapr.upms.grpcPort
=
52000
dapr.upms.metricsPort
=
9094
#\u6D4B\u8BD5\u73AF\u5883
-\u6821\u9A8C\u670D\u52A1
dapr.check.appUrl
=
http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u6D4B\u8BD5\u73AF\u5883
#
dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u672C\u5730
#dapr.check.appUrl=http://localhost:3502
/v1.0/invoke/
dapr.check.appUrl
=
http://localhost:3507
/v1.0/invoke/
dapr.check.appId
=
yifu-check
dapr.check.appPort
=
50022
dapr.check.httpPort
=
3507
dapr.check.grpcPort
=
52008
dapr.check.metricsPort
=
9098
#\u6D4B\u8BD5\u73AF\u5883-\u6863\u6848\u670D\u52A1
dapr.archives.appUrl
=
http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appUrl
=
http://localhost:3508/v1.0/invoke/
dapr.archives.appId
=
yifu-archives
dapr.archives.appPort
=
5001
dapr.archives.httpPort
=
3508
dapr.archives.grpcPort
=
52009
dapr.archives.metricsPort
=
9099
dapr.insurances.appUrl
=
http://yifu-auth.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.insurances.appId
=
yifu-insurances
dapr.social.appUrl
=
http://localhost:3509/v1.0/invoke/
dapr.social.appId
=
yifu-social
dapr.social.appPort
=
5002
dapr.social.httpPort
=
3509
dapr.social.grpcPort
=
52003
dapr.social.metricsPort
=
9093
#\u6D4B\u8BD5\u73AF\u5883-\u85AA\u8D44\u670D\u52A1
dapr.salary.appUrl
=
http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.salary.appUrl
=
http://localhost:3513/v1.0/invoke/
dapr.salary.appId
=
yifu-salary
dapr.salary.appPort
=
5003
dapr.salary.httpPort
=
3513
dapr.salary.grpcPort
=
52013
dapr.salary.metricsPort
=
9102
dapr.job.appUrl
=
http://localhost:3504/v1.0/invoke/
dapr.job.appId
=
yifu-job
dapr.job.appPort
=
5004
dapr.job.httpPort
=
3506
dapr.job.grpcPort
=
52007
dapr.job.metricsPort
=
9097
dapr.insurances.appUrl
=
http://localhost:3511/v1.0/invoke/
dapr.insurances.appId
=
yifu-insurances
dapr.insurances.appPort
=
5005
dapr.insurances.httpPort
=
3511
dapr.insurances.grpcPort
=
52012
dapr.insurances.metricsPort
=
9101
#\u6D4B\u8BD5\u73AF\u5883-\u85AA\u8D44\u670D\u52A1
#dapr.salary.appUrl=http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#dapr.salary.appId=yifu-salary
#\u6D4B\u8BD5\u73AF\u5883-\u793E\u4FDD\u670D\u52A1
dapr.social.appUrl
=
http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.social.appId
=
yifu-social
\ No newline at end of file
#dapr.social.appUrl=http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#
dapr.social.appId
=
yifu-social
\ No newline at end of file
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