Browse Source

Merge remote-tracking branch 'origin/master'

master
pref_mail@163.com 3 months ago
parent
commit
31c789702e
  1. 12
      blade-biz-common/src/main/java/org/springblade/common/constant/report/ReportConstants.java
  2. 45
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java
  3. 41
      blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java
  4. 58
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchOrderDetailEntity.java
  5. 34
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseOrderEntity.java
  6. 7
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/feign/IExpenseDispatchClient.java
  7. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  8. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  9. 42
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  10. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  11. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java
  12. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IQualityDeliverService.java
  13. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  14. 176
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java
  15. 1
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/FactoryDataServiceImpl.java
  16. 4
      blade-service/logpm-report/pom.xml
  17. 99
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java
  18. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java
  19. 70
      blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java
  20. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java
  21. 61
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  22. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml
  23. 17
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java
  24. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml
  25. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java
  26. 20
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml
  27. 9
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java
  28. 32
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml
  29. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java
  30. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml
  31. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java
  32. 13
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java
  33. 24
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml
  34. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java
  35. 25
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml
  36. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java
  37. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java
  38. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBusinessRationService.java
  39. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java
  40. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IDeliveryDataService.java
  41. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java
  42. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ITrunkDataService.java
  43. 63
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java
  44. 32
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java
  45. 34
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java
  46. 48
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java
  47. 38
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java
  48. 42
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java
  49. 32
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java
  50. 37
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java
  51. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java
  52. 30
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java
  53. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java
  54. 91
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java
  55. 47
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java
  56. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java
  57. 37
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java
  58. 35
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java
  59. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java
  60. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java
  61. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/DeptInfoVO.java
  62. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java
  63. 17
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java
  64. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java
  65. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java
  66. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java
  67. 66
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java
  68. 5
      blade-service/logpm-statisticsdata/pom.xml
  69. 16
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/feign/ExpenseDispatchClient.java
  70. 38
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/job/ExpenseJob.java
  71. 18
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchOrderDetailMapper.xml
  72. 18
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseOrderWarehouseTotalMapper.xml
  73. 48
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseOrderVO.java
  74. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

12
blade-biz-common/src/main/java/org/springblade/common/constant/report/ReportConstants.java

@ -29,5 +29,17 @@ public class ReportConstants {
public static final String REPORT_QUALITY_CAR_FINAL_EXCHANGE = "report.quality.car.final.exchange" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_QUALITY_CAR_FINAL_QUEUE = "report.quality.car.final.queue" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_QUALITY_CAR_FINAL_ROUTINGKEY = "report.quality.car.final.key" + ModuleNameConstant.DEVAUTH;
/**
* 配送订单成本报表
*/
public static final String REPORT_EXPENSE_ORDER_EXCHANGE = "report.expense.order.exchange" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_EXPENSE_ORDER_QUEUE = "report.expense.order.queue" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_EXPENSE_ORDER_ROUTINGKEY = "report.expense.order.key" + ModuleNameConstant.DEVAUTH;
/**
* 仓储订单成本报表
*/
public static final String REPORT_EXPENSE_WAREHOUSE_ORDER_EXCHANGE = "report.expense.warehouse.order.exchange" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_EXPENSE_WAREHOUSE_ORDER_QUEUE = "report.expense.warehouse.order.queue" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_EXPENSE_WAREHOUSE_ORDER_ROUTINGKEY = "report.expense.warehouse.order.key" + ModuleNameConstant.DEVAUTH;
}

45
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java

@ -118,6 +118,11 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "运单发货地址")
private String shipperAddress;
/**
* 发站
*/
@ApiModelProperty(value = "发站")
private String shipperStation;
/**
* 运单收货单位id
*/
@ -143,6 +148,11 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "运单收货地址")
private String consigneeAddress;
/**
* 到站
*/
@ApiModelProperty(value = "到站")
private String consigneeStation;
/**
* 运单号
*/
@ -719,6 +729,41 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "异动金额")
private Double changeAmount;
/**
* 订单运单总数
*/
@ApiModelProperty(value = "订单运单总数")
private Integer orderWaybillNumber;
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 客户服务类型
*/
@ApiModelProperty(value = "客户服务类型")
private String customType;
}

41
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<String, Object> data;
public LargeScreenDataEntity(Map<String, Object> data) {
this.data = data;
}
}

58
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchOrderDetailEntity.java

@ -75,8 +75,8 @@ public class ExpenseDispatchOrderDetailEntity extends TenantEntity {
/**
* 配送类型
*/
@ApiModelProperty(value = "配送类型")
@ExcelProperty("配送类型")
@ApiModelProperty(value = "运单类型")
@ExcelProperty("运单类型")
private String waybillType;
/**
* 开单时间
@ -96,12 +96,12 @@ public class ExpenseDispatchOrderDetailEntity extends TenantEntity {
@ApiModelProperty(value = "复核件数")
@ExcelProperty("复核件数")
private Integer reviewNumber;
/**
* 结算件数
*/
@ApiModelProperty(value = "结算件数")
@ExcelProperty("结算件数")
private Integer settlementNumber;
// /**
// * 结算件数
// */
// @ApiModelProperty(value = "结算件数")
// @ExcelProperty("结算件数")
// private Integer settlementNumber;
/**
* 总重量
*/
@ -126,12 +126,12 @@ public class ExpenseDispatchOrderDetailEntity extends TenantEntity {
@ApiModelProperty(value = "配送成本")
@ExcelProperty("配送成本")
private Double distributionCost;
/**
* 撕标签成本
*/
@ApiModelProperty(value = "撕标签成本")
@ExcelProperty("撕标签成本")
private Double inventoryDistributionCost;
// /**
// * 撕标签成本
// */
// @ApiModelProperty(value = "撕标签成本")
// @ExcelProperty("撕标签成本")
// private Double inventoryDistributionCost;
/**
* 上楼费成本
*/
@ -198,18 +198,18 @@ public class ExpenseDispatchOrderDetailEntity extends TenantEntity {
@ApiModelProperty(value = "其他成本")
@ExcelProperty("其他成本")
private Double otherCosts;
/**
* 异动金额
*/
@ApiModelProperty(value = "异动金额")
@ExcelProperty("异动金额")
private Double changeAmount;
/**
* 配送公里数
*/
@ApiModelProperty(value = "配送公里数")
@ExcelProperty("配送公里数")
private Double deliveryKilometers;
// /**
// * 异动金额
// */
// @ApiModelProperty(value = "异动金额")
// @ExcelProperty("异动金额")
// private Double changeAmount;
// /**
// * 配送公里数
// */
// @ApiModelProperty(value = "配送公里数")
// @ExcelProperty("配送公里数")
// private Double deliveryKilometers;
/**
* 发货人
*/
@ -264,5 +264,11 @@ public class ExpenseDispatchOrderDetailEntity extends TenantEntity {
@ApiModelProperty(value = "客户车次")
@ExcelProperty("客户车次")
private String customerTrip;
/**
* 复核完成时间
*/
@ApiModelProperty(value = "复核完成时间")
@ExcelProperty("复核完成时间")
private String reviewCompletionTime;
}

34
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseOrderEntity.java

@ -9,8 +9,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
/**
* 订单仓储成本报表
*
@ -60,30 +58,42 @@ public class ExpenseWarehouseOrderEntity extends TenantEntity {
@ExcelProperty("发货单位")
private String shippingUnit;
/**
* 发站仓
* 配送类型
*/
@ApiModelProperty(value = "发站仓")
@ExcelProperty("发站仓")
private String originWarehouse;
@ApiModelProperty(value = "运单类型")
@ExcelProperty("运单类型")
private String waybillType;
/**
* 订单总件数
* 订单运单总件数
*/
@ApiModelProperty(value = "订单总件数")
@ExcelProperty("订单总件数")
@ApiModelProperty(value = "订单运单总件数")
@ExcelProperty("订单运单总件数")
private Integer totalNumber;
/**
* 出库件数
*/
@ApiModelProperty(value = "出库件数")
@ExcelProperty("出库件数")
@ApiModelProperty(value = "签收复核件数")
@ExcelProperty("签收复核件数")
private Integer outNumber;
/**
* 发站仓
*/
@ApiModelProperty(value = "发站仓")
@ExcelProperty("发站仓")
private String originWarehouse;
/**
* 租赁成本
*/
@ApiModelProperty(value = "租赁成本")
@ExcelProperty("租赁成本")
private BigDecimal warehouseRentalCost;
private Double warehouseRentalCost;
/**
* 复核完成时间
*/
@ApiModelProperty(value = "复核完成时间")
@ExcelProperty("复核完成时间")
private String reviewCompletionTime;
}

7
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/feign/IExpenseDispatchClient.java

@ -1,7 +1,9 @@
package com.logpm.statistics.feign;
import com.logpm.statistics.dto.ExpenseDispatchClientDTO;
import com.logpm.statistics.entity.ExpenseDispatchOrderDetailEntity;
import com.logpm.statistics.entity.ExpenseDispatchTrainDetailEntity;
import com.logpm.statistics.entity.ExpenseWarehouseOrderEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@ -22,4 +24,9 @@ public interface IExpenseDispatchClient {
@PostMapping(API_PREFIX + "/saveTrainDetailEntity")
void saveTrainDetailEntity(@RequestBody ExpenseDispatchTrainDetailEntity entity);
@PostMapping(API_PREFIX + "/saveDispatchOrderDetailEntity")
void saveDispatchOrderDetailEntity(ExpenseDispatchOrderDetailEntity orderDetailEntity);
@PostMapping(API_PREFIX + "/saveWarehouseOrderEntity")
void saveWarehouseOrderEntity(ExpenseWarehouseOrderEntity orderDetailEntity);
}

5
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -497,9 +497,12 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
}
carsLoadScanEntity.setScanStatus("2");
carsLoadScanEntity.setUnloadNum(carsLoadScanEntity.getUnloadNum()+enterNum);
carsLoadScanEntity.setUnloadNodeId(warehouseId);
carsLoadScanEntity.setUnloadNodeName(warehouseEntity.getName());
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanClient.updateEntity(carsLoadScanEntity);
String waybillNo = carsLoadScanEntity.getWaybillNo();

4
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -66,7 +66,6 @@ import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -2896,9 +2895,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if (!withinOneMonth) {
throw new ServiceException("日期范伟不能超过两个月");
}
} else {
throw new ServiceException("导出时日期必填");
}
List<AftersalesWorkOrderVO> exportData = baseMapper.getBasicExportData(workOrderDTO, ids, warehouseIds);
return exportData;

