feat: 合并

This commit is contained in:
yjz
2024-08-20 10:41:56 +08:00
24 changed files with 190 additions and 128 deletions
@@ -16,11 +16,11 @@ import com.jero.modules.activiti.process.common.service.ProcessSnapshotService;
import com.jero.modules.activiti.process.standardinterpret.vo.FlowApproveInfo;
import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
import lombok.RequiredArgsConstructor;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -34,16 +34,19 @@ import java.util.stream.Collectors;
* @Date: 2024-06-24 16:08
* @Version: 1.0
**/
@RequiredArgsConstructor
@Transactional(rollbackFor = {Exception.class, JeroBootException.class})
@Component
public class FlowUtility {
private final ProcessAllService processAllService;
private final ProcessApprovalRecordService processApprovalRecordService;
private final ProcessDraftService processDraftService;
private final RuntimeService runtimeService;
private final ProcessSnapshotService processSnapshotService;
@Autowired
private ProcessAllService processAllService;
@Autowired
private ProcessApprovalRecordService processApprovalRecordService;
@Autowired
private ProcessDraftService processDraftService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private ProcessSnapshotService processSnapshotService;
public void flowApprovalUpdate(ProcessAll processAll, ProcessApprovalRecord processApprovalRecord){
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -2,7 +2,7 @@ package com.jero.modules.activiti.process.standardinterpret.controller;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -12,9 +12,9 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2024-06-24 14:46:05
*/
@RestController("/processStandardInterpretClause")
@RequiredArgsConstructor
public class ProcessStandardInterpretClauseController {
private final ProcessStandardInterpretClauseService processStandardInterpretClauseService;
@Autowired
private ProcessStandardInterpretClauseService processStandardInterpretClauseService;
}
@@ -2,7 +2,7 @@ package com.jero.modules.activiti.process.standardinterpret.controller;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseSublistService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -12,10 +12,10 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2024-06-24 14:47:59
*/
@RestController("/processStandardInterpretClauseSublist")
@RequiredArgsConstructor
public class ProcessStandardInterpretClauseSublistController {
private final ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService;
@Autowired
private ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService;
}
@@ -2,7 +2,7 @@ package com.jero.modules.activiti.process.standardinterpret.controller;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -11,11 +11,11 @@ import org.springframework.web.bind.annotation.RestController;
* @author makejava
* @since 2024-06-24 14:41:16
*/
@RequiredArgsConstructor
@RestController("/processStandardInterpret")
public class ProcessStandardInterpretController {
private final ProcessStandardInterpretService processStandardInterpretService;
@Autowired
private ProcessStandardInterpretService processStandardInterpretService;
}
@@ -18,9 +18,9 @@ import com.jero.modules.activiti.process.standardinterpret.vo.StandardInterpretF
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -37,12 +37,12 @@ import java.util.List;
**/
@Api(tags="标准解读流程")
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/process/standardInterpretFlow")
public class StandardInterpretFlowController {
private final StandardInterpretFlowService standardInterpretFlowService;
@Autowired
private StandardInterpretFlowService standardInterpretFlowService;
/**
* 标准解读流程-生成项目id
@@ -6,9 +6,9 @@ import com.jero.common.exception.JeroBootException;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause;
import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretClauseMapper;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -22,13 +22,13 @@ import java.util.List;
*/
@Service
@Slf4j
@RequiredArgsConstructor
@Transactional(rollbackFor = {Exception.class, JeroBootException.class})
public class ProcessStandardInterpretClauseServiceImpl
extends ServiceImpl<ProcessStandardInterpretClauseMapper, ProcessStandardInterpretClause>
implements ProcessStandardInterpretClauseService {
private final ProcessStandardInterpretClauseMapper processStandardInterpretClauseMapper;
@Autowired
private ProcessStandardInterpretClauseMapper processStandardInterpretClauseMapper;
@Override
public List<ProcessStandardInterpretClause> queryList(
@@ -7,8 +7,8 @@ import com.jero.common.exception.JeroBootException;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClauseSublist;
import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretClauseSublistMapper;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseSublistService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -21,13 +21,13 @@ import java.util.List;
* @since 2024-06-24 14:48:00
*/
@Service
@RequiredArgsConstructor
@Transactional(rollbackFor = {Exception.class, JeroBootException.class})
public class ProcessStandardInterpretClauseSublistServiceImpl
extends ServiceImpl<ProcessStandardInterpretClauseSublistMapper, ProcessStandardInterpretClauseSublist>
implements ProcessStandardInterpretClauseSublistService {
private final ProcessStandardInterpretClauseSublistMapper processStandardInterpretClauseSublistMapper;
@Autowired
private ProcessStandardInterpretClauseSublistMapper processStandardInterpretClauseSublistMapper;
@Override
public List<ProcessStandardInterpretClauseSublist> queryList(
@@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretMapper;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret;
import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretMapper;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -18,13 +18,13 @@ import org.springframework.transaction.annotation.Transactional;
* @since 2024-06-24 14:41:19
*/
@Service
@RequiredArgsConstructor
@Transactional(rollbackFor = {Exception.class, JeroBootException.class})
public class ProcessStandardInterpretServiceImpl
extends ServiceImpl<ProcessStandardInterpretMapper, ProcessStandardInterpret>
implements ProcessStandardInterpretService {
private final ProcessStandardInterpretMapper processStandardInterpretMapper;
@Autowired
private ProcessStandardInterpretMapper processStandardInterpretMapper;
@Override
public ProcessStandardInterpret queryOne(ProcessStandardInterpret processStandardInterpret) {
@@ -68,7 +68,6 @@ import com.jero.modules.system.service.ISysDepartService;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.service.ILawsTagService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.ManagementService;
import org.activiti.engine.RuntimeService;
@@ -86,12 +85,12 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -112,42 +111,65 @@ import java.util.stream.Collectors;
**/
@Service
@Slf4j
@RequiredArgsConstructor
@Transactional(rollbackFor = {Exception.class,JeroBootException.class})
public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowService {
private final FlowUtility flowUtility;
private final RuntimeService runtimeService;
private final TaskService taskService;
private final ProcessAllService processAllService;
private final ProcessApprovalRecordService processApprovalRecordService;
private final ProcessNodeLinkService processNodeLinkService;
private final ProcessStandardInterpretService processStandardInterpretService;
private final ProcessStandardInterpretClauseService processStandardInterpretClauseService;
private final ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService;
private final ILawsDomesticStandardService lawsDomesticStandardService;
private final IProcessHandleService processHandleService;
private final ISarFileSplitInfoService sarFileSplitInfoService;
private final DocumentSplitMapper documentSplitMapper;
private final ISysDictService sysDictService;
private final ISysDepartService sysDepartService;
private final ILawsPartNameService lawsPartNameService;
private final ILawsEnterpriseStandardService lawsEnterpriseStandardService;
private final LawsDocumentSplitMapper lawsDocumentSplitMapper;
private final SarFileSplitItemsValEOMapper sarFileSplitItemsValEOMapper;
private final IDocumentSplitService documentSplitService;
private final ManagementService managementService;
private final ILawsStandardMasterPlanService lawsStandardMasterPlanService;
private final ProcessStandardInterpretMapper processStandardInterpretMapper;
private final SendMessageAPI sendMessageAPI;
private final ILawsTagService lawsTagService;
@Autowired
private FlowUtility flowUtility;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private ProcessAllService processAllService;
@Autowired
private ProcessApprovalRecordService processApprovalRecordService;
@Autowired
private ProcessNodeLinkService processNodeLinkService;
@Autowired
private ProcessStandardInterpretService processStandardInterpretService;
@Autowired
private ProcessStandardInterpretClauseService processStandardInterpretClauseService;
@Autowired
private ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService;
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService;
@Autowired
private IProcessHandleService processHandleService;
@Autowired
private ISarFileSplitInfoService sarFileSplitInfoService;
@Autowired
private DocumentSplitMapper documentSplitMapper;
@Autowired
private ISysDictService sysDictService;
@Autowired
private ISysDepartService sysDepartService;
@Autowired
private ILawsPartNameService lawsPartNameService;
@Autowired
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
@Autowired
private LawsDocumentSplitMapper lawsDocumentSplitMapper;
@Autowired
private SarFileSplitItemsValEOMapper sarFileSplitItemsValEOMapper;
@Autowired
private IDocumentSplitService documentSplitService;
@Autowired
private ManagementService managementService;
@Autowired
private ILawsStandardMasterPlanService lawsStandardMasterPlanService;
@Autowired
private ProcessStandardInterpretMapper processStandardInterpretMapper;
@Autowired
private SendMessageAPI sendMessageAPI;
@Autowired
private ILawsTagService lawsTagService;
private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
private final List<String> tempList = new ArrayList<>();
private final int TEXT_LENGTH = 50;
private final int TEXT_DICT_LENGTH = 500;
private final int TEXT_AREA_LENGTH = 2000;
private final View error;
@Override
public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) {
@@ -203,6 +203,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
private String exportExcelTempPath;
@Value("#{'${adminRoleCode}'.split(',')}")
private List<String> adminRoleCodeList;
@Value(value = "${jero.splitStandardClass}")
private String splitStandardClass;
@Override
public IPage<DocumentSplitInfo> queryByPage(DocumentSplitInfo documentSplitInfo, Integer pageNo, Integer pageSize) {
@@ -482,7 +485,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
int count;
//拆分
if (SplitFileTypeTypeEnum.UN.getValue().equals(sarFileSplitInfoEO.getStandardClass())){
if (splitStandardClass.contains(sarFileSplitInfoEO.getStandardClass())){
count = fileSpiltService.fileEU(sarFileSplitInfoEO, SplitFileTypeTypeEnum.UN);
}else {
count = fileSpiltService.fileCHN(sarFileSplitInfoEO, SplitFileTypeTypeEnum.GBT);
@@ -15,10 +15,10 @@ import com.jero.modules.laws.standardmasterplan.vo.LawsStandardMasterPlanVO;
import com.jero.modules.system.vo.IdMapBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -37,10 +37,10 @@ import java.util.List;
@RestController
@RequestMapping("/laws/StandardMasterPlan")
@Slf4j
@RequiredArgsConstructor
public class LawsStandardMasterPlanController {
private final ILawsStandardMasterPlanService lawsStandardMasterPlanService;
@Autowired
private ILawsStandardMasterPlanService lawsStandardMasterPlanService;
/**
* 标准主计划-分页列表查询
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/laws/StandardMasterPlanSublist")
@Slf4j
@RequiredArgsConstructor
public class LawsStandardMasterPlanSublistController {
}
@@ -43,13 +43,13 @@ import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
import org.jeecgframework.poi.excel.view.JeecgTemplateExcelView;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -71,24 +71,36 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = JeroBootException.class)
@Slf4j
@RequiredArgsConstructor
public class LawsStandardMasterPlanServiceImpl
extends ServiceImpl<LawsStandardMasterPlanMapper, LawsStandardMasterPlan>
implements ILawsStandardMasterPlanService {
private final LawsStandardMasterPlanMapper lawsStandardMasterPlanMapper;
private final ILawsStandardMasterPlanSublistService lawsStandardMasterPlanSublistService;
private final ILawsDomesticStandardService lawsDomesticStandardService;
private final ISysDictService sysDictService;
private final ISysUserService sysUserService;
private final IOSSFileService ossFileService;
private final ILawsMarketStandardService lawsMarketStandardService;
private final ILawsMarketStandardDetailService lawsMarketStandardDetailService;
private final ILawsConformityAssessmentLibraryService lawsConformityAssessmentLibraryService;
private final ILawsEvaluationNotMetLibraryService lawsEvaluationNotMetLibraryService;
private final ProcessAllService processAllService;
private final ProcessStandardInterpretService processStandardInterpretService;
private final IProcessNewStandardImportService processNewStandardImportService;
@Autowired
private LawsStandardMasterPlanMapper lawsStandardMasterPlanMapper;
@Autowired
private ILawsStandardMasterPlanSublistService lawsStandardMasterPlanSublistService;
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService;
@Autowired
private ISysDictService sysDictService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IOSSFileService ossFileService;
@Autowired
private ILawsMarketStandardService lawsMarketStandardService;
@Autowired
private ILawsMarketStandardDetailService lawsMarketStandardDetailService;
@Autowired
private ILawsConformityAssessmentLibraryService lawsConformityAssessmentLibraryService;
@Autowired
private ILawsEvaluationNotMetLibraryService lawsEvaluationNotMetLibraryService;
@Autowired
private ProcessAllService processAllService;
@Autowired
private ProcessStandardInterpretService processStandardInterpretService;
@Autowired
private IProcessNewStandardImportService processNewStandardImportService;
@Value("${jero.path.exportExcelTempPath}")
private String exportExcelTempPath;
@@ -68,11 +68,12 @@ public class SarFileSplitMenuEOController extends JeroController<SarFileSplitMen
return Result.OK(MessageUtils.getMessage(ResultCommon.EDIT_OK),sarFileSplitMenuEO);
}
@ApiOperation(value = "标准拆分条款目录-修改层级")
@ApiOperation(value = "标准拆分条款目录-移动层级")
@GetMapping("/updateMenuLevel")
// @RequiresPermissions("split:sarFileSplitMenu:updateMenuLevel")
public Result<SarFileSplitMenuEO> updateMenuLevel(String id, String parentId) {
sarFileSplitMenuEOService.updateMenuLevel(id, parentId);
public Result<SarFileSplitMenuEO> updateMenuLevel(@ApiParam(value = "要移动的节点id")String sourceId,
@ApiParam(value = "要移动到的节点id")String targetId) {
sarFileSplitMenuEOService.updateMenuLevel(sourceId, targetId);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -38,6 +38,11 @@ public class SarFileSplitMenuEO implements Serializable {
*/
@ApiModelProperty("父节点id")
private String pId;
/**
* 父节点id
*/
@ApiModelProperty("父节点id")
private String parentId;
/**
* 排序序号
*/
@@ -12,6 +12,7 @@ public enum SplitFileTypeTypeEnum {
KMVSS_ARTICLE("KMVSS_Article","KMVSS_Article"),
US("CFR","美国"),
UN("UN","欧洲"),
EU("EU","欧盟"),
/**
* Japan Attachment
*/
@@ -148,6 +148,9 @@
<if test="pId != null" >
parent_id = #{pId},
</if>
<if test="parentId != null" >
parent_id = #{parentId},
</if>
<if test="displaySeq != null" >
display_seq = #{displaySeq},
</if>
@@ -379,6 +382,7 @@
select * from SAR_FILE_SPLIT_MENU
where display_seq &gt; #{displaySeq} and info_id = #{infoId}
AND valid_flag = '0'
order by display_seq asc
</select>
<select id="findByParentId" resultMap="BaseResultMap">
@@ -58,5 +58,5 @@ public interface ISarFileSplitMenuEOService extends IService<SarFileSplitMenuEO>
Result moveUpOrDown(JSONObject json);
void updateMenuLevel(String id, String parentId);
void updateMenuLevel(String sourceId, String targetId);
}
@@ -24,7 +24,6 @@ import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServi
import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
import com.jero.modules.laws.documenttool.common.DirectoryComparator;
import com.jero.modules.laws.documenttool.mapper.DocumentSplitMapper;
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
import com.jero.modules.laws.labeldatabase.entity.LawsLabelDatabase;
@@ -42,7 +41,6 @@ import com.jero.modules.split.dto.FileSplitValExportDto;
import com.jero.modules.split.dto.FileSplitValImgExportDto;
import com.jero.modules.split.entity.*;
import com.jero.modules.split.enums.SplitEnum;
import com.jero.modules.split.enums.SplitFileTypeTypeEnum;
import com.jero.modules.split.mapper.FileSplitItemsEOMapper;
import com.jero.modules.split.mapper.SarFileSplitItemsValEOMapper;
import com.jero.modules.split.mapper.SarFileSplitMenuEOMapper;
@@ -168,6 +166,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
private String splitUrl;
@Value(value = "${jero.path.uploadCos}")
private String uploadCospath;
@Value(value = "${jero.splitStandardClass}")
private String splitStandardClass;
public static boolean ENCRYPT_ENABLE;
public static String DECRYPT_URL;
@@ -1785,7 +1785,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
// if(CollectionUtils.isNotEmpty(itemNumList)) {
List<SarFileSplitMenuTreeNode> treeList = new ArrayList<>();
List<Map<String, Object>> itemsEOList = new ArrayList<>(addItemsEOList);
if (SplitFileTypeTypeEnum.UN.getValue().equals(sarFileSplitInfoEO.getStandardClass())){
if (splitStandardClass.contains(sarFileSplitInfoEO.getStandardClass())){
treeList = buildTree2(itemsEOList, treeListDisplay, menuId);
}else {
treeList = buildTree(itemsEOList, treeListDisplay, menuId);
@@ -1924,13 +1924,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
// 校验名称
File file1 = excelfilelist.get(0);
String name = file1.getName().substring(0, file1.getName().lastIndexOf("."));
if(!"条款导入模板".equals(name)){
if(!"条款导入模板,clauseImport".contains(name)){
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())){
resultMsg = "excel名称不正确,应为:条款导入模板";
resultMsg = "excel名称不正确,应为:条款导入模板 或 clauseImport";
}else{
resultMsg = "excel name is incorrect, should be: 条款导入模板";
resultMsg = "excel name is incorrect, should be: 条款导入模板 or clauseImport";
}
return Result.error(1, resultMsg);
}
@@ -3165,7 +3165,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
*/
private List<SarFileSplitMenuTreeNode> buildTree(List<Map<String, Object>> addItemsEOList, Long treeListDisplay, String menuId){
//排序
addItemsEOList.sort(new DirectoryComparator());
// addItemsEOList.sort(new DirectoryComparator());
List<SarFileSplitMenuTreeNode> treeNodeList = new ArrayList<>();
String regex = "^[0-9]{0}([0-9]|[.])+$"; //TODO 待优化数字和点必须交替
@@ -3239,21 +3239,16 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
private List<SarFileSplitMenuTreeNode> buildTree2(List<Map<String, Object>> addItemsEOList, Long treeListDisplay, String menuId){
// 过滤出 非正常编号的数据
String regexs = "^[0-9]{0}([0-9]|[.])+$";
List<Map<String, Object>> otherList =
addItemsEOList.stream()
.filter(v -> !String.valueOf(v.get("item_num")).matches(regexs))
.collect(Collectors.toList());
otherList.stream().map(v -> v.get("item_num"))
.collect(Collectors.toList()).forEach(v -> {
System.out.println(v);
});
// String regexs = "^[0-9]{0}([0-9]|[.])+$";
// List<Map<String, Object>> otherList =
// addItemsEOList.stream()
// .filter(v -> !String.valueOf(v.get("item_num")).matches(regexs))
// .collect(Collectors.toList());
// 排序
addItemsEOList.removeAll(otherList);
addItemsEOList.sort(new DirectoryComparator());
addItemsEOList.addAll(otherList);
// addItemsEOList.removeAll(otherList);
// addItemsEOList.sort(new DirectoryComparator());
// addItemsEOList.addAll(otherList);
List<SarFileSplitMenuTreeNode> treeNodeList = new ArrayList<>();
@@ -3272,7 +3267,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
treeNode.setName(itemNum);
// if(itemNum.matches(regex)) {
//父级是 总目录时不做处理
if(itemNum.contains(".")) {
if(itemNum.contains(".") && (itemNum.matches(regex) || itemNum.contains("Article"))) {
String parentName = itemNum.substring(0, itemNum.lastIndexOf("."));
treeNode.setParentName(parentName);
List<SarFileSplitMenuTreeNode> p = treeNodeList.stream().filter(e -> e.getName().equals(parentName)).collect(Collectors.toList());
@@ -374,41 +374,50 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
}
@Override
public void updateMenuLevel(String id, String parentId) {
public void updateMenuLevel(String sourceId, String targetId) {
// 要移动的节点信息
SarFileSplitMenuEO sarFileSplitMenuEO1 = baseMapper.findById(sourceId);
// 要移动到的节点信息
SarFileSplitMenuEO sarFileSplitMenuEO2 = baseMapper.findById(targetId);
// 获取要移动到的层级的最后一个 的排序值
SarFileSplitMenuEO lastMenu = getLastMenu(parentId);
SarFileSplitMenuEO lastMenu = getLastMenu(sarFileSplitMenuEO2.getId());
if (Objects.isNull(lastMenu)){
lastMenu = sarFileSplitMenuEO2;
}
// 查询当前节点和当前节点所有子集
SarFileSplitMenuEO sarFileSplitMenuEO1 = baseMapper.findById(id);
// 要移动的节点所有子集(包括本身)
List<SarFileSplitMenuEO> sarFileSplitMenuEO1List = new ArrayList<>();
sarFileSplitMenuEO1List.add(sarFileSplitMenuEO1);
List<SarFileSplitMenuEO> allList = new ArrayList<>();
getChildren(allList, sarFileSplitMenuEO1List);
List<String> idlist = new ArrayList<>();
// 获取要移动节点的数量
int childCount = allList.size();
// 更新要移动节点及其子集的排序
for (int i = 0; i <allList.size(); i++) {
SarFileSplitMenuEO sarFileSplitMenuEO = allList.get(i);
if (!Objects.equals(sarFileSplitMenuEO.getId(), lastMenu.getId())){
sarFileSplitMenuEO.setDisplaySeq(lastMenu.getDisplaySeq() + i + 1);
}
idlist.add(sarFileSplitMenuEO.getId());
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
}
Long displaySeq = allList.get(allList.size() - 1).getDisplaySeq();
// 更新节点排序
SarFileSplitMenuEO parentSarFileSplitMenu = baseMapper.findById(parentId);
// 更新 大于 要移动到节点最后节点 的节点排序
List<SarFileSplitMenuEO> sarFileSplitMenuEOList =
baseMapper.queryByGTDisplaySeq(parentSarFileSplitMenu.getInfoId(), lastMenu.getDisplaySeq());
for (SarFileSplitMenuEO fileSplitMenuEO : sarFileSplitMenuEOList) {
baseMapper.queryByGTDisplaySeq(sarFileSplitMenuEO1.getInfoId(), lastMenu.getDisplaySeq());
sarFileSplitMenuEOList = sarFileSplitMenuEOList.stream()
.filter(v -> !idlist.contains(v.getId())).collect(Collectors.toList());
for (int i = 0; i < sarFileSplitMenuEOList.size(); i++) {
// 更新排序
fileSplitMenuEO.setDisplaySeq(fileSplitMenuEO.getDisplaySeq() + childCount);
SarFileSplitMenuEO fileSplitMenuEO = sarFileSplitMenuEOList.get(i);
fileSplitMenuEO.setDisplaySeq(displaySeq + i + 1);
baseMapper.updateByPrimaryKeySelective(fileSplitMenuEO);
}
// 更新要移动节点的排序
for (int i = 0; i <allList.size(); i++) {
SarFileSplitMenuEO sarFileSplitMenuEO2 = allList.get(i);
sarFileSplitMenuEO2.setDisplaySeq(lastMenu.getDisplaySeq() + i + 1);
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO2);
}
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
sarFileSplitMenuEO.setId(id);
sarFileSplitMenuEO.setPId(parentId);
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
// 更新要移动节点的parentId
sarFileSplitMenuEO1.setParentId(targetId);
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO1);
}
private void getChildren(List<SarFileSplitMenuEO> allList, List<SarFileSplitMenuEO> sarFileSplitMenuEOList) {
@@ -421,7 +430,7 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
}
}
private SarFileSplitMenuEO getLastMenu(String parentId) {
public SarFileSplitMenuEO getLastMenu(String parentId) {
SarFileSplitMenuEO sarFileSplitMenuEO1 = baseMapper.findLastByParentId(parentId);
if(sarFileSplitMenuEO1 != null){
getLastMenu(sarFileSplitMenuEO1.getId());
@@ -216,6 +216,8 @@ jero:
splitUrl: http://10.2.16.8:8188/laws-chery/sys/split/file/getImage?fileName=
#公式转换图片url
mathToImgUrl: http://10.2.16.8:9998/mathToImg
# 拆分标准类型
splitStandardClass: UN,EU
path:
#文件上传根目录 设置
upload: //opt//upFiles
@@ -212,6 +212,8 @@ jero:
splitUrl: http://localhost:8188/laws-chery/sys/split/file/getImage?fileName=
#公式转换图片url
mathToImgUrl: http://localhost:9998/mathToImg
# 拆分标准类型
splitStandardClass: UN,EU
path:
#文件上传根目录 设置
upload: D://opt//upFiles
@@ -208,6 +208,8 @@ jero:
splitUrl: http://srms.sinotruk.com/laws-sinotruk/sys/split/file/getImage?fileName=
#公式转换图片url
mathToImgUrl: http://mathtoimg-o3lth.yf-grp:8080/mathToImg
# 拆分标准类型
splitStandardClass: UN,EU
path:
#文件上传根目录 设置
upload: /app/opt/upFiles
@@ -522,4 +524,4 @@ bindPart:
#Authorization
auth_username: CNHTC_PO_PSRMS
#Authorization
auth_password: Cnhtcpsrms2024
auth_password: Cnhtcpsrms2024
@@ -216,6 +216,8 @@ jero:
splitUrl: http://10.2.16.10:8188/laws-chery/sys/split/file/getImage?fileName=
#公式转换图片url
mathToImgUrl: http://10.2.16.10:9998/mathToImg
# 拆分标准类型
splitStandardClass: UN,EU
path:
#文件上传根目录 设置
upload: //opt//upFiles