liding
9 天以前 6305d0c86c23e9a583e8ca798645885d167f4dc5
src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -161,6 +161,16 @@
    }
    /**
     * 导出销售台账列表(包含产品明细,两个sheet页)
     */
    @Log(title = "销售台账", businessType = BusinessType.EXPORT)
    @PostMapping("/exportWithProducts")
    @ApiOperation("导出销售台账及产品明细(两个sheet页)")
    public void exportWithProducts(HttpServletResponse response, SalesLedgerDto salesLedgerDto) {
        salesLedgerService.exportWithProducts(response, salesLedgerDto);
    }
    /**
     * 导出开票登记列表
     */
    @Log(title = "导出开票登记列表", businessType = BusinessType.EXPORT)
@@ -190,6 +200,55 @@
    @ApiOperation("销售订单绑定工艺路线")
    public AjaxResult saleProcessBind(@RequestBody SalesLedgerProcessRoute salesLedgerProcessRoute) {
        salesLedgerService.saleProcessBind(salesLedgerProcessRoute);
        return AjaxResult.success();
    }
    /**
     * 反审核操作
     */
    @Log(title = "销售台账反审核", businessType = BusinessType.UPDATE)
    @PostMapping("/counterReview")
    @ApiOperation("反审核操作:作废或重新生成")
    public AjaxResult counterReview(@RequestBody CounterReviewDto dto) {
        List<Long> newLedgerIds = salesLedgerService.counterReview(dto);
        AjaxResult result = AjaxResult.success("反审核成功");
        if (newLedgerIds != null && !newLedgerIds.isEmpty()) {
            result.put("newLedgerIds", newLedgerIds);
        }
        return result;
    }
    /**
     * 标记订单完成
     */
    @Log(title = "销售台账标记完成", businessType = BusinessType.UPDATE)
    @PostMapping("/markOrderCompleted")
    @ApiOperation("标记订单完成(不可撤销)")
    public AjaxResult markOrderCompleted(@RequestBody Map<String, Object> params) {
        @SuppressWarnings("unchecked")
        List<Long> ids = (List<Long>) params.get("ids");
        if (ids == null || ids.isEmpty()) {
            return AjaxResult.error("请选择要标记完成的订单");
        }
        salesLedgerService.markOrderCompleted(ids);
        return AjaxResult.success("标记完成成功");
    }
    /**
     * 递增打印次数
     */
    @PostMapping("/incrementPrintCount")
    @ApiOperation("递增打印次数")
    public AjaxResult incrementPrintCount(@RequestBody Map<String, Object> params) {
        Long id = params.get("id") != null ? Long.valueOf(params.get("id").toString()) : null;
        String printType = (String) params.get("printType");
        if (id == null) {
            return AjaxResult.error("销售台账ID不能为空");
        }
        if (printType == null || (!"label".equals(printType) && !"document".equals(printType))) {
            return AjaxResult.error("打印类型必须为 label 或 document");
        }
        salesLedgerService.incrementPrintCount(id, printType);
        return AjaxResult.success();
    }
@@ -342,6 +401,13 @@
        return AjaxResult.success();
    }
    @PostMapping("/scanShipApply")
    @ApiOperation("销售订单扫码-发起发货审批(填写车牌/快递、审批人、附件;通过后自动扣库存并标记已发货)")
    public AjaxResult scanShipApply(@RequestBody SalesScanShipDto dto) {
        salesLedgerService.scanShipApply(dto);
        return AjaxResult.success("发货审批已发起");
    }
    @PostMapping("/scanOutboundUnqualified")
    @ApiOperation("销售订单扫码-不合格出库")
    public AjaxResult scanOutboundUnqualified(@RequestBody SalesScanInboundDto dto) {
@@ -349,4 +415,32 @@
        return AjaxResult.success();
    }
    @PostMapping("/salesHistory/shippingImport")
    @ApiOperation("销售发货历史数据导入-已发货")
    public AjaxResult shippingImport(MultipartFile file) {
        salesLedgerService.shippingImport(file);
        return AjaxResult.success();
    }
    @PostMapping("/salesHistory/notShippingImport")
    @ApiOperation("销售发货历史数据导入-未发货")
    public AjaxResult notShippingImport(MultipartFile file) {
        salesLedgerService.notShippingImport(file);
        return AjaxResult.success();
    }
    @PostMapping("/salesHistory/shippingImportTemplate")
    @ApiOperation("销售发货历史数据导入-已发货导入模板下载")
    public void shippingImportTemplate(HttpServletResponse response) {
        ExcelUtil<SalesShippingImportDto> excelUtil = new ExcelUtil<>(SalesShippingImportDto.class);
        excelUtil.importTemplateExcel(response, "已出库导入模板下载");
    }
    @PostMapping("/salesHistory/notShippingImportTemplate")
    @ApiOperation("销售发货历史数据导入-未发货导入模板下载")
    public void notShippingImportTemplate(HttpServletResponse response) {
        ExcelUtil<SalesNotShippingImportDto> excelUtil = new ExcelUtil<>(SalesNotShippingImportDto.class);
        excelUtil.importTemplateExcel(response, "未出库导入模板下载");
    }
}