条款列表导出bug修改
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
||||
void updateByDeleteId(@Param("correspondingStandardStr") String correspondingStandardStr,
|
||||
@Param("replaceStandardStr") String replaceStandardStr,
|
||||
@Param("id") String id );
|
||||
|
||||
List<Map<String, Object>> queryListByIds(@Param("ids") String ids);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -82,4 +82,11 @@
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<select id="queryListByIds" resultType="java.util.LinkedHashMap">
|
||||
select * from buss_document_library
|
||||
where id in
|
||||
<foreach collection="ids.split(',')" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+1
@@ -193,4 +193,5 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
||||
|
||||
String verifyBind(List<String> ids);
|
||||
|
||||
List<Map<String,Object>> queryListByIds(String ids);
|
||||
}
|
||||
|
||||
+5
-1
@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.WebsocketConst;
|
||||
import com.jero.common.constant.enums.*;
|
||||
@@ -4105,6 +4104,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryListByIds(String ids) {
|
||||
return bussDocumentLibraryEOMapper.queryListByIds(ids);
|
||||
}
|
||||
|
||||
private void putMapCn(String id,String serialNumber,String moduleType,
|
||||
String content,String title,String fileText,
|
||||
String fileName,String cut,Map<String, Object> stringMap,
|
||||
|
||||
+165
-16
@@ -21,6 +21,7 @@ import com.jero.common.util.DateUtils;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.ocr.util.UUIDUtils;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
@@ -46,6 +47,8 @@ import com.jero.modules.split.util.POIReadExcelToHtml;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysCategoryTreeVO;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
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.UserUtils;
|
||||
@@ -114,6 +117,11 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
private IOSSFileService ossFileService;
|
||||
@Autowired
|
||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService documentLibraryEOService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
@@ -374,7 +382,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
value = parameter.get(key + "_id");
|
||||
}
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
} else if(fieldPersonIdList.contains(key)){
|
||||
} else if(fieldPersonIdList.contains(key) || standardIdList.contains(key)){
|
||||
continue;
|
||||
} else {
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
@@ -404,11 +412,27 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
String cut = (String) parameter.get("cut");// 中英文切换标识
|
||||
// 查询条款表所有字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.FILE_SPLIT_ITEMS.getValue());
|
||||
// // 日期类型字段
|
||||
// List<OnlCgformField> onlCgformFieldList = fieldList.stream()
|
||||
// .filter(e -> FieldTypeEnum.DATE_SINGLE.getValue().equals(e.getFieldShowType()))
|
||||
// .collect(Collectors.toList());
|
||||
// List<String> fieldDateList = onlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 日期类型字段
|
||||
List<OnlCgformField> onlCgformFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.DATE_SINGLE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fieldDateList = onlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 人员选择
|
||||
List<OnlCgformField> onlCgformFieldPersonList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fieldPersonList = onlCgformFieldPersonList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 标准选择
|
||||
List<OnlCgformField> onlCgformFieldStanList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fieldStanList = onlCgformFieldStanList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 文件字段
|
||||
List<OnlCgformField> onlCgformFieldFileList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fileList = onlCgformFieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
|
||||
// 列表显示字段
|
||||
if (fieldList.size() != 0) {
|
||||
// 过滤得到列表字段(is_show_list-->列表是否显示0否 1是)
|
||||
@@ -445,21 +469,68 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
List<OnlCgformField> treeFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
//数据字典
|
||||
|
||||
// 数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
//下拉选处理数据字典
|
||||
// 下拉选处理数据字典
|
||||
List<Map> records = infoPage.getRecords();
|
||||
List<String> idList = new ArrayList<>();
|
||||
List<String> fileIdList = new ArrayList<>();
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
idList.add((String) record1.get("id"));
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
List<OnlCgformField> collect = fieldList.stream()
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()) && !FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.filter(e -> entry.getKey().equals(e.getDbFieldName()) && !FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
// 下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect, cut);
|
||||
// 树形结构处理数据字典
|
||||
treeDictItem(categoryList, entry, treeFieldList, cut);
|
||||
// 文件类型 获取connectId 用于列表回显文件名
|
||||
if(fileList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())){
|
||||
fileIdList.add((String)entry.getValue());
|
||||
}
|
||||
// 单日期
|
||||
if(fieldDateList.contains(entry.getKey()) && ObjectUtil.isNotEmpty(entry.getValue())){
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
entry.setValue(dateFormat.format((Date)entry.getValue()));
|
||||
}
|
||||
// 人员选择
|
||||
if(fieldPersonList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())) {
|
||||
List<SysUser> sysUserList = sysUserService.listByIds(Arrays.asList(entry.getValue().toString().split(",")));
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for(SysUser user : sysUserList){
|
||||
stringBuilder.append(user.getRealname()).append("(").append(user.getUsername()).append("),");
|
||||
}
|
||||
String value = stringBuilder.substring(0, stringBuilder.lastIndexOf(","));
|
||||
entry.setValue(value);
|
||||
}
|
||||
// 标准选择
|
||||
if(fieldStanList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())) {
|
||||
List<Map<String, Object>> documentLibraryEOList = documentLibraryEOService.queryListByIds(entry.getValue().toString());
|
||||
if(CollectionUtil.isNotEmpty(documentLibraryEOList)){
|
||||
String value = StringUtils.join(documentLibraryEOList.stream().map(map->map.get("serial_number")).collect(Collectors.toList()),",");
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 拼接文件名
|
||||
if(fileIdList.size() != 0){
|
||||
List<OSSFile> fileInfos = ossFileService.getFileInfos(StringUtils.join(fileIdList, ","));
|
||||
if(fileInfos.size() != 0){
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
if(fileList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())){
|
||||
String value = (String) entry.getValue();
|
||||
List<OSSFile> ossFileList = fileInfos.stream().filter(e -> value.equals(e.getConnectId())).collect(Collectors.toList());
|
||||
if(ossFileList.size() != 0){
|
||||
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
|
||||
entry.setValue(StringUtils.join(fileNameList,","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return infoPage;
|
||||
@@ -536,7 +607,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||
|
||||
//搜索条件字段类型信息
|
||||
List<Map<String, Object>> mapList = queryCondition("4", null);
|
||||
List<Map<String, Object>> mapList = queryCondition(ModuleEnum.FILE_SPLIT_ITEMS.getValue(), null);
|
||||
|
||||
//查询条件处理
|
||||
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
||||
@@ -586,6 +657,14 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||
//下拉单选或下拉多选
|
||||
conditionSb.append(" and (sar_file_split_items." + key + " in(" + substring + ")" + condition.toString());
|
||||
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
|
||||
//日期(区分单日期还时间范围)
|
||||
if (value.contains(",")) {
|
||||
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
|
||||
+ " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
|
||||
} else {
|
||||
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2146,9 +2225,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
* @param cut 需切换的语言类别
|
||||
*/
|
||||
public void dictItem(List<SysDictItem> sysDictItems, Map.Entry<String, Object> entry, List<OnlCgformField> collect, String cut) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//通过dictField判断字段是否为下拉选(不为空则为下拉选)
|
||||
if (collect.size() != 0 && StringUtils.isNotBlank(collect.get(0).getDictField())) {
|
||||
String dictCode = collect.get(0).getDictField();
|
||||
String value = (String) entry.getValue();
|
||||
//数据字典中文
|
||||
List<String> dictItemsCh = new ArrayList<>();
|
||||
@@ -2157,7 +2236,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
for (String itemValue : value.split(",")) {
|
||||
//字段的数据字典
|
||||
List<SysDictItem> dictItemList = sysDictItems.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals(entry.getKey()))
|
||||
.filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals(dictCode))
|
||||
.collect(Collectors.toList());
|
||||
if (dictItemList.size() != 0) {
|
||||
List<SysDictItem> dictItems = dictItemList.stream()
|
||||
@@ -2315,12 +2394,34 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
List<Map<String, Object>> itemsDataForExport = dao.queryByOrdersForExport(field,idList, infoId);
|
||||
// 查询条款表所有字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.FILE_SPLIT_ITEMS.getValue());
|
||||
// 日期类型字段
|
||||
List<OnlCgformField> onlCgformFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.DATE_SINGLE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fieldDateList = onlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 人员选择
|
||||
List<OnlCgformField> onlCgformFieldPersonList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fieldPersonList = onlCgformFieldPersonList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 标准选择
|
||||
List<OnlCgformField> onlCgformFieldStanList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fieldStanList = onlCgformFieldStanList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// 文件字段
|
||||
List<OnlCgformField> onlCgformFieldFileList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
List<String> fileList = onlCgformFieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
|
||||
// 过滤导出字段
|
||||
if (fieldList.size() != 0) {
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())) || "条款内容".equals(e.getDbFieldTxt()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
//过滤出树形字段
|
||||
@@ -2329,16 +2430,64 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
.collect(Collectors.toList());
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
List<String> fileIdList = new ArrayList<>();
|
||||
// 处理数据下拉框,树形结构数据及中英文切换
|
||||
for (Map record : itemsDataForExport) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
List<OnlCgformField> collect = fieldList.stream()
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()) && !FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.filter(e -> entry.getKey().equals(e.getDbFieldName()) && !FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect, cut);
|
||||
// 树形结构处理数据字典
|
||||
treeDictItem(categoryList, entry, treeFieldList, cut);
|
||||
// 文件类型 获取connectId 用于列表回显文件名
|
||||
if(fileList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())){
|
||||
fileIdList.add((String)entry.getValue());
|
||||
}
|
||||
// 单日期
|
||||
if(fieldDateList.contains(entry.getKey()) && ObjectUtil.isNotEmpty(entry.getValue())){
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
entry.setValue(dateFormat.format((Date)entry.getValue()));
|
||||
}
|
||||
// 人员选择
|
||||
if(fieldPersonList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())) {
|
||||
List<SysUser> sysUserList = sysUserService.listByIds(Arrays.asList(entry.getValue().toString().split(",")));
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for(SysUser user : sysUserList){
|
||||
stringBuilder.append(user.getRealname()).append("(").append(user.getUsername()).append("),");
|
||||
}
|
||||
String value = stringBuilder.substring(0, stringBuilder.lastIndexOf(","));
|
||||
entry.setValue(value);
|
||||
}
|
||||
// 标准选择
|
||||
if(fieldStanList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())) {
|
||||
List<Map<String, Object>> documentLibraryEOList = documentLibraryEOService.queryListByIds(entry.getValue().toString());
|
||||
if(CollectionUtil.isNotEmpty(documentLibraryEOList)){
|
||||
String value = StringUtils.join(documentLibraryEOList.stream().map(map->map.get("serial_number")).collect(Collectors.toList()),",");
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 拼接文件名
|
||||
if(fileIdList.size() != 0){
|
||||
List<OSSFile> fileInfos = ossFileService.getFileInfos(StringUtils.join(fileIdList, ","));
|
||||
if(fileInfos.size() != 0){
|
||||
for (Map record : itemsDataForExport) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
if(fileList.contains(entry.getKey()) && StringUtils.isNotBlank((String) entry.getValue())){
|
||||
String value = (String) entry.getValue();
|
||||
List<OSSFile> ossFileList = fileInfos.stream().filter(e -> value.equals(e.getConnectId())).collect(Collectors.toList());
|
||||
if(ossFileList.size() != 0){
|
||||
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
|
||||
entry.setValue(StringUtils.join(fileNameList,","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemsDataForExport;
|
||||
|
||||
Reference in New Issue
Block a user