| | |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 无人值守自动称重:计算净重、红外防作弊、订单匹配、生成磅单号/二维码并保存 |
| | | */ |
| | | @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 |
| | | */ |
| | |
| | | LocalDateTime endDateTime = LocalDateTime.parse(endDate, dateTimeFormatter); |
| | | return AjaxResult.success(unattendedOperationService.weighbridgeDailyReport(startDateTime,endDateTime)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |