新增打单产品明细保存接口,优化附加费管理逻辑
This commit is contained in:
+10
@@ -24,6 +24,7 @@ import com.bms.common.core.domain.AjaxResult;
|
||||
import com.bms.common.core.page.TableDataInfo;
|
||||
import com.bms.common.enums.BusinessType;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.price.domain.PayProduct;
|
||||
import com.bms.price.domain.PaySaveCommand;
|
||||
import com.bms.price.domain.PrcCustomerPriceSet;
|
||||
import com.bms.price.domain.PrcCustomerPriceSetBatch;
|
||||
@@ -208,6 +209,15 @@ public class LabelPackageController extends BaseController
|
||||
return success(payProductService.selectPayProductDetail(productId));
|
||||
}
|
||||
|
||||
/** 保存打单产品明细(重量段/附加费等),按当前 term 覆盖子表 */
|
||||
@PreAuthorize("@ss.hasPermi('price:label:edit')")
|
||||
@Log(title = "打单产品明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/product")
|
||||
public AjaxResult updateProduct(@RequestBody PayProduct product)
|
||||
{
|
||||
return toAjax(payProductService.updateDetail(product));
|
||||
}
|
||||
|
||||
/** 查询打单产品已绑定渠道(默认应收 AR) */
|
||||
@PreAuthorize("@ss.hasPermi('price:label:query')")
|
||||
@GetMapping("/product/{productId}/channels")
|
||||
|
||||
@@ -73,10 +73,4 @@ public class PaySurcharge
|
||||
private BigDecimal weightMax;
|
||||
|
||||
private Integer sortNo;
|
||||
|
||||
/**
|
||||
* 是否计费并落库:false 不写入 pay_surcharge;null/缺省视为要计费(兼容应付全量保存)。
|
||||
* 仅作为前端传参,不落库字段。
|
||||
*/
|
||||
private Boolean needBill;
|
||||
}
|
||||
|
||||
-24
@@ -461,8 +461,6 @@ public class PayProductServiceImpl implements IPayProductService
|
||||
{
|
||||
product.setExtraLines(new ArrayList<>());
|
||||
}
|
||||
// 计数前先按「是否计费」过滤,与落库行数一致
|
||||
retainBillableSurcharges(product);
|
||||
product.setWeightCount(product.getWeightBands().size());
|
||||
product.setSurchargeCount(product.getSurcharges().size());
|
||||
product.setExtraCount(product.getExtraLines().size());
|
||||
@@ -1531,7 +1529,6 @@ public class PayProductServiceImpl implements IPayProductService
|
||||
|
||||
private void insertSurcharges(PayProduct product)
|
||||
{
|
||||
retainBillableSurcharges(product);
|
||||
List<PaySurcharge> rows = product.getSurcharges();
|
||||
if (rows == null || rows.isEmpty())
|
||||
{
|
||||
@@ -1550,27 +1547,6 @@ public class PayProductServiceImpl implements IPayProductService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅保留需要计费的附加费:needBill=false 不入库;null 视为要计费。
|
||||
*/
|
||||
private void retainBillableSurcharges(PayProduct product)
|
||||
{
|
||||
List<PaySurcharge> rows = product.getSurcharges();
|
||||
if (rows == null || rows.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<PaySurcharge> kept = new ArrayList<PaySurcharge>();
|
||||
for (PaySurcharge fee : rows)
|
||||
{
|
||||
if (fee != null && !Boolean.FALSE.equals(fee.getNeedBill()))
|
||||
{
|
||||
kept.add(fee);
|
||||
}
|
||||
}
|
||||
product.setSurcharges(kept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按附加费名称映射 prc_surcharge.sc_id;币种不能为空:附加费 -> 价卡 -> EUR。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user