42
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -23,6 +23,7 @@ import com.logpm.statistics.entity.ExpenseDispatchPriceOverZoneEntity;
import com.logpm.statistics.feign.IExpenseDispatchClient;
import com.logpm.statistics.vo.ExpenseDispatchPriceCategoryVO;
import com.logpm.statistics.vo.ExpenseDispatchPriceVO;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.report.ReportConstants;
@ -37,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
@ -87,6 +89,7 @@ public class DeliverFinishReportListener implements ReportService {
.delay(10000)
.build());
}
public void calculateTripCost(String trainNumber, String deliveryKindParam) {
@ -95,11 +98,9 @@ public class DeliverFinishReportListener implements ReportService {
.eq(QualityDeliverEntity::getSignTrainNumber, trainNumber)
);
if (CollUtil.isNotEmpty(entities)) {
// 按签收车分组
Map<String, List<QualityDeliverEntity>> collect = null;
if(StrUtil.isEmpty(deliveryKindParam)){
return;
}
if (StrUtil.equals(deliveryKindParam, "自主配送")) {
collect = entities.stream()
.filter(entity -> StrUtil.isNotEmpty(entity.getSignCarNumber()))
@ -113,7 +114,6 @@ public class DeliverFinishReportListener implements ReportService {
}
if (CollUtil.isNotEmpty(collect)) {
for (Map.Entry<String, List<QualityDeliverEntity>> entry : collect.entrySet()) {
List<QualityDeliverEntity> value = entry.getValue();
// 根据车查询出司机id
List<String> collect2 = new ArrayList<>();
@ -901,6 +901,36 @@ public class DeliverFinishReportListener implements ReportService {
));
sendReport(BizOperationEnums.MODIFY, entityEntry.getValue(), BizOperationEnums.MODIFY);
}
Map<String, TrunklineWaybillOrderEntity> waybillOrderMap = new HashMap<>();
Collection<QualityDeliverEntity> values = valueMap.values();
for (QualityDeliverEntity entity : values) {
if (StrUtil.isEmpty(entity.getOrderCode()) || StrUtil.isEmpty(entity.getWaybillNumber())) {
log.info("订单或运单为空,不生成订单总成本报表:id = {}", entity.getId());
continue;
}
String key = entity.getOrderCode() + entity.getWaybillNumber();
if (waybillOrderMap.containsKey(key)) {
TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderMap.get(key);
Integer totalNumber = waybillOrderEntity.getTotalNumber();
waybillOrderEntity.setTotalNumber(totalNumber + entity.getSignNum());
} else {
TrunklineWaybillOrderEntity waybillOrderEntity = new TrunklineWaybillOrderEntity();
waybillOrderEntity.setOrderCode(entity.getOrderCode());
waybillOrderEntity.setWaybillNo(entity.getWaybillNumber());
waybillOrderEntity.setTotalNumber(entity.getSignNum());
waybillOrderMap.put(key, waybillOrderEntity);
}
}
// 生成订单 发送延时消息生成报表
if (CollUtil.isNotEmpty(waybillOrderMap)) {
for (Map.Entry<String, TrunklineWaybillOrderEntity> entityEntry : waybillOrderMap.entrySet()) {
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_EXPENSE_ORDER_EXCHANGE)
.routingKey(ReportConstants.REPORT_EXPENSE_ORDER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(entityEntry.getValue()))
.delay(10000)
.build());
}
}
}
}
@ -908,6 +938,8 @@ public class DeliverFinishReportListener implements ReportService {
}
}
}
private static void buildUltrAllpwCost(Map<Long, QualityDeliverEntity> valueMap, BigDecimal mul, Integer totalNum) {
BigDecimal deliveryFeeSum = BigDecimal.ZERO;
int idex = 0;
@ -925,6 +957,7 @@ public class DeliverFinishReportListener implements ReportService {
idex++;
}
}
private static void buildPointAllowCost(Map<Long, QualityDeliverEntity> valueMap, BigDecimal mul, Integer totalNum) {
BigDecimal deliveryFeeSum = BigDecimal.ZERO;
int idex = 0;
@ -942,6 +975,7 @@ public class DeliverFinishReportListener implements ReportService {
idex++;
}
}
private static void buildFuelCost(Map<Long, QualityDeliverEntity> valueMap, BigDecimal mul, Integer totalNum) {
BigDecimal deliveryFeeSum = BigDecimal.ZERO;
int idex = 0;

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -23,7 +23,9 @@ import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListInfoService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
@ -35,6 +37,7 @@ import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -87,6 +90,8 @@ public class QualityDeliverListener implements ReportService {
private BladeRedis redisCache;
@Resource
private DistributionProperties destinationProperties;
@Resource
private ITrunklineWaybillOrderClient waybillOrderClient;
@Transactional
public void buildReport(String msg) {
@ -282,6 +287,7 @@ public class QualityDeliverListener implements ReportService {
}
private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity, DistributionParcelListEntity parcelListEntity) {
String orderCode = qualityDeliverEntity.getOrderCode();
if (ObjectUtil.isNotEmpty(parcelListEntity)) {
// 品牌
qualityDeliverEntity.setBrandName(parcelListEntity.getBrandName());
@ -321,6 +327,9 @@ public class QualityDeliverListener implements ReportService {
qualityDeliverEntity.setEndWarehouseInTime(parcelListEntity.getWarehouseEntryTimeEnd());
// 构建运单相关信息
buildWaybillInfo(qualityDeliverEntity, waybillNumber);
// 设置订单运单总数
buildOrderWaybillNumber(qualityDeliverEntity, orderCode, waybillNumber);
}
// 暂存单查询结算品类
// TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode());
@ -331,7 +340,23 @@ public class QualityDeliverListener implements ReportService {
// qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName());
// }
// 构建订单相关信息
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode());
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), orderCode);
}
private void buildOrderWaybillNumber(QualityDeliverEntity qualityDeliverEntity, String orderCode, String waybillNumber) {
if (StrUtil.isNotEmpty(orderCode) && StrUtil.isNotEmpty(waybillNumber)) {
String key = AuthUtil.getTenantId() + ":" + "logpm-distribution:" + "OrderWaybill:" + orderCode + "_" + waybillNumber;
Integer totalNumber = redisCache.get(key);
if (ObjectUtil.isNotEmpty(totalNumber)) {
qualityDeliverEntity.setOrderWaybillNumber(totalNumber);
} else {
TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNumber, orderCode);
if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) {
qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber());
}
redisCache.set(key, entityByWaybillNoAndOrderCode.getTotalNumber());
}
}
}
private void buildOrderInfo(QualityDeliverEntity qualityDeliverEntity, Long warehouseId, String orderCode) {
@ -356,6 +381,19 @@ public class QualityDeliverListener implements ReportService {
qualityDeliverEntity.setStoreName(stockArticleEntity.getStoreName());
// 品牌
qualityDeliverEntity.setBrandName(stockArticleEntity.getBrand());
// 服务类型
String typeService = stockArticleEntity.getTypeService();
if(StrUtil.isNotEmpty(typeService)){
if("1".equals(typeService)){
qualityDeliverEntity.setCustomType("商配");
}else if("2".equals(typeService)){
qualityDeliverEntity.setCustomType("市配");
}else if("3".equals(typeService)){
qualityDeliverEntity.setCustomType("自提");
}else if("4".equals(typeService)){
qualityDeliverEntity.setCustomType("三方中转");
}
}
}
}
@ -394,6 +432,9 @@ public class QualityDeliverListener implements ReportService {
qualityDeliverEntity.setAssignedCustomerId(Convert.toStr(byWaybillNo.getConsigneeId()));
qualityDeliverEntity.setAssignedCustomer(byWaybillNo.getConsignee());
qualityDeliverEntity.setShipperStation(byWaybillNo.getDeparture());
qualityDeliverEntity.setConsigneeStation(byWaybillNo.getDestination());
}
}
}

