Commit 42b26b78 authored by tangwei's avatar tangwei

修改机场人员导入

parent e56677db
......@@ -791,6 +791,7 @@ public class ExcelServiceImpl {
List<OrgUsrExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, OrgUsrExcelDto.class, 1);
if (!ObjectUtils.isEmpty(excelDtoList)) {
Set<String> set = new HashSet<>();
Set<String> set1 = new HashSet<>();
excelDtoList.forEach(orgUsrExcelDto -> {
if (orgUsrExcelDto.getParentId() != null) {
String[] certificates = orgUsrExcelDto.getParentId().split("@");
......@@ -869,10 +870,17 @@ public class ExcelServiceImpl {
dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(dynamicFormInstance.getFieldValue()).getName());
}
String fieldCode = dynamicFormInstance.getFieldCode();
if (map1.containsKey(fieldCode) && fieldCode.contains("Code") ){
String[] split = map1.get(fieldCode).toString().split("@");
dynamicFormInstance.setFieldValue(split[0]);
}
if ("certificatesTypeCode".equals(fieldCode)){
String[] split = map1.get(fieldCode).toString().split("@");
dynamicFormInstance.setFieldValue(split[1]);
dynamicFormInstance.setFieldValueLabel(split[0]);}
if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){
dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString());
......@@ -884,7 +892,9 @@ public class ExcelServiceImpl {
orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist);
Bean.toPo(getCurrentInfo(), orgUsrExcelDto);
// 保存动态表单和人员单位表
if (!ObjectUtils.isEmpty(orgUsrExcelDto.getCertificatesNumber())) {
String[] split55 = orgUsrExcelDto.getCertificatesTypeCode().toString().split("@");
if (!ObjectUtils.isEmpty(orgUsrExcelDto.getCertificatesNumber())&&split55[1].equals("120")) {
if (!set.add(orgUsrExcelDto.getCertificatesNumber())) {
throw new RuntimeException("身份证号码重复!");
} else {
......@@ -894,6 +904,23 @@ public class ExcelServiceImpl {
}
}
}
//平台用户唯一效验
if (!ObjectUtils.isEmpty(orgUsrExcelDto.getAmosOrgId())) {
if (!set1.add(orgUsrExcelDto.getAmosOrgId())) {
throw new RuntimeException("关联用户"+orgUsrExcelDto.getAmosOrgCode()+"重复!");
} else {
int num = orgUsrMapper.amosIdExist(orgUsrExcelDto.getAmosOrgId(),null);
if (num > 0) {
throw new RuntimeException("关联用户"+orgUsrExcelDto.getAmosOrgCode()+"重复!");
}
}
}
try {
OrgUsrDto orgUsrDto = orgUsrService.saveOrgPersonExcel(orgUsrExcelDto);
if (!ObjectUtils.isEmpty(orgUsrDto)) {
......
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