增加收货时间

This commit is contained in:
wuweihua
2026-10-16 18:01:46 +08:00
parent 6a07786e75
commit 9ff89e36ee
6 changed files with 36 additions and 9 deletions
@@ -4,7 +4,6 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.bms.common.core.domain.BaseEntity; import com.bms.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -64,8 +63,8 @@ public class PrcOrderBill extends BaseEntity
private String warehouseCode; private String warehouseCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTime; private Date orderTime;
/** 应收来源查询专用:从 prc_order.pickup_date 读取的收件时间。 */ /** 收货时间(TAB_ORDER.PICKUP_DATE) */
@JsonIgnore @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pickupDate; private Date pickupDate;
private String orderRemark; private String orderRemark;
private String productCode; private String productCode;
@@ -53,6 +53,9 @@ public class TmsPriceBillRequest extends TmsPriceQuoteRequest
private String warehouseCode; private String warehouseCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTime; private Date orderTime;
/** TAB_ORDER.PICKUP_DATE */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pickupDate;
private String orderRemark; private String orderRemark;
/** 上游 TAB_ORDER 整行,用于写入 prc_order_ext 扩展字段 */ /** 上游 TAB_ORDER 整行,用于写入 prc_order_ext 扩展字段 */
private Map<String, Object> upstreamRow; private Map<String, Object> upstreamRow;
@@ -68,6 +68,7 @@ public class OracleOrderBillMapper
{ {
req.setOrderTime(createDate); req.setOrderTime(createDate);
} }
req.setPickupDate(firstDate(row, "PICKUP_DATE"));
return req; return req;
} }
@@ -1301,6 +1301,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
bill.setDestPostcode(request.getDestPostcode()); bill.setDestPostcode(request.getDestPostcode());
bill.setWarehouseCode(request.getWarehouseCode()); bill.setWarehouseCode(request.getWarehouseCode());
bill.setOrderTime(request.getOrderTime()); bill.setOrderTime(request.getOrderTime());
bill.setPickupDate(request.getPickupDate());
bill.setOrderRemark(request.getOrderRemark()); bill.setOrderRemark(request.getOrderRemark());
bill.setProductCode(result.getProductCode()); bill.setProductCode(result.getProductCode());
bill.setProductName(result.getProductName()); bill.setProductName(result.getProductName());
@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="destPostcode" column="dest_postcode" /> <result property="destPostcode" column="dest_postcode" />
<result property="warehouseCode" column="warehouse_code" /> <result property="warehouseCode" column="warehouse_code" />
<result property="orderTime" column="order_time" /> <result property="orderTime" column="order_time" />
<result property="pickupDate" column="pickup_date" />
<result property="orderRemark" column="order_remark" /> <result property="orderRemark" column="order_remark" />
<result property="productCode" column="product_code" /> <result property="productCode" column="product_code" />
<result property="productName" column="product_name" /> <result property="productName" column="product_name" />
@@ -81,7 +82,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<resultMap type="PrcOrderBill" id="PrcOrderBillArSourceResult" extends="PrcOrderBillResult"> <resultMap type="PrcOrderBill" id="PrcOrderBillArSourceResult" extends="PrcOrderBillResult">
<result property="pickupDate" column="pickup_date"/>
</resultMap> </resultMap>
<sql id="selectPrcOrderBillVo"> <sql id="selectPrcOrderBillVo">
@@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code, belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_id, customer_code, customer_name, customer_id, customer_code, customer_name,
pieces, actual_weight, receive_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, shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, pickup_date, order_remark,
product_code, product_name, country_code, country_name, weight, biz_date, tms_id, 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, match_source, match_message, price_set_id, price_set_code, price_set_name,
set_type, bind_priority, customer_priceset_id, psv_id, psd_id, product_country_id, set_type, bind_priority, customer_priceset_id, psv_id, psd_id, product_country_id,
@@ -107,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.belong_saler, p.belong_saler_code, p.settlement_man, p.settlement_man_code, p.service_man, p.service_man_code, 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.customer_id, p.customer_code, p.customer_name,
p.pieces, p.actual_weight, p.receive_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, o.pickup_date, p.order_remark, p.shipper_name, p.consignee_name, p.dest_postcode, p.warehouse_code, p.order_time, p.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.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, p.match_source, p.match_message, p.price_set_id, p.price_set_code, p.price_set_name,
p.set_type, p.bind_priority, p.customer_priceset_id, p.psv_id, p.psd_id, p.product_country_id, p.set_type, p.bind_priority, p.customer_priceset_id, p.psv_id, p.psd_id, p.product_country_id,
@@ -122,7 +122,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.customer_active_status, p.credit_arrears_status, p.refund_status, p.billing_fail_status, p.round_mode, p.customer_active_status, p.credit_arrears_status, p.refund_status, p.billing_fail_status, p.round_mode,
p.created_by, p.create_time, p.updated_by, p.update_time p.created_by, p.create_time, p.updated_by, p.update_time
from prc_order_bill p from prc_order_bill p
left join prc_order o on o.order_id = p.order_id
</sql> </sql>
<select id="selectPrcOrderBillByOrderNo" parameterType="String" resultMap="PrcOrderBillResult"> <select id="selectPrcOrderBillByOrderNo" parameterType="String" resultMap="PrcOrderBillResult">
@@ -545,7 +544,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code, belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_id, customer_code, customer_name, customer_id, customer_code, customer_name,
pieces, actual_weight, receive_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, shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, pickup_date, order_remark,
product_code, product_name, country_code, country_name, weight, biz_date, tms_id, 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, match_source, match_message, price_set_id, price_set_code, price_set_name,
set_type, bind_priority, customer_priceset_id, psv_id, psd_id, product_country_id, set_type, bind_priority, customer_priceset_id, psv_id, psd_id, product_country_id,
@@ -559,7 +558,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{belongSaler}, #{belongSalerCode}, #{settlementMan}, #{settlementManCode}, #{serviceMan}, #{serviceManCode}, #{belongSaler}, #{belongSalerCode}, #{settlementMan}, #{settlementManCode}, #{serviceMan}, #{serviceManCode},
#{customerId}, #{customerCode}, #{customerName}, #{customerId}, #{customerCode}, #{customerName},
#{pieces}, #{actualWeight}, #{receiveWeight}, #{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight}, #{pieces}, #{actualWeight}, #{receiveWeight}, #{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight},
#{shipperName}, #{consigneeName}, #{destPostcode}, #{warehouseCode}, #{orderTime}, #{orderRemark}, #{shipperName}, #{consigneeName}, #{destPostcode}, #{warehouseCode}, #{orderTime}, #{pickupDate}, #{orderRemark},
#{productCode}, #{productName}, #{countryCode}, #{countryName}, #{weight}, #{bizDate}, #{tmsId}, #{productCode}, #{productName}, #{countryCode}, #{countryName}, #{weight}, #{bizDate}, #{tmsId},
#{matchSource}, #{matchMessage}, #{priceSetId}, #{priceSetCode}, #{priceSetName}, #{matchSource}, #{matchMessage}, #{priceSetId}, #{priceSetCode}, #{priceSetName},
#{setType}, #{bindPriority}, #{customerPricesetId}, #{psvId}, #{psdId}, #{productCountryId}, #{setType}, #{bindPriority}, #{customerPricesetId}, #{psvId}, #{psdId}, #{productCountryId},
@@ -599,6 +598,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dest_postcode = #{destPostcode}, dest_postcode = #{destPostcode},
warehouse_code = #{warehouseCode}, warehouse_code = #{warehouseCode},
order_time = #{orderTime}, order_time = #{orderTime},
pickup_date = #{pickupDate},
order_remark = #{orderRemark}, order_remark = #{orderRemark},
product_code = #{productCode}, product_code = #{productCode},
product_name = #{productName}, product_name = #{productName},
@@ -0,0 +1,23 @@
-- prc_order_bill.pickup_date from TAB_ORDER.PICKUP_DATE
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 = 'pickup_date'
LIMIT 1
);
SET @sql := IF(
@col IS NULL,
'ALTER TABLE prc_order_bill ADD COLUMN pickup_date datetime DEFAULT NULL COMMENT \'收货时间(TAB_ORDER.PICKUP_DATE)\' AFTER order_time, ADD KEY idx_order_bill_pickup_date (pickup_date)',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
-- backfill from prc_order when order_id linked
UPDATE prc_order_bill b
INNER JOIN prc_order o ON o.order_id = b.order_id
SET b.pickup_date = o.pickup_date
WHERE b.pickup_date IS NULL
AND o.pickup_date IS NOT NULL;