Commit d231dcf2 authored by huyuchen's avatar huyuchen

法大大代码提交

parent c20abe60
......@@ -20,11 +20,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeXProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -34,7 +32,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......
......@@ -169,13 +169,13 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
try {
zipFile = new ZipFile(srcFile, CharsetUtil.CHARSET_GBK);
Enumeration<?> entries = zipFile.entries();
Enumeration<?> entriesCheck = zipFile.entries();
Map<String,String> insMap = new HashMap<>();
List<TElecEmployeeInfo> infolist = new ArrayList<>();
List<String> list = new ArrayList<>();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
while (entriesCheck.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entriesCheck.nextElement();
//添加进filesName
String empInfo = entry.getName();
// 如果是文件夹,就创建个文件夹
......
......@@ -86,18 +86,25 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
//划转,更新项目信息
TEmployeeProject updateTEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmpChangeInfo.getEmpIdcard()).eq(TEmployeeProject::getDeptName,tEmpChangeInfo.getOldSettle())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL).eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT));
if (Common.isNotNull(updateTEmployeeProject)) {
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeeProject.getId());
updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo());
updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId());
updateTEmployeeProject.setDeptName(tEmpChangeInfo.getNewSettle());
updateTEmployeeProject.setUnitId(tEmpChangeInfo.getUnitId());
updateTEmployeeProject.setUnitNo(tEmpChangeInfo.getUnitNo());
updateTEmployeeProject.setUnitName(tEmpChangeInfo.getNewDept());
updateTEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
updateTEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
updateTEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
tEmployeeProjectService.updateById(updateTEmployeeProject);
tEmpChangeInfo.setProId(updateTEmployeeProject.getId());
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeeProject.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), tEmployeeProjectOld, updateTEmployeeProject);
}
//保存档案划转记录
......@@ -168,9 +175,13 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
if (CommonConstants.ONE_INT == updateTEmployeePro.getProjectStatus()) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_DELETE_EXIT, excel.getOldSettleCode()));
} else if (Common.isNotNull(tSettleDomain)) {
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
updateTEmployeePro.setDeptNo(tSettleDomain.getDepartNo());
updateTEmployeePro.setDeptId(tSettleDomain.getId());
updateTEmployeePro.setDeptName(tSettleDomain.getDepartName());
updateTEmployeePro.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
updateTEmployeePro.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
updateTEmployeePro.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
TCustomerInfo tCustomerInfo = tCustomerInfoService.getById(tSettleDomain.getCustomerId());
if (Common.isNotNull(tCustomerInfo)) {
updateTEmployeePro.setUnitId(tCustomerInfo.getId());
......@@ -179,7 +190,6 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
updateList.add(updateTEmployeePro);
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
}
} else {
......
......@@ -30,7 +30,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
......@@ -185,7 +184,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo= checkListR.getData();
CheckBankNoVo vo= checkListR.getData();
check = (null==vo.getRes())?null:vo.getRes().getData();
if (Common.isEmpty(vo)) {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
......@@ -671,8 +670,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
/**
* 新增档案操作记录
*
* 新增档案
* @param excelVOList
* @param errorMessageList
* @param
......@@ -748,25 +746,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
check.setBankNo(excel.getBankNo());
check.setIdNum(excel.getEmpIdcard());
check.setName(excel.getEmpName());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
CheckBankNoVo vo= checkListR.getData();
check = (null==vo.getRes())?null:vo.getRes().getData();
if (Common.isEmpty(vo)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), vo.getRes().getMsg()));
} else if (Common.isEmpty(check) && !check.getResult().equals(CommonConstants.ZERO_STRING)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
}
}
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList,tEmployeeInfo);
//档案有(在档人员),项目有(草稿/已审核);
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[0] == tEmployeeProject.getProjectStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(updateList, tEmployeeInfo);
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
......@@ -775,7 +776,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(离职库),项目(已减档)
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(updateList, tEmployeeInfo);
updateExcelPro(excel, proupdateList, tEmployeeProject);
//档案有(离职库),项目无;
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
......@@ -785,25 +786,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
check.setBankNo(excel.getBankNo());
check.setIdNum(excel.getEmpIdcard());
check.setName(excel.getEmpName());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
CheckBankNoVo vo= checkListR.getData();
check = (null==vo.getRes())?null:vo.getRes().getData();
if (Common.isEmpty(vo)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), vo.getRes().getMsg()));
} else if (Common.isEmpty(check) && !check.getResult().equals(CommonConstants.ZERO_STRING)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
}
}
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo);
//档案有(在档人员),项目(已减档)
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(updateList, tEmployeeInfo);
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
//不允许复档复项
......@@ -1008,6 +1012,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isNotNull(tSettleDomain)) {
insTEmployeePro.setDeptId(tSettleDomain.getId());
insTEmployeePro.setDeptName(tSettleDomain.getDepartName());
insTEmployeePro.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
insTEmployeePro.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
insTEmployeePro.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
TCustomerInfo tCustomerInfo = tCustomerInfoMapper.selectById(tSettleDomain.getCustomerId());
if (Common.isNotNull(tCustomerInfo)) {
insTEmployeePro.setUnitId(tCustomerInfo.getId());
......@@ -1195,8 +1202,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 更新人员档案
*/
private void updateExcelPost(EmployeeProjectVO excel, List<TEmployeeInfo> updateList, TEmployeeInfo tEmployeeInfo) {
BeanUtil.copyProperties(excel, tEmployeeInfo);
private void updateExcelPost(List<TEmployeeInfo> updateList, TEmployeeInfo tEmployeeInfo) {
tEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT);
updateList.add(tEmployeeInfo);
}
......
......@@ -615,7 +615,8 @@
insert into t_employee_project
(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,
DEPT_ID,DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO,EMP_NO,TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,
WORKING_HOURS,PROJECT_SOURCE,DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS,SOCIAL_STATUS,FUND_STATUS)
BUSINESS_PRIMARY_TYPE,BUSINESS_SECOND_TYPE,BUSINESS_THIRD_TYPE,WORKING_HOURS,PROJECT_SOURCE,DELETE_FLAG,
CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS,SOCIAL_STATUS,FUND_STATUS)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
......@@ -641,6 +642,9 @@
#{item.bankName,jdbcType=VARCHAR},
#{item.bankNo,jdbcType=VARCHAR},
#{item.bankSubName,jdbcType=VARCHAR},
#{item.businessPrimaryType,jdbcType=VARCHAR},
#{item.businessSecondType,jdbcType=VARCHAR},
#{item.businessThirdType,jdbcType=VARCHAR},
#{item.workingHours,jdbcType=VARCHAR},
#{item.projectSource,jdbcType=VARCHAR},
#{item.deleteFlag,jdbcType=VARCHAR},
......
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