diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index 7f427e884..549971a72 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -419,7 +419,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl { if (fieldPullList.contains(entry.getKey())) { //下拉选处理数据字典 - dictItem(sysDictItems, entry, onlCgformFieldList); + dictItem(sysDictItems, entry, onlCgformFieldList,cut); } }); @@ -614,6 +614,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl map) { + String cut = (String) map.get("cut"); if (ObjectUtils.isNotEmpty(map.get("replace_standard_id"))) { map.put("replace_standard", map.get("replace_standard_id")); } @@ -642,7 +643,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl> dataList = bussDocumentLibraryEOMapper.selectMaps(queryWrapper); //更新log - updateLog(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList); + updateLog(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList,cut); //判断该条数据是否订阅 @@ -742,7 +743,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl fieldList, List fieldDateList, List fieldFileList, - List fieldPullList) { + List fieldPullList, + String cut) { Map mapTemp = new HashMap<>(); mapCopy(map, mapTemp); //时间类型的字段 @@ -760,14 +762,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl entry.getKey().equals(e.getDictField())) .collect(Collectors.toList()); //下拉选处理数据字典 - dictItem(sysDictItems, entry, collect); + dictItem(sysDictItems, entry, collect,cut); } for (Map.Entry entry : mapTemp.entrySet()) { List collect = fieldPullList.stream() .filter(e -> entry.getKey().equals(e.getDictField())) .collect(Collectors.toList()); //下拉选处理数据字典 - dictItem(sysDictItems, entry, collect); + dictItem(sysDictItems, entry, collect,cut); } StringBuilder sb = new StringBuilder(); @@ -1058,6 +1060,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl parameter) { + String cut = (String) parameter.get("cut");//中英文切换标识 //需要查询的字段 List fieldList = onlCgformFieldService.getFieldList("1"); if (fieldList.size() != 0) { @@ -1100,7 +1103,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl entry.getKey().equals(e.getDictField())) .collect(Collectors.toList()); //下拉选处理数据字典 - dictItem(sysDictItems, entry, collect); + dictItem(sysDictItems, entry, collect,cut); } } //收藏和订阅 @@ -1218,13 +1221,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl sysDictItems, Map.Entry entry, List collect) { + private void dictItem(List sysDictItems, Map.Entry entry, List collect,String cut) { Map map = new HashMap<>(); //通过dictField判断字段是否为下拉选(不为空则为下拉选) if (collect.size() != 0 && StringUtils.isNotBlank(collect.get(0).getDictField())) { String value = (String) entry.getValue(); //数据字典中文 List dictItemsCh = new ArrayList<>(); + List dictItemsEn = new ArrayList<>(); if (StringUtils.isNotBlank(value)) { for (String itemValue : value.split(",")) { //字段的数据字典 @@ -1236,13 +1240,23 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl itemValue.equals(e.getItemValue())) .collect(Collectors.toList()); if (dictItems.size() != 0) { - List itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); + List itemText = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(cut)){ + itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); + }else { + itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); + } dictItemsCh.addAll(itemText); + dictItemsEn.addAll(itemText); } } } } - entry.setValue(StringUtils.join(dictItemsCh, ",")); + if(CutEnum.CN.getValue().equals(cut)){ + entry.setValue(StringUtils.join(dictItemsCh, ",")); + }else{ + entry.setValue(StringUtils.join(dictItemsEn, ",")); + } } } @@ -1330,6 +1344,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl map, HttpServletResponse response, HttpServletRequest request) { + String cut = (String) map.get("cut"); //String flag = "file"为带文件导出标识 String flag = (String) map.get("flag"); // String flag = "file"; @@ -1359,8 +1374,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList()); } - headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList()); - + if(CutEnum.CN.getValue().equals(cut)){ + headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList()); + }else{ + headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList()); + } } //查询字段 List conditionFieldList = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); @@ -1380,7 +1398,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl> datas, String header, List fieldList) { + public void createDatas(Workbook workbook, Sheet sheet, List> datas, String header, List fieldList,String cut) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象 cellStyle.setAlignment(HorizontalAlignment.CENTER); @@ -1485,7 +1503,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl entry.getKey().equals(e.getDictField())) .collect(Collectors.toList()); //下拉选处理数据字典 - dictItem(sysDictItems, entry, collect); + dictItem(sysDictItems, entry, collect,cut); } Row row = sheet.createRow(i + 1); i++;