Commit cbacc555 authored by fangxinjiang's avatar fangxinjiang

Merge branch 'develop'

parents 923768da 6707e587
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* 客户数据权限表
......@@ -21,106 +22,82 @@ import java.time.LocalDateTime;
* @date 2019-07-19 16:22:22
*/
@Data
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("t_cutsomer_data_permisson")
@Schema(description = "客户数据权限表")
public class TCutsomerDataPermisson extends Model<TCutsomerDataPermisson> {
public class TCutsomerDataPermisson implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键", name = "id")
private String id;
/**
* 是否是数据所有者(0是1否)
*/
@NotBlank(message = "是否是数据所有者(0是1否)不能为空")
@Length(max = 1, message = "是否是数据所有者(0是1否)不能超过1个字符")
@ExcelAttribute(name = "是否是数据所有者(0是1否)", isNotEmpty = true, errorInfo = "是否是数据所有者(0是1否)不能为空", maxLength = 1)
@Schema(description = "是否是数据所有者(0是1否)", name = "isOwner")
private String isOwner;
/**
* 客户id
*/
@Length(max = 32, message = "客户id不能超过32个字符")
@ExcelAttribute(name = "客户id", maxLength = 32)
@Schema(description = "客户id", name = "customerId")
private String customerId;
/**
* 合同主体id
*/
@Length(max = 32, message = "合同主体id不能超过32个字符")
@ExcelAttribute(name = "合同主体id", maxLength = 32)
@Schema(description = "合同主体id", name = "contractId")
private String contractId;
/**
* 项目id
*/
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelAttribute(name = "项目id", maxLength = 32)
@Schema(description = "项目id", name = "settleDomainId")
private String settleDomainId;
/**
* 授权来源
*/
@NotBlank(message = "授权来源不能为空")
@Length(max = 50, message = "授权来源不能超过50个字符")
@ExcelAttribute(name = "授权来源", isNotEmpty = true, errorInfo = "授权来源不能为空", maxLength = 50)
@Schema(description = "授权来源", name = "permissonSrc")
private String permissonSrc;
/**
* 授权等级
*/
@NotBlank(message = "授权等级不能为空")
@ExcelAttribute(name = "授权等级", isNotEmpty = true, errorInfo = "授权等级不能为空")
@Schema(description = "授权等级", name = "permissonLevel")
private Integer permissonLevel;
/**
* 授权人
*/
@NotBlank(message = "授权人不能为空")
@Length(max = 32, message = "授权人不能超过32个字符")
@Schema(description = "授权人", name = "permissionUser")
private String permissionUser;
/**
* 被授权人
*/
@Length(max = 1, message = "状态不能超过1个字符")
@ExcelAttribute(name = "状态", maxLength = 1)
@Schema(description = "状态0启用1禁用")
private String status;
@Length(max = 32, message = "备注不能超过32个字符")
@ExcelAttribute(name = "备注", maxLength = 32)
@Schema(description = "备注")
private String remark;
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelAttribute(name = "项目id", maxLength = 32)
@Schema(description = "项目id")
private String settleDomainId;
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
private String settleDomainName;
@Length(max = 32, message = "项目编码不能超过32个字符")
@ExcelAttribute(name = "项目编码", maxLength = 32)
@Schema(description = "项目编码")
private String settleDomainNo;
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建人")
private String createName;
@Schema(description = "创建人")
@TableField(fill = FieldFill.INSERT)
@ExcelIgnore
private String createBy;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@NotBlank(message = "被授权人不能为空")
@Length(max = 32, message = "被授权人不能超过32个字符")
@ExcelAttribute(name = "被授权人", isNotEmpty = true, errorInfo = "被授权人不能为空", maxLength = 32)
@Schema(description = "被授权人", name = "bePermissonUser")
private String bePermissonUser;
/**
* 被授权时间
*/
@NotBlank(message = "被授权时间不能为空")
@ExcelAttribute(name = "被授权时间", isNotEmpty = true, errorInfo = "被授权时间不能为空")
@Schema(description = "被授权时间", name = "bePermissionTime")
private LocalDateTime bePermissionTime;
/**
* 备注
*/
@Length(max = 50, message = "备注不能超过50个字符")
@ExcelAttribute(name = "备注", maxLength = 50)
@Schema(description = "备注", name = "remark")
private String remark;
@Schema(description = "被授权人")
private String userId;
@Length(max = 1, message = "是否是客服不能超过1个字符")
@Schema(description = "是否是客服(0是1否)", name = "isCustomerService")
private String isCustomerService;
@ExcelAttribute(name = "登录名", maxLength = 50)
@Schema(description = "登录名")
private String userLoginName;
@Schema(description = "类型0:客户1:合同2:项目", name = "type")
@ExcelAttribute(name = "用户名称", maxLength = 50)
@Schema(description = "用户名称(汉字)")
private String userNickName;
@ExcelAttribute(name = "所在部门", maxLength = 50)
@Schema(description = "所在部门")
private String userDeptName;
@ExcelIgnore
@Schema(description = "授权来源0ekp,1mvp,2mvp复制")
private String type;
/**
* 无参构造方法
* @Author pwang
* @Date 2019-11-15 12:12
* @param
* @return
**/
public TCutsomerDataPermisson(){
}
@TableField(exist = false)
@ExcelIgnore
@Schema(description = "导出选中的行id数组")
private List<String> idList;
}
......@@ -144,9 +144,9 @@ public class TEmployeeProject extends BaseEntity {
private Integer isLeaveEmployee;
/**
* 已产生未结算费用 0:划转 1:不划转
* 已产生未结算费用 0:不划转 1:划转
*/
@Schema(description ="已产生未结算费用(0:划转 1:不划转)")
@Schema(description ="已产生未结算费用(0:不划转 1:划转)")
@TableField(exist = false)
private String unsettleDeal;
......
......@@ -71,7 +71,7 @@ public class EmployeeXProjectVO extends RowIndex implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="减项原因")
@NotNull(message = "减项原因不能为空")
@ExcelAttribute(name = "减项原因",isNotEmpty = true, errorInfo = "减项原因不能为空",maxLength = 100,isDataId = true,dataType = "reduce_project_reason")
@ExcelAttribute(name = "减项原因",isNotEmpty = true, errorInfo = "减项原因不能为空",maxLength = 100,isDataId = true,dataType = "social_reduce_reason")
private String leaveReason;
/**
......
......@@ -78,7 +78,6 @@ public class TEmpChangeInfoVO implements Serializable {
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="已产生未结算费用")
@NotNull(message = "已产生未结算费用不能为空")
private String unsettleDeal;
/**
......
......@@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCutsomerDataPermissonService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCutsomerDataPermissonVo;
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.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
......@@ -16,10 +14,10 @@ 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 org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
......@@ -45,9 +43,21 @@ public class TCutsomerDataPermissonController {
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TCutsomerDataPermissonVo>> getTCutsomerDataPermissonPage(Page<TCutsomerDataPermissonVo> page, TCutsomerDataPermissonVo tCutsomerDataPermisson) {
public R<IPage<TCutsomerDataPermisson>> getTCutsomerDataPermissonPage(Page<TCutsomerDataPermisson> page, TCutsomerDataPermisson tCutsomerDataPermisson) {
return new R<>(tCutsomerDataPermissonService.getTCutsomerDataPermissonPage(page,tCutsomerDataPermisson));
}
/**
* 导出list
* @param tCutsomerDataPermisson 客户数据权限表
* @return
*/
@Operation(description = "导出的list")
@GetMapping("/getList")
public R<List<TCutsomerDataPermisson>> getTCutsomerDataPermissonList(TCutsomerDataPermisson tCutsomerDataPermisson) {
return new R<>(tCutsomerDataPermissonService.getTCutsomerDataPermissonList(tCutsomerDataPermisson));
}
/**
* @Author fxj
* @Description 获取实体的权限: type-类型0:客户1:合同2:项目(不传默认2项目)
......@@ -55,21 +65,11 @@ public class TCutsomerDataPermissonController {
* @Param
* @return
**/
@Operation(description = "获取实体的权限: type-类型0:客户1:合同2:项目(不传默认2项目)")
@Operation(description = "获取实体的权限:默认项目")
@GetMapping("/getPermissonByTypeAndId")
public R<IPage<TCutsomerDataPermisson>> getTCutsomerDataPermissonByTypeAndId(String id, String type) {
if(Common.isEmpty(id)){
return R.failed("实体id");
}
public R<IPage<TCutsomerDataPermisson>> getTCutsomerDataPermissonByTypeAndId(@RequestParam String settleDomainId) {
TCutsomerDataPermisson tp = new TCutsomerDataPermisson();
if(CommonConstants.dingleDigitStrArray[0].equals(type)){
tp.setCustomerId(id);
}else if(CommonConstants.dingleDigitStrArray[1].equals(type)){
tp.setContractId(id);
}else{
tp.setSettleDomainId(id);
}
tp.setSettleDomainId(settleDomainId);
return new R(tCutsomerDataPermissonService.list(Wrappers.lambdaQuery(tp)));
}
......@@ -82,8 +82,8 @@ public class TCutsomerDataPermissonController {
**/
@Operation(description = "权限复制 权限同项目分配客服(wxhr:tsettledomain_assign_customerservice)")
@GetMapping("/copy")
@PreAuthorize("@pms.hasPermission('wxhr:tsettledomain_assign_customerservice')")
public R insertForCopyCutsomerDataPermisson(String[] srcUser, String[] beUser) {
//@PreAuthorize("@pms.hasPermission('tsettledomain_assign_customerservice')")
public R<String> insertForCopyCutsomerDataPermisson(String[] srcUser, String[] beUser) {
YifuUser user = SecurityUtils.getUser();
R result = tCutsomerDataPermissonService.insertForCopyCutsomerDataPermisson(srcUser, beUser, user);
if(CommonConstants.SUCCESS.equals(result.getCode())){//权限刷新
......@@ -111,8 +111,10 @@ public class TCutsomerDataPermissonController {
@Operation(description = "新增")
@SysLog("新增客户数据权限表")
@PostMapping
@PreAuthorize("@pms.hasPermission('wxhr:tcutsomerdatapermisson_add')")
public R save(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson){
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_add')")
public R<Boolean> save(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson){
YifuUser user = SecurityUtils.getUser();
settleDomainService.removeSettleCache(user, Arrays.asList(tCutsomerDataPermisson.getUserId()));
return new R<>(tCutsomerDataPermissonService.save(tCutsomerDataPermisson));
}
......@@ -124,8 +126,10 @@ public class TCutsomerDataPermissonController {
@Operation(description = "修改")
@SysLog("修改客户数据权限表")
@PutMapping
@PreAuthorize("@pms.hasPermission('wxhr:tcutsomerdatapermisson_edit')")
public R update(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson){
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_edit')")
public R<Boolean> update(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson) {
YifuUser user = SecurityUtils.getUser();
settleDomainService.removeSettleCache(user, Arrays.asList(tCutsomerDataPermisson.getUserId()));
return new R<>(tCutsomerDataPermissonService.updateById(tCutsomerDataPermisson));
}
......@@ -134,18 +138,18 @@ public class TCutsomerDataPermissonController {
* @param id
* @return R
*/
@Operation(description = "删除(wxhr:tcutsomerdatapermisson_del)")
@Operation(description = "删除(tcutsomerdatapermisson_del)")
@SysLog("删除客户数据权限表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('wxhr:tcutsomerdatapermisson_del')")
public R removeById(@PathVariable String id){
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_del')")
public R<Boolean> removeById(@PathVariable String id){
YifuUser user = SecurityUtils.getUser();
TCutsomerDataPermisson tdp = tCutsomerDataPermissonService.getById(id);
if(null == tdp){
return new R<>("权限已删除!");
return new R<>(true);
}
//刷新缓存
settleDomainService.removeSettleCache(user, Arrays.asList(tdp.getBePermissonUser()));
settleDomainService.removeSettleCache(user, Arrays.asList(tdp.getUserId()));
return new R<>(tCutsomerDataPermissonService.removeById(id));
}
......
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCutsomerDataPermissonVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -16,24 +17,16 @@ import java.util.List;
*/
@Mapper
public interface TCutsomerDataPermissonMapper extends BaseMapper<TCutsomerDataPermisson> {
/**
* 分页count
* @Author pwang
* @Date 2020-06-28 15:25
* @param tCutsomerDataPermisson
* @return
**/
long getTCutsomerDataPermissonPageCount( @Param("tCutsomerDataPermisson")TCutsomerDataPermisson tCutsomerDataPermisson);
/**
* 客户数据权限表简单分页查询
* @param tCutsomerDataPermisson 客户数据权限表
* @return
*/
List<TCutsomerDataPermissonVo> getTCutsomerDataPermissonPage(@Param("tCutsomerDataPermisson") TCutsomerDataPermissonVo tCutsomerDataPermisson, @Param("page")Long page, @Param("size")Long size);
IPage<TCutsomerDataPermisson> getTCutsomerDataPermissonPage(
Page<TCutsomerDataPermisson> page, @Param("tCutsomerDataPermisson") TCutsomerDataPermisson tCutsomerDataPermisson);
String getOwnerIdByIdAndType(@Param("domainId")String domainId, @Param("type")int type);
List<TCutsomerDataPermisson> getTCutsomerDataPermissonPage(@Param("tCutsomerDataPermisson") TCutsomerDataPermisson tCutsomerDataPermisson);
/**
* 获取当前登录人拥有的所有项目权限
......@@ -43,8 +36,4 @@ public interface TCutsomerDataPermissonMapper extends BaseMapper<TCutsomerDataPe
* @return
**/
List<TCutsomerDataPermisson> selectAllSettleDomainPermissionByUserId(@Param("userId")String userId);
String getCustomerServiceByid(@Param("id")String id);
String getUserByid(@Param("settleId")String settleId);
}
......@@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCutsomerDataPermissonVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import java.util.List;
/**
* 客户数据权限表
*
......@@ -21,44 +22,17 @@ public interface TCutsomerDataPermissonService extends IService<TCutsomerDataPer
* @param tCutsomerDataPermisson 客户数据权限表
* @return
*/
IPage<TCutsomerDataPermissonVo> getTCutsomerDataPermissonPage(Page<TCutsomerDataPermissonVo> page, TCutsomerDataPermissonVo tCutsomerDataPermisson);
/**
* 查询数据所有者id
* @Author pwang
* @Date 2019-07-24 15:31
* @param domainId 实体id
* @param type 实体类型0:单位1:部门2:项目
* @return 返回数据所有者的id串
**/
String findOwnerIdByIdAndType(String domainId,int type);
/**
* 查询数据所有者
* @Author pwang
* @Date 2019-07-24 15:31
* @param domainId 实体id
* @param type 实体类型0:单位1:部门2:项目
* @return 返回数据所有者
**/
YifuUser findOwnerByIdAndType(String domainId, int type);
// /**
// * 获取当前登录人拥有的所有项目权限
// * @Author fxj
// * @Date 2019-08-26
// * @param userId
// * @return
// **/
// List<TCutsomerDataPermisson> selectAllSettleDomainPermissionByUserId(int userId);
IPage<TCutsomerDataPermisson> getTCutsomerDataPermissonPage(Page<TCutsomerDataPermisson> page, TCutsomerDataPermisson tCutsomerDataPermisson);
String getCustomerServiceByid(String id);
/**
* 获取所有有权限的用户
* @Author pwang
* @Date 2019-11-28 14:54
* @param settleId
* @return
* @param tCutsomerDataPermisson
* @Description: 导出获取list
* @Author: hgw
* @Date: 2022/10/26 17:23
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson>
**/
String getUserByid(String settleId);
List<TCutsomerDataPermisson> getTCutsomerDataPermissonList(TCutsomerDataPermisson tCutsomerDataPermisson);
/**
* 权限复制 将srcUserList里面的所有用户权限(表)赋给 beUser 所有人
* @Author pwang
......@@ -68,15 +42,5 @@ public interface TCutsomerDataPermissonService extends IService<TCutsomerDataPer
* @param user user授权人
* @return
**/
R insertForCopyCutsomerDataPermisson(String[] srcUserList, String[] beUser, YifuUser user);
/**
* 专用方法 不建议调用 存在sql注入风险
* @Author pwang
* @Date 2020-07-02 19:00
* @param sql
* @param beUser
* @param user
* @return
**/
R insertCutsomerDataPermissonBySql(String sql, String beUser, YifuUser user);
R<String> insertForCopyCutsomerDataPermisson(String[] srcUserList, String[] beUser, YifuUser user);
}
......@@ -165,7 +165,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i);
excel.setUnsettleDeal(CommonConstants.IS_NO_CHANGE);
if (Common.isNotNull(excel.getChangeStartMonth()) && excel.getChangeStartMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
errorMsg.add("划转起始月长度不能超过6位");
}
......@@ -227,7 +227,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
}
updateTEmployeePro.setChangeStartMonth(excel.getChangeStartMonth());
updateTEmployeePro.setUnsettleDeal(excel.getUnsettleDeal());
updateTEmployeePro.setUnsettleDeal(CommonConstants.IS_NO_CHANGE);
updateList.add(updateTEmployeePro);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
......
......@@ -2167,7 +2167,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
c.setAuditTimeLast(LocalDateTime.now());
contractAudit.setAuditStatus("审核通过");
contractAudit.setRemark("派单审核通过,同步审核通过合同");
contractAudit.setRootName("合同审核-派单审核通过");
contractAudit.setRootName("合同审核");
contractServicer.updateInUseStatusById(c.getEmpId(),c.getDeptNo(),c.getId());
//审核不同
}else if (CommonConstants.ONE_STRING.equals(vo.getType())){
......@@ -2175,7 +2175,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
c.setInUse(CommonConstants.ONE_STRING);
contractAudit.setAuditStatus("审核不通过");
contractAudit.setRemark("派单审核不通过,同步审核不通过合同");
contractAudit.setRootName("合同审核-派单审核不通过");
contractAudit.setRootName("合同审核");
}
contractAuditMapper.insert(contractAudit);
contractServicer.updateById(c);
......
......@@ -600,7 +600,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (dictMap == null) {
return R.failed("获取字典失败!!");
}
empReduceMap = dictMap.get("reduce_project_reason");
empReduceMap = dictMap.get("social_reduce_reason");
}
String leaveReason = "";
......
......@@ -21,8 +21,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
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.AreaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCutsomerDataPermissonMapper;
......@@ -169,11 +171,11 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
}
// 处理服务团队数据权限 2022-09-19 fxj
if (Common.isNotNull(tSettleDomain.getServiceTeam())){
R<AllUserNaVo> res = upmsDaprUtils.getUserIdsByUserNames(tSettleDomain.getServiceTeam());
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserIds())){
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(tSettleDomain.getServiceTeam());
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserList())){
// 先清理缓存
this.removeSettleCache(null,res.getData().getUserIds());
saveForEkp(res.getData().getUserIds(),tSettleDomain.getId());
saveForEkp(res.getData().getUserList(), tSettleDomain);
}
}
tSettleDomain.setDeleteFlag(CommonConstants.ZERO_STRING);
......@@ -206,25 +208,28 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
* @Param
* @return
**/
public boolean saveForEkp(List<String> userIds, String domainId){
// 1. 先清除现有的这些的项目权限
public boolean saveForEkp(List<SysUser> userIds, TSettleDomain domain){
// 1. 先清除现有的这些的项目权限
permissonMapper.delete(Wrappers.<TCutsomerDataPermisson>query().lambda()
.in(TCutsomerDataPermisson::getBePermissonUser,userIds)
.eq(TCutsomerDataPermisson::getSettleDomainId,domainId));
.in(TCutsomerDataPermisson::getUserId,userIds)
.eq(TCutsomerDataPermisson::getSettleDomainId,domain.getId()));
// 2.新增新的项目人员权限
TCutsomerDataPermisson pm;
if (Common.isNotNull(userIds)){
for (String uId:userIds){
if (Common.isNotNull(userIds)) {
for (SysUser user : userIds){
pm = new TCutsomerDataPermisson();
pm.setIsCustomerService(CommonConstants.ZERO_STRING);
pm.setIsOwner(CommonConstants.ONE_STRING);
pm.setPermissonSrc("EKP服务团队");
pm.setPermissonLevel(CommonConstants.ONE_INT);
pm.setBePermissonUser(uId);
pm.setBePermissionTime(LocalDateTime.now());
pm.setSettleDomainId(domainId);
pm.setPermissionUser(CommonConstants.ONE_STRING);
pm.setType(CommonConstants.TWO_STRING);
pm.setStatus(CommonConstants.ZERO_STRING);
pm.setUserId(user.getUserId());
pm.setUserLoginName(user.getUsername());
pm.setUserNickName(user.getNickname());
pm.setUserDeptName(user.getDeptName());
pm.setCreateTime(LocalDateTime.now());
pm.setSettleDomainId(domain.getId());
pm.setSettleDomainName(domain.getDepartName());
pm.setSettleDomainNo(domain.getDepartNo());
pm.setCreateBy(CommonConstants.ONE_STRING);
pm.setCreateName("EKP同步");
pm.setType(CommonConstants.ZERO_STRING);
permissonMapper.insert(pm);
}
}
......
......@@ -6,145 +6,78 @@
<resultMap id="tCutsomerDataPermissonMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson">
<id property="id" column="ID"/>
<result property="isOwner" column="IS_OWNER"/>
<result property="contractId" column="CONTRACT_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="permissonSrc" column="PERMISSON_SRC"/>
<result property="permissonLevel" column="PERMISSON_LEVEL"/>
<result property="permissionUser" column="PERMISSION_USER"/>
<result property="bePermissonUser" column="BE_PERMISSON_USER"/>
<result property="bePermissionTime" column="BE_PERMISSION_TIME"/>
<result property="status" column="STATUS"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="userId" column="USER_ID"/>
<result property="userLoginName" column="USER_LOGIN_NAME"/>
<result property="userNickName" column="USER_NICK_NAME"/>
<result property="userDeptName" column="USER_DEPT_NAME"/>
<result property="remark" column="REMARK"/>
<result property="type" column="type"/>
<result property="settleDomainId" column="SETTLE_DOMAIN_ID"/>
</resultMap>
<resultMap id="tCutsomerDataPermissonMapVo" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TCutsomerDataPermissonVo">
<id property="id" column="ID"/>
<result property="isOwner" column="IS_OWNER"/>
<result property="contractId" column="CONTRACT_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="permissonSrc" column="PERMISSON_SRC"/>
<result property="permissonLevel" column="PERMISSON_LEVEL"/>
<result property="permissionUser" column="PERMISSION_USER"/>
<result property="bePermissonUser" column="BE_PERMISSON_USER"/>
<result property="bePermissionTime" column="BE_PERMISSION_TIME"/>
<result property="remark" column="REMARK"/>
<result property="settleDomainId" column="SETTLE_DOMAIN_ID"/>
<result property="type" column="type"/>
<result property="name" column="name"/>
<result property="permissionUserName" column="nickname"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="settleDomainNo" column="SETTLE_DOMAIN_NO"/>
</resultMap>
<sql id="base_column_list">
a.ID,
a.IS_OWNER,
a.CONTRACT_ID,
a.CUSTOMER_ID,
a.PERMISSON_SRC,
a.PERMISSON_LEVEL,
a.PERMISSION_USER,
a.BE_PERMISSON_USER,
a.BE_PERMISSION_TIME,
a.REMARK,
a.SETTLE_DOMAIN_ID,
a.type
</sql>
a.ID
,a.STATUS
,a.REMARK
,a.SETTLE_DOMAIN_ID
,a.CREATE_BY
,a.CREATE_NAME
,a.CREATE_TIME
,a.USER_ID
,a.USER_LOGIN_NAME
,a.USER_NICK_NAME
,a.USER_DEPT_NAME
,a.TYPE
,a.SETTLE_DOMAIN_NAME
,a.SETTLE_DOMAIN_NO
</sql>
<sql id="where_getTCutsomerDataPermissonPage">
<if test="tCutsomerDataPermisson.bePermissonUser != null and tCutsomerDataPermisson.bePermissonUser.trim() != ''">
AND a.BE_PERMISSON_USER = #{tCutsomerDataPermisson.bePermissonUser}
</if>
<if test="tCutsomerDataPermisson.type != null and tCutsomerDataPermisson.type.trim() != ''">
AND a.type = #{tCutsomerDataPermisson.type}
</if>
<if test="tCutsomerDataPermisson.name != null and tCutsomerDataPermisson.name.trim() != ''">
AND a.name like '%${tCutsomerDataPermisson.name}%'
</if>
<if test="tCutsomerDataPermisson.id != null and tCutsomerDataPermisson.id.trim() != ''">
AND a.ID = #{tCutsomerDataPermisson.id}
</if>
<if test="tCutsomerDataPermisson.isOwner != null and tCutsomerDataPermisson.isOwner.trim() != ''">
AND a.IS_OWNER = #{tCutsomerDataPermisson.isOwner}
</if>
<if test="tCutsomerDataPermisson.permissonSrc != null and tCutsomerDataPermisson.permissonSrc.trim() != ''">
AND a.PERMISSON_SRC = #{tCutsomerDataPermisson.permissonSrc}
</if>
<if test="tCutsomerDataPermisson.permissonLevel != null and tCutsomerDataPermisson.permissonLevel.trim() != ''">
AND a.PERMISSON_LEVEL = #{tCutsomerDataPermisson.permissonLevel}
</if>
<if test="tCutsomerDataPermisson.permissionUser != null and tCutsomerDataPermisson.permissionUser.trim() != ''">
AND a.PERMISSION_USER = #{tCutsomerDataPermisson.permissionUser}
</if>
<if test="tCutsomerDataPermisson.bePermissionTime != null and tCutsomerDataPermisson.bePermissionTime.trim() != ''">
AND a.BE_PERMISSION_TIME = #{tCutsomerDataPermisson.bePermissionTime}
</if>
<if test="tCutsomerDataPermisson.remark != null and tCutsomerDataPermisson.remark.trim() != ''">
AND a.REMARK = #{tCutsomerDataPermisson.remark}
</if>
<if test="tCutsomerDataPermisson != null">
<if test="tCutsomerDataPermisson.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tCutsomerDataPermisson.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tCutsomerDataPermisson.userNickName != null and tCutsomerDataPermisson.userNickName.trim() != ''">
AND a.USER_NICK_NAME like concat('%',#{tCutsomerDataPermisson.userNickName},'%')
</if>
<if test="tCutsomerDataPermisson.userLoginName != null and tCutsomerDataPermisson.userLoginName.trim() != ''">
AND a.USER_LOGIN_NAME like concat('%',#{tCutsomerDataPermisson.userLoginName},'%')
</if>
<if test="tCutsomerDataPermisson.userDeptName != null and tCutsomerDataPermisson.userDeptName.trim() != ''">
AND a.USER_DEPT_NAME like concat('%',#{tCutsomerDataPermisson.userDeptName},'%')
</if>
<if test="tCutsomerDataPermisson.status != null and tCutsomerDataPermisson.status.trim() != ''">
AND a.STATUS = #{tCutsomerDataPermisson.status}
</if>
<if test="tCutsomerDataPermisson.settleDomainName != null and tCutsomerDataPermisson.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME like '%${tCutsomerDataPermisson.settleDomainName}%'
</if>
<if test="tCutsomerDataPermisson.settleDomainNo != null and tCutsomerDataPermisson.settleDomainNo.trim() != ''">
AND a.SETTLE_DOMAIN_NO like '%${tCutsomerDataPermisson.settleDomainNo}%'
</if>
</if>
</sql>
<select id="getTCutsomerDataPermissonPageCount" resultType="java.lang.Long">
SELECT
count(1)
FROM view_cutsomer_permisson a
where 1=1
<include refid="where_getTCutsomerDataPermissonPage"/>
</select>
<!--查询-->
<select id="getTCutsomerDataPermissonPage" resultMap="tCutsomerDataPermissonMapVo">
<!--分页查询-->
<select id="getTCutsomerDataPermissonPage" resultMap="tCutsomerDataPermissonMap">
SELECT
<include refid="base_column_list"/>
,a.name
,u.nickname
from view_cutsomer_permisson a
left join yifu_cloud.sys_user u on a.PERMISSION_USER = u.user_id
<include refid="base_column_list"/>
from t_cutsomer_data_permisson a
where 1=1
<include refid="where_getTCutsomerDataPermissonPage"/>
ORDER BY a.BE_PERMISSION_TIME DESC
<if test="null != page and null != size">
limit #{page},#{size}
</if>
</select>
<select id="getOwnerIdByIdAndType" resultType="java.lang.String">
SELECT BE_PERMISSON_USER FROM t_cutsomer_data_permisson
WHERE IS_OWNER = '0'
<if test="0==type">
AND CUSTOMER_ID = '${domainId}'
</if>
<if test="1==type">
AND CONTRACT_ID = '${domainId}'
</if>
<if test="2==type">
AND SETTLE_DOMAIN_ID = '${domainId}'
</if>
ORDER BY BE_PERMISSION_TIME ASC
limit 1
<include refid="where_getTCutsomerDataPermissonPage"/>
ORDER BY a.CREATE_TIME DESC
</select>
<!-- 获取当前登录人拥有的所有项目权限 -->
<select id="selectAllSettleDomainPermissionByUserId" resultMap="tCutsomerDataPermissonMap">
SELECT
<include refid="base_column_list"/>
FROM t_cutsomer_data_permisson a
WHERE 1=1
AND SETTLE_DOMAIN_ID IS NOT NULL
AND BE_PERMISSON_USER = '${userId}'
</select>
<select id="getCustomerServiceByid" resultType="java.lang.String">
SELECT
GROUP_CONCAT(distinct BE_PERMISSON_USER )
FROM
t_cutsomer_data_permisson
WHERE
IS_CUSTOMER_SERVICE = '0'
AND SETTLE_DOMAIN_ID = '${id}'
WHERE a.STATUS = '0' and a.USER_ID = #{userId}
</select>
<select id="getUserByid" resultType="java.lang.String">
SELECT
GROUP_CONCAT(distinct BE_PERMISSON_USER )
FROM
t_cutsomer_data_permisson
WHERE
SETTLE_DOMAIN_ID = '${settleId}'
</select>
</mapper>
......@@ -392,6 +392,8 @@ public interface CommonConstants {
// 是否
String IS_CHANGE = "划转";
String IS_NO_CHANGE = "不划转";
// 年
String YEAR = "年";
// 月
......
......@@ -424,6 +424,11 @@ public interface ErrorCodes {
* 派增异常: 自定义缴纳养老基数不可为空
*/
String EMP_DISPATCH_SOCIAL_DIY_NOT_EMPTY = "emp.dispatch.social.diy.not.empty";
/**
* 派增异常: 自定义缴纳养老基数或养老起缴日期不可为空
*/
String EMP_DISPATCH_SOCIAL_DIY_MEDICAL_NOT_EMPTY = "emp.dispatch.social.diy.medical_not.empty";
/**
* 派增异常: 对应项目编码的项目档案已减项,请去项目档案处复项
*/
......
......@@ -155,6 +155,8 @@ socialinfo.list.num.large=\u5F53\u524D\u793E\u4FDD\u5BFC\u5165\u961F\u5217\u4E0D
emp.dispatch.social.diy.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u81EA\u5B9A\u4E49\u7F34\u7EB3\u517B\u8001\u57FA\u6570\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.social.diy.medical_not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u81EA\u5B9A\u4E49\u7F34\u7EB3\u517B\u8001\u57FA\u6570\u6216\u517B\u8001\u8D77\u7F34\u65E5\u671F\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.emp.project.not.used=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u7684\u9879\u76EE\u6863\u6848\u5DF2\u51CF\u9879\uFF0C\u8BF7\u53BB\u9879\u76EE\u6863\u6848\u5904\u590D\u9879
emp.dispatch.emp.not.used=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u7684\u4EBA\u5458\u6863\u6848\u5DF2\u51CF\u6863
......
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -59,8 +60,8 @@ public class UpmsDaprUtils {
* @Param
* @return
**/
public R<AllUserNaVo> getUserIdsByUserNames(String usernames) {
R<AllUserNaVo> allUserVoR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/user/inner/getUserIdsByUserNames", usernames, AllUserNaVo.class, SecurityConstants.FROM_IN);
public R<SysUserListVo> getUserIdsByUserNames(String usernames) {
R<SysUserListVo> allUserVoR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/user/inner/getUserIdsByUserNames", usernames, SysUserListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(allUserVoR)){
return R.failed("获取指定用户名对应用户IDs失败!");
}
......
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.ldap.util;
import com.unboundid.ldap.sdk.*;
import com.unboundid.ldap.sdk.controls.SubentriesRequestControl;
import com.unboundid.util.Base64;
import com.yifu.cloud.plus.v1.yifu.common.ldap.config.LdapProperties;
import com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo;
import com.yifu.cloud.plus.v1.yifu.common.ldap.mapper.PersonAttributesMapper;
......@@ -10,15 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.ldap.core.LdapTemplate;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
import javax.naming.ldap.Control;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import static org.springframework.ldap.query.LdapQueryBuilder.query;
......@@ -33,10 +29,6 @@ public class LdapUtil {
@Autowired
private LdapProperties ldapProperties;
private static LdapContext ctx = null;
private static final Control[] connCtls = null;
/**
* @return List<SearchResultEntry>
* @author huyc
......@@ -64,71 +56,31 @@ public class LdapUtil {
}
// 校验用户名密码的方法
public Boolean authenticate(String usr, String pwd) {
boolean valide;
public Boolean authenticate(String usr, String pwd) throws NoSuchAlgorithmException {
if (pwd == null || "".equals(pwd))
return false;
if (ctx == null) {
getCtx();
}
String userDN = getUserDN(usr);
if ("".equals(userDN) || userDN == null) {
return false;
}
try {
ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, userDN);
ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, pwd);
ctx.reconnect(connCtls);
valide = true;
closeCtx();
} catch (NamingException e) {
log.error(userDN + " is not authenticated");
valide = false;
}
return valide;
}
public void getCtx() {
if (ctx != null) {
return;
}
Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://" + ldapProperties.getUrl() + ":" + ldapProperties.getPort() +
"/" + ldapProperties.getDn());
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, ldapProperties.getUserName());
env.put(Context.SECURITY_CREDENTIALS, ldapProperties.getPassword());
try {
// 链接ldap
ctx = new InitialLdapContext(env, connCtls);
} catch (NamingException e) {
e.printStackTrace();
}
}
public void closeCtx() throws NamingException {
if (ctx != null)
ctx.close();
}
public String getUserDN(String uid) {
StringBuilder userDN = new StringBuilder();
try {
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
NamingEnumeration<?> en = ctx.search("", "uid=" + uid, constraints);
while (en != null && en.hasMoreElements()) {
Object obj = en.nextElement();
if (obj instanceof javax.naming.directory.SearchResult) {
javax.naming.directory.SearchResult si = (javax.naming.directory.SearchResult) obj;
userDN.append(si.getName());
userDN.append(",").append(ldapProperties.getDn());
List<SearchResultEntry> entryList = this.getAllPersonNamesWithTraditionalWay();
byte[] ldapPw = new byte[0];
for (SearchResultEntry resultEntry: entryList){
if (resultEntry.getDN().contains("uid="+usr)) {
String password = resultEntry.getAttributeValue("userPassword");
if (null != password) {
String ldapPwd1 = password.substring(5);
ldapPw = Base64.decode(ldapPwd1);
break;
} else {
return false;
}
}
}
} catch (Exception e) {
e.printStackTrace();
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(pwd.getBytes());
byte[] m = md5.digest();
return MessageDigest.isEqual(m, ldapPw);
} catch (ParseException e) {
log.error(" is not authenticated");
}
return userDN.toString();
return false;
}
}
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
......@@ -51,12 +52,6 @@ public class TDispatchAuditExportVo {
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工类型")
private String empType;
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Schema(description = "客户名称")
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -90,6 +85,7 @@ public class TDispatchAuditExportVo {
/**
* 合同起始时间
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "合同起始时间", isDate = true)
@Schema(description = "合同起始时间" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -107,6 +103,7 @@ public class TDispatchAuditExportVo {
/**
* 合同到期时间
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "合同到期时间", isDate = true)
@Schema(description = "合同到期时间" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -163,6 +160,7 @@ public class TDispatchAuditExportVo {
/**
* 离职日期
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "离职日期", isDate = true)
@Schema(description = "离职日期" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -176,10 +174,28 @@ public class TDispatchAuditExportVo {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("减少原因" )
private String reduceReason;
/**
* 社保起缴日期
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "社保起缴日期", isDate = true)
@Schema(description = "社保起缴日期" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保起缴日期" )
private Date socialStartDate;
/**
* 公积金起缴日期
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "公积金起缴日期", isDate = true)
@Schema(description = "公积金起缴日期" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金起缴日期" )
private Date providentStart;
/**
* 社保停缴日期
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "社保停缴日期", isDate = true)
@Schema(description = "社保停缴日期" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -189,6 +205,7 @@ public class TDispatchAuditExportVo {
/**
* 公积金停缴日期
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "公积金停缴日期", isDate = true)
@Schema(description = "公积金停缴日期" )
@HeadFontStyle(fontHeightInPoints = 11)
......
......@@ -1104,6 +1104,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setEmpName(excel.getEmpName());
dispatch.setEmpNational(excel.getEmpNational());
dispatch.setEmpType(excel.getEmpType());
dispatch.setTryPeriod(excel.getTryPeriod());
dispatch.setEmpMobile(excel.getEmpMobile());
dispatch.setType(CommonConstants.ZERO_STRING);
dispatch.setCurrentOperator(user.getNickname());
......@@ -2130,13 +2131,35 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return true;
}
// 非自定义的 基数 起缴日期不可空
if (Common.isNotNull(excel.getSocialHousehold())
&& !CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (Common.isEmpty(excel.getRecordBase())
|| Common.isEmpty(excel.getPensionStart())
)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_EMPTY)));
return true;
if (Common.isNotNull(excel.getSocialHousehold())){
if (!CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (Common.isEmpty(excel.getRecordBase())
|| Common.isEmpty(excel.getPensionStart()))
) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_EMPTY)));
return true;
}
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (Common.isNullOrZero(excel.getPensionCardinal()) || Common.isEmpty(excel.getPensionStart()))
&& !(
Common.isEmpty(excel.getPensionStart())
&& Common.isNotNull(excel.getWorkInjuryStart())
&& Common.isEmpty(excel.getMedicalStart())
&& Common.isEmpty(excel.getBirthStart())
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& Common.isNullOrZero(excel.getPensionCardinal())
&& Common.isNullOrZero(excel.getMedicalCardinal())
&& Common.isNullOrZero(excel.getBirthCardinal())
&& Common.isNullOrZero(excel.getUnemploymentCardinal())
&& !Common.isNullOrZero(excel.getWorkInjuryCardinal())
&& Common.isNullOrZero(excel.getBigailmentCardinal())
)
){
//养老基数为空 兼职工伤除外
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DIY_MEDICAL_NOT_EMPTY)));
return true;
}
}
// 兼职工伤 的起缴日期不可为空
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
......@@ -2565,6 +2588,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setSettleDomainCode(setInfoVo.getDepartNo());
dispatch.setBelongUnit(setInfoVo.getCustomerId());
dispatch.setBelongUnitName(setInfoVo.getCustomerName());
TEmployeeProject temp = new TEmployeeProject();
temp.setDeptId(dispatch.getSettleDomain());
temp.setEmpId(dispatch.getEmpId());
R<TEmployeeProject> res = archivesDaprUtil.getTEmployeeProjectById(temp);
if (Common.isNotNull(res)){
if (Common.isNotNull(res.getData().getWorkingHours())) {
dispatch.setWorkingHours(res.getData().getWorkingHours());
}
}
}
StringBuffer temp = new StringBuffer();
if (Common.isNotNull(excel.getSocialReduceDate())){
......@@ -2615,6 +2647,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setFundStatus(CommonConstants.FIVE_STRING);
socialFund.setFundReduceStatus(CommonConstants.ZERO_STRING);
}
if (Common.isNotNull(temp.toString())){
temp.deleteCharAt(temp.length()-1);
}
dispatch.setDispatchItem(temp.toString());
dispatch.setBelongUnitName(socialFund.getUnitName());
dispatch.setBelongUnit(socialFund.getUnitId());
......@@ -2631,6 +2666,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setFileProvince(empVo.getFileProvince());
dispatch.setFileCity(empVo.getFileCity());
dispatch.setFileTown(empVo.getFileTown());
dispatch.setContractName(empVo.getContractName());
dispatch.setContractSubName(empVo.getContractSubName());
}
return dispatch;
}
......
......@@ -619,7 +619,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
errorMessageList), yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
// 阻塞当前线程,等待所有的线程执行完毕
boolean computeFlag;
do {
......@@ -635,12 +634,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
log.error("社保缴费库数据批量导入异常:" + e);
redisUtil.remove(key);
}
// -----------------------------线程池处理list,批量保存社保信息结束--------------------------------
//最后一个推送
log.info("社保批量导入耗时:{}", (System.currentTimeMillis() - start) + "");
redisUtil.remove(key);
}
}
redisUtil.remove(key);
}
}
......@@ -2333,8 +2329,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
socialParam.setFd_3af9ee3aa9c84a(CommonConstants.EMPTY_STRING);
}
//实缴合计
if (Common.isNotNull(library.getSumAll())) {
socialParam.setFd_3af9ee3c6bfc74(library.getSumAll().toString());
if (Common.isNotNull(library.getSocialSum())) {
socialParam.setFd_3af9ee3c6bfc74(library.getSocialSum().toString());
} else {
socialParam.setFd_3af9ee3c6bfc74(CommonConstants.EMPTY_STRING);
}
......
......@@ -148,7 +148,6 @@
<resultMap id="exportAuditMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchAuditExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empType" column="EMP_TYPE"/>
<result property="belongUnitName" column="BELONG_UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="type" column="TYPE"/>
......@@ -178,7 +177,9 @@
<result property="personalUnemploymentCardinal" column="PERSONAL_UNEMPLOYMENT_CARDINAL"/>
<result property="personalBigailmentMoney" column="PERSONAL_BIGAILMENT_MONEY"/>
<result property="unitBigailmentMoney" column="UNIT_BIGAILMENT_MONEY"/>
<result property="socialStartDate" column="SOCIAL_START_DATE"/>
<result property="providentStart" column="PROVIDENT_START"/>
<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
<result property="personalProvidentCardinal" column="PERSONAL_PROVIDENT_CARDINAL"/>
<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
......@@ -613,7 +614,6 @@
select
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.TYPE,
......@@ -630,6 +630,7 @@
a.FUND_REDUCE_DATE,
a.LEAVE_DATE,
a.REDUCE_REASON,
b.SOCIAL_START_DATE,
b.PAYMENT_TYPE,
b.RECORD_BASE,
b.UNIT_PENSION_CARDINAL,
......@@ -643,6 +644,7 @@
b.PERSONAL_BIGAILMENT_MONEY,
b.UNIT_BIGAILMENT_MONEY,
c.UNIT_PROVIDENG_CARDINAL,
c.PROVIDENT_START,
c.PERSONAL_PROVIDENT_CARDINAL,
c.UNIT_PROVIDENT_PER,
c.PERSONAL_PROVIDENT_PER
......
......@@ -174,8 +174,8 @@
<result property="idCardTown" column="ID_CARD_TOWN"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE__CITY"/>
<result property="fileTown" column="FILE__TOWN"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="post" column="POST"/>
<result property="tryPeriod" column="TRY_PERIOD"/>
<result property="workingHours" column="WORKING_HOURS"/>
......
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author Hgw
* @Date 2022-10-26 17:09:09
* @Description
* @Version 1.0
*/
@Data
public class SysUserListVo implements Serializable {
private List<SysUser> userList;
private List<String> userIds;
}
......@@ -25,10 +25,7 @@ import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
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.UserExcelVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserInfoVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.*;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -45,6 +42,7 @@ import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -257,7 +255,7 @@ public class UserController {
*/
@SysLog("登录验证")
@PostMapping("/ldapLogin")
public R<Boolean> loginAuthentication(@RequestParam String userName,@RequestParam String password) {
public R<Boolean> loginAuthentication(@RequestParam String userName,@RequestParam String password) throws NoSuchAlgorithmException {
return userService.loginAuthentication(userName,password);
}
......@@ -304,8 +302,8 @@ public class UserController {
**/
@Inner
@PostMapping(value = {"/inner/getUserIdsByUserNames"})
public AllUserNaVo getUserIdsByUserNames(@RequestBody String usernames) {
AllUserNaVo naVo = new AllUserNaVo();
public SysUserListVo getUserIdsByUserNames(@RequestBody String usernames) {
SysUserListVo naVo = new SysUserListVo();
if (Common.isEmpty(usernames)){
return naVo;
}
......@@ -315,9 +313,9 @@ public class UserController {
List<String> userIds = new ArrayList<>();
for (SysUser u:sysUsers){
userIds.add(u.getUserId());
}
naVo.setUserIds(userIds);
naVo.setUserList(sysUsers);
}
return naVo;
}
......@@ -362,4 +360,21 @@ public class UserController {
}
return userIds.toString();
}
/**
* @param nickName 用户名称
* @return 上级部门用户列表
*/
@GetMapping("/getSysUserList")
@Operation(summary = "获取所有系统人员", description = "获取所有系统人员")
public R<List<SysUser>> getSysUserList(@RequestParam(required = false) String nickName) {
List<SysUser> sysUserList;
if (Common.isNotNull(nickName)) {
sysUserList = userService.list(Wrappers.<SysUser>query().lambda().like(SysUser::getNickname, nickName));
} else {
sysUserList = userService.list();
}
return R.ok(sysUserList);
}
}
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -41,4 +42,9 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
List<String> selectDnList();
SysDept selectCountId(@Param("deptId")Long deptId);
int updateDeptById(@Param("dept") SysDept dept);
SysDept selectDeptDn(@Param("deptDn")String deptDn);
}
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Set;
......@@ -132,6 +133,6 @@ public interface SysUserService extends IService<SysUser> {
* 从ldap中验证登录用户
* @return R
*/
R<Boolean> loginAuthentication(String userName, String password);
R<Boolean> loginAuthentication(String userName, String password) throws NoSuchAlgorithmException;
}
......@@ -60,8 +60,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
private final LdapUtil ldapUtil;
private final SysDeptMapper sysDeptMapper;
private final SysUserMapper sysUserMapper;
/**
......@@ -188,11 +186,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
//获取ldap所有的dn
List<String> entryDnList = entryList.stream().map(SearchResultEntry::getDN).collect(Collectors.toList());
//获取本地dept表中所有的dn
List<String> dnList = sysDeptMapper.selectDnList();
List<String> dnList = baseMapper.selectDnList();
List<String> delList = dnList.stream().filter(p-> !entryDnList.contains(p)).collect(Collectors.toList());
//删除ldap中不存在的dn的数据
if (!delList.isEmpty()) {
sysDeptMapper.delete(Wrappers.<SysDept>query().lambda().in(SysDept::getDeptDn, delList));
baseMapper.delete(Wrappers.<SysDept>query().lambda().in(SysDept::getDeptDn, delList));
}
List<Map<String,Object>> updUserList = new ArrayList<>();
for (SearchResultEntry entry : entryList) {
......@@ -206,35 +204,52 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
String deptName = saveDnList.get(0).replace("ou=", "");
int size = saveDnList.size();
if (size == 1) {
SysDept sysDept = this.getOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn));
SysDept sysDept = baseMapper.selectDeptDn(dn);
if (null == sysDept) {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(0L);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
if (StringUtils.isEmpty(userId)) {
SysDept ins = baseMapper.selectCountId(Long.valueOf(entry.getAttributeValue("x-ouid")));
if (Common.isNotNull(ins)) {
ins.setName(deptName);
ins.setDeptDn(dn);
baseMapper.updateDeptById(ins);
} else {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(0L);
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
baseMapper.insert(insertSysDept);
}
}
insertSysDept.setDeptDn(dn);
this.save(insertSysDept);
} else {
sysDept.setName(deptName);
this.updateDeptById(sysDept);
baseMapper.updateDeptById(sysDept);
}
} else {
try {
SysDept sysDept = this.getOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn.substring(dn.indexOf("ou=", 2), dn.length())));
if (null != sysDept) {
SysDept sysDeptCount = this.getOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn));
SysDept sysDeptCount = baseMapper.selectDeptDn(dn);
if (null == sysDeptCount) {
if (StringUtils.isEmpty(userId)) {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
SysDept ins = baseMapper.selectCountId(Long.valueOf(entry.getAttributeValue("x-ouid")));
if (Common.isNotNull(ins)) {
ins.setName(deptName);
ins.setDeptDn(dn);
ins.setParentId(sysDept.getDeptId());
baseMapper.updateDeptById(ins);
} else {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
baseMapper.insert(insertSysDept);
}
this.save(insertSysDept);
}
} else {
if (!StringUtils.isEmpty(userId)) {
......@@ -246,7 +261,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
}else {
sysDeptCount.setName(deptName);
sysDeptCount.setParentId(sysDept.getDeptId());
this.updateDeptById(sysDeptCount);
sysDeptCount.setDeptDn(dn);
baseMapper.updateDeptById(sysDeptCount);
}
}
}
......
......@@ -55,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.validation.BindingResult;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -82,8 +83,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private final LdapUtil ldapUtil;
private final SysUserMapper sysUserMapper;
/**
* 保存用户信息
* @param userDto DTO 对象
......@@ -431,10 +430,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
}
if (!updateList.isEmpty()) {
sysUserMapper.batchUpdateUser(updateList);
baseMapper.batchUpdateUser(updateList);
}
if (!insertList.isEmpty()) {
sysUserMapper.batchInsertUser(insertList);
baseMapper.batchInsertUser(insertList);
}
}
List<SearchResultEntry> entryList = ldapUtil.getAllPersonNamesWithTraditionalWay();
......@@ -455,38 +454,55 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userId = dn.substring(4, dn.indexOf(",", 1));
dn = dn.substring(dn.indexOf(",", 1) + 1);
}
List<String> saveDnList = Arrays.stream(dn.split(",")).filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList());
List<String> saveDnList = Arrays.asList(dn.split(",")).stream().filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList());
String deptName = saveDnList.get(0).replace("ou=", "");
int size = saveDnList.size();
if (size == 1) {
SysDept sysDept = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn));
SysDept sysDept = sysDeptMapper.selectDeptDn(dn);
if (null == sysDept) {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(0L);
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
if (StringUtils.isEmpty(userId)) {
SysDept ins = sysDeptMapper.selectCountId(Long.valueOf(entry.getAttributeValue("x-ouid")));
if (Common.isNotNull(ins)) {
ins.setName(deptName);
ins.setDeptDn(dn);
sysDeptMapper.updateDeptById(ins);
} else {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(0L);
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
sysDeptMapper.insert(insertSysDept);
}
}
sysDeptMapper.insert(insertSysDept);
} else {
sysDept.setName(deptName);
sysDeptMapper.updateById(sysDept);
sysDeptMapper.updateDeptById(sysDept);
}
} else {
SysDept sysDept = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn.substring(dn.indexOf("ou=", 2), dn.length())));
if (null != sysDept) {
SysDept sysDeptCount = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn));
SysDept sysDeptCount = sysDeptMapper.selectDeptDn(dn);
if (null == sysDeptCount) {
if (StringUtils.isEmpty(userId)) {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
SysDept ins = sysDeptMapper.selectCountId(Long.valueOf(entry.getAttributeValue("x-ouid")));
if (Common.isNotNull(ins)) {
ins.setName(deptName);
ins.setDeptDn(dn);
ins.setParentId(sysDept.getDeptId());
sysDeptMapper.updateDeptById(ins);
} else {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
sysDeptMapper.insert(insertSysDept);
}
sysDeptMapper.insert(insertSysDept);
}
} else {
if (!StringUtils.isEmpty(userId)) {
......@@ -497,15 +513,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
updUserList.add(map);
}else {
sysDeptCount.setName(deptName);
sysDeptCount.setDeptDn(dn);
sysDeptCount.setParentId(sysDept.getDeptId());
sysDeptMapper.updateById(sysDeptCount);
sysDeptMapper.updateDeptById(sysDeptCount);
}
}
}
}
}
//更新用户信息
sysUserMapper.updateUser(updUserList);
if (!updUserList.isEmpty()) {
baseMapper.updateUser(updUserList);
}
}catch (Exception e) {
log.info("用户部门信息同步异常:" + e.getMessage());
return R.failed("用户部门信息同步异常!");
......@@ -518,8 +537,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @return R
*/
@Override
public R<Boolean> loginAuthentication(String userName, String password) {
if (ldapUtil.authenticate(userName,password)) {
public R<Boolean> loginAuthentication(String userName, String password) throws NoSuchAlgorithmException {
if (Boolean.TRUE.equals(ldapUtil.authenticate(userName,password))) {
return R.ok();
}
return R.failed("验证不通过");
......
......@@ -38,4 +38,33 @@
WHERE a.del_flag = 0
AND a.dept_dn IS NOT NULL
</select>
<select id="selectCountId" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept">
SELECT
*
from sys_dept a
<where>
a.dept_id = #{deptId}
</where>
</select>
<select id="selectDeptDn" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept">
SELECT
*
from sys_dept a
<where>
a.dept_dn = #{deptDn}
</where>
</select>
<update id="updateDeptById">
update sys_dept
<trim prefix="set" suffixOverrides=",">
<if test="dept.name != null">name=#{dept.name},</if>
<if test="dept.parentId != null">parent_id=#{dept.parentId},</if>
<if test="dept.deptDn != null">dept_dn=#{dept.deptDn},</if>
update_time = now()
</trim>
WHERE dept_id=#{dept.deptId}
</update>
</mapper>
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