处理各位因为类型强制转换为空校验导致的问题
This commit is contained in:
+64
@@ -65,5 +65,69 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
return "".equals(FilterNull(o.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Integer param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Character param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Double param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Long param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Boolean param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Float param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Character[] param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
public static String valueOf(Object param){
|
||||
if (param == null){
|
||||
return null;
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+105
-92
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.document.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -66,13 +67,13 @@ import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
@@ -103,6 +104,7 @@ import org.yaml.snakeyaml.util.UriEncoder;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.transaction.Transactional;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -134,6 +136,7 @@ import java.util.stream.Collectors;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLibraryEOMapper, BussDocumentLibraryEO> implements IBussDocumentLibraryEOService {
|
||||
|
||||
@Autowired
|
||||
@@ -337,6 +340,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("文档库删除es失败");
|
||||
}
|
||||
}
|
||||
@@ -430,7 +434,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if ("1".equals(searchFlag)) {
|
||||
//搜索中心输入框
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowSearch()))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowSearch()))
|
||||
&& (FieldTypeEnum.TEXT_STRING.getValue().equals(e.getFieldShowType()) //输入框(字符串)
|
||||
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType())//输入框(数字)
|
||||
|| FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType())//人员选择
|
||||
@@ -442,7 +446,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
//搜索中心下拉,树形,日期等字段
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowSearch()))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowSearch()))
|
||||
&& (FieldTypeEnum.PULL_SINGLE.getValue().equals(e.getFieldShowType())//下拉单选
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(e.getFieldShowType())//下拉多选
|
||||
|| FieldTypeEnum.DATE_SINGLE.getValue().equals(e.getFieldShowType())//日期单选
|
||||
@@ -454,7 +458,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
} else {
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsQuery()))).collect(Collectors.toList());
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList());
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
fieldList = fieldList.stream().filter(e->!"title_en".equals(e.getDbFieldName())).collect(Collectors.toList());
|
||||
}else{
|
||||
@@ -516,7 +520,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤出搜索条件()
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsQuery()))).collect(Collectors.toList());
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList());
|
||||
}
|
||||
//树形数据字典
|
||||
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(null);
|
||||
@@ -569,7 +573,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤列表字段(is_show_list-->列表是否显示0否 1是)
|
||||
if ("search".equals(searchFlag)) {
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowSearch()))).collect(Collectors.toList());
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowSearch()))).collect(Collectors.toList());
|
||||
} else {
|
||||
for (OnlCgformField onlCgformField : fieldList) {
|
||||
if(CutEnum.EN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())){
|
||||
@@ -581,7 +585,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowList()))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowList()))
|
||||
&& !"title_en".equals(e.getDbFieldName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
@@ -642,11 +646,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if ("add".equals(type)) {
|
||||
//新增时,被代替标准在表单中不显示.
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())) && !"replaced_standard".equals(e.getDbFieldName()))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm())) && !"replaced_standard".equals(e.getDbFieldName()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -735,11 +739,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if ("add".equals(type)) {
|
||||
//新增时,被代替标准在表单中不显示.
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())) && !"replaced_standard".equals(e.getDbFieldName()))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm())) && !"replaced_standard".equals(e.getDbFieldName()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())))
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -1053,7 +1057,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤出表单字段(is_show_form-->表单是否显示0否 1是)
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
for (OnlCgformArea onlCgformAreaTemp : areaList) {
|
||||
@@ -1078,7 +1082,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
value = sdf.format(dataList.get(0).get(dbFieldName));
|
||||
}
|
||||
} else {
|
||||
value = String.valueOf(dataList.get(0).get(dbFieldName));
|
||||
value = StringUtils.valueOf(dataList.get(0).get(dbFieldName));
|
||||
if("null".equals(value)){
|
||||
value = "";
|
||||
}
|
||||
@@ -1390,7 +1394,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//
|
||||
// if (fieldList.size() != 0) {
|
||||
// //过滤出表单字段(is_show_form-->表单是否显示0否 1是)
|
||||
// fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
// fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
// }
|
||||
//
|
||||
// for (OnlCgformArea onlCgformAreaTemp : areaList) {
|
||||
@@ -1415,7 +1419,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
// value = sdf.format(dataList.get(0).get(dbFieldName));
|
||||
// }
|
||||
// } else {
|
||||
// value = String.valueOf(dataList.get(0).get(dbFieldName));
|
||||
// value = StringUtils.valueOf(dataList.get(0).get(dbFieldName));
|
||||
// if("null".equals(value)){
|
||||
// value = "";
|
||||
// }
|
||||
@@ -1575,8 +1579,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
public void addInfo(Map<String, Object> map) {
|
||||
String cut = (String) map.get("cut");
|
||||
try {
|
||||
String serialNumber = String.valueOf(map.get("serial_number"));
|
||||
//String serialNumber = String.valueOf(map.get("serial_number"));
|
||||
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
|
||||
//String serialNumber = StringUtils.valueOf(map.get("serial_number"));
|
||||
//编码验重
|
||||
List<BussDocumentLibraryEO> list = this.list();
|
||||
if(list.size() != 0){
|
||||
@@ -1587,10 +1591,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String issueTime = (String) map.get("issue_time");
|
||||
String issueTime = (String) (map.get("issue_time"));
|
||||
Date issueTimeDate = df.parse(issueTime);
|
||||
String implementTime = (String) map.get("implement_time");//在产车实施日期
|
||||
String newCarimplementTime = (String) map.get("xin1_che1_xing2_ren4_zheng4_shi2_jian1");//新车型实施日期
|
||||
String newCarimplementTime = (String) map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1");//新车型实施日期
|
||||
if (StringUtils.isNotBlank(implementTime)) {
|
||||
Date implementTimeDate = df.parse(implementTime);
|
||||
if (issueTimeDate.after(implementTimeDate)) {
|
||||
@@ -1604,6 +1608,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}
|
||||
|
||||
@@ -1764,7 +1769,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||
String s = (String) map.get(onlCgformField.getDbFieldName());
|
||||
String s = StringUtils.valueOf(map.get(onlCgformField.getDbFieldName()));
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
stringMapCn.put(onlCgformField.getDbFieldName(), s);
|
||||
stringMapEn.put(onlCgformField.getDbFieldName(), s);
|
||||
@@ -1772,12 +1777,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
//文件相关封装中文的全文内容(es)
|
||||
putMapCn(idTemp + ossFile.getId(), (String) map.get("serial_number"), "文档库",
|
||||
sbCn.toString(), (String) map.get("title"), fileText,
|
||||
putMapCn(idTemp + ossFile.getId(), StringUtils.valueOf(map.get("serial_number")), "文档库",
|
||||
sbCn.toString(), StringUtils.valueOf(map.get("title")), fileText,
|
||||
ossFile.getFileName(), cutCn, stringMapCn, null);
|
||||
//文件相关封装英文的全文内容(es)
|
||||
putMapCn(idTemp + ossFile.getId(), (String) map.get("serial_number"), "document library",
|
||||
sbEn.toString(), (String) map.get("title"), fileText,
|
||||
putMapCn(idTemp + ossFile.getId(), StringUtils.valueOf(map.get("serial_number")), "document library",
|
||||
sbEn.toString(), StringUtils.valueOf(map.get("title")), fileText,
|
||||
ossFile.getFileName(), cutEn, stringMapEn, null);
|
||||
|
||||
mapListTempCn.add(stringMapCn);
|
||||
@@ -1794,20 +1799,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||
String s = (String) map.get(onlCgformField.getDbFieldName());
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
String s = StringUtils.valueOf(map.get(onlCgformField.getDbFieldName()));
|
||||
if(StrUtil.isNotBlank(s)){
|
||||
mapBaseDateCn.put(onlCgformField.getDbFieldName(), s);
|
||||
mapBaseDateEn.put(onlCgformField.getDbFieldName(), s);
|
||||
}
|
||||
}
|
||||
//基础数据(中文)
|
||||
putMapCn(idTemp, (String) map.get("serial_number"), "文档库",
|
||||
sbCn.toString(), (String) map.get("title"), "", "",
|
||||
putMapCn(idTemp, StringUtils.valueOf(map.get("serial_number")), "文档库",
|
||||
sbCn.toString(), StringUtils.valueOf(map.get("title")), "", "",
|
||||
cutCn, mapBaseDateCn,SEARCH_FLAG);
|
||||
mapBaseDateCn.put("file_sort",idTemp+"_"+1);
|
||||
//基础数据(英文)
|
||||
putMapCn(idTemp, (String) map.get("serial_number"), "document library",
|
||||
sbEn.toString(), (String) map.get("title"), "", "",
|
||||
putMapCn(idTemp, StringUtils.valueOf(map.get("serial_number")), "document library",
|
||||
sbEn.toString(), StringUtils.valueOf(map.get("title")), "", "",
|
||||
cutEn, mapBaseDateEn,SEARCH_FLAG);
|
||||
mapBaseDateEn.put("file_sort",idTemp+"_"+1);
|
||||
mapListTempCn.add(mapBaseDateCn);
|
||||
@@ -1816,27 +1821,27 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
Map<String, Object> stringMapCn = new HashMap<>();
|
||||
Map<String, Object> stringMapEn = new HashMap<>();
|
||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||
String s = (String) map.get(onlCgformField.getDbFieldName());
|
||||
String s = StringUtils.valueOf(map.get(onlCgformField.getDbFieldName()));
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
stringMapCn.put(onlCgformField.getDbFieldName(), s);
|
||||
stringMapEn.put(onlCgformField.getDbFieldName(), s);
|
||||
}
|
||||
}
|
||||
//封装中文的全文内容(es)
|
||||
putMapCn(idTemp,
|
||||
(String) map.get("serial_number"), "文档库", sbCn.toString(),
|
||||
(String) map.get("title"), "", "",
|
||||
putMapCn(idTemp, StringUtils.valueOf(map.get("serial_number")), "文档库", sbCn.toString(),
|
||||
StringUtils.valueOf(map.get("title")), "", "",
|
||||
cutCn, stringMapCn, SEARCH_FLAG);
|
||||
stringMapCn.put("file_sort",idTemp+"_"+1);
|
||||
//封装英文的全文内容(es)
|
||||
putMapCn(idTemp, (String) map.get("serial_number"), "document library", sbEn.toString(),
|
||||
(String) map.get("title"), "", "",
|
||||
putMapCn(idTemp, StringUtils.valueOf(map.get("serial_number")), "document library", sbEn.toString(),
|
||||
StringUtils.valueOf(map.get("title")), "", "",
|
||||
cutEn, stringMapEn,SEARCH_FLAG);
|
||||
stringMapEn.put("file_sort",idTemp+"_"+1);
|
||||
mapListTempCn.add(stringMapCn);
|
||||
mapListTempEn.add(stringMapEn);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("文档库新增es错误");
|
||||
}
|
||||
|
||||
@@ -1845,7 +1850,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String insertValue = mustValues + valuesBuilder.toString();
|
||||
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
|
||||
|
||||
String replaceStandard = (String) map.get("replace_standard");
|
||||
String replaceStandard = StringUtils.valueOf(map.get("replace_standard"));
|
||||
if (StringUtils.isNotBlank(replaceStandard)) {
|
||||
//新增时如果填写代替标准,需要向填写的代替标准的负责人发消息
|
||||
replaceStandardSend(Arrays.asList(replaceStandard.split(",")));
|
||||
@@ -2054,6 +2059,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("es全文转换失败");
|
||||
}
|
||||
}
|
||||
@@ -2063,10 +2069,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
mapTemp.put("domainId", map.get("technology_territory"));
|
||||
mapTemp.put("documentId", "");
|
||||
List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
|
||||
String title = (String) map.get("title");
|
||||
String serialNumber = (String) map.get("serial_number");
|
||||
String category = (String)map.get("lei4_bie2");
|
||||
String titleEn = (String) map.get("title_en");
|
||||
String title = StringUtils.valueOf(map.get("title"));
|
||||
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
|
||||
String category = StringUtils.valueOf(map.get("lei4_bie2"));
|
||||
String titleEn = StringUtils.valueOf(map.get("title_en"));
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsAll();
|
||||
if(StringUtils.isNotBlank(category)){
|
||||
String finalCategory = category;
|
||||
@@ -2171,15 +2177,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String cut = (String) map.get("cut");
|
||||
List<BussDocumentLibraryEO> list = this.list();
|
||||
List<String> serialNumberList = list.stream().map(BussDocumentLibraryEO::getSerialNumber).collect(Collectors.toList());
|
||||
String serialNumber = (String)map.get("serial_number");
|
||||
String category = (String)map.get("lei4_bie2");
|
||||
String id = (String) map.get("id");
|
||||
String title = (String) map.get("title");
|
||||
String titleEn = (String) map.get("title_en");
|
||||
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
|
||||
String category = StringUtils.valueOf(map.get("lei4_bie2"));
|
||||
String id = StringUtils.valueOf(map.get("id"));
|
||||
String title = StringUtils.valueOf(map.get("title"));
|
||||
String titleEn = StringUtils.valueOf(map.get("title_en"));
|
||||
//通过id查询数据
|
||||
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMapsAll(id);
|
||||
if(dataList.size() != 0){
|
||||
String serialNumberTemp = (String)dataList.get(0).get("serial_number");
|
||||
String serialNumberTemp = StringUtils.valueOf(dataList.get(0).get("serial_number"));
|
||||
if(!serialNumberTemp.equals(serialNumber) && serialNumberList.contains(serialNumber)){
|
||||
throw new JeroBootException("编号已存在不能重复添加");
|
||||
}
|
||||
@@ -2197,7 +2203,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String issueTime = (String) map.get("issue_time");
|
||||
Date issueTimeDate = df.parse(issueTime);
|
||||
String implementTime = (String) map.get("implement_time");//在产车实施日期
|
||||
String newCarimplementTime = (String) map.get("xin1_che1_xing2_ren4_zheng4_shi2_jian1");//新车型实施日期
|
||||
String newCarimplementTime = (String) map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1");//新车型实施日期
|
||||
if (StringUtils.isNotBlank(implementTime)) {
|
||||
Date implementTimeDate = df.parse(implementTime);
|
||||
if (issueTimeDate.after(implementTimeDate)) {
|
||||
@@ -2212,6 +2218,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}
|
||||
|
||||
@@ -2367,7 +2374,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> connectIdList = new ArrayList<>();
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = String.valueOf(entry.getValue());
|
||||
String value = StringUtils.valueOf(entry.getValue());
|
||||
if(fileFieldList.contains(key)){
|
||||
if(!"null".equals(value)){
|
||||
connectIdList.add(value);
|
||||
@@ -2396,15 +2403,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
//封装中文的全文内容(es)
|
||||
putMapCn((String) map.get("id"), (String) map.get("serial_number"), "文档库",
|
||||
sbCn.toString(), (String) map.get("title"), "", "",
|
||||
putMapCn(StringUtils.valueOf(map.get("id")), StringUtils.valueOf(map.get("serial_number")), "文档库",
|
||||
sbCn.toString(), StringUtils.valueOf(map.get("title")), "", "",
|
||||
cutCn, stringMapCn,SEARCH_FLAG);
|
||||
stringMapCn.put("file_sort",(String) map.get("id")+"_"+1);
|
||||
stringMapCn.put("file_sort", StringUtils.valueOf(map.get("id")+"_"+1));
|
||||
//封装英文的全文内容(es)
|
||||
putMapCn((String) map.get("id"), (String) map.get("serial_number"), "document library",
|
||||
sbEn.toString(), (String) map.get("title"), "", "",
|
||||
putMapCn(StringUtils.valueOf(map.get("id")), StringUtils.valueOf(map.get("serial_number")), "document library",
|
||||
sbEn.toString(), StringUtils.valueOf(map.get("title")), "", "",
|
||||
cutEn, stringMapEn,SEARCH_FLAG);
|
||||
stringMapEn.put("file_sort",(String) map.get("id")+"_"+1);
|
||||
stringMapEn.put("file_sort", StringUtils.valueOf(map.get("id")+"_"+1));
|
||||
|
||||
mapListTempCn.add(stringMapCn);
|
||||
mapListTempEn.add(stringMapEn);
|
||||
@@ -2412,6 +2419,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("文档库新增es错误");
|
||||
}
|
||||
|
||||
@@ -2425,7 +2433,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|
||||
List<String> connectIdList = new ArrayList<>();//已删除的文件关联id
|
||||
for (OnlCgformField onlCgformField : fieldFileList) {
|
||||
String connectId = (String) mapList.get(0).get(onlCgformField.getDbFieldName());
|
||||
String connectId = StringUtils.valueOf(mapList.get(0).get(onlCgformField.getDbFieldName()));
|
||||
//如果文件没有修改则不用删除
|
||||
if (StringUtils.isNotBlank(connectId) && !connectId.equals(map.get(onlCgformField.getDbFieldName()))) {
|
||||
connectIdList.add(connectId);
|
||||
@@ -2580,7 +2588,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> fileIdLIstTemp = new ArrayList<>();
|
||||
for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = String.valueOf(entry.getValue());
|
||||
String value = StringUtils.valueOf(entry.getValue());
|
||||
//文件
|
||||
if(fileFieldList.contains(key)&& !"null".equals(value) && StringUtils.isNotBlank(value)){
|
||||
fileIdLIstTemp.addAll(Arrays.asList(value.split(",")));
|
||||
@@ -2589,9 +2597,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
int count = 0;
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = String.valueOf(entry.getValue());
|
||||
String value = StringUtils.valueOf(entry.getValue());
|
||||
|
||||
if (value == null){
|
||||
continue;
|
||||
}
|
||||
|
||||
//状态
|
||||
if("state".equals(key) && !value.equals((String)dataList.get(0).get("state"))){
|
||||
if("state".equals(key) && !value.equals(StringUtils.valueOf(dataList.get(0).get("state")))){
|
||||
count++;
|
||||
//数据字典转换 dictItemList
|
||||
String finalValue = value;
|
||||
@@ -2616,7 +2629,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|
||||
}
|
||||
//适用车型 car_type
|
||||
if("shi4_yong4_che1_xing2".equals(key) && !value.equals((String)dataList.get(0).get("shi4_yong4_che1_xing2")) && !"null".equals(value)){
|
||||
if("shi4_yong4_che1_xing2".equals(key) && !value.equals(StringUtils.valueOf(dataList.get(0).get("shi4_yong4_che1_xing2"))) && !"null".equals(value)){
|
||||
count++;
|
||||
//数据字典转换 dictItemList
|
||||
List<SysDictItem> stateDictItemList = dictItemList.stream()
|
||||
@@ -3474,7 +3487,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> fieldDateList = onlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤列表字段(is_show_list-->列表是否显示0否 1是)
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowList()))).collect(Collectors.toList());
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowList()))).collect(Collectors.toList());
|
||||
}
|
||||
List<String> fieldListTemp = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
List<String> fieldListNew = new ArrayList<>();
|
||||
@@ -3575,7 +3588,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (!"pageNo".equals(key) && !"pageSize".equals(key)) {
|
||||
String value = "";
|
||||
if(ObjectUtils.isNotEmpty(entry.getValue())){
|
||||
value = String.valueOf(entry.getValue());
|
||||
value = StringUtils.valueOf(entry.getValue());
|
||||
}
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
for (Map<String, Object> map : mapList) {
|
||||
@@ -3871,8 +3884,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
&& !"update_by".equals(e.getDbFieldName())
|
||||
&& !"update_time".equals(e.getDbFieldName())
|
||||
&& !"sys_org_code".equals(e.getDbFieldName())
|
||||
&& !"warn_flag".equals(e.getDbFieldName())
|
||||
&& YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))
|
||||
&& YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))
|
||||
&& StringUtils.isNotBlank(e.getShowArea())).collect(Collectors.toList());
|
||||
//只导出数据时,过滤掉文件类型
|
||||
if (!"file".equals(flag)) {
|
||||
@@ -3930,17 +3942,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> fileFieldList = onlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
|
||||
for (Map<String, Object> data : datas) {
|
||||
if (StringUtils.isBlank((String) data.get("serial_number"))) {
|
||||
if (StringUtils.isBlank(StringUtils.valueOf(data.get("serial_number")))) {
|
||||
continue;
|
||||
}
|
||||
List<String> valueList = new ArrayList<>();
|
||||
for (String field : fileFieldList) {
|
||||
String value = (String) data.get(field);
|
||||
String value = StringUtils.valueOf(data.get(field));
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
valueList.add(value);
|
||||
}
|
||||
}
|
||||
String serialNumber = (String) data.get("serial_number");
|
||||
String serialNumber = StringUtils.valueOf(data.get("serial_number"));
|
||||
if (serialNumber.contains("/")) {
|
||||
serialNumber = serialNumber.replace("/", "-");
|
||||
}
|
||||
@@ -4007,13 +4019,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
datasTemp.add(mapTemp);
|
||||
}
|
||||
for (Map<String, Object> data : datas) {
|
||||
String idTemp = (String) data.get("serial_number");
|
||||
String idTemp = StringUtils.valueOf(data.get("serial_number"));
|
||||
StringBuilder replacedStandardSb = new StringBuilder();
|
||||
datasTemp.forEach(entry -> {
|
||||
String replaceStandardTemp = (String) entry.get("replace_standard");
|
||||
//被代替标准
|
||||
if (StringUtils.isNotBlank(replaceStandardTemp) && replaceStandardTemp.contains(idTemp)) {
|
||||
replacedStandardSb.append((String) entry.get("serial_number") + ",");
|
||||
replacedStandardSb.append(entry.get("serial_number") + ",");
|
||||
}
|
||||
});
|
||||
if (StringUtils.isNotBlank(replacedStandardSb)) {
|
||||
@@ -4085,7 +4097,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> connectIdList = new ArrayList<>();
|
||||
for (Map<String, Object> data : datas) {
|
||||
for (OnlCgformField onlCgformField : fileFieldList) {
|
||||
String value = (String) data.get(onlCgformField.getDbFieldName());
|
||||
String value = StringUtils.valueOf(data.get(onlCgformField.getDbFieldName()));
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
connectIdList.add(value);
|
||||
}
|
||||
@@ -4134,7 +4146,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
} else {
|
||||
value = String.valueOf(data.get(onlCgformField.getDbFieldName()));
|
||||
value = StringUtils.valueOf(data.get(onlCgformField.getDbFieldName()));
|
||||
}
|
||||
if("null".equals(value)){
|
||||
value = "";
|
||||
@@ -4175,7 +4187,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤列表字段(is_show_list-->列表是否显示0否 1是)
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowList()))).collect(Collectors.toList());
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowList()))).collect(Collectors.toList());
|
||||
}
|
||||
List<String> fieldListTemp = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
List<String> fieldListNew = new ArrayList<>();
|
||||
@@ -4295,30 +4307,30 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String fieldShowType = "field_show_type";
|
||||
//多选字段
|
||||
if (FieldTypeEnum.PULL_MORE.getValue().equals(map.get(fieldShowType))) {
|
||||
pullMoreList.add((String) map.get("db_field_txt"));
|
||||
pullMoreList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(map.get(fieldShowType))) {
|
||||
//单选字段
|
||||
pullSingleList.add((String) map.get("db_field_txt"));
|
||||
pullSingleList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.FILE.getValue().equals(map.get(fieldShowType))) {
|
||||
//文件字段
|
||||
fileList.add((String) map.get("db_field_txt"));
|
||||
fileList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.TEXT_NUMBER.getValue().equals(map.get(fieldShowType))) {
|
||||
//数字输入框字段
|
||||
textNumberList.add((String) map.get("db_field_txt"));
|
||||
textNumberList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.TEXT_STRING.getValue().equals(map.get(fieldShowType))) {
|
||||
//字符串输入框字段
|
||||
textStringList.add((String) map.get("db_field_txt"));
|
||||
textStringList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(map.get(fieldShowType))) {
|
||||
//单选日期字段
|
||||
dateSingleList.add((String) map.get("db_field_txt"));
|
||||
dateSingleList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.DATE_MORE.getValue().equals(map.get(fieldShowType))) {
|
||||
//多选日期字段
|
||||
dateMoreList.add((String) map.get("db_field_txt"));
|
||||
dateMoreList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
} else if (FieldTypeEnum.STANDARD.getValue().equals(map.get(fieldShowType))) {
|
||||
//标准选择字段
|
||||
standardList.add((String) map.get("db_field_txt"));
|
||||
standardList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
}else if(FieldTypeEnum.TREE.getValue().equals(map.get(fieldShowType))){
|
||||
treeList.add((String) map.get("db_field_txt"));
|
||||
treeList.add(StringUtils.valueOf(map.get("db_field_txt")));
|
||||
}
|
||||
}
|
||||
String title = sb.substring(0, sb.length() - 1);
|
||||
@@ -4686,14 +4698,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> urlList = new ArrayList<>();
|
||||
List<String> hrefList = new ArrayList<>();
|
||||
for (Map<String, Object> map : mapList) {
|
||||
serialNumberList.add((String) map.get("serial_number"));
|
||||
String url = backUrl + "/docManage/library/detail?id=" + (String) map.get("id")+
|
||||
"&title=" + (String) map.get("title") +
|
||||
"&serial_number=" + (String) map.get("serial_number");
|
||||
serialNumberList.add(StringUtils.valueOf(map.get("serial_number")));
|
||||
String url = backUrl + "/docManage/library/detail?id=" + map.get("id") +
|
||||
"&title=" + map.get("title") +
|
||||
"&serial_number=" + map.get("serial_number");
|
||||
|
||||
String href = "<a href='/docManage/library/detail?id=" + (String) map.get("id") +
|
||||
"&title=" + (String) map.get("title") +
|
||||
"&serial_number=" + (String) map.get("serial_number") + "'" + " target='_blank'>" + (String) map.get("serial_number") + "</a>";
|
||||
String href = "<a href='/docManage/library/detail?id=" + map.get("id") +
|
||||
"&title=" + map.get("title") +
|
||||
"&serial_number=" + map.get("serial_number") + "'" + " target='_blank'>" + map.get("serial_number") + "</a>";
|
||||
urlList.add(url);
|
||||
hrefList.add(href);
|
||||
}
|
||||
@@ -4713,7 +4725,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> list = new ArrayList<>();
|
||||
mapList.stream().forEach(e->{
|
||||
if(s.contains((String)e.get("id"))){
|
||||
String serialNumber = (String) e.get("serial_number");
|
||||
String serialNumber = StringUtils.valueOf(e.get("serial_number"));
|
||||
list.add(serialNumber);
|
||||
}
|
||||
});
|
||||
@@ -4740,7 +4752,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> treeFields = treeFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
String key = entry.getKey();
|
||||
if (treeFields.contains(entry.getKey())) {
|
||||
String value = (String) entry.getValue();
|
||||
String value = StringUtils.valueOf(entry.getValue());
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<String> idList = Arrays.asList(value.split(","));
|
||||
List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
|
||||
@@ -4985,7 +4997,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Date issueTimeDate = df.parse(issueTime);
|
||||
// String implementTime = (String) stringStringMap.get("implement_time");//在产车实施日期
|
||||
// String newCarimplementTime = (String) stringStringMap.get("xin1_che1_xing2_ren4_zheng4_shi2_jian1");//新车型实施日期
|
||||
// String newCarimplementTime = (String) stringStringMap.get("xin1_che1_xing2_shi2_shi1_ri4_qi1");//新车型实施日期
|
||||
// if(StringUtils.isNotBlank(implementTime)){
|
||||
// Date implementTimeDate = df.parse(implementTime);
|
||||
// if (issueTimeDate.after(implementTimeDate)) {
|
||||
@@ -5392,7 +5404,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
switch (cell.getCellType()) {
|
||||
case HSSFCell.CELL_TYPE_NUMERIC: // 数字
|
||||
//如果为时间格式的内容
|
||||
value = String.valueOf(cell.getNumericCellValue());
|
||||
value = StringUtils.valueOf(cell.getNumericCellValue());
|
||||
break;
|
||||
case HSSFCell.CELL_TYPE_STRING: // 字符串
|
||||
value = cell.getStringCellValue();
|
||||
@@ -5469,6 +5481,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
UUID uuid = UUID.fromString(id);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("document", e);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
+1
-13
@@ -5471,19 +5471,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
//
|
||||
// try {
|
||||
// OutputStream os = new FileOutputStream(templateFile);
|
||||
// int bytesRead = 0;
|
||||
// byte[] buffer = new byte[8192];
|
||||
// while ((bytesRead = inputStream.read(buffer, 0, 8192)) != -1) {
|
||||
// os.write(buffer, 0, bytesRead);
|
||||
// }
|
||||
// os.close();
|
||||
// inputStream.close();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
|
||||
log.debug("导出word报告,获取模板结束 =============================================================================");
|
||||
//if(templateFile != null){
|
||||
|
||||
+1
-1
@@ -1886,7 +1886,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Date issueTimeDate = df.parse(issueTime);
|
||||
// String implementTime = (String) stringStringMap.get("implement_time");//在产车实施日期
|
||||
// String newCarimplementTime = (String) stringStringMap.get("xin1_che1_xing2_ren4_zheng4_shi2_jian1");//新车型实施日期
|
||||
// String newCarimplementTime = (String) stringStringMap.get("xin1_che1_xing2_shi2_shi1_ri4_qi1");//新车型实施日期
|
||||
// if(StringUtils.isNotBlank(implementTime)){
|
||||
// Date implementTimeDate = df.parse(implementTime);
|
||||
// if (issueTimeDate.after(implementTimeDate)) {
|
||||
|
||||
Reference in New Issue
Block a user