48
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java

@ -1,6 +1,8 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.logpm.distribution.pros.DistributionProperties;
import com.logpm.distribution.service.IQualityDeliverService;
@ -513,6 +515,52 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_EXPENSE_ORDER_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_EXPENSE_ORDER_EXCHANGE, type = ExchangeTypes.TOPIC,
delayed = FactoryDataConstants.Mq.DELAYED),
key = ReportConstants.REPORT_EXPENSE_ORDER_ROUTINGKEY
), ackMode = "MANUAL")
public void orderExpenseDispatchDetailFinal(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
log.info("生成订单总成本报表: {}", msg);
try {
JSONArray objects = JSONUtil.parseArray(msg);
if(CollUtil.isNotEmpty(objects)){
qualityDeliverService.orderExpenseDispatchDetailFinal(objects);
}
} catch (Exception e) {
e.printStackTrace();
log.error("生成订单总成本报表失败: {}", e.getMessage());
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_EXPENSE_WAREHOUSE_ORDER_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_EXPENSE_WAREHOUSE_ORDER_EXCHANGE, type = ExchangeTypes.TOPIC,
delayed = FactoryDataConstants.Mq.DELAYED),
key = ReportConstants.REPORT_EXPENSE_WAREHOUSE_ORDER_ROUTINGKEY
), ackMode = "MANUAL")
public void expenseWarehouseOrder(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
log.info("生成仓储订单总成本报表: {}", msg);
try {
JSONArray objects = JSONUtil.parseArray(msg);
if(CollUtil.isNotEmpty(objects)){
qualityDeliverService.expenseWarehouseOrder(objects);
}
} catch (Exception e) {
e.printStackTrace();
log.error("生成仓储订单总成本报表失败: {}", e.getMessage());
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private ReportService selectReportService(Class<? extends ReportService> clazz) {

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IQualityDeliverService.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.service;
import cn.hutool.json.JSONArray;
import com.logpm.distribution.entity.QualityDeliverEntity;
import org.springblade.core.mp.base.BaseService;
@ -42,4 +43,8 @@ public interface IQualityDeliverService extends BaseService<QualityDeliverEntity
void delDistributionCarStart(Long id);
void carExpenseDispatchDetailFinal(String trainNumber);
void orderExpenseDispatchDetailFinal(JSONArray objects);
void expenseWarehouseOrder(JSONArray objects);
}

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -1524,6 +1524,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionLoadscaninvnEntity> kucuns = new ArrayList<>();
List<DistributionLoadscanEntity> dingzhis= new ArrayList<>();
List<DistributionLoadscanEntity> lingdans = new ArrayList<>();
List<DistributionParcelListEntity> pushList = new ArrayList<>();
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
switch (reservationStockarticleEntity.getIsZero()) {
@ -1600,6 +1601,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
newT.setOrderPackageStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(newT);
pushList.add(newT);
//扣减在库订单的在库数量
// Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
updatePackageList.add(parcelListEntity);
@ -1838,7 +1840,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if(Func.isNotEmpty(lingdans)){
sendBuildNodeFanoutMsgByZeroOrder(deliveryList,lingdans);
}
if (CollUtil.isNotEmpty(pushList)) {
for (DistributionParcelListEntity parcelListEntity : pushList) {
List<Object> contents = new ArrayList<>();
PushData pushData = PushData.builder()
.packageCode(parcelListEntity.getOrderPackageCode())
.orderCode(parcelListEntity.getOrderCode())
.warehouseName(myCurrentWarehouse.getName())
.waybillNumber(parcelListEntity.getWaybillNumber()).build();
contents.add(pushData);
NodePushMsg msg = new NodePushMsg();
msg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
msg.setBrand(BrandEnums.getByValue(parcelListEntity.getBrandName()));
msg.setOperator(AuthUtil.getNickName());
msg.setOperatorTime(new Date());
msg.setContent(contents);
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
}
return Resp.scanSuccess("操作成功", "装车成功");
}

176
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java

@ -23,6 +23,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -34,8 +35,11 @@ import com.logpm.basicdata.feign.IWarehouseLeasingClient;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.mapper.QualityDeliverMapper;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.statistics.entity.ExpenseDispatchOrderDetailEntity;
import com.logpm.statistics.entity.ExpenseDispatchTrainDetailEntity;
import com.logpm.statistics.entity.ExpenseWarehouseOrderEntity;
import com.logpm.statistics.feign.IExpenseDispatchClient;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@ -47,6 +51,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -445,4 +450,175 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl<QualityDeliverMap
}
}
@Override
public void orderExpenseDispatchDetailFinal(JSONArray objects) {
// 生成配送订单总成本
if (CollUtil.isNotEmpty(objects)) {
List<TrunklineWaybillOrderEntity> list = JSONUtil.toList(objects, TrunklineWaybillOrderEntity.class);
TrunklineWaybillOrderEntity entity = list.get(0);
List<QualityDeliverEntity> qualityDeliverEntities = baseMapper.selectList(Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getOrderCode, entity.getOrderCode())
.eq(QualityDeliverEntity::getWaybillNumber, entity.getWaybillNo())
.orderByDesc(QualityDeliverEntity::getCarComplateTime)
);
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
QualityDeliverEntity qualityDeliverEntity = qualityDeliverEntities.get(0);
// 订单运单总数
Integer totalNumber = qualityDeliverEntity.getOrderWaybillNumber();
// 计算签收总数
Integer reduce = qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.map(QualityDeliverEntity::getSignNum)
.filter(Objects::nonNull)
.reduce(0, Integer::sum);
// 全部计算完成之后生成订单总成本
if (NumberUtil.equals(totalNumber, reduce)) {
ExpenseDispatchOrderDetailEntity orderDetailEntity = new ExpenseDispatchOrderDetailEntity();
orderDetailEntity.setBrand(qualityDeliverEntity.getBrandName());
orderDetailEntity.setOrderCode(qualityDeliverEntity.getOrderCode());
orderDetailEntity.setWaybillNumber(qualityDeliverEntity.getWaybillNumber());
orderDetailEntity.setDestinationWarehouse(qualityDeliverEntity.getWarehouseName());
orderDetailEntity.setShippingOrg(qualityDeliverEntity.getShipperUnit());
orderDetailEntity.setConsigneeOrg(qualityDeliverEntity.getConsigneeUnit());
orderDetailEntity.setWaybillType(qualityDeliverEntity.getCustomType());
orderDetailEntity.setDocumentCreationTime(DateUtil.formatDateTime(qualityDeliverEntity.getOpenOrderTime()));
orderDetailEntity.setTotalQuantity(totalNumber);
orderDetailEntity.setReviewNumber(reduce);
orderDetailEntity.setTotalWeight(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getWeight()))
.map(QualityDeliverEntity::getWeight)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setTotalVolume(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getVolume()))
.map(QualityDeliverEntity::getVolume)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setTotalDistributionCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getTotalDistributionCost()))
.map(QualityDeliverEntity::getTotalDistributionCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setDistributionCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getDistributionCost()))
.map(QualityDeliverEntity::getDistributionCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setStairCarryingFee(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getApstairsCost()))
.map(QualityDeliverEntity::getApstairsCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setGoodsAllocationCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getApartCost()))
.map(QualityDeliverEntity::getApartCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setRepositioningCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getMoveCost()))
.map(QualityDeliverEntity::getMoveCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setHandlingCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getStevedoreCost()))
.map(QualityDeliverEntity::getStevedoreCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setMileageCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getKiloAllowCost()))
.map(QualityDeliverEntity::getKiloAllowCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setSubsidizedKilometerCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getAllowKiloAllowCost()))
.map(QualityDeliverEntity::getAllowKiloAllowCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setExcessZoneMileageCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getUltrAllpwCost()))
.map(QualityDeliverEntity::getUltrAllpwCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setLocationSubsidyCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getPointAllowCost()))
.map(QualityDeliverEntity::getPointAllowCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setMinimumGuaranteeCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getGuarCost()))
.map(QualityDeliverEntity::getGuarCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setFuelCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getFuelCost()))
.map(QualityDeliverEntity::getFuelCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setOtherCosts(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getCarComplateTime()))
.filter(item -> Objects.nonNull(item.getOtherCost()))
.map(QualityDeliverEntity::getOtherCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
orderDetailEntity.setShipper(qualityDeliverEntity.getShipperPerson());
orderDetailEntity.setShippingPhone(qualityDeliverEntity.getShipperMobile());
orderDetailEntity.setShippingAddress(qualityDeliverEntity.getShipperAddress());
orderDetailEntity.setArrivalStation(qualityDeliverEntity.getConsigneeStation());
orderDetailEntity.setDepartureWarehouse(qualityDeliverEntity.getShipperStation());
orderDetailEntity.setConsignee(qualityDeliverEntity.getConsigneePerson());
orderDetailEntity.setConsigneePhone(qualityDeliverEntity.getConsigneeMobile());
orderDetailEntity.setConsigneeAddress(qualityDeliverEntity.getConsigneeAddress());
orderDetailEntity.setCustomerTrip(qualityDeliverEntity.getTrainNumber());
orderDetailEntity.setReviewCompletionTime(DateUtil.formatDateTime(qualityDeliverEntity.getReviewTime()));
expenseDispatchClient.saveDispatchOrderDetailEntity(orderDetailEntity);
}
}
}
}
@Override
public void expenseWarehouseOrder(JSONArray objects) {
// 生成仓储订单总成本
if (CollUtil.isNotEmpty(objects)) {
List<TrunklineWaybillOrderEntity> list = JSONUtil.toList(objects, TrunklineWaybillOrderEntity.class);
TrunklineWaybillOrderEntity entity = list.get(0);
List<QualityDeliverEntity> qualityDeliverEntities = baseMapper.selectList(Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getOrderCode, entity.getOrderCode())
.eq(QualityDeliverEntity::getWaybillNumber, entity.getWaybillNo())
.orderByDesc(QualityDeliverEntity::getReviewTime)
);
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
QualityDeliverEntity qualityDeliverEntity = qualityDeliverEntities.get(0);
// 订单运单总数
Integer totalNumber = qualityDeliverEntity.getOrderWaybillNumber();
// 计算签收总数
Integer reduce = qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getReviewUserName()))
.map(QualityDeliverEntity::getSignNum)
.filter(Objects::nonNull)
.reduce(0, Integer::sum);
// 全部计算完成之后生成订单总成本
if (NumberUtil.equals(totalNumber, reduce)) {
ExpenseWarehouseOrderEntity orderDetailEntity = new ExpenseWarehouseOrderEntity();
orderDetailEntity.setBusinessUnit(qualityDeliverEntity.getBusinessUnit());
orderDetailEntity.setWarehouseName(qualityDeliverEntity.getWarehouseName());
orderDetailEntity.setOrderCode(qualityDeliverEntity.getOrderCode());
orderDetailEntity.setShipmentNumber(qualityDeliverEntity.getWaybillNumber());
orderDetailEntity.setReceivingUnit(qualityDeliverEntity.getConsigneeUnit());
orderDetailEntity.setShippingUnit(qualityDeliverEntity.getShipperUnit());
orderDetailEntity.setWaybillType(qualityDeliverEntity.getCustomType());
orderDetailEntity.setTotalNumber(totalNumber);
orderDetailEntity.setOutNumber(totalNumber);
orderDetailEntity.setOriginWarehouse(qualityDeliverEntity.getShipperStation());
orderDetailEntity.setReviewCompletionTime(DateUtil.formatDateTime(qualityDeliverEntity.getReviewTime()));
orderDetailEntity.setWarehouseRentalCost(Convert.toDouble(qualityDeliverEntities.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getReviewUserName()))
.filter(item -> Objects.nonNull(item.getWarehouseCost()))
.map(QualityDeliverEntity::getWarehouseCost)
.reduce(BigDecimal.ZERO, BigDecimal::add)));
expenseDispatchClient.saveWarehouseOrderEntity(orderDetailEntity);
}
}
}
}
}

