Browse Source

Merge remote-tracking branch 'origin/dev' into dev

visual
zhenghaoyu 5 months ago
parent
commit
da4654cd2a
  1. 15
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java
  2. 10
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/FactoryNodePushEntity.java
  3. 1
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/enums/NodeNeedEnums.java
  4. 9
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java
  5. 6
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java
  6. 322
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  7. 32
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java
  8. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  9. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

15
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java

@ -39,7 +39,20 @@ public class StatisticsOrderInfoVO implements Serializable {
private String payType;//支付类型
private String payWay;//支付方式
private String goodsName;//物料品类
/**
* 开单品类
*/
private String goodsName;
/**
* 开单数量
*/
private String goodsNum;
/**
* 开单价格
*/
private String goodsPrice;
private Integer totalNum;//订单数量
private BigDecimal totalWeight;//订单重量
private BigDecimal totalVolume;//订单体积

10
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/FactoryNodePushEntity.java

@ -50,11 +50,21 @@ public class FactoryNodePushEntity extends BaseEntity {
*/
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
/**
* 类型仓配stock/干线carrier
*/
@ApiModelProperty(name = "类型(仓配stock/干线carrier)", notes = "")
private String type;
/**
* 订单号
*/
@ApiModelProperty(name = "订单号", notes = "")
private String orderCode;
/**
* 仓库
*/
@ApiModelProperty(name = "仓库", notes = "")
private String warehouse;
/**
* 运单
*/

1
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/enums/NodeNeedEnums.java

@ -21,6 +21,7 @@ public enum NodeNeedEnums implements Serializable {
* 包件入库
*/
// END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"),
INITIAL_WAREHOUSE_ENTRY(101020, "始发仓入库"),
UNLOAD_INCOMING_WAREHOUSE(105010, "卸车入库"),
;

9
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java

@ -214,6 +214,8 @@ public class NodeDataPushListener {
// 保存推送记录
factoryNodePushService.save(FactoryNodePushEntity.builder()
.orderCode(orderCode)
.type(arriveFor)
.warehouse(StrUtil.equals(arriveFor, "stock") ? filterDatum.getWarehouseName() : null)
.node(FactoryNodeEnums.END_WAREHOUSE_UNLOADING.getCode().toString())
.content(JSONUtil.toJsonStr(js))
.packageCode(packageCode)
@ -269,6 +271,9 @@ public class NodeDataPushListener {
// 保存推送记录
factoryNodePushService.save(FactoryNodePushEntity.builder()
.orderCode(sendOrderCode)
.type(arriveFor)
// 仓配数据记录仓库
.warehouse(StrUtil.equals(arriveFor, "stock") ? filterDatum.getWarehouseName() : null)
.transportNo(transportNo)
.node(FactoryNodeEnums.FINAL_NET_ARRIVE_CAR.getCode().toString())
.content(JSONUtil.toJsonStr(js))
@ -294,8 +299,8 @@ public class NodeDataPushListener {
.exchange(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH_DELAYED)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_NODE_DATA_PUSH)
.message(JSONUtil.toJsonStr(nodePushMsg, HutoolConfigUtil.jsonConfigByDataTimeFormat()))
// 3-10秒随机
.delay(1000 * RandomUtil.randomInt(3, 11))
// 30-109秒随机
.delay(1000 * RandomUtil.randomInt(30, 110))
.build());
}
}

6
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java

@ -479,8 +479,10 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
}
advanceDetailEntity.setSiteName(IDict.getTextByCode(BusSourceEnums.class, order.getBusSource()));
advanceDetailEntity.setSiteCode("");
String planQty = orderPackageDTO.getGoodsNum();
advanceDetailEntity.setQuantity((StrUtil.isNotBlank(planQty) && NumberUtil.isNumber(planQty)) ? Convert.toInt(planQty) : 0);
// String planQty = orderPackageDTO.getGoodsNum();
// 包件数量默认 1
advanceDetailEntity.setQuantity(1);
// advanceDetailEntity.setQuantity((StrUtil.isNotBlank(planQty) && NumberUtil.isNumber(planQty)) ? Convert.toInt(planQty) : 1);
advanceDetailEntity.setOrderPackageCode(orderPackageDTO.getExtBoxCode());
advanceDetailEntity.setTrainNumber("");
advanceDetailEntity.setServiceNum(orderInfo.getOmsExtYsId());

322
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -4,46 +4,49 @@
<select id="pageList" resultType="com.logpm.statistics.vo.StatisticsOrderInfoVO">
select lsoi.id orderInfoId,
lsoi.brand_id brandId,
lsoi.brand brand,
lsoi.waybill_id waybillId,
lsoi.waybill_no waybillNo,
lsoi.order_code orderCode,
lsoi.type_service typeService,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.consignee consignee,
lww.consignee_name consigneePerson,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
concat(GROUP_CONCAT(lwwd.product_name)) as goodsName,
lsoi.sign_status signStatus,
lsoi.sign_date signDate,
lww.create_time openTime,
lww.departure departure,
lww.destination destination,
lsoi.departure_warehouse_id departureWarehouseId,
lsoi.departure_warehouse_name departureWarehouseName,
lsoi.destination_warehouse_id destinationWarehouseId,
lsoi.destination_warehouse_name destinationWarehouseName,
lww.delivery_method deliveryMethod,
lww.customer_train customerTrain,
lww.pay_type payType,
lww.pay_way payWay,
lsoi.create_reconciliation_order_status createReconciliationOrderStatus,
lsoi.create_reconciliation_user_name createReconciliationUserName,
lsoi.create_reconciliation_date createReconciliationDate,
lsoi.cycle cycle,
lsoi.warehouse_fee_interval warehouseFeeInterval,
lsoi.sync_fee_status syncFeeStatus,
lsoi.sync_fee_date syncFeeDate,
lbc.clean_obj_type cleanObjType
lsoi.brand_id brandId,
lsoi.brand brand,
lsoi.waybill_id waybillId,
lsoi.waybill_no waybillNo,
lsoi.order_code orderCode,
lsoi.type_service typeService,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.consignee consignee,
lww.consignee_name consigneePerson,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
concat(GROUP_CONCAT(lwwd.product_name)) as goodsName,
concat(
group_concat( lwwd.num )) AS goodsNum,
concat(
group_concat( lwwd.price )) AS goodsPrice,
lsoi.sign_status signStatus,
lsoi.sign_date signDate,
lww.create_time openTime,
lww.departure departure,
lww.destination destination,
lsoi.departure_warehouse_id departureWarehouseId,
lsoi.departure_warehouse_name departureWarehouseName,
lsoi.destination_warehouse_id destinationWarehouseId,
lsoi.destination_warehouse_name destinationWarehouseName,
lww.delivery_method deliveryMethod,
lww.customer_train customerTrain,
lww.pay_type payType,
lww.pay_way payWay,
lsoi.create_reconciliation_order_status createReconciliationOrderStatus,
lsoi.create_reconciliation_user_name createReconciliationUserName,
lsoi.create_reconciliation_date createReconciliationDate,
lsoi.cycle cycle,
lsoi.warehouse_fee_interval warehouseFeeInterval,
lsoi.sync_fee_status syncFeeStatus,
lsoi.sync_fee_date syncFeeDate,
lbc.clean_obj_type cleanObjType
from logpm_statistics_order_info lsoi
left join logpm_basicdata_client lbc on lbc.id = lsoi.consignee_id
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
LEFT JOIN logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id=lww.id
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
where 1=1
and lsoi.create_reconciliation_order_status = 0
<if test="param.listType == 1">
@ -135,10 +138,10 @@
lsoi.waybill_no waybillNo,
lsoi.order_code orderCode,
case when lsoi.type_service=1 then '商配'
when lsoi.type_service=2 then '市配'
when lsoi.type_service=3 then '自提'
when lsoi.type_service=4 then '三方中转'
else '未知' end typeService,
when lsoi.type_service=2 then '市配'
when lsoi.type_service=3 then '自提'
when lsoi.type_service=4 then '三方中转'
else '未知' end typeService,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
@ -148,8 +151,8 @@
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
case when lsoi.sign_status=0 then '未签收'
when lsoi.sign_status=1 then '已签收'
else '未知' end signStatus,
when lsoi.sign_status=1 then '已签收'
else '未知' end signStatus,
lsoi.sign_date signDate,
lww.create_time openTime,
lww.departure departure,
@ -304,111 +307,113 @@
</select>
<select id="findStatementListByOrderInfoIds" resultType="com.logpm.statistics.vo.StatisticsOrderInfoVO">
select lsoi.id orderInfoId,
lsoi.order_code orderNo,
lsoi.waybill_no waybillNo,
lww.brand brand,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.consignee consignee,
lww.consignee_name consigneePerson,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
lww.waybill_status waybillStatus,
lsoi.sign_status signStatus,
lsoi.type_service typeService,
IF(lww.check_user_id is null,0,1) isCheck,
lww.create_time openTime,
lww.departure departure,
lww.destination destination,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.delivery_method deliveryMethod,
lww.customer_train customerTrain,
IF(twr.waybill_id is null,0,1) receiptStatus,
lww.remark waybillRemark,
lww.pay_type payType,
lww.pay_way payWay,
lsoi.confirm_statistics_order confirmStatisticsOrder,
lsoi.confirm_statistics_user_name confirmStatisticsUserName,
lsoi.confirm_statistics_time confirmStatisticsTime,
lsoi.changes_fee changesFee,
IF(count(lscr.id)>0,1,0) isChanges,
GROUP_CONCAT(lscr.item_record) changesItems,
GROUP_CONCAT(lscr.remark) changesRemark,
MAX(lscr.create_time) changesTime,
GROUP_CONCAT(DISTINCT lstp.product_name) goodsName,
IFNULL(sum(lstp.total_num),0) totalcount,
IFNULL(sum(lstp.total_weight),0) totalWeight,
IFNULL(sum(lstp.total_volume),0) totalVolume,
IFNULL(sum(lstp.open_price+lswp.open_price+lsdp.open_price),0) openFee,
IFNULL(sum(lstp.total_price+lswp.total_price+lsdp.total_price),0) totalFee,
sum(lstp.pickup_fee) pickupFee,
sum(lstp.real_pickup_fee) realPickupFee,
sum(lstp.freight_fee) freightFee,
sum(lstp.real_freight_fee) realFreightFee,
sum(lstp.install_fee) installFee,
sum(lstp.real_install_fee) realInstallFee,
sum(lstp.quotation_fee) quotationFee,
sum(lstp.real_quotation_fee) realQuotationFee,
sum(lstp.claiming_value) claimingValue,
sum(lstp.real_claiming_value) realClaimingValue,
sum(lstp.other_fee) otherFee,
sum(lstp.real_other_fee) realOtherFee,
sum(lstp.return_fee) returnFee,
sum(lstp.real_return_fee) realReturnFee,
sum(lstp.third_opration_fee) thirdOprationFee,
sum(lstp.real_third_opration_fee) realThirdOprationFee,
sum(lstp.x_pay) xPay,
sum(lstp.real_x_pay) realXPay,
sum(lstp.d_pay) dPay,
sum(lstp.real_d_pay) realDPay,
sum(lstp.h_pay) hPay,
sum(lstp.real_h_pay) realHPay,
sum(lstp.y_pay) yPay,
sum(lstp.real_y_pay) realYPay,
min(lswp.incoming_time) incomingTime,
max(lswp.outing_time) outingTime,
sum(lswp.warehouse_service_fee) warehouseServiceFee,
sum(lswp.real_warehouse_service_fee) realWarehouseServiceFee,
sum(lswp.warehouse_fee) warehouseFee,
sum(lswp.real_warehouse_fee) realWarehouseFee,
sum(lswp.warehouse_manage_fee) warehouseManageFee,
sum(lswp.real_warehouse_manage_fee) realWarehouseManageFee,
sum(lswp.warehouse_sorting_fee) warehouseSortingFee,
sum(lswp.real_warehouse_sorting_fee) realWarehouseSortingFee,
sum(lswp.warehouse_operating_fee) warehouseOperatingFee,
sum(lswp.real_warehouse_operating_fee) realWarehouseOperatingFee,
sum(lsdp.delivery_service_fee) deliveryServiceFee,
sum(lsdp.real_delivery_service_fee) realDeliveryServiceFee,
sum(lsdp.delivery_fee) deliveryFee,
sum(lsdp.real_delivery_fee) realDeliveryFee,
sum(lsdp.delivery_loading_fee) deliveryLoadingFee,
sum(lsdp.real_delivery_loading_fee) realDeliveryLoadingFee,
sum(lsdp.delivery_sorting_fee) deliverySortingFee,
sum(lsdp.real_delivery_sorting_fee) realDeliverySortingFee,
sum(lsdp.delivery_upfloor_fee) deliveryUpfloorFee,
sum(lsdp.real_delivery_upfloor_fee) realDeliveryUpfloorFee,
sum(lsdp.delivery_move_fee) deliveryMoveFee,
sum(lsdp.real_delivery_move_fee) realDeliveryMoveFee,
max(lsdp.delivery_distance) deliveryDistance,
max(lsdp.real_delivery_distance) realDeliveryDistance,
sum(lsdp.delivery_crossing_fee) deliveryCrossingFee,
sum(lsdp.real_delivery_crossing_fee) realDeliveryCrossingFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price)+lsoi.changes_fee totalStatementFee,
sum(IF(lsdp.is_sign = 0,0,lsdp.total_num)) signNum,
max(lsdp.sign_time) signTime
lsoi.order_code orderNo,
lsoi.waybill_no waybillNo,
lww.brand brand,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.consignee consignee,
lww.consignee_name consigneePerson,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
lww.waybill_status waybillStatus,
lsoi.sign_status signStatus,
lsoi.type_service typeService,
IF(lww.check_user_id is null,0,1) isCheck,
lww.create_time openTime,
lww.departure departure,
lww.destination destination,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.delivery_method deliveryMethod,
lww.customer_train customerTrain,
IF(twr.waybill_id is null,0,1) receiptStatus,
lww.remark waybillRemark,
lww.pay_type payType,
lww.pay_way payWay,
lsoi.confirm_statistics_order confirmStatisticsOrder,
lsoi.confirm_statistics_user_name confirmStatisticsUserName,
lsoi.confirm_statistics_time confirmStatisticsTime,
lsoi.changes_fee changesFee,
IF(count(lscr.id)>0,1,0) isChanges,
GROUP_CONCAT(lscr.item_record) changesItems,
GROUP_CONCAT(lscr.remark) changesRemark,
MAX(lscr.create_time) changesTime,
GROUP_CONCAT(DISTINCT lstp.product_name) goodsName,
IFNULL(sum(lstp.total_num),0) totalcount,
IFNULL(sum(lstp.total_weight),0) totalWeight,
IFNULL(sum(lstp.total_volume),0) totalVolume,
IFNULL(sum(lstp.open_price+lswp.open_price+lsdp.open_price),0) openFee,
IFNULL(sum(lstp.total_price+lswp.total_price+lsdp.total_price),0) totalFee,
sum(lstp.pickup_fee) pickupFee,
sum(lstp.real_pickup_fee) realPickupFee,
sum(lstp.freight_fee) freightFee,
sum(lstp.real_freight_fee) realFreightFee,
sum(lstp.install_fee) installFee,
sum(lstp.real_install_fee) realInstallFee,
sum(lstp.quotation_fee) quotationFee,
sum(lstp.real_quotation_fee) realQuotationFee,
sum(lstp.claiming_value) claimingValue,
sum(lstp.real_claiming_value) realClaimingValue,
sum(lstp.other_fee) otherFee,
sum(lstp.real_other_fee) realOtherFee,
sum(lstp.return_fee) returnFee,
sum(lstp.real_return_fee) realReturnFee,
sum(lstp.third_opration_fee) thirdOprationFee,
sum(lstp.real_third_opration_fee) realThirdOprationFee,
sum(lstp.x_pay) xPay,
sum(lstp.real_x_pay) realXPay,
sum(lstp.d_pay) dPay,
sum(lstp.real_d_pay) realDPay,
sum(lstp.h_pay) hPay,
sum(lstp.real_h_pay) realHPay,
sum(lstp.y_pay) yPay,
sum(lstp.real_y_pay) realYPay,
min(lswp.incoming_time) incomingTime,
max(lswp.outing_time) outingTime,
sum(lswp.warehouse_service_fee) warehouseServiceFee,
sum(lswp.real_warehouse_service_fee) realWarehouseServiceFee,
sum(lswp.warehouse_fee) warehouseFee,
sum(lswp.real_warehouse_fee) realWarehouseFee,
sum(lswp.warehouse_manage_fee) warehouseManageFee,
sum(lswp.real_warehouse_manage_fee) realWarehouseManageFee,
sum(lswp.warehouse_sorting_fee) warehouseSortingFee,
sum(lswp.real_warehouse_sorting_fee) realWarehouseSortingFee,
sum(lswp.warehouse_operating_fee) warehouseOperatingFee,
sum(lswp.real_warehouse_operating_fee) realWarehouseOperatingFee,
sum(lsdp.delivery_service_fee) deliveryServiceFee,
sum(lsdp.real_delivery_service_fee) realDeliveryServiceFee,
sum(lsdp.delivery_fee) deliveryFee,
sum(lsdp.real_delivery_fee) realDeliveryFee,
sum(lsdp.delivery_loading_fee) deliveryLoadingFee,
sum(lsdp.real_delivery_loading_fee) realDeliveryLoadingFee,
sum(lsdp.delivery_sorting_fee) deliverySortingFee,
sum(lsdp.real_delivery_sorting_fee) realDeliverySortingFee,
sum(lsdp.delivery_upfloor_fee) deliveryUpfloorFee,
sum(lsdp.real_delivery_upfloor_fee) realDeliveryUpfloorFee,
sum(lsdp.delivery_move_fee) deliveryMoveFee,
sum(lsdp.real_delivery_move_fee) realDeliveryMoveFee,
max(lsdp.delivery_distance) deliveryDistance,
max(lsdp.real_delivery_distance) realDeliveryDistance,
sum(lsdp.delivery_crossing_fee) deliveryCrossingFee,
sum(lsdp.real_delivery_crossing_fee) realDeliveryCrossingFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price)+lsoi.changes_fee totalStatementFee,
sum(IF(lsdp.is_sign = 0,0,lsdp.total_num)) signNum,
max(lsdp.sign_time) signTime
from logpm_statistics_order_info lsoi
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on
twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and
lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and
lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
where 1=1
and lsoi.id in
<foreach collection="orderInfoIds" item="item" open="(" separator="," close=")">
@ -417,7 +422,6 @@
</select>
<select id="findPackageListByOrderIds" resultType="com.logpm.statistics.vo.StatisticsPackageFeeInfoVO">
select
IFNULL(sum(lstp.num),0) totalNum,
@ -442,8 +446,12 @@
IFNULL(sum(lsdp.delivery_other_fee),0) deliveryOtherFee,
IFNULL(sum(lsdp.delivery_crossing_fee),0) deliveryCrossingFee
from logpm_statistics_trunkline_package lstp
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and IFNULL(lswp.order_package_code,0) = IFNULL(lstp.order_package_code,0) and IFNULL(lswp.product_id,1) = IFNULL(lstp.product_id,1)
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and IFNULL(lsdp.order_package_code,0) = IFNULL(lswp.order_package_code,0) and IFNULL(lswp.product_id,1) = IFNULL(lsdp.product_id,1)
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and
IFNULL(lswp.order_package_code,0) = IFNULL(lstp.order_package_code,0) and IFNULL(lswp.product_id,1) =
IFNULL(lstp.product_id,1)
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and
IFNULL(lsdp.order_package_code,0) = IFNULL(lswp.order_package_code,0) and IFNULL(lswp.product_id,1) =
IFNULL(lsdp.product_id,1)
where lstp.order_info_id in
<foreach collection="orderInfoIds" item="item" open="(" separator="," close=")">
#{item}
@ -456,8 +464,10 @@
IFNULL(sum(lstp.num),0) totalNum,
IFNULL(sum(lstp.weight),0) totalWeight,
IFNULL(sum(lstp.volume),0) totalVolume,
IFNULL(sum(lstp.system_freight_price),0)+IFNULL(sum(lstp.system_pickup_price),0)+IFNULL(sum(lswp.warehouse_service_fee),0)+IFNULL(sum(lsdp.delivery_service_fee),0) sysTotalFee,
IFNULL(sum(lstp.freight_price),0)+IFNULL(sum(lstp.pickup_price),0)+IFNULL(sum(lswp.warehouse_service_fee),0)+IFNULL(sum(lsdp.delivery_service_fee),0) totalFee,
IFNULL(sum(lstp.system_freight_price),0)+IFNULL(sum(lstp.system_pickup_price),0)+IFNULL(sum(lswp.warehouse_service_fee),0)+IFNULL(sum(lsdp.delivery_service_fee),0)
sysTotalFee,
IFNULL(sum(lstp.freight_price),0)+IFNULL(sum(lstp.pickup_price),0)+IFNULL(sum(lswp.warehouse_service_fee),0)+IFNULL(sum(lsdp.delivery_service_fee),0)
totalFee,
IFNULL(sum(lstp.system_freight_price),0) systemFreightPrice,
IFNULL(sum(lstp.freight_price),0) freightPrice,
IFNULL(sum(lstp.system_pickup_price),0) systemPickupPrice,
@ -479,8 +489,12 @@
IFNULL(sum(lsdp.sign_num),0) signNum,
max(lsdp.sign_time) signTime
from logpm_statistics_trunkline_package lstp
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and IFNULL(lswp.order_package_code,'0') = IFNULL(lstp.order_package_code,'0') and IFNULL(lswp.product_id,1) = IFNULL(lstp.product_id,1)
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and IFNULL(lsdp.order_package_code,'0') = IFNULL(lswp.order_package_code,'0') and IFNULL(lswp.product_id,1) = IFNULL(lsdp.product_id,1)
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and
IFNULL(lswp.order_package_code,'0') = IFNULL(lstp.order_package_code,'0') and IFNULL(lswp.product_id,1) =
IFNULL(lstp.product_id,1)
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and
IFNULL(lsdp.order_package_code,'0') = IFNULL(lswp.order_package_code,'0') and IFNULL(lswp.product_id,1) =
IFNULL(lsdp.product_id,1)
where lstp.order_info_id in
<foreach collection="orderInfoIds" item="item" open="(" separator="," close=")">
#{item}
@ -528,7 +542,7 @@
t.waybill_id
</select>
<delete id="deleteListByOrderInfoIds" >
<delete id="deleteListByOrderInfoIds">
delete from logpm_statistics_order_info
where id in
<foreach collection="orderInfoIdsList" item="item" open="(" separator="," close=")">

32
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

@ -106,12 +106,16 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
IPage<StatisticsOrderInfoVO> statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO);
List<StatisticsOrderInfoVO> records = statisticsOrderInfoVOIPage.getRecords();
//把records中所有的orderInfoId放入一个集合
List<Long> orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList());
List<String> waybillNoList = records.stream().map(StatisticsOrderInfoVO::getOrderCode).collect(Collectors.toList());
// 运单ID集合
Set<Long> warehouseIdSet = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet());
List<WaybillDetailByWaybillNoVo> waybillDetailByWaybillNoVoList;
// Set<Long> warehouseIdSet = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet());
// List<WaybillDetailByWaybillNoVo> waybillDetailByWaybillNoVoList;
Map<Long, StatisticsPackageFeeInfoVO> orderPackageInfoMap;
if(CollUtil.isNotEmpty(orderInfoIdList)){
List<StatisticsPackageFeeInfoVO> orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupById(orderInfoIdList);
@ -125,11 +129,11 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
} else {
orderPackageInfoMap = null;
}
if(CollUtil.isNotEmpty(warehouseIdSet)){
waybillDetailByWaybillNoVoList = baseMapper.findWaybillDetailByWaybillId(warehouseIdSet);
} else {
waybillDetailByWaybillNoVoList = null;
}
// if(CollUtil.isNotEmpty(warehouseIdSet)){
// waybillDetailByWaybillNoVoList = baseMapper.findWaybillDetailByWaybillId(warehouseIdSet);
// } else {
// waybillDetailByWaybillNoVoList = null;
// }
records.forEach(statisticsOrderInfoVO -> {
Long waybillId = statisticsOrderInfoVO.getWaybillId();
@ -137,18 +141,20 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
Long orderInfoId = statisticsOrderInfoVO.getOrderInfoId();
if(orderPackageInfoMap!=null){
StatisticsPackageFeeInfoVO statisticsPackageFeeInfoVO = orderPackageInfoMap.get(orderInfoId);
if(statisticsPackageFeeInfoVO!=null){
statisticsPackageFeeInfoVO.setGoodsName(statisticsOrderInfoVO.getGoodsName());
BeanUtil.copy(statisticsPackageFeeInfoVO, statisticsOrderInfoVO);
}
}
if(waybillDetailByWaybillNoVoList!=null){
waybillDetailByWaybillNoVo1 = waybillDetailByWaybillNoVoList.stream().filter(waybillDetailByWaybillNoVo -> Objects.equals(waybillDetailByWaybillNoVo.getWaybillId(), waybillId)).findFirst().orElse(null);
}
if(waybillDetailByWaybillNoVo1!=null){
statisticsOrderInfoVO.setGoodsName(waybillDetailByWaybillNoVo1.getGoodsName());
}
// if(waybillDetailByWaybillNoVoList!=null){
// waybillDetailByWaybillNoVo1 = waybillDetailByWaybillNoVoList.stream().filter(waybillDetailByWaybillNoVo -> Objects.equals(waybillDetailByWaybillNoVo.getWaybillId(), waybillId)).findFirst().orElse(null);
// }
// if(waybillDetailByWaybillNoVo1!=null){
// statisticsOrderInfoVO.setGoodsName(waybillDetailByWaybillNoVo1.getGoodsName());
// }
});
statisticsOrderInfoVOIPage.setRecords(records);

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -489,8 +489,8 @@
lww.claiming_value claimingValue,
lww.third_operation_fee thirdOperationFee,
lww.rebate rebate,
GROUP_CONCAT(concat(lwwd.product_name,'(',lwwd.num,')')) goodsTypeNum,
GROUP_CONCAT(concat(lwwd.product_name,'(',lwwd.price,')')) goodsTypePrice,
GROUP_CONCAT(concat(lwwd.num)) goodsTypeNum,
GROUP_CONCAT(concat(lwwd.price)) goodsTypePrice,
GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.delivery_price,0),')')) goodsTypeDeliveryPrice,
GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.pickup_price,0),')')) goodsTypePickupPrice,
GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.freight_price,0),')')) goodsTypeFreightPrice,
@ -592,10 +592,10 @@
and lww.document_making_time &lt;= #{param.documentMakingTimeEndDate}
</if>
<if test="param.createTimeStartDate != null">
and lww.create_time &gt;= #{param.createTimeStartDate}
and lww.document_making_time &gt;= #{param.createTimeStartDate}
</if>
<if test="param.createTimeEndDate != null">
and lww.create_time &lt;= #{param.createTimeEndDate}
and lww.document_making_time &lt;= #{param.createTimeEndDate}
</if>
<if test="param.checkTimeStartDate != null">
and lww.check_time &gt;= #{param.checkTimeStartDate}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -780,7 +780,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
public Map<String, List<PrintPreviewVO>> printBatch(String ids, String tempId) throws Exception {
Map<String, List<PrintPreviewVO>> stringListMap = new HashMap<>();
Map<String, List<PrintPreviewVO>> stringListMap = new LinkedHashMap<>();
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(tempId);
String[] idArray = ids.split(",");

Loading…
Cancel
Save