| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | /********************************************************营销采购类**************************************************/ |
| | | @GetMapping("/supplierPurchaseRanking") |
| | | @Operation(summary = "供应商采购排名") |
| | | public R supplierPurchaseRanking(@DefaultType Integer type) { |
| | | List<SupplierPurchaseRankingDto> list = homeService.supplierPurchaseRanking(type); |
| | | public R supplierPurchaseRanking(@DefaultType Integer type, |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate) { |
| | | List<SupplierPurchaseRankingDto> list = homeService.supplierPurchaseRanking(type, startDate, endDate); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | @GetMapping("/customerContributionRanking") |
| | | @Operation(summary = "客户金额贡献排名") |
| | | public R customerContributionRanking(@DefaultType Integer type) { |
| | | List<CustomerContributionRankingDto> list = homeService.customerContributionRanking(type); |
| | | public R customerContributionRanking(@DefaultType Integer type, |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate) { |
| | | List<CustomerContributionRankingDto> list = homeService.customerContributionRanking(type, startDate, endDate); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/productSalesAnalysis") |
| | | @Operation(summary = "各产品销售金额分析") |
| | | public R productSalesAnalysis() { |
| | | List<MapDto> list = homeService.productSalesAnalysis(); |
| | | public R productSalesAnalysis( |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate) { |
| | | List<MapDto> list = homeService.productSalesAnalysis(startDate, endDate); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/rawMaterialPurchaseAmountRatio") |
| | | @Operation(summary = "原材料采购金额占比") |
| | | public R rawMaterialPurchaseAmountRatio(){ |
| | | List<MapDto> list = homeService.rawMaterialPurchaseAmountRatio(); |
| | | public R rawMaterialPurchaseAmountRatio( |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | List<MapDto> list = homeService.rawMaterialPurchaseAmountRatio(startDate, endDate); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | Integer queryStatus = resolveOrderStatus(status, tab); |
| | | |
| | | long safePageNum = pageNum == null || pageNum < 1 ? 1 : pageNum; |
| | | long safePageSize = pageSize == null || pageSize < 1 ? 10 : Math.min(pageSize, 50); |
| | | long offset = (safePageNum - 1) * safePageSize; |
| | | boolean queryAll = pageSize != null && pageSize == -1; |
| | | long safePageSize = queryAll ? -1 : (pageSize == null || pageSize < 1 ? 10 : Math.min(pageSize, 50)); |
| | | long offset = queryAll ? 0 : (safePageNum - 1) * safePageSize; |
| | | LocalDateTime startTime = queryDate == null ? null : queryDate.atStartOfDay(); |
| | | LocalDateTime endTime = queryDate == null ? null : queryDate.plusDays(1).atStartOfDay(); |
| | | |
| | |
| | | result.put("tab", mapOrderTab(queryStatus)); |
| | | result.put("status", mapOrderStatus(queryStatus)); |
| | | result.put("bizDate", queryDate == null ? null : queryDate.format(DATE_FORMATTER)); |
| | | result.put("total", toLong(productionOrderMapper.countHomeOrderProgress(queryStatus, startTime, endTime))); |
| | | result.put("total", toLong(productionOrderMapper.countHomeOrderProgress(null, startTime, endTime))); |
| | | result.put("pageNum", safePageNum); |
| | | result.put("pageSize", safePageSize); |
| | | result.put("waitingCount", waitingCount); |
| | |
| | | |
| | | @GetMapping("/salesPurchaseStorageProductCount") |
| | | @Operation(summary = "销售-采购-储存产品数") |
| | | public R salesPurchaseStorageProductCount(){ |
| | | List<MapDto> list = homeService.salesPurchaseStorageProductCount(); |
| | | public R salesPurchaseStorageProductCount( |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | List<MapDto> list = homeService.salesPurchaseStorageProductCount(startDate, endDate); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/productInOutAnalysis") |
| | | @Operation(summary = "产品出入库分析") |
| | | public R productInOutAnalysis(@DefaultType Integer type){ |
| | | List<Map<String, Object>> result = homeService.productInOutAnalysis(type); |
| | | public R productInOutAnalysis(@DefaultType Integer type, |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | List<Map<String, Object>> result = homeService.productInOutAnalysis(type, startDate, endDate); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/productTurnoverDays") |
| | | @Operation(summary = "产品周转天数") |
| | | public R productTurnoverDays(){ |
| | | List<MapDto> list = homeService.productTurnoverDays(); |
| | | public R productTurnoverDays( |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | List<MapDto> list = homeService.productTurnoverDays(startDate, endDate); |
| | | return R.ok(list); |
| | | } |
| | | |