Commit fcad5961 authored by hongguangwu's avatar hongguangwu

合同变更-仅作废之前选的合同

parent c660337b
......@@ -66,7 +66,7 @@ public class EmployeeVO extends RowIndex implements Serializable {
* 项目编码
*/
@ExcelProperty(value = "项目编码")
@ExcelAttribute(name = "项目编码", maxLength = 32, needExport = true, errorInfo = "身份证号必填且不可超过20位")
@ExcelAttribute(name = "项目编码", maxLength = 32, needExport = true, errorInfo = "项目编码必填且不可超过20位")
@Size(max = 32, message = "项目编码不可超过32位")
private String deptNo;
......
......@@ -416,10 +416,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
// 作废、终止,不变为在用
// 非作废、终止,本条变为在用
if (Common.isEmpty(contractInfo.getSituation())
|| (!EmployeeConstants.SITUATION_SIX.equals(contractInfo.getSituation())
&& !EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation()))) {
// 其他变为不在用
baseMapper.updateInUseStatusById(contractInfo.getEmpId(), contractInfo.getSettleDomain(), contractInfo.getId(), CommonConstants.ONE_STRING);
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
// 更新档案、项目合同状态为(1可用)
......
......@@ -8,4 +8,5 @@ package com.yifu.cloud.plus.v1.yifu.social.constants;
public class SocialConstants {
// 社保补缴配置有误!
public static final String SOCIAL_SET_ERROR = "社保补缴配置有误!";
public static final String EMP_NAME_ERROR = "员工姓名错误!";
}
......@@ -36,15 +36,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAuditInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TAuditInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFundInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import com.yifu.cloud.plus.v1.yifu.social.service.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundHistoryVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoVo;
......@@ -58,7 +54,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 社保公积金查询表
......@@ -75,6 +73,7 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
private final TDispatchInfoService tDispatchInfoService;
private final TSocialLogService tSocialLogService;
private final TAuditInfoService tAuditInfoService;
private final TForecastLibraryService tForecastLibraryService;
/**
* 社保公积金查询表简单分页查询
......@@ -191,12 +190,12 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TSocialFundInfoVo> util1 = new ExcelUtil<>(TSocialFundInfoVo.class);
ExcelUtil<TSocialFundHistoryVo> util1 = new ExcelUtil<>(TSocialFundHistoryVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TSocialFundInfoVo.class, new ReadListener<TSocialFundInfoVo>() {
EasyExcel.read(inputStream, TSocialFundInfoVo.class, new ReadListener<TSocialFundHistoryVo>() {
/**
* 单次缓存的数据量
*/
......@@ -204,10 +203,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
/**
*临时存储
*/
private List<TSocialFundInfoVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
private List<TSocialFundHistoryVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TSocialFundInfoVo data, AnalysisContext context) {
public void invoke(TSocialFundHistoryVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
......@@ -245,24 +244,56 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
return R.ok(errorMessageList);
}
private void importTSocialFundInfo(List<TSocialFundInfoVo> excelVOList, List<ErrorMessage> errorMessageList) {
private void importTSocialFundInfo(List<TSocialFundHistoryVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
TSocialFundHistoryVo excel;
List<String> idCardList = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) {
idCardList.add(excelVOList.get(i).getIdCard());
}
List<TSocialFundInfo> socialFundInfoList = this.list(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, idCardList));
Map<String, TSocialFundInfo> socialFundInfoMap = new HashMap<>();
if (socialFundInfoList != null && !socialFundInfoList.isEmpty()) {
for (TSocialFundInfo socialFundInfo : socialFundInfoList) {
socialFundInfoMap.put(socialFundInfo.getEmpIdcard(), socialFundInfo);
}
socialFundInfoList.clear();
}
TSocialFundInfo oldSocialFundInfo;
TSocialFundInfo socialFundInfo;
for (int i = 0; i < excelVOList.size(); i++) {
TSocialFundInfoVo excel = excelVOList.get(i);
// 数据合法情况 TODO
excel = excelVOList.get(i);
socialFundInfo = socialFundInfoMap.get(excel.getIdCard());
if (socialFundInfo.getEmpName().equals(excel.getName())) {
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
// 0:校验数据有效性-TODO
// 1:更新社保公积金查询-TODO
//updateSocialFundInfo(socialFundInfo, excel);
// 2:新增调基记录
insertExcel(excel);
// 3:新增变更日志
oldSocialFundInfo = new TSocialFundInfo();
BeanUtil.copyProperties(socialFundInfo, oldSocialFundInfo);
tSocialLogService.saveModificationRecord(CommonConstants.ONE_INT, oldSocialFundInfo.getId(), oldSocialFundInfo, socialFundInfo);
// 4:同步预估库-TODO
//tForecastLibraryService.
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SocialConstants.EMP_NAME_ERROR));
}
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TSocialFundInfoVo excel) {
private void insertExcel(TSocialFundHistoryVo excel) {
TSocialFundInfo insert = new TSocialFundInfo();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
......
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