1
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/FactoryDataServiceImpl.java

@ -133,6 +133,7 @@ public class FactoryDataServiceImpl implements FactoryDataService {
entity.setDeliveryNoteId(vo.getId().toString());
entity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
entity.setTenantCode(AuthUtil.getTenantId());
entity.setOrderType(vo.getOrderType());
packageInfoEntities.add(entity);
}
packageInfoService.saveBatch(packageInfoEntities);

4
blade-service/logpm-report/pom.xml

@ -48,6 +48,10 @@
<artifactId>logpm-factory-data-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
</dependencies>
<build>

99
blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java

@ -1,30 +1,69 @@
package com.logpm.report.controller;
import com.logpm.report.service.largeScreen.IBillingDataService;
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.*;
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.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);
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;
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;
}
/**
* 地图仓库数据
@ -62,7 +101,49 @@ public class LargeScreenController{
* 事业线配载件量趋势
*/
@GetMapping("/careerLineData")
public R<List<MonthBillingDataVO>> getCareerLineData(){
return R.data(billingDataService.getMonthBillingData());
public R<List<CareerLineDataVO>> getCareerLineData(@Param("isDelivery") Integer isDelivery){
return R.data(CarsLoad.getCareerLineData(isDelivery));
}
/**
* 节点数据
*/
@GetMapping("/nodeData")
public R<NodeDataVO> getNodeData(){
return R.data(nodeData.getNodeData());
}
/**
* 库位数据
*/
@GetMapping("/binLocationData")
public R<BinLocationDataVO> getBinLocationData(){
return R.data(BinLocation.getBinLocationData());
}
/**
* 干线车次数据
*/
@GetMapping("/trunkData")
public R<TrunkDataVO> getTrunkData(){
return R.data(trunkData.getTrunkData());
}
/**
* 配送数据
* @param isYear 是否是年数据 1是
*/
@GetMapping("/deliveryData")
public R<DeliveryDataVO> getDeliveryData(@Param("isYear") Integer isYear){
log.info("getDeliveryData: isYear={}", isYear);
return R.data(deliveryDataService.getDeliveryAllData(isYear));
}
/**
* 业务占比
*/
@GetMapping("/businessRatio")
public R<BusinessRatioDataVO> getDeliveryData2B(){
return R.data(businessRatio.getBusinessRatioData());
}
}

