Commit 3900117d authored by hongguangwu's avatar hongguangwu

MVP1.7.0 更新附件

parent 1605e233
......@@ -146,7 +146,7 @@ public class PreUploadEmpImportVo implements Serializable {
// private List<TPreEmpFamily> tpreEmpFamilyList
@ExcelAttribute(name = "成员姓名", maxLength = 32)
private String familyName;
@ExcelAttribute(name = "与本人关系", isMark = true, maxLength = 32)
@ExcelAttribute(name = "与本人关系", isMark = true,isDataId = true,dataType = ExcelAttributeConstants.FAMILY_RELATION, maxLength = 32)
private String relationshipSelf;
@ExcelAttribute(name = "手机号码(家庭成员)", isMark = true, isPhone = true, maxLength = 32)
private String contractTel;
......@@ -258,6 +258,8 @@ public class PreUploadEmpImportVo implements Serializable {
// 预入职-员工工作履历信息表
@ExcelAttribute(name = "是否为首份工作")
private String firstWorkFlagValue;
@ExcelAttribute(name = "与本人关系")
private String relationshipSelfValue;
// 预入职-员工职业资格信息表
@ExcelAttribute(name = "是否有职业资格证书")
private String haveQualificationValue;
......
......@@ -34,7 +34,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.monitorjbl.xlsx.StreamingReader;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper;
......@@ -2666,9 +2665,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 校验是否通过
StringBuilder errorCheck;
// 已存在的主档案Map
Map<String, PreUploadEmpImportVo> empMap = new HashMap<>();
Map<String, String> empMap = new HashMap<>();
// 已存在的主档案
PreUploadEmpImportVo curVo;
String curVo;
// 人员map
Map<String, TEmployeeProject> proMap = tEmployeeProjectService.getMapByDeptIdAndDelete(paramVo.getDeptId());
TEmployeeProject project;
......@@ -2679,7 +2678,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
Map<String, String> dictMap = new HashMap<>();
// 存放父级area的值
Map<String, String> parentAreaMap = new HashMap<>();
Map<String, Date> startDateMap = new HashMap<>();
Map<String, Date> startDateMap;
for (Map<String, String> rowMap : vo.getContentList()) {
curVo = null;
errorMust = new StringBuilder();
......@@ -2839,13 +2838,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
detail.setErrorInfo(errorInfo.toString());
if (curVo != null) {
//List<PreUploadEmpImportVo> otherList = curVo.getOtherList();
//otherList.add(detail);
//empMap.put(detail.getEmpIdcard(), curVo);
detail.setIsMain(false);
} else {
detail.setIsMain(true);
empMap.put(detail.getEmpIdcard(), detail);
empMap.put(detail.getEmpIdcard(), CommonConstants.ZERO_STRING);
}
}
}
......@@ -3042,6 +3038,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TPreEmpEducation> preEmpEducationList = new ArrayList<>();
List<TPreEmpFamily> preEmpFamilyList = new ArrayList<>();
List<TPreEmpWorkRecording> preEmpWorkRecordingList = new ArrayList<>();
List<TPreEmpProfessionalQualification> preEmpProfessionalQualificationList = new ArrayList<>();
TPreEmpBadRecord tPreEmpBadRecord;
TPreEmpContactInfo tPreEmpContactInfo;
......@@ -3049,6 +3046,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmpEducation tPreEmpEducation;
TPreEmpFamily tPreEmpFamily;
TPreEmpWorkRecording tPreEmpWorkRecording;
TPreEmpProfessionalQualification tPreEmpProfessionalQualification;
String mainId;
String empIdCard;
// 组装附属信息
......@@ -3056,16 +3054,15 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
main = saveMainMap.get(info.getEmpIdcard());
empId = null;
if (main != null) {
employee = null;
employee = oldEmpMap.get(info.getEmpIdcard());
mainId = main.getId();
empIdCard = main.getEmpIdcard();
// 1、2、预入职档案表、项目档案表
if (Common.isNotNull(info.getIsMain()) && Boolean.TRUE.equals(info.getIsMain())) {
tPreEmployeeInfo = new TPreEmployeeInfo();
tPreEmployeeProject = new TPreEmployeeProject();
employee = oldEmpMap.get(info.getEmpIdcard());
project = proMap.get(info.getEmpIdcard());
project = proMap.get(info.getEmpIdcard());
tPreEmployeeInfo.setEmpName(main.getEmpName());
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
if (employee != null) {
......@@ -3076,18 +3073,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
tPreEmployeeProject.setOldId(project.getId());
}
} else {
tPreEmployeeProject.setEmpName(main.getEmpName());
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
tPreEmployeeProject.setUnitNo(dept.getCustomerNo());
tPreEmployeeProject.setBusinessPrimaryType(dept.getBusinessPrimaryType());
tPreEmployeeProject.setBusinessSecondType(dept.getBusinessSecondType());
tPreEmployeeProject.setBusinessThirdType(dept.getBusinessThirdType());
tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
}
tPreEmployeeInfo.setPreMainId(mainId);
......@@ -3158,6 +3143,17 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProject.setProjectSource(CommonConstants.EIGHT_STRING);
tPreEmployeeProject.setEmpName(main.getEmpName());
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
tPreEmployeeProject.setUnitNo(dept.getCustomerNo());
tPreEmployeeProject.setBusinessPrimaryType(dept.getBusinessPrimaryType());
tPreEmployeeProject.setBusinessSecondType(dept.getBusinessSecondType());
tPreEmployeeProject.setBusinessThirdType(dept.getBusinessThirdType());
tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
preEmployeeProjectList.add(tPreEmployeeProject);
// 其他附属信息
......@@ -3186,6 +3182,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpContactInfo.setCreateTime(LocalDateTime.now());
// 紧急联系人姓名 与本人关系 联系地址-省 联系地址-市 联系地址-区/县 联系地址-详细地址 手机号码(紧急联系人)
tPreEmpContactInfo.setEmpName(info.getContactEmpName());
tPreEmpContactInfo.setEmpIdcard(empIdCard);
tPreEmpContactInfo.setRelationType(info.getRelationType());
tPreEmpContactInfo.setRelationProvince(info.getRelationProvinceValue());
tPreEmpContactInfo.setRelationCity(info.getRelationCityValue());
......@@ -3257,15 +3254,15 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpFamily.setCreateName(user.getNickname());
tPreEmpFamily.setCreateTime(LocalDateTime.now());
tPreEmpFamily.setFamilyName(info.getFamilyName());
tPreEmpFamily.setRelationshipSelf(info.getRelationshipSelf());
tPreEmpFamily.setRelationshipSelf(info.getRelationshipSelfValue());
tPreEmpFamily.setContractTel(info.getContractTel());
preEmpFamilyList.add(tPreEmpFamily);
}
// 主要工作经历
if (Common.isNotNull(info.getFirstWorkFlag())
&& CommonConstants.IS_FALSE.equals(main.getFirstWorkFlag())
&& CommonConstants.IS_FALSE.equals(info.getFirstWorkFlag())) {
&& CommonConstants.ONE_STRING.equals(main.getFirstWorkFlag())
&& CommonConstants.ONE_STRING.equals(info.getFirstWorkFlag())) {
tPreEmpWorkRecording = new TPreEmpWorkRecording();
tPreEmpWorkRecording.setSettleDomain(deptId);
tPreEmpWorkRecording.setEmpId(empId);
......@@ -3287,25 +3284,24 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 职业资格信息——职业资格证书
if (Common.isNotNull(info.getHaveQualification())
&& CommonConstants.IS_TRUE.equals(main.getHaveQualification())
&& CommonConstants.IS_TRUE.equals(info.getHaveQualification())) {
tPreEmpWorkRecording = new TPreEmpWorkRecording();
tPreEmpWorkRecording.setSettleDomain(deptId);
tPreEmpWorkRecording.setEmpId(empId);
&& CommonConstants.ZERO_STRING.equals(main.getHaveQualification())
&& CommonConstants.ZERO_STRING.equals(info.getHaveQualification())) {
tPreEmpProfessionalQualification = new TPreEmpProfessionalQualification();
tPreEmpProfessionalQualification.setPreMainId(mainId);
tPreEmpProfessionalQualification.setSettleDomain(deptId);
tPreEmpProfessionalQualification.setEmpId(empId);
if (employee != null) {
tPreEmpWorkRecording.setEmpName(employee.getEmpName());
tPreEmpWorkRecording.setEmpCode(employee.getEmpCode());
tPreEmpProfessionalQualification.setEmpName(employee.getEmpName());
tPreEmpProfessionalQualification.setEmpCode(employee.getEmpCode());
}
tPreEmpWorkRecording.setEmpIdcard(empIdCard);
tPreEmpWorkRecording.setPreMainId(mainId);
tPreEmpWorkRecording.setCreateBy(user.getId());
tPreEmpWorkRecording.setCreateName(user.getNickname());
tPreEmpWorkRecording.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecording.setWorkUnit(info.getWorkUnit());
tPreEmpWorkRecording.setWorkJob(info.getWorkJob());
tPreEmpWorkRecording.setStartDate(info.getStartDateValue());
tPreEmpWorkRecording.setEndDate(info.getEndDateValue());
preEmpWorkRecordingList.add(tPreEmpWorkRecording);
tPreEmpProfessionalQualification.setEmpIdcard(empIdCard);
tPreEmpProfessionalQualification.setCreateBy(user.getId());
tPreEmpProfessionalQualification.setCreateName(user.getNickname());
tPreEmpProfessionalQualification.setCreateTime(LocalDateTime.now());
// 是否有职业资格证书 申报年度 职业资格名称
tPreEmpProfessionalQualification.setDeclareYear(info.getDeclareYearValue());
tPreEmpProfessionalQualification.setQualificationType(info.getQualificationTypeValue());
preEmpProfessionalQualificationList.add(tPreEmpProfessionalQualification);
}
}
}
......@@ -3334,6 +3330,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (!preEmpWorkRecordingList.isEmpty()) {
tPreEmpWorkRecordingService.saveBatch(preEmpWorkRecordingList);
}
if (!preEmpProfessionalQualificationList.isEmpty()) {
tPreEmpProfessionalService.saveBatch(preEmpProfessionalQualificationList);
}
}
if (!errorList.isEmpty()) {
return new R<>(CommonConstants.TWO_INT, "失败数据:", excelList);
......@@ -3397,6 +3396,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
errorFormat.append(attr.name()).append(";");
} else {
startDateMap.put(shuName, dateValue);
tempStr = c.trim();
}
}
//手机号码校验
......@@ -3407,6 +3407,35 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (attr.maxLength() > 0 && c.length() > attr.maxLength()) {
errorFormat.append(attr.name()).append("_超出最大长度;");
}
// 字典
if (attr.isDataId() && null != dictMap) {
tempStr = null;
if (Common.isNotNull(attr.readConverterExp())) {
String[] convertSource = attr.readConverterExp().split(",");
String[] itemArray;
for (String item : convertSource) {
itemArray = item.split("=");
if (itemArray.length>1 && itemArray[1].equals(c)) {
tempStr = itemArray[0];
break;
}
}
} else {
tempStr = getLableIdByValue(attr, dictMap, c);
}
if (Common.isEmpty(tempStr)) {
errorFormat.append(attr.name()).append("_未找到字典值;");
}
}
// 时间大小比较
if (Common.isNotNull(attr.pattern())) {
if (!("validityEnd".equals(shuName) && "长期".equals(c)) && dateValue != null) {
Date startDate = startDateMap.get(attr.pattern());
if (startDate != null && !dateValue.after(startDate)) {
errorFormat.append(attr.name()).append("_小于起始日期;");
}
}
}
}
} else {
//日期格式校验
......@@ -3421,6 +3450,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
errorFormat.append(attr.name()).append(";");
} else {
startDateMap.put(shuName, dateValue);
tempStr = c.trim();
}
}
}
......@@ -3469,8 +3499,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
// 字典
tempStr = null;
if (attr.isDataId() && null != dictMap) {
tempStr = null;
if (Common.isNotNull(attr.readConverterExp())) {
String[] convertSource = attr.readConverterExp().split(",");
String[] itemArray;
......@@ -3488,7 +3518,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
errorFormat.append(attr.name()).append("_未找到字典值;");
}
}
}
// 时间大小比较
if (Common.isNotNull(attr.pattern())) {
if (!("validityEnd".equals(shuName) && "长期".equals(c)) && dateValue != null) {
......@@ -3499,6 +3528,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
}
}
return tempStr;
}
......
......@@ -566,7 +566,7 @@
</foreach>
</delete>
<delete id="deleteContactByMainIdList">
delete from t_pre_emp_contact_info where PRE_MAIN_ID = in
delete from t_pre_emp_contact_info where PRE_MAIN_ID in
<foreach collection="preMainIdList" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
......
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