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