7
blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java

@ -40,4 +40,11 @@ public class ReportTimeDTO implements Serializable {
private String trainNumber;
private String loadCode;
private String openTimeStartStr;
private String openTimeEndStr;
private Date openTimeStart;
private Date openTimeEnd;
}

70
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<String, Object> 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));
}
}

3
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java

@ -2,7 +2,6 @@ package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.report.dto.ReportTimeDTO;
import com.logpm.report.entity.ReportConfigOrderAllEntity;
import com.logpm.report.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -47,5 +46,5 @@ public interface ReportTimeMapper {
IPage<ReportOrderAllTimeVO> orderAllTimePage(IPage<Object> page, @Param("param") ReportTimeDTO reportTimeDTO);
List<ReportConfigOrderAllEntity> orderAllTimeExport(@Param("param") ReportTimeDTO reportTimeDTO);
List<ReportOrderAllTimeVO> orderAllTimeExport(@Param("param") ReportTimeDTO reportTimeDTO);
}

61
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -1391,12 +1391,6 @@
where ltad.waybill_id is not null
and ltad.create_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id
<if test="param.startTime != null ">
and ltad.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and ltad.create_time &lt;= #{param.endTime}
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
@ -1436,13 +1430,6 @@
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName !='' ">
and lww.destination_warehouse_name like concat('%',#{param.destinationWarehouseName},'%')
</if>
<if test="param.trainNumber != null and param.trainNumber !='' ">
and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%')
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
</if>
<if test="param.loadCode != null and param.loadCode !='' ">
and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%')
</if>
group by ltad.order_code,
ltad.waybill_no,
ltad.brand,
@ -1451,6 +1438,26 @@
lww.departure_warehouse_name,
lww.destination_warehouse_name,
oat.day_time
<trim prefix="HAVING" prefixOverrides="AND">
<if test="param.trainNumber != null and param.trainNumber !='' ">
and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.loadCode != null and param.loadCode !='' ">
and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%')
</if>
<if test="param.startTime != null ">
and min(ltad.create_time) &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and min(ltad.create_time) &lt;= #{param.endTime}
</if>
<if test="param.openTimeStart != null ">
and min(lww.create_time) &gt;= #{param.openTimeStart}
</if>
<if test="param.openTimeEnd != null ">
and min(lww.create_time) &lt;= #{param.openTimeEnd}
</if>
</trim>
</select>
@ -1498,12 +1505,6 @@
where ltad.waybill_id is not null
and ltad.create_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id
<if test="param.startTime != null ">
and ltad.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and ltad.create_time &lt;= #{param.endTime}
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
@ -1545,7 +1546,6 @@
</if>
<if test="param.trainNumber != null and param.trainNumber !='' ">
and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%')
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
</if>
<if test="param.loadCode != null and param.loadCode !='' ">
and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%')
@ -1558,6 +1558,27 @@
lww.departure_warehouse_name,
lww.destination_warehouse_name,
oat.day_time
<trim prefix="HAVING" prefixOverrides="AND">
<if test="param.trainNumber != null and param.trainNumber !='' ">
and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%')
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
</if>
<if test="param.loadCode != null and param.loadCode !='' ">
and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%')
</if>
<if test="param.startTime != null ">
and min(ltad.create_time) &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and min(ltad.create_time) &lt;= #{param.endTime}
</if>
<if test="param.openTimeStart != null ">
and min(lww.create_time) &gt;= #{param.openTimeStart}
</if>
<if test="param.openTimeEnd != null ">
and min(lww.create_time) &lt;= #{param.openTimeEnd}
</if>
</trim>
</select>

4
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

17
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();
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.BinLocationMapper">
<select id="getOrderNum" resultType="java.lang.Integer">
select count(distinct order_code) from logpm_platform.logpm_distribution_parcel_list where order_package_status = '20'
</select>
<select id="getPackageNum" resultType="java.lang.Integer">
select count(distinct order_package_code) from logpm_platform.logpm_distribution_parcel_list where order_package_status = '20'
</select>
<select id="getBinLocationNum" resultType="java.lang.Integer">
select count(id) from logpm_platform.logpm_warehouse_goods_allocation where enable_status = 1
</select>
<select id="getIdleBinLocationNum" resultType="java.lang.Integer">
select count(*) from logpm_platform.logpm_warehouse_goods_allocation where enable_status = 1 AND allocation_status = 1
</select>
</mapper>

15
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<ItemDataVO> getTypeData(String startTime, String endTime);
List<ItemDataVO> getBrandData(String startTime, String endTime);
}

20
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.BusinessRatioMapper">
<select id="getTypeData" resultType="com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO">
select
service_type as name,
SUM(total_count) as value
from logpm_platform.logpm_warehouse_waybill
where create_time between #{startTime} and #{endTime}
group by service_type
</select>
<select id="getBrandData" resultType="com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO">
select
brand as name,
SUM(total_count) as value
from logpm_platform.logpm_warehouse_waybill
where create_time between #{startTime} and #{endTime}
group by brand
</select>
</mapper>

