diff --git a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/entity/BindPartStandardVO.java b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/entity/BindPartStandardVO.java index ff00aed8..4b542d7d 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/entity/BindPartStandardVO.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/entity/BindPartStandardVO.java @@ -1,10 +1,14 @@ package com.jero.modules.laws.bindPart.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.jero.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; +import java.io.Serializable; import java.util.Date; /** @@ -12,7 +16,9 @@ import java.util.Date; * @Date: 2024/4/18 10:09 */ @Data -public class BindPartStandardVO { +@NoArgsConstructor +@AllArgsConstructor +public class BindPartStandardVO implements Serializable { /** * id */ @@ -38,7 +44,7 @@ public class BindPartStandardVO { * 标准状态 */ @ApiModelProperty(value = "企标标准状态") - @Dict(dicCode = "es_standard_state") + @Dict(dicCode = "es_status") private String esStandardState; /** * 发布日期 @@ -58,4 +64,7 @@ public class BindPartStandardVO { */ @ApiModelProperty(value = "拆分条款记录Id(选择条款用)") private String infoId; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/LawsBindPartMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/LawsBindPartMapper.java index 09b1496f..097d15e0 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/LawsBindPartMapper.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/LawsBindPartMapper.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.jero.modules.laws.bindPart.entity.BindPartStandardVO; import com.jero.modules.laws.bindPart.entity.LawsBindPart; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardPlanVo; import org.apache.ibatis.annotations.Param; /** @@ -16,8 +15,6 @@ import org.apache.ibatis.annotations.Param; public interface LawsBindPartMapper extends BaseMapper { IPage page(IPage page, @Param("param") LawsBindPart lawsBindPart); - - IPage selectStandard(IPage page, @Param("param") BindPartStandardVO bindPartStandardVO); } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/xml/LawsBindPartMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/xml/LawsBindPartMapper.xml index b142a573..98523b86 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/xml/LawsBindPartMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/mapper/xml/LawsBindPartMapper.xml @@ -1,7 +1,5 @@ - + @@ -78,56 +76,4 @@ GROUP BY bp.id - - diff --git a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/service/impl/LawsBindPartServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/service/impl/LawsBindPartServiceImpl.java index d1b17a13..13b0d4e5 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/bindPart/service/impl/LawsBindPartServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/bindPart/service/impl/LawsBindPartServiceImpl.java @@ -5,16 +5,28 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.TableEnum; import com.jero.common.exception.JeroBootException; +import com.jero.modules.activiti.process.common.enums.StandardStateEnum; import com.jero.modules.laws.bindPart.entity.BindPartStandardVO; import com.jero.modules.laws.bindPart.entity.LawsBindPart; import com.jero.modules.laws.bindPart.entity.LawsBindPartDoc; import com.jero.modules.laws.bindPart.service.ILawsBindPartDocService; import com.jero.modules.laws.bindPart.service.ILawsBindPartService; import com.jero.modules.laws.bindPart.mapper.LawsBindPartMapper; +import com.jero.modules.laws.enterprise.util.BeanCopyUtils; +import com.jero.modules.laws.standard.controller.LawsDomesticController; +import com.jero.modules.laws.standard.controller.LawsOverseasController; +import com.jero.modules.laws.standard.entity.LawsDomesticStandard; +import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard; +import com.jero.modules.laws.standard.entity.LawsOverseasStandard; +import com.jero.modules.laws.standard.service.ILawsDomesticStandardService; +import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService; +import com.jero.modules.laws.standard.service.ILawsOverseasStandardService; import com.jero.modules.onlyoffice.entity.StandardFileType; import com.jero.modules.split.entity.SarFileSplitInfoEO; import com.jero.modules.split.service.ISarFileSplitInfoService; +import com.jero.modules.tag.enums.TableNameEnum; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -42,6 +54,15 @@ public class LawsBindPartServiceImpl extends ServiceImpl queryPage(LawsBindPart lawsBindPart, Integer pageNo, Integer pageSize, HttpServletRequest req) { IPage page = new Page<>(pageNo, pageSize); @@ -114,9 +135,63 @@ public class LawsBindPartServiceImpl extends ServiceImpl selectStandard(BindPartStandardVO bindPartStandardVO, Integer pageNo, Integer pageSize) { - IPage page = new Page<>(pageNo, pageSize); - lawsBindPartMapper.selectStandard(page, bindPartStandardVO); - List records = page.getRecords(); + String standardType = bindPartStandardVO.getStandardType(); + String standardName = bindPartStandardVO.getStandardName(); + IPage resultPage = new Page<>(pageNo, pageSize); + List records = new ArrayList<>(); + if (StrUtil.isBlank(standardType) || standardType.equals(TableNameEnum.DOMESTIC_REGULATIONS.getValue())) { + IPage page = new Page<>(pageNo, pageSize); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.ne(LawsDomesticStandard::getStandardState, "7"); + queryWrapper.like(StrUtil.isNotBlank(standardName), LawsDomesticStandard::getStandardNumber, standardName).or() + .like(StrUtil.isNotBlank(standardName),LawsDomesticStandard::getStandardName, standardName); + IPage lawsDomesticStandardIPage = gbService.page(page, queryWrapper); + records = BeanCopyUtils.copyBeanList(lawsDomesticStandardIPage.getRecords(), BindPartStandardVO.class); + records.forEach(r -> { + r.setStandardType(TableNameEnum.DOMESTIC_REGULATIONS.getValue()); + }); + resultPage.setPages(page.getPages()) + .setCurrent(page.getCurrent()) + .setSize(page.getSize()) + .setTotal(page.getTotal()) + .setRecords(records); + } + if (standardType.equals(TableNameEnum.FOREIGN_REGULATIONS.getValue())){ + IPage page = new Page<>(pageNo, pageSize); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.ne(LawsOverseasStandard::getStandardState, "7"); + queryWrapper.like(StrUtil.isNotBlank(standardName), LawsOverseasStandard::getStandardNumber, standardName).or() + .like(StrUtil.isNotBlank(standardName), LawsOverseasStandard::getStandardName, standardName); + IPage lawsOverseasStandardIPage = fbService.page(page, queryWrapper); + records = BeanCopyUtils.copyBeanList(lawsOverseasStandardIPage.getRecords(), BindPartStandardVO.class); + records.forEach(r -> { + r.setStandardType(TableNameEnum.FOREIGN_REGULATIONS.getValue()); + }); + resultPage.setPages(page.getPages()) + .setCurrent(page.getCurrent()) + .setSize(page.getSize()) + .setTotal(page.getTotal()) + .setRecords(records); + } + if (standardType.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue())){ + IPage page = new Page<>(pageNo, pageSize); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.ne(LawsEnterpriseStandard::getStandardState, StandardStateEnum.ABOLISH); + queryWrapper.like(StrUtil.isNotBlank(standardName), LawsEnterpriseStandard::getStandardNumber, standardName).or() + .like(StrUtil.isNotBlank(standardName), LawsEnterpriseStandard::getStandardName, standardName); + IPage lawsEnterpriseStandardIPage = esService.page(page, queryWrapper); + records = BeanCopyUtils.copyBeanList(lawsEnterpriseStandardIPage.getRecords(), BindPartStandardVO.class); + records.forEach(r -> { + r.setEsStandardState(r.getStandardState()); + r.setStandardType(TableNameEnum.ENTERPRISE_STANDARDS.getValue()); + }); + resultPage.setPages(page.getPages()) + .setCurrent(page.getCurrent()) + .setSize(page.getSize()) + .setTotal(page.getTotal()) + .setRecords(records); + } + // 获取所有标准Id List standardIdList = records.stream().map(BindPartStandardVO::getId).collect(Collectors.toList()); LambdaQueryWrapper sarFileSplitInfoEOLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -146,7 +221,7 @@ public class LawsBindPartServiceImpl extends ServiceImpl