Commit 4f7ac6cd authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.18' into MVP1.7.18

parents 699e57ab 42f463f5
...@@ -11,9 +11,9 @@ spec: # 资源规范字段 ...@@ -11,9 +11,9 @@ spec: # 资源规范字段
protocol: TCP # 协议 protocol: TCP # 协议
targetPort: 5008 # 容器暴露的端口 targetPort: 5008 # 容器暴露的端口
name: http-batch # 端口名称 name: http-batch # 端口名称
- port: 3518 # service 端口 - port: 3500 # service 端口
protocol: TCP # 协议 protocol: TCP # 协议
targetPort: 3518 # 容器暴露的端口 targetPort: 3500 # 容器暴露的端口
name: http-batch-dapr name: http-batch-dapr
selector: # 选择器 selector: # 选择器
app: yifu-batch # 资源名称 app: yifu-batch # 资源名称
......
...@@ -11,9 +11,9 @@ spec: # 资源规范字段 ...@@ -11,9 +11,9 @@ spec: # 资源规范字段
protocol: TCP # 协议 protocol: TCP # 协议
targetPort: 5008 # 容器暴露的端口 targetPort: 5008 # 容器暴露的端口
name: http-batch # 端口名称 name: http-batch # 端口名称
#- port: 3518 # service 端口 #- port: 4089 # service 端口
# protocol: TCP # 协议 # protocol: TCP # 协议
# targetPort: 3518 # 容器暴露的端口 # targetPort: 4089 # 容器暴露的端口
# name: http-batch-dapr # name: http-batch-dapr
selector: # 选择器 selector: # 选择器
app: yifu-batch # 资源名称 app: yifu-batch # 资源名称
......
...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; 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.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
...@@ -18,9 +17,9 @@ import lombok.EqualsAndHashCode; ...@@ -18,9 +17,9 @@ import lombok.EqualsAndHashCode;
*/ */
@Data @Data
@TableName("t_task_archive_relation") @TableName("t_task_archive_relation")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode()
@Schema(description = "电子档案上传任务和档案明细关系表") @Schema(description = "电子档案上传任务和档案明细关系表")
public class TTaskArchiveRelation extends BaseEntity { public class TTaskArchiveRelation {
/** /**
* 主键 * 主键
......
...@@ -8,7 +8,7 @@ ARG JAR_FILE=target/yifu-batch-biz.jar ...@@ -8,7 +8,7 @@ ARG JAR_FILE=target/yifu-batch-biz.jar
COPY ${JAR_FILE} app.jar COPY ${JAR_FILE} app.jar
EXPOSE 5077 EXPOSE 5008
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
......
...@@ -77,7 +77,7 @@ public class TElectronicArchiveTaskController { ...@@ -77,7 +77,7 @@ public class TElectronicArchiveTaskController {
*/ */
@Operation(summary = "导入Excel模板文件", description = "第一步:导入Excel模板文件,包含身份证、姓名、项目编码、项目名称") @Operation(summary = "导入Excel模板文件", description = "第一步:导入Excel模板文件,包含身份证、姓名、项目编码、项目名称")
@PostMapping("/importExcel") @PostMapping("/importExcel")
public R<?> importExcel(@Parameter(description = "Excel文件") @RequestParam("file") MultipartFile file) { public R<?> importExcel(@RequestBody MultipartFile file) {
if (file == null || file.isEmpty()) { if (file == null || file.isEmpty()) {
return R.failed("文件不能为空"); return R.failed("文件不能为空");
} }
...@@ -104,7 +104,7 @@ public class TElectronicArchiveTaskController { ...@@ -104,7 +104,7 @@ public class TElectronicArchiveTaskController {
@Operation(summary = "导入ZIP文件", description = "第二步:导入ZIP文件,包含员工档案资料") @Operation(summary = "导入ZIP文件", description = "第二步:导入ZIP文件,包含员工档案资料")
@PostMapping("/importZip") @PostMapping("/importZip")
public R<?> importZip( public R<?> importZip(
@Parameter(description = "ZIP文件") @RequestParam("file") MultipartFile file, @Parameter(description = "ZIP文件") @RequestBody MultipartFile file,
@Parameter(description = "任务ID") @RequestParam("taskId") String taskId) { @Parameter(description = "任务ID") @RequestParam("taskId") String taskId) {
if (file == null || file.isEmpty()) { if (file == null || file.isEmpty()) {
......
...@@ -153,7 +153,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo ...@@ -153,7 +153,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
// 建立任务和档案详情的关联关系 // 建立任务和档案详情的关联关系
createTaskArchiveRelations(task.getId(), successList); createTaskArchiveRelations(task.getId(), successList);
return R.ok("导入成功,任务编号:" + taskCode); return R.ok("导入成功,任务编号:" + task.getId());
} catch (Exception e) { } catch (Exception e) {
log.error("导入Excel文件失败", e); log.error("导入Excel文件失败", e);
...@@ -356,7 +356,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo ...@@ -356,7 +356,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
File tempZipFile = null; File tempZipFile = null;
try { try {
// 1. 校验ZIP大小 // 1. 校验ZIP大小
if (file.getSize() > ArchiveConstants.ZIP_MAX_SIZE) { long fileSize = file.getSize();
if (fileSize > ArchiveConstants.ZIP_MAX_SIZE) {
return R.failed("ZIP文件大小不能超过500M"); return R.failed("ZIP文件大小不能超过500M");
} }
...@@ -378,7 +379,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo ...@@ -378,7 +379,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
taskService.updateById(task); taskService.updateById(task);
// 将ZIP文件保存到临时目录 // 将ZIP文件保存到临时目录
String tempDirPath = System.getProperty("java.io.tmpdir") + File.separator + "zip_upload_" + taskId; String tempDirPath = System.getProperty("java.io.tmpdir") + "zip_load/" + System.currentTimeMillis() + "/";
File tempDir = new File(tempDirPath); File tempDir = new File(tempDirPath);
if (!tempDir.exists() && !tempDir.mkdirs()) { if (!tempDir.exists() && !tempDir.mkdirs()) {
throw new IOException("Failed to create directory: " + tempDirPath); throw new IOException("Failed to create directory: " + tempDirPath);
...@@ -390,7 +391,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo ...@@ -390,7 +391,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
// 保存ZIP附件信息(记录临时文件路径) // 保存ZIP附件信息(记录临时文件路径)
TAttaInfo zipAtta = new TAttaInfo(); TAttaInfo zipAtta = new TAttaInfo();
zipAtta.setAttaName(file.getOriginalFilename()); zipAtta.setAttaName(file.getOriginalFilename());
zipAtta.setAttaSize(file.getSize()); zipAtta.setAttaSize(fileSize);
zipAtta.setRelationType(ArchiveConstants.ATTA_RELATION_TYPE_ZIP); zipAtta.setRelationType(ArchiveConstants.ATTA_RELATION_TYPE_ZIP);
zipAtta.setDomainId(taskId); zipAtta.setDomainId(taskId);
zipAtta.setStatus(ArchiveConstants.ATTA_STATUS_DISABLED); zipAtta.setStatus(ArchiveConstants.ATTA_STATUS_DISABLED);
...@@ -478,41 +479,47 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo ...@@ -478,41 +479,47 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
d -> d d -> d
)); ));
// 创建临时目录用于解压ZIP文件 // 创建临时目录用于解压ZIP文件
String tempDirPath = System.getProperty("java.io.tmpdir") + File.separator + "archive_" + taskId + "_" + System.currentTimeMillis(); String tempDirPath = System.getProperty("java.io.tmpdir") + File.separator + "archive_file" + File.separator
tempDir = new File(tempDirPath); + System.currentTimeMillis() + File.separator;
if (!tempDir.mkdirs()) { tempDir = new File(tempDirPath);
if (!tempDir.exists() && !tempDir.mkdirs()) {
updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED);
return R.failed("创建临时目录失败");
}
// 解压ZIP文件
try {
// 验证ZIP文件是否可读
if (!zipSourceFile.canRead()) {
log.error("ZIP文件不可读,路径:{}", zipSourceFile.getAbsolutePath());
updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED); updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED);
return R.failed("创建临时目录失败"); return R.failed("ZIP文件不可读");
} }
// 使用指定字符集解压(支持中文文件名)
// 解压ZIP文件 // Windows系统通常使用GBK编码,Linux使用UTF-8
try { try {
ZipUtil.unzip(zipSourceFile, tempDir); ZipUtil.unzip(zipSourceFile, tempDir, java.nio.charset.Charset.forName("GBK"));
} catch (Exception e) { } catch (Exception e1) {
log.error("解压ZIP文件失败,任务ID:{}", taskId, e); // 如果GBK失败,尝试UTF-8
updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED); ZipUtil.unzip(zipSourceFile, tempDir, java.nio.charset.StandardCharsets.UTF_8);
return R.failed("解压ZIP文件失败:" + e.getMessage());
} }
} catch (Exception e) {
log.error("解压ZIP文件失败,任务ID:{},ZIP路径:{},临时目录:{}",
taskId, zipSourceFile.getAbsolutePath(), tempDirPath, e);
updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED);
return R.failed("解压ZIP文件失败:" + e.getMessage() + ",请检查ZIP文件是否完整且格式正确");
}
// 获取ZIP包的根目录(第一级目录) // 获取ZIP包的根目录(第一级目录,身份证+姓名目录
File[] zipRootDirs = tempDir.listFiles(File::isDirectory); File[] zipRootDirs = tempDir.listFiles(File::isDirectory);
if (zipRootDirs == null || zipRootDirs.length == 0) { if (zipRootDirs == null || zipRootDirs.length == 0) {
updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED); updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED);
return R.failed("ZIP文件格式不正确"); return R.failed("ZIP文件格式不正确");
} }
File zipRootDir = zipRootDirs[0]; // 第一级目录
// 处理第二级目录(身份证+姓名目录)
File[] personDirs = zipRootDir.listFiles(File::isDirectory);
if (personDirs == null || personDirs.length == 0) {
updateTaskStatus(task, ArchiveConstants.TASK_STATUS_NOT_UPLOADED);
return R.failed("ZIP文件格式不正确");
}
// 遍历每个人员目录,递归处理所有附件 // 遍历每个人员目录,递归处理所有附件
for (File personDir : personDirs) { for (File personDir : zipRootDirs) {
processPersonDirectory(personDir, detailMap, feedbackList, taskId); processPersonDirectory(personDir, detailMap, feedbackList, taskId);
} }
...@@ -757,7 +764,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo ...@@ -757,7 +764,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
detail.getId() detail.getId()
); );
if (uploadResult == null || !R.isSuccess(uploadResult)) { if (!R.isSuccess(uploadResult)) {
ArchiveFeedbackVO feedback = createFeedbackVO(detail, materialType, ArchiveFeedbackVO feedback = createFeedbackVO(detail, materialType,
ArchiveConstants.PROCESS_RESULT_FAILED, ArchiveConstants.PROCESS_RESULT_FAILED,
"文件上传失败:" + fileName + ",原因:" + (uploadResult != null ? uploadResult.getMsg() : "未知错误")); "文件上传失败:" + fileName + ",原因:" + (uploadResult != null ? uploadResult.getMsg() : "未知错误"));
......
...@@ -1001,11 +1001,12 @@ public class TElectronicArchiveDetailServiceImpl extends ServiceImpl<TElectronic ...@@ -1001,11 +1001,12 @@ public class TElectronicArchiveDetailServiceImpl extends ServiceImpl<TElectronic
public void initSearchVo(TElectronicArchiveDetailSearchVo searchVo) { public void initSearchVo(TElectronicArchiveDetailSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L; long roleId = 1569585030423158786L;
boolean isSsc = this.haveRole(user, roleId); boolean isSsc = this.haveRole(user, roleId);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) { long seeRoleId = 2003347621962379266L;
boolean isSeeSsc = this.haveRole(user, seeRoleId);
if (isSeeSsc || isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setAuthSql(null); searchVo.setAuthSql(null);
return;
} }
} }
......
...@@ -11,9 +11,12 @@ import com.yifu.cloud.plus.v1.batch.mapper.TElectronicArchiveTaskMapper; ...@@ -11,9 +11,12 @@ import com.yifu.cloud.plus.v1.batch.mapper.TElectronicArchiveTaskMapper;
import com.yifu.cloud.plus.v1.batch.service.TElectronicArchiveTaskService; import com.yifu.cloud.plus.v1.batch.service.TElectronicArchiveTaskService;
import com.yifu.cloud.plus.v1.batch.service.TTaskArchiveRelationService; import com.yifu.cloud.plus.v1.batch.service.TTaskArchiveRelationService;
import com.yifu.cloud.plus.v1.batch.vo.TElectronicArchiveTaskSearchVo; import com.yifu.cloud.plus.v1.batch.vo.TElectronicArchiveTaskSearchVo;
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.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -42,7 +45,9 @@ public class TElectronicArchiveTaskServiceImpl extends ServiceImpl<TElectronicAr ...@@ -42,7 +45,9 @@ public class TElectronicArchiveTaskServiceImpl extends ServiceImpl<TElectronicAr
*/ */
@Override @Override
public IPage<TElectronicArchiveTask> getTElectronicArchiveTaskPage(Page<TElectronicArchiveTask> page, TElectronicArchiveTaskSearchVo tElectronicArchiveTask){ public IPage<TElectronicArchiveTask> getTElectronicArchiveTaskPage(Page<TElectronicArchiveTask> page, TElectronicArchiveTaskSearchVo tElectronicArchiveTask){
return baseMapper.getTElectronicArchiveTaskPage(page,tElectronicArchiveTask); //权限赋值
initSearchVo(tElectronicArchiveTask);
return baseMapper.getTElectronicArchiveTaskPage(page,tElectronicArchiveTask);
} }
@Override @Override
...@@ -68,4 +73,22 @@ public class TElectronicArchiveTaskServiceImpl extends ServiceImpl<TElectronicAr ...@@ -68,4 +73,22 @@ public class TElectronicArchiveTaskServiceImpl extends ServiceImpl<TElectronicAr
return R.ok(); return R.ok();
} }
public void initSearchVo(TElectronicArchiveTaskSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1569585030423158786L;
boolean isSsc = this.haveRole(user, roleId);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setCreateBy(null);
}
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
if (role == roleId) {
return true;
}
}
return false;
}
} }
...@@ -73,7 +73,7 @@ springdoc: ...@@ -73,7 +73,7 @@ springdoc:
# 文件上传相关 支持阿里云、华为云、腾讯、minio # 文件上传相关 支持阿里云、华为云、腾讯、minio
oss: oss:
endpoint: http://oss-cn-beijing.aliyuncs.com endpoint: http://oss-cn-hangzhou.aliyuncs.com
accessKey: LTAIDh9goA3jgpun accessKey: LTAIDh9goA3jgpun
secretKey: eN8EHPAZxglNfcUCMhAT02cy93omLa secretKey: eN8EHPAZxglNfcUCMhAT02cy93omLa
bucket-name: yf-hr-efile-source bucket-name: yf-hr-efile-source
\ No newline at end of file
...@@ -191,13 +191,13 @@ public class ChecksUtil { ...@@ -191,13 +191,13 @@ public class ChecksUtil {
private static String getJsonElementValue(JsonElement temp) { private static String getJsonElementValue(JsonElement temp) {
String msg = ""; String msg = "";
if (Common.isNotNull(temp)) { if (Common.isNotNull(temp) && !temp.isJsonNull()) {
try { try {
return temp.getAsString(); return temp.getAsString();
} catch (Exception e) { } catch (Exception e) {
msg = temp.toString(); msg = temp.toString();
if (msg.length() > 10) { if (msg.length() > 10) {
msg = temp.toString().substring(0, 10); msg = msg.substring(0, 10);
} }
return "创蓝云智返回异常:" + msg; return "创蓝云智返回异常:" + msg;
} }
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration; import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService; import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService;
import com.yifu.cloud.plus.v1.csp.vo.*; import com.yifu.cloud.plus.v1.csp.vo.*;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptContractInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
...@@ -379,4 +380,16 @@ public class EmployeeRegistrationController { ...@@ -379,4 +380,16 @@ public class EmployeeRegistrationController {
public R addYearsMonths(@RequestBody TEmployeeContractDateVo vo) { public R addYearsMonths(@RequestBody TEmployeeContractDateVo vo) {
return R.ok(employeeRegistrationService.addYearsMonths(vo)); return R.ok(employeeRegistrationService.addYearsMonths(vo));
} }
/**
* @param vo
* @Description: 根据项目编码查询项目信息
* @Author: huyc
* @Date: 2025/6/18
* @return:
**/
@PostMapping("/selectContractInfoByDetptNo")
public EkpDeptContractInfoVo selectContractInfoByDetptNo(@RequestBody EkpDeptContractInfoVo vo) {
return employeeRegistrationService.selectContractInfoByDetptNo(vo);
}
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,6 +5,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.csp.entity.EmployeeRegistration; import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.vo.*; import com.yifu.cloud.plus.v1.csp.vo.*;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptContractInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
...@@ -178,4 +179,6 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati ...@@ -178,4 +179,6 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
Date addYearsMonths(TEmployeeContractDateVo vo); Date addYearsMonths(TEmployeeContractDateVo vo);
EkpDeptContractInfoVo selectContractInfoByDetptNo(EkpDeptContractInfoVo vo);
} }
...@@ -1916,6 +1916,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1916,6 +1916,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
} }
@Override
public EkpDeptContractInfoVo selectContractInfoByDetptNo(EkpDeptContractInfoVo vo) {
if (Common.isNotNull(vo) && Common.isNotNull(vo.getDeptNo())) {
R<EkpDeptContractInfoVo> info = ekpDaprUtils.selectContractInfoByDetptNo(vo);
if (Common.isNotNull(info) && Common.isNotNull(info.getData())) {
return info.getData();
}
}
return null;
}
/** /**
* @Description: 批量处理日志 * @Description: 批量处理日志
* @Author: hgw * @Author: hgw
......
...@@ -227,23 +227,27 @@ public class TSocialFundInfoController { ...@@ -227,23 +227,27 @@ public class TSocialFundInfoController {
/** /**
* 通过身份证查询在途或在保的数据 * 通过身份证查询在途或在保的数据
* @param empIdcard 社保公积金查询表 * @param empIdcard 社保公积金查询表
* @param type 0 确认接收使用,1信息修改使用
* @return * @return
*/ */
@Operation(summary = "通过身份证查询在途或在保的数据", description = "通过身份证查询在途或在保的数据") @Operation(summary = "通过身份证查询在途或在保的数据", description = "通过身份证查询在途或在保的数据")
@PostMapping("/selectUnSocialFundInfoByEmpIdcard" ) @PostMapping("/selectUnSocialFundInfoByEmpIdcard" )
public R<List<UnSocialFundInfoVo>> selectUnSocialFundInfoByEmpIdcard(@RequestParam String empIdcard) { public R<List<UnSocialFundInfoVo>> selectUnSocialFundInfoByEmpIdcard(@RequestParam String empIdcard,
return R.ok(tSocialFundInfoService.selectUnSocialFundInfoByEmpIdcard(empIdcard)); @RequestParam(required = false) String type) {
return R.ok(tSocialFundInfoService.selectUnSocialFundInfoByEmpIdcard(empIdcard, type));
} }
/** /**
* 通过身份证查询在途或在保的公积金数据 * 通过身份证查询在途或在保的公积金数据
* @param empIdcard 社保公积金查询表 * @param empIdcard 社保公积金查询表
* @param type 0 确认接收使用,1信息修改使用
* @return * @return
*/ */
@Operation(summary = "通过身份证查询在途或在保的公积金数据", description = "通过身份证查询在途或在保的公积金数据") @Operation(summary = "通过身份证查询在途或在保的公积金数据", description = "通过身份证查询在途或在保的公积金数据")
@PostMapping("/selectUnFundInfoByEmpIdcard" ) @PostMapping("/selectUnFundInfoByEmpIdcard" )
public R<List<UnFundInfoVo>> selectUnFundInfoByEmpIdcard(@RequestParam String empIdcard) { public R<List<UnFundInfoVo>> selectUnFundInfoByEmpIdcard(@RequestParam String empIdcard,
return R.ok(tSocialFundInfoService.selectUnFundInfoByEmpIdcard(empIdcard)); @RequestParam(required = false) String type) {
return R.ok(tSocialFundInfoService.selectUnFundInfoByEmpIdcard(empIdcard, type));
} }
......
...@@ -98,13 +98,13 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> { ...@@ -98,13 +98,13 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> {
**/ **/
List<String> getSocialWorkInjuryList(); List<String> getSocialWorkInjuryList();
List<UnSocialFundInfoVo> selectUnSocialFundInfoByEmpIdcard(@Param("empIdcard") String empIdcard); List<UnSocialFundInfoVo> selectUnSocialFundInfoByEmpIdcard(@Param("empIdcard") String empIdcard,@Param("type") String type);
long selectSocialFundInfoCountByEmpIdcard(@Param("empIdcard") String empIdcard); long selectSocialFundInfoCountByEmpIdcard(@Param("empIdcard") String empIdcard);
long selectFundCountByEmpIdcard(@Param("empIdcard") String empIdcard); long selectFundCountByEmpIdcard(@Param("empIdcard") String empIdcard);
List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(@Param("empIdcard")String empIdcard); List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(@Param("empIdcard")String empIdcard,@Param("type") String type);
// 离职待办专用,查询社保ID与状态(主要派增部分失败与成功的) // 离职待办专用,查询社保ID与状态(主要派增部分失败与成功的)
TSocialFundInfo getSocialStatus(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo); TSocialFundInfo getSocialStatus(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
......
...@@ -96,7 +96,7 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> { ...@@ -96,7 +96,7 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
SocialFundVo getSocialAndFundReduceListByEmpIdCardSet(Set<String> empIdCardSet); SocialFundVo getSocialAndFundReduceListByEmpIdCardSet(Set<String> empIdCardSet);
List<UnSocialFundInfoVo> selectUnSocialFundInfoByEmpIdcard(String empIdcard); List<UnSocialFundInfoVo> selectUnSocialFundInfoByEmpIdcard(String empIdcard,String type);
Boolean selectExitEmpSocail(TEmployeeAutoRegistCheckVo cardVo); Boolean selectExitEmpSocail(TEmployeeAutoRegistCheckVo cardVo);
...@@ -109,7 +109,7 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> { ...@@ -109,7 +109,7 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
**/ **/
Boolean selectExitEmpFund(TEmployeeAutoRegistCheckVo cardVo); Boolean selectExitEmpFund(TEmployeeAutoRegistCheckVo cardVo);
List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(String empIdcard); List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(String empIdcard,String type);
/** /**
* @param paramVo * @param paramVo
......
...@@ -234,9 +234,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -234,9 +234,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (redisLabelMap != null) { if (redisLabelMap != null) {
redisLabelMap.putAll(userMap); redisLabelMap.putAll(userMap);
} }
// 使用 try-with-resources 确保输出流正确关闭 // 获取输出流
try (ServletOutputStream out = response.getOutputStream()) { OutputStream out = null;
ExcelWriter excelWriter = EasyExcel.write(out, TDispatchInfoExportVo.class) ExcelWriter excelWriter = null;
try {
out = response.getOutputStream();
excelWriter = EasyExcel.write(out, TDispatchInfoExportVo.class)
.registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(searchVo.getExportFields()) .includeColumnFieldNames(searchVo.getExportFields())
.build(); .build();
...@@ -263,13 +266,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -263,13 +266,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
excelWriter.finish(); } catch (IOException e) {
out.flush(); log.error("导出文件时发生IO异常", e);
throw new RuntimeException("导出文件失败", e); // 可以根据需要转换为业务异常
} finally {
if (excelWriter != null) {
try {
excelWriter.finish();
} catch (Exception e) {
log.error("关闭ExcelWriter时发生异常", e);
}
}
} }
} catch (IOException e) { }catch (Exception e) {
log.error("导出文件时发生IO异常", e);
throw new RuntimeException("导出文件失败", e); // 可以根据需要转换为业务异常
} catch (Exception e) {
log.error("执行导出时发生未知异常", e); log.error("执行导出时发生未知异常", e);
throw new RuntimeException("导出过程中发生错误", e); throw new RuntimeException("导出过程中发生错误", e);
} finally { } finally {
......
...@@ -954,12 +954,12 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe ...@@ -954,12 +954,12 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
} }
@Override @Override
public List<UnSocialFundInfoVo> selectUnSocialFundInfoByEmpIdcard(String empIdcard) { public List<UnSocialFundInfoVo> selectUnSocialFundInfoByEmpIdcard(String empIdcard,String type) {
return baseMapper.selectUnSocialFundInfoByEmpIdcard(empIdcard); return baseMapper.selectUnSocialFundInfoByEmpIdcard(empIdcard, type);
} }
@Override @Override
public List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(String empIdcard) { public List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(String empIdcard,String type) {
return baseMapper.selectUnFundInfoByEmpIdcard(empIdcard); return baseMapper.selectUnFundInfoByEmpIdcard(empIdcard, type);
} }
@Override @Override
public Boolean selectExitEmpSocail(TEmployeeAutoRegistCheckVo cardVo) { public Boolean selectExitEmpSocail(TEmployeeAutoRegistCheckVo cardVo) {
......
...@@ -1251,7 +1251,9 @@ ...@@ -1251,7 +1251,9 @@
where a.EMP_IDCARD = #{empIdcard} where a.EMP_IDCARD = #{empIdcard}
<!-- 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败 10 审核不通过)、派减(6待审核 7待办理 8办理成功 9 办理失败 11派减办理中 12 派减部分办理失败) --> <!-- 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败 10 审核不通过)、派减(6待审核 7待办理 8办理成功 9 办理失败 11派减办理中 12 派减部分办理失败) -->
and a.social_status in ('0', '1', '2', '3', '4', '6', '7', '9', '11', '12') and a.social_status in ('0', '1', '2', '3', '4', '6', '7', '9', '11', '12')
and a.create_name not like '自动化%' <if test="type != null and type = '1'">
and a.create_name not like '自动化%'
</if>
</select> </select>
<!--tSocialFundInfo简单分页查询--> <!--tSocialFundInfo简单分页查询-->
<select id="selectUnFundInfoByEmpIdcard" resultMap="unFundInfoMap"> <select id="selectUnFundInfoByEmpIdcard" resultMap="unFundInfoMap">
...@@ -1275,7 +1277,9 @@ ...@@ -1275,7 +1277,9 @@
<!-- 派增(0待审核、1待办理、3办理成功、4办理失败9 审核不通过)、派减(5待审核 6待办理 7 办理成功 8 办理失败 ) --> <!-- 派增(0待审核、1待办理、3办理成功、4办理失败9 审核不通过)、派减(5待审核 6待办理 7 办理成功 8 办理失败 ) -->
and a.fund_status in ('0', '1', '3', '5', '6', '8') and a.fund_status in ('0', '1', '3', '5', '6', '8')
and a.create_name not like '自动化%' <if test="type != null and type == '1'">
and a.create_name not like '自动化%'
</if>
</select> </select>
<select id="selectSocialFundInfoCountByEmpIdcard" resultType="java.lang.Long"> <select id="selectSocialFundInfoCountByEmpIdcard" resultType="java.lang.Long">
SELECT count(1) SELECT count(1)
......
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