9
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java

@ -1,14 +1,19 @@
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<CareerLineInfoVO> getCareerLineInfo();
public List<DeptInfoVO> getDeptInfo();
public List<VehicleStowageDataVO> getVehicleStowageData(String startTime, String endTime);
public List<VehicleStowageDataVO> getDeliveryData(String startTime, String endTime);
public List<WarehouseDeptVO> getWarehouseDept();
}

32
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml

@ -1,11 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.CarsLoadDataMapper">
<select id="getCareerLineInfo"
resultType="com.logpm.report.vo.largeScreen.CareerLineData.CareerLineInfoVO">
<select id="getDeptInfo"
resultType="com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO">
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 '%事业线%'
</select>
<select id="getVehicleStowageData"
resultType="com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO">
select DATE_FORMAT(create_time, '%Y-%m') as createMonth,
SUBSTRING_INDEX(end_warehouse_ids, ',', -1) as warehouseId,
SUM(real_loading_number) as total
from logpm_platform.logpm_trunkline_cars_load
where create_time between #{startTime} and #{endTime}
group by createMonth, warehouseId
</select>
<select id="getWarehouseDept" resultType="com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO">
select
id as warehouseId,
department as dept
from logpm_platform.logpm_warehouse_warehouse
</select>
<select id="getDeliveryData" resultType="com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO">
select DATE_FORMAT(create_time, '%Y-%m') as createMonth,
warehouse_id as warehouseId,
SUM(delivery_number) as total
from logpm_platform.logpm_distribution_delivery_list
where create_time between #{startTime} and #{endTime}
group by createMonth, warehouseId
</select>
</mapper>

11
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);
}

33
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.DeliveryDataMapper">
<select id="getDeliveryAllData" resultType="com.logpm.report.vo.largeScreen.DeliveryDataVO">
select
count(*) as total,
sum(case when delivery_status = '3' then 0 else 1 end) as toBeSigned
from logpm_platform.logpm_distribution_delivery_list
<if test="startTime != null">
where create_time between #{startTime} and #{endTime}
</if>
</select>
<select id="getDelivery2BData" resultType="com.logpm.report.vo.largeScreen.DeliveryDataVO">
select
count(*) as total2B,
sum(case when delivery_status = '3' then 0 else 1 end) as toBeSigned2B
from logpm_platform.logpm_distribution_delivery_list
where type = '1'
<if test="startTime != null">
and create_time between #{startTime} and #{endTime}
</if>
</select>
<select id="getDelivery2CData" resultType="com.logpm.report.vo.largeScreen.DeliveryDataVO">
select
count(*) as total2C,
sum(case when delivery_status = '3' then 0 else 1 end) as toBeSigned2C
from logpm_platform.logpm_distribution_delivery_list
where type = '2'
<if test="startTime != null">
and create_time between #{startTime} and #{endTime}
</if>
</select>
</mapper>

10
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<LargeScreenDataEntity> {
}

13
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);
}

24
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.NodeDataMapper">
<select id="getWaybill" resultType="java.lang.Integer">
select SUM(total_count) from logpm_platform.logpm_warehouse_waybill where create_time between #{startTime} and #{endTime}
</select>
<select id="getCarsLoadLoading" resultType="java.lang.Integer">
select SUM(real_loading_number) from logpm_platform.logpm_trunkline_cars_load where create_time between #{startTime} and #{endTime}
</select>
<select id="getDeliveryLading" resultType="java.lang.Integer">
select SUM(loaded_number) + SUM(loadedin_number) from logpm_platform.logpm_distribution_signfor where create_time between #{startTime} and #{endTime}
</select>
<select id="getArrival" resultType="java.lang.Integer">
select
count(*)
from logpm_platform.logpm_warehouse_waybill w
INNER JOIN logpm_platform.logpm_trunkline_cars_unload_log l on l.waybill_id = w.id
where l.create_time between #{startTime} and #{endTime}
</select>
<select id="getSign" resultType="java.lang.Integer">
select SUM(received_quantity) + SUM(receivedin_quantity) from logpm_platform.logpm_distribution_signfor where create_time between #{startTime} and #{endTime}
</select>
</mapper>

10
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);
}

25
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.TrunkDataMapper">
<select id="getTotal" resultType="java.lang.Integer">
select count(*)
from logpm_platform.logpm_trunkline_cars_load
where
create_time between #{startTime} and #{endTime}
and load_status in ('0', '10', '20', '30', '40', '80')
</select>
<select id="getOnTheWay" resultType="java.lang.Integer">
select
count(*)
from logpm_platform.logpm_trunkline_cars_load
where load_status in ('10', '20', '30')
</select>
<select id="getArrival" resultType="java.lang.Integer">
select
count(*)
from logpm_platform.logpm_trunkline_cars_load
where
create_time between #{startTime} and #{endTime}
and load_status in ('40', '80')
</select>
</mapper>

6
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java

@ -415,6 +415,8 @@ public class ReportTimeServiceImpl implements IReportTimeService {
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setOpenTimeStart(CommonUtil.getStartByDateStr(reportTimeDTO.getOpenTimeStartStr()));
reportTimeDTO.setOpenTimeEnd(CommonUtil.getEndByDateStr(reportTimeDTO.getOpenTimeEndStr()));
reportTimeDTO.setDayTime(0);
@ -447,9 +449,9 @@ public class ReportTimeServiceImpl implements IReportTimeService {
reportTimeDTO.setDayTime(orderAllEntity.getDayTime());
}
List<ReportConfigOrderAllEntity> list = reportTimeMapper.orderAllTimeExport(reportTimeDTO);
List<ReportOrderAllTimeVO> list = reportTimeMapper.orderAllTimeExport(reportTimeDTO);
//导出ls
ExcelUtil.export(response, "订单整体时效报表导出", "订单整体时效报表导出", list, ReportConfigOrderAllEntity.class);
ExcelUtil.export(response, "订单整体时效报表导出", "订单整体时效报表导出", list, ReportOrderAllTimeVO.class);
}
}

7
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();
}

8
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();
}

2
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<CareerLineDataVO> getCareerLineData();
public List<CareerLineDataVO> getCareerLineData(Integer isDelivery);
}

8
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);
}

7
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();
}

8
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();
}

63
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.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getBillingData();
}
@Override
public List<WarehouseBillingDataVO> getWarehouseBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getWarehouseBillingData();
}
@Override
public List<MonthBillingDataVO> getMonthBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new ArrayList<>();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getMonthBillingData();
}
}

32
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.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new BinLocationDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getBinLocationData();
}
}

34
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.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new BusinessRatioDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getBusinessRatio();
}
}

48
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<CareerLineDataVO> getCareerLineData(Integer isDelivery) {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new ArrayList<>();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return isDelivery.equals(1)
? init.getCareerLineDeliveryData()
: init.getCareerLineData();
}
}

38
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.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new DeliveryDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return isYear.equals(1)
? init.getDeliveryYearData()
: init.getDeliveryData();
}
}

42
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<MapWarehouseVO> list() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new ArrayList<>();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getMapWarehouse();
}
}

32
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.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new NodeDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getNodeData();
}
}

37
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.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new TrunkDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getTrunkData();
}
}

4
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;

30
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java

@ -0,0 +1,30 @@
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.context.annotation.Primary;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
@Log4j2
@Primary
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;
}
}

33
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java

@ -0,0 +1,33 @@
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.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service
@Log4j2
@Primary
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;
}
}

