分页修改&sql添加未删除条件:查询不计价规则列表接口、查询参数降级规则列表接口、查询结算公式列表

This commit is contained in:
guojunyun
2025-11-04 17:24:56 +08:00
parent 00ac5c1aef
commit 320913a626
9 changed files with 64 additions and 22 deletions

View File

@@ -1,11 +1,12 @@
package com.zt.plat.module.contractorder.api.vo.contract;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 查询参数降级规则列表 Request VO")
@Data
public class DemotesQueryReqVO {
public class DemotesQueryReqVO extends PageParam {
@Schema(description = "合同名称")
private String contractName;

View File

@@ -1,11 +1,12 @@
package com.zt.plat.module.contractorder.api.vo.contract;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 查询结算公式列表 Request VO")
@Data
public class FormulasQueryReqVO {
public class FormulasQueryReqVO extends PageParam {
@Schema(description = "合同名称")
private String contractName;

View File

@@ -1,11 +1,12 @@
package com.zt.plat.module.contractorder.api.vo.contract;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 查询不计价规则列表 Request VO")
@Data
public class NotsQueryReqVO {
public class NotsQueryReqVO extends PageParam {
@Schema(description = "合同名称")
private String contractName;

View File

@@ -51,21 +51,21 @@ public class ContractController implements BusinessControllerMarker {
@GetMapping("/nots")
@Operation(summary = "查询不计价规则列表")
@PreAuthorize("@ss.hasPermission('base:contract:query')")
public CommonResult<List<NotRespVO>> getNots(NotsQueryReqVO queryReqVO) {
public CommonResult<PageResult<NotRespVO>> getNots(NotsQueryReqVO queryReqVO) {
return success(contractService.getNots(queryReqVO));
}
@GetMapping("/demotes")
@Operation(summary = "查询参数降级规则列表")
@PreAuthorize("@ss.hasPermission('base:contract:query')")
public CommonResult<List<DemoteRespVO>> getDemotes(DemotesQueryReqVO queryReqVO) {
public CommonResult<PageResult<DemoteRespVO>> getDemotes(DemotesQueryReqVO queryReqVO) {
return success(contractService.getDemotes(queryReqVO));
}
@GetMapping("/formulas")
@Operation(summary = "查询结算公式列表")
@PreAuthorize("@ss.hasPermission('base:contract:query')")
public CommonResult<List<FormulaRespVO>> getFormulas(FormulasQueryReqVO queryReqVO) {
public CommonResult<PageResult<FormulaRespVO>> getFormulas(FormulasQueryReqVO queryReqVO) {
return success(contractService.getFormulas(queryReqVO));
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.api.vo.contract.DemoteRespVO;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractDemoteDO;
@@ -22,7 +23,7 @@ public interface ContractDemoteMapper extends BaseMapperX<ContractDemoteDO> {
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
"from bse_ctrt_dmot",
"where 1 = 1",
"where DELETED = 0",
"<if test= \"contractIds != null and contractIds.size() > 0\">",
"and ctrt_id in",
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
@@ -37,5 +38,5 @@ public interface ContractDemoteMapper extends BaseMapperX<ContractDemoteDO> {
"</if>",
"</script>"
})
List<DemoteRespVO> selectDemotes(List<Long> contractIds, String materialName, String elementName);
IPage<DemoteRespVO> selectDemotes(IPage<?> page, List<Long> contractIds, String materialName, String elementName);
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.api.vo.contract.FormulaRespVO;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractFormulaDO;
@@ -22,7 +23,7 @@ public interface ContractFormulaMapper extends BaseMapperX<ContractFormulaDO> {
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
"from bse_ctrt_fmu",
"where 1 = 1",
"where DELETED = 0",
"<if test= \"contractIds != null and contractIds.size() > 0\">",
"and ctrt_id in",
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
@@ -37,5 +38,5 @@ public interface ContractFormulaMapper extends BaseMapperX<ContractFormulaDO> {
"</if>",
"</script>"
})
List<FormulaRespVO> selectFormulas(List<Long> contractIds, String materialName, String elementName);
IPage<FormulaRespVO> selectFormulas(IPage<?> page, List<Long> contractIds, String materialName, String elementName);
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.api.vo.contract.NotRespVO;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractNotDO;
@@ -22,7 +23,7 @@ public interface ContractNotMapper extends BaseMapperX<ContractNotDO> {
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
"from bse_ctrt_nt",
"where 1 = 1",
"where DELETED = 0",
"<if test= \"contractIds != null and contractIds.size() > 0\">",
"and ctrt_id in",
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
@@ -37,5 +38,5 @@ public interface ContractNotMapper extends BaseMapperX<ContractNotDO> {
"</if>",
"</script>"
})
List<NotRespVO> selectNots(List<Long> contractIds, String materialName, String elementName);
IPage<NotRespVO> selectNots(IPage<NotRespVO> page, List<Long> contractIds, String materialName, String elementName);
}

View File

@@ -73,7 +73,7 @@ public interface ContractService {
* @param queryReqVO 查询参数
* @return 不计价规则列表
*/
List<NotRespVO> getNots(NotsQueryReqVO queryReqVO);
PageResult<NotRespVO> getNots(NotsQueryReqVO queryReqVO);
/**
* 查询参数降级规则列表
@@ -81,7 +81,7 @@ public interface ContractService {
* @param queryReqVO 查询参数
* @return 参数降级规则列表
*/
List<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO);
PageResult<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO);
/**
* 查询结算公式列表
@@ -89,7 +89,7 @@ public interface ContractService {
* @param queryReqVO 查询参数
* @return 结算公式列表
*/
List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
PageResult<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
/**
* 通过合同编号获取对应的合同信息

View File

@@ -4,6 +4,8 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
@@ -1185,33 +1187,67 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public List<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
public PageResult<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
// 查合同ID集合
List<Long> contractIds = new ArrayList<>();
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
if (StringUtils.isNotEmpty(queryReqVO.getContractName())
|| StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
}
return contractNotMapper.selectNots(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
// 分页查询
IPage<NotRespVO> ipage = contractNotMapper.selectNots(
new Page<NotRespVO>().setCurrent(queryReqVO.getPageNo()).setSize(queryReqVO.getPageSize()),
contractIds,
queryReqVO.getMaterialName(),
queryReqVO.getElementName()
);
// 分页返回
return new PageResult<NotRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
}
@Override
public List<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO) {
public PageResult<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO) {
// 查合同ID集合
List<Long> contractIds = new ArrayList<>();
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
}
return contractDemoteMapper.selectDemotes(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
// 分页查询
IPage<DemoteRespVO> ipage = contractDemoteMapper.selectDemotes(
new Page<>().setCurrent(queryReqVO.getPageNo()).setSize(queryReqVO.getPageSize()),
contractIds,
queryReqVO.getMaterialName(),
queryReqVO.getElementName()
);
// 分页返回
return new PageResult<DemoteRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
}
@Override
public List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO) {
public PageResult<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO) {
// 查合同ID集合
List<Long> contractIds = new ArrayList<>();
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
}
return contractFormulaMapper.selectFormulas(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
// 分页查询
IPage<FormulaRespVO> ipage = contractFormulaMapper.selectFormulas(
new Page<>().setCurrent(queryReqVO.getPageNo()).setSize(queryReqVO.getPageSize()),
contractIds,
queryReqVO.getMaterialName(),
queryReqVO.getElementName()
);
// 分页返回
return new PageResult<FormulaRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
}
@Override