fix(app): 统一修改提示信息为“请联系管理员为您开放权限”
- 将AppRatioAgentConfigController中所有涉及权限提示的消息由“请联系管理员为你设置”修改为“请联系管理员为您开放权限” - PlanController中为setDefaultRatio接口添加@Min(1)参数校验,确保传入系数不小于1 - ShoppingController中修改权限相关提示信息,统一为“请联系管理员为您开放权限” - 优化用户权限提示语句,提升用户体验和表述一致性
This commit is contained in:
parent
a97e80f857
commit
9cceef75bb
|
|
@ -94,7 +94,7 @@ public class AppRatioAgentConfigController extends ControllerBase {
|
||||||
*/
|
*/
|
||||||
@PostMapping("config/search")
|
@PostMapping("config/search")
|
||||||
public ApiResult<PageData<Map<String, Object>>> search(@Valid @RequestBody ModelConfigSearchRequest request) {
|
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()
|
QuotationModelRatioAgent ratioAgent = ratioAgentService.lambdaQuery()
|
||||||
.eq(QuotationModelRatioAgent::getStatus, 1)
|
.eq(QuotationModelRatioAgent::getStatus, 1)
|
||||||
.eq(QuotationModelRatioAgent::getCreateByType, 1)
|
.eq(QuotationModelRatioAgent::getCreateByType, 1)
|
||||||
|
|
@ -109,7 +109,7 @@ public class AppRatioAgentConfigController extends ControllerBase {
|
||||||
.list();
|
.list();
|
||||||
AppUser cuser = appUserService.getById(AppUserUtil.getUserId());
|
AppUser cuser = appUserService.getById(AppUserUtil.getUserId());
|
||||||
DictionaryItem category = appUserService.getCategory(cuser);
|
DictionaryItem category = appUserService.getCategory(cuser);
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为你设置区域类型");
|
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为您开放权限");
|
||||||
List<AppUser> users = appUserService.getChildren(cuser);
|
List<AppUser> users = appUserService.getChildren(cuser);
|
||||||
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
||||||
PageData<Map<String, Object>> mdatas = new PageData<>();
|
PageData<Map<String, Object>> mdatas = new PageData<>();
|
||||||
|
|
@ -247,10 +247,10 @@ public class AppRatioAgentConfigController extends ControllerBase {
|
||||||
*/
|
*/
|
||||||
@PostMapping("list/search")
|
@PostMapping("list/search")
|
||||||
public ApiResult<PageData<RatioConfigSearchVO>> search(@Valid @RequestBody ModelRatioUserSearchRequest request) {
|
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());
|
AppUser cuser = appUserService.getById(AppUserUtil.getUserId());
|
||||||
DictionaryItem category = appUserService.getCategory(cuser);
|
DictionaryItem category = appUserService.getCategory(cuser);
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为你设置区域类型");
|
VUtils.trueThrowBusinessError(Objects.isNull(category)).throwMessage("请联系管理员为您开放权限");
|
||||||
List<QuotationUserPlanModelItemDTO> plans = planModelItemService.getEffectivesForAgent();
|
List<QuotationUserPlanModelItemDTO> plans = planModelItemService.getEffectivesForAgent();
|
||||||
List<QuotationModelRatioAgentItemDTO> items = ratioAgentItemService.getEffectiveByCreate(AppUserUtil.getUserId());
|
List<QuotationModelRatioAgentItemDTO> items = ratioAgentItemService.getEffectiveByCreate(AppUserUtil.getUserId());
|
||||||
if (Objects.isNull(request.getUserId())) {
|
if (Objects.isNull(request.getUserId())) {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
@ -75,7 +76,7 @@ public class PlanController extends ControllerBase {
|
||||||
* 设置方案默认系数
|
* 设置方案默认系数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/setDefaultRatio")
|
@PostMapping("/setDefaultRatio")
|
||||||
public ApiResult<Void> setDefaultRatio(@RequestParam BigDecimal ratio) {
|
public ApiResult<Void> setDefaultRatio(@RequestParam @Min(1) BigDecimal ratio) {
|
||||||
QuotationUserPlanDefault planDefault = planDefaultService.lambdaQuery()
|
QuotationUserPlanDefault planDefault = planDefaultService.lambdaQuery()
|
||||||
.eq(QuotationUserPlanDefault::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
|
.eq(QuotationUserPlanDefault::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
|
||||||
.eq(QuotationUserPlanDefault::getCreateById, AppUserUtil.getUserId())
|
.eq(QuotationUserPlanDefault::getCreateById, AppUserUtil.getUserId())
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ public class ShoppingController extends ControllerBase {
|
||||||
@PostMapping("/cart/init")
|
@PostMapping("/cart/init")
|
||||||
public ApiResult<ShoppingCartVO> init(@Valid @RequestBody ShoppingInitRequest request) {
|
public ApiResult<ShoppingCartVO> init(@Valid @RequestBody ShoppingInitRequest request) {
|
||||||
String qc = getQuotationCode();
|
String qc = getQuotationCode();
|
||||||
VUtils.trueThrowBusinessError(StrUtil.isBlank(qc)).throwMessage("请联系管理员为你设置报价代码");
|
VUtils.trueThrowBusinessError(StrUtil.isBlank(qc)).throwMessage("请联系管理员为您开放权限");
|
||||||
Long categoryId = getCategoryId();
|
Long categoryId = getCategoryId();
|
||||||
ProductModel model = productModelService.lambdaQuery().eq(ProductModel::getState, 1).eq(ProductModel::getNo, request.getModelNo()).one();
|
ProductModel model = productModelService.lambdaQuery().eq(ProductModel::getState, 1).eq(ProductModel::getNo, request.getModelNo()).one();
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("未找到该机型");
|
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("未找到该机型");
|
||||||
|
|
@ -930,7 +930,7 @@ public class ShoppingController extends ControllerBase {
|
||||||
private Long getCategoryId() {
|
private Long getCategoryId() {
|
||||||
if (AppUserUtil.isAgent()) {
|
if (AppUserUtil.isAgent()) {
|
||||||
DictionaryItem di = appUserService.getCategory(appUserService.getById(AppUserUtil.getUserId()));
|
DictionaryItem di = appUserService.getCategory(appUserService.getById(AppUserUtil.getUserId()));
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(di)).throwMessage("请联系管理员设置区域类别");
|
VUtils.trueThrowBusinessError(Objects.isNull(di)).throwMessage("请联系管理员为您开放权限");
|
||||||
return di.getId();
|
return di.getId();
|
||||||
} else {
|
} else {
|
||||||
Long categoryId = adminUserService.getById(AppUserUtil.getUserId()).getCategoryId();
|
Long categoryId = adminUserService.getById(AppUserUtil.getUserId()).getCategoryId();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue