修改套餐价格

This commit is contained in:
wuweihua
2026-09-16 17:14:19 +08:00
parent 7172621fd3
commit 4441aa12bf
48 changed files with 4258 additions and 682 deletions
@@ -1,6 +1,8 @@
package com.ruoyi.web.controller.price;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
@@ -17,9 +19,11 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.price.domain.PrcCustomerPriceSet;
import com.ruoyi.price.domain.PrcPriceSet;
import com.ruoyi.price.domain.PrcPriceSetDetail;
import com.ruoyi.price.domain.PrcPriceSetSaveTask;
import com.ruoyi.price.service.IPrcPriceSetService;
/**
@@ -57,8 +61,23 @@ public class PriceSetController extends BaseController
{
set.setCreateBy(getUsername());
set.setUpdateBy(getUsername());
Long id = priceSetService.savePrcPriceSet(set);
return success(id);
String taskId = priceSetService.submitSaveAsync(set);
// Do not pass bare String to success(): overload puts it into msg, not data.
Map<String, Object> payload = new HashMap<String, Object>();
payload.put("taskId", taskId);
return success(payload);
}
@PreAuthorize("@ss.hasPermi('price:set:query')")
@GetMapping("/save/task/{taskId}")
public AjaxResult getSaveTask(@PathVariable String taskId)
{
PrcPriceSetSaveTask task = priceSetService.getSaveTask(taskId);
if (task == null)
{
return error(MessageUtils.message("price.set.save.task.notExists"));
}
return success(task);
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@@ -102,6 +121,31 @@ public class PriceSetController extends BaseController
return toAjax(priceSetService.reject(priceSetId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "Price set version activate", businessType = BusinessType.UPDATE)
@PutMapping("/version/activate/{psvId}")
public AjaxResult activateVersion(@PathVariable Long psvId)
{
return toAjax(priceSetService.activateVersion(psvId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:add')")
@Log(title = "Price set version copy", businessType = BusinessType.INSERT)
@PostMapping("/version/copy/{psvId}")
public AjaxResult copyVersion(@PathVariable Long psvId)
{
Long newPsvId = priceSetService.copyVersion(psvId, getUsername());
return success(newPsvId);
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "Price set version delete", businessType = BusinessType.DELETE)
@DeleteMapping("/version/{psvId}")
public AjaxResult deleteVersion(@PathVariable Long psvId)
{
return toAjax(priceSetService.deleteVersion(psvId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:audit')")
@Log(title = "价格套餐停用", businessType = BusinessType.UPDATE)
@PutMapping("/disable/{priceSetId}")
@@ -33,7 +33,8 @@ public class PriceStatusController extends BaseController
{
int[] counts = refreshTask.refreshNow();
String msg = MessageUtils.message("price.status.refresh.success",
String.valueOf(counts[0]), String.valueOf(counts[1]));
String.valueOf(counts[0]), String.valueOf(counts[1]),
String.valueOf(counts.length > 2 ? counts[2] : 0));
return success(msg);
}
}
@@ -63,6 +63,19 @@ public class SurchargeController extends BaseController
return success(surchargeRelService.selectRelByProductCode(productCode));
}
/**
* 附加费配置全量(非分页,供套餐明细勾选使用)
*
* 不要求 price:surcharge:list 权限,套餐维护角色(price:set:*)也能读,避免套餐页拿到 403 空列表。
*/
@PreAuthorize("@ss.hasPermi('price:surcharge:list') or @ss.hasPermi('price:surcharge:query')"
+ " or @ss.hasPermi('price:set:query') or @ss.hasPermi('price:set:add') or @ss.hasPermi('price:set:edit')")
@GetMapping("/options")
public AjaxResult listOptions(PrcSurcharge surcharge)
{
return success(surchargeService.selectPrcSurchargeList(surcharge));
}
/**
* 绑定附加费到产品/明细(body: scId, productId, productCode, detailId;detailId 空=产品级)
*/
@@ -136,9 +136,20 @@ price.quote.quoteIdRequired=报价ID为空
price.quote.hitCustomerFixedPackageDetail=命中客户套餐固定价格明细
# ---- 状态自动刷新 ----
price.status.refresh.success=状态刷新完成:bms_product 更新 {0} 行,bms_product_country 更新 {1} 行
price.status.refresh.success=状态刷新完成:bms_product 更新 {0} 行,bms_product_country 更新 {1} 行,价格套餐版本 {2} 套
# receivable bill
price.bill.orderNoRequired=订单号为空
price.bill.billIdRequired=计费ID为空
price.bill.notFound=计费记录不存在
price.bill.bizDateRequired=业务日期为空
price.set.version.effectiveTime.empty=版本生效时间不能为空
price.set.version.notExists=套餐版本不存在
price.set.version.activate.statusNotAllowed=仅草稿版本可启动
price.set.version.delete.statusNotAllowed=仅草稿版本可删除
price.set.save.task.notExists=保存任务不存在或已过期
price.set.library.empty=产品库无可用价格明细,请检查产品国家配置
price.set.detail.duplicate.fixed=产品{0} 国家{1} 重量段{2} {3}(共{4}条)
price.set.detail.duplicate.discount=产品{0}(共{1}条)
price.set.detail.duplicate.hasZone=有分区({0})
price.set.detail.duplicate.noZone=无分区