91
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java

@ -2,28 +2,107 @@ 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.context.annotation.Primary;
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
@Log4j2
@Primary
public class CarsLoadDataServiceImpl implements ICarsLoadDataService {
private CarsLoadDataMapper carsLoadDataMapper;
@Override
public List<CareerLineDataVO> getCareerLineData() {
public List<CareerLineDataVO> getCareerLineData(Integer isDelivery) {
List<CareerLineInfoVO> careerLineInfo = carsLoadDataMapper.getCareerLineInfo();
Map<Long, DeptInfoVO> careerLineMap = analysisCareerLineByDept(carsLoadDataMapper.getDeptInfo());
Map<Long, Long> warehouseDept = carsLoadDataMapper.getWarehouseDept().stream()
.filter(WarehouseDeptVO -> WarehouseDeptVO.getDept() != null)
.collect(Collectors.toMap(WarehouseDeptVO::getWarehouseId, WarehouseDeptVO::getDept));
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<VehicleStowageDataVO> vehicleStowageData = isDelivery.equals(1)
? carsLoadDataMapper.getDeliveryData(startTime, endTime)
: carsLoadDataMapper.getVehicleStowageData(startTime, endTime);
return Collections.emptyList();
HashMap<Long, CareerLineDataVO> resultMap = new HashMap<>();
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<VehicleStowageMonthDataVo> monthDataInit(){
String year = String.valueOf(LocalDate.now().getYear());
List<VehicleStowageMonthDataVo> 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<Long, DeptInfoVO> analysisCareerLineByDept(List<DeptInfoVO> deptInfo) {
Map<Long, DeptInfoVO> deptInfoVOMap = deptInfo.stream().collect(Collectors.toMap(DeptInfoVO::getId, deptInfoVO -> deptInfoVO));
Map<Long, DeptInfoVO> 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;
}
}

47
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java

@ -0,0 +1,47 @@
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.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service
@Log4j2
@Primary
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;
}
}

10
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java

@ -9,14 +9,19 @@ 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;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@AllArgsConstructor
@Service
@Slf4j
@Primary
public class MapWarehouseServiceImpl implements IMapWarehouseService {
private final MapWarehouseMapper mapWarehouseMapper;
@ -25,10 +30,9 @@ public class MapWarehouseServiceImpl implements IMapWarehouseService {
public List<MapWarehouseVO> list() {
List<WarehouseInfoVO> warehouselist = mapWarehouseMapper.warehouselist();
List<LineInfoVO> 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<Long, List<LineInfoVO>> warehouseLine = lineInfoVOS.stream().collect(Collectors.groupingBy(LineInfoVO::getStartWarehouseId));

37
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java

@ -0,0 +1,37 @@
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.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Log4j2
@Service
@Primary
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;
}
}

35
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java

@ -0,0 +1,35 @@
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.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service
@Log4j2
@Primary
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;
}
}

11
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;
}

14
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<ItemDataVO> type;
private List<ItemDataVO> brand;
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/CareerLineInfoVO.java → 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;
}

15
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;
}

17
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;
}
}

11
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;
}

15
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<VehicleStowageMonthDataVo> monthData;
public CareerLineDataVO(String careerLineName, List<VehicleStowageMonthDataVo> monthData) {
this.careerLineName = careerLineName;
this.monthData = monthData;
}
}

33
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;
}

