liu
10 天以前 dd1a51612fcd3c839d31dfa0df83b3d3071c8145
src/main/java/com/ruoyi/unattended/controller/UnattendedOperationController.java
@@ -39,7 +39,9 @@
    @PostMapping("/weighbridgeSystemAdd")
    @ApiOperation("新增")
    public AjaxResult add(@RequestBody UnattendedOperation unattendedOperation) {
        return AjaxResult.success(unattendedOperationService.save(unattendedOperation));
        UnattendedOperation result = unattendedOperationService.autoWeigh(unattendedOperation);
        unattendedOperationService.save(result);
        return AjaxResult.success(result);
    }
    /**
@@ -94,6 +96,45 @@
    }
    /**
     * 无人值守自动称重:计算净重、红外防作弊、订单匹配、生成磅单号/二维码并保存
     */
    @PostMapping("/weighbridgeAutoWeigh")
    @ApiOperation("自动称重")
    public AjaxResult autoWeigh(@RequestBody UnattendedOperation operation) {
        try {
            UnattendedOperation result = unattendedOperationService.autoWeigh(operation);
            unattendedOperationService.save(result);
            return AjaxResult.success(result);
        } catch (IllegalArgumentException e) {
            return AjaxResult.error(e.getMessage());
        }
    }
    /**
     * 推送 ERP
     */
    @PostMapping("/weighbridgePushErp/{id}")
    @ApiOperation("推送ERP")
    public AjaxResult pushErp(@PathVariable Long id) {
        try {
            return AjaxResult.success(unattendedOperationService.pushErp(id));
        } catch (IllegalArgumentException e) {
            return AjaxResult.error(e.getMessage());
        }
    }
    /**
     * 承运商绩效分析
     */
    @GetMapping("/carrierPerformance")
    @ApiOperation("承运商绩效分析")
    public AjaxResult carrierPerformance(String startDate, String endDate) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return AjaxResult.success(unattendedOperationService.carrierPerformance(
                LocalDateTime.parse(startDate, formatter), LocalDateTime.parse(endDate, formatter)));
    }
    /**
     *统计
     * @return
     */
@@ -105,7 +146,5 @@
        LocalDateTime endDateTime = LocalDateTime.parse(endDate, dateTimeFormatter);
        return AjaxResult.success(unattendedOperationService.weighbridgeDailyReport(startDateTime,endDateTime));
    }
}