|
@@ -18,6 +18,7 @@ import com.bootdo.system.domain.RoleDO;
|
|
import com.bootdo.system.domain.UserDO;
|
|
import com.bootdo.system.domain.UserDO;
|
|
import com.bootdo.system.service.RoleService;
|
|
import com.bootdo.system.service.RoleService;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
@@ -229,6 +230,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
int otherProvince = 0;
|
|
int otherProvince = 0;
|
|
int otherCity = 0;
|
|
int otherCity = 0;
|
|
int auditPass = 0;
|
|
int auditPass = 0;
|
|
|
|
+ int unitNoAudit = 0;
|
|
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
|
|
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
|
|
XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0);
|
|
XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0);
|
|
// 企业信息
|
|
// 企业信息
|
|
@@ -251,12 +253,21 @@ public class GyDataServiceImpl implements GyDataService {
|
|
userCity = sysCity;
|
|
userCity = sysCity;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //判断是哪种格式的
|
|
|
|
+ Row firstRow = xssfSheet.getRow(0);
|
|
|
|
+ Cell firstRowCell = firstRow.getCell(0);
|
|
|
|
+ int beginDataRowIndex = 0;
|
|
|
|
+ if("序号".equals(firstRowCell.getStringCellValue())){
|
|
|
|
+ beginDataRowIndex = 1;
|
|
|
|
+ } else {
|
|
|
|
+ beginDataRowIndex = 4;
|
|
|
|
+ }
|
|
|
|
|
|
- if(xssfSheet.getLastRowNum() < 1){ //getLastRowNum返回最后一行的索引,即 比行总数小1
|
|
|
|
|
|
+ if(xssfSheet.getLastRowNum() < beginDataRowIndex){ //getLastRowNum返回最后一行的索引,即 比行总数小1
|
|
throw new BDException("excel文件无数据");
|
|
throw new BDException("excel文件无数据");
|
|
}
|
|
}
|
|
// 遍历
|
|
// 遍历
|
|
- for (int i = 1; i <= xssfSheet.getLastRowNum(); i++) {
|
|
|
|
|
|
+ for (int i = beginDataRowIndex; i <= xssfSheet.getLastRowNum(); i++) {
|
|
log.info("userProvince: {}, i: {}", userProvince, i);
|
|
log.info("userProvince: {}, i: {}", userProvince, i);
|
|
|
|
|
|
Row row = xssfSheet.getRow(i);
|
|
Row row = xssfSheet.getRow(i);
|
|
@@ -283,6 +294,13 @@ public class GyDataServiceImpl implements GyDataService {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ GyUnitDO tmpGyUnitDO = gyUnitDao.getGyUnitByCreditCode(row.getCell(17).getStringCellValue());
|
|
|
|
+
|
|
|
|
+ if (ObjectUtils.isEmpty(tmpGyUnitDO) || !"1".equals(tmpGyUnitDO.getAuditStatus())) {
|
|
|
|
+ unitNoAudit++;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
// 企业单位
|
|
// 企业单位
|
|
GyUnitDO gyUnitDO = new GyUnitDO();
|
|
GyUnitDO gyUnitDO = new GyUnitDO();
|
|
// 数据信息
|
|
// 数据信息
|
|
@@ -353,9 +371,9 @@ public class GyDataServiceImpl implements GyDataService {
|
|
gyDataDO.setIsForeignData(row.getCell(37).getStringCellValue());//是否为涉外数据
|
|
gyDataDO.setIsForeignData(row.getCell(37).getStringCellValue());//是否为涉外数据
|
|
gyDataDO.setIsCrossmainFlow(row.getCell(38).getStringCellValue());//是否涉及跨主体流动
|
|
gyDataDO.setIsCrossmainFlow(row.getCell(38).getStringCellValue());//是否涉及跨主体流动
|
|
gyDataDO.setInfoSystemName(row.getCell(39).getStringCellValue());//信息系统名称
|
|
gyDataDO.setInfoSystemName(row.getCell(39).getStringCellValue());//信息系统名称
|
|
- gyDataDO.setInfoSystemType(row.getCell(40).getStringCellValue());//信息系统类型
|
|
|
|
- gyDataDO.setInfoSystemIpAddress(row.getCell(41).getStringCellValue());//信息系统ip地址
|
|
|
|
- gyDataDO.setInfoSystemDomainName(row.getCell(42).getStringCellValue());//信息系统域名
|
|
|
|
|
|
+ gyDataDO.setInfoSystemIpAddress(row.getCell(40).getStringCellValue());//信息系统ip地址
|
|
|
|
+ gyDataDO.setInfoSystemDomainName(row.getCell(41).getStringCellValue());//信息系统域名
|
|
|
|
+ gyDataDO.setInfoSystemType(row.getCell(42).getStringCellValue());//信息系统类型
|
|
gyDataDO.setSecurityCognizance(row.getCell(43).getStringCellValue());//网络安全等级保护认定情况
|
|
gyDataDO.setSecurityCognizance(row.getCell(43).getStringCellValue());//网络安全等级保护认定情况
|
|
gyDataDO.setComSecurityCognizance(row.getCell(44).getStringCellValue());//通信网络安全防护定级备案情况
|
|
gyDataDO.setComSecurityCognizance(row.getCell(44).getStringCellValue());//通信网络安全防护定级备案情况
|
|
gyDataDO.setIsKetSystem(row.getCell(45).getStringCellValue());//是否为关键信息基础设施
|
|
gyDataDO.setIsKetSystem(row.getCell(45).getStringCellValue());//是否为关键信息基础设施
|
|
@@ -452,6 +470,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
try {
|
|
try {
|
|
gyUnitDO.setCreateTime(new Date());
|
|
gyUnitDO.setCreateTime(new Date());
|
|
gyUnitDO.setStatus("0");
|
|
gyUnitDO.setStatus("0");
|
|
|
|
+ gyUnitDO.setAuditStatus("0");
|
|
gyUnitDao.save(gyUnitDO);
|
|
gyUnitDao.save(gyUnitDO);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("error enterprise-only : {}", e.getMessage());
|
|
log.error("error enterprise-only : {}", e.getMessage());
|
|
@@ -465,7 +484,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
gyDataDao.batchSave(dataList);
|
|
gyDataDao.batchSave(dataList);
|
|
}
|
|
}
|
|
String result = null;
|
|
String result = null;
|
|
- if ((otherProvince + otherCity + auditPass) > 0) {
|
|
|
|
|
|
+ if ((otherProvince + otherCity + auditPass + unitNoAudit) > 0) {
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
if (otherProvince > 0) {
|
|
if (otherProvince > 0) {
|
|
sb.append(otherProvince).append("条非本省数据(已忽略导入)! <br/>");
|
|
sb.append(otherProvince).append("条非本省数据(已忽略导入)! <br/>");
|
|
@@ -476,7 +495,9 @@ public class GyDataServiceImpl implements GyDataService {
|
|
if (auditPass > 0) {
|
|
if (auditPass > 0) {
|
|
sb.append(auditPass).append("条已经审核通过数据(已忽略导入)! <br/>");
|
|
sb.append(auditPass).append("条已经审核通过数据(已忽略导入)! <br/>");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (unitNoAudit > 0) {
|
|
|
|
+ sb.append(unitNoAudit).append("条所属企业未注册或还没通过审核(已忽略导入)! <br/>");
|
|
|
|
+ }
|
|
result = sb.toString();
|
|
result = sb.toString();
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|