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

This commit is contained in:
caoyang
2022-04-05 19:34:30 +08:00
10 changed files with 248 additions and 146 deletions
@@ -442,7 +442,7 @@ public class JeroElasticsearchTemplate {
json.put("highlight", highlight);
json.put("query", query);
json.put("sort", sort);
json.put("from", from);
json.put("from", from * size);
json.put("size", size);
return json;
}
@@ -43,60 +43,17 @@ public class OnlCgformCollectionController extends JeroController<OnlCgformColle
/**
* 分页列表查询
*
* @param onlCgformCollection
* @param pageNo
* @param pageSize
* @param req
* @param params
* @return
*/
@AutoLog(value = "我的收藏-分页列表查询")
@ApiOperation(value="我的收藏-分页列表查询", notes="我的收藏-分页列表查询")
@PostMapping(value = "/page")
public Result<?> queryPageList(@RequestBody Map<String,Object> params){
/*
public Result<?> queryPageList(OnlCgformCollection onlCgformCollection,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OnlCgformCollection> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformCollection, req.getParameterMap());
Page<OnlCgformCollection> page = new Page<OnlCgformCollection>(pageNo, pageSize);
IPage<OnlCgformCollection> pageList = onlCgformCollectionService.page(page, queryWrapper);
*/
IPage<OnlCgformCollection> pageList = onlCgformCollectionService.queryPageList(params);
return Result.OK(pageList);
}
/**
* 表头中英文切换
*
* @return
*/
/*
@AutoLog(value = "标签管理-表头中英文切换")
@ApiOperation(value="标签管理-表头中英文切换", notes="标签管理-表头中英文切换")
@GetMapping(value = "/getHeader")
public Result<List<Map<String, Object>>> getHeader(@RequestParam(name = "flag") String flag,
@RequestParam(name = "cut") String cut) {
List<Map<String, Object>> list =onlCgformCollectionService.queryCondition(flag, cut);
return Result.OK(list);
}
*/
/**
* 查询条件中英文切换
*
* @return
*/
/*
@AutoLog(value = "OCR识别转换记录表-查询条件中英文切换")
@ApiOperation(value="OCR识别转换记录表-查询条件中英文切换", notes="OCR识别转换记录表-查询条件中英文切换")
@GetMapping(value = "/queryCondition")
public Result<List<Map<String, Object>>> queryCondition(@RequestParam(name = "flag") String flag,
@RequestParam(name = "cut") String cut) {
List<Map<String, Object>> list = onlCgformCollectionService.queryCondition(flag, cut);
return Result.OK(list);
}
*/
/**
* 列表查询
*
@@ -178,7 +135,6 @@ public class OnlCgformCollectionController extends JeroController<OnlCgformColle
return Result.OK(onlCgformCollection);
}
/**
* 表头中英文切换
*
@@ -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);
}
@@ -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>
@@ -193,4 +193,5 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
String verifyBind(List<String> ids);
List<Map<String,Object>> queryListByIds(String ids);
}
@@ -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.*;
@@ -722,13 +721,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
public List<Map<String, Object>> getInfoById(String id, String cut) {
//通过id查询数据
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMapsAll(id);
List<Map<String, Object>> result = new ArrayList<>(); // 要返回的结果
if (dataList.isEmpty()){
// 取不到数据,直接返回空结果
return result;
}
//查询所有
List<Map<String, Object>> mapList = bussDocumentLibraryEOMapper.selectMapsAll(null);
//原始对应标准,代替标准,被代替标准(原始数据存的是iD)
String correspondingStandardId = "";
String replaceStandardId = "";//代替标准
if (dataList.size() != 0) {
if (!dataList.isEmpty()) {
correspondingStandardId = (String) dataList.get(0).get("corresponding_standard");//对应标准
replaceStandardId = (String) dataList.get(0).get("replace_standard");//代替标准
}
@@ -887,7 +893,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//过滤出表单字段(is_show_form-->表单是否显示0否 1是)
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
}
List<Map<String, Object>> result = new ArrayList<>();
for (OnlCgformArea onlCgformAreaTemp : areaList) {
String areaName = "";
if (CutEnum.CN.getValue().equals(cut)) {
@@ -1139,44 +1145,47 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//es全文新增数据(数据转换)
esFullText(cut, fieldList, categoryList, dictItemList, mapList, sbCn,sbEn, entry);
//处理日期格式
if (fieldDateList.contains(key)) {
if (ObjectUtils.isNotEmpty(value)) {
value = "str_to_date('" + value + "','%Y-%m-%d %H:%i:%s')";
} else {
value = null;
}
valuesBuilder.append("," + value);
} else {
//处理文件类型
List<OnlCgformField> fieldFile = null;
try {
fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
}
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
String valueTemp = UUID.randomUUID().toString().replace("-", "");
stringObjectMap.put(key,valueTemp);
// value = valueTemp;
//修改文件表关联信息connect_id
List<OSSFile> oSSFileList = new ArrayList<>();
for (String fileId : value.toString().split(",")) {
OSSFile ossFile = new OSSFile();
ossFile.setId(fileId);
ossFile.setConnectId(valueTemp);
oSSFileList.add(ossFile);
if (ObjectUtils.isNotEmpty(value)) {
//处理日期格式
if (fieldDateList.contains(key)) {
if (ObjectUtils.isNotEmpty(value)) {
value = "str_to_date('" + value + "','%Y-%m-%d %H:%i:%s')";
} else {
value = null;
}
if (oSSFileList.size() != 0) {
oSSFileAll.addAll(oSSFileList);
}
iOSSFileService.updateFileInfo(oSSFileList);
valuesBuilder.append("," + "'" + valueTemp + "'");
valuesBuilder.append("," + value);
} else {
valuesBuilder.append("," + "'" + value + "'");
//处理文件类型
List<OnlCgformField> fieldFile = null;
try {
fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
}
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
String valueTemp = UUID.randomUUID().toString().replace("-", "");
stringObjectMap.put(key,valueTemp);
// value = valueTemp;
//修改文件表关联信息connect_id
List<OSSFile> oSSFileList = new ArrayList<>();
for (String fileId : value.toString().split(",")) {
OSSFile ossFile = new OSSFile();
ossFile.setId(fileId);
ossFile.setConnectId(valueTemp);
oSSFileList.add(ossFile);
}
if (oSSFileList.size() != 0) {
oSSFileAll.addAll(oSSFileList);
}
iOSSFileService.updateFileInfo(oSSFileList);
valuesBuilder.append("," + "'" + valueTemp + "'");
} else {
valuesBuilder.append("," + "'" + value + "'");
}
}
fieldsBuilder.append("," + key);
}
fieldsBuilder.append("," + key);
}
} catch (Exception e) {
e.printStackTrace();
@@ -2413,7 +2422,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
public IPage getInfoPage(Map<String, Object> parameter) {
String cut = (String) parameter.get("cut");//中英文切换标识
//需要查询的字段
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.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());
@@ -4105,6 +4114,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,
@@ -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;
@@ -92,7 +92,8 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
Result<OnlCgformTag> result=new Result<>();
//校验--不能向数据库添加重复数据
QueryWrapper<OnlCgformTag> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("db_field_txt",onlCgformTag.getDbFieldTxt());
//查询同一模块下,同名数据
queryWrapper.eq("db_field_txt",onlCgformTag.getDbFieldTxt()).eq("is_model",onlCgformTag.getIsModel());
List<OnlCgformTag> existCgformTagList = this.onlCgformTagService.list(queryWrapper);
if(!existCgformTagList.isEmpty()){
@@ -111,20 +112,20 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
this.onlCgformTagService.add(onlCgformTag);
}
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL)) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID), "normal");
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID.getValue()), "normal");
}else {//同步文档拆分
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_IS_MODEL), "normal");
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_ID.getValue()), "normal");
}
}else{
throw new JeroBootException("属性已存在,请检查");
}
}else {
onlCgformTagService.add(onlCgformTag);
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL)) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID), "normal");
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID.getValue()), "normal");
}else {//同步文档拆分
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_IS_MODEL), "normal");
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_ID.getValue()), "normal");
}
return result.success("添加成功!");
}
@@ -146,15 +147,16 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
return Result.error("固定字段,不可修改");
}else {
QueryWrapper<OnlCgformTag> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("db_Field_txt",onlCgformTag.getDbFieldTxt());
//查询同一模块下,同名数据
queryWrapper.eq("db_Field_txt",onlCgformTag.getDbFieldTxt()).eq("is_model",onlCgformTag.getIsModel());
List<OnlCgformTag> existCgformTagList=onlCgformTagService.list(queryWrapper);
if(!existCgformTagList.isEmpty()){//有同名数据
if(existCgformTagList.get(0).getId().equals(onlCgformTag.getId())){//已存在同名的数据,就是正在编辑的这个
onlCgformTagService.editById(onlCgformTag);
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL)) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID), "normal");
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID.getValue()), "normal");
}else {//同步文档拆分
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_IS_MODEL), "normal");
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_ID.getValue()), "normal");
}
}else{//已存在同名的数据,不是正在编辑的这个
@@ -163,10 +165,10 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
onlCgformTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_0,onlCgformTagDB.getId());
onlCgformTag.setId(onlCgformTagDB.getId());
onlCgformTagService.editById(onlCgformTag);
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL)) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID), "normal");
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID.getValue()), "normal");
}else {//同步文档拆分
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_IS_MODEL), "normal");
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_ID.getValue()), "normal");
}
}else {//有未删数据,报错
return Result.error("属性已存在,请检查");
@@ -174,10 +176,10 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
}
}else{
onlCgformTagService.editById(onlCgformTag);
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL)) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID), "normal");
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//同步文档库
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID.getValue()), "normal");
}else {//同步文档拆分
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_IS_MODEL), "normal");
this.onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_SPLIT_ID.getValue()), "normal");
}
}
return Result.OK("编辑成功!");
@@ -33,23 +33,19 @@ public class OnlCgformTag implements Serializable {
private java.lang.String id;
/**创建人*/
@Dict(dictTable = "onl_cgform_field", dicText = "create_by", dicCode = "create_by")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
//@Dict(dictTable = "onl_cgform_field", dicText = "create_time", dicCode = "create_time")
private java.util.Date createTime;
/**更新人*/
@Dict(dictTable = "onl_cgform_field", dicText = "update_by", dicCode = "update_by")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
//@Dict(dictTable = "onl_cgform_field", dicText = "update_time", dicCode = "update_time")
private java.util.Date updateTime;
/**所属部门*/
@@ -57,7 +53,6 @@ public class OnlCgformTag implements Serializable {
private java.lang.String sysOrgCode;
/**文档库-表id*/
// @Dict(dictTable = "onl_cgform_field", dicText = "cgform_head_id", dicCode = "cgform_head_id")
private java.lang.String cgformHeadId;
/**所属模块(1文档库,0文档拆分)*/
@@ -65,11 +60,9 @@ public class OnlCgformTag implements Serializable {
private java.lang.String isModel;
/**属性名称*/
//@Dict(dictTable = "onl_cgform_field", dicText = "db_field_txt", dicCode = "db_field_txt")
private java.lang.String dbFieldTxt;
/**字段英文名称描述*/
// @Dict(dictTable = "onl_cgform_field", dicText = "db_field_en_name", dicCode = "db_field_en_name")
private java.lang.String dbFieldEnName;
/**属性类型*/
@@ -86,43 +79,33 @@ public class OnlCgformTag implements Serializable {
private java.lang.String fieldShowTypeEnName;
/**字典id*/
//@Dict(dictTable = "onl_cgform_field", dicText = "dict_id", dicCode = "dict_id")
private java.lang.String dictId;
/**字典Code*/
//@Dict(dictTable = "onl_cgform_field", dicText = "dict_field", dicCode = "dict_field")
private java.lang.String dictField;
/**字典表*/
//@Dict(dictTable = "onl_cgform_field", dicText = "dict_table", dicCode = "dict_table")
private java.lang.String dictTable;
/**字典Text*/
// @Dict(dictTable = "onl_cgform_field", dicText = "dict_text", dicCode = "dict_text")
private java.lang.String dictText;
/**数据库字段长度*/
// @Dict(dictTable = "onl_cgform_field", dicText = "db_length", dicCode = "db_length")
private java.lang.Integer dbLength;
/**排序*/
// @Dict(dictTable = "onl_cgform_field", dicText = "order_num", dicCode = "order_num")
private java.lang.Integer orderNum;
/**字段是否必填0否 1是*/
// @Dict(dictTable = "onl_cgform_field", dicText = "field_must_input", dicCode = "field_must_input")
private java.lang.String fieldMustInput;
/**表单是否显示0否 1是*/
// @Dict(dictTable = "onl_cgform_field", dicText = "is_show_form", dicCode = "is_show_form")
private java.lang.Integer isShowForm;
/**列表是否显示0否 1是*/
// @Dict(dictTable = "onl_cgform_field", dicText = "is_show_list", dicCode = "is_show_list")
private java.lang.Integer isShowList;
/**是否是只读(2字段固定,内部可配1固定字段 0非固定字段)*/
// @Dict(dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
private java.lang.Integer isReadOnly;
/**展示区域id*/
@@ -140,39 +123,30 @@ public class OnlCgformTag implements Serializable {
private java.lang.String showAreaEnName;
/**是否查询条件0否 1是*/
// @Dict(dictTable = "onl_cgform_field", dicText = "is_query", dicCode = "is_query")
private java.lang.Integer isQuery;
/**法规清单是否展示0否 1是*/
// @Dict(dictTable = "onl_cgform_field", dicText = "is_show_laws_list", dicCode = "is_show_laws_list")
private java.lang.Integer isShowLawsList;
/**搜索中心是否展示0否 1是*/
//@Dict(dictTable = "onl_cgform_field", dicText = "is_show_search", dicCode = "is_show_search")
private java.lang.Integer isShowSearch;
/**逻辑删除标识 0未删 1已删*/
// @Dict(dictTable = "onl_cgform_field", dicText = "is_delete", dicCode = "is_delete")
private Integer isDelete;
/**字段名字*/
//@Dict(dictTable = "onl_cgform_field", dicText = "db_field_name", dicCode = "db_field_name")
private String dbFieldName;
/**是否主键 0否 1是*/
// @Dict(dictTable = "onl_cgform_field", dicText = "db_is_key", dicCode = "db_is_key")
private Integer dbIsKey;
/**是否允许为空 0否 1是*/
//@Dict(dictTable = "onl_cgform_field", dicText = "db_is_null", dicCode = "db_is_null")
private Integer dbIsNull;
/**小数点*/
// @Dict(dictTable = "onl_cgform_field", dicText = "db_point_length", dicCode = "db_point_length")
private Integer dbPointLength;
/**数据库字段类型*/
//@Dict(dictTable = "onl_cgform_field", dicText = "db_type", dicCode = "db_type")
private String dbType;
public OnlCgformTag() {
@@ -80,7 +80,7 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
}
}
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL)) {//设置文档库-表id
if(onlCgformTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//设置文档库-表id
onlCgformTag.setCgformHeadId(FileTableIdEnum.FILE_TABLE_ID.getValue());
}else {//设置文档拆分-表id
onlCgformTag.setCgformHeadId(FileTableIdEnum.FILE_SPLIT_ID.getValue());
@@ -148,7 +148,6 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
}
}
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
onlCgformTag.setCgformHeadId(FileTableIdEnum.FILE_TABLE_ID.getValue());//设置文档库-表id
onlCgformTag.setDbIsKey(Integer.valueOf(YesOrNoEnum.NO.getValue()));
onlCgformTag.setDbIsNull(Integer.valueOf(YesOrNoEnum.YES.getValue()));
onlCgformTag.setDbPointLength(0); //默认为0