Commit e75446c5 authored by xixinzhao's avatar xixinzhao

人员导入修改

parent a168f687
......@@ -159,7 +159,7 @@ public class OrgUsrExcelDto extends BaseDto {
@ExplicitConstraint(indexNum = 19, sourceClass = CommonExplicitConstraint.class,method="getCitys") //动态下拉内容
@ExcelProperty(value = "户籍所在地", index = 19)
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue;
private String nativePlace;
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 20)
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
......@@ -173,7 +173,7 @@ public class OrgUsrExcelDto extends BaseDto {
@ExplicitConstraint(indexNum = 22, sourceClass = CommonExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 22)
@ApiModelProperty(value = "现居住地")
private String residence;
private String residenceDetails;
@ExcelProperty(value = "现居住地详细地址", index = 23)
@ApiModelProperty(value = "现居住地详细地址")
......
......@@ -126,7 +126,7 @@ public class ExcelController extends BaseController {
return ResponseHelper.buildResponse(uuidString);
} catch (RuntimeException e) {
e.printStackTrace();
throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日
throw new BadRequest(e.getMessage());
} catch (Exception e) {
throw new BadRequest("文件格式不正确或excel 模板不匹配!");
}
......
......@@ -4,12 +4,7 @@ import java.io.InputStream;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
......@@ -721,6 +716,7 @@ public class ExcelServiceImpl {
private void excelImportOrgUsrExcelDtoNew(MultipartFile multipartFile) throws Exception {
List<OrgUsrExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, OrgUsrExcelDto.class, 1);
if (!ObjectUtils.isEmpty(excelDtoList)) {
Set<String> set = new HashSet<>();
excelDtoList.forEach(orgUsrExcelDto -> {
if (orgUsrExcelDto.getParentId() != null) {
String[] certificates = orgUsrExcelDto.getParentId().split("@");
......@@ -778,8 +774,18 @@ public class ExcelServiceImpl {
orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist);
Bean.toPo(getCurrentInfo(), orgUsrExcelDto);
try {
// 保存动态表单和人员单位表
if (!ObjectUtils.isEmpty(orgUsrExcelDto.getCertificatesNumber())) {
if (!set.add(orgUsrExcelDto.getCertificatesNumber())) {
throw new RuntimeException("身份证号码重复!");
} else {
boolean b = orgUsrService.checkCertificatesNumber(orgUsrExcelDto.getCertificatesNumber());
if (b) {
throw new RuntimeException("身份证号码重复!");
}
}
}
try {
OrgUsrDto orgUsrDto = orgUsrService.saveOrgPersonExcel(orgUsrExcelDto);
if (!ObjectUtils.isEmpty(orgUsrDto)) {
// 保存其余项
......@@ -834,13 +840,13 @@ public class ExcelServiceImpl {
firefighters.setBizOrgName(item.getParentName());
firefighters.setBizOrgCode(result.getBizOrgCode());
}
if (firefighters.getNativePlaceValue() != null) {
String[] tempCity = firefighters.getNativePlaceValue().split("@");
if (item.getNativePlace() != null) {
String[] tempCity = item.getNativePlace().split("@");
firefighters.setNativePlaceValue(tempCity[0]);
firefighters.setNativePlace(tempCity[1]);
}
if (firefighters.getResidence() != null) {
String[] tempCity = firefighters.getResidence().split("@");
if (item.getResidenceDetails() != null) {
String[] tempCity = item.getResidenceDetails().split("@");
firefighters.setResidence(tempCity[0]);
firefighters.setResidenceDetails(tempCity[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