From 3896ecbcd23cfbf58944fb7e4764169eb0286d79 Mon Sep 17 00:00:00 2001 From: chenlong Date: Thu, 19 Dec 2024 17:13:17 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=9A=84=E8=8A=82=E7=82=B9=E3=80=81=E5=BA=93=E4=BD=8D=E3=80=81?= =?UTF-8?q?=E5=B9=B2=E7=BA=BF=E4=BA=8B=E4=B8=9A=E7=BA=BF=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LargeScreenController.java | 25 ++++-- .../mapper/largeScreen/BinLocationMapper.java | 17 ++++ .../mapper/largeScreen/BinLocationMapper.xml | 16 ++++ .../largeScreen/CarsLoadDataMapper.java | 8 +- .../mapper/largeScreen/CarsLoadDataMapper.xml | 24 +++++- .../mapper/largeScreen/NodeDataMapper.java | 13 +++ .../mapper/largeScreen/NodeDataMapper.xml | 24 ++++++ .../largeScreen/IBinLocationService.java | 7 ++ .../service/largeScreen/INodeDataService.java | 7 ++ .../impl/BinLocationServiceImpl.java | 28 ++++++ .../impl/CarsLoadDataServiceImpl.java | 85 +++++++++++++++++-- .../impl/MapWarehouseServiceImpl.java | 8 +- .../largeScreen/impl/NodeDataServiceImpl.java | 35 ++++++++ ...{CareerLineInfoVO.java => DeptInfoVO.java} | 4 +- .../CareerLineData/VehicleStowageDataVO.java | 15 ++++ .../VehicleStowageMonthDataVo.java | 17 ++++ .../CareerLineData/WarehouseDeptVO.java | 11 +++ .../vo/largeScreen/CareerLineDataVO.java | 15 ++++ 18 files changed, 338 insertions(+), 21 deletions(-) create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java rename blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/{CareerLineInfoVO.java => DeptInfoVO.java} (72%) create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java index 485712f06..daafd405c 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java @@ -2,11 +2,11 @@ package com.logpm.report.controller; import com.logpm.report.service.largeScreen.IBillingDataService; +import com.logpm.report.service.largeScreen.ICarsLoadDataService; import com.logpm.report.service.largeScreen.IMapWarehouseService; -import com.logpm.report.vo.largeScreen.BillingDataVO; -import com.logpm.report.vo.largeScreen.MapWarehouseVO; -import com.logpm.report.vo.largeScreen.MonthBillingDataVO; -import com.logpm.report.vo.largeScreen.WarehouseBillingDataVO; +import com.logpm.report.service.largeScreen.INodeDataService; +import com.logpm.report.service.largeScreen.impl.BinLocationServiceImpl; +import com.logpm.report.vo.largeScreen.*; import io.swagger.annotations.Api; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; @@ -25,6 +25,9 @@ public class LargeScreenController{ private final IMapWarehouseService mapWarehouseService; private final IBillingDataService billingDataService; + private final ICarsLoadDataService CarsLoad; + private final INodeDataService nodeData; + private final BinLocationServiceImpl BinLocation; /** * 地图仓库数据 @@ -62,7 +65,17 @@ public class LargeScreenController{ * 事业线配载件量趋势 */ @GetMapping("/careerLineData") - public R> getCareerLineData(){ - return R.data(billingDataService.getMonthBillingData()); + public R> getCareerLineData(){ + return R.data(CarsLoad.getCareerLineData()); + } + + @GetMapping("/nodeData") + public R getNodeData(){ + return R.data(nodeData.getNodeData()); + } + + @GetMapping("/binLocationData") + public R getBinLocationData(){ + return R.data(BinLocation.getBinLocationData()); } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java new file mode 100644 index 000000000..afd290a58 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java @@ -0,0 +1,17 @@ +package com.logpm.report.mapper.largeScreen; + + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface BinLocationMapper { + // 在库订单数 + Integer getOrderNum(); + // 包裹数 + Integer getPackageNum(); + // 货柜数 + Integer getBinLocationNum(); + // 使用货柜数 + // 空闲货柜数 + Integer getIdleBinLocationNum(); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml new file mode 100644 index 000000000..2bc5bbbe2 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java index 377dba328..fdf981cf6 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java @@ -1,14 +1,18 @@ package com.logpm.report.mapper.largeScreen; -import com.logpm.report.vo.largeScreen.CareerLineData.CareerLineInfoVO; +import com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO; +import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO; +import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper public interface CarsLoadDataMapper { - public List getCareerLineInfo(); + public List getDeptInfo(); + public List getVehicleStowageData(String startTime, String endTime); + public List getWarehouseDept(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml index 4de3891d4..b94adf4b6 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml @@ -1,11 +1,27 @@ - SELECT id, - dept_name as deptName + dept_name as deptName, + parent_id as parentId FROM logpm.blade_dept - WHERE dept_category = 2 AND dept_name like '%事业线%' + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java new file mode 100644 index 000000000..fdc26a361 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java @@ -0,0 +1,13 @@ +package com.logpm.report.mapper.largeScreen; + + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface NodeDataMapper { + public Integer getWaybill(String startTime, String endTime); + public Integer getCarsLoadLoading(String startTime, String endTime); + public Integer getDeliveryLading(String startTime, String endTime); + public Integer getArrival(String startTime, String endTime); + public Integer getSign(String startTime, String endTime); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml new file mode 100644 index 000000000..3dbc89abc --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java new file mode 100644 index 000000000..e40f35c7a --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java @@ -0,0 +1,7 @@ +package com.logpm.report.service.largeScreen; + +import com.logpm.report.vo.largeScreen.BinLocationDataVO; + +public interface IBinLocationService { + BinLocationDataVO getBinLocationData(); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java new file mode 100644 index 000000000..4c8be9126 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java @@ -0,0 +1,7 @@ +package com.logpm.report.service.largeScreen; + +import com.logpm.report.vo.largeScreen.NodeDataVO; + +public interface INodeDataService { + NodeDataVO getNodeData(); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java new file mode 100644 index 000000000..cb062aad8 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java @@ -0,0 +1,28 @@ +package com.logpm.report.service.largeScreen.impl; + +import com.logpm.report.mapper.largeScreen.BinLocationMapper; +import com.logpm.report.service.largeScreen.IBinLocationService; +import com.logpm.report.vo.largeScreen.BinLocationDataVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + + +@AllArgsConstructor +@Service +@Log4j2 +public class BinLocationServiceImpl implements IBinLocationService { + private BinLocationMapper binLocationMapper; + + public BinLocationDataVO getBinLocationData() { + + BinLocationDataVO binLocationDataVO = new BinLocationDataVO(); + binLocationDataVO.setOrderNum(binLocationMapper.getOrderNum()); + binLocationDataVO.setPackageNum(binLocationMapper.getPackageNum()); + binLocationDataVO.setBinLocationNum(binLocationMapper.getBinLocationNum()); + binLocationDataVO.setUseBinLocationNum(binLocationMapper.getBinLocationNum() - binLocationMapper.getIdleBinLocationNum()); + binLocationDataVO.setIdleBinLocationNum(binLocationMapper.getIdleBinLocationNum()); + + return binLocationDataVO; + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java index e8c328e3b..afd07cc70 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java @@ -2,14 +2,19 @@ package com.logpm.report.service.largeScreen.impl; import com.logpm.report.mapper.largeScreen.CarsLoadDataMapper; import com.logpm.report.service.largeScreen.ICarsLoadDataService; -import com.logpm.report.vo.largeScreen.CareerLineData.CareerLineInfoVO; +import com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO; +import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO; +import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageMonthDataVo; +import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO; import com.logpm.report.vo.largeScreen.CareerLineDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; -import java.util.Collections; -import java.util.List; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; @AllArgsConstructor @Service @@ -21,9 +26,79 @@ public class CarsLoadDataServiceImpl implements ICarsLoadDataService { @Override public List getCareerLineData() { - List careerLineInfo = carsLoadDataMapper.getCareerLineInfo(); + Map careerLineMap = analysisCareerLineByDept(carsLoadDataMapper.getDeptInfo()); + Map warehouseDept = carsLoadDataMapper.getWarehouseDept().stream() + .filter(WarehouseDeptVO -> WarehouseDeptVO.getDept() != null) + .collect(Collectors.toMap(WarehouseDeptVO::getWarehouseId, WarehouseDeptVO::getDept)); + List vehicleStowageData = carsLoadDataMapper.getVehicleStowageData( + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")), + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")) + ); + HashMap resultMap = new HashMap<>(); - return Collections.emptyList(); + for (VehicleStowageDataVO vehicleStowageDataVO : vehicleStowageData) { + Long DeptId = warehouseDept.get(vehicleStowageDataVO.getWarehouseId()); + if (!careerLineMap.containsKey(DeptId)) { + log.info("未找到事业线:" + DeptId); + continue; + } + + DeptInfoVO careerLine = careerLineMap.get(DeptId); + if (!resultMap.containsKey(careerLine.getId())) { + resultMap.put(careerLine.getId(), new CareerLineDataVO(careerLine.getDeptName(), monthDataInit())); + } + + resultMap.get(careerLine.getId()).getMonthData().forEach(vehicleStowageMonthDataVo -> { + if (vehicleStowageDataVO.getCreateMonth().equals(vehicleStowageMonthDataVo.getCreateMonth())) { + vehicleStowageMonthDataVo.setTotal(vehicleStowageMonthDataVo.getTotal() + vehicleStowageDataVO.getTotal()); + } + }); + } + + return new ArrayList<>(resultMap.values()); + } + + + private List monthDataInit(){ + String year = String.valueOf(LocalDate.now().getYear()); + List vehicleStowageMonthDataVos = new ArrayList<>(); + for (int i = 1; i <= 12; i++) { + vehicleStowageMonthDataVos.add(new VehicleStowageMonthDataVo(year + "-" + String.format("%02d", i), 0)); + } + return vehicleStowageMonthDataVos; + } + + + /** + * 根据部门id获取事业线信息 + * @param deptInfo 所有部门信息 + */ + private Map analysisCareerLineByDept(List deptInfo) { + + Map deptInfoVOMap = deptInfo.stream().collect(Collectors.toMap(DeptInfoVO::getId, deptInfoVO -> deptInfoVO)); + Map careerLineMap = new HashMap<>(); + + deptInfo.forEach(deptInfoVO -> { + if (deptInfoVO.getDeptName().contains("事业线")) { + careerLineMap.put(deptInfoVO.getId(), deptInfoVO); + return; + } + Long parentId = deptInfoVO.getParentId(); + + while (deptInfoVOMap.containsKey(parentId)) { + + if (deptInfoVOMap.get(parentId).getDeptName().contains("事业线")) { + careerLineMap.put(deptInfoVO.getId(), deptInfoVOMap.get(parentId)); + return; + } + parentId = deptInfoVOMap.get(parentId).getParentId(); + } + + careerLineMap.put(deptInfoVO.getId(), deptInfoVO); + }); + + + return careerLineMap; } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java index ff49dbf19..a6f177030 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java @@ -11,6 +11,9 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -25,10 +28,9 @@ public class MapWarehouseServiceImpl implements IMapWarehouseService { public List list() { List warehouselist = mapWarehouseMapper.warehouselist(); List lineInfoVOS = mapWarehouseMapper.lineInfolist( - DateUtil.format(new Date(), "yyyy-10-dd 00:00:00"), - DateUtil.format(new Date(), "yyyy-MM-dd 23:59:59") + LocalDateTime.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59")) ); - log.info("lineInfoVOS:{}", lineInfoVOS); Map> warehouseLine = lineInfoVOS.stream().collect(Collectors.groupingBy(LineInfoVO::getStartWarehouseId)); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java new file mode 100644 index 000000000..39af61d94 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java @@ -0,0 +1,35 @@ +package com.logpm.report.service.largeScreen.impl; + +import com.logpm.report.mapper.largeScreen.NodeDataMapper; +import com.logpm.report.service.largeScreen.INodeDataService; +import com.logpm.report.vo.largeScreen.NodeDataVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@AllArgsConstructor +@Log4j2 +@Service +public class NodeDataServiceImpl implements INodeDataService { + + private final NodeDataMapper nodeDataMapper; + + @Override + public NodeDataVO getNodeData() { + + String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")); + String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")); + + NodeDataVO nodeDataVO = new NodeDataVO(); + nodeDataVO.setWaybill(nodeDataMapper.getWaybill(startTime, endTime)); + nodeDataVO.setCarsLoadLoading(nodeDataMapper.getCarsLoadLoading(startTime, endTime)); + nodeDataVO.setDeliveryLading(nodeDataMapper.getDeliveryLading(startTime, endTime)); + nodeDataVO.setArrival(nodeDataMapper.getArrival(startTime, endTime)); + nodeDataVO.setSign(nodeDataMapper.getSign(startTime, endTime)); + + return nodeDataVO; + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/CareerLineInfoVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/DeptInfoVO.java similarity index 72% rename from blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/CareerLineInfoVO.java rename to blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/DeptInfoVO.java index f212a9257..f8821eec4 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/CareerLineInfoVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/DeptInfoVO.java @@ -4,8 +4,10 @@ package com.logpm.report.vo.largeScreen.CareerLineData; import lombok.Data; @Data -public class CareerLineInfoVO { +public class DeptInfoVO { public String deptName; + public Long parentId; + public Long id; } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java new file mode 100644 index 000000000..5f0729788 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java @@ -0,0 +1,15 @@ +package com.logpm.report.vo.largeScreen.CareerLineData; + + +import lombok.Data; + +import java.util.List; + +@Data +public class VehicleStowageDataVO { + private Long warehouseId; + + private String createMonth; + + private Integer total; +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java new file mode 100644 index 000000000..f1d6cdece --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java @@ -0,0 +1,17 @@ +package com.logpm.report.vo.largeScreen.CareerLineData; + + +import lombok.Data; + +@Data +public class VehicleStowageMonthDataVo { + + private String createMonth; + + private Integer total; + + public VehicleStowageMonthDataVo(String createMonth, Integer total){ + this.createMonth = createMonth; + this.total = total; + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java new file mode 100644 index 000000000..365fd622f --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java @@ -0,0 +1,11 @@ +package com.logpm.report.vo.largeScreen.CareerLineData; + + +import lombok.Data; + +@Data +public class WarehouseDeptVO { + private Long dept; + + private Long warehouseId; +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java index 9b72c96e3..2677205d0 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java @@ -1,7 +1,22 @@ package com.logpm.report.vo.largeScreen; +import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageMonthDataVo; +import lombok.Data; + +import java.util.List; + /** * 事业线车辆配载数据 */ +@Data public class CareerLineDataVO { + + private String careerLineName; + + private List monthData; + + public CareerLineDataVO(String careerLineName, List monthData) { + this.careerLineName = careerLineName; + this.monthData = monthData; + } } From e54f6eeaf818aa1109dc251b1409cae12a8edb68 Mon Sep 17 00:00:00 2001 From: chenlong Date: Fri, 20 Dec 2024 13:50:34 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E9=80=81,=E4=B8=9A=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LargeScreenController.java | 50 ++++++++++++++++--- .../largeScreen/BusinessRatioMapper.java | 15 ++++++ .../largeScreen/BusinessRatioMapper.xml | 20 ++++++++ .../largeScreen/CarsLoadDataMapper.java | 1 + .../mapper/largeScreen/CarsLoadDataMapper.xml | 8 +++ .../largeScreen/DeliveryDataMapper.java | 11 ++++ .../mapper/largeScreen/DeliveryDataMapper.xml | 33 ++++++++++++ .../mapper/largeScreen/TrunkDataMapper.java | 10 ++++ .../mapper/largeScreen/TrunkDataMapper.xml | 25 ++++++++++ .../largeScreen/IBusinessRationService.java | 8 +++ .../largeScreen/ICarsLoadDataService.java | 2 +- .../largeScreen/IDeliveryDataService.java | 8 +++ .../largeScreen/ITrunkDataService.java | 8 +++ .../impl/BusinessRationServiceImpl.java | 31 ++++++++++++ .../impl/CarsLoadDataServiceImpl.java | 12 +++-- .../impl/DeliveryDataServiceImpl.java | 45 +++++++++++++++++ .../impl/TrunkDataServiceImpl.java | 33 ++++++++++++ .../largeScreen/BusinessRatio/ItemDataVO.java | 11 ++++ .../vo/largeScreen/BusinessRatioDataVO.java | 14 ++++++ .../report/vo/largeScreen/DeliveryDataVO.java | 33 ++++++++++++ 20 files changed, 365 insertions(+), 13 deletions(-) create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBusinessRationService.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IDeliveryDataService.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ITrunkDataService.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java index daafd405c..7367ed19a 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java @@ -1,15 +1,15 @@ package com.logpm.report.controller; -import com.logpm.report.service.largeScreen.IBillingDataService; -import com.logpm.report.service.largeScreen.ICarsLoadDataService; -import com.logpm.report.service.largeScreen.IMapWarehouseService; -import com.logpm.report.service.largeScreen.INodeDataService; +import com.logpm.report.service.largeScreen.*; import com.logpm.report.service.largeScreen.impl.BinLocationServiceImpl; import com.logpm.report.vo.largeScreen.*; import io.swagger.annotations.Api; import lombok.AllArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springblade.core.tool.api.R; +import org.springframework.data.repository.query.Param; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -23,11 +23,15 @@ import java.util.List; @AllArgsConstructor public class LargeScreenController{ + private static final Logger log = LoggerFactory.getLogger(LargeScreenController.class); private final IMapWarehouseService mapWarehouseService; private final IBillingDataService billingDataService; private final ICarsLoadDataService CarsLoad; private final INodeDataService nodeData; - private final BinLocationServiceImpl BinLocation; + private final IBinLocationService BinLocation; + private final ITrunkDataService trunkData; + private final IDeliveryDataService deliveryDataService; + private final IBusinessRationService businessRatio; /** * 地图仓库数据 @@ -65,17 +69,49 @@ public class LargeScreenController{ * 事业线配载件量趋势 */ @GetMapping("/careerLineData") - public R> getCareerLineData(){ - return R.data(CarsLoad.getCareerLineData()); + public R> getCareerLineData(@Param("isDelivery") Integer isDelivery){ + return R.data(CarsLoad.getCareerLineData(isDelivery)); } + /** + * 节点数据 + */ @GetMapping("/nodeData") public R getNodeData(){ return R.data(nodeData.getNodeData()); } + /** + * 库位数据 + */ @GetMapping("/binLocationData") public R getBinLocationData(){ return R.data(BinLocation.getBinLocationData()); } + + /** + * 干线车次数据 + */ + @GetMapping("/trunkData") + public R getTrunkData(){ + return R.data(trunkData.getTrunkData()); + } + + /** + * 配送数据 + * @param isYear 是否是年数据 1是 + */ + @GetMapping("/deliveryData") + public R getDeliveryData(@Param("isYear") Integer isYear){ + log.info("getDeliveryData: isYear={}", isYear); + return R.data(deliveryDataService.getDeliveryAllData(isYear)); + } + + /** + * 业务占比 + */ + @GetMapping("/businessRatio") + public R getDeliveryData2B(){ + return R.data(businessRatio.getBusinessRatioData()); + } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java new file mode 100644 index 000000000..251a4c3d6 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java @@ -0,0 +1,15 @@ +package com.logpm.report.mapper.largeScreen; + + +import com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BusinessRatioMapper { + + List getTypeData(String startTime, String endTime); + + List getBrandData(String startTime, String endTime); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml new file mode 100644 index 000000000..9362ed39a --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java index fdf981cf6..870225a56 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java @@ -13,6 +13,7 @@ public interface CarsLoadDataMapper { public List getDeptInfo(); public List getVehicleStowageData(String startTime, String endTime); + public List getDeliveryData(String startTime, String endTime); public List getWarehouseDept(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml index b94adf4b6..981c5cc28 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml @@ -24,4 +24,12 @@ department as dept from logpm_platform.logpm_warehouse_warehouse + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java new file mode 100644 index 000000000..d50b5c2a8 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java @@ -0,0 +1,11 @@ +package com.logpm.report.mapper.largeScreen; + +import com.logpm.report.vo.largeScreen.DeliveryDataVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DeliveryDataMapper { + public DeliveryDataVO getDeliveryAllData(String startTime, String endTime); + public DeliveryDataVO getDelivery2BData(String startTime, String endTime); + public DeliveryDataVO getDelivery2CData(String startTime, String endTime); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml new file mode 100644 index 000000000..9d4e6d450 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml @@ -0,0 +1,33 @@ + + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java new file mode 100644 index 000000000..de5b1220f --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java @@ -0,0 +1,10 @@ +package com.logpm.report.mapper.largeScreen; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface TrunkDataMapper { + public Integer getTotal(String startTime, String endTime); + public Integer getOnTheWay(); + public Integer getArrival(String startTime, String endTime); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml new file mode 100644 index 000000000..f10b15961 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBusinessRationService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBusinessRationService.java new file mode 100644 index 000000000..d33922e45 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBusinessRationService.java @@ -0,0 +1,8 @@ +package com.logpm.report.service.largeScreen; + +import com.logpm.report.vo.largeScreen.BusinessRatioDataVO; + +public interface IBusinessRationService { + + BusinessRatioDataVO getBusinessRatioData(); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java index 6e27b53dd..521ffe3ef 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java @@ -11,5 +11,5 @@ import java.util.List; public interface ICarsLoadDataService { - public List getCareerLineData(); + public List getCareerLineData(Integer isDelivery); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IDeliveryDataService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IDeliveryDataService.java new file mode 100644 index 000000000..6a3027aef --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IDeliveryDataService.java @@ -0,0 +1,8 @@ +package com.logpm.report.service.largeScreen; + + +import com.logpm.report.vo.largeScreen.DeliveryDataVO; + +public interface IDeliveryDataService { + DeliveryDataVO getDeliveryAllData(Integer isYear); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ITrunkDataService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ITrunkDataService.java new file mode 100644 index 000000000..51e4a7a12 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ITrunkDataService.java @@ -0,0 +1,8 @@ +package com.logpm.report.service.largeScreen; + +import com.logpm.report.vo.largeScreen.TrunkDataVO; + +public interface ITrunkDataService { + + public TrunkDataVO getTrunkData(); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java new file mode 100644 index 000000000..cc5424380 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java @@ -0,0 +1,31 @@ +package com.logpm.report.service.largeScreen.impl; + +import com.logpm.report.mapper.largeScreen.BusinessRatioMapper; +import com.logpm.report.service.largeScreen.IBusinessRationService; +import com.logpm.report.vo.largeScreen.BusinessRatioDataVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@AllArgsConstructor +@Service +@Log4j2 +public class BusinessRationServiceImpl implements IBusinessRationService { + + private final BusinessRatioMapper businessRatioMapper; + + @Override + public BusinessRatioDataVO getBusinessRatioData() { + String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")); + String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")); + + BusinessRatioDataVO businessRatioDataVO = new BusinessRatioDataVO(); + businessRatioDataVO.setType(businessRatioMapper.getTypeData(startTime, endTime)); + businessRatioDataVO.setBrand(businessRatioMapper.getBrandData(startTime, endTime)); + + return businessRatioDataVO; + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java index afd07cc70..c6420ea7e 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java @@ -24,17 +24,19 @@ public class CarsLoadDataServiceImpl implements ICarsLoadDataService { private CarsLoadDataMapper carsLoadDataMapper; @Override - public List getCareerLineData() { + public List getCareerLineData(Integer isDelivery) { Map careerLineMap = analysisCareerLineByDept(carsLoadDataMapper.getDeptInfo()); Map warehouseDept = carsLoadDataMapper.getWarehouseDept().stream() .filter(WarehouseDeptVO -> WarehouseDeptVO.getDept() != null) .collect(Collectors.toMap(WarehouseDeptVO::getWarehouseId, WarehouseDeptVO::getDept)); - List vehicleStowageData = carsLoadDataMapper.getVehicleStowageData( - LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")), - LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")) - ); + String startTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")); + String endTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")); + List vehicleStowageData = isDelivery.equals(1) + ? carsLoadDataMapper.getDeliveryData(startTime, endTime) + : carsLoadDataMapper.getVehicleStowageData(startTime, endTime); + HashMap resultMap = new HashMap<>(); for (VehicleStowageDataVO vehicleStowageDataVO : vehicleStowageData) { diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java new file mode 100644 index 000000000..d3de4f0e6 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java @@ -0,0 +1,45 @@ +package com.logpm.report.service.largeScreen.impl; + +import com.logpm.report.mapper.largeScreen.DeliveryDataMapper; +import com.logpm.report.service.largeScreen.IDeliveryDataService; +import com.logpm.report.vo.largeScreen.DeliveryDataVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@AllArgsConstructor +@Service +@Log4j2 +public class DeliveryDataServiceImpl implements IDeliveryDataService { + + private final DeliveryDataMapper deliveryDataMapper; + + @Override + public DeliveryDataVO getDeliveryAllData(Integer isYear) { + + DeliveryDataVO deliveryDataVO = new DeliveryDataVO(); + String startTime = isYear.equals(1) ? LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")) : null; + String endTime = isYear.equals(1) ? LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")) : null; + + DeliveryDataVO deliveryAllData = deliveryDataMapper.getDeliveryAllData(startTime, endTime); + DeliveryDataVO delivery2CData = deliveryDataMapper.getDelivery2CData(startTime, endTime); + DeliveryDataVO delivery2BData = deliveryDataMapper.getDelivery2BData(startTime, endTime); + + deliveryDataVO.setTotal(deliveryAllData.getTotal()); + deliveryDataVO.setToBeSigned(deliveryAllData.getToBeSigned()); + deliveryDataVO.setSigned(deliveryAllData.getTotal() - deliveryAllData.getToBeSigned()); + + deliveryDataVO.setTotal2B(delivery2BData.getTotal2B()); + deliveryDataVO.setToBeSigned2B(delivery2BData.getToBeSigned2B()); + deliveryDataVO.setSigned2B(delivery2BData.getTotal2B() - delivery2BData.getToBeSigned2B()); + + deliveryDataVO.setTotal2C(delivery2CData.getTotal2C()); + deliveryDataVO.setToBeSigned2C(delivery2CData.getToBeSigned2C()); + deliveryDataVO.setSigned2C(delivery2CData.getTotal2C() - delivery2CData.getToBeSigned2C()); + + return deliveryDataVO; + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java new file mode 100644 index 000000000..65159ab61 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java @@ -0,0 +1,33 @@ +package com.logpm.report.service.largeScreen.impl; + +import com.logpm.report.mapper.largeScreen.TrunkDataMapper; +import com.logpm.report.service.largeScreen.ITrunkDataService; +import com.logpm.report.vo.largeScreen.TrunkDataVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + + +@AllArgsConstructor +@Service +@Log4j2 +public class TrunkDataServiceImpl implements ITrunkDataService { + + private final TrunkDataMapper trunkDataMapper; + + @Override + public TrunkDataVO getTrunkData() { + String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")); + String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")); + + TrunkDataVO trunkDataVO = new TrunkDataVO(); + trunkDataVO.setTotal(trunkDataMapper.getTotal(startTime, endTime)); + trunkDataVO.setOnTheWay(trunkDataMapper.getOnTheWay()); + trunkDataVO.setArrival(trunkDataMapper.getArrival(startTime, endTime)); + + return trunkDataVO; + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java new file mode 100644 index 000000000..afb3999d1 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java @@ -0,0 +1,11 @@ +package com.logpm.report.vo.largeScreen.BusinessRatio; + + +import lombok.Data; + +@Data +public class ItemDataVO { + private String name; + + private Integer value; +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java new file mode 100644 index 000000000..3be043f3f --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java @@ -0,0 +1,14 @@ +package com.logpm.report.vo.largeScreen; + +import com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO; +import lombok.Data; + +import java.util.List; + +@Data +public class BusinessRatioDataVO { + + private List type; + + private List brand; +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java index f2a7e28d6..f4f5fa3ce 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java @@ -11,4 +11,37 @@ public class DeliveryDataVO { /** * 配送总数 */ + private Integer total; + /** + * 待签数 + */ + private Integer toBeSigned; + /** + * 已签数 + */ + private Integer signed; + /** + * 2B总数 + */ + private Integer total2B; + /** + * 2B已签数 + */ + private Integer signed2B; + /** + * 2B待签数 + */ + private Integer toBeSigned2B; + /** + * 2C总数 + */ + private Integer total2C; + /** + * 2C已签数 + */ + private Integer signed2C; + /** + * 2C待签数 + */ + private Integer toBeSigned2C; } From a52cfac5888e2c19b3d17a823d1a8dc3294b962f Mon Sep 17 00:00:00 2001 From: chenlong Date: Fri, 20 Dec 2024 15:34:13 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=9A=84xxljob?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/entity/LargeScreenDataEntity.java | 41 +++++++++++ blade-service/logpm-report/pom.xml | 4 ++ .../controller/LargeScreenController.java | 34 ++++++++- .../report/job/LargeScreenQueryXxlJob.java | 70 +++++++++++++++++++ .../largeScreen/LargeScreenDataMapper.java | 10 +++ .../httpImpl/BillingDataServiceImpl.java | 63 +++++++++++++++++ .../httpImpl/BinLocationServiceImpl.java | 32 +++++++++ .../httpImpl/BusinessRationServiceImpl.java | 34 +++++++++ .../httpImpl/CarsLoadDataServiceImpl.java | 48 +++++++++++++ .../httpImpl/DeliveryDataServiceImpl.java | 38 ++++++++++ .../httpImpl/MapWarehouseServiceImpl.java | 42 +++++++++++ .../httpImpl/NodeDataServiceImpl.java | 32 +++++++++ .../httpImpl/TrunkDataServiceImpl.java | 37 ++++++++++ .../impl/BillingDataServiceImpl.java | 4 +- .../impl/BinLocationServiceImpl.java | 2 + .../impl/BusinessRationServiceImpl.java | 2 + .../impl/CarsLoadDataServiceImpl.java | 2 + .../impl/DeliveryDataServiceImpl.java | 2 + .../impl/MapWarehouseServiceImpl.java | 2 + .../largeScreen/impl/NodeDataServiceImpl.java | 2 + .../impl/TrunkDataServiceImpl.java | 2 + .../report/vo/largeScreen/XxlJobQueryVO.java | 66 +++++++++++++++++ 22 files changed, 567 insertions(+), 2 deletions(-) create mode 100644 blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java diff --git a/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java b/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java new file mode 100644 index 000000000..a5504d82a --- /dev/null +++ b/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java @@ -0,0 +1,41 @@ +package com.logpm.report.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.util.Map; + +@Data +@TableName("logpm_large_screen_data") +@EqualsAndHashCode(callSuper = true) +@AllArgsConstructor +public class LargeScreenDataEntity extends TenantEntity { + + /** 预留1 */ + @ApiModelProperty(name = "预留1",notes = "") + private String reserve1 ; + /** 预留2 */ + @ApiModelProperty(name = "预留2",notes = "") + private String reserve2 ; + /** 预留3 */ + @ApiModelProperty(name = "预留3",notes = "") + private String reserve3 ; + /** 预留4 */ + @ApiModelProperty(name = "预留4",notes = "") + private String reserve4 ; + /** 预留5 */ + @ApiModelProperty(name = "预留5",notes = "") + private String reserve5 ; + + @ApiModelProperty(name = "数据",notes = "") + private Map data; + + public LargeScreenDataEntity(Map data) { + this.data = data; + } +} diff --git a/blade-service/logpm-report/pom.xml b/blade-service/logpm-report/pom.xml index 0fcdb9ef7..ae7ed3676 100644 --- a/blade-service/logpm-report/pom.xml +++ b/blade-service/logpm-report/pom.xml @@ -48,6 +48,10 @@ logpm-factory-data-api 3.2.0.RELEASE + + com.xuxueli + xxl-job-core + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java index 7367ed19a..ee89b4b2e 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java @@ -9,18 +9,19 @@ import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springblade.core.tool.api.R; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.repository.query.Param; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.util.List; @RestController @RequestMapping("/largeScreen") @Api(value = "大屏数据", tags = "大屏数据") -@AllArgsConstructor public class LargeScreenController{ private static final Logger log = LoggerFactory.getLogger(LargeScreenController.class); @@ -33,6 +34,37 @@ public class LargeScreenController{ private final IDeliveryDataService deliveryDataService; private final IBusinessRationService businessRatio; + + public LargeScreenController( + // 正式使用是使用这个 +// @Qualifier(value = "mapWarehouseServiceHttp") IMapWarehouseService mapWarehouseService, +// @Qualifier(value = "billingDataServiceHttp") IBillingDataService billingDataService, +// @Qualifier(value = "carsLoadDataServiceHttp") ICarsLoadDataService carsLoadDataService, +// @Qualifier(value = "nodeDataServiceHttp") INodeDataService nodeData, +// @Qualifier(value = "binLocationServiceHttp") IBinLocationService binLocation, +// @Qualifier(value = "trunkDataServiceHttp") ITrunkDataService trunkData, +// @Qualifier(value = "deliveryDataServiceHttp") IDeliveryDataService deliveryDataService, +// @Qualifier(value = "businessRationServiceHttp") IBusinessRationService businessRatio + IMapWarehouseService mapWarehouseService, + IBillingDataService billingDataService, + ICarsLoadDataService carsLoadDataService, + INodeDataService nodeData, + IBinLocationService binLocation, + ITrunkDataService trunkData, + IDeliveryDataService deliveryDataService, + IBusinessRationService businessRatio + ) { + this.mapWarehouseService = mapWarehouseService; + this.billingDataService = billingDataService; + this.CarsLoad = carsLoadDataService; + this.nodeData = nodeData; + this.BinLocation = binLocation; + this.trunkData = trunkData; + this.deliveryDataService = deliveryDataService; + this.businessRatio = businessRatio; + } + + /** * 地图仓库数据 */ diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java b/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java new file mode 100644 index 000000000..39a5bfd99 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java @@ -0,0 +1,70 @@ +package com.logpm.report.job; + + +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.service.largeScreen.*; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Component; + +import java.util.HashMap; + +/** + * 大屏数据查询job + */ +@AllArgsConstructor +@Component +@Log4j2 +public class LargeScreenQueryXxlJob { + + private final IMapWarehouseService mapWarehouseService; + private final IBillingDataService billingDataService; + private final ICarsLoadDataService CarsLoad; + private final INodeDataService nodeData; + private final IBinLocationService BinLocation; + private final ITrunkDataService trunkData; + private final IDeliveryDataService deliveryDataService; + private final IBusinessRationService businessRatio; + + private final LargeScreenDataMapper largeScreenDataMapper; + + /** + * 数据查询 + */ + @XxlJob("LargeScreenQuery") + public void query() + { + XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO(); + xxlJobQueryVO.setMapWarehouse(mapWarehouseService.list()); + xxlJobQueryVO.setBillingData(billingDataService.getBillingData()); + xxlJobQueryVO.setCareerLineDeliveryData(CarsLoad.getCareerLineData(1)); + xxlJobQueryVO.setCareerLineData(CarsLoad.getCareerLineData(0)); + xxlJobQueryVO.setNodeData(nodeData.getNodeData()); + xxlJobQueryVO.setBinLocationData(BinLocation.getBinLocationData()); + xxlJobQueryVO.setTrunkData(trunkData.getTrunkData()); + xxlJobQueryVO.setDeliveryData(deliveryDataService.getDeliveryAllData(0)); + xxlJobQueryVO.setDeliveryYearData(deliveryDataService.getDeliveryAllData(1)); + xxlJobQueryVO.setBusinessRatio(businessRatio.getBusinessRatioData()); + xxlJobQueryVO.setWarehouseBillingData(billingDataService.getWarehouseBillingData()); + xxlJobQueryVO.setMonthBillingData(billingDataService.getMonthBillingData()); + + HashMap data = new HashMap<>(); + data.put("mapWarehouse", xxlJobQueryVO.getMapWarehouse()); + data.put("billingData", xxlJobQueryVO.getBillingData()); + data.put("warehouseBillingData", xxlJobQueryVO.getWarehouseBillingData()); + data.put("monthBillingData", xxlJobQueryVO.getMonthBillingData()); + data.put("careerLineData", xxlJobQueryVO.getCareerLineData()); + data.put("careerLineDeliveryData", xxlJobQueryVO.getCareerLineDeliveryData()); + data.put("nodeData", xxlJobQueryVO.getNodeData()); + data.put("binLocationData", xxlJobQueryVO.getBinLocationData()); + data.put("trunkData", xxlJobQueryVO.getTrunkData()); + data.put("deliveryData", xxlJobQueryVO.getDeliveryData()); + data.put("deliveryYearData", xxlJobQueryVO.getDeliveryYearData()); + data.put("businessRatio", xxlJobQueryVO.getBusinessRatio()); + + largeScreenDataMapper.insert(new LargeScreenDataEntity(data)); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java new file mode 100644 index 000000000..dbf06b11d --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java @@ -0,0 +1,10 @@ +package com.logpm.report.mapper.largeScreen; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.report.entity.LargeScreenDataEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface LargeScreenDataMapper extends BaseMapper { + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java new file mode 100644 index 000000000..199f082f7 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java @@ -0,0 +1,63 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.BillingDataMapper; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.mapper.largeScreen.MapWarehouseMapper; +import com.logpm.report.service.largeScreen.IBillingDataService; +import com.logpm.report.vo.largeScreen.BillingDataVO; +import com.logpm.report.vo.largeScreen.MapWarehouse.WarehouseInfoVO; +import com.logpm.report.vo.largeScreen.MonthBillingDataVO; +import com.logpm.report.vo.largeScreen.WarehouseBillingDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import com.logpm.report.vo.largeScreen.billingData.BillingDataInfoVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service("billingDataServiceHttp") +@Log4j2 +@AllArgsConstructor +public class BillingDataServiceImpl implements IBillingDataService { + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public BillingDataVO getBillingData() { + + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getBillingData(); + } + + @Override + public List getWarehouseBillingData() { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getWarehouseBillingData(); + } + + @Override + public List getMonthBillingData() { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new ArrayList<>(); + } + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getMonthBillingData(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java new file mode 100644 index 000000000..8ad9f44e8 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java @@ -0,0 +1,32 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.BinLocationMapper; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.service.largeScreen.IBinLocationService; +import com.logpm.report.vo.largeScreen.BinLocationDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + + +@AllArgsConstructor +@Service("binLocationServiceHttp") +@Log4j2 +public class BinLocationServiceImpl implements IBinLocationService { + private final LargeScreenDataMapper largeScreenDataMapper; + + public BinLocationDataVO getBinLocationData() { + + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new BinLocationDataVO(); + } + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getBinLocationData(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java new file mode 100644 index 000000000..d0d58f29b --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java @@ -0,0 +1,34 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.BusinessRatioMapper; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.service.largeScreen.IBusinessRationService; +import com.logpm.report.vo.largeScreen.BusinessRatioDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@AllArgsConstructor +@Service("businessRationServiceHttp") +@Log4j2 +public class BusinessRationServiceImpl implements IBusinessRationService { + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public BusinessRatioDataVO getBusinessRatioData() { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + if (largeScreenDataEntity == null) { + return new BusinessRatioDataVO(); + } + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getBusinessRatio(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java new file mode 100644 index 000000000..1cf7df6eb --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java @@ -0,0 +1,48 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.CarsLoadDataMapper; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.service.largeScreen.ICarsLoadDataService; +import com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO; +import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO; +import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageMonthDataVo; +import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO; +import com.logpm.report.vo.largeScreen.CareerLineDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@AllArgsConstructor +@Service("carsLoadDataServiceHttp") +@Log4j2 +public class CarsLoadDataServiceImpl implements ICarsLoadDataService { + + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public List getCareerLineData(Integer isDelivery) { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new ArrayList<>(); + } + + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return isDelivery.equals(1) + ? init.getCareerLineDeliveryData() + : init.getCareerLineData(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java new file mode 100644 index 000000000..262f30952 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java @@ -0,0 +1,38 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.DeliveryDataMapper; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.service.largeScreen.IDeliveryDataService; +import com.logpm.report.vo.largeScreen.DeliveryDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@AllArgsConstructor +@Service("deliveryDataServiceHttp") +@Log4j2 +public class DeliveryDataServiceImpl implements IDeliveryDataService { + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public DeliveryDataVO getDeliveryAllData(Integer isYear) { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new DeliveryDataVO(); + } + + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return isYear.equals(1) + ? init.getDeliveryYearData() + : init.getDeliveryData(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java new file mode 100644 index 000000000..a6e2fb633 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java @@ -0,0 +1,42 @@ +package com.logpm.report.service.largeScreen.httpImpl; + + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.mapper.largeScreen.MapWarehouseMapper; +import com.logpm.report.service.largeScreen.IMapWarehouseService; +import com.logpm.report.vo.largeScreen.MapWarehouse.LineInfoVO; +import com.logpm.report.vo.largeScreen.MapWarehouse.WarehouseInfoVO; +import com.logpm.report.vo.largeScreen.MapWarehouseVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@AllArgsConstructor +@Service("mapWarehouseServiceHttp") +@Slf4j +public class MapWarehouseServiceImpl implements IMapWarehouseService { + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public List list() { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new ArrayList<>(); + } + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getMapWarehouse(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java new file mode 100644 index 000000000..d25bfd48d --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java @@ -0,0 +1,32 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.service.largeScreen.INodeDataService; +import com.logpm.report.vo.largeScreen.NodeDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +@AllArgsConstructor +@Log4j2 +@Service("nodeDataServiceHttp") +public class NodeDataServiceImpl implements INodeDataService { + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public NodeDataVO getNodeData() { + + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new NodeDataVO(); + } + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getNodeData(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java new file mode 100644 index 000000000..badb6a50a --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java @@ -0,0 +1,37 @@ +package com.logpm.report.service.largeScreen.httpImpl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.report.entity.LargeScreenDataEntity; +import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; +import com.logpm.report.mapper.largeScreen.TrunkDataMapper; +import com.logpm.report.service.largeScreen.ITrunkDataService; +import com.logpm.report.vo.largeScreen.TrunkDataVO; +import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + + +@AllArgsConstructor +@Service("trunkDataServiceHttp") +@Log4j2 +public class TrunkDataServiceImpl implements ITrunkDataService { + + private final LargeScreenDataMapper largeScreenDataMapper; + + @Override + public TrunkDataVO getTrunkData() { + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + + if (largeScreenDataEntity == null) { + return new TrunkDataVO(); + } + + XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + + return init.getTrunkData(); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java index 8d58d7977..b5e8ffedf 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java @@ -11,14 +11,16 @@ import com.logpm.report.vo.largeScreen.WarehouseBillingDataVO; import com.logpm.report.vo.largeScreen.billingData.BillingDataInfoVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.util.*; import java.util.stream.Collectors; -@Service +@Service("张三") @Log4j2 @AllArgsConstructor +@Primary public class BillingDataServiceImpl implements IBillingDataService { private final BillingDataMapper billingDataMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java index cb062aad8..3dfabd14e 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java @@ -5,12 +5,14 @@ import com.logpm.report.service.largeScreen.IBinLocationService; import com.logpm.report.vo.largeScreen.BinLocationDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; @AllArgsConstructor @Service @Log4j2 +@Primary public class BinLocationServiceImpl implements IBinLocationService { private BinLocationMapper binLocationMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java index cc5424380..cbb347680 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java @@ -5,6 +5,7 @@ import com.logpm.report.service.largeScreen.IBusinessRationService; import com.logpm.report.vo.largeScreen.BusinessRatioDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -13,6 +14,7 @@ import java.time.format.DateTimeFormatter; @AllArgsConstructor @Service @Log4j2 +@Primary public class BusinessRationServiceImpl implements IBusinessRationService { private final BusinessRatioMapper businessRatioMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java index c6420ea7e..63b49af0f 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java @@ -9,6 +9,7 @@ import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO; import com.logpm.report.vo.largeScreen.CareerLineDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.time.LocalDate; @@ -19,6 +20,7 @@ import java.util.stream.Collectors; @AllArgsConstructor @Service @Log4j2 +@Primary public class CarsLoadDataServiceImpl implements ICarsLoadDataService { private CarsLoadDataMapper carsLoadDataMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java index d3de4f0e6..6c377e7dc 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java @@ -5,6 +5,7 @@ import com.logpm.report.service.largeScreen.IDeliveryDataService; import com.logpm.report.vo.largeScreen.DeliveryDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -13,6 +14,7 @@ import java.time.format.DateTimeFormatter; @AllArgsConstructor @Service @Log4j2 +@Primary public class DeliveryDataServiceImpl implements IDeliveryDataService { private final DeliveryDataMapper deliveryDataMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java index a6f177030..bca70eb7f 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java @@ -9,6 +9,7 @@ import com.logpm.report.vo.largeScreen.MapWarehouse.WarehouseInfoVO; import com.logpm.report.vo.largeScreen.MapWarehouseVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.time.LocalDate; @@ -20,6 +21,7 @@ import java.util.stream.Collectors; @AllArgsConstructor @Service @Slf4j +@Primary public class MapWarehouseServiceImpl implements IMapWarehouseService { private final MapWarehouseMapper mapWarehouseMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java index 39af61d94..62afaecb9 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java @@ -5,6 +5,7 @@ import com.logpm.report.service.largeScreen.INodeDataService; import com.logpm.report.vo.largeScreen.NodeDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -13,6 +14,7 @@ import java.time.format.DateTimeFormatter; @AllArgsConstructor @Log4j2 @Service +@Primary public class NodeDataServiceImpl implements INodeDataService { private final NodeDataMapper nodeDataMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java index 65159ab61..c88b4295b 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java @@ -5,6 +5,7 @@ import com.logpm.report.service.largeScreen.ITrunkDataService; import com.logpm.report.vo.largeScreen.TrunkDataVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -14,6 +15,7 @@ import java.time.format.DateTimeFormatter; @AllArgsConstructor @Service @Log4j2 +@Primary public class TrunkDataServiceImpl implements ITrunkDataService { private final TrunkDataMapper trunkDataMapper; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java new file mode 100644 index 000000000..606a7c97d --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java @@ -0,0 +1,66 @@ +package com.logpm.report.vo.largeScreen; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +public class XxlJobQueryVO { + List mapWarehouse; + BillingDataVO billingData; + List warehouseBillingData; + List monthBillingData; + List careerLineData; + List careerLineDeliveryData; + NodeDataVO nodeData; + BinLocationDataVO binLocationData; + TrunkDataVO trunkData; + DeliveryDataVO deliveryData; + DeliveryDataVO deliveryYearData; + BusinessRatioDataVO businessRatio; + + public static XxlJobQueryVO init(Map data){ + XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO(); + data.forEach((k,v) -> { + if (k.equals("mapWarehouse")) { + xxlJobQueryVO.setMapWarehouse((List) v); + } + if (k.equals("billingData")) { + xxlJobQueryVO.setBillingData((BillingDataVO) v); + } + if (k.equals("warehouseBillingData")) { + xxlJobQueryVO.setWarehouseBillingData((List) v); + } + if (k.equals("monthBillingData")) { + xxlJobQueryVO.setMonthBillingData((List) v); + } + if (k.equals("careerLineData")) { + xxlJobQueryVO.setCareerLineData((List) v); + } + if (k.equals("careerLineDeliveryData")) { + xxlJobQueryVO.setCareerLineDeliveryData((List) v); + } + if (k.equals("nodeData")) { + xxlJobQueryVO.setNodeData((NodeDataVO) v); + } + if (k.equals("binLocationData")) { + xxlJobQueryVO.setBinLocationData((BinLocationDataVO) v); + } + if (k.equals("trunkData")) { + xxlJobQueryVO.setTrunkData((TrunkDataVO) v); + } + if (k.equals("deliveryData")) { + xxlJobQueryVO.setDeliveryData((DeliveryDataVO) v); + } + if (k.equals("deliveryYearData")) { + xxlJobQueryVO.setDeliveryYearData((DeliveryDataVO) v); + } + if (k.equals("businessRatio")) { + xxlJobQueryVO.setBusinessRatio((BusinessRatioDataVO) v); + } + }); + + return xxlJobQueryVO; + } +} From 75987d364b3e1d9cc827cb114fe4e8da852987c6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 4 Jan 2025 23:07:47 +0800 Subject: [PATCH 04/10] =?UTF-8?q?1.=E6=97=B6=E6=95=88=E6=8A=A5=E8=A1=A8bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=202.=E5=AE=A1=E6=A0=B8=E8=BF=90=E5=8D=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ReportIncomingController.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java index 296e4ec4d..8aa69a7c0 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java @@ -8,9 +8,7 @@ import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -22,32 +20,32 @@ public class ReportIncomingController extends BladeController { private final IReportIncomingService reportIncomingService; - @GetMapping("/deptIncomingPage") + @PostMapping("/deptIncomingPage") @ApiOperationSupport(order = 1) @ApiOperation(value = "营业部收入报表", notes = "营业部收入报表") - public R deptIncomingPage(ReportIncomingDTO reportIncomingDTO) { + public R deptIncomingPage(@RequestBody ReportIncomingDTO reportIncomingDTO) { return reportIncomingService.deptIncomingPage(reportIncomingDTO); } - @GetMapping("/deptIncomingExport") + @PostMapping("/deptIncomingExport") @ApiOperationSupport(order = 1) @ApiOperation(value = "营业部收入报表导出", notes = "营业部收入报表导出") - public void deptIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { + public void deptIncomingExport(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { reportIncomingService.deptIncomingExport(reportIncomingDTO,response); } - @GetMapping("/consigineeIncomingPage") + @PostMapping("/consigineeIncomingPage") @ApiOperationSupport(order = 1) @ApiOperation(value = "收货单位收入报表", notes = "收货单位收入报表") - public R consigineeIncomingPage(ReportIncomingDTO reportIncomingDTO) { + public R consigineeIncomingPage(@RequestBody ReportIncomingDTO reportIncomingDTO) { return reportIncomingService.consigineeIncomingPage(reportIncomingDTO); } - @GetMapping("/consigineeIncomingExport") + @PostMapping("/consigineeIncomingExport") @ApiOperationSupport(order = 1) @ApiOperation(value = "收货单位收入报表导出", notes = "收货单位收入报表导出") - public void consigineeIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { + public void consigineeIncomingExport(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { reportIncomingService.consigineeIncomingExport(reportIncomingDTO,response); } From e5ab6c299ff2417ea3dcc2bbf4470bbfb5f218d7 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 4 Jan 2025 23:15:52 +0800 Subject: [PATCH 05/10] =?UTF-8?q?1.=E6=94=B6=E5=85=A5=E6=8A=A5=E8=A1=A8bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/report/mapper/ReportIncomingMapper.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml index 9c58830af..600a82655 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml @@ -36,7 +36,7 @@ and lww.departure_warehouse_id in - + #{item} @@ -90,7 +90,7 @@ and lww.departure_warehouse_id in - + #{item} @@ -152,7 +152,7 @@ and lww.departure_warehouse_id in - + #{item} @@ -214,7 +214,7 @@ and lww.departure_warehouse_id in - + #{item} @@ -272,7 +272,7 @@ and lww.departure_warehouse_id in - + #{item} @@ -337,7 +337,7 @@ and lww.departure_warehouse_id in - + #{item} From e424afe3403c5b50672f7ca5551ac8fd4455d162 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 6 Jan 2025 09:55:21 +0800 Subject: [PATCH 06/10] =?UTF-8?q?1.=E6=89=93=E6=89=98=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse/service/impl/WarehouseTrayTypeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java index 146c767eb..fad0378fa 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java @@ -1782,7 +1782,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl keys = Collections.singletonList(key); List args = Arrays.asList(value, String.valueOf(expireTime)); - Long result = redis.getRedisTemplate().execute(redisScript, keys, args); + Long result = redis.getStringRedisTemplate().execute(redisScript, keys, args); if (result == 1) { log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId); From 5b5b23070842038f827aaf80279f7d4c4f378048 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 6 Jan 2025 11:02:32 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E6=97=A5=E5=BF=97=E6=B2=A1=E7=94=A8=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=E4=BA=BA=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionSignforServiceImpl.java | 2 +- .../factory/receiver/OrderStatusHandler.java | 146 ------------------ 2 files changed, 1 insertion(+), 147 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 36e335493..9d8426064 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -8140,7 +8140,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl m = new HashMap<>(); -// m.put("trayType",newTrayType); -// m.put("trayCode","T"+trayId); -// m.put("warehouseId",warehouseId); -// m.put("orderPackageCode",unitNo); -// -// R response = warehouseTrayTypeClient.orderScanOrderPackageCodeReturnR(m); -// int code = response.getCode(); -// if(code == 4001){ -// log.info("####################orderStatusHandler: 包件已在当前托盘打托 unitNo={} trayCode={}",unitNo,"T"+trayId); -// }else if(code == 4002){ -// log.info("####################orderStatusHandler: 包件已在其他托盘打托 unitNo={} ",unitNo); -// WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsClient.findTrayCodeByOrderPackageCode(unitNo); -// if(Objects.isNull(trayGoodsEntity)){ -// log.warn("####################orderStatusHandler: 包件未打托 unitNo={}",unitNo); -// }else{ -// String oldTrayCode = trayGoodsEntity.getTrayCode(); -// Long trayGoodsId = trayGoodsEntity.getId(); -// Long wid = trayGoodsEntity.getWarehouseId(); -// BasicdataTrayEntity oldTrayEntity = basicdataTrayClient.getTrayByTrayCode(oldTrayCode); -// Long oldTrayId = oldTrayEntity.getId(); -// //判断托盘是否有上架 -// Long oldAllocationId = taryAllocationClient.findAllocationByTrayId(oldTrayId); -// if (Objects.isNull(oldAllocationId)){ -// //没有上架 -// //直接解绑托盘 -// warehouseTrayGoodsClient.delTrayGoodsById(trayGoodsId,wid); -// }else{ -// //有上架 -// //下架 -// updownTypeClient.downPackage(unitNo,wid); -// } -// } -// -// boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m); -// if(!b1){ -// log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId); -// }else{ -// log.info("####################orderStatusHandler: 二次打托成功 unitNo={} trayCode={}",unitNo,"T"+trayId); -// } -// }else if(code == 4003){ -// log.info("####################orderStatusHandler: 包件未打托已上架 unitNo={} ",unitNo); -// WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsClient.findEntityByOrderPackageCode(unitNo); -// if(Objects.isNull(updownGoodsEntity)){ -// log.warn("####################orderStatusHandler: 包件未上架 unitNo={}",unitNo); -// }else{ -// Long wid = updownGoodsEntity.getWarehouseId(); -// updownTypeClient.downPackage(unitNo,wid); -// } -// boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m); -// if(!b1){ -// log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId); -// }else{ -// log.info("####################orderStatusHandler: 二次打托成功 unitNo={} trayCode={}",unitNo,"T"+trayId); -// } -// }else if(code == 4004){ -// log.info("####################orderStatusHandler: 包件打托方式不正确 unitNo={} ",unitNo); -// //先去空置托盘再打托 -// warehouseTrayTypeClient.trayToNull("T"+trayId); -// boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m); -// if(!b1){ -// log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId); -// } -// }else{ -// String msg1 = r.getMsg(); -// int code1 = r.getCode(); -// log.warn("######################orderStatusHandler: 打托失败 msg={} code={}",msg1,code1); -// log.warn("######################orderStatusHandler: 打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId); -// } -// -// }else{ -// //有上架就上架 -// updownTypeClient.upShelfPackage(unitNo,allocationId,warehouseId); -// } -// } - } } From 97dc37323f9da7b70768c12302cb4927eb9fef92 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 6 Jan 2025 12:57:06 +0800 Subject: [PATCH 08/10] =?UTF-8?q?1.=E6=89=93=E6=89=98=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WarehouseTrayTypeServiceImpl.java | 11 +++++++---- .../src/main/resources/luascript/resubmit.lua | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java index fad0378fa..95a996a8f 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java @@ -1780,16 +1780,19 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl keys = Collections.singletonList(key); - List args = Arrays.asList(value, String.valueOf(expireTime)); + List args = Arrays.asList(value, expireTime); - Long result = redis.getStringRedisTemplate().execute(redisScript, keys, args); + log.info("Keys: {}", keys); + log.info("Args: {}", args); + + Long result = redis.getRedisTemplate().execute(redisScript, keys, args.toArray()); if (result == 1) { log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId); throw new CustomerException(405, "托盘信息正在更新,请重试"); } - redis.setEx(key,"1",5L); +// redis.setEx(key,"1",5L); WarehouseTrayTypeEntity trayTypeEntity = new WarehouseTrayTypeEntity(); BladeUser user = AuthUtil.getUser(); @@ -1879,7 +1882,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl Date: Mon, 6 Jan 2025 15:48:31 +0800 Subject: [PATCH 09/10] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=B1=82?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 3 +++ .../src/main/resources/application-dev.yml | 20 +++++++++++++++++-- .../src/main/resources/application-prod.yml | 10 +++++++--- .../src/main/resources/application-test.yml | 7 +++++++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/resources/application-dev.yml b/blade-service/logpm-distribution/src/main/resources/application-dev.yml index 2ced6d350..886f4678d 100644 --- a/blade-service/logpm-distribution/src/main/resources/application-dev.yml +++ b/blade-service/logpm-distribution/src/main/resources/application-dev.yml @@ -45,6 +45,9 @@ spring: datasource: dynamic: druid: +# connect-timeout: 60000 + + #通用校验配置 validation-query: select 1 #启用sql日志拦截器 diff --git a/blade-service/logpm-report/src/main/resources/application-dev.yml b/blade-service/logpm-report/src/main/resources/application-dev.yml index e75326109..fb8d122aa 100644 --- a/blade-service/logpm-report/src/main/resources/application-dev.yml +++ b/blade-service/logpm-report/src/main/resources/application-dev.yml @@ -21,16 +21,32 @@ spring: #启用sql日志拦截器 proxy-filters: - sqlLogInterceptor - query-timeout: 60000 - #设置默认的数据源或者数据源组,默认值即为master +# query-timeout: 60000 +# connect-timeout: 60000 +# transaction-timeout: 60000 +# max-wait: 60000 +# time-between-eviction-runs-millis: 60000 +# min-evictable-idle-time-millis: 300000 +# connectTimeout: 60000 +# socketTimeout: 60000 +# queryTimeout: 60000 + #设置默认的数据源或者数据源组,默认值即为master primary: master datasource: master: druid: #独立校验配置 validation-query: select 1 + queryTimeout: 60000 #oracle校验 #validation-query: select 1 from dual url: ${blade.datasource.report.master.url} username: ${blade.datasource.report.master.username} password: ${blade.datasource.report.master.password} + 627683: + druid: + validation-query: select 1 + queryTimeout: 60000 + url: jdbc:mysql://192.168.2.46:3306/logpm_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&socketTimeout=30000 + username: root + password: 12345678 diff --git a/blade-service/logpm-report/src/main/resources/application-prod.yml b/blade-service/logpm-report/src/main/resources/application-prod.yml index d2d395e11..09f492296 100644 --- a/blade-service/logpm-report/src/main/resources/application-prod.yml +++ b/blade-service/logpm-report/src/main/resources/application-prod.yml @@ -21,9 +21,6 @@ spring: #启用sql日志拦截器 proxy-filters: - sqlLogInterceptor - query-timeout: 60000 - time-between-eviction-runs-millis: 60000 - min-evictable-idle-time-millis: 300000 #设置默认的数据源或者数据源组,默认值即为master primary: master datasource: @@ -36,3 +33,10 @@ spring: url: ${blade.datasource.report.master.url} username: ${blade.datasource.report.master.username} password: ${blade.datasource.report.master.password} + 627683: + druid: + validation-query: select 1 + queryTimeout: 60000 + url: ${blade.datasource.report.627683.url} + username: ${blade.datasource.report.627683.username} + password: ${blade.datasource.report.627683.password} diff --git a/blade-service/logpm-report/src/main/resources/application-test.yml b/blade-service/logpm-report/src/main/resources/application-test.yml index e75326109..9f962556a 100644 --- a/blade-service/logpm-report/src/main/resources/application-test.yml +++ b/blade-service/logpm-report/src/main/resources/application-test.yml @@ -34,3 +34,10 @@ spring: url: ${blade.datasource.report.master.url} username: ${blade.datasource.report.master.username} password: ${blade.datasource.report.master.password} + 627683: + druid: + validation-query: select 1 + queryTimeout: 60000 + url: ${blade.datasource.report.627683.url} + username: ${blade.datasource.report.627683.username} + password: ${blade.datasource.report.627683.password} From c6a11e3fce8f0a581f826f5b2118dad07661748a Mon Sep 17 00:00:00 2001 From: chenlong Date: Mon, 6 Jan 2025 16:27:55 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/report/controller/LargeScreenController.java | 2 +- .../com/logpm/report/mapper/largeScreen/BillingDataMapper.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java index ee89b4b2e..46f3c33f8 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java @@ -62,7 +62,7 @@ public class LargeScreenController{ this.trunkData = trunkData; this.deliveryDataService = deliveryDataService; this.businessRatio = businessRatio; - } + } /** diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml index dff9e478a..61ada2f67 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml @@ -18,7 +18,7 @@ count(d.id) as value, w.destination_warehouse_id as warehouseId from logpm_platform.logpm_warehouse_waybill as w - INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.waybill_no = d.waybill_no + INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.id = d.waybill_id where w.freeze_status = 0 and w.create_time BETWEEN #{startTime} and #{endTime} group by w.destination_warehouse_id @@ -30,7 +30,7 @@ count(d.id) as value, date_format(w.create_time, '%Y-%m') as month from logpm_platform.logpm_warehouse_waybill as w - INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.waybill_no = d.waybill_no + INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.id = d.waybill_id where w.freeze_status = 0 and w.create_time BETWEEN #{startTime} and #{endTime} group by month