BI大屏总体运营态势查询调整
This commit is contained in:
+22
-5
@@ -3,8 +3,8 @@ package com.mhd.bi.domain.biOverallOperation.support;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mhd.bi.domain.biReport.support.BiInventoryTurnoverTrendSupport;
|
||||
import com.mhd.bi.domain.biReport.support.BiOnTimeDeliveryRateChartSupport;
|
||||
import com.mhd.bi.domain.biReport.support.BiWarehouseCapabilityRankingSupport;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.overall.OverallOperationSituationVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.overall.OverallTransportOperationVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.overall.OverallWarehouseOperationVO;
|
||||
@@ -12,7 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 总体运营态势:左侧保留 warehouse.capabilityRanking;右下角 transport.on_time_rate 替代 enterpriseRanking。
|
||||
* 总体运营态势:左侧 warehouse.turnover_rate_trend;右下角 transport.on_time_rate。
|
||||
*/
|
||||
@Slf4j
|
||||
public final class OverallOperationPayloadNormalizer {
|
||||
@@ -30,13 +30,31 @@ public final class OverallOperationPayloadNormalizer {
|
||||
JsonNode root = MAPPER.readTree(json.trim());
|
||||
boolean changed = false;
|
||||
|
||||
ObjectNode rootObj = (ObjectNode) root;
|
||||
JsonNode warehouse = root.path("warehouse");
|
||||
if (warehouse.isObject()) {
|
||||
ObjectNode warehouseObj = (ObjectNode) warehouse;
|
||||
if (warehouseObj.has("map") && !rootObj.has("map")) {
|
||||
rootObj.set("map", warehouseObj.remove("map"));
|
||||
changed = true;
|
||||
}
|
||||
if (warehouseObj.has("transport") && !rootObj.has("transport")) {
|
||||
rootObj.set("transport", warehouseObj.remove("transport"));
|
||||
changed = true;
|
||||
}
|
||||
if (warehouseObj.has("capabilityRanking")) {
|
||||
warehouseObj.remove("capabilityRanking");
|
||||
changed = true;
|
||||
}
|
||||
if (warehouseObj.has("on_time_rate")) {
|
||||
warehouseObj.remove("on_time_rate");
|
||||
changed = true;
|
||||
}
|
||||
if (!warehouseObj.has("turnover_rate_trend")) {
|
||||
warehouseObj.set("turnover_rate_trend",
|
||||
MAPPER.valueToTree(BiInventoryTurnoverTrendSupport.defaultTrend()));
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
JsonNode transport = root.path("transport");
|
||||
@@ -65,9 +83,8 @@ public final class OverallOperationPayloadNormalizer {
|
||||
return null;
|
||||
}
|
||||
OverallWarehouseOperationVO warehouse = vo.getWarehouse();
|
||||
if (warehouse != null
|
||||
&& (warehouse.getCapabilityRanking() == null || warehouse.getCapabilityRanking().isEmpty())) {
|
||||
warehouse.setCapabilityRanking(BiWarehouseCapabilityRankingSupport.defaultRanking());
|
||||
if (warehouse != null && BiInventoryTurnoverTrendSupport.isEmpty(warehouse.getTurnoverRateTrend())) {
|
||||
warehouse.setTurnoverRateTrend(BiInventoryTurnoverTrendSupport.defaultTrend());
|
||||
}
|
||||
OverallTransportOperationVO transport = vo.getTransport();
|
||||
if (transport != null && BiOnTimeDeliveryRateChartSupport.isChartEmpty(transport.getOnTimeRate())) {
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.mhd.bi.domain.biReport.support;
|
||||
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.warehouseZone.WhMonthRatePointVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.warehouseZone.WhTurnoverRateTrendVO;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 总体运营态势左侧「库存周转率趋势」默认数据(与仓储运营专区 turnover_rate_trend 结构一致)
|
||||
*/
|
||||
public final class BiInventoryTurnoverTrendSupport {
|
||||
|
||||
private BiInventoryTurnoverTrendSupport() {
|
||||
}
|
||||
|
||||
public static WhTurnoverRateTrendVO defaultTrend() {
|
||||
return WhTurnoverRateTrendVO.builder()
|
||||
.currentMonth("3次")
|
||||
.annual("4次")
|
||||
.data(Arrays.asList(
|
||||
WhMonthRatePointVO.builder().month("11月").rate(10).build(),
|
||||
WhMonthRatePointVO.builder().month("12月").rate(15).build(),
|
||||
WhMonthRatePointVO.builder().month("1月").rate(22).build(),
|
||||
WhMonthRatePointVO.builder().month("2月").rate(20).build(),
|
||||
WhMonthRatePointVO.builder().month("3月").rate(12).build(),
|
||||
WhMonthRatePointVO.builder().month("4月").rate(16).build()
|
||||
))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static boolean isEmpty(WhTurnoverRateTrendVO trend) {
|
||||
return trend == null || trend.getData() == null || trend.getData().isEmpty();
|
||||
}
|
||||
|
||||
public static WhTurnoverRateTrendVO emptyShell() {
|
||||
return WhTurnoverRateTrendVO.builder()
|
||||
.currentMonth("")
|
||||
.annual("")
|
||||
.data(java.util.Collections.emptyList())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -118,7 +118,7 @@ public final class BiReportSnapshotMapperSupport {
|
||||
.customerCount(0L).coverageArea("")
|
||||
.annualThroughput(0).throughputUnit("").throughputGrowth(0d)
|
||||
.build())
|
||||
.capabilityRanking(BiWarehouseCapabilityRankingSupport.defaultRanking())
|
||||
.turnoverRateTrend(BiInventoryTurnoverTrendSupport.defaultTrend())
|
||||
.build())
|
||||
.map(OverallMapSectionVO.builder().nodes(Collections.emptyList()).build())
|
||||
.transport(OverallTransportOperationVO.builder()
|
||||
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package com.mhd.bi.domain.biReport.support;
|
||||
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.overall.OverallWarehouseCapabilityRankVO;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 总体运营态势左侧「仓储运营能力」表格默认数据
|
||||
*/
|
||||
public final class BiWarehouseCapabilityRankingSupport {
|
||||
|
||||
private BiWarehouseCapabilityRankingSupport() {
|
||||
}
|
||||
|
||||
public static List<OverallWarehouseCapabilityRankVO> defaultRanking() {
|
||||
return Arrays.asList(
|
||||
OverallWarehouseCapabilityRankVO.builder().rank(1).name("横琴仓")
|
||||
.processedVolume("2,400单").throughput("5.2万吨").utilizationRate("85%").build(),
|
||||
OverallWarehouseCapabilityRankVO.builder().rank(2).name("陆路仓")
|
||||
.processedVolume("1,800单").throughput("4.1万吨").utilizationRate("78%").build(),
|
||||
OverallWarehouseCapabilityRankVO.builder().rank(3).name("联丰仓")
|
||||
.processedVolume("1,200单").throughput("3.5万吨").utilizationRate("92%").build(),
|
||||
OverallWarehouseCapabilityRankVO.builder().rank(4).name("香港仓")
|
||||
.processedVolume("800单").throughput("2.2万吨").utilizationRate("65%").build()
|
||||
);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package com.mhd.bi.domain.biSnapshotSync.support;
|
||||
|
||||
import com.mhd.bi.domain.biReport.support.BiOnTimeDeliveryRateChartSupport;
|
||||
import com.mhd.bi.domain.biReport.support.BiWarehouseCapabilityRankingSupport;
|
||||
import com.mhd.bi.domain.biReport.support.BiInventoryTurnoverTrendSupport;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.ComprehensiveSituationVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.CustomerContributionRankVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.WarehouseTransportSituationVO;
|
||||
@@ -243,7 +243,7 @@ public final class BiSnapshotWeeklyRandomDataBuilder {
|
||||
|
||||
/**
|
||||
* 与产品约定返回值示例一致,供快照同步与联调。
|
||||
* 左侧 {@code warehouse.capabilityRanking} 仓储运营能力表;右下角 {@code transport.on_time_rate} 准时配送率。
|
||||
* 左侧 {@code warehouse.turnover_rate_trend} 库存周转率趋势;右下角 {@code transport.on_time_rate} 准时配送率。
|
||||
*/
|
||||
public static OverallOperationSituationVO overallReferenceDashboard() {
|
||||
return OverallOperationSituationVO.builder()
|
||||
@@ -285,7 +285,7 @@ public final class BiSnapshotWeeklyRandomDataBuilder {
|
||||
.throughputUnit("万吨")
|
||||
.throughputGrowth(8.5)
|
||||
.build())
|
||||
.capabilityRanking(BiWarehouseCapabilityRankingSupport.defaultRanking())
|
||||
.turnoverRateTrend(BiInventoryTurnoverTrendSupport.defaultTrend())
|
||||
.build())
|
||||
.map(OverallMapSectionVO.builder()
|
||||
.nodes(Arrays.asList(
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.mhd.bi.interfaces.facadeApi.biReport.vo.overall;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("总体运营态势-左侧仓储运营能力排行行")
|
||||
public class OverallWarehouseCapabilityRankVO {
|
||||
|
||||
@ApiModelProperty("排名")
|
||||
private Integer rank;
|
||||
|
||||
@ApiModelProperty("仓库/业务名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("处理单量展示,如 2,400单")
|
||||
private String processedVolume;
|
||||
|
||||
@ApiModelProperty("吞吐量展示,如 5.2万吨")
|
||||
private String throughput;
|
||||
|
||||
@ApiModelProperty("周转率/利用率展示,如 85%")
|
||||
private String utilizationRate;
|
||||
}
|
||||
+5
-2
@@ -1,6 +1,8 @@
|
||||
package com.mhd.bi.interfaces.facadeApi.biReport.vo.overall;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.warehouseZone.WhTurnoverRateTrendVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -33,6 +35,7 @@ public class OverallWarehouseOperationVO {
|
||||
@ApiModelProperty("仓库运营统计")
|
||||
private OverallWarehouseBizStatisticVO bizStatistics;
|
||||
|
||||
@ApiModelProperty("左侧仓储运营能力排名表")
|
||||
private List<OverallWarehouseCapabilityRankVO> capabilityRanking;
|
||||
@JsonProperty("turnover_rate_trend")
|
||||
@ApiModelProperty("库存周转率趋势(替代原 capabilityRanking)")
|
||||
private WhTurnoverRateTrendVO turnoverRateTrend;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user