Commit b48a0c2a authored by huyuchen's avatar huyuchen

提供角色类表接口

parent 6ba0fda2
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author huyc
* @Date 2024-1-31 15:38:08
* @Description
* @Version 1.0
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.permission", ignoreInvalidFields = false)
public class DaprPermissionProperties {
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String appUrl;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmInitRoleInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprPermissionProperties;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
/**
* @Author huyc
* @Date 2024-01-31
* @Description
* @Version 1.0
*/
@Log4j2
@EnableConfigurationProperties(DaprPermissionProperties.class)
public class PermissionDaprUtil {
@Autowired
private DaprPermissionProperties daprProperties;
/**
* @Author huyc
* @Description 新增用户初始化角色信息
* @Date 2024/1/31
* @Param
* @return
**/
public void saveSysUserRole(HcmInitRoleInfoVo infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/sysuserroleres/inner/saveSysUserRole", JSON.toJSONString(infoVo), Object.class, SecurityConstants.FROM_IN);
}
}
...@@ -5,4 +5,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ ...@@ -5,4 +5,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils,\ com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil,\ com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil,\ com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.PermissionDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SalaryDaprUtil com.yifu.cloud.plus.v1.yifu.common.dapr.util.SalaryDaprUtil
...@@ -67,6 +67,11 @@ public class PersonVo { ...@@ -67,6 +67,11 @@ public class PersonVo {
@Attribute(name = "userPassword") @Attribute(name = "userPassword")
private String password; private String password;
/**
* 用户角色
*/
@Attribute(name = "x-init-role-ids")
private String roleIds;
/** /**
* 创建时间 * 创建时间
......
...@@ -28,6 +28,9 @@ public class PersonAttributesMapper implements AttributesMapper<PersonVo> { ...@@ -28,6 +28,9 @@ public class PersonAttributesMapper implements AttributesMapper<PersonVo> {
if (null != attributes.get("ou")) { if (null != attributes.get("ou")) {
personVo.setDeptName((String) attributes.get("ou").get()); personVo.setDeptName((String) attributes.get("ou").get());
} }
if (null != attributes.get("x-init-role-ids")) {
personVo.setRoleIds((String) attributes.get("x-init-role-ids").get());
}
return personVo; return personVo;
} }
} }
...@@ -64,6 +64,16 @@ public class SysUserRoleRes { ...@@ -64,6 +64,16 @@ public class SysUserRoleRes {
@Schema(description = "角色ID") @Schema(description = "角色ID")
private String roleId; private String roleId;
/**
* 登录名
*/
@ExcelAttribute(name = "登录名", isNotEmpty = true, errorInfo = "登录名不能为空", maxLength = 50)
@NotBlank(message = "登录名")
@Length(max = 50, message = "登录名不能超过50个字符")
@ExcelProperty("登录名")
@Schema(description = "登录名")
private String loginName;
@TableField(exist = false) @TableField(exist = false)
private String roleName; private String roleName;
......
...@@ -3,8 +3,10 @@ package com.yifu.cloud.plus.v1.permission.controller; ...@@ -3,8 +3,10 @@ package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.permission.service.SysUserRoleResService; import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmInitRoleInfoVo;
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.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes; import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo; import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
...@@ -121,4 +123,17 @@ public class SysUserRoleResController { ...@@ -121,4 +123,17 @@ public class SysUserRoleResController {
return R.ok(sysUserRoleResService.removeById(fdId)); return R.ok(sysUserRoleResService.removeById(fdId));
} }
/**
* @param vo
* @Description: 新增用户角色信息
* @Author: huyc
* @Date: 2024/2/18
* @return:
**/
@Inner
@PostMapping("/inner/saveSysUserRole")
public void saveSysUserRole(@RequestBody HcmInitRoleInfoVo vo) {
sysUserRoleResService.saveSysUserRole(vo);
}
} }
...@@ -51,13 +51,13 @@ public interface SysRoleInfoMapper extends BaseMapper<SysRoleInfo> { ...@@ -51,13 +51,13 @@ public interface SysRoleInfoMapper extends BaseMapper<SysRoleInfo> {
List<String> getRoleDataAuthByRoleId(@Param("roleIdList") List<String> roleIdList); List<String> getRoleDataAuthByRoleId(@Param("roleIdList") List<String> roleIdList);
/** /**
* @param userId * @param loginName
* @Description: 获取账号的所有权限 * @Description: 获取账号的所有权限
* @Author: hgw * @Author: hgw
* @Date: 2023/9/8 9:22 * @Date: 2023/9/8 9:22
* @return: java.util.List<java.lang.String> * @return: java.util.List<java.lang.String>
**/ **/
List<String> getAllRoleDataAuthByUserId(@Param("userId") String userId); List<String> getAllRoleDataAuthByUserId(@Param("loginName") String loginName);
/** /**
* @param roleName * @param roleName
......
...@@ -51,7 +51,7 @@ public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> { ...@@ -51,7 +51,7 @@ public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
List<SysUserInfo> getEkpUser(); List<SysUserInfo> getEkpUser();
List<SysUserRoleRes> getResAndRoleNameUserId(@Param("userId") String userId); List<SysUserRoleRes> getResAndRoleNameUserId(@Param("loginName") String loginName);
/** /**
......
...@@ -49,7 +49,7 @@ public interface SysUserRoleResMapper extends BaseMapper<SysUserRoleRes> { ...@@ -49,7 +49,7 @@ public interface SysUserRoleResMapper extends BaseMapper<SysUserRoleRes> {
**/ **/
List<String> getSysUserByRoleId(@Param("roleId") String roleId); List<String> getSysUserByRoleId(@Param("roleId") String roleId);
boolean deleteByUserId(@Param("userId") String userId); boolean deleteByUserId(@Param("loginName") String loginName);
boolean deleteByRoleId(@Param("roleId") String roleId); boolean deleteByRoleId(@Param("roleId") String roleId);
} }
...@@ -62,13 +62,13 @@ public interface SysRoleInfoService extends IService<SysRoleInfo> { ...@@ -62,13 +62,13 @@ public interface SysRoleInfoService extends IService<SysRoleInfo> {
List<SysRoleInfo> noPageDiy(SysRoleInfoSearchVo searchVo); List<SysRoleInfo> noPageDiy(SysRoleInfoSearchVo searchVo);
/** /**
* @param userId * @param loginName
* @Description: 各种角色的权限融合 * @Description: 各种角色的权限融合
* @Author: hgw * @Author: hgw
* @Date: 2023/8/30 18:06 * @Date: 2023/8/30 18:06
* @return: java.lang.String * @return: java.lang.String
**/ **/
String getAllRoleDataAuthByUserId(String userId); String getAllRoleDataAuthByUserId(String loginName);
/** /**
* @param roleIdList * @param roleIdList
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.permission.service; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.permission.service;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmInitRoleInfoVo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes; import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo; import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
...@@ -52,4 +53,6 @@ public interface SysUserRoleResService extends IService<SysUserRoleRes> { ...@@ -52,4 +53,6 @@ public interface SysUserRoleResService extends IService<SysUserRoleRes> {
**/ **/
boolean deleteByRoleId(String roleId); boolean deleteByRoleId(String roleId);
void saveSysUserRole(HcmInitRoleInfoVo vo);
} }
...@@ -137,8 +137,8 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo ...@@ -137,8 +137,8 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
} }
@Override @Override
public String getAllRoleDataAuthByUserId(String userId) { public String getAllRoleDataAuthByUserId(String loginName) {
List<String> authList = baseMapper.getAllRoleDataAuthByUserId(userId); List<String> authList = baseMapper.getAllRoleDataAuthByUserId(loginName);
return this.getAuths(authList); return this.getAuths(authList);
} }
......
...@@ -124,11 +124,11 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs ...@@ -124,11 +124,11 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
SysUserInfoSaveVo vo = new SysUserInfoSaveVo(); SysUserInfoSaveVo vo = new SysUserInfoSaveVo();
SysUserInfo user = this.getById(fdId); SysUserInfo user = this.getById(fdId);
if (user != null && Common.isNotNull(user.getFdId())) { if (user != null && Common.isNotNull(user.getFdId())) {
List<SysUserRoleRes> resList = baseMapper.getResAndRoleNameUserId(user.getFdId()); List<SysUserRoleRes> resList = baseMapper.getResAndRoleNameUserId(user.getFdLoginName());
vo.setUser(user); vo.setUser(user);
if (resList != null && !resList.isEmpty()) { if (resList != null && !resList.isEmpty()) {
// 各种角色的权限融合 // 各种角色的权限融合
String dataAuth = sysRoleInfoService.getAllRoleDataAuthByUserId(user.getFdId()); String dataAuth = sysRoleInfoService.getAllRoleDataAuthByUserId(user.getFdLoginName());
vo.setDataAuth(dataAuth); vo.setDataAuth(dataAuth);
} }
vo.setResList(resList); vo.setResList(resList);
...@@ -148,12 +148,13 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs ...@@ -148,12 +148,13 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
SysUserInfo user = vo.getUser(); SysUserInfo user = vo.getUser();
List<SysUserRoleRes> resList = vo.getResList(); List<SysUserRoleRes> resList = vo.getResList();
if (user != null && Common.isNotNull(user.getFdName()) && resList != null && !resList.isEmpty()) { if (user != null && Common.isNotNull(user.getFdName()) && resList != null && !resList.isEmpty()) {
if (Common.isNotNull(user.getFdId())) { if (Common.isNotNull(user.getFdLoginName())) {
sysUserRoleResService.deleteByUserId(user.getFdId()); sysUserRoleResService.deleteByUserId(user.getFdLoginName());
} }
this.saveOrUpdate(user); this.saveOrUpdate(user);
for (SysUserRoleRes res : resList) { for (SysUserRoleRes res : resList) {
res.setUserId(user.getFdId()); res.setUserId(user.getFdId());
res.setLoginName(user.getFdLoginName());
} }
sysUserRoleResService.saveBatch(resList); sysUserRoleResService.saveBatch(resList);
return R.ok("保存成功"); return R.ok("保存成功");
......
...@@ -22,7 +22,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -22,7 +22,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysUserRoleResMapper; import com.yifu.cloud.plus.v1.permission.mapper.SysUserRoleResMapper;
import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService; import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmInitRoleInfoVo;
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.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes; import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo; import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -76,8 +78,8 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper, ...@@ -76,8 +78,8 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper,
} }
@Override @Override
public boolean deleteByUserId(String userId) { public boolean deleteByUserId(String loginName) {
return baseMapper.deleteByUserId(userId); return baseMapper.deleteByUserId(loginName);
} }
@Override @Override
...@@ -85,6 +87,13 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper, ...@@ -85,6 +87,13 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper,
return baseMapper.deleteByRoleId(roleId); return baseMapper.deleteByRoleId(roleId);
} }
@Override
public void saveSysUserRole(HcmInitRoleInfoVo vo) {
SysUserRoleRes roleRes = new SysUserRoleRes();
BeanCopyUtils.copyProperties(vo,roleRes);
baseMapper.insert(roleRes);
}
private LambdaQueryWrapper buildQueryWrapper(SysUserRoleResSearchVo entity) { private LambdaQueryWrapper buildQueryWrapper(SysUserRoleResSearchVo entity) {
LambdaQueryWrapper<SysUserRoleRes> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<SysUserRoleRes> wrapper = Wrappers.lambdaQuery();
return wrapper; return wrapper;
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
a.data_auth a.data_auth
FROM sys_role_info a FROM sys_role_info a
left join sys_user_role_res r on r.role_id = a.fd_id left join sys_user_role_res r on r.role_id = a.fd_id
where a.delete_flag = 0 and r.user_id = #{userId} where a.delete_flag = 0 and r.login_name = #{loginName}
</select> </select>
<!-- 根据角色Id获取所有的角色的权限--> <!-- 根据角色Id获取所有的角色的权限-->
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM sys_user_info a FROM sys_user_info a
LEFT JOIN sys_user_role_res res on a.fd_id=res.user_id LEFT JOIN sys_user_role_res res on a.fd_login_name=res.login_name
LEFT JOIN sys_role_info r on res.role_id=r.fd_id and r.delete_flag = 0 and r.status = 0 LEFT JOIN sys_role_info r on res.role_id=r.fd_id and r.delete_flag = 0 and r.status = 0
<where> <where>
1=1 1=1
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
,r.role_name as roleName ,r.role_name as roleName
FROM sys_user_role_res a FROM sys_user_role_res a
LEFT JOIN sys_role_info r on a.role_id=r.fd_id and r.delete_flag = 0 and r.status = 0 LEFT JOIN sys_role_info r on a.role_id=r.fd_id and r.delete_flag = 0 and r.status = 0
where a.user_id=#{userId} where a.login_name=#{loginName}
</select> </select>
<!--给EKP用的,获取列表是否全量的权限--> <!--给EKP用的,获取列表是否全量的权限-->
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.fd_id, a.fd_id,
a.user_id, a.user_id,
a.login_name,
a.role_id a.role_id
</sql> </sql>
<sql id="sysUserRoleRes_where"> <sql id="sysUserRoleRes_where">
...@@ -68,7 +69,7 @@ ...@@ -68,7 +69,7 @@
<!-- 根据账号删除关联表 --> <!-- 根据账号删除关联表 -->
<delete id="deleteByUserId"> <delete id="deleteByUserId">
delete from sys_user_role_res where user_id = #{userId} delete from sys_user_role_res where login_name = #{loginName}
</delete> </delete>
<!-- 根据角色删除关联表 --> <!-- 根据角色删除关联表 -->
......
...@@ -1212,6 +1212,15 @@ public class TSocialFundInfo extends BaseEntity { ...@@ -1212,6 +1212,15 @@ public class TSocialFundInfo extends BaseEntity {
@ExcelProperty("公积金状态" ) @ExcelProperty("公积金状态" )
private String fundStatus; private String fundStatus;
/**
* 社保公积金查询的快照id
*/
@ExcelAttribute(name = "社保公积金查询的快照id", maxLength = 32)
@Schema(description = "社保公积金查询的快照id" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保公积金查询的快照id" )
private String reduceSocialFundId;
/** /**
* 派单ID (实时更新) * 派单ID (实时更新)
*/ */
......
...@@ -3,10 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.social.vo; ...@@ -3,10 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAuditInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TProvidentFund;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -40,6 +37,10 @@ public class DispatchDetailVo implements Serializable { ...@@ -40,6 +37,10 @@ public class DispatchDetailVo implements Serializable {
* 社保 * 社保
**/ **/
private TSocialInfo social; private TSocialInfo social;
/**
* 社保
**/
private TDispatchSocialFundInfo dispatchSocial;
/** /**
* 公积金 * 公积金
**/ **/
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 社保公积金查询表
*
* @author huyc
* @date 2024-02-01 11:38:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialfundinfo" )
@Tag(name = "社保公积金查询表管理")
public class TDispatchSocialFundInfoController {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchSocialFundInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* 社保公积金查询表
*
* @author huyc
* @date 2024-02-01 11:38:05
*/
@Mapper
public interface TDispatchSocialFundInfoMapper extends BaseMapper<TDispatchSocialFundInfo> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchSocialFundInfo;
/**
* 社保公积金查询表
*
* @author huyc
* @date 2024-02-01 11:38:05
*/
public interface TDispatchSocialFundInfoService extends IService<TDispatchSocialFundInfo> {
}
...@@ -60,10 +60,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants; ...@@ -60,10 +60,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants; import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*; import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*; import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.util.DoSocialTask; import com.yifu.cloud.plus.v1.yifu.social.util.DoSocialTask;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil; import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.*; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
...@@ -73,6 +70,7 @@ import org.apache.poi.ss.usermodel.Cell; ...@@ -73,6 +70,7 @@ import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType; import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType; import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
...@@ -136,6 +134,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -136,6 +134,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Autowired @Autowired
private DoSocialTask socialTask; private DoSocialTask socialTask;
private final TDispatchSocialFundInfoService infoService;
/** /**
* 派单信息记录表简单分页查询 * 派单信息记录表简单分页查询
* *
...@@ -347,6 +347,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -347,6 +347,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(entity.getCreateName())) { if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TDispatchInfo::getCreateName, entity.getCreateName()); wrapper.eq(TDispatchInfo::getCreateName, entity.getCreateName());
} }
if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TDispatchInfo::getEmpIdcard, entity.getEmpIdcard());
}
return wrapper; return wrapper;
} }
...@@ -2990,6 +2993,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2990,6 +2993,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
socialFundMapper.updateById(socialFund); socialFundMapper.updateById(socialFund);
//派减时生成社保公积金查询快照
TDispatchSocialFundInfo infoEntity = new TDispatchSocialFundInfo();
BeanUtils.copyProperties(socialFund,infoEntity);
infoEntity.setReduceSocialFundId(dispatch.getId());
infoService.save(infoEntity);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
}catch (Exception e){ }catch (Exception e){
log.error("批量派减异常:",e); log.error("批量派减异常:",e);
...@@ -3217,6 +3225,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3217,6 +3225,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchInfo dispatch = baseMapper.selectById(id); TDispatchInfo dispatch = baseMapper.selectById(id);
detailVo.setDispatch(dispatch); detailVo.setDispatch(dispatch);
if (Common.isNotNull(dispatch)){ if (Common.isNotNull(dispatch)){
TDispatchSocialFundInfo info = infoService.getOne(Wrappers.<TDispatchSocialFundInfo>query().lambda()
.eq(TDispatchSocialFundInfo::getReduceSocialFundId, id)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(info) && CommonConstants.ONE_STRING.equals(dispatch.getType())){
detailVo.setDispatchSocial(info);
}
if (Common.isNotNull(dispatch.getSocialId())){ if (Common.isNotNull(dispatch.getSocialId())){
detailVo.setSocial(socialMapper.selectById(dispatch.getSocialId())); detailVo.setSocial(socialMapper.selectById(dispatch.getSocialId()));
} }
...@@ -3306,6 +3320,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3306,6 +3320,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
int forecastFlag; int forecastFlag;
// 是否SSC,true是 // 是否SSC,true是
boolean isSSC; boolean isSSC;
TDispatchSocialFundInfo socialFundInfo;
for (TDispatchInfo dis : dispatchs) { for (TDispatchInfo dis : dispatchs) {
isSSC = CommonConstants.FIVE_STRING.equals(dis.getStatus()); isSSC = CommonConstants.FIVE_STRING.equals(dis.getStatus());
forecastFlag = getForecastFlag(dis); forecastFlag = getForecastFlag(dis);
...@@ -3539,8 +3555,28 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3539,8 +3555,28 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dis.setAuditTime(now); dis.setAuditTime(now);
baseMapper.updateById(dis); baseMapper.updateById(dis);
socialFundMapper.updateById(sf); socialFundMapper.updateById(sf);
//派减的申请审核完更新社保公积金查询快照表
if (CommonConstants.ONE_STRING.equals(dis.getType())) {
socialFundInfo = infoService.getOne(Wrappers.<TDispatchSocialFundInfo>query().lambda()
.eq(TDispatchSocialFundInfo::getReduceSocialFundId, dis.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(socialFundInfo)) {
socialFundInfo.setSocialStatus(sf.getSocialStatus());
socialFundInfo.setSocialReduceStatus(sf.getSocialReduceStatus());
socialFundInfo.setSocialReduceDate(sf.getSocialReduceDate());
socialFundInfo.setSocialAddStatus(sf.getSocialAddStatus());
socialFundInfo.setPensionHandle(sf.getPensionHandle());
socialFundInfo.setMedicalHandle(sf.getMedicalHandle());
socialFundInfo.setWorkInjuryHandle(sf.getWorkInjuryHandle());
socialFundInfo.setUnemployHandle(sf.getUnemployHandle());
socialFundInfo.setBirthHandle(sf.getBirthHandle());
socialFundInfo.setBigailmentHandle(sf.getBigailmentHandle());
infoService.updateById(socialFundInfo);
}
}
// 派增审核不通过 // 派增审核不通过
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())
&& CommonConstants.ONE_INT == flag){ && CommonConstants.ONE_INT == flag){
...@@ -3752,6 +3788,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3752,6 +3788,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// auditFlag 表示社保办理无办理项是不保存 // auditFlag 表示社保办理无办理项是不保存
boolean auditFlag = true; boolean auditFlag = true;
boolean partSuccess = false; boolean partSuccess = false;
TDispatchSocialFundInfo socialFundInfo;
for (TDispatchInfo dis : disList) { for (TDispatchInfo dis : disList) {
auditFlag = true; auditFlag = true;
if (CommonConstants.ZERO_STRING.equals(typeSub)) { if (CommonConstants.ZERO_STRING.equals(typeSub)) {
...@@ -4062,6 +4099,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4062,6 +4099,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
baseMapper.updateById(dis); baseMapper.updateById(dis);
socialFundMapper.updateById(sf); socialFundMapper.updateById(sf);
//派减的申请审核完更新社保公积金查询快照表
if (CommonConstants.ONE_STRING.equals(dis.getType())) {
socialFundInfo = infoService.getOne(Wrappers.<TDispatchSocialFundInfo>query().lambda()
.eq(TDispatchSocialFundInfo::getReduceSocialFundId, dis.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(socialFundInfo)) {
BeanUtils.copyProperties(sf,socialFundInfo);
infoService.updateById(socialFundInfo);
}
}
//1.派增办理失败 刷新预估数据 //1.派增办理失败 刷新预估数据
if (CommonConstants.ZERO_STRING.equals(dis.getType())) { if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
// 全部办理失败 社保和公积金派增办理失败 减少预估 // 全部办理失败 社保和公积金派增办理失败 减少预估
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchSocialFundInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchSocialFundInfoService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 社保公积金查询表
*
* @author huyc
* @date 2024-02-01 11:38:05
*/
@Log4j2
@RequiredArgsConstructor
@Service
public class TDispatchSocialFundInfoServiceImpl extends ServiceImpl<TDispatchSocialFundInfoMapper, TDispatchSocialFundInfo> implements TDispatchSocialFundInfoService {
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Data
public class HcmInitRoleInfoVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "角色id")
private String roleId;
@Schema(description = "用户id")
private String userId;
@Schema(description = "登录名")
private String loginName;
}
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.service.impl; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -30,10 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO; ...@@ -30,10 +31,7 @@ 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.dto.UserInfo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.*; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.*;
import com.yifu.cloud.plus.v1.yifu.admin.api.util.ParamResolver; import com.yifu.cloud.plus.v1.yifu.admin.api.util.ParamResolver;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.*;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserExcelVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPasswordVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.*; import com.yifu.cloud.plus.v1.yifu.admin.mapper.*;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysMenuService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysMenuService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService;
...@@ -42,8 +40,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; ...@@ -42,8 +40,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.enums.MenuTypeEnum; import com.yifu.cloud.plus.v1.yifu.common.core.constant.enums.MenuTypeEnum;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
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.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.PermissionDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo; import com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo;
import com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil; import com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -92,6 +94,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -92,6 +94,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private final ArchivesDaprUtil archivesDaprUtil; private final ArchivesDaprUtil archivesDaprUtil;
private final PermissionDaprUtil permissionDaprUtil;
/** /**
* 保存用户信息 * 保存用户信息
* @param userDto DTO 对象 * @param userDto DTO 对象
...@@ -502,6 +506,35 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -502,6 +506,35 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
} }
if (!insertList.isEmpty()) { if (!insertList.isEmpty()) {
baseMapper.batchInsertUser(insertList); baseMapper.batchInsertUser(insertList);
//新增用户的初始化角色
JSONObject jsonObject;
for (PersonVo personVo :insertList) {
if (Common.isNotNull(personVo.getRoleIds())) {
SysUser user = this.getOne(Wrappers.<SysUser>query().lambda().
eq(SysUser::getUsername, personVo.getUid()).last(CommonConstants.LAST_ONE_SQL));
jsonObject = JSONObject.parseObject(personVo.getRoleIds());
//获取mvp用户的角色
String userRole=jsonObject.get("hro")==null?"":jsonObject.getString("hro");
if (!userRole.isEmpty()) {
Common.getList(userRole).stream().map(roleId -> {
SysUserRole role = new SysUserRole();
role.setUserId(user.getUserId());
role.setRoleId(Long.valueOf(roleId));
return role;
}).forEach(sysUserRoleMapper::insert);
}
//获取ekp用户的角色
String ekpUserRole=jsonObject.get("ekp")==null?"":jsonObject.getString("ekp");
if (!ekpUserRole.isEmpty()) {
for (String roleId : Common.getList(ekpUserRole)) {
HcmInitRoleInfoVo vo = new HcmInitRoleInfoVo();
vo.setLoginName(user.getUsername());
vo.setRoleId(roleId);
permissionDaprUtil.saveSysUserRole(vo);
}
}
}
}
} }
} }
List<SearchResultEntry> entryList = ldapUtil.getAllPersonNamesWithTraditionalWay(); List<SearchResultEntry> entryList = ldapUtil.getAllPersonNamesWithTraditionalWay();
......
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