Commit 9088881a authored by huyuchen's avatar huyuchen

审核权限增加

parent 1e057e16
/*
* 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.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@Data
@TableName("t_socialfund_house_res")
@EqualsAndHashCode()
@Schema(description = "社保公积金户权限配置表")
public class TSocialfundHouseRes {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
@TableField(exist = false)
private List<String> idList;
/**
* 登录人id
*/
@ExcelAttribute(name = "审核人id", maxLength = 32)
@Length(max = 32, message = "审核人id不能超过32个字符")
@ExcelProperty("审核人id")
@Schema(description = "审核人id")
private String userId;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", maxLength = 32)
@Length(max = 32, message = "社保户不能超过32个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialHousehold;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户", maxLength = 32)
@Length(max = 32, message = "公积金户不能超过32个字符")
@ExcelProperty("公积金户")
@Schema(description = "公积金户")
private String fundHousehold;
/**
* 被授权时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "被授权时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 授权人
*/
@ExcelAttribute(name = "授权人", maxLength = 32)
@ExcelProperty("授权人")
@Schema(description = "授权人")
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 状态0启用1禁用
*/
@ExcelAttribute(name = "状态0启用1禁用", maxLength = 1)
@Length(max = 1, message = "状态0启用1禁用不能超过1个字符")
@ExcelProperty("状态0启用1禁用")
@Schema(description = "状态0启用1禁用")
private String status;
/**
* 审核人姓名
*/
@ExcelAttribute(name = "审核人姓名", maxLength = 32)
@Length(max = 32, message = "审核人姓名不能超过32个字符")
@ExcelProperty("审核人姓名")
@Schema(description = "审核人姓名")
private String userName;
/**
* 所在部门
*/
@ExcelAttribute(name = "所在部门", maxLength = 32)
@Length(max = 32, message = "所在部门不能超过32个字符")
@ExcelProperty("所在部门")
@Schema(description = "所在部门")
private String userDeptName;
/**
* 户类型 0社保户1公积金户
*/
@ExcelAttribute(name = "户类型 0社保户1公积金户", maxLength = 1)
@Length(max = 1, message = "户类型 0社保户1公积金户不能超过1个字符")
@ExcelProperty("户类型 0社保户1公积金户")
@Schema(description = "户类型 0社保户1公积金户")
private String houseNameType;
}
...@@ -17,12 +17,17 @@ ...@@ -17,12 +17,17 @@
package com.yifu.cloud.plus.v1.yifu.social.controller; package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.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.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.social.entity.SysHouseHoldInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes;
import com.yifu.cloud.plus.v1.yifu.social.service.SysHouseHoldInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.SysHouseHoldInfoService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -120,4 +125,27 @@ public class SysHouseHoldInfoController { ...@@ -120,4 +125,27 @@ public class SysHouseHoldInfoController {
return R.ok(sysHouseHoldInfoService.removeById(id)); return R.ok(sysHouseHoldInfoService.removeById(id));
} }
/**
* @param flag 0/1
* @param name 户名
* @return 上级部门用户列表
*/
@PostMapping("/getHouseList")
@Operation(summary = "获取所有的户名", description = "获取所有的户名")
public R<List<SysHouseHoldInfo>> getSysUserList(@RequestParam String flag,
@RequestParam(required = false) String name) {
List<SysHouseHoldInfo> houseHoldList;
LambdaQueryWrapper<SysHouseHoldInfo> wrapper = Wrappers.lambdaQuery();
if (CommonConstants.ZERO_STRING.equals(flag)) {
wrapper.eq(SysHouseHoldInfo::getType, CommonConstants.ZERO_STRING);
if (Common.isNotNull(name)) {
wrapper.eq(SysHouseHoldInfo::getName, CommonConstants.ZERO_STRING);
}
} else {
wrapper.eq(SysHouseHoldInfo::getType, CommonConstants.ONE_STRING);
}
houseHoldList = sysHouseHoldInfoService.list(wrapper);
return R.ok(houseHoldList);
}
} }
/*
* 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 com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.social.entity.TSocialfundHouseRes;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialfundHouseResService;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialfundhouseres" )
@Tag(name = "社保公积金户权限配置表管理")
public class TSocialfundHouseResController {
private final TSocialfundHouseResService tSocialfundHouseResService;
/**
* 简单分页查询
* @param page 分页对象
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSocialfundHouseRes>> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, TSocialfundHouseRes tSocialfundHouseRes) {
return new R<>(tSocialfundHouseResService.getTSocialfundHouseResPage(page,tSocialfundHouseRes));
}
/**
* 导出查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
@Operation(summary = "导出查询", description = "导出查询")
@PostMapping("/exportList" )
public R<List<TSocialfundHouseRes>> getexportList(@RequestBody TSocialfundHouseRes tSocialfundHouseRes) {
return R.ok(tSocialfundHouseResService.getexportList(tSocialfundHouseRes));
}
/**
* 通过id查询社保公积金户权限配置表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsocialfundhouseres_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_get')" )
public R<TSocialfundHouseRes> getById(@PathVariable("id" ) String id) {
return R.ok(tSocialfundHouseResService.getById(id));
}
/**
* 新增社保公积金户权限配置表
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return R
*/
@Operation(summary = "新增社保公积金户权限配置表", description = "新增社保公积金户权限配置表:hasPermission('social_tsocialfundhouseres_add')")
@SysLog("新增社保公积金户权限配置表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_add')" )
public R save(@RequestBody TSocialfundHouseRes tSocialfundHouseRes) {
return tSocialfundHouseResService.saveSocialAuth(tSocialfundHouseRes);
}
/**
* 修改社保公积金户权限配置表
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return R
*/
@Operation(summary = "修改社保公积金户权限配置表", description = "修改社保公积金户权限配置表:hasPermission('social_tsocialfundhouseres_edit')")
@SysLog("修改社保公积金户权限配置表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_edit')" )
public R<Boolean> updateById(@RequestBody TSocialfundHouseRes tSocialfundHouseRes) {
return R.ok(tSocialfundHouseResService.updateById(tSocialfundHouseRes));
}
/**
* 通过id删除社保公积金户权限配置表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除社保公积金户权限配置表", description = "通过id删除社保公积金户权限配置表:hasPermission('social_tsocialfundhouseres_del')")
@SysLog("通过id删除社保公积金户权限配置表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialfundHouseResService.removeById(id));
}
}
/*
* 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.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@Mapper
public interface TSocialfundHouseResMapper extends BaseMapper<TSocialfundHouseRes> {
/**
* 社保公积金户权限配置表简单分页查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
IPage<TSocialfundHouseRes> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, @Param("tSocialfundHouseRes") TSocialfundHouseRes tSocialfundHouseRes);
/**
* 社保公积金户权限配置表导出查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
List<TSocialfundHouseRes> getexportList(@Param("tSocialfundHouseRes") TSocialfundHouseRes tSocialfundHouseRes);
}
/*
* 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.TSocialfundHouseRes;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
public interface TSocialfundHouseResService extends IService<TSocialfundHouseRes> {
/**
* 社保公积金户权限配置表简单分页查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
IPage<TSocialfundHouseRes> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, TSocialfundHouseRes tSocialfundHouseRes);
List<TSocialfundHouseRes> getexportList(TSocialfundHouseRes searchVo);
R saveSocialAuth(TSocialfundHouseRes searchVo);
}
/*
* 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.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.social.entity.TSocialfundHouseRes;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialfundHouseResMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialfundHouseResService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@Log4j2
@Service
public class TSocialfundHouseResServiceImpl extends ServiceImpl<TSocialfundHouseResMapper, TSocialfundHouseRes> implements TSocialfundHouseResService {
/**
* 社保公积金户权限配置表简单分页查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
@Override
public IPage<TSocialfundHouseRes> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, TSocialfundHouseRes tSocialfundHouseRes){
return baseMapper.getTSocialfundHouseResPage(page,tSocialfundHouseRes);
}
/**
* 社保公积金户权限配置表批量导出
* @param searchVo 社保公积金户权限配置表
* @return
*/
@Override
public List<TSocialfundHouseRes> getexportList(TSocialfundHouseRes searchVo) {
return baseMapper.getexportList(searchVo);
}
@Override
public R saveSocialAuth(TSocialfundHouseRes searchVo) {
LambdaQueryWrapper<TSocialfundHouseRes> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(searchVo.getSocialHousehold())) {
wrapper.eq(TSocialfundHouseRes::getSocialHousehold, searchVo.getSocialHousehold());
}
if (Common.isNotNull(searchVo.getFundHousehold())){
wrapper.eq(TSocialfundHouseRes::getFundHousehold,searchVo.getFundHousehold());
}
if (Common.isNotNull(searchVo.getUserId())){
wrapper.eq(TSocialfundHouseRes::getUserId,searchVo.getUserId());
}
TSocialfundHouseRes socialfundHouseRes = baseMapper.selectOne(wrapper);
if (Common.isNotNull(socialfundHouseRes)) {
return R.failed("员工已存在审核权限");
} else {
baseMapper.insert(searchVo);
return R.ok();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialfundHouseResMapper">
<resultMap id="tSocialfundHouseResMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="fundHousehold" column="FUND_HOUSEHOLD"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createBy" column="CREATE_BY"/>
<result property="status" column="STATUS"/>
<result property="userName" column="USER_NAME"/>
<result property="userDeptName" column="USER_DEPT_NAME"/>
<result property="houseNameType" column="HOUSE_NAME_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.SOCIAL_HOUSEHOLD,
a.FUND_HOUSEHOLD,
a.CREATE_TIME,
a.CREATE_BY,
a.STATUS,
a.USER_NAME,
a.USER_DEPT_NAME,
a.HOUSE_NAME_TYPE
</sql>
<sql id="tSocialfundHouseRes_where">
<if test="tSocialfundHouseRes != null">
<if test="tSocialfundHouseRes.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tSocialfundHouseRes.idList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
<if test="tSocialfundHouseRes.idList == null">
<if test="tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''">
AND a.SOCIAL_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.socialHousehold,'%'})
</if>
<if test="tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''">
AND a.FUND_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.fundHousehold,'%'})
</if>
<if test="tSocialfundHouseRes.status != null and tSocialfundHouseRes.status.trim() != ''">
AND a.STATUS = #{tSocialfundHouseRes.status}
</if>
<if test="tSocialfundHouseRes.userName != null and tSocialfundHouseRes.userName.trim() != ''">
AND a.USER_NAME like concat('%',#{tSocialfundHouseRes.userName,'%'})
</if>
<if test="tSocialfundHouseRes.userDeptName != null and tSocialfundHouseRes.userDeptName.trim() != ''">
AND a.USER_DEPT_NAME like concat('%',#{tSocialfundHouseRes.userDeptName,'%'})
</if>
</if>
</if>
</sql>
<!--tSocialfundHouseRes简单分页查询-->
<select id="getTSocialfundHouseResPage" resultMap="tSocialfundHouseResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_socialfund_house_res a
<where>
1=1
<include refid="tSocialfundHouseRes_where"/>
</where>
</select>
<!--tSocialfundHouseResa导出查询-->
<select id="getexportList" resultMap="tSocialfundHouseResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_socialfund_house_res a
<where>
1=1
<include refid="tSocialfundHouseRes_where"/>
</where>
</select>
</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