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

dev^2
mqh 1 year ago
commit aa548e6e1e
  1. 2
      ant-design-vue-jeecg/src/views/modulex/ModulexList.vue
  2. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java
  4. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java

@ -575,7 +575,7 @@ export default {
'表名(非空): 请填写实体表的名称', '表名(非空): 请填写实体表的名称',
'中文名称(非空): 请填写字段名称', '中文名称(非空): 请填写字段名称',
'英文名称(非空): 请填写字段名称的英语名称', '英文名称(非空): 请填写字段名称的英语名称',
'数据类型(非空): 请填写数据类型,{char,varchar,int}这些等等,具体可以查看数据字典', '数据类型(非空): 请填写数据类型,大写{CHAR,VARCHAR,INT}这些等等,具体可以查看数据字典',
'数据长度: 请填写该字段对应的长度', '数据长度: 请填写该字段对应的长度',
'浮点精度: 请填写浮点精度', '浮点精度: 请填写浮点精度',
'显示形式: 请填写该字段显示的形式', '显示形式: 请填写该字段显示的形式',

@ -8,6 +8,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.aliyuncs.utils.StringUtils; import com.aliyuncs.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -436,6 +437,7 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
if (StringUtils.isEmpty(String.valueOf(cell))) { if (StringUtils.isEmpty(String.valueOf(cell))) {
break; break;
} }
ExcelInfo excelInfo = new ExcelInfo(); ExcelInfo excelInfo = new ExcelInfo();
excelInfo.setcells(cells); excelInfo.setcells(cells);
Fieldx222 fieldx222 = new Fieldx222(); Fieldx222 fieldx222 = new Fieldx222();
@ -455,6 +457,7 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
fieldx222Service.remove(null); fieldx222Service.remove(null);
return Result.error("序号为" + (r - 2) + "的中文名称不能为空"); return Result.error("序号为" + (r - 2) + "的中文名称不能为空");
} }
fieldx222.setFieldName(excelInfo.getFieldName());
Fieldx222 fieldx2221=fieldx222Service.query().eq("field_name",excelInfo.getFieldName()).one(); Fieldx222 fieldx2221=fieldx222Service.query().eq("field_name",excelInfo.getFieldName()).one();
if(fieldx2221!=null){ if(fieldx2221!=null){
message.put("isError", "true"); message.put("isError", "true");
@ -466,6 +469,17 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
} }
fieldx222.setFieldName(excelInfo.getFieldName()); fieldx222.setFieldName(excelInfo.getFieldName());
LambdaQueryWrapper<Fieldx> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(Fieldx::getTableId,fieldx222.getTableId()).eq(Fieldx::getFieldName,fieldx222.getFieldName());
List<Fieldx> list=fieldxService.list(queryWrapper);
if(list!=null&&list.size()!=0){
message.put("isError", "true");
message.put("status","序号为" + (r - 2) + "的字段名此表已存在不能重复");
message.put("closeable","true");
webSocketUtils.sendMessage(loginUser.getId(), message);
fieldx222Service.remove(null);
return Result.error("序号为" + (r - 2) + "的字段名此表已存在不能重复");
}
if (StringUtil.isBlank(excelInfo.getFieldEnName())) { if (StringUtil.isBlank(excelInfo.getFieldEnName())) {
message.put("isError", "true"); message.put("isError", "true");
message.put("status","序号为" + (r - 2) + "的”英文名称”不能为空"); message.put("status","序号为" + (r - 2) + "的”英文名称”不能为空");

@ -41,7 +41,7 @@ public class Fieldx implements Serializable {
@Dict(dictTable="tablex",dicText = "table_name",dicCode = "id") @Dict(dictTable="tablex",dicText = "table_name",dicCode = "id")
private java.lang.String tableId; private java.lang.String tableId;
/**中文名称*/ /**中文名称*/
@Excel(name = "中文名称", width = 15) @Excel(name = "中文名称", width = 15,dicCode = "field_name")
@ApiModelProperty(value = "中文名称") @ApiModelProperty(value = "中文名称")
private java.lang.String fieldName; private java.lang.String fieldName;
/**英文名称*/ /**英文名称*/

@ -390,6 +390,9 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
if (j == 2) { if (j == 2) {
for (int k = 0; k < physicalNumberOfCells; k++) { for (int k = 0; k < physicalNumberOfCells; k++) {
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
if(cell==null){
propertyNames.add(null);
}
String name = cell.getStringCellValue(); String name = cell.getStringCellValue();
propertyNames.add(name); propertyNames.add(name);
} }
@ -425,6 +428,13 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
int annual = 0; int annual = 0;
for (int k = 0; k < physicalNumberOfCells; k++) { for (int k = 0; k < physicalNumberOfCells; k++) {
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
if(cell==null){
message.put("isError", "true");
message.put("status","表格中有空白单元格,"+"请重新导入");
message.put("closeable","true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("数据匹配读取失败,"+"请重新导入");
}
String value = cell.getStringCellValue(); String value = cell.getStringCellValue();
switch (k){ switch (k){
case 0: case 0:
@ -707,8 +717,14 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,责任人信息查询不到"); return Result.error("导入失败,责任人信息查询不到");
} }
String strip = org.apache.commons.lang.StringUtils.strip(list.toString(), "[]"); // String strip = org.apache.commons.lang.StringUtils.strip(list.toString(), "[]");
modulex.setManagerUsers(strip); String s = "";
for (int j = 0; j < list.size(); j++) {
s = s + list.get(j);
if (j < list.size() - 1)
s = s + ",";
}
modulex.setManagerUsers(s);
} }
} }
String workLevel = modulexTemplate.getWorkLevel(); String workLevel = modulexTemplate.getWorkLevel();

Loading…
Cancel
Save