文档拆分条款
This commit is contained in:
+1
@@ -9,6 +9,7 @@ public enum ModuleEnum {
|
||||
DOCUMENT_LIBRARY("文档管理","1"),
|
||||
OCR_RECORD("OCR识别转换记录表","2"),
|
||||
FILE_SPLIT("文档拆分","3"),
|
||||
FILE_SPLIT_ITEMS("文档拆分条款","4"),
|
||||
ONL_CGFORM_COLLECTION("我的收藏","5"),
|
||||
ONL_CGFORM_SUBSCRIBE("我的订阅","6");
|
||||
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ public enum TableEnum {
|
||||
BUSS_DOCUMENT_LIBRARY("buss_document_library"),
|
||||
OCR_RECORD("ocr_record"),
|
||||
FILE_SPLIT("sar_file_split_info"),
|
||||
FILE_SPLIT_ITEMS("sar_file_split_items"),
|
||||
TAG("onl_cgform_tag"),
|
||||
TAG_AREA("onl_cgform_area"),
|
||||
ONL_CGFORM_COLLECTION("onl_cgform_collection"),
|
||||
|
||||
+2
@@ -820,6 +820,8 @@ public class OnlCgformFieldServiceImpl extends ServiceImpl<OnlCgformFieldMapper,
|
||||
fieldList = onlCgformFieldMapper.getFieldList(TableEnum.OCR_RECORD.getTable());
|
||||
} else if (ModuleEnum.FILE_SPLIT.getValue().equals(flag)) {
|
||||
fieldList = onlCgformFieldMapper.getFieldList(TableEnum.FILE_SPLIT.getTable());
|
||||
} else if (ModuleEnum.FILE_SPLIT_ITEMS.getValue().equals(flag)) {
|
||||
fieldList = onlCgformFieldMapper.getFieldList(TableEnum.FILE_SPLIT_ITEMS.getTable());
|
||||
} else if (ModuleEnum.ONL_CGFORM_COLLECTION.getValue().equals(flag)) {
|
||||
fieldList = onlCgformFieldMapper.getFieldList(TableEnum.ONL_CGFORM_COLLECTION.getTable());
|
||||
} else if (ModuleEnum.ONL_CGFORM_SUBSCRIBE.getValue().equals(flag)) {
|
||||
|
||||
+15
@@ -246,6 +246,21 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysCategoryTreeVO> getSysCategoryTreeByCut(String cut) {
|
||||
try {
|
||||
List<SysCategory> list = super.baseMapper.selectList(new QueryWrapper<>());
|
||||
List<SysCategoryTreeVO> tree = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
tree = TreeUtils.getSysCategoryTreeByCut(list, cut);
|
||||
}
|
||||
return tree;
|
||||
}catch (Exception ex){
|
||||
log.error("查询树形结构失败: " + ex.getMessage());
|
||||
throw new JeroBootException("查询树形结构失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDictDelFlag(int delFlag, String id) {
|
||||
baseMapper.updateDictDelFlag(delFlag,id);
|
||||
|
||||
+23
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.system.util;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysCategoryTreeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -37,6 +38,28 @@ public class TreeUtils {
|
||||
return sysCategoryTreeVOList;
|
||||
}
|
||||
|
||||
public static List<SysCategoryTreeVO> getSysCategoryTreeByCut(List<SysCategory> sysCategoryList, String cut) {
|
||||
List<SysCategoryTreeVO> sysCategoryTreeVOList = new LinkedList();
|
||||
for (SysCategory sysCategory : sysCategoryList) {
|
||||
if (TREE_ROOT_CODE.equals(sysCategory.getPid())) {
|
||||
SysCategoryTreeVO sysCategoryTreeVO = new SysCategoryTreeVO();
|
||||
sysCategoryTreeVO.setId(sysCategory.getId());
|
||||
sysCategoryTreeVO.setKey(sysCategory.getId());
|
||||
sysCategoryTreeVO.setValue(sysCategory.getId());
|
||||
sysCategoryTreeVO.setDictId(sysCategory.getSysDictId());
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
sysCategoryTreeVO.setTitle(sysCategory.getName());
|
||||
} else if (CutEnum.EN.getValue().equals(cut)) {
|
||||
sysCategoryTreeVO.setTitle(sysCategory.getEnName());
|
||||
}
|
||||
sysCategoryTreeVO.setParentId(sysCategory.getPid());
|
||||
sysCategoryTreeVO.setChildren(getSysCategoryTreeChild(sysCategory.getId(), sysCategoryList));
|
||||
sysCategoryTreeVOList.add(sysCategoryTreeVO);
|
||||
}
|
||||
}
|
||||
return sysCategoryTreeVOList;
|
||||
}
|
||||
|
||||
private static List<SysCategoryTreeVO> getSysCategoryTreeChild(String id, List<SysCategory> sysCategoryList) {
|
||||
List<SysCategoryTreeVO> childrenList = new LinkedList();
|
||||
for (SysCategory sysCategory : sysCategoryList) {
|
||||
|
||||
+14
@@ -55,4 +55,18 @@ public class LanguageSwitchController {
|
||||
List<Map<String, Object>> list = languageSwitchService.queryCondition(flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
/**
|
||||
* 表单中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "表单中英文切换")
|
||||
@ApiOperation(value="表单中英文切换", notes="表单中英文切换")
|
||||
@GetMapping(value = "/getForm")
|
||||
public Result<List<Map<String, Object>>> getForm(@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list = languageSwitchService.getForm(flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -25,4 +25,12 @@ public interface ILanguageSwitchService {
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> queryCondition(String flag, String cut);
|
||||
|
||||
/**
|
||||
* 表单中英文切换
|
||||
* @param flag
|
||||
* @param cut
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getForm(String flag, String cut);
|
||||
}
|
||||
|
||||
+72
-6
@@ -1,12 +1,15 @@
|
||||
package com.jero.modules.lanswitch.service.impl;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
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.lanswitch.service.ILanguageSwitchService;
|
||||
import com.jero.modules.ocr.util.LineHumpUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import com.jero.modules.system.entity.SysCategoryTreeVO;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -26,6 +29,9 @@ public class LanguageSwitchServiceImpl implements ILanguageSwitchService {
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
|
||||
@Autowired
|
||||
private SysCategoryServiceImpl sysCategoryService;
|
||||
|
||||
/**
|
||||
* 列表表头中英文切换
|
||||
*
|
||||
@@ -54,10 +60,10 @@ public class LanguageSwitchServiceImpl implements ILanguageSwitchService {
|
||||
}
|
||||
|
||||
String dbFieldName = onlCgformField.getDbFieldName();
|
||||
if (StringUtils.isNotBlank(onlCgformField.getDictField())) {
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName)+ "_dictText");//配置了数据字典的字段,需要特殊处理
|
||||
}else{
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));//字段
|
||||
if (ModuleEnum.FILE_SPLIT_ITEMS.getValue().equals(flag)) {
|
||||
map.put("db_field_name", dbFieldName);
|
||||
} else {
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));
|
||||
}
|
||||
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
@@ -82,12 +88,72 @@ public class LanguageSwitchServiceImpl implements ILanguageSwitchService {
|
||||
//过滤出搜索条件()
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsQuery()))).collect(Collectors.toList());
|
||||
}
|
||||
//树形数据字典
|
||||
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTreeByCut(cut); // 查询所有 并以树结构返回
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : fieldList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
if (FieldTypeEnum.TREE.getValue().equals(onlCgformField.getFieldShowType())) {
|
||||
List<SysCategoryTreeVO> sysCategoryTreeVOList = sysCategoryTree.stream()
|
||||
.filter(e -> onlCgformField.getDictId().equals(e.getDictId()))
|
||||
.collect(Collectors.toList());
|
||||
map.put("tree", sysCategoryTreeVOList); // 树形结构字段 设置树形结构字段值
|
||||
} else {
|
||||
map.put("tree", new ArrayList<>()); // 其他类型字段 该key为空
|
||||
}
|
||||
|
||||
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
|
||||
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
|
||||
if (ModuleEnum.FILE_SPLIT_ITEMS.getValue().equals(flag)) {
|
||||
map.put("db_field_name", onlCgformField.getDbFieldName());//字段
|
||||
} else {
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
|
||||
}
|
||||
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
|
||||
} else {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
|
||||
}
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getForm(String flag, String cut) {
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(flag);
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤出搜索条件()
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
}
|
||||
//树形数据字典
|
||||
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTreeByCut(cut); // 查询所有 并以树结构返回
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : fieldList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (FieldTypeEnum.TREE.getValue().equals(onlCgformField.getFieldShowType())) {
|
||||
List<SysCategoryTreeVO> sysCategoryTreeVOList = sysCategoryTree.stream()
|
||||
.filter(e -> onlCgformField.getDictId().equals(e.getDictId()))
|
||||
.collect(Collectors.toList());
|
||||
map.put("tree", sysCategoryTreeVOList); // 树形结构字段 设置树形结构字段值
|
||||
} else {
|
||||
map.put("tree", new ArrayList<>()); // 其他类型字段 该key为空
|
||||
}
|
||||
|
||||
map.put("area", null);//展示区域。没用到
|
||||
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
|
||||
map.put("field_must_input", onlCgformField.getFieldMustInput());//是否必填
|
||||
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
|
||||
if (ModuleEnum.FILE_SPLIT_ITEMS.getValue().equals(flag)) {
|
||||
map.put("db_field_name", onlCgformField.getDbFieldName());//字段
|
||||
} else {
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
|
||||
}
|
||||
map.put("db_length", onlCgformField.getDbLength());//字段长度
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
|
||||
} else {
|
||||
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.jero.modules.split.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||
import com.jero.modules.split.service.IFileSplitItemsEOService;
|
||||
import com.jero.modules.split.service.impl.FileSplitItemsEOServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 17:59 2022/3/27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/split/sarFileSplitItems")
|
||||
@Api(tags = "文档拆分条款信息")
|
||||
public class FileSplitItemsEOController extends JeroController<SarFileSplitItemsEO, IFileSplitItemsEOService> {
|
||||
@Autowired
|
||||
private FileSplitItemsEOServiceImpl fileSplitItemsEOService;
|
||||
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@PostMapping("/getSplitItemsByPage")
|
||||
public Result<IPage> page(@RequestBody Map<String, Object> parameter) throws Exception {
|
||||
IPage infoPage = fileSplitItemsEOService.getInfoPage(parameter);
|
||||
return Result.OK(infoPage);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增")
|
||||
@PostMapping("/addSplitItems")
|
||||
public Result<?> addSplitItems(@RequestBody Map<String, Object> parameter) {
|
||||
List<SarFileSplitItemsValEO> itemValEOList = (List<SarFileSplitItemsValEO>) parameter.get("itemValEOList");
|
||||
if(CollectionUtils.isNotEmpty(itemValEOList)) {
|
||||
List<SarFileSplitItemsValEO> itemValEOListNew = new ArrayList<>();
|
||||
for (SarFileSplitItemsValEO itemsValEO : itemValEOList) {
|
||||
itemsValEO.setItemContent(StringEscapeUtils.unescapeHtml4(itemsValEO.getItemContent()));
|
||||
itemValEOListNew.add(itemsValEO);
|
||||
}
|
||||
parameter.put("itemValEOList",itemValEOListNew);
|
||||
}
|
||||
int resultCount = fileSplitItemsEOService.addItemContent(parameter);
|
||||
if (resultCount > 0) {
|
||||
return Result.OK("新增成功", parameter);
|
||||
} else {
|
||||
return Result.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑")
|
||||
@PostMapping("/updateSplitItems")
|
||||
public Result<?> updateSplitItems(@RequestBody Map<String, Object> parameter) {
|
||||
List<SarFileSplitItemsValEO> itemValEOList = (List<SarFileSplitItemsValEO>) parameter.get("itemValEOList");
|
||||
if(CollectionUtils.isNotEmpty(itemValEOList)) {
|
||||
List<SarFileSplitItemsValEO> itemValEOListNew = new ArrayList<>();
|
||||
for (SarFileSplitItemsValEO itemsValEO : itemValEOList) {
|
||||
itemsValEO.setItemContent(StringEscapeUtils.unescapeHtml4(itemsValEO.getItemContent()));
|
||||
itemValEOListNew.add(itemsValEO);
|
||||
}
|
||||
parameter.put("itemValEOList",itemValEOListNew);
|
||||
}
|
||||
int resultCount = fileSplitItemsEOService.updateItemContent(parameter);
|
||||
if (resultCount > 0) {
|
||||
return Result.OK("修改成功",parameter);
|
||||
} else {
|
||||
return Result.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
@PostMapping("/batchDeleteItems")
|
||||
public Result batchDeleteItems(String ids) {
|
||||
if (StringUtils.isNotEmpty(ids)) {
|
||||
int result = fileSplitItemsEOService.batchDeleteItems(ids);
|
||||
if (result > 0) {
|
||||
return Result.OK("删除成功",null);
|
||||
} else {
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
} else {
|
||||
return Result.error("请选择要删除的数据");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文档拆分条款信息-判断包含子节点Y")
|
||||
@GetMapping("/judgeContaintChilds")
|
||||
/*@RequiresPermissions("lawss:sarMenu:judgequeryMenuByPid")*/
|
||||
public Result<Map<String, Object>> judgeContaintChilds(String ids) {
|
||||
Map<String, Object> result = fileSplitItemsEOService.judgeContaintChilds(ids);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -59,8 +59,8 @@ import java.util.*;
|
||||
import static com.jero.modules.split.util.ExcelUtil.checkObjAllFieldsIsNull;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/split/sarFileSplitItems")
|
||||
@Api(tags = "文档拆分条款信息")
|
||||
@RequestMapping("/split/fileSplitItems")
|
||||
@Api(tags = "条款信息-备用")
|
||||
public class SarFileSplitItemsEOController extends JeroController<SarFileSplitItemsEO, ISarFileSplitItemsEOService> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarFileSplitItemsEOController.class);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class SarFileSplitItemsValEOController extends JeroController<SarFileSpli
|
||||
// return Result.OK(pageList);
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "文档拆分条目信息-查询")
|
||||
@ApiOperation(value = "文档拆分条目信息-查询Y")
|
||||
@GetMapping("/getItemsValList")
|
||||
// @RequiresPermissions("lawss:sarFileSplitItemsVal:list")
|
||||
public Result<List<SarFileSplitItemsValEO>> list(SarFileSplitItemsValEOPage page) throws Exception {
|
||||
|
||||
+18
-18
@@ -3,10 +3,10 @@ package com.jero.modules.split.controller;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.split.entity.DrageMenuEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.mapper.SarFileSplitItemsEOMapper;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.IFileSplitItemsEOService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -16,9 +16,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/split/sarFileSplitMenu")
|
||||
@@ -33,6 +31,9 @@ public class SarFileSplitMenuEOController extends JeroController<SarFileSplitMen
|
||||
@Autowired
|
||||
private SarFileSplitItemsEOMapper sarFileSplitItemsEOMapper;
|
||||
|
||||
@Autowired
|
||||
private IFileSplitItemsEOService fileSplitItemsEOService;
|
||||
|
||||
// @ApiOperation(value = "文档拆分条款目录-分页查询")
|
||||
// @GetMapping("/page")
|
||||
// @RequiresPermissions("lawss:sarFileSplitMenu:page")
|
||||
@@ -111,14 +112,14 @@ public class SarFileSplitMenuEOController extends JeroController<SarFileSplitMen
|
||||
|
||||
@ApiOperation(value = "文档拆分条款目录-复制节点不包括子节点")
|
||||
@PostMapping("/copyMenuNotChildren")
|
||||
public Result copyMenuNotChildren(@RequestBody SarFileSplitItemsEO sarFileSplitItemsEO) throws Exception {
|
||||
int result = sarFileSplitMenuEOService.copyMenuNotChildren(sarFileSplitItemsEO);
|
||||
return Result.OK("复制成功",sarFileSplitItemsEO);
|
||||
public Result copyMenuNotChildren(@RequestBody Map<String, Object> itemsMap) throws Exception {
|
||||
int result = sarFileSplitMenuEOService.copyMenuNotChildren(itemsMap);
|
||||
return Result.OK("复制成功",itemsMap);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文档拆分条款目录-批量复制节点不包括子节点Y")
|
||||
@PostMapping("/copyMenuNotChildrenall")
|
||||
public Result<List<SarFileSplitItemsEO>> copyMenuNotChildrenall(@RequestParam(value = "ids",required = false) String ids,
|
||||
public Result<List<Map<String, Object>>> copyMenuNotChildrenall(@RequestParam(value = "ids",required = false) String ids,
|
||||
@RequestParam(value = "menuids",required = false) String menuids,
|
||||
@RequestParam(value = "infoIds",required = false) String infoIds) throws Exception {
|
||||
/*int result = sarFileSplitMenuEOService.copyMenuNotChildren(sarFileSplitItemsEO);
|
||||
@@ -131,22 +132,21 @@ public class SarFileSplitMenuEOController extends JeroController<SarFileSplitMen
|
||||
List<String> menuidslist =new ArrayList<>();
|
||||
menuidslist = Arrays.asList(menuidss);
|
||||
|
||||
|
||||
String infoIdss[] = infoIds.split(",");
|
||||
List<String> infoIdslist =new ArrayList<>();
|
||||
infoIdslist = Arrays.asList(infoIdss);
|
||||
List<SarFileSplitItemsEO> sarFileSplitItemsEOS = new ArrayList<>();
|
||||
List<Map<String, Object>> itemsMapList = new ArrayList<>();
|
||||
for(int i=0;i<idlist.size();i++){
|
||||
SarFileSplitItemsEO sarFileSplitItemsEO = new SarFileSplitItemsEO();
|
||||
sarFileSplitItemsEO.setId(idlist.get(i));
|
||||
sarFileSplitItemsEO.setMenuId(menuidslist.get(i));
|
||||
sarFileSplitItemsEO.setInfoId(infoIdslist.get(i));
|
||||
int result = sarFileSplitMenuEOService.copyMenuNotChildren(sarFileSplitItemsEO);
|
||||
Map<String, Object> itemsMap = new HashMap<>();
|
||||
itemsMap.put("id", idlist.get(i));
|
||||
itemsMap.put("menu_id", menuidslist.get(i));
|
||||
itemsMap.put("info_id", infoIdslist.get(i));
|
||||
int result = sarFileSplitMenuEOService.copyMenuNotChildren(itemsMap);
|
||||
// 同时复制目录下的条款
|
||||
sarFileSplitItemsEO = sarFileSplitItemsEOMapper.selectByPrimaryKey(sarFileSplitItemsEO.getId());
|
||||
sarFileSplitItemsEOS.add(sarFileSplitItemsEO);
|
||||
itemsMap = fileSplitItemsEOService.selectByPrimaryKey(idlist.get(i));
|
||||
itemsMapList.add(itemsMap);
|
||||
}
|
||||
|
||||
return Result.OK("复制成功",sarFileSplitItemsEOS);
|
||||
return Result.OK("复制成功",itemsMapList);
|
||||
}
|
||||
}
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.jero.modules.split.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description: 文档拆分条款表
|
||||
* @Date: Created in 9:40 2022/3/24
|
||||
*/
|
||||
public interface FileSplitItemsEOMapper extends BaseMapper<SarFileSplitItemsEO> {
|
||||
|
||||
int insertInfo(@Param("insertField") String insertField,
|
||||
@Param("insertValue") String insertValue);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param field
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
IPage getInfoPage(@Param("page") IPage page,
|
||||
@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param
|
||||
* @param field
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getInfoList(@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> selectByPrimaryKey(String value);
|
||||
|
||||
int deleteByPrimaryKey(String value);
|
||||
|
||||
List<Map<String, Object>> queryByItemsIds(@Param("idList") List<String> idList);
|
||||
|
||||
List<Map<String, Object>> queryItemsByMenuId(@Param("menuId") String menuId);
|
||||
|
||||
int deleteByItemsIdList(@Param("idList") List<String> idList);
|
||||
}
|
||||
+3
-1
@@ -27,7 +27,7 @@ public interface SarFileSplitMenuEOMapper extends BaseMapper<SarFileSplitMenuEO>
|
||||
|
||||
List<SarFileSplitMenuEO> queryByPidExcpetSelf(SarFileSplitMenuEO sarFileSplitMenuEO);
|
||||
|
||||
int deleteByPId(@Param("id") String id);
|
||||
int deleteByPId(@Param("idList") List<String> idList);
|
||||
|
||||
int getMaxDisplayByid(@Param("id") String id);
|
||||
|
||||
@@ -67,4 +67,6 @@ public interface SarFileSplitMenuEOMapper extends BaseMapper<SarFileSplitMenuEO>
|
||||
int queryByCount(SarFileSplitMenuEOPage page);
|
||||
|
||||
List<SarFileSplitMenuEO> queryByPage(SarFileSplitMenuEOPage page);
|
||||
|
||||
List<String> getAllChildrenId(String menuId);
|
||||
}
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.split.mapper.FileSplitItemsEOMapper">
|
||||
|
||||
<!--新增-->
|
||||
<insert id="insertInfo">
|
||||
insert into sar_file_split_items(${insertField})
|
||||
values (${insertValue})
|
||||
</insert>
|
||||
|
||||
<!--分页-->
|
||||
<select id="getInfoPage" resultType="java.util.LinkedHashMap">
|
||||
select ${field}
|
||||
from sar_file_split_items left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
${condition}
|
||||
</select>
|
||||
|
||||
<!--列表-->
|
||||
<select id="getInfoList" resultType="java.util.LinkedHashMap">
|
||||
select ${field}
|
||||
from sar_file_split_items
|
||||
${condition}
|
||||
</select>
|
||||
|
||||
<!--根据id查询-->
|
||||
<select id="selectByPrimaryKey" resultType="java.util.LinkedHashMap">
|
||||
select *
|
||||
from sar_file_split_items
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from sar_file_split_items
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<!-- 通过menuid 查询目录下所有的条目 -->
|
||||
<select id="queryItemsByMenuId" resultType="java.util.LinkedHashMap" parameterType="java.lang.String">
|
||||
select SAR_FILE_SPLIT_ITEMS.* from SAR_FILE_SPLIT_ITEMS
|
||||
left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
where SAR_FILE_SPLIT_ITEMS.menu_id in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND m.valid_flag = '0'
|
||||
)
|
||||
order by SAR_FILE_SPLIT_MENU.display_seq asc
|
||||
</select>
|
||||
|
||||
<select id="queryByItemsIds" resultType="java.util.LinkedHashMap" parameterType="java.util.List">
|
||||
select menu_id from SAR_FILE_SPLIT_ITEMS
|
||||
where id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
group by menu_id
|
||||
</select>
|
||||
|
||||
<delete id="deleteByItemsIdList" parameterType="java.util.List">
|
||||
delete from SAR_FILE_SPLIT_ITEMS
|
||||
where id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+7
-6
@@ -310,7 +310,7 @@
|
||||
<if test="menuId != null">
|
||||
and SAR_FILE_SPLIT_ITEMS.MENU_ID in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{menuId})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -321,12 +321,13 @@
|
||||
<!-- 查询SAR_FILE_SPLIT_ITEMS列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.jero.modules.split.page.SarFileSplitItemsEOPage">
|
||||
select tmp_tb.* from
|
||||
(select <include refid="Base_Column_List" /> from SAR_FILE_SPLIT_ITEMS left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
(select <include refid="Base_Column_List" /> from SAR_FILE_SPLIT_ITEMS
|
||||
left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="menuId != null">
|
||||
and SAR_FILE_SPLIT_ITEMS.MENU_ID in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{menuId})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -344,7 +345,7 @@
|
||||
<if test="menuId != null">
|
||||
and SAR_FILE_SPLIT_ITEMS.MENU_ID in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{menuId})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -416,7 +417,7 @@
|
||||
left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
where SAR_FILE_SPLIT_ITEMS.valid_flag = '0' and menu_id in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{menuId})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -451,7 +452,7 @@
|
||||
<if test="menuId != null">
|
||||
and SAR_FILE_SPLIT_ITEMS.MENU_ID in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{menuId})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
|
||||
+12
-14
@@ -262,27 +262,24 @@
|
||||
|
||||
<select id="queryByPidExcpetSelf" resultMap="BaseResultMap" parameterType="com.jero.modules.split.entity.SarFileSplitMenuEO">
|
||||
select m.*
|
||||
from SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
from SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
AND id != #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPId" parameterType="java.lang.String">
|
||||
delete from SAR_FILE_SPLIT_MENU where id in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
)
|
||||
<delete id="deleteByPId" parameterType="java.util.List">
|
||||
delete from SAR_FILE_SPLIT_MENU where id in
|
||||
<foreach collection="idList" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</delete>
|
||||
|
||||
<select id="getMaxDisplayByid" resultType="java.lang.Integer" parameterType="com.jero.modules.split.common.BasePage">
|
||||
SELECT max(m.DISPLAY_SEQ)
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -295,7 +292,7 @@
|
||||
|
||||
<select id="getChildrenCountByParentId" resultType="java.lang.Integer" parameterType="com.jero.modules.split.common.BasePage">
|
||||
SELECT count(*)
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -308,7 +305,7 @@
|
||||
modify_user = #{modifyUser}
|
||||
where id in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -322,7 +319,7 @@
|
||||
modify_user = #{modifyUser}
|
||||
where id in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -331,7 +328,7 @@
|
||||
|
||||
<select id="queryAllChildrenByid" resultMap="BaseResultMap" parameterType="com.jero.modules.split.entity.SarFileSplitMenuEO">
|
||||
select m.*
|
||||
from SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querysSplitMenuChildren (#{id})) AS pids ) t
|
||||
from SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{id})) AS pids ) t
|
||||
WHERE
|
||||
FIND_IN_SET( m.id, t.pids )
|
||||
AND valid_flag = '0'
|
||||
@@ -345,4 +342,5 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.jero.modules.split.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 20:39 2022/3/27
|
||||
*/
|
||||
public interface IFileSplitItemsEOService extends IService<SarFileSplitItemsEO> {
|
||||
int addItemContent(Map<String, Object> parameter);
|
||||
|
||||
int updateItemContent(Map<String, Object> parameter);
|
||||
|
||||
int insertInfo(Map<String, Object> parameter, String id);
|
||||
|
||||
IPage getInfoPage(Map<String, Object> parameter);
|
||||
|
||||
int batchDeleteItems(String ids);
|
||||
|
||||
List<Map<String, Object>> queryCondition(String flag, String cut);
|
||||
|
||||
Map<String,Object> judgeContaintChilds(String ids);
|
||||
|
||||
Map<String,Object> selectByPrimaryKey(String id);
|
||||
|
||||
}
|
||||
+2
-1
@@ -7,6 +7,7 @@ import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,7 +32,7 @@ public interface ISarFileSplitMenuEOService extends IService<SarFileSplitMenuEO>
|
||||
|
||||
int copyMenu (SarFileSplitMenuEO sarMenuEO) ;
|
||||
|
||||
int copyMenuNotChildren(SarFileSplitItemsEO sarFileSplitItemsEO) ;
|
||||
int copyMenuNotChildren(Map<String, Object> sarFileSplitItemsEO) ;
|
||||
|
||||
String addMenuForImport(SarFileSplitMenuEO sarFileSplitMenuEO);
|
||||
|
||||
|
||||
+558
@@ -0,0 +1,558 @@
|
||||
package com.jero.modules.split.service.impl;
|
||||
|
||||
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.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
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.split.entity.SarFileSplitItemsEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.mapper.FileSplitItemsEOMapper;
|
||||
import com.jero.modules.split.mapper.SarFileSplitItemsValEOMapper;
|
||||
import com.jero.modules.split.mapper.SarFileSplitMenuEOMapper;
|
||||
import com.jero.modules.split.service.IFileSplitItemsEOService;
|
||||
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.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.UserUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 14:59 2022/3/24
|
||||
*/
|
||||
@Service
|
||||
public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMapper, SarFileSplitItemsEO> implements IFileSplitItemsEOService {
|
||||
@Autowired
|
||||
private FileSplitItemsEOMapper dao;
|
||||
|
||||
@Autowired
|
||||
private SarFileSplitMenuEOMapper sarFileSplitMenuEOMapper;
|
||||
|
||||
@Autowired
|
||||
private SarFileSplitItemsValEOMapper sarFileSplitItemsValEOMapper;
|
||||
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
@Autowired
|
||||
private SysCategoryServiceImpl sysCategoryService;
|
||||
@Autowired
|
||||
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||
|
||||
@Override
|
||||
public int addItemContent(Map<String, Object> parameter){
|
||||
List<SarFileSplitItemsValEO> getValList = (List<SarFileSplitItemsValEO>) parameter.get("itemValEOList");
|
||||
String itemConditions = "";
|
||||
String userId = UserUtils.getUserId();
|
||||
String itemId = UUID.randomUUID().toString().replace("-", "");
|
||||
int resultCount = 0;
|
||||
//添加条款要求内容
|
||||
if (getValList != null && !getValList.isEmpty()) {
|
||||
//向val表更新数据
|
||||
int ind = 1;
|
||||
List<SarFileSplitItemsValEO> addValList = new ArrayList<>();
|
||||
for (SarFileSplitItemsValEO valEO : getValList) {
|
||||
// 当前段内容
|
||||
String valContent = "";
|
||||
if ("TEXT".equals(valEO.getType())) {
|
||||
valContent = "<p>" + valEO.getItemContent() + "</p>";
|
||||
} else if ("IMG".equals(valEO.getType())) {
|
||||
// valContent = "<img class=\'wordImg\' src=\'"+ valEO.getItemContent() +"\'>";
|
||||
valContent = valEO.getItemContent();
|
||||
} else if ("TABLE".equals(valEO.getType())) {
|
||||
valContent = valEO.getItemContent();
|
||||
}
|
||||
itemConditions += valContent;
|
||||
// val表信息
|
||||
valEO.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
valEO.setItemId(itemId);
|
||||
valEO.setDisplaySeq(ind);
|
||||
valEO.setValidFlag(0);
|
||||
valEO.setCreationTime(new Date());
|
||||
valEO.setModifyTime(new Date());
|
||||
valEO.setCreationUser(userId);
|
||||
valEO.setModifyUser(userId);
|
||||
addValList.add(valEO);
|
||||
// sarFileSplitItemsValEODao.insertSelective(valEO);
|
||||
|
||||
ind++;
|
||||
}
|
||||
if (addValList != null && !addValList.isEmpty()) {
|
||||
sarFileSplitItemsValEOMapper.insertForeach(addValList);
|
||||
}
|
||||
parameter.put("iterms_conditions", itemConditions);
|
||||
// saveFileInfo(sarFileSplitItemsEO);
|
||||
}
|
||||
|
||||
resultCount = insertInfo(parameter, itemId);
|
||||
return resultCount;
|
||||
}
|
||||
|
||||
public int updateItemContent(Map<String, Object> parameter) {
|
||||
List<SarFileSplitItemsValEO> getValList = (List<SarFileSplitItemsValEO>) parameter.get("itemValEOList");
|
||||
String itemId = parameter.get("id").toString();
|
||||
String itemConditions = "";
|
||||
String userId = UserUtils.getUserId();
|
||||
int resultCount = 0;
|
||||
|
||||
//修改条款要求内容
|
||||
if (getValList != null && !getValList.isEmpty()) {
|
||||
String delIds = parameter.get("delItemIds").toString();
|
||||
List<String> itemValIds = new ArrayList<>();
|
||||
//删除VAL表前台删掉的条目信息
|
||||
if (com.jero.modules.system.util.StringUtils.isNotEmpty(delIds)) {
|
||||
String[] delArr = delIds.split(",");
|
||||
SarFileSplitItemsValEO delEO = new SarFileSplitItemsValEO();
|
||||
delEO.setIdList(delArr);
|
||||
if (delArr != null && delArr.length > 0) {
|
||||
sarFileSplitItemsValEOMapper.deleteByIds(delEO);
|
||||
//删除table表数据
|
||||
itemValIds = new ArrayList<>(Arrays.asList(delArr));
|
||||
}
|
||||
}
|
||||
//向val表更新数据
|
||||
int ind = 1;
|
||||
List<SarFileSplitItemsValEO> addValList = new ArrayList<>();
|
||||
List<SarFileSplitItemsValEO> updateValList = new ArrayList<>();
|
||||
for (SarFileSplitItemsValEO valEO : getValList) {
|
||||
// 当前段内容
|
||||
String valContent = "";
|
||||
if ("TEXT".equals(valEO.getType())) {
|
||||
valContent = "<p>" + valEO.getItemContent() + "</p>";
|
||||
} else if ("IMG".equals(valEO.getType())) {
|
||||
// valContent = "<img class=\'wordImg\' src=\'"+ valEO.getItemContent() +"\'>";
|
||||
valContent = valEO.getItemContent();
|
||||
} else if ("TABLE".equals(valEO.getType())) {
|
||||
valContent = valEO.getItemContent();
|
||||
}
|
||||
itemConditions += valContent;
|
||||
// val表信息
|
||||
if (com.jero.modules.system.util.StringUtils.isNotEmpty(valEO.getId())) {
|
||||
valEO.setDisplaySeq(ind);
|
||||
valEO.setModifyTime(new Date());
|
||||
valEO.setModifyUser(userId);
|
||||
updateValList.add(valEO);
|
||||
itemValIds.add(valEO.getId());
|
||||
// sarFileSplitItemsValEODao.updateByPrimaryKeySelective(valEO);
|
||||
} else {
|
||||
valEO.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
valEO.setDisplaySeq(ind);
|
||||
valEO.setValidFlag(0);
|
||||
valEO.setCreationTime(new Date());
|
||||
valEO.setModifyTime(new Date());
|
||||
valEO.setCreationUser(userId);
|
||||
valEO.setModifyUser(userId);
|
||||
addValList.add(valEO);
|
||||
// sarFileSplitItemsValEODao.insertSelective(valEO);
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
if (addValList != null && !addValList.isEmpty()) {
|
||||
sarFileSplitItemsValEOMapper.insertForeach(addValList);
|
||||
}
|
||||
if (updateValList != null && !updateValList.isEmpty()) {
|
||||
sarFileSplitItemsValEOMapper.updateForeach(updateValList);
|
||||
}
|
||||
// sarFileSplitItemsTableEODao.deleteByitemValIds(itemValIds);
|
||||
parameter.put("iterms_conditions", itemConditions);
|
||||
// saveFileInfo(sarFileSplitItemsEO);
|
||||
// 先删除 后新增
|
||||
dao.deleteByPrimaryKey(itemId);
|
||||
resultCount = insertInfo(parameter, itemId);
|
||||
} else {
|
||||
// SarFileSplitItemsEO itemsEO = new SarFileSplitItemsEO();
|
||||
// itemsEO.setId(sarFileSplitItemsEO.getId());
|
||||
parameter.put("iterms_conditions", "");
|
||||
// saveFileInfo(sarFileSplitItemsEO);
|
||||
// 先删除 后新增
|
||||
dao.deleteByPrimaryKey(itemId);
|
||||
resultCount = insertInfo(parameter, itemId);
|
||||
// 删除val表全部信息
|
||||
sarFileSplitItemsValEOMapper.deleteByitemId(itemId);
|
||||
}
|
||||
return resultCount;
|
||||
}
|
||||
|
||||
public int insertInfo(Map<String, Object> parameter, String id){
|
||||
StringBuilder fieldsBuilder = new StringBuilder(); // 字段名称
|
||||
StringBuilder valuesBuilder = new StringBuilder(); // 字段值
|
||||
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
fieldsBuilder.append("," + key);
|
||||
}
|
||||
String mustFields = "id,creation_user,creation_time,modify_user,modify_time,sys_org_code";
|
||||
// String idTemp = UUID.randomUUID().toString().replace("-", "");
|
||||
String mustValues = getMustValues(id);
|
||||
String insertField = mustFields + fieldsBuilder.toString();
|
||||
String insertValue = mustValues + valuesBuilder.toString();
|
||||
return dao.insertInfo(insertField, insertValue);
|
||||
}
|
||||
|
||||
private String getMustValues(String id) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String mustValue = "'" + id + "','" + sysUser.getUsername() + "',"
|
||||
+ "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')" + ",'" + sysUser.getUsername() + "',"
|
||||
+ "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')" + ",'" + sysUser.getOrgCode() + "'";
|
||||
return mustValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||
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());
|
||||
// 列表显示字段
|
||||
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());
|
||||
}
|
||||
// List<String> fieldListTemp = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
//sql查询字段
|
||||
// List<String> fieldListNew = new ArrayList<>();
|
||||
// fieldListNew.add("id"); // 加上主键
|
||||
// 处理数据为空的字段,如果字段值为空,显示斜杠
|
||||
// for (String field : fieldListTemp) {
|
||||
// String fieldTemp = null;
|
||||
// if(fieldDateList.contains(field)){
|
||||
// String fieldNew = "date_format(" + field + ", '%Y-%m-%d')"; // 转时间格式
|
||||
// fieldTemp = "case when " + fieldNew + " is null then \"\" else " + fieldNew + " end " + field;
|
||||
// fieldListNew.add(fieldTemp);
|
||||
// }else{
|
||||
// fieldTemp = "case when " + field + " is null then \"\" else " + field + " end " + field;
|
||||
// fieldListNew.add(fieldTemp);
|
||||
// }
|
||||
// }
|
||||
//sql查询条件
|
||||
String condition = getConditionStr(parameter);
|
||||
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
||||
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage infoPage = dao.getInfoPage(page, " " + "sar_file_split_items.*", condition);
|
||||
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
//过滤出树形字段
|
||||
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<>();
|
||||
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()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect, cut);
|
||||
treeDictItem(categoryList, entry, treeFieldList, cut);
|
||||
}
|
||||
}
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
public int batchDeleteItems(String ids) {
|
||||
String[] itemIds = ids.split(",");
|
||||
List<String> idList = Arrays.asList(itemIds);
|
||||
// 查到对应menu
|
||||
List<Map<String, Object>> getMenuList = dao.queryByItemsIds(idList);
|
||||
List<Map<String, Object>> getAllItemList = new ArrayList<>();
|
||||
List<SarFileSplitMenuEO> getAllMenuList = new ArrayList<>();
|
||||
List<String> menuIdList = new ArrayList<>();
|
||||
List<String> allItemIdList = new ArrayList<>();
|
||||
int result = 0;
|
||||
if (getMenuList != null && !getMenuList.isEmpty()) {
|
||||
for(Map<String, Object> splitItemsMap : getMenuList){
|
||||
String menuId = splitItemsMap.get("menu_id").toString();
|
||||
menuIdList.add(menuId);
|
||||
SarFileSplitMenuEO menuEO = new SarFileSplitMenuEO();
|
||||
menuEO.setId(menuId);
|
||||
//查询当前目录的所有子目录,不包括当前目录
|
||||
List<SarFileSplitMenuEO> menuList = sarFileSplitMenuEOMapper.queryByPidExcpetSelf(menuEO);
|
||||
getAllMenuList.addAll(menuList);
|
||||
//查询子目录下的所有条款,包括当前目录
|
||||
List<Map<String, Object>> rows = dao.queryItemsByMenuId(menuId);
|
||||
getAllItemList.addAll(rows);
|
||||
}
|
||||
if (getAllItemList != null && !getAllItemList.isEmpty()) {
|
||||
//目录下没有子节点时,
|
||||
if ((getAllMenuList == null || getAllMenuList.isEmpty()) && getAllItemList.size() > 1) {
|
||||
// 删除val表数据
|
||||
sarFileSplitItemsValEOMapper.deleteValByitemIds(idList);
|
||||
result = dao.deleteByItemsIdList(idList);
|
||||
return result;
|
||||
}
|
||||
for (Map<String, Object> itemsMap : getAllItemList) {
|
||||
String itemId = itemsMap.get("id").toString();
|
||||
if (allItemIdList != null && !allItemIdList.contains(itemId)) {
|
||||
allItemIdList.add(itemId);
|
||||
} else if (allItemIdList == null || allItemIdList.size() < 1) {
|
||||
allItemIdList.add(itemId);
|
||||
}
|
||||
}
|
||||
if (getAllMenuList != null && !getAllMenuList.isEmpty()) {
|
||||
for(SarFileSplitMenuEO sarFileSplitMenuEO : getAllMenuList){
|
||||
if(!menuIdList.contains(sarFileSplitMenuEO.getId())){
|
||||
menuIdList.add(sarFileSplitMenuEO.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除menu表数据
|
||||
sarFileSplitMenuEOMapper.deleteByIdList(menuIdList);
|
||||
// 删除val表数据
|
||||
sarFileSplitItemsValEOMapper.deleteValByitemIds(allItemIdList);
|
||||
result = dao.deleteByItemsIdList(allItemIdList);
|
||||
}else {
|
||||
//要删除的条款menuId均不存在,判定为垃圾数据
|
||||
|
||||
// 删除val表数据
|
||||
sarFileSplitItemsValEOMapper.deleteValByitemIds(idList);
|
||||
result = dao.deleteByItemsIdList(idList);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getConditionStr(Map<String, Object> parameter) {
|
||||
//查询条件
|
||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||
|
||||
//搜索条件字段类型信息
|
||||
List<Map<String, Object>> mapList = queryCondition("1", null);
|
||||
|
||||
//查询条件处理
|
||||
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
// 处理必传字段的查询条件
|
||||
if ("info_id".equals(key)) {
|
||||
String value = (String) entry.getValue();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
conditionSb.append(" and sar_file_split_items." + key + " ='" + value +"'");
|
||||
}
|
||||
} else if ("menu_id".equals(key)) {
|
||||
String value = (String) entry.getValue();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
// 查询所有子级id
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
|
||||
sarFileSplitMenuEO.setId(value);
|
||||
List<String> menuIdList = sarFileSplitMenuEOMapper.queryAllChildrenByid(sarFileSplitMenuEO).stream()
|
||||
.map(SarFileSplitMenuEO::getId)
|
||||
.collect(Collectors.toList());
|
||||
String menuIds = StringUtils.join(menuIdList,"','");
|
||||
conditionSb.append(" and sar_file_split_items." + key + " in('" + menuIds + "')");
|
||||
}
|
||||
} else if (!"pageNo".equals(key) && !"pageSize".equals(key)) {
|
||||
String value = (String) entry.getValue();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
for (Map<String, Object> map : mapList) {
|
||||
String fieldName = (String) map.get("db_field_name");//字段
|
||||
if (key.equals(fieldName)) {
|
||||
//字段类型(判断是输入框还是下拉,等等)
|
||||
String fieldType = (String) map.get("field_show_type");//字段类型
|
||||
if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldType)) {
|
||||
//输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/'
|
||||
if(value.contains("%")){
|
||||
value = value.replace("%", "/%");
|
||||
}
|
||||
conditionSb.append(" and sar_file_split_items." + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'");
|
||||
// conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType)
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)
|
||||
|| FieldTypeEnum.TREE.getValue().equals(fieldType)) {
|
||||
StringBuilder valueSb = new StringBuilder();
|
||||
StringBuilder condition = new StringBuilder();
|
||||
for (String valueTemp : value.split(",")) {
|
||||
valueSb.append("'" + valueTemp + "',");
|
||||
condition.append(" or sar_file_split_items." + key + " like concat(concat('%','" + valueTemp + "'),'%'))");
|
||||
}
|
||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||
//下拉单选或下拉多选
|
||||
conditionSb.append(" and (sar_file_split_items." + key + " in(" + substring + ")" + condition.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理列表表头排序
|
||||
conditionSb.append(" order by SAR_FILE_SPLIT_MENU.display_seq asc");
|
||||
String condition = conditionSb.toString();
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Map<String,Object> judgeContaintChilds(String ids){
|
||||
String[] itemIds = ids.split(",");
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
List<String> idList = Arrays.asList(itemIds);
|
||||
// 查到对应menu
|
||||
List<Map<String, Object>> getMenuList = dao.queryByItemsIds(idList);
|
||||
if (getMenuList != null && !getMenuList.isEmpty()) {
|
||||
for (Map<String, Object> splitItemsMap : getMenuList) {
|
||||
SarFileSplitMenuEO sarMenuEO = new SarFileSplitMenuEO();
|
||||
sarMenuEO.setId(splitItemsMap.get("menu_id").toString());
|
||||
List<SarFileSplitMenuEO> list = sarFileSplitMenuEOMapper.queryByPidExcpetSelf(sarMenuEO);
|
||||
if(list != null && !list.isEmpty()){
|
||||
// String menuNameStr = list.stream().map(SarFileSplitMenuEO :: getName).collect(Collectors.joining(";"));
|
||||
result.put("flag",false);
|
||||
// result.put("content", menuNameStr);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
result.put("flag",true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectByPrimaryKey(String id) {
|
||||
return dao.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
* @param flag
|
||||
* @param cut
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> queryCondition(String flag, String cut) {
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(flag);
|
||||
if (fieldList.size() != 0) {
|
||||
//过滤出搜索条件()
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsQuery()))).collect(Collectors.toList());
|
||||
}
|
||||
//树形数据字典
|
||||
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(); // 查询所有 并以树结构返回
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : fieldList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 树形结构字段 获取字段值
|
||||
if (FieldTypeEnum.TREE.getValue().equals(onlCgformField.getFieldShowType())) {
|
||||
List<SysCategoryTreeVO> sysCategoryTreeVOList = sysCategoryTree.stream()
|
||||
.filter(e -> onlCgformField.getDictId().equals(e.getDictId()))
|
||||
.collect(Collectors.toList());
|
||||
map.put("tree", sysCategoryTreeVOList);
|
||||
} else {
|
||||
map.put("tree", new ArrayList<>());
|
||||
}
|
||||
|
||||
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
|
||||
map.put("dict_field", onlCgformField.getDictField());
|
||||
map.put("db_field_name", onlCgformField.getDbFieldName());//字段
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
|
||||
} else {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
|
||||
}
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉选处理数据字典
|
||||
*
|
||||
* @param sysDictItems 所有数据字典值信息
|
||||
* @param entry 需要处理的某个字段数据
|
||||
* @param collect 该字段对应的字段信息
|
||||
* @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 value = (String) entry.getValue();
|
||||
//数据字典中文
|
||||
List<String> dictItemsCh = new ArrayList<>();
|
||||
List<String> dictItemsEn = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
for (String itemValue : value.split(",")) {
|
||||
//字段的数据字典
|
||||
List<SysDictItem> dictItemList = sysDictItems.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals(entry.getKey()))
|
||||
.collect(Collectors.toList());
|
||||
if (dictItemList.size() != 0) {
|
||||
List<SysDictItem> dictItems = dictItemList.stream()
|
||||
.filter(e -> itemValue.equals(e.getItemValue()))
|
||||
.collect(Collectors.toList());
|
||||
if (dictItems.size() != 0) {
|
||||
List<String> itemText = new ArrayList<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
|
||||
} else {
|
||||
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
|
||||
}
|
||||
dictItemsCh.addAll(itemText);
|
||||
dictItemsEn.addAll(itemText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
entry.setValue(StringUtils.join(dictItemsCh, ","));
|
||||
} else {
|
||||
entry.setValue(StringUtils.join(dictItemsEn, ","));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 属性字典处理中文
|
||||
*
|
||||
* @param categoryList 所有树形字典值信息
|
||||
* @param entry 需要处理的某个字段数据
|
||||
* @param treeFieldList 列表字段红的树形字段
|
||||
* @param cut 需切换的语言类别
|
||||
*/
|
||||
public void treeDictItem(List<SysCategory> categoryList, Map.Entry<String, Object> entry, List<OnlCgformField> treeFieldList, String cut) {
|
||||
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();
|
||||
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());
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
|
||||
entry.setValue(StringUtils.join(nameList, ","));
|
||||
} else {
|
||||
List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
|
||||
entry.setValue(StringUtils.join(nameEnList, ","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
-23
@@ -6,6 +6,7 @@ import com.jero.modules.split.entity.*;
|
||||
import com.jero.modules.split.mapper.*;
|
||||
import com.jero.modules.split.page.SarFileSplitItemsEOPage;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.IFileSplitItemsEOService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.system.util.UserUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
@@ -48,6 +49,9 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
@Autowired
|
||||
private SarFileSplitItemsParamsMapper sarFileSplitItemsParamsMapper;
|
||||
|
||||
@Autowired
|
||||
private IFileSplitItemsEOService fileSplitItemsEOService;
|
||||
|
||||
public int dragMenu(DrageMenuEO drageMenuEO){
|
||||
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
|
||||
@@ -210,6 +214,12 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
sarFileSplitMenuEO.setCreationTime(new Date());
|
||||
sarFileSplitMenuEO.setModifyTime(new Date());
|
||||
int count = dao.insertSelective(sarFileSplitMenuEO);
|
||||
// 新增对应条款
|
||||
Map<String, Object> parameter = new HashMap<>();
|
||||
parameter.put("items_num", sarFileSplitMenuEO.getName());
|
||||
parameter.put("items_name", sarFileSplitMenuEO.getItemName());
|
||||
String itemId = UUID.randomUUID().toString().replace("-", "");
|
||||
fileSplitItemsEOService.insertInfo(parameter, itemId);
|
||||
// 之后的所有节点序号增加
|
||||
SarFileSplitMenuEOPage page = new SarFileSplitMenuEOPage();
|
||||
page.setPId(sarFileSplitMenuEO.getPId());
|
||||
@@ -226,7 +236,7 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
return count;
|
||||
}
|
||||
|
||||
public boolean judgequeryMenuByPid(SarFileSplitMenuEO sarMenuEO) throws Exception {
|
||||
public boolean judgequeryMenuByPid(SarFileSplitMenuEO sarMenuEO) throws Exception {
|
||||
boolean result = false; //true 表示有记录,false表示无记录
|
||||
//先判断目录下是否有子节点
|
||||
List<SarFileSplitMenuEO> list = dao.queryByPidExcpetSelf(sarMenuEO);
|
||||
@@ -248,19 +258,18 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
|
||||
public void deleteMenu(String id){
|
||||
List<String> menuIds = new ArrayList<>();
|
||||
menuIds.add(id);
|
||||
// dao.deleteByPrimaryKey(id);
|
||||
// 删除节点及子节点
|
||||
dao.deleteByPId(id);
|
||||
// 删除条款
|
||||
SarFileSplitMenuEO sarMenuEO = new SarFileSplitMenuEO();
|
||||
sarMenuEO.setId(id);
|
||||
List<SarFileSplitMenuEO> list = dao.queryByPidExcpetSelf(sarMenuEO);
|
||||
// 查询当前节点及所有子节点
|
||||
List<SarFileSplitMenuEO> list = dao.queryAllChildrenByid(sarMenuEO);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for(SarFileSplitMenuEO menu : list){
|
||||
menuIds.add(menu.getId());
|
||||
}
|
||||
}
|
||||
// 删除节点及子节点
|
||||
dao.deleteByPId(menuIds);
|
||||
// 删除条款
|
||||
sarFileSplitItemsValEOMapper.deleteValByMenuIds(menuIds);
|
||||
sarFileSplitItemsTableEOMapper.deleteTableByMenuIds(menuIds);
|
||||
sarFileSplitItemsEOMapper.deleteByMenuIds(menuIds);
|
||||
@@ -365,18 +374,18 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public int copyMenuNotChildren(SarFileSplitItemsEO sarFileSplitItemsEO) {
|
||||
public int copyMenuNotChildren(Map<String, Object> itemsMap) {
|
||||
int result =0;
|
||||
List<String> oldItemIdList = new ArrayList<>();
|
||||
Map itemValIdMap = new HashMap<>();
|
||||
oldItemIdList.add(sarFileSplitItemsEO.getId());
|
||||
String itemId = itemsMap.get("id").toString();
|
||||
oldItemIdList.add(itemId);
|
||||
|
||||
sarFileSplitItemsEO = sarFileSplitItemsEOMapper.selectByPrimaryKey(sarFileSplitItemsEO.getId());
|
||||
itemsMap = fileSplitItemsEOService.selectByPrimaryKey(itemId);
|
||||
|
||||
// 查询该节点下所有的 子节点 并修改排序
|
||||
SarFileSplitMenuEO sarMenuEO = new SarFileSplitMenuEO();
|
||||
sarMenuEO.setId(sarFileSplitItemsEO.getMenuId());
|
||||
sarMenuEO.setId(itemsMap.get("menu_id").toString());
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOList = dao.queryAllChildrenByid(sarMenuEO);
|
||||
sarMenuEO = dao.selectByPrimaryKey(sarMenuEO.getId());
|
||||
int maxDisplay = dao.getMaxDisplayByid(sarMenuEO.getId());
|
||||
@@ -386,7 +395,7 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
sarFileSplitMenuEO.setChildrenCount(1L);
|
||||
sarFileSplitMenuEO.setModifyUser(UserUtils.getUserId());
|
||||
sarFileSplitMenuEO.setModifyTime(new Date());
|
||||
sarFileSplitMenuEO.setInfoId(sarFileSplitItemsEO.getInfoId());
|
||||
sarFileSplitMenuEO.setInfoId(itemsMap.get("info_id").toString());
|
||||
dao.updateDisplaySeqAdd(sarFileSplitMenuEO);
|
||||
|
||||
// SAR_FILE_ITEMS_MENU 添加数据,
|
||||
@@ -399,13 +408,9 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
result = dao.insertSelective(sarMenuEO);
|
||||
|
||||
// SAR_FILE_ITEMS 添加数据,
|
||||
sarFileSplitItemsEO.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
sarFileSplitItemsEO.setMenuId(sarMenuEO.getId());
|
||||
sarFileSplitItemsEO.setCreationTime(new Date());
|
||||
sarFileSplitItemsEO.setModifyTime(new Date());
|
||||
sarFileSplitItemsEO.setCreationUser(UserUtils.getUserId());
|
||||
sarFileSplitItemsEO.setModifyUser(UserUtils.getUserId());
|
||||
result += sarFileSplitItemsEOMapper.insertSelective(sarFileSplitItemsEO);
|
||||
String newItemId = UUID.randomUUID().toString().replace("-", "");
|
||||
itemsMap.put("menu_id", sarMenuEO.getId());
|
||||
result += fileSplitItemsEOService.insertInfo(itemsMap, newItemId);
|
||||
|
||||
// SAR_FILE_ITEMS_VAL 添加数据,
|
||||
List<SarFileSplitItemsValEO> sarFileSplitItemsValEOList = sarFileSplitItemsValEOMapper.queryItemsValByMenuId(oldItemIdList);
|
||||
@@ -413,7 +418,7 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
String newItemValId = UUID.randomUUID().toString().replace("-", "");
|
||||
itemValIdMap.put(sarFileSplitItemsValEO.getId(), newItemValId);
|
||||
sarFileSplitItemsValEO.setId(newItemValId);
|
||||
sarFileSplitItemsValEO.setItemId(sarFileSplitItemsEO.getId());
|
||||
sarFileSplitItemsValEO.setItemId(newItemId);
|
||||
sarFileSplitItemsValEO.setCreationTime(new Date());
|
||||
sarFileSplitItemsValEO.setModifyTime(new Date());
|
||||
sarFileSplitItemsValEO.setCreationUser(UserUtils.getUserId());
|
||||
@@ -426,7 +431,7 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
List<SarFileSplitItemsParamsEO> sarFileSplitItemsParamsEOList = sarFileSplitItemsParamsMapper.queryItemsParamsByMenuId(oldItemIdList);
|
||||
for (SarFileSplitItemsParamsEO sarFileSplitItemsParamsEO : sarFileSplitItemsParamsEOList) {
|
||||
sarFileSplitItemsParamsEO.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
sarFileSplitItemsParamsEO.setItemId(sarFileSplitItemsEO.getId());
|
||||
sarFileSplitItemsParamsEO.setItemId(newItemId);
|
||||
sarFileSplitItemsParamsEO.setCreationTime(new Date());
|
||||
sarFileSplitItemsParamsEO.setModifyTime(new Date());
|
||||
}
|
||||
@@ -437,7 +442,7 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
List<SarFileSplitItemsTableEO> sarFileSplitItemsTableEOList = sarFileSplitItemsTableEOMapper.queryItemsTableByMenuId(oldItemIdList);
|
||||
for (SarFileSplitItemsTableEO sarFileSplitItemsTableEO : sarFileSplitItemsTableEOList) {
|
||||
sarFileSplitItemsTableEO.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
sarFileSplitItemsTableEO.setItemsId(sarFileSplitItemsEO.getId());
|
||||
sarFileSplitItemsTableEO.setItemsId(newItemId);
|
||||
sarFileSplitItemsTableEO.setItemsValId(itemValIdMap.get(sarFileSplitItemsTableEO.getItemsValId()).toString());
|
||||
sarFileSplitItemsTableEO.setCreationTime(new Date());
|
||||
sarFileSplitItemsTableEO.setModifyTime(new Date());
|
||||
|
||||
Reference in New Issue
Block a user