fix(app): 统一修改提示信息为“请联系管理员为您开放权限”

- 将AppRatioAgentConfigController中所有涉及权限提示的消息由“请联系管理员为你设置”修改为“请联系管理员为您开放权限”
- PlanController中为setDefaultRatio接口添加@Min(1)参数校验,确保传入系数不小于1
- ShoppingController中修改权限相关提示信息,统一为“请联系管理员为您开放权限”
- 优化用户权限提示语句,提升用户体验和表述一致性
This commit is contained in:
曹鹏飞 2026-05-13 09:01:03 +08:00
parent a97e80f857
commit 9cceef75bb
3 changed files with 8 additions and 7 deletions

View File

@ -94,7 +94,7 @@ public class AppRatioAgentConfigController extends ControllerBase {
*/
@PostMapping("config/search")
public ApiResult<PageData<Map<String, Object>>> search(@Valid @RequestBody ModelConfigSearchRequest request) {
VUtils.trueThrowBusinessError(!ratioAgentItemService.hasConfig(AppUserUtil.getUserId())).throwMessage("请联系管理员为你设置系数");
VUtils.trueThrowBusinessError(!ratioAgentItemService.hasConfig(AppUserUtil.getUserId())).throwMessage("请联系管理员为您开放权限");
QuotationModelRatioAgent ratioAgent = ratioAgentService.lambdaQuery()
.eq(QuotationModelRatioAgent::getStatus, 1)
.eq(QuotationModelRatioAgent::getCreateByType, 1)
@ -109,7 +109,7 @@ public class AppRatioAgentConfigController extends ControllerBase {
.list();
AppUser cuser = appUserService.getById(AppUserUtil.getUserId());
DictionaryItem category = appUserService.getCategory(cuser);
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为你设置区域类型");
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为您开放权限");
List<AppUser> users = appUserService.getChildren(cuser);
List<ModelPriceVO> prices = priceService.getAllModelPrice();
PageData<Map<String, Object>> mdatas = new PageData<>();
@ -247,10 +247,10 @@ public class AppRatioAgentConfigController extends ControllerBase {
*/
@PostMapping("list/search")
public ApiResult<PageData<RatioConfigSearchVO>> search(@Valid @RequestBody ModelRatioUserSearchRequest request) {
VUtils.trueThrowBusinessError(!ratioAgentItemService.hasConfig(AppUserUtil.getUserId())).throwMessage("请联系管理员为你设置系数");
VUtils.trueThrowBusinessError(!ratioAgentItemService.hasConfig(AppUserUtil.getUserId())).throwMessage("请联系管理员为您开放权限");
AppUser cuser = appUserService.getById(AppUserUtil.getUserId());
DictionaryItem category = appUserService.getCategory(cuser);
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为你设置区域类型");
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为您开放权限");
List<QuotationUserPlanModelItemDTO> plans = planModelItemService.getEffectivesForAgent();
List<QuotationModelRatioAgentItemDTO> items = ratioAgentItemService.getEffectiveByCreate(AppUserUtil.getUserId());
if (Objects.isNull(request.getUserId())) {

View File

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -75,7 +76,7 @@ public class PlanController extends ControllerBase {
* 设置方案默认系数
*/
@PostMapping("/setDefaultRatio")
public ApiResult<Void> setDefaultRatio(@RequestParam BigDecimal ratio) {
public ApiResult<Void> setDefaultRatio(@RequestParam @Min(1) BigDecimal ratio) {
QuotationUserPlanDefault planDefault = planDefaultService.lambdaQuery()
.eq(QuotationUserPlanDefault::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
.eq(QuotationUserPlanDefault::getCreateById, AppUserUtil.getUserId())

View File

@ -156,7 +156,7 @@ public class ShoppingController extends ControllerBase {
@PostMapping("/cart/init")
public ApiResult<ShoppingCartVO> init(@Valid @RequestBody ShoppingInitRequest request) {
String qc = getQuotationCode();
VUtils.trueThrowBusinessError(StrUtil.isBlank(qc)).throwMessage("请联系管理员为你设置报价代码");
VUtils.trueThrowBusinessError(StrUtil.isBlank(qc)).throwMessage("请联系管理员为您开放权限");
Long categoryId = getCategoryId();
ProductModel model = productModelService.lambdaQuery().eq(ProductModel::getState, 1).eq(ProductModel::getNo, request.getModelNo()).one();
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("未找到该机型");
@ -930,7 +930,7 @@ public class ShoppingController extends ControllerBase {
private Long getCategoryId() {
if (AppUserUtil.isAgent()) {
DictionaryItem di = appUserService.getCategory(appUserService.getById(AppUserUtil.getUserId()));
VUtils.trueThrowBusinessError(Objects.isNull(di)).throwMessage("请联系管理员设置区域类别");
VUtils.trueThrowBusinessError(Objects.isNull(di)).throwMessage("请联系管理员为您开放权限");
return di.getId();
} else {
Long categoryId = adminUserService.getById(AppUserUtil.getUserId()).getCategoryId();