修改计费时间类型
This commit is contained in:
@@ -67,7 +67,8 @@ public class PrcOrderBill extends BaseEntity
|
||||
private String countryCode;
|
||||
private String countryName;
|
||||
private BigDecimal weight;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
/** 计费时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date bizDate;
|
||||
private Long tmsId;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TmsPriceQuoteRequest implements Serializable
|
||||
@NotNull(message = "weight is required")
|
||||
private BigDecimal weight;
|
||||
|
||||
/** yyyy-MM-dd,默认今天 */
|
||||
/** yyyy-MM-dd or yyyy-MM-dd HH:mm:ss; quote defaults today; bill required */
|
||||
private String bizDate;
|
||||
private Integer tmsId;
|
||||
/** Header X-Api-Code 优先;Body 兜底 */
|
||||
|
||||
@@ -62,7 +62,7 @@ public class OracleOrderBillMapper
|
||||
req.setConsigneeName(firstStr(row, "CONSIGNEE_NAME"));
|
||||
req.setWarehouseCode(firstStr(row, "REGISTER_SITE_CODE"));
|
||||
req.setOrderRemark(firstStr(row, "TRACK_REMARK", "EXCEPTION_REMARK", "ORDER_CUSTOMNOTE"));
|
||||
// CREATE_DATE is order place time only; bizDate (billing date) comes from mobile inbound task.
|
||||
// CREATE_DATE is order place time only; bizDate (billing datetime) comes from task.bill_time.
|
||||
Date createDate = firstDate(row, "CREATE_DATE");
|
||||
if (createDate != null)
|
||||
{
|
||||
|
||||
+2
-2
@@ -182,8 +182,8 @@ public class PrcBillingTaskServiceImpl implements IPrcBillingTaskService
|
||||
{
|
||||
billReq.setOrderNo(task.getOrderNo());
|
||||
}
|
||||
// Billing date from task.bill_time (mobile), not Oracle CREATE_DATE.
|
||||
billReq.setBizDate(new SimpleDateFormat("yyyy-MM-dd").format(task.getBillTime()));
|
||||
// Billing datetime from task.bill_time (keep HH:mm:ss), not Oracle CREATE_DATE.
|
||||
billReq.setBizDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(task.getBillTime()));
|
||||
task.setCustomerCode(billReq.getCustomerCode());
|
||||
|
||||
TmsPriceQuoteResult result = billWithDbRetry(taskId, billReq);
|
||||
|
||||
+4
-7
@@ -2,8 +2,6 @@ package com.bms.price.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Arrays;
|
||||
@@ -27,6 +25,7 @@ import com.bms.ar.enums.ArOrderBillStatus;
|
||||
import com.bms.common.annotation.DataScope;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.utils.DateUtils;
|
||||
import com.bms.common.utils.DictUtils;
|
||||
import com.bms.common.utils.MessageUtils;
|
||||
import com.bms.common.utils.SecurityUtils;
|
||||
@@ -1709,13 +1708,11 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
{
|
||||
throw new ServiceException(MessageUtils.message("price.bill.bizDateRequired"));
|
||||
}
|
||||
try
|
||||
{
|
||||
return new SimpleDateFormat("yyyy-MM-dd").parse(bizDate.trim());
|
||||
}
|
||||
catch (ParseException e)
|
||||
Date parsed = DateUtils.parseDate(bizDate.trim());
|
||||
if (parsed == null)
|
||||
{
|
||||
throw new ServiceException(MessageUtils.message("price.quote.bizDateInvalid"));
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -18,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.utils.DateUtils;
|
||||
import com.bms.common.utils.MessageUtils;
|
||||
import com.bms.common.utils.StringUtils;
|
||||
import com.bms.common.utils.sign.Md5Utils;
|
||||
@@ -1630,14 +1631,12 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
return new Date();
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
return new SimpleDateFormat("yyyy-MM-dd").parse(bizDate.trim());
|
||||
}
|
||||
catch (ParseException e)
|
||||
Date parsed = DateUtils.parseDate(bizDate.trim());
|
||||
if (parsed == null)
|
||||
{
|
||||
throw new ServiceException(MessageUtils.message("price.quote.bizDateInvalid"));
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
||||
/** Use end of bill day so same-day version activate still matches that day's quote. */
|
||||
|
||||
@@ -1019,7 +1019,7 @@ CREATE TABLE `prc_order_bill` (
|
||||
`country_code` char(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '国家二字码',
|
||||
`country_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '国家名称',
|
||||
`weight` decimal(10,3) NOT NULL COMMENT '计费重量KG',
|
||||
`biz_date` date NOT NULL COMMENT '计费日期',
|
||||
`biz_date` datetime NOT NULL COMMENT '计费时间',
|
||||
`tms_id` bigint(20) DEFAULT NULL COMMENT '多租户系统ID',
|
||||
`match_source` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '命中来源',
|
||||
`match_message` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '命中说明',
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
-- prc_order_bill.biz_date: date -> datetime (keep hour/minute/second)
|
||||
ALTER TABLE prc_order_bill
|
||||
MODIFY COLUMN `biz_date` datetime NOT NULL COMMENT '计费时间';
|
||||
Reference in New Issue
Block a user