diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcOrderBill.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcOrderBill.java index eb8a620e..f6dd927b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcOrderBill.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcOrderBill.java @@ -49,6 +49,8 @@ public class PrcOrderBill extends BaseEntity private List customerCodes; private Integer pieces; private BigDecimal actualWeight; + /** Receive weight from upstream TAB_ORDER.WEIGHT */ + private BigDecimal receiveWeight; private BigDecimal volume; private BigDecimal volumeWeight; private BigDecimal pkgLength; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceBillRequest.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceBillRequest.java index a80337d2..1bd054ea 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceBillRequest.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceBillRequest.java @@ -38,6 +38,8 @@ public class TmsPriceBillRequest extends TmsPriceQuoteRequest private String customerName; private Integer pieces; private BigDecimal actualWeight; + /** Upstream TAB_ORDER.WEIGHT (receive weight) */ + private BigDecimal receiveWeight; private BigDecimal volume; private BigDecimal volumeWeight; private BigDecimal pkgLength; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java index 46f4011a..238c047b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java @@ -105,6 +105,8 @@ public class TmsPriceQuoteResult implements Serializable private String refundStatus; private Integer pieces; private BigDecimal actualWeight; + /** Receive weight from upstream TAB_ORDER.WEIGHT */ + private BigDecimal receiveWeight; private BigDecimal volume; private BigDecimal volumeWeight; private BigDecimal pkgLength; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/oracle/OracleOrderBillMapper.java b/bms-back/bms-system/src/main/java/com/bms/price/oracle/OracleOrderBillMapper.java index 989816b0..b0e901e1 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/oracle/OracleOrderBillMapper.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/oracle/OracleOrderBillMapper.java @@ -46,8 +46,14 @@ public class OracleOrderBillMapper String countryName = firstStr(row, "COUNTRY_NAME", "COUNTRY_EINGTH_NAME", "COUNTRY"); req.setCountryName(countryName); req.setDestPostcode(firstStr(row, "CONSIGNEE_POSTCODE")); - // Quote / prc_order_bill.weight: use upstream TAB_ORDER.WEIGHT directly. - req.setWeight(firstPositiveDecimal(row, "WEIGHT")); + // TAB_ORDER.DIMENSIONAL_WEIGHT_FACTOR = billing weight -> quote weight / prc_order_bill.weight + BigDecimal chargeWeight = firstPositiveDecimal(row, "DIMENSIONAL_WEIGHT_FACTOR"); + BigDecimal weight = chargeWeight != null + ? chargeWeight + : firstPositiveDecimal(row, "ACTUAL_WEIGHT", "PUSH_WEIGHT", "WEIGHT", "VOLUME_WEIGHT"); + req.setWeight(weight); + // TAB_ORDER.WEIGHT = receive weight (收货重) + req.setReceiveWeight(firstDecimal(row, "WEIGHT")); req.setActualWeight(firstPositiveDecimal(row, "ACTUAL_WEIGHT", "PUSH_WEIGHT", "WEIGHT")); req.setPieces(firstInt(row, "ORDER_PIECE", "PACKAGE_NUM", "PRODUCT_SUM")); req.setVolume(toVolumeM3(firstDecimal(row, "VOLUME"))); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java index f2ba31bf..92d42d56 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java @@ -1081,6 +1081,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService bill.setCustomerActiveStatus(customerActiveStatus); bill.setPieces(request.getPieces()); bill.setActualWeight(request.getActualWeight()); + bill.setReceiveWeight(request.getReceiveWeight()); bill.setVolume(request.getVolume()); bill.setVolumeWeight(request.getVolumeWeight()); bill.setPkgLength(request.getPkgLength()); @@ -1699,6 +1700,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService r.setRefundStatus(bill.getRefundStatus()); r.setPieces(bill.getPieces()); r.setActualWeight(bill.getActualWeight()); + r.setReceiveWeight(bill.getReceiveWeight()); r.setVolume(bill.getVolume()); r.setVolumeWeight(bill.getVolumeWeight()); r.setPkgLength(bill.getPkgLength()); diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PrcOrderBillMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PrcOrderBillMapper.xml index a30666b5..187a20af 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PrcOrderBillMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PrcOrderBillMapper.xml @@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -85,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select bill_id, bill_key, order_no, tracking_no, transfer_no, belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code, customer_id, customer_code, customer_name, - pieces, actual_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height, + pieces, actual_weight, receive_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height, shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, order_remark, product_code, product_name, country_code, country_name, weight, biz_date, tms_id, match_source, match_message, price_set_id, price_set_code, price_set_name, @@ -103,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select p.bill_id, p.bill_key, p.order_no, p.tracking_no, p.transfer_no, p.belong_saler, p.belong_saler_code, p.settlement_man, p.settlement_man_code, p.service_man, p.service_man_code, p.customer_id, p.customer_code, p.customer_name, - p.pieces, p.actual_weight, p.volume, p.volume_weight, p.pkg_length, p.pkg_width, p.pkg_height, + p.pieces, p.actual_weight, p.receive_weight, p.volume, p.volume_weight, p.pkg_length, p.pkg_width, p.pkg_height, p.shipper_name, p.consignee_name, p.dest_postcode, p.warehouse_code, p.order_time, e.pickup_date, p.order_remark, p.product_code, p.product_name, p.country_code, p.country_name, p.weight, p.biz_date, p.tms_id, p.match_source, p.match_message, p.price_set_id, p.price_set_code, p.price_set_name, @@ -521,7 +522,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bill_id, bill_key, order_no, tracking_no, transfer_no, belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code, customer_id, customer_code, customer_name, - pieces, actual_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height, + pieces, actual_weight, receive_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height, shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, order_remark, product_code, product_name, country_code, country_name, weight, biz_date, tms_id, match_source, match_message, price_set_id, price_set_code, price_set_name, @@ -535,7 +536,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{billId}, #{billKey}, #{orderNo}, #{trackingNo}, #{transferNo}, #{belongSaler}, #{belongSalerCode}, #{settlementMan}, #{settlementManCode}, #{serviceMan}, #{serviceManCode}, #{customerId}, #{customerCode}, #{customerName}, - #{pieces}, #{actualWeight}, #{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight}, + #{pieces}, #{actualWeight}, #{receiveWeight}, #{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight}, #{shipperName}, #{consigneeName}, #{destPostcode}, #{warehouseCode}, #{orderTime}, #{orderRemark}, #{productCode}, #{productName}, #{countryCode}, #{countryName}, #{weight}, #{bizDate}, #{tmsId}, #{matchSource}, #{matchMessage}, #{priceSetId}, #{priceSetCode}, #{priceSetName}, @@ -564,6 +565,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" customer_name = #{customerName}, pieces = #{pieces}, actual_weight = #{actualWeight}, + receive_weight = #{receiveWeight}, volume = #{volume}, volume_weight = #{volumeWeight}, pkg_length = #{pkgLength}, diff --git a/bms-back/sql/bms_init.sql b/bms-back/sql/bms_init.sql index eb9718b0..80526418 100644 --- a/bms-back/sql/bms_init.sql +++ b/bms-back/sql/bms_init.sql @@ -1004,6 +1004,7 @@ CREATE TABLE `prc_order_bill` ( `customer_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '客户名称', `pieces` int(11) DEFAULT NULL COMMENT '件数', `actual_weight` decimal(10,3) DEFAULT NULL COMMENT '实际重量KG', + `receive_weight` decimal(10,3) DEFAULT NULL COMMENT '收货重KG(上游TAB_ORDER.WEIGHT)', `volume` decimal(12,4) DEFAULT NULL COMMENT '体积m3', `volume_weight` decimal(10,3) DEFAULT NULL COMMENT '材积重KG', `pkg_length` decimal(10,2) DEFAULT NULL COMMENT '长CM', diff --git a/bms-back/sql/price/order_bill_receive_weight_alter.sql b/bms-back/sql/price/order_bill_receive_weight_alter.sql new file mode 100644 index 00000000..7827a9a6 --- /dev/null +++ b/bms-back/sql/price/order_bill_receive_weight_alter.sql @@ -0,0 +1,16 @@ +-- prc_order_bill.receive_weight from upstream TAB_ORDER.WEIGHT +SET NAMES utf8mb4; + +SET @col := ( + SELECT COLUMN_NAME FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = 'prc_order_bill' + AND COLUMN_NAME = 'receive_weight' + LIMIT 1 +); +SET @sql := IF( + @col IS NULL, + 'ALTER TABLE prc_order_bill ADD COLUMN receive_weight decimal(10,3) DEFAULT NULL COMMENT ''收货重KG(上游TAB_ORDER.WEIGHT)'' AFTER actual_weight', + 'SELECT 1' +); +PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt; diff --git a/bms-front/src/views/price/billing/bill.vue b/bms-front/src/views/price/billing/bill.vue index 6e5a8605..575f54ae 100644 --- a/bms-front/src/views/price/billing/bill.vue +++ b/bms-front/src/views/price/billing/bill.vue @@ -160,6 +160,7 @@ const columns = [ { label: '国家', prop: 'country', minWidth: 130, slot: 'country' }, { label: '件数', prop: 'pieces', align: 'center', width: 70 }, { label: '计费重', prop: 'chargeWeight', align: 'center', width: 90, slot: 'chargeWeight' }, + { label: '收货重', prop: 'receiveWeight', align: 'center', width: 90, slot: 'chargeWeight' }, { label: '应收总额', prop: 'incomeTotal', align: 'right', width: 120, slot: 'incomeTotal' }, { label: '应付总额', prop: 'payTotal', align: 'right', width: 120, slot: 'payTotal' }, { label: '计价来源', prop: 'matchSource', align: 'center', width: 130, slot: 'matchSource' }, diff --git a/bms-front/src/views/price/billing/components/BillDetail.vue b/bms-front/src/views/price/billing/components/BillDetail.vue index 3fb67bbf..cef30e18 100644 --- a/bms-front/src/views/price/billing/components/BillDetail.vue +++ b/bms-front/src/views/price/billing/components/BillDetail.vue @@ -32,6 +32,7 @@ {{ detail.pieces != null ? detail.pieces : '-' }} {{ dimLabel(detail) }} {{ formatWeight(detail.actualWeight) }} + {{ formatWeight(detail.receiveWeight) }} {{ formatWeight(detail.volumeWeight) }} {{ formatMoney(detail.volume) }} {{ formatDateTime(detail.orderTime) }}