6 小时以前 55d694aaae4e421b5e55cd941500e08f85cb5d4d
src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -166,6 +166,24 @@
        return toAjax(salesLedgerService.addOrUpdateSalesLedger(salesLedgerDto));
    }
    @PostMapping("/createFrameworkOrder")
    @Operation(summary = "创建框架订单")
    public AjaxResult createFrameworkOrder(@RequestBody SalesLedgerDto salesLedgerDto) {
        return toAjax(salesLedgerService.createFrameworkOrder(salesLedgerDto));
    }
    @GetMapping("/listFrameworkOrders")
    @Operation(summary = "查询框架合同下的框架订单")
    public AjaxResult listFrameworkOrders(@RequestParam("parentContractId") Long parentContractId) {
        return AjaxResult.success(salesLedgerService.listFrameworkOrders(parentContractId));
    }
    @GetMapping("/frameworkContractShippedQuantity")
    @Operation(summary = "查询框架合同累计已发货数量")
    public AjaxResult frameworkContractShippedQuantity(@RequestParam("parentContractId") Long parentContractId) {
        return AjaxResult.success(salesLedgerService.getFrameworkContractShippedQuantity(parentContractId));
    }
    /**
     * 删除销售台账
     */
@@ -262,16 +280,13 @@
            //  如果已经有过开票或回款操作,则不允许编辑
            boolean hasReceiptOperation = receiptPaymentAmountTotal.compareTo(BigDecimal.ZERO) > 0;
            salesLedgerVo.setIsEdit(hasReceiptOperation);
            salesLedgerVo.setIsEdit(!hasReceiptOperation);
            salesLedgerVo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.FILE, RecordTypeEnum.SALES_LEDGER, ledgerId));
        }
        if (ObjectUtils.isNotEmpty(salesLedgerDto.getStatus())) {
            if (salesLedgerDto.getStatus()) {
                // 清除所有“未开票金额”为 0 的记录
                iPage.getRecords().removeIf(salesLedger ->
                        Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00")));
                iPage.setTotal(iPage.getRecords().size());
            }
        }