|
|
|
@ -366,7 +366,7 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!"序号".equals(row.getCell(0).getStringCellValue())||!"表名".equals(row.getCell(1).getStringCellValue()) |
|
|
|
|
if(!"项目名称".equals(row.getCell(0).getStringCellValue())||!"表名".equals(row.getCell(1).getStringCellValue()) |
|
|
|
|
||!"中文名称".equals(row.getCell(2).getStringCellValue())||!"英文名称".equals(row.getCell(3).getStringCellValue()) |
|
|
|
|
||!"数据类型".equals(row.getCell(4).getStringCellValue())||!"数据长度".equals(row.getCell(5).getStringCellValue()) |
|
|
|
|
||!"浮点精度".equals(row.getCell(6).getStringCellValue())||!"显示形式".equals(row.getCell(7).getStringCellValue()) |
|
|
|
@ -426,43 +426,51 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> { |
|
|
|
|
for (int i=0;i< numberofSheets;i++) |
|
|
|
|
{ |
|
|
|
|
Sheet Sheet=workbook.getSheetAt(i); |
|
|
|
|
int physicalNumberOfRows = Sheet.getPhysicalNumberOfRows(); |
|
|
|
|
|
|
|
|
|
for(int r=3;r<=Sheet.getLastRowNum();r++) { |
|
|
|
|
for(int r=3;r<=physicalNumberOfRows;r++) { |
|
|
|
|
Row cells = Sheet.getRow(r); |
|
|
|
|
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); |
|
|
|
|
|
|
|
|
|
Cell cell = cells.getCell(0); |
|
|
|
|
if (cell==null||String.valueOf(cell).equals("")) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
ExcelInfo excelInfo = new ExcelInfo(); |
|
|
|
|
excelInfo.setcells(cells,workbook); |
|
|
|
|
Fieldx222 fieldx222 = new Fieldx222(); |
|
|
|
|
if(StringUtil.isBlank(excelInfo.getproject())&&StringUtil.isBlank(excelInfo.getTableId())&&StringUtil.isBlank(excelInfo.getFieldName())) |
|
|
|
|
break; |
|
|
|
|
if(StringUtil.isBlank(excelInfo.getproject())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”项目名称”不能为空或是此项目不存在"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的项目名称不能为空或是此项目不纯在"); |
|
|
|
|
} |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getTableId())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”表名”不能为空或是此表不存在"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”表名”不能为空或是此表不存在"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的表名不能为空或是此表不纯在"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的表名不能为空或是此表不纯在"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setTableId(excelInfo.getTableId()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getFieldName())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为 "+ (r - 2) + "的”中文名称”不能为空"); |
|
|
|
|
message.put("status","序号为 "+ (r + 1) + "的”中文名称”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的中文名称不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的中文名称不能为空"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setFieldName(excelInfo.getFieldName()); |
|
|
|
|
Fieldx222 fieldx2221=fieldx222Service.query().eq("field_name",excelInfo.getFieldName()).one(); |
|
|
|
|
|
|
|
|
|
Fieldx222 fieldx2221=fieldx222Service.query().eq("field_name", |
|
|
|
|
excelInfo.getFieldName()).eq("table_id",excelInfo.getTableId()).one(); |
|
|
|
|
if(fieldx2221!=null){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为 "+ (r - 2) + "的”中文名称”与表中数据已重复"); |
|
|
|
|
message.put("status","序号为 "+ (r + 1) + "的”中文名称”与表中数据已重复"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的中文名称与表中数据已重复"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的中文名称与表中数据已重复"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fieldx222.setFieldName(excelInfo.getFieldName()); |
|
|
|
@ -471,45 +479,46 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> { |
|
|
|
|
List<Fieldx> list=fieldxService.list(queryWrapper); |
|
|
|
|
if(list!=null&&list.size()!=0){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的字段名此表已存在不能重复"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的字段名此表已存在不能重复"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的字段名此表已存在不能重复"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的字段名此表已存在不能重复"); |
|
|
|
|
} |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getFieldEnName())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”英文名称”不能为空"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”英文名称”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的英文名称不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的英文名称不能为空"); |
|
|
|
|
} |
|
|
|
|
Fieldx222 fieldx2222=fieldx222Service.query().eq("field_en_name",excelInfo.getFieldEnName()).one(); |
|
|
|
|
Fieldx222 fieldx2222=fieldx222Service.query().eq("field_en_name",excelInfo.getFieldEnName()) |
|
|
|
|
.eq("table_id",excelInfo.getTableId()).one(); |
|
|
|
|
if(fieldx2222!=null){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) +" 的”英文名称”与表中数据已重复"); |
|
|
|
|
message.put("status","序号为" + (r + 1) +" 的”英文名称”与表中数据已重复"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的英文名称与表中数据已重复"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的英文名称与表中数据已重复"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setFieldEnName(excelInfo.getFieldEnName()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getType())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”数据类型”不能为空"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”数据类型”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的数据类型不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的数据类型不能为空"); |
|
|
|
|
} |
|
|
|
|
else if(!sjlx.contains(excelInfo.getType())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”数据类型”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”数据类型”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的数据类型输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的数据类型输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setType(excelInfo.getType()); |
|
|
|
|
|
|
|
|
@ -518,11 +527,11 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> { |
|
|
|
|
} |
|
|
|
|
else if(!sf.contains(excelInfo.getIsPk())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”是否主键”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”是否主键”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的是否主键输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的是否主键输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setIsPk(excelInfo.getIsPk()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getIsFk())) { |
|
|
|
@ -530,79 +539,79 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> { |
|
|
|
|
} |
|
|
|
|
else if(!sf.contains(excelInfo.getIsFk())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”是否外键”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”是否外键”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的是否外键输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的是否外键输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setIsFk(excelInfo.getIsFk()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getIsNull())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”是否为空”不能为空"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”是否为空”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的是否为空不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的是否为空不能为空"); |
|
|
|
|
} |
|
|
|
|
else if(!sf.contains(excelInfo.getIsNull())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”是否为空”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1)+ "的”是否为空”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的是否为空输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的是否为空输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setIsNull(excelInfo.getIsNull()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getIsUniqueness())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”是否重复”不能为空"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”是否重复”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的是否重复不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1)+ "的是否重复不能为空"); |
|
|
|
|
} |
|
|
|
|
else if(!sf.contains(excelInfo.getIsUniqueness())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”是否重复”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”是否重复”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的是否重复输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的是否重复输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setIsUniqueness(excelInfo.getIsUniqueness()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getStatus())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”字段状态”不能为空"); |
|
|
|
|
message.put("status","序号为" + (r + 1)+ "的”字段状态”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的”字段状态”不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的”字段状态”不能为空"); |
|
|
|
|
} |
|
|
|
|
else if(!zt.contains(excelInfo.getStatus())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”字段状态”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”字段状态”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的字段状态输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的字段状态输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setStatus(excelInfo.getStatus()); |
|
|
|
|
if (StringUtil.isBlank(excelInfo.getVerisonStatus())) { |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”版本状态”不能为空"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”版本状态”不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的”版本状态”不能为空"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的”版本状态”不能为空"); |
|
|
|
|
} |
|
|
|
|
else if(!sf.contains(excelInfo.getVerisonStatus())){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","序号为" + (r - 2) + "的”版本状态”输入格式不正确"); |
|
|
|
|
message.put("status","序号为" + (r + 1) + "的”版本状态”输入格式不正确"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
fieldx222Service.remove(null); |
|
|
|
|
return Result.error("序号为" + (r - 2) + "的版本状态输入格式不正确"); |
|
|
|
|
return Result.error("序号为" + (r + 1) + "的版本状态输入格式不正确"); |
|
|
|
|
} |
|
|
|
|
fieldx222.setVerisonStatus(excelInfo.getVerisonStatus()); |
|
|
|
|
|
|
|
|
|