Commit 1bbada55 authored by fangxinjiang's avatar fangxinjiang

入职确认接收端+接收方式+项目配置限制项和自动化配置项和自动化入口限制-fxj

parent bb7251a8
...@@ -215,13 +215,4 @@ public class EmployeeRegistrationPre extends BaseEntity { ...@@ -215,13 +215,4 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "接收方式:0-单个接收,1-批量接收") @Schema(description = "接收方式:0-单个接收,1-批量接收")
private String receiveType; private String receiveType;
@Schema(description = "劳务费可修改标识:0-可修改,1-不可修改")
private String laborFeeModifyFlag;
@Schema(description = "计时工资可修改标识:0-可修改,1-不可修改")
private String hourlyWageModifyFlag;
@Schema(description = "计件工资可修改标识:0-可修改,1-不可修改")
private String pieceWageModifyFlag;
} }
...@@ -99,7 +99,7 @@ public class TAutoMainRel extends BaseEntity { ...@@ -99,7 +99,7 @@ public class TAutoMainRel extends BaseEntity {
private String postFlag; private String postFlag;
/** /**
* 是否仅使用自动化入口 0 是 1否 * 是否仅使用自动化入口 0 是 1否 解释为 0限制 1不限制
*/ */
@ExcelAttribute(name = "是否仅使用自动化入口", maxLength = 1) @ExcelAttribute(name = "是否仅使用自动化入口", maxLength = 1)
@Schema(description = "是否仅使用自动化入口 0 是 1否") @Schema(description = "是否仅使用自动化入口 0 是 1否")
...@@ -126,4 +126,86 @@ public class TAutoMainRel extends BaseEntity { ...@@ -126,4 +126,86 @@ public class TAutoMainRel extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String csLoginName; private String csLoginName;
} // ==================== 限制项字段(控制是否限制某服务项目) ====================
/**
* 是否限制档案:0-不限制,1-限制
*/
@ExcelAttribute(name = "是否限制档案", maxLength = 1)
@Schema(description = "是否限制档案:0-不限制,1-限制")
private String restrictArchive;
/**
* 是否限制商险:0-不限制,1-限制
*/
@ExcelAttribute(name = "是否限制商险", maxLength = 1)
@Schema(description = "是否限制商险:0-不限制,1-限制")
private String restrictInsurance;
/**
* 是否限制合同:0-不限制,1-限制
*/
@ExcelAttribute(name = "是否限制合同", maxLength = 1)
@Schema(description = "是否限制合同:0-不限制,1-限制")
private String restrictContract;
/**
* 是否限制社保公积金:0-不限制,1-限制
*/
@ExcelAttribute(name = "是否限制社保公积金", maxLength = 1)
@Schema(description = "是否限制社保公积金:0-不限制,1-限制")
private String restrictSocialFund;
// ==================== 自动化配置项字段(5个独立字段,由后端根据项目配置的服务项目自动计算) ====================
/**
* 是否配置档案:0-否,1-是
*/
@ExcelAttribute(name = "是否配置档案", maxLength = 1)
@Schema(description = "是否配置档案:0-否,1-是")
private String autoConfigArchive;
/**
* 是否配置合同:0-否,1-是
*/
@ExcelAttribute(name = "是否配置合同", maxLength = 1)
@Schema(description = "是否配置合同:0-否,1-是")
private String autoConfigContract;
/**
* 是否配置商险:0-否,1-是
*/
@ExcelAttribute(name = "是否配置商险", maxLength = 1)
@Schema(description = "是否配置商险:0-否,1-是")
private String autoConfigInsurance;
/**
* 是否配置社保:0-否,1-是
*/
@ExcelAttribute(name = "是否配置社保", maxLength = 1)
@Schema(description = "是否配置社保:0-否,1-是")
private String autoConfigSocial;
/**
* 是否配置公积金:0-否,1-是
*/
@ExcelAttribute(name = "是否配置公积金", maxLength = 1)
@Schema(description = "是否配置公积金:0-否,1-是")
private String autoConfigFund;
// ==================== 非数据库字段(用于列表显示) ====================
/**
* 限制项显示(拼接后的服务项目名称,如"社保,公积金")
* 非数据库字段,查询时动态生成
*/
@TableField(exist = false)
@Schema(description = "限制项显示(拼接后的服务项目名称)")
private String restrictItemsDisplay;
/**
* 自动化配置项显示(拼接后的服务项目名称,如"档案、商险、社保")
* 非数据库字段,查询时动态生成
*/
@TableField(exist = false)
@Schema(description = "自动化配置项显示(拼接后的服务项目名称)")
private String autoConfigItemsDisplay;
}
\ No newline at end of file
...@@ -392,4 +392,13 @@ public class TEmployeeContractPre extends BaseEntity { ...@@ -392,4 +392,13 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "发薪日") @Schema(description = "发薪日")
private String salaryDay; private String salaryDay;
@Schema(description = "劳务费可修改标识:0-可修改,1-不可修改")
private String laborFeeModifyFlag;
@Schema(description = "计时工资可修改标识:0-可修改,1-不可修改")
private String hourlyWageModifyFlag;
@Schema(description = "计件工资可修改标识:0-可修改,1-不可修改")
private String pieceWageModifyFlag;
} }
...@@ -185,14 +185,4 @@ public class EmployeeRegistrationPreVo implements Serializable { ...@@ -185,14 +185,4 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "接收方式:0-单个接收,1-批量接收") @Schema(description = "接收方式:0-单个接收,1-批量接收")
private String receiveType; private String receiveType;
@Schema(description = "劳务费可修改标识:0-可修改,1-不可修改")
private String laborFeeModifyFlag;
@Schema(description = "计时工资可修改标识:0-可修改,1-不可修改")
private String hourlyWageModifyFlag;
@Schema(description = "计件工资可修改标识:0-可修改,1-不可修改")
private String pieceWageModifyFlag;
} }
/*
* 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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 项目自动化配置查询参数
*
* @author fxj
* @date 2025-05-18
*/
@Data
@Schema(description = "项目自动化配置查询参数")
public class ProjectAutoSetParam implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目编码列表
*/
@Schema(description = "项目编码列表")
private List<String> departNos;
/**
* 类型:0 档案 1 合同 2 商险 3 社保公积金 4 薪酬
*/
@Schema(description = "类型:0 档案 1 合同 2 商险 3 社保公积金 4 薪酬")
private String type;
}
...@@ -53,9 +53,9 @@ public class TAutoMainRelAddVo implements Serializable { ...@@ -53,9 +53,9 @@ public class TAutoMainRelAddVo implements Serializable {
//社保规则明细表 //社保规则明细表
private List<TAutoSocialRuleRel> socialRuleRels; private List<TAutoSocialRuleRel> socialRuleRels;
//社保规则主表 //公积金规则主表
private TAutoFundRuleInfo fundRuleInfo; private TAutoFundRuleInfo fundRuleInfo;
//社保规则明细表 //公积金规则明细表
private List<TAutoFundRuleRel> fundRuleRels; private List<TAutoFundRuleRel> fundRuleRels;
} }
...@@ -92,6 +92,28 @@ public class TAutoMainRelExportVo implements Serializable { ...@@ -92,6 +92,28 @@ public class TAutoMainRelExportVo implements Serializable {
@Schema(description = "规则最新更新人") @Schema(description = "规则最新更新人")
private String ruleUpdatePerson; private String ruleUpdatePerson;
/**
* 是否仅使用自动化入口
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否仅使用自动化入口")
@Schema(description = "是否仅使用自动化入口")
@ExcelAttribute(name = "是否仅使用自动化入口", readConverterExp = "0=是,1=否")
private String autoFlag;
// ==================== 非数据库字段(用于列表显示) ====================
/**
* 限制项显示(拼接后的服务项目名称,如"社保,公积金")
* 非数据库字段,查询时动态生成
*/
@TableField(exist = false)
@Schema(description = "限制项显示(拼接后的服务项目名称)")
private String restrictItemsDisplay;
// ==================== 自动化配置项显示字段 ====================
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("自动化配置项")
@Schema(description = "自动化配置项列表(记录配置了哪些服务项目)")
private String autoConfigItemsDisplay;
} }
\ No newline at end of file
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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;
/**
* 项目配置限制项批量导入VO
*/
@Data
@Schema(description = "项目配置限制项批量导入")
public class TAutoMainRelRestrictImportVo extends RowIndex {
@ExcelProperty("项目编码(必填)")
@Schema(description = "项目编码")
@ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目编码不能为空", maxLength = 50)
private String deptNo;
@ExcelProperty("项目名称")
@Schema(description = "项目名称")
private String departName;
@ExcelProperty("是否限制(0限制/1不限制)")
@Schema(description = "是否限制:0-限制(仅自动化入口),1-不限制")
@ExcelAttribute(name = "是否限制",isNotEmpty = true, errorInfo = "是否限制不能为空", readConverterExp = "0=限制,1=不限制")
private String autoFlag;
@ExcelProperty("是否限制档案(0不限制/1限制)")
@Schema(description = "是否限制档案")
@ExcelAttribute(name = "是否限制档案", readConverterExp = "0=不限制,1=限制")
private String restrictArchive;
@ExcelProperty("是否限制商险(0不限制/1限制)")
@Schema(description = "是否限制商险")
@ExcelAttribute(name = "是否限制商险", readConverterExp = "0=不限制,1=限制")
private String restrictInsurance;
@ExcelProperty("是否限制合同(0不限制/1限制)")
@Schema(description = "是否限制合同")
@ExcelAttribute(name = "是否限制合同", readConverterExp = "0=不限制,1=限制")
private String restrictContract;
@ExcelProperty("是否限制社保公积金(0不限制/1限制)")
@Schema(description = "是否限制社保公积金")
@ExcelAttribute(name = "是否限制社保公积金", readConverterExp = "0=不限制,1=限制")
private String restrictSocialFund;
}
\ No newline at end of file
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 项目配置限制项VO
* 用于单个限制接口新增和更新限制项
*/
@Data
@Schema(description = "项目配置限制项")
public class TAutoMainRelRestrictVo {
@NotBlank(message = "项目ID不能为空")
@Schema(description = "项目配置ID")
private String id;
/**
* 是否仅使用自动化入口(限制标志):0-限制(仅自动化入口),1-不限制
*/
@Schema(description = "是否仅使用自动化入口:0-限制(仅自动化入口),1-不限制")
private String autoFlag;
@Schema(description = "是否限制档案:0-不限制,1-限制")
private String restrictArchive;
@Schema(description = "是否限制商险:0-不限制,1-限制")
private String restrictInsurance;
@Schema(description = "是否限制合同:0-不限制,1-限制")
private String restrictContract;
@Schema(description = "是否限制社保公积金:0-不限制,1-限制")
private String restrictSocialFund;
}
\ No newline at end of file
...@@ -49,10 +49,24 @@ private LocalDateTime[] createTimes; ...@@ -49,10 +49,24 @@ private LocalDateTime[] createTimes;
@Schema(description = "查询limit 开始") @Schema(description = "查询limit 开始")
private int limitStart; private int limitStart;
/** /**
* @Author fxj * @Author fxj
* 查询数据止 * 查询数据止
**/ **/
@Schema(description = "查询limit 数据条数") @Schema(description = "查询limit 数据条数")
private int limitEnd; private int limitEnd;
/**
* 是否仅使用自动化入口(多选查询)
*/
@Schema(description = "是否仅使用自动化入口(多选查询)")
private java.util.List<String> autoFlagList;
// ==================== 限制项字段(多选查询) ====================
@Schema(description = "限制项(多选查询,如\"档案\"、\"商险\")")
private java.util.List<String> restrictItemsList;
// ==================== 自动化配置项字段(多选查询) ====================
@Schema(description = "自动化配置项(多选查询,如\"档案\"、\"商险\"、\"社保\"、\"公积金\")")
private java.util.List<String> autoConfigItemsList;
} }
\ No newline at end of file
...@@ -581,4 +581,13 @@ public class TEmployeeContractPreVo extends RowIndex implements Serializable { ...@@ -581,4 +581,13 @@ public class TEmployeeContractPreVo extends RowIndex implements Serializable {
@Schema(description = "发薪日") @Schema(description = "发薪日")
private String salaryDay; private String salaryDay;
@Schema(description = "劳务费可修改标识:0-可修改,1-不可修改")
private String laborFeeModifyFlag;
@Schema(description = "计时工资可修改标识:0-可修改,1-不可修改")
private String hourlyWageModifyFlag;
@Schema(description = "计件工资可修改标识:0-可修改,1-不可修改")
private String pieceWageModifyFlag;
} }
...@@ -25,7 +25,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TAutoMainRelService; ...@@ -25,7 +25,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TAutoMainRelService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelAddVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelAddVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelDetailVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelExportVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelRestrictVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectAutoSetParam;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...@@ -190,12 +192,13 @@ public class TAutoMainRelController { ...@@ -190,12 +192,13 @@ public class TAutoMainRelController {
/** /**
* @Author fxj * @Author fxj
* @Description 远程接口获取项目对应商险的自动化配置信息,有商险自动化且配置为启用的 * @Description 远程接口获取项目对应商险的自动化配置信息,有商险自动化且配置为启用的
* @param param 查询参数对象
* @Date 11:20 2025/9/17 * @Date 11:20 2025/9/17
**/ **/
@Inner @Inner
@PostMapping("/inner/getProjectAutoSetMap") @PostMapping("/inner/getProjectAutoSetMap")
public Map<String,String> getProjectAutoSetMap(@RequestBody List<String> departNos) { public Map<String,String> getProjectAutoSetMap(@RequestBody ProjectAutoSetParam param) {
return tAutoMainRelService.getProjectAutoSetMap(departNos); return tAutoMainRelService.getProjectAutoSetMap(param.getDepartNos(), param.getType());
} }
/** /**
...@@ -223,4 +226,31 @@ public class TAutoMainRelController { ...@@ -223,4 +226,31 @@ public class TAutoMainRelController {
return tAutoMainRelService.getAutoDeptMap(); return tAutoMainRelService.getAutoDeptMap();
} }
// ==================== 限制项相关接口 ====================
/**
* 单个更新限制项
* @param vo 限制项VO
* @return 更新结果
*/
@Operation(summary = "单个更新限制项", description = "更新单个项目配置的限制项")
@SysLog("单个更新限制项")
@PostMapping("/updateRestrict")
public R<Boolean> updateRestrict(@RequestBody TAutoMainRelRestrictVo vo) {
return tAutoMainRelService.updateRestrict(vo);
}
/**
* 批量更新限制项(通过上传限制项文件)
* @param file Excel文件
* @return 导入结果
*/
@SneakyThrows
@Operation(summary = "批量更新限制项", description = "上传Excel文件批量更新项目配置限制项")
@SysLog("批量更新限制项")
@PostMapping("/uploadRestrictConfig")
public R<List<ErrorMessage>> uploadRestrictConfig(@RequestParam("file") MultipartFile file) {
return tAutoMainRelService.uploadRestrictConfig(file.getInputStream());
}
} }
...@@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -22,10 +22,7 @@ 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.archives.entity.TAutoContractScheme; import com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoContractScheme;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoMainRel; import com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoMainRel;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelAddVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoMainRelSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.AutoDeptVO; import com.yifu.cloud.plus.v1.yifu.insurances.vo.AutoDeptVO;
...@@ -65,10 +62,38 @@ public interface TAutoMainRelService extends IService<TAutoMainRel> { ...@@ -65,10 +62,38 @@ public interface TAutoMainRelService extends IService<TAutoMainRel> {
IPage<TAutoContractScheme> getContractSchemePage(Page<TAutoContractScheme> page, TAutoContractScheme search); IPage<TAutoContractScheme> getContractSchemePage(Page<TAutoContractScheme> page, TAutoContractScheme search);
Map<String, String> getProjectAutoSetMap(List<String> departNos); /**
* @Author fxj
* @Description 远程接口获取项目对应商险的自动化配置信息,有商险自动化且配置'是否仅使用自动化入口' 为是的需要强制限制
* @param type 0 档案 1 合同 2 商险 3 社保公积金 4 薪酬
* @Date 11:26 2025/9/17
**/
Map<String, String> getProjectAutoSetMap(List<String> departNos, String type);
// 获取全量自动化项目,value里是续保周期 // 获取全量自动化项目,value里是续保周期
AutoDeptVO getAutoDeptMap(); AutoDeptVO getAutoDeptMap();
R<Boolean> updateAutoFlagById(String id, String autoFlag); R<Boolean> updateAutoFlagById(String id, String autoFlag);
// ==================== 限制项相关方法 ====================
/**
* 单个更新限制项
* @param vo 限制项VO
* @return 更新结果
*/
R<Boolean> updateRestrict(TAutoMainRelRestrictVo vo);
/**
* 批量更新限制项(通过上传限制项文件)
* @param file Excel文件
* @return 导入结果(包含错误信息)
*/
R<List<ErrorMessage>> uploadRestrictConfig(InputStream file);
/**
* 自动计算自动化配置项
* 根据项目配置了哪些服务项目,设置5个自动化配置项字段值
* @param entity 项目配置实体
*/
void generateAutoConfigItems(TAutoMainRel entity);
} }
...@@ -48,6 +48,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO; ...@@ -48,6 +48,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...@@ -76,6 +77,7 @@ import java.math.RoundingMode; ...@@ -76,6 +77,7 @@ import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Arrays;
import java.util.*; import java.util.*;
/** /**
...@@ -126,6 +128,18 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -126,6 +128,18 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final CspDaprUtils cspDaprUtil; private final CspDaprUtils cspDaprUtil;
private final TAutoMainRelService tAutoMainRelService;
/**
* @Description: 检测是否有某个角色权限(超管放行)
* @Author: AI Assistant
* @Date: 2026/5/19
* @return: boolean
**/
private boolean isSuperAdmin(YifuUser user) {
// 使用工具类方法进行超管判断
return SecurityUtils.isSuperAdmin(user);
}
/** /**
* 员工合同信息表简单分页查询 * 员工合同信息表简单分页查询
* *
...@@ -168,6 +182,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -168,6 +182,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isEmpty(tEmployeeContractInfo.getEmpId()) || Common.isEmpty(tEmployeeContractInfo.getSettleDomain())) { if (Common.isEmpty(tEmployeeContractInfo.getEmpId()) || Common.isEmpty(tEmployeeContractInfo.getSettleDomain())) {
return R.failed(EmployeeConstants.EMPID_NOT_EMPTY); return R.failed(EmployeeConstants.EMPID_NOT_EMPTY);
} }
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.USER_FAIL);
}
TSettleDomain domain = tSettleDomainService.getById(tEmployeeContractInfo.getSettleDomain());
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag()) && null != domain) {
// 超管放行,不进行自动化限制检查
if (!isSuperAdmin(user)) {
String deptNo = domain.getDepartNo();
if (Common.isNotNull(deptNo)) {
Map<String, String> res = tAutoMainRelService.getProjectAutoSetMap(Arrays.asList(deptNo), CommonConstants.ONE_STRING);
if (Common.isNotNull(res) && res.containsKey(deptNo)) {
return R.failed("该项目已纳入自动化,请至作业自动化模块操作");
}
}
}
}
return this.setBaseInfo(tEmployeeContractInfo, null); return this.setBaseInfo(tEmployeeContractInfo, null);
} catch (Exception e) { } catch (Exception e) {
log.error("员工合同保存异常:" + e.getMessage()); log.error("员工合同保存异常:" + e.getMessage());
...@@ -1373,6 +1406,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1373,6 +1406,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
public R<List<ErrorMessage>> batchImport(InputStream inputStream) { public R<List<ErrorMessage>> batchImport(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<EmployeeContractVO> util1 = new ExcelUtil<>(EmployeeContractVO.class); ExcelUtil<EmployeeContractVO> util1 = new ExcelUtil<>(EmployeeContractVO.class);
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.USER_FAIL);
}
// 写法2: // 写法2:
// 匿名内部类 不用额外写一个DemoDataListener // 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
...@@ -1387,7 +1424,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1387,7 +1424,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
*临时存储 *临时存储
*/ */
private List<EmployeeContractVO> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); private List<EmployeeContractVO> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
/**
* 项目编码自动化校验缓存,key: deptNo, value: true-已纳入自动化, false-未纳入
*/
private Map<String, Boolean> autoCheckCache = new HashMap<>();
@Override @Override
public void invoke(EmployeeContractVO data, AnalysisContext context) { public void invoke(EmployeeContractVO data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder(); ReadRowHolder readRowHolder = context.readRowHolder();
...@@ -1397,6 +1438,31 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1397,6 +1438,31 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(errorMessage)) { if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
} else { } else {
// 导入时的自动化校验
String deptNo = data.getDeptNo();
if (Common.isNotNull(deptNo) && !isSuperAdmin(user)) {
// 先从缓存中获取
Boolean isAuto = autoCheckCache.get(deptNo);
if (isAuto == null) {
// 缓存中没有,查询数据库
TSettleDomain domain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, deptNo)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isNotNull(domain)) {
Map<String, String> res = tAutoMainRelService.getProjectAutoSetMap(Arrays.asList(deptNo), CommonConstants.ONE_STRING);
isAuto = Common.isNotNull(res) && res.containsKey(deptNo);
} else {
isAuto = false;
}
autoCheckCache.put(deptNo, isAuto);
}
if (isAuto) {
errorMessageList.add(new ErrorMessage(data.getRowIndex(), "该项目已纳入自动化,请至作业自动化模块操作"));
return;
}
}
cachedDataList.add(data); cachedDataList.add(data);
} }
if (cachedDataList.size() >= BATCH_COUNT) { if (cachedDataList.size() >= BATCH_COUNT) {
......
...@@ -182,10 +182,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -182,10 +182,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
// 接收终端和接收方式 // 接收终端和接收方式
IGNORE_FIELD.add("receiveTerminal"); IGNORE_FIELD.add("receiveTerminal");
IGNORE_FIELD.add("receiveType"); IGNORE_FIELD.add("receiveType");
// 工资可修改标识
IGNORE_FIELD.add("laborFeeModifyFlag");
IGNORE_FIELD.add("hourlyWageModifyFlag");
IGNORE_FIELD.add("pieceWageModifyFlag");
} }
private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>(); private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>();
...@@ -233,6 +230,10 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -233,6 +230,10 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
CONTRACT_IGNORE_FIELD.add("isLeave"); CONTRACT_IGNORE_FIELD.add("isLeave");
CONTRACT_IGNORE_FIELD.add("isRefuse"); CONTRACT_IGNORE_FIELD.add("isRefuse");
CONTRACT_IGNORE_FIELD.add("configId"); CONTRACT_IGNORE_FIELD.add("configId");
// 工资可修改标识
CONTRACT_IGNORE_FIELD.add("laborFeeModifyFlag");
CONTRACT_IGNORE_FIELD.add("hourlyWageModifyFlag");
CONTRACT_IGNORE_FIELD.add("pieceWageModifyFlag");
} }
private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>(); private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>();
......
...@@ -36,6 +36,17 @@ ...@@ -36,6 +36,17 @@
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<result property="postFlag" column="POST_FLAG"/> <result property="postFlag" column="POST_FLAG"/>
<result property="autoFlag" column="AUTO_FLAG"/> <result property="autoFlag" column="AUTO_FLAG"/>
<result property="restrictArchive" column="RESTRICT_ARCHIVE"/>
<result property="restrictInsurance" column="RESTRICT_INSURANCE"/>
<result property="restrictContract" column="RESTRICT_CONTRACT"/>
<result property="restrictSocialFund" column="RESTRICT_SOCIAL_FUND"/>
<result property="autoConfigArchive" column="AUTO_CONFIG_ARCHIVE"/>
<result property="autoConfigContract" column="AUTO_CONFIG_CONTRACT"/>
<result property="autoConfigInsurance" column="AUTO_CONFIG_INSURANCE"/>
<result property="autoConfigSocial" column="AUTO_CONFIG_SOCIAL"/>
<result property="autoConfigFund" column="AUTO_CONFIG_FUND"/>
<result property="restrictItemsDisplay" column="RESTRICT_ITEMS_DISPLAY"/>
<result property="autoConfigItemsDisplay" column="AUTO_CONFIG_ITEMS_DISPLAY"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -87,6 +98,35 @@ ...@@ -87,6 +98,35 @@
<if test="tAutoMainRel.authSql != null and tAutoMainRel.authSql.trim() != ''"> <if test="tAutoMainRel.authSql != null and tAutoMainRel.authSql.trim() != ''">
${tAutoMainRel.authSql} ${tAutoMainRel.authSql}
</if> </if>
<!-- 限制项多选查询(含其中一项就匹配) -->
<if test="tAutoMainRel.restrictItemsList != null and tAutoMainRel.restrictItemsList.size() > 0">
AND (
<foreach collection="tAutoMainRel.restrictItemsList" item="item" separator=" OR ">
<choose>
<when test="item == '档案'">a.RESTRICT_ARCHIVE = '1'</when>
<when test="item == '商险'">a.RESTRICT_INSURANCE = '1'</when>
<when test="item == '合同'">a.RESTRICT_CONTRACT = '1'</when>
<when test="item == '社保公积金'">a.RESTRICT_SOCIAL_FUND = '1'</when>
</choose>
</foreach>
)
</if>
<!-- 自动化配置项多选查询(含其中一项就匹配) -->
<if test="tAutoMainRel.autoConfigItemsList != null and tAutoMainRel.autoConfigItemsList.size() > 0">
AND (
<foreach collection="tAutoMainRel.autoConfigItemsList" item="item" separator=" OR ">
<choose>
<when test="item == '档案'">a.AUTO_CONFIG_ARCHIVE = '1'</when>
<when test="item == '合同'">a.AUTO_CONFIG_CONTRACT = '1'</when>
<when test="item == '商险'">a.AUTO_CONFIG_INSURANCE = '1'</when>
<when test="item == '社保'">a.AUTO_CONFIG_SOCIAL = '1'</when>
<when test="item == '公积金'">a.AUTO_CONFIG_FUND = '1'</when>
</choose>
</foreach>
)
</if>
</if> </if>
</sql> </sql>
<!--tAutoMainRel简单分页查询--> <!--tAutoMainRel简单分页查询-->
...@@ -100,9 +140,47 @@ ...@@ -100,9 +140,47 @@
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME, a.CREATE_TIME,
a.UPDATE_BY, a.UPDATE_BY,
a.UPDATE_TIME,a.post_flag a.UPDATE_TIME,
,b.DEPART_NAME,IFNULL(b.cs_name,'') csUserName,b.DEPART_NO dept_NO,IF(b.STOP_FLAG='0','是','否') STOP_FLAG a.post_flag,
,a.AUTO_FLAG a.AUTO_FLAG,
a.RESTRICT_ARCHIVE,
a.RESTRICT_INSURANCE,
a.RESTRICT_CONTRACT,
a.RESTRICT_SOCIAL_FUND,
a.AUTO_CONFIG_ARCHIVE,
a.AUTO_CONFIG_CONTRACT,
a.AUTO_CONFIG_INSURANCE,
a.AUTO_CONFIG_SOCIAL,
a.AUTO_CONFIG_FUND,
-- 限制项显示字段
CASE
WHEN a.RESTRICT_ARCHIVE = '1' OR a.RESTRICT_INSURANCE = '1' OR
a.RESTRICT_CONTRACT = '1' OR a.RESTRICT_SOCIAL_FUND = '1'
THEN CONCAT_WS(',',
CASE WHEN a.RESTRICT_ARCHIVE = '1' THEN '档案' ELSE NULL END,
CASE WHEN a.RESTRICT_INSURANCE = '1' THEN '商险' ELSE NULL END,
CASE WHEN a.RESTRICT_CONTRACT = '1' THEN '合同' ELSE NULL END,
CASE WHEN a.RESTRICT_SOCIAL_FUND = '1' THEN '社保公积金' ELSE NULL END
)
ELSE NULL
END as RESTRICT_ITEMS_DISPLAY,
-- 自动化配置项显示字段
CASE
WHEN a.AUTO_CONFIG_ARCHIVE = '1' OR a.AUTO_CONFIG_CONTRACT = '1' OR
a.AUTO_CONFIG_INSURANCE = '1' OR a.AUTO_CONFIG_SOCIAL = '1' OR a.AUTO_CONFIG_FUND = '1'
THEN CONCAT_WS('、',
CASE WHEN a.AUTO_CONFIG_ARCHIVE = '1' THEN '档案' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_CONTRACT = '1' THEN '合同' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_INSURANCE = '1' THEN '商险' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_SOCIAL = '1' THEN '社保' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_FUND = '1' THEN '公积金' ELSE NULL END
)
ELSE NULL
END as AUTO_CONFIG_ITEMS_DISPLAY,
b.DEPART_NAME,
IFNULL(b.cs_name,'') csUserName,
b.DEPART_NO dept_NO,
IF(b.STOP_FLAG='0','是','否') STOP_FLAG
FROM t_auto_main_rel a FROM t_auto_main_rel a
left join t_settle_domain b on a.DEPT_ID = b.id left join t_settle_domain b on a.DEPT_ID = b.id
<where> <where>
...@@ -114,6 +192,13 @@ ...@@ -114,6 +192,13 @@
<if test="tAutoMainRel.csUserName != null and tAutoMainRel.csUserName.trim() != ''"> <if test="tAutoMainRel.csUserName != null and tAutoMainRel.csUserName.trim() != ''">
AND b.cs_name like concat('%',#{tAutoMainRel.csUserName} ,'%') AND b.cs_name like concat('%',#{tAutoMainRel.csUserName} ,'%')
</if> </if>
<!-- 是否仅使用自动化入口(多选) -->
<if test="tAutoMainRel.autoFlagList != null and tAutoMainRel.autoFlagList.size() > 0">
AND a.AUTO_FLAG IN
<foreach collection="tAutoMainRel.autoFlagList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if> </if>
<include refid="tAutoMainRel_where"/> <include refid="tAutoMainRel_where"/>
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
...@@ -163,7 +248,37 @@ ...@@ -163,7 +248,37 @@
b.DEPART_NAME, b.DEPART_NAME,
IFNULL(b.cs_name,'') csUserName, IFNULL(b.cs_name,'') csUserName,
b.DEPART_NO dept_NO, b.DEPART_NO dept_NO,
IF(b.STOP_FLAG='0','是','否') STOP_FLAG IF(b.STOP_FLAG='0','是','否') STOP_FLAG,
a.AUTO_FLAG,
a.RESTRICT_ARCHIVE,
a.RESTRICT_INSURANCE,
a.RESTRICT_CONTRACT,
a.RESTRICT_SOCIAL_FUND,
-- 限制项显示(拼接服务项目名称)
CASE
WHEN a.RESTRICT_ARCHIVE = '1' OR a.RESTRICT_CONTRACT = '1' OR
a.RESTRICT_INSURANCE = '1' OR a.RESTRICT_SOCIAL_FUND = '1'
THEN CONCAT_WS('、',
CASE WHEN a.RESTRICT_ARCHIVE = '1' THEN '档案' ELSE NULL END,
CASE WHEN a.RESTRICT_CONTRACT = '1' THEN '合同' ELSE NULL END,
CASE WHEN a.RESTRICT_INSURANCE = '1' THEN '商险' ELSE NULL END,
CASE WHEN a.RESTRICT_SOCIAL_FUND = '1' THEN '社保公积金' ELSE NULL END
)
ELSE NULL
END as RESTRICT_ITEMS_DISPLAY,
-- 自动化配置项显示(拼接服务项目名称)
CASE
WHEN a.AUTO_CONFIG_ARCHIVE = '1' OR a.AUTO_CONFIG_CONTRACT = '1' OR
a.AUTO_CONFIG_INSURANCE = '1' OR a.AUTO_CONFIG_SOCIAL = '1' OR a.AUTO_CONFIG_FUND = '1'
THEN CONCAT_WS('、',
CASE WHEN a.AUTO_CONFIG_ARCHIVE = '1' THEN '档案' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_CONTRACT = '1' THEN '合同' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_INSURANCE = '1' THEN '商险' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_SOCIAL = '1' THEN '社保' ELSE NULL END,
CASE WHEN a.AUTO_CONFIG_FUND = '1' THEN '公积金' ELSE NULL END
)
ELSE NULL
END as AUTO_CONFIG_ITEMS_DISPLAY
FROM t_auto_main_rel a FROM t_auto_main_rel a
left join t_settle_domain b on a.DEPT_ID = b.id left join t_settle_domain b on a.DEPT_ID = b.id
<where> <where>
......
...@@ -38,10 +38,14 @@ public class ArchivesDaprUtil { ...@@ -38,10 +38,14 @@ public class ArchivesDaprUtil {
/** /**
* @Author fxj * @Author fxj
* @Description 获取项目自动化设置信息,只返回配置了自动化且商险自动化为是的信息 * @Description 获取项目自动化设置信息,只返回配置了自动化且商险自动化为是的信息
* @param type 0 档案 1 合同 2 商险 3 社保公积金 4 薪酬
* @Date 11:16 2025/9/17 * @Date 11:16 2025/9/17
**/ **/
public R<Map<String,String>> getProjectAutoSetMap(List<String> departNos){ public R<Map<String,String>> getProjectAutoSetMap(List<String> departNos, String type){
R<Map> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tautomainrel/inner/getProjectAutoSetMap" , JSON.toJSONString(departNos), Map.class, SecurityConstants.FROM_IN); ProjectAutoSetParam param = new ProjectAutoSetParam();
param.setDepartNos(departNos);
param.setType(type);
R<Map> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tautomainrel/inner/getProjectAutoSetMap" , JSON.toJSONString(param), Map.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取项目商险自动化信息失败!"); return R.failed("获取项目商险自动化信息失败!");
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.common.security.util; package com.yifu.cloud.plus.v1.yifu.common.security.util;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
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.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...@@ -99,4 +100,29 @@ public class SecurityUtils { ...@@ -99,4 +100,29 @@ public class SecurityUtils {
return false; return false;
} }
} }
/**
* @Description: 检测用户是否为超管(超管放行)
* 超管角色ID:1L 或 SSC开发组角色ID:1668092146875969537L
* @Author: AI Assistant
* @Date: 2026/5/19
* @param user 用户信息
* @return: boolean true-是超管,false-不是超管
**/
public boolean isSuperAdmin(YifuUser user) {
if (user == null || user.getClientRoleMap() == null) {
return false;
}
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
if (roleList == null || roleList.isEmpty()) {
return false;
}
// SSC开发组-1668092146875969537L 超管1
for (Long role : roleList) {
if (role == 1668092146875969537L || role == 1L) {
return true;
}
}
return false;
}
} }
...@@ -2167,7 +2167,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -2167,7 +2167,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.eq(EmployeeRegistration::getEmpIdcard, registration.getEmpIdcard()) .eq(EmployeeRegistration::getEmpIdcard, registration.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, registration.getDeptNo()) .eq(EmployeeRegistration::getDeptNo, registration.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, registration.getFeedbackType()) .eq(EmployeeRegistration::getFeedbackType, registration.getFeedbackType())
.in(EmployeeRegistration::getProcessStatus, Stream.of("0","1","2").collect(Collectors.toList())) .in(EmployeeRegistration::getProcessStatus, Stream.of("0","1").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
if (Common.isNotNull(exit)) { if (Common.isNotNull(exit)) {
...@@ -3212,7 +3212,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3212,7 +3212,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.eq(EmployeeRegistration::getEmpIdcard, insert.getEmpIdcard()) .eq(EmployeeRegistration::getEmpIdcard, insert.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, insert.getDeptNo()) .eq(EmployeeRegistration::getDeptNo, insert.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, insert.getFeedbackType()) .eq(EmployeeRegistration::getFeedbackType, insert.getFeedbackType())
.in(EmployeeRegistration::getProcessStatus, Stream.of("0","1","2").collect(Collectors.toList())) .in(EmployeeRegistration::getProcessStatus, Stream.of("0","1").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
if (Common.isNotNull(exit)) { if (Common.isNotNull(exit)) {
...@@ -3373,9 +3373,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3373,9 +3373,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
BeanUtils.copyProperties(preVo, logPreVo); BeanUtils.copyProperties(preVo, logPreVo);
logPreVo.setReceiveTerminal(null); logPreVo.setReceiveTerminal(null);
logPreVo.setReceiveType(null); logPreVo.setReceiveType(null);
logPreVo.setLaborFeeModifyFlag(null);
logPreVo.setHourlyWageModifyFlag(null);
logPreVo.setPieceWageModifyFlag(null);
archiveDetail.setNewInfo(JSON.toJSONString(logPreVo,JSON_FEATURES)); archiveDetail.setNewInfo(JSON.toJSONString(logPreVo,JSON_FEATURES));
archiveDetail.setDifferenceInfo(null); archiveDetail.setDifferenceInfo(null);
archiveDetail.setCreateBy(user.getId()); archiveDetail.setCreateBy(user.getId());
...@@ -3464,7 +3461,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3464,7 +3461,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
contractDetail.setPreId(empPreId); contractDetail.setPreId(empPreId);
contractDetail.setPreLogId(logId); contractDetail.setPreLogId(logId);
contractDetail.setOldInfo(null); contractDetail.setOldInfo(null);
contractDetail.setNewInfo(JSON.toJSONString(employeeContractPreVo,JSON_FEATURES)); // 创建合同对象副本,排除不记录日志的字段
TEmployeeContractPreVo logContractVo = new TEmployeeContractPreVo();
BeanUtils.copyProperties(employeeContractPreVo, logContractVo);
logContractVo.setLaborFeeModifyFlag(null);
logContractVo.setHourlyWageModifyFlag(null);
logContractVo.setPieceWageModifyFlag(null);
contractDetail.setNewInfo(JSON.toJSONString(logContractVo,JSON_FEATURES));
contractDetail.setDifferenceInfo(null); contractDetail.setDifferenceInfo(null);
contractDetail.setCreateBy(user.getId()); contractDetail.setCreateBy(user.getId());
contractDetail.setCreateName(user.getNickname()); contractDetail.setCreateName(user.getNickname());
......
...@@ -3876,7 +3876,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3876,7 +3876,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
departNos = paramList.stream().map(InsuranceAddParam::getDeptNo).collect(Collectors.toList()); departNos = paramList.stream().map(InsuranceAddParam::getDeptNo).collect(Collectors.toList());
} }
if (Common.isNotNull(departNos)){ if (Common.isNotNull(departNos)){
R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(departNos); R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(departNos, CommonConstants.TWO_STRING);
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){ if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){
insurAutoMap = resR.getData(); insurAutoMap = resR.getData();
}else { }else {
...@@ -3893,7 +3893,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3893,7 +3893,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
departNos = paramList.stream().map(InsuranceBatchParam::getDeptNo).collect(Collectors.toList()); departNos = paramList.stream().map(InsuranceBatchParam::getDeptNo).collect(Collectors.toList());
} }
if (Common.isNotNull(departNos)){ if (Common.isNotNull(departNos)){
R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(departNos); R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(departNos, CommonConstants.TWO_STRING);
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){ if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){
insurAutoMap = resR.getData(); insurAutoMap = resR.getData();
}else { }else {
...@@ -3909,7 +3909,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3909,7 +3909,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
departNos = paramList.stream().map(InsuranceReplaceParam::getReplaceDeptNo).collect(Collectors.toList()); departNos = paramList.stream().map(InsuranceReplaceParam::getReplaceDeptNo).collect(Collectors.toList());
} }
if (Common.isNotNull(departNos)){ if (Common.isNotNull(departNos)){
R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(departNos); R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(departNos, CommonConstants.TWO_STRING);
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){ if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){
insurAutoMap = resR.getData(); insurAutoMap = resR.getData();
}else { }else {
......
...@@ -67,6 +67,15 @@ public class SalaryAccountExportVo{ ...@@ -67,6 +67,15 @@ public class SalaryAccountExportVo{
@ExcelProperty("项目编码") @ExcelProperty("项目编码")
private String deptNo; private String deptNo;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("封面抬头")
private String invoiceTitle;
/** /**
* 员工姓名 * 员工姓名
*/ */
......
...@@ -55,6 +55,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -55,6 +55,7 @@ import javax.servlet.http.HttpServletResponse;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 派单信息记录表 * 派单信息记录表
...@@ -512,9 +513,31 @@ public class TDispatchInfoController { ...@@ -512,9 +513,31 @@ public class TDispatchInfoController {
@PostMapping("/reduceSocialAndFund") @PostMapping("/reduceSocialAndFund")
public R<List<ErrorMessage>> reduceSocialAndFund(@RequestBody TDispatchReduceVo excelVOList, public R<List<ErrorMessage>> reduceSocialAndFund(@RequestBody TDispatchReduceVo excelVOList,
@RequestParam(required = false) String orderId) { @RequestParam(required = false) String orderId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 自动化校验:检查项目是否纳入自动化(管理员除外)
String deptNo = excelVOList.getDepartNo();
if (Common.isNotNull(deptNo)) {
// 判断是否为管理员:超管ID为1 或 SSC开发组角色
boolean isAdmin = SecurityUtils.isSuperAdmin(user);
if (!isAdmin) {
R<Map<String, String>> resR = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl()
, daprArchivesProperties.getAppId(), "/tautomainrel/inner/getProjectAutoSetMap"
, "{\"departNos\":[\"" + deptNo + "\"],\"type\":\"3\"}", Map.class, SecurityConstants.FROM_IN);
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData()) && resR.getData().containsKey(deptNo)) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT, "该项目已纳入自动化,请至作业自动化模块操作"));
return R.failed(errorMessageList);
}
}
}
List<TDispatchReduceVo> list = new ArrayList<>(); List<TDispatchReduceVo> list = new ArrayList<>();
list.add(excelVOList); list.add(excelVOList);
YifuUser user = SecurityUtils.getUser();
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
tDispatchInfoService.batchReduceDispatch(list, errorMessageList, user, orderId,null); tDispatchInfoService.batchReduceDispatch(list, errorMessageList, user, orderId,null);
return R.ok(errorMessageList); return R.ok(errorMessageList);
......
...@@ -414,6 +414,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -414,6 +414,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isEmpty(user)) { if (Common.isEmpty(user)) {
R.failed(CommonConstants.USER_FAIL); R.failed(CommonConstants.USER_FAIL);
} }
// 判断是否为管理员:使用工具类方法(超管放行)
boolean isAdmin = SecurityUtils.isSuperAdmin(user);
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TDispatchImportVo> util1 = new ExcelUtil<>(TDispatchImportVo.class); ExcelUtil<TDispatchImportVo> util1 = new ExcelUtil<>(TDispatchImportVo.class);
Map<String, String> idCardMap = new HashMap<>(); Map<String, String> idCardMap = new HashMap<>();
...@@ -429,6 +433,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -429,6 +433,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*临时存储 *临时存储
*/ */
private List<TDispatchImportVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); private List<TDispatchImportVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
/**
* 项目编码自动化校验缓存,key: deptNo, value: true-已纳入自动化, false-未纳入
*/
private Map<String, Boolean> autoCheckCache = new HashMap<>();
@Override @Override
public void invoke(TDispatchImportVo data, AnalysisContext context) { public void invoke(TDispatchImportVo data, AnalysisContext context) {
...@@ -439,6 +447,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -439,6 +447,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(errorMessage)) { if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
} else { } else {
// 导入时的自动化校验(管理员除外)
if (!isAdmin) {
String deptNo = data.getSettleDomainCode();
if (Common.isNotNull(deptNo)) {
// 先从缓存中获取
Boolean isAuto = autoCheckCache.get(deptNo);
if (isAuto == null) {
// 缓存中没有,查询数据库
R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(Arrays.asList(deptNo), CommonConstants.THREE_STRING);
isAuto = Common.isNotNull(resR) && Common.isNotNull(resR.getData()) && resR.getData().containsKey(deptNo);
autoCheckCache.put(deptNo, isAuto);
}
if (isAuto) {
errorMessageList.add(new ErrorMessage(data.getRowIndex(), "该项目已纳入自动化,请至作业自动化模块操作"));
return;
}
}
}
cachedDataList.add(data); cachedDataList.add(data);
} }
if (cachedDataList.size() >= BATCH_COUNT) { if (cachedDataList.size() >= BATCH_COUNT) {
...@@ -3169,6 +3195,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3169,6 +3195,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isEmpty(user)) { if (Common.isEmpty(user)) {
R.failed(CommonConstants.USER_FAIL); R.failed(CommonConstants.USER_FAIL);
} }
// 判断是否为管理员:使用工具类方法(超管放行)
boolean isAdmin = SecurityUtils.isSuperAdmin(user);
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TDispatchReduceVo> util1 = new ExcelUtil<>(TDispatchReduceVo.class); ExcelUtil<TDispatchReduceVo> util1 = new ExcelUtil<>(TDispatchReduceVo.class);
// 写法2: // 写法2:
...@@ -3184,6 +3214,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3184,6 +3214,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*临时存储 *临时存储
*/ */
private List<TDispatchReduceVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); private List<TDispatchReduceVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
/**
* 项目编码自动化校验缓存,key: deptNo, value: true-已纳入自动化, false-未纳入
*/
private Map<String, Boolean> autoCheckCache = new HashMap<>();
@Override @Override
public void invoke(TDispatchReduceVo data, AnalysisContext context) { public void invoke(TDispatchReduceVo data, AnalysisContext context) {
...@@ -3194,6 +3228,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3194,6 +3228,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(errorMessage)) { if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
} else { } else {
// 导入时的自动化校验(管理员除外)
if (!isAdmin) {
String deptNo = data.getDepartNo();
if (Common.isNotNull(deptNo)) {
// 先从缓存中获取
Boolean isAuto = autoCheckCache.get(deptNo);
if (isAuto == null) {
// 缓存中没有,查询数据库
R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(Arrays.asList(deptNo), CommonConstants.THREE_STRING);
isAuto = Common.isNotNull(resR) && Common.isNotNull(resR.getData()) && resR.getData().containsKey(deptNo);
autoCheckCache.put(deptNo, isAuto);
}
if (isAuto) {
errorMessageList.add(new ErrorMessage(data.getRowIndex(), "该项目已纳入自动化,请至作业自动化模块操作"));
return;
}
}
}
cachedDataList.add(data); cachedDataList.add(data);
} }
if (cachedDataList.size() >= BATCH_COUNT) { if (cachedDataList.size() >= BATCH_COUNT) {
...@@ -6913,6 +6965,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6913,6 +6965,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL); return R.failed(CommonConstants.USER_FAIL);
} }
// 自动化校验:检查项目是否纳入自动化(使用工具类方法,超管放行)
boolean isAdmin = SecurityUtils.isSuperAdmin(user);
if (!isAdmin) {
String deptNo = importVo.getSettleDomainCode();
if (Common.isNotNull(deptNo)) {
R<Map<String, String>> resR = archivesDaprUtil.getProjectAutoSetMap(Arrays.asList(deptNo), CommonConstants.THREE_STRING);
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData()) && resR.getData().containsKey(deptNo)) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
errorMessageList.add(new ErrorMessage(CommonConstants.ONE_INT, "该项目已纳入自动化,请至作业自动化模块操作"));
return R.failed(errorMessageList);
}
}
}
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
HashMap<String, SysArea> areaMap = new HashMap<>(); HashMap<String, SysArea> areaMap = new HashMap<>();
HashMap<String, SysArea> areaIdMap = new HashMap<>(); HashMap<String, SysArea> areaIdMap = new HashMap<>();
......
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