Commit 1412cef4 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.4' into MVP1.4

# Conflicts:
#	yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/controller/system/TBusDeptController.java
parents 41502ce4 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
...@@ -26,6 +26,7 @@ import lombok.EqualsAndHashCode; ...@@ -26,6 +26,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 客户信息 * 客户信息
...@@ -250,5 +251,6 @@ public class TCustomerInfo extends BaseEntity { ...@@ -250,5 +251,6 @@ public class TCustomerInfo extends BaseEntity {
@Schema(description = "账户余额") @Schema(description = "账户余额")
private BigDecimal balance; private BigDecimal balance;
private List<String> customerIds;
} }
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;
}
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;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.util.List;
/**
* @program: master
* @description: b端回显的客户信息包装类
* @author: pwang
* @create: 2020-08-26 19:47
**/
@Data
@Tag(name = "b端回显的客户信息包装类")
public class CustomerForBusinessVo {
//已有的客户信息
@Schema(name = "已有的客户信息")
private List<String> hadCustomer;
//已有的结算主体信息
@Schema(name = "已有的结算主体信息")
private List<String> hadSettle;
//客户分页信息
/* @Schema(name = "客户分页信息")
Page<TCustomerInfo> customerInfoPage;
//结算主体
@Schema(name = "客户信息")
private List<TCustomerInfo> customerList;*/
//结算主体
@Schema(name = "结算主体")
private List<TSettleDomain> settleDomainList;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class CustomerOwnerSelectVo implements Serializable {
/**
* 单位名称
*/
private String customerName;
/**
* 单位编码
*/
private String customerCode;
/**
* 单位ID
*/
private String customerId;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @program: master
* @description: 分页展示包装类
* @author: pwang
* @create: 2019-09-02 11:40
**/
@Tag(name = "结算主体表分页包装类")
@Data
public class TSettleDomainVo extends TSettleDomain implements Serializable {
/**
*客户名称
**/
@Schema(description = "客户编码", name = "customerCode")
//非本表字段
@TableField(exist = false)
private String customerCode;
/**
*客户名称
**/
@Schema(description = "客户名称", name = "customerName")
//非本表字段
@TableField(exist = false)
private String customerName;
/**
*客户id
**/
//非本表字段
@TableField(exist = false)
private String customerId;
/**
* 归属服务公司Id(乙方)
*/
@Schema(description = "归属服务公司Id(合同属性)", name = "businessSubject")
//非本表字段
@TableField(exist = false)
private String businessSubject;
/**
* 归属服务公司名称
*/
@Schema(description = "归属服务公司名称(合同属性)", name = "businessSubject")
//非本表字段
@TableField(exist = false)
private String businessSubjectName;
/**
*合同名称
**/
//非本表字段
@TableField(exist = false)
private String contractName;
//业务类型
@TableField(exist = false)
@Schema(description = "业务类型")
private String businessType;
//业务类型细分
@TableField(exist = false)
@Schema(description = "业务细分")
private String businessSub;
@TableField(exist = false)
@Schema(description = "创建月(需求变更查FIRST_PASS_TIME)")
private String createMonth;
/**************************************结算主体改造新增字段2021-03-17 开始*********************************************/
@Schema(description = "业务类型分类", name = "businessPrimaryType")
private String businessPrimaryType;
@Schema(description = "业务类型二级分类", name = "businessSecondType")
private String businessSecondType;
@Schema(description = "业务类型三级分类", name = "businessThirdType")
private String businessThirdType;
/**
* 0:人事;1:非人事
*/
@Schema(description = "0:人事;1:非人事", name = "type")
private Integer type;
/**************************************结算主体改造新增字段2021-03-17 结束********************************************/
/**************************************结算主体改造可先不关联合同2021-05-17 开始********************************************/
/**
* 创建类型:0 合同之后 1 合同之前
*/
@Schema(description = "创建类型:0:合同之后 1:合同之前", name = "createType")
private String createType;
/**
* 关联合同:0是1否
*/
@Schema(description = "关联合同:0是1否", name = "relateFlag")
private String relateFlag;
/**
* 异常说明
*/
@Schema(description = "异常说明", name = "exceptionRemark")
private String exceptionRemark;
/**************************************结算主体改造可先不关联合同2021-05-17 结算主体改造新增字段2021-03-17 结束****************/
/**
* B端 传参 客户ID
*/
@TableField(exist = false)
private List<String> customerIds;
/**
* B端 传参 结算主体ID
*/
@TableField(exist = false)
private List<String> settleDomainIds;
}
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;
}
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;
}
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteUserService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ListWrapper;
import com.yifu.cloud.plus.v1.yifu.archives.vo.CustomerForBusinessVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.CustomerOwnerSelectVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.EmpBusinessConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* B端接口-客户信息相关
* @program: master
* @description: b端控制器
* @author: pwang
* @create: 2020-08-25 11:07
**/
@RestController
@AllArgsConstructor
@RequestMapping(value = "/customerBusiness/customerInfo")
@Tag(name = "B端接口-客户信息相关")
@Slf4j
public class CustomerBusinessContoller {
private final TSettleDomainService tSettleDomainService;
private final MSetttleCustomerUserService mSetttleCustomerUserService;
private final RemoteUserService remoteUserService;
private static final String CREATE_TIME_COLNUM = "CREATE_TIME"; //客户创建时间
private final RedisUtil redisUtil;
private final UpmsDaprUtils upmsDaprUtils;
/**
* 简单分页查询
* @param page 分页对象
* @param tCustomerInfo 客户信息
* @return
*/
@Operation(description = "B端客户单位分页查询")
@GetMapping("/customerPage")
public R<IPage<TCustomerInfo>> getCustomerInfoPage(Page<TCustomerInfo> page, TCustomerInfo tCustomerInfo, String customerIdStr) {
if (Common.isNotNull(customerIdStr)){
tCustomerInfo.setCustomerIds(Common.initStrToList(customerIdStr,CommonConstants.COMMA_STRING));
}
page.addOrder(OrderItem.desc(CREATE_TIME_COLNUM));
return null; // TODO new R<>(tCustomerInfoService.getTCustomerInfoPageForB(page,tCustomerInfo));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param tSettleDomain 结算主体表
* @return
*/
@Operation(description = "B端结算主体简单分页查询")
@GetMapping("/settleDomainPage")
public R<IPage<TSettleDomainVo>> settleDomainPage(Page<TSettleDomainVo> page, TSettleDomainVo tSettleDomain, String customerIdStr) {
YifuUser user = SecurityUtils.getUser();
if(null == user){
return R.failed(CommonConstants.USER_FAIL);
}
// 按客户ID查询结算主体
if (Common.isNotNull(customerIdStr)){
tSettleDomain.setCustomerIds(Common.initStrToList(customerIdStr,CommonConstants.COMMA_STRING));
}else {
// 按权限查询结算主体
List<String> settleDomainIds;
boolean flag = !SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B, user);
if (flag) {
settleDomainIds = null;// TODO user.getSettleIdList();
if (Common.isEmpty(settleDomainIds)) {
return R.failed(EmpBusinessConstants.noSettleDomainAuth);
}
tSettleDomain.setSettleDomainIds(settleDomainIds);
}
}
page.addOrder(OrderItem.desc("CREATE_TIME"));
return null;// TODO new R(tSettleDomainService.getTSettleDomainPageB(page, tSettleDomain));
}
/**
* 获取客户下的结算主体(未删除、不是审核不通过的)
* name = "customerId", value = "客户id"
*/
@Operation(description = "获取客户下的结算主体")
@GetMapping("/getSettleDomain/{customerId}")
public R<List<TSettleDomain>> getSettleDomain(@PathVariable String customerId) {
return new R<>(tSettleDomainService.list(getSettleDomainWrapper(CollUtil.toList(customerId))));
}
/**
* 保存客户结算主体关系
*/
@Operation(description = "保存客户结算主体关系")
@PostMapping("/batch/saveMSetttleCustomerUser")
public R<List<TSettleDomain>> saveMSetttleCustomerUser(@Valid @RequestBody ListWrapper<MSetttleCustomerUser> mSetttleCustomerUser) {
if(Common.isNotNull(mSetttleCustomerUser.getList())){
//先删后增
String userId = mSetttleCustomerUser.getList().get(0).getUserId();
mSetttleCustomerUserService.remove(Wrappers.<MSetttleCustomerUser>lambdaQuery().eq(MSetttleCustomerUser::getUserId, userId));
if(mSetttleCustomerUserService.saveBatch(mSetttleCustomerUser.getList())){
//清除用户缓存
R<SysUser> simpleUser = upmsDaprUtils.getSimpleUser(userId);
log.info("清除b端结算主体缓存开始");
if(null != simpleUser && null != simpleUser.getData()){
SysUser user = simpleUser.getData();
log.info("清除b端结算主体缓存: "+ ServiceNameConstants.UMPS_SERVICE + "_user_details::" + user.getUsername());
redisUtil.remove(ServiceNameConstants.UMPS_SERVICE + "_user_details::" + user.getUsername());
if( Common.isNotNull(user.getPhone())){
log.info("清除b端结算主体缓存: "+ ServiceNameConstants.UMPS_SERVICE + "_user_details_phone::" + user.getPhone());
redisUtil.remove(ServiceNameConstants.UMPS_SERVICE + "_user_details_phone::" + user.getPhone());
}
}
return R.ok();
}else {
return R.failed("保存失败,数据入库异常!");
}
}else{
return R.failed("保存失败,对象为空!");
}
}
/**
* 获取用户回显数据
* name = "userId", value = "用户id")
*/
@Operation(description = "获取用户回显数据")
@GetMapping("/CustomerForBusinessVo/{userId}")
public R<CustomerForBusinessVo> getCustomerForBusinessVo(@PathVariable String userId) {
CustomerForBusinessVo result = new CustomerForBusinessVo();
//查回显数据
List<MSetttleCustomerUser> list = mSetttleCustomerUserService.list(Wrappers.<MSetttleCustomerUser>lambdaQuery().eq(MSetttleCustomerUser::getUserId, userId));
if(Common.isNotNull(list)){
//已有权限的结算主体
List<String> setttleList = new ArrayList<>();
List<String> customerList = new ArrayList<>();
Map<String,String> customerMap = new HashMap<>();
Map<String,String> settleMap = new HashMap<>();
for(MSetttleCustomerUser cu :list){
settleMap.put(cu.getSettleId(),cu.getSettleId());
customerMap.put(cu.getCustomerId(),cu.getCustomerId());
}
if (Common.isNotNull(customerMap)){
customerList = customerMap.values().stream().collect(Collectors.toList());
}
if (Common.isNotNull(settleMap)){
setttleList = settleMap.values().stream().collect(Collectors.toList());
}
result.setHadSettle(setttleList);
result.setHadCustomer(customerList);
// 获取所有有权限的客户信息 TODO
//result.setCustomerList(tCustomerInfoService.list(Wrappers.<TCustomerInfo>query().lambda().in(TCustomerInfo::getId,customerList)));
//获取该客户下的主体
result.setSettleDomainList(tSettleDomainService.list(getSettleDomainWrapper(customerList)));
}
return new R<>(result);
}
/**
* 获取结算主体的查询条件(未删除、非审核不通过的)
* @Author pwang
* @Date 2020-09-21 14:13
* @param customerIds
* @return
**/
private LambdaQueryWrapper<TSettleDomain> getSettleDomainWrapper(List<String> customerIds) {
return Wrappers.<TSettleDomain>lambdaQuery().in(TSettleDomain::getCustomerId,customerIds).ne(TSettleDomain::getDpAuditFlag, CommonConstants.ONE_STRING);
}
/**
* b端获取用户的结算主体 无分页
* @param settleName, value = "结算主体名称"
* @param limit, value = "最大返回条数,【1-50】之间的正整数,不传默认为20"
* @return
*/
@Operation(description = "获取项目-无分页")
@GetMapping("/ownSettleDomainNoPage")
public R<List<TSettleDomain>> ownSettleDomainNoPage(String settleName,Integer limit) {
YifuUser user = SecurityUtils.getUser();
if(null == user){
return R.failed("非法用户!");
}
//管理员权限
if(SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B,user)){
//验证参数
if(null == limit){
limit = 20;
}
if( CommonConstants.dingleDigitIntArray[0] > limit || 50 <= limit){
return R.failed("参数传0到50的整数!");
}
//拼接条件
LambdaQueryWrapper<TSettleDomain> wrapper = Wrappers.<TSettleDomain>lambdaQuery();
if(Common.isNotNull(settleName)){
wrapper.like(TSettleDomain::getDepartName,settleName);
}
wrapper.last("limit " + limit);
return new R<>(tSettleDomainService.list(wrapper));
}else{
return new R<>(tSettleDomainService.getOwnSettleDomainNoPage(user.getId().toString(),settleName));
}
}
/**
* b端获取用户的结算主体
* @ApiImplicitParam(name = "settleName", value = "结算主体名称"),
* @ApiImplicitParam(name = "limit", value = "最大返回条数,【1-50】之间的正整数,不传默认为20"
*/
@Operation(description = "获取项目")
@GetMapping("/ownSettleDomain")
public R<IPage<TSettleDomainVo> > getOwnSettleDomain(Page<TSettleDomainVo> page, TSettleDomainVo vo) {
YifuUser user = SecurityUtils.getUser();
if(null == user){
return R.failed("非法用户!");
}
//管理员权限
/*if(SecurityUtils.isHaveAllOrg(ServiceNameConstants.CLIENT_ID_HR_B,user)){
return new R(tSettleDomainService.getPage(page, vo));
}else{
}*/
return new R(tSettleDomainService.getOwnSettleDomain(page,user.getId().toString(),vo.getDepartName()));
}
/**
* 获取权限内所有客户下拉项
* @author fxj
* @date 2021-11-03
* @param page
* @param customerName
* @return
*/
@Operation(description = "获取权限内所有客户下拉项")
@GetMapping("/getCustomerOwnerPage")
public R<IPage<CustomerOwnerSelectVo> > getCustomerOwnerPage(Page<CustomerOwnerSelectVo> page, String customerName) {
return null;// TODO tSettleDomainService.getCustomerOwnerPage(page,customerName);
}
}
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));
// }
}
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);
}
...@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; ...@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.IdNameNoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.IdNameNoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -78,4 +79,8 @@ public interface TSettleDomainMapper extends BaseMapper<TSettleDomain> { ...@@ -78,4 +79,8 @@ public interface TSettleDomainMapper extends BaseMapper<TSettleDomain> {
List<ProjectSetInfoVo> getSetInfoByCodes(@Param(value = "codes") List<String> codes); List<ProjectSetInfoVo> getSetInfoByCodes(@Param(value = "codes") List<String> codes);
List<TSettleDomain> getSettleInfoByCodes(@Param(value = "codes") List<String> codes); List<TSettleDomain> getSettleInfoByCodes(@Param(value = "codes") List<String> codes);
List<TSettleDomain> getOwnSettleDomainNoPage(@Param("userId") String userId, @Param("name") String name);
IPage<TSettleDomainVo> getOwnSettleDomain(Page page, @Param("userId") String userId, @Param("name") String name);
} }
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);
}
...@@ -108,4 +108,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -108,4 +108,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
R updateProjectInfo(List<TSettleDomainEkpVo> list); R updateProjectInfo(List<TSettleDomainEkpVo> list);
List<TSettleDomain> getOwnSettleDomainNoPage(String toString, String settleName);
R<IPage<TSettleDomainVo>> getOwnSettleDomain(Page<TSettleDomainVo> page, String userId, String name);
} }
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, ",");
}
}
...@@ -46,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -46,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -394,4 +395,18 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -394,4 +395,18 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
} }
return true; return true;
} }
@Override
public List<TSettleDomain> getOwnSettleDomainNoPage(String userId, String settleName) {
if(Common.isNotNull(userId)){
return baseMapper.getOwnSettleDomainNoPage(userId,settleName);
}
return Collections.emptyList();
}
@Override
public R<IPage<TSettleDomainVo>> getOwnSettleDomain(Page<TSettleDomainVo> page, String userId, String name) {
if(Common.isNotNull(userId)){
return R.ok(baseMapper.getOwnSettleDomain(page,userId,name),CommonConstants.RESULT_DATA_SUCESS);
}
return (R<IPage<TSettleDomainVo>>) Collections.emptyList();
}
} }
package com.yifu.cloud.plus.v1.yifu.archives.utils;
import lombok.Getter;
import lombok.Setter;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @program: master
* @description: 验证list对象
* @author: pwang
* @create: 2020-07-29 20:17
**/
@Getter
@Setter
public class ListWrapper<E> implements Serializable {
private static final long serialVersionUID = 1L;
@Valid
private List<E> list;
public ListWrapper() {
list = new ArrayList<>();
}
public ListWrapper(List<E> list) {
this.list = list;
}
}
<?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>
...@@ -311,4 +311,30 @@ ...@@ -311,4 +311,30 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="getOwnSettleDomainNoPage" resultMap="tSettleDomainMap">
SELECT
<include refid="Base_Column_List"/>
FROM
t_settle_domain a
where
1=1
<if test="name != null and name.trim() != ''">
and a.DEPART_NAME like concat("%",#{name},"%")
</if>
and a.id in (select b.settle_id from m_setttle_customer_user b where b.user_id = #{userId}) and a.DELETE_FLAG = '0'
</select>
<select id="getOwnSettleDomain" resultMap="tSettleDomainMap">
SELECT
<include refid="Base_Column_List"/>
FROM
t_settle_domain a
where
1=1
<if test="name != null and name.trim() != ''">
and a.DEPART_NAME like concat("%",#{name},"%")
</if>
and a.id in (select b.settle_id from m_setttle_customer_user b where b.user_id = #{userId}) and a.DELETE_FLAG = '0'
</select>
</mapper> </mapper>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<groupId>com.yifu.cloud.plus.v1</groupId> <groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId> <artifactId>yifu-common-swagger</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-business-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -4,15 +4,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,15 +4,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.entity.system.TBusDept;
import com.yifu.cloud.plus.v1.business.service.system.TBusDeptService; 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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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 com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -28,14 +32,14 @@ import java.util.List; ...@@ -28,14 +32,14 @@ import java.util.List;
* @date 2021-08-10 10:38:44 * @date 2021-08-10 10:38:44
*/ */
@RestController @RestController
@AllArgsConstructor @RequiredArgsConstructor
@RequestMapping("/tbusdept") @RequestMapping("/tbusdept")
@Tag(name = "B端部门表") @Tag(name = "B端部门表")
public class TBusDeptController { public class TBusDeptController {
private final TBusDeptService tBusDeptService; private final TBusDeptService tBusDeptService;
//private final RemoteBasiBusinessService remoteBasiBusinessService; private final ArchivesDaprUtil archivesDaprUtil;
/** /**
* 简单分页查询 * 简单分页查询
...@@ -44,8 +48,8 @@ public class TBusDeptController { ...@@ -44,8 +48,8 @@ public class TBusDeptController {
* @param tBusDept B端部门表 * @param tBusDept B端部门表
* @return * @return
*/ */
@Operation(summary = "简单分页查询") @Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page") @GetMapping("/page")
public R<IPage<TBusDept>> getTBusDeptPage(Page<TBusDept> page, TBusDept tBusDept) { public R<IPage<TBusDept>> getTBusDeptPage(Page<TBusDept> page, TBusDept tBusDept) {
return new R<>(tBusDeptService.getTBusDeptPage(page, tBusDept)); return new R<>(tBusDeptService.getTBusDeptPage(page, tBusDept));
} }
...@@ -64,8 +68,8 @@ public class TBusDeptController { ...@@ -64,8 +68,8 @@ public class TBusDeptController {
* 查询父级的平级list * 查询父级的平级list
* @return * @return
*/ */
@Operation(summary = "查询父级的平级list") @Operation(summary = "查询父级的平级list", description = "查询父级的平级list")
@GetMapping("/getParentList") @GetMapping("/getParentList")
public R<List<TBusDept>> getParentList(Integer pid) { public R<List<TBusDept>> getParentList(Integer pid) {
if (Common.isNotNull(pid)) { if (Common.isNotNull(pid)) {
TBusDept parent = tBusDeptService.getById(pid); TBusDept parent = tBusDeptService.getById(pid);
...@@ -83,8 +87,8 @@ public class TBusDeptController { ...@@ -83,8 +87,8 @@ public class TBusDeptController {
* @param tBusDept B端部门表 * @param tBusDept B端部门表
* @return * @return
*/ */
@Operation(summary = "查询所有的list") @Operation(summary = "查询所有的list", description = "查询所有的list")
@GetMapping("/getTBusDeptList") @GetMapping("/getTBusDeptList")
public R<List<TBusDept>> getTBusDeptList(TBusDept tBusDept) { public R<List<TBusDept>> getTBusDeptList(TBusDept tBusDept) {
return new R<>(tBusDeptService.getTBusDeptList(tBusDept)); return new R<>(tBusDeptService.getTBusDeptList(tBusDept));
} }
...@@ -94,8 +98,8 @@ public class TBusDeptController { ...@@ -94,8 +98,8 @@ public class TBusDeptController {
* @param tBusDept B端部门表 * @param tBusDept B端部门表
* @return * @return
*/ */
@Operation(summary = "查询所有的list") @Operation(summary = "查询所有的list", description = "查询所有的list")
@GetMapping("/getTBusDeptListAsso") @GetMapping("/getTBusDeptListAsso")
public R<List<TBusDept>> getTBusDeptListAsso(TBusDept tBusDept) { public R<List<TBusDept>> getTBusDeptListAsso(TBusDept tBusDept) {
return new R<>(tBusDeptService.getTBusDeptListAsso(tBusDept)); return new R<>(tBusDeptService.getTBusDeptListAsso(tBusDept));
} }
...@@ -105,8 +109,8 @@ public class TBusDeptController { ...@@ -105,8 +109,8 @@ public class TBusDeptController {
* @param rootDept B端部门表,id是想要查询的顶级节点 * @param rootDept B端部门表,id是想要查询的顶级节点
* @return * @return
*/ */
@Operation(summary = "查询tree") @Operation(summary = "查询tree", description = "查询tree")
@GetMapping("/getTBusDeptTree") @GetMapping("/getTBusDeptTree")
public R<TBusDept> getTBusDeptTree(TBusDept rootDept) { public R<TBusDept> getTBusDeptTree(TBusDept rootDept) {
if (rootDept == null || rootDept.getId() == null) { if (rootDept == null || rootDept.getId() == null) {
rootDept = tBusDeptService.getById(1); rootDept = tBusDeptService.getById(1);
...@@ -146,15 +150,14 @@ public class TBusDeptController { ...@@ -146,15 +150,14 @@ public class TBusDeptController {
} }
} }
/** /**
* 通过id查询单条记录 * 通过id查询单条记录
* *
* @param id * @param id
* @return R * @return R
*/ */
@Operation(summary = "id查询") @Operation(summary = "id查询", description = "id查询")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<TBusDept> getById(@PathVariable("id") Integer id) { public R<TBusDept> getById(@PathVariable("id") Integer id) {
return new R<>(tBusDeptService.getById(id)); return new R<>(tBusDeptService.getById(id));
} }
...@@ -165,8 +168,8 @@ public class TBusDeptController { ...@@ -165,8 +168,8 @@ public class TBusDeptController {
* @param tBusDept * @param tBusDept
* @return R * @return R
*/ */
@Operation(summary = "新增(yifu-hro-business:tbusdept_add)") @Operation(summary = "新增(yifu-mvp-business:tbusdept_add)", description = "新增(yifu-mvp-business:tbusdept_add)")
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('yifu-hro-business:tbusdept_add')") @PreAuthorize("@pms.hasPermission('yifu-hro-business:tbusdept_add')")
public R<Boolean> save(@RequestBody TBusDept tBusDept) { public R<Boolean> save(@RequestBody TBusDept tBusDept) {
String error; String error;
...@@ -209,8 +212,8 @@ public class TBusDeptController { ...@@ -209,8 +212,8 @@ public class TBusDeptController {
* @param tBusDept * @param tBusDept
* @return R * @return R
*/ */
/* @Operation(summary = "修改(yifu-hro-business:tbusdept_edit)") @Operation(summary = "修改(yifu-hro-business:tbusdept_edit)", description = "修改(yifu-hro-business:tbusdept_edit)")
@SysLog("修改B端部门表") @SysLog("修改B端部门表")
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('yifu-hro-business:tbusdept_edit')") @PreAuthorize("@pms.hasPermission('yifu-hro-business:tbusdept_edit')")
public R<Boolean> update(@RequestBody TBusDept tBusDept) { public R<Boolean> update(@RequestBody TBusDept tBusDept) {
...@@ -238,17 +241,17 @@ public class TBusDeptController { ...@@ -238,17 +241,17 @@ public class TBusDeptController {
} }
boolean isSuccess = tBusDeptService.updateById(tBusDept); boolean isSuccess = tBusDeptService.updateById(tBusDept);
// 更新人员表冗余字段 //更新人员表冗余字段
if (isSuccess) { if (isSuccess) {
UpdateEmployeeExtendRedundancyDTO dto = new UpdateEmployeeExtendRedundancyDTO(); UpdateEmployeeExtendRedundancyDTO dto = new UpdateEmployeeExtendRedundancyDTO();
dto.setDepartId(tBusDept.getId()); dto.setDepartId(tBusDept.getId());
dto.setDepartName(tBusDept.getName()); dto.setDepartName(tBusDept.getName());
dto.setTreeLogo(tBusDept.getTreeLogo()); dto.setTreeLogo(tBusDept.getTreeLogo());
dto.setDepartIdVal(tBusDept.getId()); dto.setDepartIdVal(tBusDept.getId());
remoteBasiBusinessService.updateEmployeeExtendRedundancy(CollUtil.newArrayList(dto), SecurityConstants.FROM_IN); archivesDaprUtil.updateEmployeeExtendRedundancy(dto);
} }
return new R<>(isSuccess); return new R<>(isSuccess);
}*/ }
/** /**
* 通过id删除一条记录 * 通过id删除一条记录
...@@ -256,8 +259,8 @@ public class TBusDeptController { ...@@ -256,8 +259,8 @@ public class TBusDeptController {
* @param id * @param id
* @return R * @return R
*/ */
/*@Operation(summary = "假删除(yifu-hro-business:tbusdept_del)") @Operation(summary = "假删除(yifu-hro-business:tbusdept_del)", description = "假删除(yifu-hro-business:tbusdept_del)")
@SysLog("假删除B端部门表") @SysLog("假删除B端部门表")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('yifu-hro-business:tbusdept_del')") @PreAuthorize("@pms.hasPermission('yifu-hro-business:tbusdept_del')")
public R<Boolean> removeById(@PathVariable Integer id) { public R<Boolean> removeById(@PathVariable Integer id) {
...@@ -279,17 +282,17 @@ public class TBusDeptController { ...@@ -279,17 +282,17 @@ public class TBusDeptController {
dto.setDepartName(null); dto.setDepartName(null);
dto.setTreeLogo(null); dto.setTreeLogo(null);
dto.setDepartIdVal(null); dto.setDepartIdVal(null);
remoteBasiBusinessService.updateEmployeeExtendRedundancy(CollUtil.newArrayList(dto), SecurityConstants.FROM_IN); archivesDaprUtil.updateEmployeeExtendRedundancy(dto);
} }
return new R<>(isSuccess); return new R<>(isSuccess);
}*/ }
/** /**
* 导入 * 导入
* @return R * @return R
*/ */
@Operation(summary = "导入") @Operation(summary = "导入", description = "导入")
@PostMapping("/importDept") @PostMapping("/importDept")
public R<List<ErrorMessage>> importDept(@RequestBody List<TBusDept> deptList) { public R<List<ErrorMessage>> importDept(@RequestBody List<TBusDept> deptList) {
if (deptList == null || deptList.isEmpty()) { if (deptList == null || deptList.isEmpty()) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
...@@ -297,10 +300,10 @@ public class TBusDeptController { ...@@ -297,10 +300,10 @@ public class TBusDeptController {
String error; String error;
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed("未获取到登录人信息!"); return R.failed("未获取到登录人信息!");
} }
String userId = user.getId(); String userId = String.valueOf(user.getId());
String userName = user.getNickname(); String userName = user.getNickname();
LocalDateTime nows = LocalDateTime.now(); LocalDateTime nows = LocalDateTime.now();
List<ErrorMessage> errorList = new ArrayList<>(); List<ErrorMessage> errorList = new ArrayList<>();
...@@ -320,7 +323,7 @@ public class TBusDeptController { ...@@ -320,7 +323,7 @@ public class TBusDeptController {
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
} }
} }
return R.ok(errorList, CommonConstants.SAVE_SUCCESS); return R.ok(errorList);
} }
/** /**
...@@ -369,17 +372,18 @@ public class TBusDeptController { ...@@ -369,17 +372,18 @@ public class TBusDeptController {
/** /**
* 根据部门父id或等级查询部门列表 * 根据部门父id或等级查询部门列表
* @param pid 部门pid 部门父id选填,如果需要获取指定部门下面所有的部门须填写 * @param pid 部门pid
* @param level 部门等级 部门等级 1:一级部门 2:二级部门,以此类推 * @param level 部门等级
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusDept>> * @return: com.yifu.cloud.v1.common.core.util.R<java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusDept>>
* @author: wangweiguo * @author: wangweiguo
* @date: 2021/9/7 * @date: 2021/9/7
* @since hrob2.1 * @since hrob2.1
*/ */
@Operation(summary ="根据部门父id或等级查询部门列表") @Operation(summary = "根据部门父id或等级查询部门列表", description = "根据部门父id或等级查询部门列表")
@GetMapping("/getBusDepartByLevelOrPid") @GetMapping("/getBusDepartByLevelOrPid")
public R<List<TBusDept>> getBusDepartByLevelOrPid(@RequestParam(name = "pid", required = false) Integer pid public R<List<TBusDept>> getBusDepartByLevelOrPid(
, @RequestParam Integer level) { @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); return this.tBusDeptService.getBusDepartByLevelOrPid(pid, level);
} }
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</select> </select>
<!-- 批量更新子集的treeLogo --> <!-- 批量更新子集的treeLogo -->
<update id="updateAllTreeLogo"> <update id="updateAllTreeLogo">
update update
t_bus_dept a t_bus_dept a
set set
......
...@@ -304,6 +304,15 @@ public interface CommonConstants { ...@@ -304,6 +304,15 @@ public interface CommonConstants {
String UPDATE_SUCCESS = "更新成功!"; 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 PARAM_IS_NOT_EMPTY = "参数不可为空";
String DATA_CAN_NOT_EMPTY = "数据不可为空"; String DATA_CAN_NOT_EMPTY = "数据不可为空";
......
package com.yifu.cloud.plus.v1.yifu.common.core.constant;
/**
* B端员工及合同相关静态数据
* @Author fxj
* @Date 2020-08-25
**/
public class EmpBusinessConstants {
private EmpBusinessConstants(){
throw new IllegalStateException("EmpBusinessConstants class");
}
public static final String empContractSituationNew = "新签";
public static final String empContractSituationRenew = "续签";
public static final int ninety = 90;
public static final String noSettleDomainAuth = "无结算主体权限,请联系管理员分配!";
public static final String selectSettleDomainOrCallManager = "请选择项目或联系管理员分配权限!";
}
...@@ -299,6 +299,21 @@ public class ArchivesDaprUtil { ...@@ -299,6 +299,21 @@ public class ArchivesDaprUtil {
return res; 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 * @Author fxj
* @Description 更新项目档案和人员档案的社保公积金状态 * @Description 更新项目档案和人员档案的社保公积金状态
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util; package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
...@@ -81,4 +82,12 @@ public class UpmsDaprUtils { ...@@ -81,4 +82,12 @@ public class UpmsDaprUtils {
} }
return allUserVoR; return allUserVoR;
} }
public R<SysUser> getSimpleUser(String userId) {
R<SysUser> userR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/user/inner/getSimpleUser",userId, SysUser.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(userR)){
return R.failed("获取所有用户数据失败!");
}
return userR;
}
} }
#\u6D4B\u8BD5\u73AF\u5883-\u7BA1\u7406\u540E\u53F0 #\u6D4B\u8BD5\u73AF\u5883
dapr.upms.appUrl=http://yifu-upms.qas-mvp.svc.cluster.local:3500/v1.0/invoke/ #\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.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 #\u6D4B\u8BD5\u73AF\u5883
dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/ #dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u672C\u5730 #\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.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://localhost:3508/v1.0/invoke/
dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appId=yifu-archives 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.social.appUrl=http://localhost:3509/v1.0/invoke/
dapr.insurances.appId=yifu-insurances 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://localhost:3513/v1.0/invoke/
dapr.salary.appUrl=http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.salary.appId=yifu-salary 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 #\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.appUrl=http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.social.appId=yifu-social #dapr.social.appId=yifu-social
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.common.security.util; package com.yifu.cloud.plus.v1.yifu.common.security.util;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
...@@ -90,4 +91,12 @@ public class SecurityUtils { ...@@ -90,4 +91,12 @@ public class SecurityUtils {
YifuUser user = getUser(); YifuUser user = getUser();
return null != user && null != user.getClientRoleMap() ? user.getClientRoleMap().get(client) : null; return null != user && null != user.getClientRoleMap() ? user.getClientRoleMap().get(client) : null;
} }
public static boolean isHaveAllOrg(String clientIdHrB, YifuUser user) {
if ( (CommonConstants.ONE_STRING.equals(user.getId()))){
return true;
}else{
return false;
}
}
} }
...@@ -372,6 +372,12 @@ public class UserController { ...@@ -372,6 +372,12 @@ public class UserController {
return userIds.toString(); return userIds.toString();
} }
@Inner
@PostMapping(value = {"/inner/getSimpleUser"})
public SysUser getSimpleUser(@RequestBody String userId) {
return userService.getById(userId);
}
/** /**
* @param nickName 用户名称 * @param nickName 用户名称
* @return 上级部门用户列表 * @return 上级部门用户列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment