修改计费逻辑

This commit is contained in:
wuweihua
2026-11-12 11:07:13 +08:00
parent 17ee9731e8
commit d2c75e0c51
7 changed files with 57 additions and 14 deletions
@@ -60,6 +60,9 @@ public class TmsPriceBillRequest extends TmsPriceQuoteRequest
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pickupDate; private Date pickupDate;
private String orderRemark; private String orderRemark;
/** 上游 PRODUCT_FLOOR_CODE;打单计费在账单落库前也可直接用 */
private String productFloorCode;
/** 上游 TAB_ORDER 整行,用于写入 prc_order_bill_ext 扩展字段 */ /** 上游 TAB_ORDER 整行,用于写入 prc_order_bill_ext 扩展字段 */
private Map<String, Object> upstreamRow; private Map<String, Object> upstreamRow;
@@ -22,7 +22,7 @@ public class TmsPriceQuoteRequest implements Serializable
private String productCode; private String productCode;
/** /**
* 打单套餐(LABEL)试算/计费用渠道ID;计费也可从订单扩展 productChannelId 解析。 * 打单套餐(LABEL)试算用渠道ID;计费优先取订单 product_floor_code。
*/ */
private String channelId; private String channelId;
@@ -44,6 +44,7 @@ public class OracleOrderBillMapper
} }
req.setProductCode(product); req.setProductCode(product);
req.setProductName(firstStr(row, "LINE_NAME", "PRODUCT_NAME")); req.setProductName(firstStr(row, "LINE_NAME", "PRODUCT_NAME"));
req.setProductFloorCode(firstStr(row, "PRODUCT_FLOOR_CODE"));
req.setCountryCode(firstStr(row, "COUNTRY")); req.setCountryCode(firstStr(row, "COUNTRY"));
String countryName = firstStr(row, "COUNTRY_NAME", "COUNTRY_EINGTH_NAME", "COUNTRY"); String countryName = firstStr(row, "COUNTRY_NAME", "COUNTRY_EINGTH_NAME", "COUNTRY");
req.setCountryName(countryName); req.setCountryName(countryName);
@@ -3180,6 +3180,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
req.setCustomerName(bill.getCustomerName()); req.setCustomerName(bill.getCustomerName());
req.setProductCode(bill.getProductCode()); req.setProductCode(bill.getProductCode());
req.setProductName(resolveBillProductName(bill)); req.setProductName(resolveBillProductName(bill));
req.setProductFloorCode(bill.getProductFloorCode());
req.setCountryCode(bill.getCountryCode()); req.setCountryCode(bill.getCountryCode());
req.setCountryName(bill.getCountryName()); req.setCountryName(bill.getCountryName());
req.setDestPostcode(bill.getDestPostcode()); req.setDestPostcode(bill.getDestPostcode());
@@ -32,6 +32,7 @@ import com.bms.price.domain.PayCostLine;
import com.bms.price.domain.PayOrderCostResult; import com.bms.price.domain.PayOrderCostResult;
import com.bms.price.domain.PayProduct; import com.bms.price.domain.PayProduct;
import com.bms.price.domain.PrcCustomerPriceSet; import com.bms.price.domain.PrcCustomerPriceSet;
import com.bms.price.domain.PrcOrderBill;
import com.bms.price.domain.PrcOrderBillExt; import com.bms.price.domain.PrcOrderBillExt;
import com.bms.price.domain.PrcPriceSet; import com.bms.price.domain.PrcPriceSet;
import com.bms.price.domain.PrcPriceSetDetail; import com.bms.price.domain.PrcPriceSetDetail;
@@ -52,8 +53,11 @@ import com.bms.price.enums.BillCustomerActiveStatus;
import com.bms.price.mapper.BmsProductCountryMapper; import com.bms.price.mapper.BmsProductCountryMapper;
import com.bms.price.mapper.BmsProductMapper; import com.bms.price.mapper.BmsProductMapper;
import com.bms.price.mapper.BmsRedlineProductCountryMapper; import com.bms.price.mapper.BmsRedlineProductCountryMapper;
import com.bms.masterdata.domain.ServiceChannel;
import com.bms.masterdata.mapper.ServiceChannelMapper;
import com.bms.price.mapper.PrcCustomerPriceSetMapper; import com.bms.price.mapper.PrcCustomerPriceSetMapper;
import com.bms.price.mapper.PrcOrderBillExtMapper; import com.bms.price.mapper.PrcOrderBillExtMapper;
import com.bms.price.mapper.PrcOrderBillMapper;
import com.bms.price.mapper.PrcPriceSetDetailMapper; import com.bms.price.mapper.PrcPriceSetDetailMapper;
import com.bms.price.mapper.PrcPriceSetMapper; import com.bms.price.mapper.PrcPriceSetMapper;
import com.bms.price.mapper.PrcPriceSetProductMapper; import com.bms.price.mapper.PrcPriceSetProductMapper;
@@ -143,6 +147,12 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
@Autowired @Autowired
private PrcOrderBillExtMapper orderBillExtMapper; private PrcOrderBillExtMapper orderBillExtMapper;
@Autowired
private PrcOrderBillMapper orderBillMapper;
@Autowired
private ServiceChannelMapper serviceChannelMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public TmsPriceQuoteResult quote(TmsPriceQuoteRequest request) public TmsPriceQuoteResult quote(TmsPriceQuoteRequest request)
@@ -715,7 +725,10 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
return r; return r;
} }
/** 试算用 request.channelId;计费优先订单扩展 productChannelId。 */ /**
* 试算用 request.channelId;计费优先 prc_order_bill.product_floor_code,
* 没有再取 prc_order_bill_ext.product_floor_code,再解析为渠道ID。
*/
private String resolveLabelChannelId(TmsPriceQuoteRequest request) private String resolveLabelChannelId(TmsPriceQuoteRequest request)
{ {
if (request != null && StringUtils.isNotEmpty(request.getChannelId())) if (request != null && StringUtils.isNotEmpty(request.getChannelId()))
@@ -727,22 +740,48 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
return null; return null;
} }
TmsPriceBillRequest billReq = (TmsPriceBillRequest) request; TmsPriceBillRequest billReq = (TmsPriceBillRequest) request;
PrcOrderBillExt ext = null; String floorCode = emptyToNull(billReq.getProductFloorCode());
if (StringUtils.isNotEmpty(billReq.getOrderNo())) String orderNo = emptyToNull(billReq.getOrderNo());
if (StringUtils.isEmpty(floorCode) && StringUtils.isNotEmpty(orderNo))
{ {
ext = orderBillExtMapper.selectByOrderNo(billReq.getOrderNo().trim()); PrcOrderBill bill = orderBillMapper.selectPrcOrderBillByOrderNo(orderNo);
if (bill != null)
{
floorCode = emptyToNull(bill.getProductFloorCode());
} }
if (ext == null) }
if (StringUtils.isEmpty(floorCode) && StringUtils.isNotEmpty(orderNo))
{
PrcOrderBillExt ext = orderBillExtMapper.selectByOrderNo(orderNo);
if (ext != null)
{
floorCode = emptyToNull(ext.getProductFloorCode());
}
}
if (StringUtils.isEmpty(floorCode))
{ {
return null; return null;
} }
if (StringUtils.isNotEmpty(ext.getProductChannelId())) return resolveChannelIdByFloorCode(floorCode);
{
return ext.getProductChannelId().trim();
} }
if (StringUtils.isNotEmpty(ext.getProductFloorCode()))
/** 将 product_floor_code 解析为 srv_service_channel.id(先按编码,再按ID) */
private String resolveChannelIdByFloorCode(String floorCode)
{ {
return ext.getProductFloorCode().trim(); if (StringUtils.isEmpty(floorCode) || serviceChannelMapper == null)
{
return null;
}
String code = floorCode.trim();
ServiceChannel byCode = serviceChannelMapper.selectServiceChannelByCode(code);
if (byCode != null && StringUtils.isNotEmpty(byCode.getId()))
{
return byCode.getId().trim();
}
ServiceChannel byId = serviceChannelMapper.selectServiceChannelById(code);
if (byId != null && StringUtils.isNotEmpty(byId.getId()))
{
return byId.getId().trim();
} }
return null; return null;
} }
@@ -128,10 +128,9 @@ function statusTag(status) {
return map[String(status)] || 'info' return map[String(status)] || 'info'
} }
/** 待生效、已生效:可编辑价卡 */ /** 不限状态:待生效/已生效/已失效均可编辑价卡 */
function canEdit(row) { function canEdit(row) {
const s = row ? String(row.status) : '' return !!row
return s === '0' || s === '1'
} }
/** 仅待生效可改生效时间 */ /** 仅待生效可改生效时间 */
+1 -1
View File
@@ -192,7 +192,7 @@ function openCreateVersion() {
}) })
} }
/** 编辑待生效/已生效版本价卡 */ /** 编辑版本价卡(不限状态) */
function openEditVersion(row) { function openEditVersion(row) {
if (!priceSetId.value || !row?.versionNo) return if (!priceSetId.value || !row?.versionNo) return
proxy.$router.push({ proxy.$router.push({