开发OTA备案工具-导入导出
This commit is contained in:
+3
-2
@@ -203,16 +203,17 @@ public class OtaBaCxAqcsController extends JeroController<OtaBaCxAqcs, IOtaBaCxA
|
|||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
OtaBaCxAqcs res;
|
OtaBaCxAqcs res;
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
res = this.otaBaCxAqcsService.importData(file, params[0], cut);
|
res = this.otaBaCxAqcsService.importData(file, params[0], cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK(res);
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -196,16 +196,17 @@ public class OtaBaCxJbxxController extends JeroController<OtaBaCxJbxx, IOtaBaCxJ
|
|||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
OtaBaCxJbxx res;
|
OtaBaCxJbxx res;
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
res = this.otaBaCxJbxxService.importData(file, otaId, cut);
|
res = this.otaBaCxJbxxService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK(res);
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -199,16 +199,17 @@ public class OtaBaCxJsfzbacsController extends JeroController<OtaBaCxJsfzbacs, I
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
this.otaBaCxJsfzbacsService.importData(file, otaId, cut);
|
this.otaBaCxJsfzbacsService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK();
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -200,16 +200,17 @@ public class OtaBaCxKsjjsmccsController extends JeroController<OtaBaCxKsjjsmccs,
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
this.otaBaCxKsjjsmccsService.importData(file, otaId, cut);
|
this.otaBaCxKsjjsmccsService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK();
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -202,16 +202,17 @@ public class OtaBaCxKsjxtmccsController extends JeroController<OtaBaCxKsjxtmccs,
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
this.otaBaCxKsjxtmccsService.importData(file, otaId, cut);
|
this.otaBaCxKsjxtmccsService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK();
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -197,17 +197,18 @@ public class OtaBaCxZxsjyqController extends JeroController<OtaBaCxZxsjyq, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
OtaBaCxZxsjyq res;
|
OtaBaCxZxsjyq res;
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
res = this.otaBaCxZxsjyqService.importData(file, otaId, cut);
|
res = this.otaBaCxZxsjyqService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK(res);
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -202,16 +202,17 @@ public class OtaBaSjGgnrfsController extends JeroController<OtaBaSjGgnrfs, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
this.otaBaSjGgnrfsService.importData(file, otaId, cut);
|
this.otaBaSjGgnrfsService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK();
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -200,16 +200,17 @@ public class OtaBaSjSjfzbhController extends JeroController<OtaBaSjSjfzbh, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
this.otaBaSjSjfzbhService.importData(file, otaId, cut);
|
this.otaBaSjSjfzbhService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK();
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -195,16 +195,17 @@ public class OtaBaSjSjmbclController extends JeroController<OtaBaSjSjmbcl, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
OtaBaSjSjmbcl res;
|
OtaBaSjSjmbcl res;
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
res = this.otaBaSjSjmbclService.importData(file, otaId, cut);
|
res = this.otaBaSjSjmbclService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK(res);
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -196,17 +196,18 @@ public class OtaBaSjSjmbcxController extends JeroController<OtaBaSjSjmbcx, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
OtaBaSjSjmbcx res;
|
OtaBaSjSjmbcx res;
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
res = this.otaBaSjSjmbcxService.importData(file, otaId, cut);
|
res = this.otaBaSjSjmbcxService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK(res);
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -202,16 +202,17 @@ public class OtaBaSjSjxtbhController extends JeroController<OtaBaSjSjxtbh, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
this.otaBaSjSjxtbhService.importData(file, otaId, cut);
|
this.otaBaSjSjxtbhService.importData(file, otaId, cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK();
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -201,17 +201,18 @@ public class OtaBaSjSjyxpgController extends JeroController<OtaBaSjSjyxpg, IOtaB
|
|||||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
@RequestParam(value = "cut", required = false) String cut,
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
StringBuilder errMsg = new StringBuilder();
|
||||||
OtaBaSjSjyxpg res;
|
OtaBaSjSjyxpg res;
|
||||||
try {
|
try {
|
||||||
String[] params = otaId.split("\\?");
|
String[] params = otaId.split("\\?");
|
||||||
otaId = params[0].equals("null") ? "" : params[0];
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
cut = params[1].replace("cut=", "");
|
cut = params[1].replace("cut=", "");
|
||||||
res = this.otaBaSjSjyxpgService.importData(file, params[0], cut);
|
res = this.otaBaSjSjyxpgService.importData(file, params[0], cut, errMsg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.OK(res);
|
return Result.error(errMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-8
@@ -209,7 +209,14 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
|
|||||||
|
|
||||||
Row row = s.getRow(1);
|
Row row = s.getRow(1);
|
||||||
Cell cell = row.getCell(2);
|
Cell cell = row.getCell(2);
|
||||||
mbcx.setBabh(ImportFileUtil.getCellValue(cell, wb));
|
String cpbh = ImportFileUtil.getCellValue(cell, wb);
|
||||||
|
if (StringUtils.isEmpty(cpbh)) {
|
||||||
|
throw new JeroBootException("升级备案编号不能为空");
|
||||||
|
}
|
||||||
|
if (cpbh.length() > 50) {
|
||||||
|
throw new JeroBootException("升级备案编号字数超过50");
|
||||||
|
}
|
||||||
|
mbcx.setBabh(cpbh);
|
||||||
row = s.getRow(2);
|
row = s.getRow(2);
|
||||||
cell = row.getCell(2);
|
cell = row.getCell(2);
|
||||||
mbcx.setQymc(ImportFileUtil.getCellValue(cell, wb));
|
mbcx.setQymc(ImportFileUtil.getCellValue(cell, wb));
|
||||||
@@ -220,19 +227,23 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
|
|||||||
if (StringUtils.isEmpty(pc)) {
|
if (StringUtils.isEmpty(pc)) {
|
||||||
throw new JeroBootException("车型及功能备案《公告》批次不能为空");
|
throw new JeroBootException("车型及功能备案《公告》批次不能为空");
|
||||||
}
|
}
|
||||||
|
if (pc.length() > 50) {
|
||||||
|
throw new JeroBootException("车型及功能备案《公告》批次字数超过50");
|
||||||
|
}
|
||||||
|
mbcx.setBapc(pc);
|
||||||
//查找车型备案的同批次数据
|
//查找车型备案的同批次数据
|
||||||
LambdaQueryWrapper<OtaBaCxJbxx> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OtaBaCxJbxx> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(OtaBaCxJbxx::getGgpc, pc);
|
queryWrapper.eq(OtaBaCxJbxx::getGgpc, pc);
|
||||||
OtaBaCxJbxx jbxx = otaBaCxJbxxService.getOne(queryWrapper, false);
|
OtaBaCxJbxx jbxx = otaBaCxJbxxService.getOne(queryWrapper, false);
|
||||||
if (ObjectUtils.isEmpty(jbxx)) {
|
if (ObjectUtils.isEmpty(jbxx)) {
|
||||||
throw new JeroBootException("车型及功能备案《公告》批次:" + jbxx + " 无法找到车型备案数据");
|
errMsg.append("车型及功能备案《公告》批次:" + pc + " 无法找到车型备案数据");
|
||||||
|
} else {
|
||||||
|
mbcx.setCpsb(jbxx.getCpsb());
|
||||||
|
mbcx.setCpmc(jbxx.getCpmc());
|
||||||
|
mbcx.setCpxh(jbxx.getCpxh());
|
||||||
|
mbcx.setDllx1(jbxx.getDllx1());
|
||||||
|
mbcx.setDllx2(jbxx.getDllx2());
|
||||||
}
|
}
|
||||||
mbcx.setBapc(pc);
|
|
||||||
mbcx.setCpsb(jbxx.getCpsb());
|
|
||||||
mbcx.setCpmc(jbxx.getCpmc());
|
|
||||||
mbcx.setCpxh(jbxx.getCpxh());
|
|
||||||
mbcx.setDllx1(jbxx.getDllx1());
|
|
||||||
mbcx.setDllx2(jbxx.getDllx2());
|
|
||||||
ComparisonUtil cu = new ComparisonUtil();
|
ComparisonUtil cu = new ComparisonUtil();
|
||||||
cu.checkError(mbcx, errMsg, sysDictService, cut);
|
cu.checkError(mbcx, errMsg, sysDictService, cut);
|
||||||
return mbcx;
|
return mbcx;
|
||||||
|
|||||||
Reference in New Issue
Block a user