添加问题新增添加选择条款分页列表

This commit is contained in:
梁琦涛
2024-10-08 16:25:38 +08:00
parent c820aa73d9
commit 9e6431824a
6 changed files with 141 additions and 6 deletions
@@ -2,6 +2,7 @@ package com.jero.modules.laws.documenttool.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.jero.common.api.vo.Result;
@@ -9,9 +10,7 @@ import com.jero.common.api.vo.ResultCommon;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplitView;
import com.jero.modules.laws.documenttool.entity.SplitFileInfo;
import com.jero.modules.laws.documenttool.entity.*;
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
@@ -486,4 +485,21 @@ public class DocumentSplitController {
documentSplitService.disposeItemVal(isAsmsImport, serialNumber);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 标准拆分详情-通过标准编号获取最新拆分的条款内容不区分状态
* @param
* @return
*/
@AutoLog(value = "标准拆分详情-通过条款号获取最新拆分的条款内容不区分状态")
@ApiOperation(value = "标准拆分详情-通过条款号获取最新拆分的条款内容不区分状态")
@GetMapping("/getPageByStandardNumber")
public Result<IPage<LawsSplitByStandardNumber>> getPageByStandardNumber(LawsSplitByStandardNumber lawsSplitByStandardNumber,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
IPage<LawsSplitByStandardNumber> page = documentSplitService.getPageByNum(lawsSplitByStandardNumber,pageNo,pageSize,req);
return Result.OK(page);
}
}
@@ -0,0 +1,38 @@
package com.jero.modules.laws.documenttool.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Author: yjz
* @Date: 2023/10/15/19:34
* @Description:
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_document_split对象", description="文档拆分")
public class LawsSplitByStandardNumber extends BaseEntity {
// 条款号
@ApiModelProperty("条款号")
private String itemNum;
// 条款名称
@ApiModelProperty("条款名称")
private String itemTitle;
// 条款内容
@ApiModelProperty("条款内容")
private String itemContent;
// 标准名称
@ApiModelProperty("标准名称")
private String standardName;
// 标准编号
@ApiModelProperty("标准编号")
private String standardNumber;
// 标准id
@ApiModelProperty("标准id")
private String standardIds;
}
@@ -240,4 +240,8 @@ public interface DocumentSplitMapper extends BaseMapper<LawsDocumentSplit> {
* @return
*/
List<String> getSplitSelectIds(List<String> countryList);
List<String> getInfoId(@Param(Constants.WRAPPER) QueryWrapper<LawsDocumentSplit> queryWrapper);
IPage<LawsSplitByStandardNumber> getPageByNum(Page<LawsSplitByStandardNumber> page, @Param(Constants.WRAPPER) QueryWrapper<LawsSplitByStandardNumber> queryWrapper);
}
@@ -326,4 +326,48 @@
CONCAT(',',l1.applicable_market,',') like CONCAT('%,',#{item},',%')
</foreach>
</select>
<select id="getPageByNum" resultType="com.jero.modules.laws.documenttool.entity.LawsSplitByStandardNumber">
SELECT s.id,
item_num ,
item_title,
item_content,
l.standard_name,
l.standard_number
FROM laws_document_split s
LEFT JOIN SAR_FILE_SPLIT_MENU m ON s.MENU_ID = m.id
left join sar_file_split_info s1 ON s1.id = s.info_id and s1.del_flag = 0
left join laws_domestic_standard l ON l.id = s1.standard_id and l.del_flag = 0
${ew.customSqlSegment}
</select>
<select id="getInfoId" resultType="java.lang.String">
select o1.id from (
select
case when file_type = 'publish_of_original' then 1
when file_type = 'tbt_file' then 2
when file_type = 'draft_for_review' then 3
when file_type = 'draft_for_approval' then 4
when file_type = 'draft_for_comment' then 5
when file_type = 'draft' then 6
when file_type = 'other_file' then 7
end as file_type,
id,
standard_id
from sar_file_split_info where del_flag = 0 group by standard_id,file_type) o1
join (
select min(file_type) as file_type,standard_id from (
select
case when file_type = 'publish_of_original' then 1
when file_type = 'tbt_file' then 2
when file_type = 'draft_for_review' then 3
when file_type = 'draft_for_approval' then 4
when file_type = 'draft_for_comment' then 5
when file_type = 'draft' then 6
when file_type = 'other_file' then 7
end as file_type,
id,
standard_id
from sar_file_split_info where del_flag = 0 group by standard_id,file_type) a group by standard_id
) o2 ON o1.file_type = o2.file_type AND o1.standard_id = o2.standard_id
${ew.customSqlSegment}
</select>
</mapper>
@@ -2,9 +2,8 @@ package com.jero.modules.laws.documenttool.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplitView;
import com.jero.modules.laws.documenttool.entity.SplitFileInfo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.modules.laws.documenttool.entity.*;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
import com.jero.modules.split.entity.SarFileSplitMenuEO;
@@ -240,4 +239,14 @@ public interface IDocumentSplitService {
* @param ids
*/
void updatePermissionsCheck(String ids);
/**
* 通过标准编号获取最新拆分的条款内容不区分状态
* @param lawsSplitByStandardNumber
* @param pageNo
* @param pageSize
* @param req
* @return
*/
IPage<LawsSplitByStandardNumber> getPageByNum(LawsSplitByStandardNumber lawsSplitByStandardNumber, Integer pageNo, Integer pageSize, HttpServletRequest req);
}
@@ -35,6 +35,7 @@ import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
import com.jero.modules.laws.labeldatabase.entity.LawsLabelDatabase;
import com.jero.modules.laws.labeldatabase.service.ILawsLabelDatabaseService;
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandard;
import com.jero.modules.laws.standard.entity.*;
import com.jero.modules.laws.standard.service.*;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
@@ -1679,6 +1680,29 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
}
}
@Override
public IPage<LawsSplitByStandardNumber> getPageByNum(LawsSplitByStandardNumber lawsSplitByStandardNumber, Integer pageNo, Integer pageSize, HttpServletRequest req) {
if(StringUtils.isEmpty(lawsSplitByStandardNumber.getStandardIds())){
throw new JeroBootException(ResultCommon.PARAMETER_NOT_RECOGNIZED);
}
QueryWrapper<LawsDocumentSplit> queryWrapperLawsDocumentSplit = new QueryWrapper<>();
queryWrapperLawsDocumentSplit.in("o1.standard_id",Arrays.asList(lawsSplitByStandardNumber.getStandardIds().split(",")));
List<String> ids = documentSplitMapper.getInfoId(queryWrapperLawsDocumentSplit);
if(CollectionUtils.isEmpty(ids)){
ids.add("-1");
}
Page<LawsSplitByStandardNumber> page = new Page<>(pageNo, pageSize);
QueryWrapper<LawsSplitByStandardNumber> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("s.del_flag","0");
queryWrapper.in("s1.id",ids);
queryWrapper.eq(!StringUtils.isEmpty(lawsSplitByStandardNumber.getStandardNumber()),"l.standard_number",lawsSplitByStandardNumber.getStandardNumber());
queryWrapper.eq(!StringUtils.isEmpty(lawsSplitByStandardNumber.getStandardName()),"l.standard_name",lawsSplitByStandardNumber.getStandardName());
queryWrapper.eq(!StringUtils.isEmpty(lawsSplitByStandardNumber.getItemNum()),"item_num",lawsSplitByStandardNumber.getItemNum());
queryWrapper.eq(!StringUtils.isEmpty(lawsSplitByStandardNumber.getItemTitle()),"item_title",lawsSplitByStandardNumber.getItemTitle());
IPage<LawsSplitByStandardNumber> res = documentSplitMapper.getPageByNum(page, queryWrapper);
return res;
}
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, List<String> valuesList) {
// 所有key(字段名)
resultMap.forEach((k, v) -> {