Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
wangzhijiang
2023-04-14 09:23:54 +08:00
31 changed files with 196 additions and 89 deletions
@@ -214,7 +214,11 @@ public class OtaBaCxAqcsController extends JeroController<OtaBaCxAqcs, IOtaBaCxA
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -213,7 +213,11 @@ public class OtaBaCxJbxxController extends JeroController<OtaBaCxJbxx, IOtaBaCxJ
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK(res).success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -210,7 +210,11 @@ public class OtaBaCxJsfzbacsController extends JeroController<OtaBaCxJsfzbacs, I
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -211,7 +211,11 @@ public class OtaBaCxKsjjsmccsController extends JeroController<OtaBaCxKsjjsmccs,
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -213,7 +213,11 @@ public class OtaBaCxKsjxtmccsController extends JeroController<OtaBaCxKsjxtmccs,
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -245,7 +245,11 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
@ApiOperation(value = "车型及功能备案列表-数据导出") @ApiOperation(value = "车型及功能备案列表-数据导出")
@@ -209,7 +209,10 @@ public class OtaBaCxZxsjyqController extends JeroController<OtaBaCxZxsjyq, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -213,7 +213,11 @@ public class OtaBaSjGgnrfsController extends JeroController<OtaBaSjGgnrfs, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -241,7 +241,11 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
@ApiOperation(value = "升级备案-数据导出") @ApiOperation(value = "升级备案-数据导出")
@@ -211,7 +211,11 @@ public class OtaBaSjSjfzbhController extends JeroController<OtaBaSjSjfzbh, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -207,6 +207,10 @@ public class OtaBaSjSjmbclController extends JeroController<OtaBaSjSjmbcl, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -208,7 +208,11 @@ public class OtaBaSjSjmbcxController extends JeroController<OtaBaSjSjmbcx, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -213,7 +213,11 @@ public class OtaBaSjSjxtbhController extends JeroController<OtaBaSjSjxtbh, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -188,14 +188,14 @@ public class OtaBaSjSjyxpgController extends JeroController<OtaBaSjSjyxpg, IOtaB
return super.importExcel(request, response, OtaBaSjSjyxpg.class); return super.importExcel(request, response, OtaBaSjSjyxpg.class);
} }
@ApiOperation(value = "车型备案-安全措施-模板下载") @ApiOperation(value = "升级备案-升级影响评估-模板下载")
@GetMapping(value = "/exportTemplate") @GetMapping(value = "/exportTemplate")
// @RequiresPermissions("otaBaCx:exportTemplate") // @RequiresPermissions("otaBaCx:exportTemplate")
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception { public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
this.otaBaSjSjyxpgService.exportTemplate(response, request); this.otaBaSjSjyxpgService.exportTemplate(response, request);
} }
@ApiOperation(value = "车型备案-安全措施-数据导入") @ApiOperation(value = "升级备案-升级影响评估-数据导入")
@PostMapping(value = "/importData") @PostMapping(value = "/importData")
// @RequiresPermissions("otaBaCx:importData") // @RequiresPermissions("otaBaCx:importData")
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file, public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@@ -213,7 +213,11 @@ public class OtaBaSjSjyxpgController extends JeroController<OtaBaSjSjyxpg, IOtaB
e.printStackTrace(); e.printStackTrace();
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
return Result.OK().success(errMsg.toString()); String errMsgStr = errMsg.toString();
if (errMsgStr.endsWith(", ")) {
errMsgStr = errMsgStr.substring(0, errMsgStr.lastIndexOf(","));
}
return Result.OK().success(errMsgStr);
} }
} }
@@ -110,11 +110,13 @@ public class OtaBaCxJbxx implements Serializable {
/**车辆动力类型1*/ /**车辆动力类型1*/
@Excel(name = "车辆动力类型1", width = 15) @Excel(name = "车辆动力类型1", width = 15)
@ApiModelProperty(value = "车辆动力类型1") @ApiModelProperty(value = "车辆动力类型1")
@Dict(dicCode = "vehicle_dynamic_type")
private java.lang.String dllx1; private java.lang.String dllx1;
/**车辆动力类型2*/ /**车辆动力类型2*/
@Excel(name = "车辆动力类型2", width = 15) @Excel(name = "车辆动力类型2", width = 15)
@ApiModelProperty(value = "车辆动力类型2") @ApiModelProperty(value = "车辆动力类型2")
@Dict(dicCode = "vehicle_dynamic_type1")
private java.lang.String dllx2; private java.lang.String dllx2;
/**通信终端*/ /**通信终端*/
@@ -104,11 +104,13 @@ public class OtaBaSjSjmbcx implements Serializable {
/**车辆动力类型1*/ /**车辆动力类型1*/
@Excel(name = "车辆动力类型1", width = 15) @Excel(name = "车辆动力类型1", width = 15)
@ApiModelProperty(value = "车辆动力类型1") @ApiModelProperty(value = "车辆动力类型1")
@Dict(dicCode = "vehicle_dynamic_type")
private java.lang.String dllx1; private java.lang.String dllx1;
/**车辆动力类型2*/ /**车辆动力类型2*/
@Excel(name = "车辆动力类型2", width = 15) @Excel(name = "车辆动力类型2", width = 15)
@ApiModelProperty(value = "车辆动力类型2") @ApiModelProperty(value = "车辆动力类型2")
@Dict(dicCode = "vehicle_dynamic_type1")
private java.lang.String dllx2; private java.lang.String dllx2;
} }
@@ -17,8 +17,8 @@ public enum OtaTitleEnum {
// QYMC("qymc", "企业名称", "0","enterprise name ",0), // QYMC("qymc", "企业名称", "0","enterprise name ",0),
DJBH("djbh", "产品登记编号", "0", "Product Registration Number ", 500), DJBH("djbh", "产品登记编号", "0", "Product Registration Number ", 500),
CPLB("cplb", "产品类别", "product_category", "Product category", 0), CPLB("cplb", "产品类别", "product_category", "Product category", 0),
DLLX1("dllx1", "车辆动力类型", "0", "Vehicle Power Type", 50), DLLX1("dllx1", "车辆动力类型", "vehicle_dynamic_type", "Vehicle Power Type", 50),
DLLX2("dllx2", "车辆动力类型", "0", "Vehicle Power Type", 50), DLLX2("dllx2", "车辆动力类型", "vehicle_dynamic_type1", "Vehicle Power Type", 50),
TXZD("txzd", "通信终端", "communication_terminal", "communication terminal", 0), TXZD("txzd", "通信终端", "communication_terminal", "communication terminal", 0),
CDOTASJ("cdotasj", "车端OTA升级管理系统", "0", "OTA Upgrade Management System", 500), CDOTASJ("cdotasj", "车端OTA升级管理系统", "0", "OTA Upgrade Management System", 500),
@@ -257,7 +257,7 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
aqcs.setXxaqjz(ImportFileUtil.getCellValueDict(cell, wb, "Information_security_mechanism", sysDictService, cut)); aqcs.setXxaqjz(ImportFileUtil.getCellValueDict(cell, wb, "Information_security_mechanism", sysDictService, cut));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(aqcs, errMsg, sysDictService, cut); cu.checkError(aqcs, errMsg, sysDictService, cut, 0);
row = s.getRow(2); row = s.getRow(2);
cell = row.getCell(3); cell = row.getCell(3);
@@ -268,10 +268,10 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
jbxx.setCpxh(ImportFileUtil.getCellValue(cell, wb)); jbxx.setCpxh(ImportFileUtil.getCellValue(cell, wb));
row = s.getRow(8); row = s.getRow(8);
cell = row.getCell(1); cell = row.getCell(1);
jbxx.setDllx1(ImportFileUtil.getCellValue(cell, wb)); jbxx.setDllx1(ImportFileUtil.getCellValueDict(cell, wb, "vehicle_dynamic_type", sysDictService, cut));
row = s.getRow(9); row = s.getRow(9);
cell = row.getCell(1); cell = row.getCell(1);
jbxx.setDllx2(ImportFileUtil.getCellValue(cell, wb)); jbxx.setDllx2(ImportFileUtil.getCellValueDict(cell, wb, "vehicle_dynamic_type1", sysDictService, cut));
row = s.getRow(10); row = s.getRow(10);
cell = row.getCell(1); cell = row.getCell(1);
jbxx.setTxzd(ImportFileUtil.getCellValueDict(cell, wb, "communication_terminal", sysDictService, cut)); jbxx.setTxzd(ImportFileUtil.getCellValueDict(cell, wb, "communication_terminal", sysDictService, cut));
@@ -280,7 +280,7 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
jbxx.setCdotasj(ImportFileUtil.getCellValue(cell, wb)); jbxx.setCdotasj(ImportFileUtil.getCellValue(cell, wb));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(jbxx, errMsg, sysDictService, cut); cu.checkError(jbxx, errMsg, sysDictService, cut, 0);
return jbxx; return jbxx;
} }
@@ -301,7 +301,7 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
row = s.getRow(3); row = s.getRow(3);
cell = row.getCell(1); cell = row.getCell(1);
cell.setCellValue(jbxx.getCplb()); cell.setCellValue(ComparisonUtil.queryDictTextByKey("product_category", jbxx.getCplb(), sysDictService));
row = s.getRow(4); row = s.getRow(4);
cell = row.getCell(1); cell = row.getCell(1);
cell.setCellValue(jbxx.getGgpc()); cell.setCellValue(jbxx.getGgpc());
@@ -316,10 +316,10 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
cell.setCellValue(jbxx.getCpxh()); cell.setCellValue(jbxx.getCpxh());
row = s.getRow(8); row = s.getRow(8);
cell = row.getCell(1); cell = row.getCell(1);
cell.setCellValue(jbxx.getDllx1()); cell.setCellValue(ComparisonUtil.queryDictTextByKey("vehicle_dynamic_type", jbxx.getDllx1(), sysDictService));
row = s.getRow(9); row = s.getRow(9);
cell = row.getCell(1); cell = row.getCell(1);
cell.setCellValue(jbxx.getDllx2()); cell.setCellValue(ComparisonUtil.queryDictTextByKey("vehicle_dynamic_type1", jbxx.getDllx2(), sysDictService));
row = s.getRow(10); row = s.getRow(10);
cell = row.getCell(1); cell = row.getCell(1);
String str = jbxx.getTxzd(); String str = jbxx.getTxzd();
@@ -343,7 +343,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
cell = row.getCell(7); cell = row.getCell(7);
sjmk.setBzwz(ImportFileUtil.getCellValue(cell, wb)); sjmk.setBzwz(ImportFileUtil.getCellValue(cell, wb));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(sjmk, errMsg, sysDictService, cut); cu.checkError(sjmk, errMsg, sysDictService, cut, i + 1);
sjmkList.add(sjmk); sjmkList.add(sjmk);
} }
} }
@@ -608,7 +608,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
cell = row.getCell(4); cell = row.getCell(4);
bass.setEdrScqy(ImportFileUtil.getCellValue(cell, wb)); bass.setEdrScqy(ImportFileUtil.getCellValue(cell, wb));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(bass, errMsg, sysDictService, cut); cu.checkError(bass, errMsg, sysDictService, cut, 0);
return bass; return bass;
} }
@@ -288,7 +288,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
cell = row.getCell(1); cell = row.getCell(1);
str = ImportFileUtil.getCellValue(cell, wb); str = ImportFileUtil.getCellValue(cell, wb);
String[] strs = str.split(","); String[] strs = str.split(",");
otaBaCxList.setZxsjjsfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "证明材料", cut)); otaBaCxList.setZxsjjsfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "证明材料", cut, i + 1));
otaBaCxListService.editById(otaBaCxList); otaBaCxListService.editById(otaBaCxList);
} }
break; break;
@@ -328,7 +328,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
mssc.setCreateTime(now); mssc.setCreateTime(now);
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(mssc, errMsg, sysDictService, cut); cu.checkError(mssc, errMsg, sysDictService, cut, i + 1);
mccsList.add(mssc); mccsList.add(mssc);
} }
} }
@@ -351,7 +351,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getSfksj())); cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getSfksj()));
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellValue(mccs.getJszdhjb()); cell.setCellValue(ComparisonUtil.queryDictTextByKey("driving_automation_level", mccs.getJszdhjb(), sysDictService));
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(mccs.getSjggcs()); cell.setCellValue(mccs.getSjggcs());
cell = row.createCell(5); cell = row.createCell(5);
@@ -357,7 +357,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
cell = row.getCell(1); cell = row.getCell(1);
str = ImportFileUtil.getCellValue(cell, wb); str = ImportFileUtil.getCellValue(cell, wb);
String[] strs = str.split(","); String[] strs = str.split(",");
otaBaCxList.setZxsjxtfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "证明材料", cut)); otaBaCxList.setZxsjxtfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "证明材料", cut, i + 1));
otaBaCxListService.editById(otaBaCxList); otaBaCxListService.editById(otaBaCxList);
} }
break; break;
@@ -374,7 +374,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
mssc.setSjbgcs(ImportFileUtil.getCellValue(cell, wb)); mssc.setSjbgcs(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(3); cell = row.getCell(3);
String[] strs = ImportFileUtil.getCellValue(cell, wb).split(","); String[] strs = ImportFileUtil.getCellValue(cell, wb).split(",");
mssc.setTpt(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "系统电子控制器架构拓扑图", cut)); mssc.setTpt(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "系统电子控制器架构拓扑图", cut, i + 1));
cell = row.getCell(4); cell = row.getCell(4);
mssc.setKzqmc(ImportFileUtil.getCellValue(cell, wb)); mssc.setKzqmc(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(5); cell = row.getCell(5);
@@ -401,7 +401,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
mssc.setUpdateTime(now); mssc.setUpdateTime(now);
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(mssc, errMsg, sysDictService, cut); cu.checkError(mssc, errMsg, sysDictService, cut, i + 1);
mccsList.add(mssc); mccsList.add(mssc);
} }
} }
@@ -152,6 +152,7 @@ public class OtaBaCxQtServiceImpl extends ServiceImpl<OtaBaCxQtMapper, OtaBaCxQt
Row row = s.getRow(0); Row row = s.getRow(0);
Cell cell = row.getCell(1); Cell cell = row.getCell(1);
cell.setCellValue(qt.getSjbbhcs()); cell.setCellValue(qt.getSjbbhcs());
wb.write(new FileOutputStream(file));
wb.close(); wb.close();
} }
} }
@@ -273,7 +273,7 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
otaBaCxZxsjyq.setSjzt(ImportFileUtil.getCellValueYesOrNo(cell, wb)); otaBaCxZxsjyq.setSjzt(ImportFileUtil.getCellValueYesOrNo(cell, wb));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(otaBaCxZxsjyq, errMsg, sysDictService, cut); cu.checkError(otaBaCxZxsjyq, errMsg, sysDictService, cut, 0);
row = s.getRow(2); row = s.getRow(2);
cell = row.getCell(3); cell = row.getCell(3);
@@ -168,7 +168,6 @@ public class OtaBaSjQtsjxxServiceImpl extends ServiceImpl<OtaBaSjQtsjxxMapper, O
js = sdf.format(qt.getSjjzsj()); js = sdf.format(qt.getSjjzsj());
} }
cell.setCellValue(js); cell.setCellValue(js);
cell.setCellValue(ks);
wb.write(new FileOutputStream(file)); wb.write(new FileOutputStream(file));
wb.close(); wb.close();
} }
@@ -115,6 +115,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
} }
} }
public List<OtaBaSjSjfzbh> setDefault(String otaId) { public List<OtaBaSjSjfzbh> setDefault(String otaId) {
List<OtaBaSjSjfzbh> list = this.getByOtaId(otaId); List<OtaBaSjSjfzbh> list = this.getByOtaId(otaId);
Date now = new Date(); Date now = new Date();
@@ -224,7 +225,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
@Override @Override
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception { public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath); List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut,errMsg); parseFileList(upLoadFiles, otaId, cut, errMsg);
} }
@Override @Override
@@ -243,7 +244,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
if (ObjectUtils.isEmpty(oldList)) { if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>(); oldList = new ArrayList<>();
} }
List<OtaBaSjSjfzbh> newList = parseFile(upFile, otaId, cut,errMsg); List<OtaBaSjSjfzbh> newList = parseFile(upFile, otaId, cut, errMsg);
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService); List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
deleteByOtaId(otaId); deleteByOtaId(otaId);
@@ -283,7 +284,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
fzbh.setCreateTime(now); fzbh.setCreateTime(now);
fzbh.setUpdateTime(now); fzbh.setUpdateTime(now);
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(fzbh, errMsg, sysDictService, cut); cu.checkError(fzbh, errMsg, sysDictService, cut, i + 1);
fzbhList.add(fzbh); fzbhList.add(fzbh);
} }
@@ -246,7 +246,7 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
mbcx.setDllx2(jbxx.getDllx2()); mbcx.setDllx2(jbxx.getDllx2());
} }
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(mbcx, errMsg, sysDictService, cut); cu.checkError(mbcx, errMsg, sysDictService, cut, 0);
return mbcx; return mbcx;
} }
@@ -271,7 +271,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
cell = row.getCell(10); cell = row.getCell(10);
xtbh.setSfcfsj(ImportFileUtil.getCellValueYesOrNo(cell, wb)); xtbh.setSfcfsj(ImportFileUtil.getCellValueYesOrNo(cell, wb));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(xtbh, errMsg, sysDictService, cut); cu.checkError(xtbh, errMsg, sysDictService, cut, i + 1);
if (xtbh.isNull()) { if (xtbh.isNull()) {
break; break;
} }
@@ -185,7 +185,7 @@ public class ComparisonUtil<T> {
} }
} }
public void checkError(T clazz, StringBuilder errMsg, ISysDictService sysDictService, String cut) { public void checkError(T clazz, StringBuilder errMsg, ISysDictService sysDictService, String cut,int row) {
Field[] fields = clazz.getClass().getDeclaredFields(); Field[] fields = clazz.getClass().getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {
OtaTitleEnum ote = OtaTitleEnum.getOtaTitleEnum(field.getName()); OtaTitleEnum ote = OtaTitleEnum.getOtaTitleEnum(field.getName());
@@ -200,17 +200,29 @@ public class ComparisonUtil<T> {
String str = val.toString(); String str = val.toString();
if ("0".equals(ote.getType())) { if ("0".equals(ote.getType())) {
if (str.length() > ote.getLen()) { if (str.length() > ote.getLen()) {
errMsg.append(title + " 的长度超过了 " + ote.getLen() + ", "); if (row > 0) {
errMsg.append("" + row + "" + title + " 的长度超过了 " + ote.getLen() + ", ");
} else {
errMsg.append(title + " 的长度超过了 " + ote.getLen() + ", ");
}
field.set(clazz, null); field.set(clazz, null);
} }
} else if ("1".equals(ote.getType())) { } else if ("1".equals(ote.getType())) {
if (!"1".equals(str) && !"2".equals(str)) { if (!"1".equals(str) && !"2".equals(str)) {
errMsg.append(title + " 必须填写有或无, "); if (row > 0) {
errMsg.append("" + row + "" + title + " 必须填写有或无, ");
}else{
errMsg.append(title + " 必须填写有或无, ");
}
field.set(clazz, null); field.set(clazz, null);
} }
} else if ("2".equals(ote.getType())) { } else if ("2".equals(ote.getType())) {
if (!"1".equals(str) && !"2".equals(str)) { if (!"1".equals(str) && !"2".equals(str)) {
errMsg.append(title + " 必须填写是或否, "); if (row > 0) {
errMsg.append("" + row + "" + title + " 必须填写是或否, ");
}else{
errMsg.append(title + " 必须填写是或否, ");
}
field.set(clazz, null); field.set(clazz, null);
} }
} else if ("3".equals(ote.getType())) { } else if ("3".equals(ote.getType())) {
@@ -220,7 +232,11 @@ public class ComparisonUtil<T> {
for (String s : strs) { for (String s : strs) {
String res = sysDictService.queryDictTextByKeyEn(ote.getType(), s, cut); String res = sysDictService.queryDictTextByKeyEn(ote.getType(), s, cut);
if (StringUtils.isEmpty(res)) { if (StringUtils.isEmpty(res)) {
errMsg.append(title + " 填写了无法识别的选项, "); if (row > 0) {
errMsg.append("" + row + "" + title + " 填写了无法识别的选项, ");
}else{
errMsg.append(title + " 填写了无法识别的选项, ");
}
field.set(clazz, null); field.set(clazz, null);
} }
} }
@@ -71,7 +71,7 @@ public class ImportFileUtil {
throw new JeroBootException("Please upload a zip file or rar file"); throw new JeroBootException("Please upload a zip file or rar file");
} }
} }
String path = uploadPath + File.separator + "modal" + File.separator + System.currentTimeMillis()+ File.separator + filenameorg; String path = uploadPath + File.separator + "modal" + File.separator + System.currentTimeMillis() + File.separator + filenameorg;
File saveDirectory = new File(path); File saveDirectory = new File(path);
if (!saveDirectory.isDirectory()) { if (!saveDirectory.isDirectory()) {
saveDirectory.mkdir(); saveDirectory.mkdir();
@@ -166,7 +166,7 @@ public class ImportFileUtil {
public static String getCellValueHaveOrNot(Cell cell, Workbook workbook) throws Exception { public static String getCellValueHaveOrNot(Cell cell, Workbook workbook) throws Exception {
String res = "3"; String res = "";
String str = getCellValue(cell, workbook); String str = getCellValue(cell, workbook);
if (StringUtils.isNotEmpty(str)) { if (StringUtils.isNotEmpty(str)) {
if (str.equals("")) { if (str.equals("")) {
@@ -179,7 +179,7 @@ public class ImportFileUtil {
} }
public static String getCellValueHaveOrNotInt(Integer val) throws Exception { public static String getCellValueHaveOrNotInt(Integer val) throws Exception {
String res = "3"; String res = "";
if (ObjectUtils.isNotEmpty(val)) { if (ObjectUtils.isNotEmpty(val)) {
if (val.equals(1)) { if (val.equals(1)) {
res = ""; res = "";
@@ -191,7 +191,7 @@ public class ImportFileUtil {
} }
public static String getCellValueYesOrNo(Cell cell, Workbook workbook) throws Exception { public static String getCellValueYesOrNo(Cell cell, Workbook workbook) throws Exception {
String res = "3"; String res = "";
String str = getCellValue(cell, workbook); String str = getCellValue(cell, workbook);
if (StringUtils.isNotEmpty(str)) { if (StringUtils.isNotEmpty(str)) {
if (str.equals("")) { if (str.equals("")) {
@@ -204,7 +204,7 @@ public class ImportFileUtil {
} }
public static String getCellValueYesOrNoInt(Integer val) throws Exception { public static String getCellValueYesOrNoInt(Integer val) throws Exception {
String res = "3"; String res = "";
if (ObjectUtils.isNotEmpty(val)) { if (ObjectUtils.isNotEmpty(val)) {
if (val.equals(1)) { if (val.equals(1)) {
res = ""; res = "";
@@ -216,7 +216,7 @@ public class ImportFileUtil {
} }
public static String getCellValueHaveOrNot(String str) throws Exception { public static String getCellValueHaveOrNot(String str) throws Exception {
String res = "3"; String res = "";
if (StringUtils.isNotEmpty(str)) { if (StringUtils.isNotEmpty(str)) {
if (str.equals("1")) { if (str.equals("1")) {
res = ""; res = "";
@@ -228,7 +228,7 @@ public class ImportFileUtil {
} }
public static String getCellValueYesOrNo(String str) throws Exception { public static String getCellValueYesOrNo(String str) throws Exception {
String res = "3"; String res = "";
if (StringUtils.isNotEmpty(str)) { if (StringUtils.isNotEmpty(str)) {
if (str.equals("1")) { if (str.equals("1")) {
res = ""; res = "";
@@ -356,7 +356,7 @@ public class ImportFileUtil {
return res; return res;
} }
public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService, StringBuilder errMsg, String title, String cut) throws Exception { public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService, StringBuilder errMsg, String title, String cut, int row) throws Exception {
String res = ""; String res = "";
//已导入文件数,用于判断超过20 //已导入文件数,用于判断超过20
int inFile = 0; int inFile = 0;
@@ -368,16 +368,28 @@ public class ImportFileUtil {
if (StringUtils.isNotEmpty(strs[i])) { if (StringUtils.isNotEmpty(strs[i])) {
File file = ImportFileUtil.findFile(attFile, strs[i]); File file = ImportFileUtil.findFile(attFile, strs[i]);
if (null == file) { if (null == file) {
errMsg.append(title + " 找不到文件:" + strs[i] + ", "); if (row > 0) {
errMsg.append("" + row + "" + title + " 找不到文件:" + strs[i] + ", ");
} else {
errMsg.append(title + " 找不到文件:" + strs[i] + ", ");
}
continue; continue;
} }
if (!file.getName().endsWith(".doc") && !file.getName().endsWith(".docx") && !file.getName().endsWith(".pdf") if (!file.getName().endsWith(".doc") && !file.getName().endsWith(".docx") && !file.getName().endsWith(".pdf")
&& !file.getName().endsWith(".DOC") && !file.getName().endsWith(".DOCX") && !file.getName().endsWith(".PDF")) { && !file.getName().endsWith(".DOC") && !file.getName().endsWith(".DOCX") && !file.getName().endsWith(".PDF")) {
errMsg.append(title + " 只支持doc/docx/pdf格式, "); if (row > 0) {
errMsg.append("" + row + "" + title + " 只支持doc/docx/pdf格式, ");
} else {
errMsg.append(title + " 只支持doc/docx/pdf格式, ");
}
continue; continue;
} }
if (file.length() > 50 * 1024 * 1024) { if (file.length() > 50 * 1024 * 1024) {
errMsg.append(title + " 上传文件不可以超过50MB, "); if (row > 0) {
errMsg.append("" + row + "" + title + " 上传文件不可以超过50MB, ");
} else {
errMsg.append(title + " 上传文件不可以超过50MB, ");
}
continue; continue;
} }
OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null);
@@ -43,7 +43,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top: 68px;background: #fff"> <div style="margin-top: 68px;background: #fff" class="detail-box">
<div class="detail-content"> <div class="detail-content">
<div v-for="(item,index) in detailList" class="content-box"> <div v-for="(item,index) in detailList" class="content-box">
<div v-for="val in Object.keys(item)" class="content"> <div v-for="val in Object.keys(item)" class="content">
@@ -168,14 +168,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="detail-content-right"> <!-- <div class="detail-content-right">-->
<div class="detail-content-right-text" <!-- <div class="detail-content-right-text"-->
:class="{'detail-content-right-text-one':item.pname ? true : false}" <!-- :class="{'detail-content-right-text-one':item.pname ? true : false}"-->
v-for="(item,index) in rightTitleList" <!-- v-for="(item,index) in rightTitleList"-->
@click="detailTextClick(index,item.name)"> <!-- @click="detailTextClick(index,item.name)">-->
{{item.name}} <!-- {{item.name}}-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> </div>
</div> </div>
<a-modal <a-modal
@@ -362,21 +362,20 @@
dataIndex: 'implementationTypeText', dataIndex: 'implementationTypeText',
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
width: '25%' width: '15%'
}, },
{ {
title: this.$t('implementationDateTwo'), title: this.$t('implementationDateTwo'),
dataIndex: 'implementationDate', dataIndex: 'implementationDate',
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
width: '25%' width: '15%'
}, },
{ {
title: this.$t('remarks'), title: this.$t('remarks'),
dataIndex: 'remarks', dataIndex: 'remarks',
align: 'left', align: 'left',
ellipsis: true, width: '45%'
width: '25%'
} }
], ],
columns: [ columns: [
@@ -714,7 +713,8 @@
height: 100%; height: 100%;
.detail-content { .detail-content {
width: calc(100% - 212px); /*width: calc(100% - 212px);*/
width: 100%;
} }
.doc-detail-wrap { .doc-detail-wrap {
@@ -753,8 +753,8 @@
} }
.content-box { .content-box {
padding: 0 40px 0 32px; /*padding: 0 40px 0 32px;*/
box-sizing: border-box; /*box-sizing: border-box;*/
} }
.header-text { .header-text {
@@ -795,7 +795,7 @@
overflow: hidden; overflow: hidden;
word-break: break-word; word-break: break-word;
color: #040B29; color: #040B29;
font-weight: bold; /*font-weight: bold;*/
} }
} }
@@ -816,7 +816,7 @@
} }
.text-field-right { .text-field-right {
width: calc(100% - 130px); width: calc(66.6% - 130px);
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -825,7 +825,7 @@
overflow: visible; overflow: visible;
float: left; float: left;
color: #040B29; color: #040B29;
font-weight: bold; /*font-weight: bold;*/
} }
} }
@@ -846,7 +846,7 @@
} }
.text-field-right { .text-field-right {
width: calc(100% - 130px); width: calc(66.6% - 130px);
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -855,7 +855,7 @@
overflow: hidden; overflow: hidden;
float: left; float: left;
color: #040B29; color: #040B29;
font-weight: bold; /*font-weight: bold;*/
} }
.text-field-right-text { .text-field-right-text {
@@ -866,6 +866,16 @@
} }
} }
/*.detail-box {*/
/* padding: 0 0 0 170px;*/
/* box-sizing: border-box;*/
/*}*/
.detail-box {
padding: 0 110px 0 110px;
box-sizing: border-box;
}
.page { .page {
text-align: right; text-align: right;
margin-top: 20px; margin-top: 20px;
@@ -1007,28 +1017,28 @@
} }
.TextInformation-box { .TextInformation-box {
width: calc(50% - 10px); width: calc(33.3% - 10px);
height: auto; height: auto;
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
margin-right: 20px; margin-right: 15px;
} }
.TextInformation-box:nth-child(even) { .TextInformation-box:nth-child(3n) {
margin-right: 0; margin-right: 0;
} }
.TextInformation-box-title { .TextInformation-box-title {
background: #F5F6F7; background: #f3f6f6;
border-radius: 4px; border-radius: 4px;
width: 100%; width: 100%;
display: inline-block; display: inline-block;
height: 56px; height: 44px;
padding: 0 16px; padding: 0 16px;
line-height: 56px; line-height: 44px;
color: #040B29; color: #040B29;
font-weight: 400; font-weight: 500;
font-size: 16px; font-size: 14px;
} }
.TextInformation-box-box { .TextInformation-box-box {
@@ -1039,7 +1049,7 @@
} }
.TextInformation-box-box-text { .TextInformation-box-box-text {
width: calc(50% - 20px); width: 100%;
margin-right: 20px; margin-right: 20px;
height: 36px; height: 36px;
float: left; float: left;
@@ -1058,7 +1068,7 @@
.detail-content-right-text { .detail-content-right-text {
color: #040B29; color: #040B29;
font-size: 14px; font-size: 14px;
font-weight: bolder; /*font-weight: bolder;*/
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
border-left: 2px #CED0D8 solid; border-left: 2px #CED0D8 solid;
@@ -1109,7 +1119,16 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
font-weight: bold; /*font-weight: bold;*/
color: #01A0AC; color: #01A0AC;
} }
::v-deep .ant-table-column-title{
font-weight: 400!important;
color: #040B29!important;
}
::v-deep .ant-table-column-title {
font-weight: 400 !important;
color: #040B29 !important;
}
</style> </style>