Commit 7d6c5014 authored by fangxinjiang's avatar fangxinjiang

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

parents 0dc458d7 551fdbd9
...@@ -20,10 +20,7 @@ import cn.hutool.core.collection.CollUtil; ...@@ -20,10 +20,7 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpChangeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpChangeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCustomerInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TCustomerInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService;
...@@ -57,6 +54,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -57,6 +54,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
private final TSettleDomainService tSettleDomainService; private final TSettleDomainService tSettleDomainService;
private final TEmployeeLogServiceImpl tEmployeeLogService;
/** /**
* @Author huyc * @Author huyc
* @Description 档案划转 * @Description 档案划转
...@@ -90,6 +89,10 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -90,6 +89,10 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
} }
//保存档案划转记录 //保存档案划转记录
this.save(tEmpChangeInfo); this.save(tEmpChangeInfo);
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(tEmpChangeInfo.getProId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), tEmployeeProjectOld, updateTEmployeeProject);
return R.ok(); return R.ok();
} }
...@@ -139,6 +142,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -139,6 +142,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName()); updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
} }
tEmployeeProjectService.updateById(updateTEmployeePro); tEmployeeProjectService.updateById(updateTEmployeePro);
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
} }
} }
} else { } else {
......
...@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
...@@ -39,11 +40,15 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO; ...@@ -39,11 +40,15 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
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.exception.ErrorCodes; import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
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.DaprCheckProperties;
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;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper; import org.springframework.cache.support.SimpleValueWrapper;
...@@ -66,6 +71,7 @@ import java.util.stream.Collectors; ...@@ -66,6 +71,7 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@EnableConfigurationProperties(DaprCheckProperties.class)
public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService { public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService {
private final TEmployeeLogService tEmployeeLogService; private final TEmployeeLogService tEmployeeLogService;
...@@ -76,6 +82,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -76,6 +82,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
private final TCustomerInfoMapper tCustomerInfoMapper; private final TCustomerInfoMapper tCustomerInfoMapper;
private final DaprCheckProperties daprCheckProperties;
// 缓存信息 // 缓存信息
private final CacheManager cacheManager; private final CacheManager cacheManager;
...@@ -216,6 +224,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -216,6 +224,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
List<TEmployeeInfo> updateList = new ArrayList(); List<TEmployeeInfo> updateList = new ArrayList();
List<TEmployeeProject> proInsList = new ArrayList(); List<TEmployeeProject> proInsList = new ArrayList();
List<TEmployeeProject> proupdateList = new ArrayList(); List<TEmployeeProject> proupdateList = new ArrayList();
// 获取身份证、手机号列表,批量查询档案
Map<String, Integer> idCardMap = new HashMap<>();
String idCard;
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectVO excel = excelVOList.get(i); EmployeeProjectVO excel = excelVOList.get(i);
...@@ -226,6 +239,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -226,6 +239,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
continue; continue;
} }
idCard = excel.getEmpIdcard();
if (idCardMap.get(idCard) != null) {
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号与第" + idCardMap.get(idCard) + "行重复!"));
} else {
idCardMap.put(idCard, i + 2);
}
//根据身份证获取人员档案 //根据身份证获取人员档案
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard()) .eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard())
...@@ -239,8 +259,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -239,8 +259,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//不存在复档或复项的情况 //不存在复档或复项的情况
//档案无(在档人员、离职库皆无),项目无 //档案无(在档人员、离职库皆无),项目无
if (Common.isEmpty(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)) { if (Common.isEmpty(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)) {
// 校验身份证实名
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(excel.getEmpName());
checkIdCard.setIdCard(excel.getEmpIdcard());
List<TCheckIdCard> checkList = new ArrayList<>();
checkList.add(checkIdCard);
R<List<TCheckIdCard>> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCard", checkList, TCheckIdCard.class, SecurityConstants.FROM_IN);
Boolean isSave = false;
if (checkListR != null && checkListR.getData() != null) {
for (TCheckIdCard check : checkListR.getData()) {
if (check.getIsTrue() == CommonConstants.ZERO_INT) {
errorMsg.add(check.getReason());
isSave = true;
break;
}
}
}
if (!isSave) {
insertExcelPost(excel, insertList); insertExcelPost(excel, insertList);
insertExcelPro(excel, proInsList); insertExcelPro(excel, proInsList);
}
//档案有(在档人员),项目无 //档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject) } else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) { && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) {
...@@ -617,6 +657,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -617,6 +657,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
tEmployeeInfo.setUpdateBy(user.getId()); tEmployeeInfo.setUpdateBy(user.getId());
updateList.add(tEmployeeInfo); updateList.add(tEmployeeInfo);
// 记录变更日志
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo);
} }
/** /**
...@@ -627,6 +670,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -627,6 +670,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
tEmployeeProject.setUpdateBy(user.getId()); tEmployeeProject.setUpdateBy(user.getId());
proupdateList.add(tEmployeeProject); proupdateList.add(tEmployeeProject);
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), tEmployeeProjectOld, tEmployeeProject);
} }
@Override @Override
......
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