platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractInvoiceController.java
@@ -48,23 +48,23 @@
   @Operation(summary = "分页查询" , description = "分页查询" )
   @GetMapping("/page" )
   public R getContractPage(@ParameterObject Page page, @ParameterObject ContractQueryDTO queryDTO) {
      LambdaQueryWrapper<Contract> wrapper = Wrappers.lambdaQuery();
      wrapper.like(StringUtils.isNotBlank(queryDTO.getContractName()),Contract::getContractName,queryDTO.getContractName());
      wrapper.like(StringUtils.isNotBlank(queryDTO.getPartyA()),Contract::getPartyA,queryDTO.getPartyA());
      wrapper.eq(Contract::getBillingStatus,queryDTO.getBillingStatus());
      if (StrUtil.equals(queryDTO.getInvoiceType(),"1")){
         wrapper.eqSql(Contract::getBillingAmout,"(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = contract.id)");
      }else if (StrUtil.equals(queryDTO.getInvoiceType(),"0")){
         wrapper.ltSql(Contract::getBillingAmout,"(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = contract.id)");
      }
//      LambdaQueryWrapper<Contract> wrapper = Wrappers.lambdaQuery();
//      wrapper.like(StringUtils.isNotBlank(queryDTO.getContractName()),Contract::getContractName,queryDTO.getContractName());
//      wrapper.like(StringUtils.isNotBlank(queryDTO.getPartyA()),Contract::getPartyA,queryDTO.getPartyA());
//      wrapper.eq(Contract::getBillingStatus,queryDTO.getBillingStatus());
//      if (StrUtil.equals(queryDTO.getInvoiceType(),"1")){
//         wrapper.eqSql(Contract::getBillingAmout,"(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = contract.id)");
//      }else if (StrUtil.equals(queryDTO.getInvoiceType(),"0")){
//         wrapper.ltSql(Contract::getBillingAmout,"(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = contract.id)");
//      }
//
//      if (StrUtil.equals(queryDTO.getBillingStatus(),"1")){
//         wrapper.orderByDesc(BaseModel::getCreateTime);
//      }else {
//         wrapper.orderByAsc(BaseModel::getCreateTime);
//      }
      if (StrUtil.equals(queryDTO.getBillingStatus(),"1")){
         wrapper.orderByDesc(BaseModel::getCreateTime);
      }else {
         wrapper.orderByAsc(BaseModel::getCreateTime);
      }
      return R.ok(contractService.pageByScope(page, wrapper));
      return R.ok(contractInvoiceService.pageScope(page, queryDTO));
   }
   /**
@@ -74,6 +74,15 @@
   @GetMapping("/getContractOutBound/{contractId}" )
   public R getContractOutBound(@PathVariable("contractId")Long contractId) {
      return contractInvoiceService.getContractOutBound(contractId);
   }
   /**
    * 获取合同房租 水电 费用信息
    * @return
    */
   @GetMapping("/getContractHouseWater/{contractId}" )
   public R getContractHouseWater(@PathVariable("contractId")Long contractId) {
      return contractInvoiceService.getContractHouseWater(contractId);
   }
   /**
@@ -136,4 +145,5 @@
   public R pageInvoice(@ParameterObject Page page, @ParameterObject ContractInvoiceQueryDTO queryDTO) {
      return R.ok(contractInvoiceService.pageInvoice(page, queryDTO));
   }
}