66
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<MapWarehouseVO> mapWarehouse;
BillingDataVO billingData;
List<WarehouseBillingDataVO> warehouseBillingData;
List<MonthBillingDataVO> monthBillingData;
List<CareerLineDataVO> careerLineData;
List<CareerLineDataVO> careerLineDeliveryData;
NodeDataVO nodeData;
BinLocationDataVO binLocationData;
TrunkDataVO trunkData;
DeliveryDataVO deliveryData;
DeliveryDataVO deliveryYearData;
BusinessRatioDataVO businessRatio;
public static XxlJobQueryVO init(Map<String, Object> data){
XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO();
data.forEach((k,v) -> {
if (k.equals("mapWarehouse")) {
xxlJobQueryVO.setMapWarehouse((List<MapWarehouseVO>) v);
}
if (k.equals("billingData")) {
xxlJobQueryVO.setBillingData((BillingDataVO) v);
}
if (k.equals("warehouseBillingData")) {
xxlJobQueryVO.setWarehouseBillingData((List<WarehouseBillingDataVO>) v);
}
if (k.equals("monthBillingData")) {
xxlJobQueryVO.setMonthBillingData((List<MonthBillingDataVO>) v);
}
if (k.equals("careerLineData")) {
xxlJobQueryVO.setCareerLineData((List<CareerLineDataVO>) v);
}
if (k.equals("careerLineDeliveryData")) {
xxlJobQueryVO.setCareerLineDeliveryData((List<CareerLineDataVO>) 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;
}
}

5
blade-service/logpm-statisticsdata/pom.xml

@ -78,6 +78,11 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-data-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
</dependencies>
<build>

16
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/feign/ExpenseDispatchClient.java

@ -7,14 +7,18 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.statistics.dto.ExpenseDispatchClientDTO;
import com.logpm.statistics.dto.ExpenseDispatchPriceRuleDTO;
import com.logpm.statistics.entity.ExpenseDispatchOrderDetailEntity;
import com.logpm.statistics.entity.ExpenseDispatchPriceEntity;
import com.logpm.statistics.entity.ExpenseDispatchPriceRuleEntity;
import com.logpm.statistics.entity.ExpenseDispatchPriceServiceEntity;
import com.logpm.statistics.entity.ExpenseDispatchTrainDetailEntity;
import com.logpm.statistics.entity.ExpenseWarehouseOrderEntity;
import com.logpm.statistics.service.IExpenseDispatchOrderDetailService;
import com.logpm.statistics.service.IExpenseDispatchPriceRuleService;
import com.logpm.statistics.service.IExpenseDispatchPriceService;
import com.logpm.statistics.service.IExpenseDispatchPriceServiceService;
import com.logpm.statistics.service.IExpenseDispatchTrainDetailService;
import com.logpm.statistics.service.IExpenseOrderWarehouseTotalService;
import com.logpm.statistics.vo.ExpenseDispatchPriceVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -35,6 +39,8 @@ public class ExpenseDispatchClient implements IExpenseDispatchClient {
private final IExpenseDispatchPriceService priceService;
private final IExpenseDispatchPriceRuleService ruleService;
private final IExpenseDispatchTrainDetailService trainDetailService;
private final IExpenseDispatchOrderDetailService orderDetailService;
private final IExpenseOrderWarehouseTotalService orderWarehouseTotalService;
@Override
public ExpenseDispatchClientDTO findPriceByDriverId(Long warehouseId, Long driverId, Long carType, String dispatchType) {
@ -80,4 +86,14 @@ public class ExpenseDispatchClient implements IExpenseDispatchClient {
trainDetailService.save(entity);
}
}
@Override
public void saveDispatchOrderDetailEntity(ExpenseDispatchOrderDetailEntity orderDetailEntity) {
orderDetailService.save(orderDetailEntity);
}
@Override
public void saveWarehouseOrderEntity(ExpenseWarehouseOrderEntity orderDetailEntity) {
orderWarehouseTotalService.save(orderDetailEntity);
}
}

38
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/job/ExpenseJob.java

@ -7,22 +7,27 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.entity.WarehouseLeasingEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.feign.IWarehouseLeasingClient;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.feign.IQualityDeliverClient;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.vo.SendMsg;
import com.logpm.statistics.entity.ExpenseWarehouseDayEntity;
import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity;
import com.logpm.statistics.service.IExpenseDispatchWarehouseMonthService;
import com.logpm.statistics.service.IExpenseWarehouseDayService;
import com.logpm.statistics.service.IExpenseWarehouseMonthService;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.report.ReportConstants;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -59,6 +64,8 @@ public class ExpenseJob {
private IExpenseDispatchWarehouseMonthService dispatchWarehouseMonthService;
@Resource
private ITrunklineCarsLoadScanClient carsLoadScanClient;
@Resource
private IFactoryDataClient factoryDataClient;
/**
* 仓库月度仓储成本统计表
@ -133,7 +140,27 @@ public class ExpenseJob {
Map<Long, List<QualityDeliverEntity>> customMap = new HashMap<>();
Map<Long, List<QualityDeliverEntity>> tempMap = new HashMap<>();
Map<Long, List<QualityDeliverEntity>> gcpMap = new HashMap<>();
Map<String, TrunklineWaybillOrderEntity> waybillOrderMap = new HashMap<>();
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
for (QualityDeliverEntity entity : qualityDeliverEntities) {
if (StrUtil.isEmpty(entity.getOrderCode()) || StrUtil.isEmpty(entity.getWaybillNumber())) {
log.info("订单或运单为空,不生成订单总成本报表:id = {}", entity.getId());
continue;
}
String key = entity.getOrderCode() + entity.getWaybillNumber();
if (waybillOrderMap.containsKey(key)) {
TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderMap.get(key);
Integer totalNumber = waybillOrderEntity.getTotalNumber();
waybillOrderEntity.setTotalNumber(totalNumber + entity.getSignNum());
} else {
TrunklineWaybillOrderEntity waybillOrderEntity = new TrunklineWaybillOrderEntity();
waybillOrderEntity.setOrderCode(entity.getOrderCode());
waybillOrderEntity.setWaybillNo(entity.getWaybillNumber());
waybillOrderEntity.setTotalNumber(entity.getSignNum());
waybillOrderMap.put(key, waybillOrderEntity);
}
}
// 每个仓有多少数据
Map<Long, List<QualityDeliverEntity>> map = qualityDeliverEntities.stream().collect(Collectors.groupingBy(QualityDeliverEntity::getWarehouseId));
for (Map.Entry<Long, List<QualityDeliverEntity>> longListEntry : map.entrySet()) {
@ -307,6 +334,17 @@ public class ExpenseJob {
if (CollUtil.isNotEmpty(packageCostMap)) {
qualityDeliverClient.updateWarehouseCost(packageCostMap);
}
// 生成订单 发送延时消息生成报表
if (CollUtil.isNotEmpty(waybillOrderMap)) {
for (Map.Entry<String, TrunklineWaybillOrderEntity> entityEntry : waybillOrderMap.entrySet()) {
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_EXPENSE_WAREHOUSE_ORDER_EXCHANGE)
.routingKey(ReportConstants.REPORT_EXPENSE_WAREHOUSE_ORDER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(entityEntry.getValue()))
.delay(10000)
.build());
}
}
}
return ReturnT.SUCCESS;
}

18
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchOrderDetailMapper.xml

@ -6,8 +6,22 @@
<resultMap id="expenseDispatchOrderDetailResultMap" type="com.logpm.statistics.entity.ExpenseDispatchOrderDetailEntity">
</resultMap>
<select id="selectExpenseDispatchOrderDetailPage" resultMap="expenseDispatchOrderDetailResultMap">
<select id="selectExpenseDispatchOrderDetailPage" resultType="com.logpm.statistics.vo.ExpenseDispatchOrderDetailVO">
select *
from logpm_expense_dispatch_order_detail t
<where>
<if test="expenseDispatchOrderDetail.orderCode != null and expenseDispatchOrderDetail.orderCode != ''">
and t.order_code like concat('%',#{expenseDispatchOrderDetail.orderCode},'%')
</if>
<if test="expenseDispatchOrderDetail.destinationWarehouse != null and expenseDispatchOrderDetail.destinationWarehouse != ''">
and t.destination_warehouse = #{expenseDispatchOrderDetail.destinationWarehouse}
</if>
<if test="expenseDispatchOrderDetail.waybillNumber != null and expenseDispatchOrderDetail.waybillNumber != ''">
and t.waybill_number like concat('%',#{expenseDispatchOrderDetail.waybillNumber},'%')
</if>
</where>
</select>
<select id="selectExpenseDispatchOrderDetailPage" resultType="com.logpm.statistics.vo.ExpenseDispatchOrderDetailVO">
select t.order_code orderCode,
t.waybill_number waybillNumber,
t.brand_name brand,

18
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseOrderWarehouseTotalMapper.xml

@ -8,6 +8,24 @@
<select id="selectExpenseOrderWarehouseTotalPage" resultType="com.logpm.statistics.vo.ExpenseWarehouseOrderVO">
select *
from logpm_expense_warehouse_order
<where>
<if test="query.orderCode != null and query.orderCode != ''">
and order_code = #{query.orderCode}
</if>
<if test="query.shipmentNumber != null and query.shipmentNumber != ''">
and shipment_number = #{query.shipmentNumber}
</if>
<if test="query.warehouseName != null and query.warehouseName != ''">
and warehouse_name in
<foreach collection="query.warehouseName.split(',')" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectExpenseOrderWarehouseTotalPage1" resultType="com.logpm.statistics.vo.ExpenseWarehouseOrderVO">
select * from (
select warehouse_name warehouseName,
order_code orderCode,

48
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseOrderVO.java

@ -71,41 +71,47 @@ public class ExpenseWarehouseOrderVO {
@ExcelProperty("发货单位")
private String shippingUnit;
/**
* 发货单位
* 运单类型
*/
@ApiModelProperty(value = "配送类型")
@ExcelProperty("配送类型")
@ApiModelProperty(value = "运单类型")
@ExcelProperty("运单类型")
private String deliveryType;
/**
* 复核状态
*/
@ApiModelProperty(value = "复核状态 已完成 未完成")
@ExcelProperty("复核状态")
private String reviewStatus;
/**
* 发站仓
*/
@ApiModelProperty(value = "发站仓")
@ExcelProperty("发站仓")
private String originWarehouse;
// /**
// * 复核状态
// */
// @ApiModelProperty(value = "复核状态 已完成 未完成")
// @ExcelProperty("复核状态")
// private String reviewStatus;
/**
* 订单总件数
* 订单运单总件数
*/
@ApiModelProperty(value = "订单总件数")
@ExcelProperty("订单总件数")
@ApiModelProperty(value = "订单运单总件数")
@ExcelProperty("订单运单总件数")
private Integer totalNumber;
/**
* 出库件数
* 签收复核件数
*/
@ApiModelProperty(value = "出库件数")
@ExcelProperty("出库件数")
@ApiModelProperty(value = "签收复核件数")
@ExcelProperty("签收复核件数")
private Integer outNumber;
/**
* 发站仓
*/
@ApiModelProperty(value = "发站仓")
@ExcelProperty("发站仓")
private String originWarehouse;
/**
* 租赁成本
*/
@ApiModelProperty(value = "租赁成本")
@ExcelProperty("租赁成本")
private BigDecimal warehouseRentalCost;
/**
* 复核完成时间
*/
@ApiModelProperty(value = "复核完成时间")
@ExcelProperty("复核完成时间")
private String reviewCompletionTime;
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -9043,7 +9043,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
if(!Objects.isNull(isTrunklineLoadingPhoto) && NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = loadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){

Loading…
Cancel
Save