|
@@ -35,6 +35,7 @@ import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
@@ -474,7 +475,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
//获得表头
|
|
|
Row rowHead = authPartySheet.getRow(0);
|
|
|
//判断表头是否正确
|
|
|
- if (7 != rowHead.getLastCellNum() || !"机构名称".equals(rowHead.getCell(0).getStringCellValue())) {
|
|
|
+ if (9 != rowHead.getLastCellNum() || !"机构名称".equals(rowHead.getCell(0).getStringCellValue())) {
|
|
|
return ResponseJson.error("授权机构表格式错误");
|
|
|
}
|
|
|
// 获得数据的总行数
|
|
@@ -486,12 +487,12 @@ public class AuthServiceImpl implements AuthService {
|
|
|
Row authPartyRow = authPartySheet.getRow(i);
|
|
|
// 校验机构名称
|
|
|
String authParty = authPartyRow.getCell(0).getStringCellValue();
|
|
|
- if (StringUtils.isEmpty(authParty)) {
|
|
|
+ if (StringUtils.isBlank(authParty)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行机构名称不能为空");
|
|
|
}
|
|
|
// 校验省市区
|
|
|
String area = authPartyRow.getCell(1).getStringCellValue();
|
|
|
- if (StringUtils.isEmpty(area)) {
|
|
|
+ if (StringUtils.isBlank(area)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行所在地区不能为空");
|
|
|
}
|
|
|
String[] areaSplit = area.split("/");
|
|
@@ -500,7 +501,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
// 省份
|
|
|
String provinceName = areaSplit[0];
|
|
|
- if (StringUtils.isEmpty(provinceName)) {
|
|
|
+ if (StringUtils.isBlank(provinceName)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行省份不能为空");
|
|
|
}
|
|
|
if (provinceName.length() > 2) {
|
|
@@ -509,16 +510,16 @@ public class AuthServiceImpl implements AuthService {
|
|
|
Integer provinceId = authMapper.getProvinceId(provinceName);
|
|
|
// 市名
|
|
|
String cityName = areaSplit[1];
|
|
|
- if (StringUtils.isEmpty(cityName)) {
|
|
|
+ if (StringUtils.isBlank(cityName)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行市名不能为空");
|
|
|
}
|
|
|
if (cityName.length() > 2) {
|
|
|
cityName = cityName.substring(0, cityName.length() - 1).trim();
|
|
|
}
|
|
|
Integer cityId = authMapper.getCityId(cityName);
|
|
|
- // 区名
|
|
|
Integer townId = null;
|
|
|
if (areaSplit.length > 2) {
|
|
|
+ // 区名
|
|
|
String townName = areaSplit[2];
|
|
|
if (StringUtils.isNotEmpty(townName) && townName.length() > 2) {
|
|
|
townName = townName.substring(0, townName.length() - 1).trim();
|
|
@@ -546,12 +547,12 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
// 校验详细地址
|
|
|
String address = authPartyRow.getCell(2).getStringCellValue();
|
|
|
- if (StringUtils.isEmpty(address)) {
|
|
|
- return ResponseJson.error("第" + i + 1 + "行所在地区不能为空");
|
|
|
+ if (StringUtils.isBlank(address)) {
|
|
|
+ return ResponseJson.error("第" + i + 1 + "行详细地址不能为空");
|
|
|
}
|
|
|
// 校验经纬度
|
|
|
String lngAndLat = authPartyRow.getCell(3).getStringCellValue();
|
|
|
- if (StringUtils.isEmpty(lngAndLat)) {
|
|
|
+ if (StringUtils.isBlank(lngAndLat)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行经纬度不能为空");
|
|
|
}
|
|
|
String[] split = lngAndLat.split(",");
|
|
@@ -562,13 +563,22 @@ public class AuthServiceImpl implements AuthService {
|
|
|
BigDecimal lat = new BigDecimal(split[1]);
|
|
|
// 校验联系电话
|
|
|
String mobile = authPartyRow.getCell(4).getStringCellValue();
|
|
|
- if (StringUtils.isEmpty(mobile)) {
|
|
|
+ if (StringUtils.isBlank(mobile)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行联系电话不能为空");
|
|
|
}
|
|
|
+ // 认证编号
|
|
|
+ String authCode = authPartyRow.getCell(5).getStringCellValue();
|
|
|
+ // 认证日期
|
|
|
+ Date authDate = null;
|
|
|
+ String authDateStr = authPartyRow.getCell(6).getStringCellValue();
|
|
|
+ if (StringUtils.isNotBlank(authDateStr)) {
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd");
|
|
|
+ authDate = format.parse(authDateStr);
|
|
|
+ }
|
|
|
// 校验员工人数
|
|
|
Integer empNum = null;
|
|
|
- String empNumStr = authPartyRow.getCell(5).getStringCellValue();
|
|
|
- if (StringUtils.isEmpty(empNumStr)) {
|
|
|
+ String empNumStr = authPartyRow.getCell(7).getStringCellValue();
|
|
|
+ if (StringUtils.isBlank(empNumStr)) {
|
|
|
return ResponseJson.error("第" + i + 1 + "行员工人数不能为空");
|
|
|
}
|
|
|
try {
|