文档库--导出(标准类型字段)
This commit is contained in:
+48
-25
@@ -3271,7 +3271,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String condition = getConditionStr(map);
|
||||
//导出数据(全部导出的数据)
|
||||
List<Map<String, Object>> datas = bussDocumentLibraryEOMapper.getInfoList(" " + StringUtils.join(conditionFieldList, ","), condition);
|
||||
//处理对应标准,代替标准,被代替标准(由id转中文)
|
||||
//处理被代替标准(由id转中文)
|
||||
getStandard(datas);
|
||||
//部分导出
|
||||
String partId = (String) map.get("id");
|
||||
@@ -3380,44 +3380,67 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
datasTemp.add(mapTemp);
|
||||
}
|
||||
for (Map<String, Object> data : datas) {
|
||||
String idTemp = (String) data.get("id");
|
||||
String correspondingStandard = (String) data.get("corresponding_standard");
|
||||
String replaceStandard = (String) data.get("replace_standard");
|
||||
StringBuilder correspondingStandardSb = new StringBuilder();
|
||||
StringBuilder replaceStandardSb = new StringBuilder();
|
||||
String idTemp = (String) data.get("serial_number");
|
||||
StringBuilder replacedStandardSb = new StringBuilder();
|
||||
datasTemp.forEach(entry -> {
|
||||
String id = (String) entry.get("id");
|
||||
String replaceStandardTemp = (String) entry.get("replace_standard");
|
||||
//对应标准
|
||||
if (StringUtils.isNotBlank(correspondingStandard) && correspondingStandard.contains(id)) {
|
||||
correspondingStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
}
|
||||
//代替标准
|
||||
if (StringUtils.isNotBlank(replaceStandard) && replaceStandard.contains(id)) {
|
||||
replaceStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
}
|
||||
//被代替标准
|
||||
if (StringUtils.isNotBlank(replaceStandardTemp) && replaceStandardTemp.contains(idTemp)) {
|
||||
replacedStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
}
|
||||
});
|
||||
//对应标准
|
||||
if (StringUtils.isNotBlank(correspondingStandardSb)) {
|
||||
String correspondingStandardStr = correspondingStandardSb.substring(0, correspondingStandardSb.length() - 1);
|
||||
data.put("corresponding_standard", correspondingStandardStr);
|
||||
}
|
||||
//代替标准
|
||||
if (StringUtils.isNotBlank(replaceStandardSb)) {
|
||||
String replaceStandardStr = replaceStandardSb.substring(0, replaceStandardSb.length() - 1);
|
||||
data.put("replace_standard", replaceStandardStr);
|
||||
}
|
||||
if (StringUtils.isNotBlank(replacedStandardSb)) {
|
||||
String replacedStandardStr = replacedStandardSb.substring(0, replacedStandardSb.length() - 1);
|
||||
data.put("replaced_standard", replacedStandardStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
// private void getStandard(List<Map<String, Object>> datas) {
|
||||
// List<Map<String, Object>> datasTemp = new ArrayList<>();
|
||||
// for (Map<String, Object> data : datas) {
|
||||
// Map<String, Object> mapTemp = new HashMap<>();
|
||||
// mapCopy(data, mapTemp);
|
||||
// datasTemp.add(mapTemp);
|
||||
// }
|
||||
// for (Map<String, Object> data : datas) {
|
||||
// String idTemp = (String) data.get("id");
|
||||
// String correspondingStandard = (String) data.get("corresponding_standard");
|
||||
// String replaceStandard = (String) data.get("replace_standard");
|
||||
// StringBuilder correspondingStandardSb = new StringBuilder();
|
||||
// StringBuilder replaceStandardSb = new StringBuilder();
|
||||
// StringBuilder replacedStandardSb = new StringBuilder();
|
||||
// datasTemp.forEach(entry -> {
|
||||
// String id = (String) entry.get("id");
|
||||
// String replaceStandardTemp = (String) entry.get("replace_standard");
|
||||
// //对应标准
|
||||
// if (StringUtils.isNotBlank(correspondingStandard) && correspondingStandard.contains(id)) {
|
||||
// correspondingStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
// }
|
||||
// //代替标准
|
||||
// if (StringUtils.isNotBlank(replaceStandard) && replaceStandard.contains(id)) {
|
||||
// replaceStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
// }
|
||||
// //被代替标准
|
||||
// if (StringUtils.isNotBlank(replaceStandardTemp) && replaceStandardTemp.contains(idTemp)) {
|
||||
// replacedStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
// }
|
||||
// });
|
||||
// //对应标准
|
||||
// if (StringUtils.isNotBlank(correspondingStandardSb)) {
|
||||
// String correspondingStandardStr = correspondingStandardSb.substring(0, correspondingStandardSb.length() - 1);
|
||||
// data.put("corresponding_standard", correspondingStandardStr);
|
||||
// }
|
||||
// //代替标准
|
||||
// if (StringUtils.isNotBlank(replaceStandardSb)) {
|
||||
// String replaceStandardStr = replaceStandardSb.substring(0, replaceStandardSb.length() - 1);
|
||||
// data.put("replace_standard", replaceStandardStr);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(replacedStandardSb)) {
|
||||
// String replacedStandardStr = replacedStandardSb.substring(0, replacedStandardSb.length() - 1);
|
||||
// data.put("replaced_standard", replacedStandardStr);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public void createDatas(Workbook workbook, Sheet sheet, List<Map<String, Object>> datas, String header, List<OnlCgformField> fieldList, String cut) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Reference in New Issue
Block a user