Commit 1e057e16 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/develop' into develop

parents e89deff2 42b7ef7e
/*
* 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.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
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 org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
@TableName("t_employee_contract_area_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同地市权限配置表")
public class TEmployeeContractAreaRes extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 登录人id
*/
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id不能为空", maxLength = 32)
@NotBlank(message = "登录人id不能为空")
@Length(max = 32, message = "登录人id不能超过32个字符")
@ExcelProperty("登录人id")
@Schema(description = "登录人id")
private String userId;
/**
* 登录人姓名
*/
@ExcelProperty("审核人")
@Schema(description = "审核人")
private String userName;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县")
@ExcelProperty("档案-县")
@Schema(description = "档案-县")
private Integer fileTown;
/**
* 申請人所在部门
*/
@ExcelAttribute(name = "审核人所在部门")
@ExcelProperty("办审核人所在部门")
@Schema(description = "审核人所在部门")
private Integer organName;
/**
* 状态 0 启用 1 禁用
*/
@ExcelAttribute(name = "状态")
@ExcelProperty("状态")
@Schema(description = "状态:0 启用 1 禁用")
private String status;
}
/*
* 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.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
public class TEmpContractAreaExportVo implements Serializable {
/**
* 登录人姓名
*/
@ExcelProperty("审核人")
@Schema(description = "审核人")
private String userName;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县")
@ExcelProperty("档案-县")
@Schema(description = "档案-县")
private Integer fileTown;
/**
* 申請人所在部门
*/
@ExcelAttribute(name = "审核人所在部门")
@ExcelProperty("办审核人所在部门")
@Schema(description = "审核人所在部门")
private Integer organName;
/**
* 状态 0 启用 1 禁用
*/
@ExcelAttribute(name = "授权状态")
@ExcelProperty("授权状态")
@Schema(description = "授权状态:0 启用 1 禁用")
private String status;
}
/*
* 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.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
public class TEmployeeContractAreaResSearchVo extends TEmployeeContractAreaRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
public class TEmployeeContractAreaResVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 登录人id
*/
@NotBlank(message = "登录人id 不能为空")
@Length(max = 32, message = "登录人id 不能超过32 个字符")
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id 不能为空", maxLength = 32)
@Schema(description = "登录人id")
@ExcelProperty("登录人id")
private String userId;
/**
* 档案-省
*/
@NotBlank(message = "档案-省 不能为空")
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省 不能为空")
@Schema(description = "档案-省")
@ExcelProperty("档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@Schema(description = "档案-市")
@ExcelProperty("档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县")
@Schema(description = "档案-县")
@ExcelProperty("档案-县")
private Integer fileTown;
}
/*
* 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.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAreaResService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeecontractareares")
@Tag(name = "合同地市权限配置表管理")
public class TEmployeeContractAreaResController {
private final TEmployeeContractAreaResService tEmployeeContractAreaResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TEmployeeContractAreaRes>> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, TEmployeeContractAreaResSearchVo tEmployeeContractAreaRes) {
return new R<>(tEmployeeContractAreaResService.getTEmployeeContractAreaResPage(page, tEmployeeContractAreaRes));
}
/**
* 不分页查询
*
* @param searchVo 合同地市权限配置表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('temployeecontractareares_get')" )
public R<List<TEmpContractAreaExportVo>> getTEmployeeContractAreaResNoPage(@RequestBody TEmployeeContractAreaResSearchVo searchVo) {
return R.ok(tEmployeeContractAreaResService.noPageDiy(searchVo,null, Common.getList(searchVo.getIds()),null));
}
/**
* 通过id查询合同地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('temployeecontractareares_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_get')")
public R<TEmployeeContractAreaRes> getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContractAreaResService.getById(id));
}
/**
* 新增合同地市权限配置表
*
* @param areaRes 合同地市权限配置表
* @return R
*/
@Operation(summary = "新增合同地市权限配置表", description = "新增合同地市权限配置表:hasPermission('temployeecontractareares_add')")
@SysLog("新增合同地市权限配置表")
@PostMapping
@PreAuthorize("@pms.hasPermission('temployeecontractareares_add')")
public R<Boolean> save(@RequestBody TEmployeeContractAreaRes areaRes) {
TEmployeeContractAreaRes res = tEmployeeContractAreaResService.getOne(Wrappers.<TEmployeeContractAreaRes>query().lambda()
.eq(TEmployeeContractAreaRes::getFileProvince,areaRes.getFileProvince())
.eq(TEmployeeContractAreaRes::getFileCity,areaRes.getFileCity())
.eq(TEmployeeContractAreaRes::getFileTown,areaRes.getFileTown())
.eq(TEmployeeContractAreaRes::getUserId,areaRes.getUserId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(res)){
return R.failed("已存在对应审核人及地市配置!");
}
return R.ok(tEmployeeContractAreaResService.save(areaRes));
}
/**
* 修改合同地市权限配置表
*
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return R
*/
@Operation(summary = "修改合同地市权限配置表", description = "修改合同地市权限配置表:hasPermission('temployeecontractareares_edit')")
@SysLog("修改合同地市权限配置表")
@PutMapping
@PreAuthorize("@pms.hasPermission('temployeecontractareares_edit')")
public R<Boolean> updateById(@RequestBody TEmployeeContractAreaRes tEmployeeContractAreaRes) {
return R.ok(tEmployeeContractAreaResService.updateById(tEmployeeContractAreaRes));
}
/**
* 通过id启用或禁用合同地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id启用或禁用合同地市权限配置表", description = "通过id启用或禁用(0 启用,1禁用)合同地市权限配置表:hasPermission('temployeecontractareares_edit')")
@SysLog("通过id启用或禁用合同地市权限配置表")
@DeleteMapping("/updateStatus")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_edit')")
public R<Boolean> removeById(@RequestParam(name = "id",required = true) String id,
@RequestParam(name = "status",required = true) String status) {
TEmployeeContractAreaRes areaRes = tEmployeeContractAreaResService.getById(id);
if (Common.isEmpty(areaRes)
|| !(CommonConstants.ONE_STRING).equals(status)
&& !CommonConstants.ZERO_STRING.equals(status)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
areaRes.setStatus(status);
return R.ok(tEmployeeContractAreaResService.updateById(areaRes));
}
/**
* 通过id删除合同地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除合同地市权限配置表", description = "通过id删除合同地市权限配置表:hasPermission('temployeecontractareares_del')")
@SysLog("通过id删除合同地市权限配置表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmployeeContractAreaResService.removeById(id));
}
/**
* 合同地市权限配置表 批量导入
*
* @author fxj
* @date 2022-11-01 10:30:12
**/
@SneakyThrows
@Operation(description = "批量新增合同地市权限配置表 hasPermission('temployeecontractareares-batch-import')")
@SysLog("批量新增合同地市权限配置表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('temployeecontractareares-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tEmployeeContractAreaResService.importDiy(file.getInputStream());
}
/**
* 合同地市权限配置表 批量导出
*
* @author fxj
* @date 2022-11-01 10:30:12
**/
@Operation(description = "导出合同地市权限配置表 hasPermission('temployeecontractareares-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('temployeecontractareares-export')")
public void export(HttpServletResponse response, @RequestBody TEmployeeContractAreaResSearchVo searchVo) {
tEmployeeContractAreaResService.listExport(response, 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.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.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Mapper
public interface TEmployeeContractAreaResMapper extends BaseMapper<TEmployeeContractAreaRes> {
/**
* 合同地市权限配置表简单分页查询
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
IPage<TEmployeeContractAreaRes> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, @Param("tEmployeeContractAreaRes") TEmployeeContractAreaRes tEmployeeContractAreaRes);
List<TEmpContractAreaExportVo> noPageDiy(@Param("tEmployeeContractAreaRes") TEmployeeContractAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
int noPageCountDiy(@Param("tEmployeeContractAreaRes") TEmployeeContractAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
}
/*
* 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.archives.service;
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.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
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 fxj
* @date 2022-11-01 10:30:12
*/
public interface TEmployeeContractAreaResService extends IService<TEmployeeContractAreaRes> {
/**
* 合同地市权限配置表简单分页查询
*
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
IPage<TEmployeeContractAreaRes> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, TEmployeeContractAreaResSearchVo tEmployeeContractAreaRes);
List<TEmpContractAreaExportVo> noPageDiy(TEmployeeContractAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TEmployeeContractAreaResSearchVo 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.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractAreaResMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAreaResService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Log4j2
@Service
public class TEmployeeContractAreaResServiceImpl extends ServiceImpl<TEmployeeContractAreaResMapper, TEmployeeContractAreaRes> implements TEmployeeContractAreaResService {
/**
* 合同地市权限配置表简单分页查询
*
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
@Override
public IPage<TEmployeeContractAreaRes> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, TEmployeeContractAreaResSearchVo tEmployeeContractAreaRes) {
return baseMapper.getTEmployeeContractAreaResPage(page, tEmployeeContractAreaRes);
}
/**
* 合同地市权限配置表批量导出
*
* @param searchVo 合同地市权限配置表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TEmployeeContractAreaResSearchVo searchVo) {
String fileName = "合同地市权限配置表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TEmpContractAreaExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo,null, Common.getList(searchVo.getIds()),null);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TEmployeeContractAreaRes.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo,null, Common.getList(searchVo.getIds()),null);
if (Common.isNotNull(list)) {
ExcelUtil<TEmpContractAreaExportVo> util = new ExcelUtil<>(TEmpContractAreaExportVo.class);
for (TEmpContractAreaExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("合同地市权限配置表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("合同地市权限配置表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public List<TEmpContractAreaExportVo> noPageDiy(TEmployeeContractAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageDiy(searchVo,settleDomainIds,ids,sql);
}
private int noPageCountDiy(TEmployeeContractAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageCountDiy(searchVo,settleDomainIds,ids,sql);
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TEmployeeContractAreaResVo> util1 = new ExcelUtil<>(TEmployeeContractAreaResVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TEmployeeContractAreaResVo.class, new ReadListener<TEmployeeContractAreaResVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TEmployeeContractAreaResVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TEmployeeContractAreaResVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTEmployeeContractAreaRes(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTEmployeeContractAreaRes(List<TEmployeeContractAreaResVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TEmployeeContractAreaResVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TEmployeeContractAreaResVo excel) {
TEmployeeContractAreaRes insert = new TEmployeeContractAreaRes();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
<?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.archives.mapper.TEmployeeContractAreaResMapper">
<resultMap id="tEmployeeContractAreaResMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<resultMap id="empContractAreaResExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo">
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,a.USER_NAME,a.STATUS,a.ORGAN_NAME
</sql>
<sql id="tEmployeeContractAreaRes_where">
<if test="tEmployeeContractAreaRes != null">
<if test="tEmployeeContractAreaRes.id != null and tEmployeeContractAreaRes.id.trim() != ''">
AND a.ID = #{tEmployeeContractAreaRes.id}
</if>
<if test="tEmployeeContractAreaRes.userId != null and tEmployeeContractAreaRes.userId.trim() != ''">
AND a.USER_ID = #{tEmployeeContractAreaRes.userId}
</if>
<if test="tEmployeeContractAreaRes.fileProvince != null">
AND a.FILE_PROVINCE = #{tEmployeeContractAreaRes.fileProvince}
</if>
<if test="tEmployeeContractAreaRes.fileCity != null">
AND a.FILE_CITY = #{tEmployeeContractAreaRes.fileCity}
</if>
<if test="tEmployeeContractAreaRes.fileTown != null">
AND a.FILE_TOWN = #{tEmployeeContractAreaRes.fileTown}
</if>
<if test="tEmployeeContractAreaRes.status!= null">
AND a.status like CONCAT(#{tInsuranceAreaRes.status},'%')
</if>
<if test="tEmployeeContractAreaRes.userName != null">
AND a.USER_NAME like CONCAT(#{tInsuranceAreaRes.userName},'%')
</if>
<if test="tEmployeeContractAreaRes.organName != null">
AND a.ORGAN_NAME like CONCAT(#{tInsuranceAreaRes.organName},'%')
</if>
</if>
</sql>
<!--tEmployeeContractAreaRes简单分页查询-->
<select id="getTEmployeeContractAreaResPage" resultMap="tEmployeeContractAreaResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_contract_area_res a
<where>
1=1
<include refid="tEmployeeContractAreaRes_where"/>
</where>
</select>
<select id="noPageDiy" resultMap="empContractAreaResExportMap">
SELECT
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,a.USER_NAME,a.STATUS,a.ORGAN_NAME
FROM t_employee_contract_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tEmployeeContractAreaRes != null">
<if test="tEmployeeContractAreaRes.authSql != null and tEmployeeContractAreaRes.authSql.trim() != ''">
${tEmployeeContractAreaRes.authSql}
</if>
<if test="tEmployeeContractAreaRes.limitStart != null">
limit #{tEmployeeContractAreaRes.limitStart},#{tEmployeeContractAreaRes.limitEnd}
</if>
</if>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_contract_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tEmployeeContractAreaRes.authSql != null and tEmployeeContractAreaRes.authSql.trim() != ''">
${tEmployeeContractAreaRes.authSql}
</if>
</where>
</select>
<sql id="export_where">
<include refid="tEmployeeContractAreaRes_where"/>
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<!--数据权限判断-->
<if test="settleDomainIds != null">
<if test="settleDomainIds.size() > 0">
and a.SETTLE_DOMAIN_ID in
<foreach collection="settleDomainIds" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="settleDomainIds.size() == 0">
and 1=2
</if>
</if>
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
</sql>
</mapper>
......@@ -361,6 +361,10 @@ public interface ErrorCodes {
* 新增异常:未找到对应社保户名称的可用基数配置信息
*/
String EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST = "emp.dispatch.social.hold.not.exist";
/**
* 新增异常:备案基数不可为空
*/
String EMP_DISPATCH_SOCIAL_RECORD_BASE_NOT_EXIST = "emp.dispatch.social.record.base.not.exist";
/**
* 新增异常:未找到对应公积金户名称的可用基数配置信息
......
......@@ -203,7 +203,7 @@ emp.dispatch.emp.contract.end.not.empty=\u589E\u5F02\u5E38\uFF1A \u56FA\u5B9A\u6
emp.dispatch.emp.contract.sub.name.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5408\u540C\u7C7B\u578B\u4E3A\u5176\u4ED6\u65F6\u4E1A\u52A1\u7EC6\u5206\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.social.record.base.not.exist=\u65B0\u589E\u5F02\u5E38\uFF1A\u5907\u6848\u57FA\u6570\u4E0D\u53EF\u4E3A\u7A7A
......
/*
* 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.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
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 org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
@TableName("t_insurance_area_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商险地市权限配置表")
public class TInsuranceAreaRes extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 登录人id
*/
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id不能为空", maxLength = 32)
@NotBlank(message = "登录人id不能为空")
@Length(max = 32, message = "登录人id不能超过32个字符")
@ExcelProperty("登录人id")
@Schema(description = "登录人id")
private String userId;
/**
* 登录人姓名
*/
@ExcelProperty("办理人")
@Schema(description = "办理人")
private String userName;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer province;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer city;
/**
* 申請人所在部门
*/
@ExcelAttribute(name = "办理人所在部门")
@ExcelProperty("办理人所在部门")
@Schema(description = "办理人所在部门")
private Integer organName;
/**
* 状态 0 启用 1 禁用
*/
@ExcelAttribute(name = "状态")
@ExcelProperty("状态")
@Schema(description = "状态:0 启用 1 禁用")
private String status;
}
/*
* 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.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
public class TInsuranceAreaExportVo implements Serializable {
/**
* 登录人姓名
*/
@ExcelProperty("办理人")
@Schema(description = "办理人")
private String userName;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer province;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer city;
/**
* 申請人所在部门
*/
@ExcelAttribute(name = "办理人所在部门")
@ExcelProperty("办理人所在部门")
@Schema(description = "办理人所在部门")
private Integer organName;
/**
* 状态 0 启用 1 禁用
*/
@ExcelAttribute(name = "授权状态")
@ExcelProperty("授权状态")
@Schema(description = "授权状态:0 启用 1 禁用")
private String status;
}
/*
* 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.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
public class TInsuranceAreaResSearchVo extends TInsuranceAreaRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
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.io.Serializable;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
public class TInsuranceAreaResVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 登录人id
*/
@NotBlank(message = "登录人id 不能为空")
@Length(max = 32, message = "登录人id 不能超过32 个字符")
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id 不能为空", maxLength = 32)
@Schema(description = "登录人id")
@ExcelProperty("登录人id")
private String userId;
/**
* 档案-省
*/
@NotBlank(message = "档案-省 不能为空")
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省 不能为空")
@Schema(description = "档案-省")
@ExcelProperty("档案-省")
private Integer province;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@Schema(description = "档案-市")
@ExcelProperty("档案-市")
private Integer city;
}
/*
* 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.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceAreaResService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tinsuranceareares")
@Tag(name = "商险地市权限配置表管理")
public class TInsuranceAreaResController {
private final TInsuranceAreaResService tInsuranceAreaResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TInsuranceAreaRes>> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, TInsuranceAreaResSearchVo tInsuranceAreaRes) {
return new R<>(tInsuranceAreaResService.getTInsuranceAreaResPage(page, tInsuranceAreaRes));
}
/**
* 不分页查询
*
* @param searchVo 商险地市权限配置表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('tinsuranceareares_get')" )
public R<List<TInsuranceAreaExportVo>> getTInsuranceAreaResNoPage(@RequestBody TInsuranceAreaResSearchVo searchVo) {
return R.ok(tInsuranceAreaResService.noPageDiy(searchVo,null, Common.getList(searchVo.getIds()),null));
}
/**
* 通过id查询商险地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('tinsuranceareares_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_get')")
public R<TInsuranceAreaRes> getById(@PathVariable("id") String id) {
return R.ok(tInsuranceAreaResService.getById(id));
}
/**
* 新增商险地市权限配置表
*
* @param areaRes 商险地市权限配置表
* @return R
*/
@Operation(summary = "新增商险地市权限配置表", description = "新增商险地市权限配置表:hasPermission('tinsuranceareares_add')")
@SysLog("新增商险地市权限配置表")
@PostMapping
@PreAuthorize("@pms.hasPermission('tinsuranceareares_add')")
public R<Boolean> save(@RequestBody TInsuranceAreaRes areaRes) {
TInsuranceAreaRes res = tInsuranceAreaResService.getOne(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getProvince,areaRes.getProvince())
.eq(TInsuranceAreaRes::getCity,areaRes.getCity())
.eq(TInsuranceAreaRes::getUserId,areaRes.getUserId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(res)){
return R.failed("已存在对应审核人及地市配置!");
}
return R.ok(tInsuranceAreaResService.save(areaRes));
}
/**
* 修改商险地市权限配置表
*
* @param tInsuranceAreaRes 商险地市权限配置表
* @return R
*/
@Operation(summary = "修改商险地市权限配置表", description = "修改商险地市权限配置表:hasPermission('tinsuranceareares_edit')")
@SysLog("修改商险地市权限配置表")
@PutMapping
@PreAuthorize("@pms.hasPermission('tinsuranceareares_edit')")
public R<Boolean> updateById(@RequestBody TInsuranceAreaRes tInsuranceAreaRes) {
return R.ok(tInsuranceAreaResService.updateById(tInsuranceAreaRes));
}
/**
* 通过id删除商险地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除商险地市权限配置表", description = "通过id删除商险地市权限配置表:hasPermission('tinsuranceareares_del')")
@SysLog("通过id删除商险地市权限配置表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tInsuranceAreaResService.removeById(id));
}
/**
* 通过id启用或禁用商险地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id启用或禁用商险地市权限配置表", description = "通过id启用或禁用(0 启用,1禁用)商险地市权限配置表:hasPermission('tinsuranceareares_del')")
@SysLog("通过id启用或禁用商险地市权限配置表")
@DeleteMapping("/updateStatus")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_edit')")
public R<Boolean> removeById(@RequestParam(name = "id",required = true) String id,
@RequestParam(name = "status",required = true) String status) {
TInsuranceAreaRes areaRes = tInsuranceAreaResService.getById(id);
if (Common.isEmpty(areaRes)
|| !(CommonConstants.ONE_STRING).equals(status)
&& !CommonConstants.ZERO_STRING.equals(status)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
areaRes.setStatus(status);
return R.ok(tInsuranceAreaResService.updateById(areaRes));
}
/**
* 商险地市权限配置表 批量导入
*
* @author fxj
* @date 2022-11-01 10:32:05
**/
@SneakyThrows
@Operation(description = "批量新增商险地市权限配置表 hasPermission('tinsuranceareares-batch-import')")
@SysLog("批量新增商险地市权限配置表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('tinsuranceareares-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tInsuranceAreaResService.importDiy(file.getInputStream());
}
/**
* 商险地市权限配置表 批量导出
*
* @author fxj
* @date 2022-11-01 10:32:05
**/
@Operation(description = "导出商险地市权限配置表 hasPermission('tinsuranceareares-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('tinsuranceareares-export')")
public void export(HttpServletResponse response, @RequestBody TInsuranceAreaResSearchVo searchVo) {
tInsuranceAreaResService.listExport(response, 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.insurances.mapper.insurances;
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.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Mapper
public interface TInsuranceAreaResMapper extends BaseMapper<TInsuranceAreaRes> {
/**
* 商险地市权限配置表简单分页查询
*
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
IPage<TInsuranceAreaRes> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, @Param("tInsuranceAreaRes") TInsuranceAreaRes tInsuranceAreaRes);
List<TInsuranceAreaExportVo> noPageDiy(@Param("tInsuranceAreaRes")TInsuranceAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
int noPageCountDiy(@Param("tInsuranceAreaRes")TInsuranceAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
}
/*
* 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.insurances.service;
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.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
public interface TInsuranceAreaResService extends IService<TInsuranceAreaRes> {
/**
* 商险地市权限配置表简单分页查询
*
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
IPage<TInsuranceAreaRes> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, TInsuranceAreaResSearchVo tInsuranceAreaRes);
List<TInsuranceAreaExportVo> noPageDiy(TInsuranceAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TInsuranceAreaResSearchVo searchVo);
}
<?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.insurances.mapper.insurances.TInsuranceAreaResMapper">
<resultMap id="tInsuranceAreaResMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<resultMap id="insuranceAreaResExportMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo">
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.PROVINCE,
a.CITY,a.USER_NAME,a.STATUS,a.ORGAN_NAME
</sql>
<sql id="tInsuranceAreaRes_where">
<if test="tInsuranceAreaRes != null">
<if test="tInsuranceAreaRes.id != null and tInsuranceAreaRes.id.trim() != ''">
AND a.ID = #{tInsuranceAreaRes.id}
</if>
<if test="tInsuranceAreaRes.userId != null and tInsuranceAreaRes.userId.trim() != ''">
AND a.USER_ID = #{tInsuranceAreaRes.userId}
</if>
<if test="tInsuranceAreaRes.province != null">
AND a.PROVINCE = #{tInsuranceAreaRes.province}
</if>
<if test="tInsuranceAreaRes.city != null">
AND a.CITY = #{tInsuranceAreaRes.city}
</if>
<if test="tInsuranceAreaRes.status!= null">
AND a.status like CONCAT(#{tInsuranceAreaRes.status},'%')
</if>
<if test="tInsuranceAreaRes.userName != null">
AND a.USER_NAME tInsuranceAreaRes.organName like CONCAT(#{tInsuranceAreaRes.userName},'%')
</if>
<if test="tInsuranceAreaRes.organName != null">
AND a.ORGAN_NAME like CONCAT(#{tInsuranceAreaRes.organName},'%')
</if>
</if>
</sql>
<!--tInsuranceAreaRes简单分页查询-->
<select id="getTInsuranceAreaResPage" resultMap="tInsuranceAreaResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_area_res a
<where>
1=1
<include refid="tInsuranceAreaRes_where"/>
</where>
</select>
<select id="noPageDiy" resultMap="insuranceAreaResExportMap">
SELECT
a.PROVINCE,
a.CITY,a.USER_NAME,a.STATUS,a.ORGAN_NAME
FROM t_insurance_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tInsuranceAreaRes != null">
<if test="tInsuranceAreaRes.authSql != null and tInsuranceAreaRes.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
<if test="tInsuranceAreaRes.limitStart != null">
limit #{tInsuranceAreaRes.limitStart},#{tInsuranceAreaRes.limitEnd}
</if>
</if>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_insurance_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tInsuranceAreaRes.authSql != null and tInsuranceAreaRes.authSql.trim() != ''">
${tInsuranceAreaRes.authSql}
</if>
</where>
</select>
<sql id="export_where">
<include refid="tInsuranceAreaRes_where"/>
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<!--数据权限判断-->
<if test="settleDomainIds != null">
<if test="settleDomainIds.size() > 0">
and a.SETTLE_DOMAIN_ID in
<foreach collection="settleDomainIds" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="settleDomainIds.size() == 0">
and 1=2
</if>
</if>
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
</sql>
</mapper>
......@@ -442,6 +442,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchPart = true;
}
if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isNullOrZero(excel.getRecordBase())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_RECORD_BASE_NOT_EXIST)));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
if (Common.isEmpty(socialSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
......@@ -456,7 +461,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& Common.isNotNull(excel.getWorkInjuryStart())
&& (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(excel.getWorkInjuryCardinal())) <= 0);
&& (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(excel.getWorkInjuryCardinal())) < 0);
}
// 失败项社保派单 和已有派单户不一致
if (dispatchPart && Common.isNotNull(socialFund)
......@@ -2592,7 +2597,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.setDeptId(dispatch.getSettleDomain());
temp.setEmpId(dispatch.getEmpId());
R<TEmployeeProject> res = archivesDaprUtil.getTEmployeeProjectById(temp);
if (Common.isNotNull(res)){
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
if (Common.isNotNull(res.getData().getWorkingHours())) {
dispatch.setWorkingHours(res.getData().getWorkingHours());
}
......
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