fix(shopping): 修复查看密码验证逻辑

- 当用户未设置查看密码时直接返回验证结果
- 避免未设置密码情况下的空指针异常
- 简化密码验证流程提高代码可读性
This commit is contained in:
曹鹏飞 2026-03-26 11:13:35 +08:00
parent 9eb62258b6
commit 6d87095160
2 changed files with 14 additions and 2 deletions

View File

@ -340,6 +340,13 @@ public class ShoppingController extends ControllerBase {
QuotationShoppingCart cart = shoppingCartService.getById(id);
VUtils.trueThrowBusinessError(Objects.isNull(cart)).throwMessage("未找到购物车信息");
ShoppingCartVO vo = Convert.convert(ShoppingCartVO.class, cart);
ProductModel model=productModelService.lambdaQuery()
.eq(ProductModel::getState, 1)
.eq(ProductModel::getBatchNumber, cart.getModelId())
.one();
if (Objects.nonNull(model)){
vo.setModelKeyId(model.getId());
}
//获取部件配置
// Long categoryId = getCategoryId();
// List<ModelConfigEffectiveDTO> parts = modelConfigService.getEffectives(cart.getConfigId(), cart.getPriceId(), categoryId, MultilingualUtil.getLanguage());
@ -429,7 +436,7 @@ public class ShoppingController extends ControllerBase {
*/
@Transactional
@PostMapping("/quotation/generate")
public ApiResult<Void> generateQuotation(@RequestBody @NotEmpty List<Long> cartIds) {
public ApiResult<Long> generateQuotation(@RequestBody @NotEmpty List<Long> cartIds) {
List<QuotationShoppingCart> carts = shoppingCartService.lambdaQuery()
.eq(QuotationShoppingCart::getStatus, 0)
.eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
@ -484,7 +491,7 @@ public class ShoppingController extends ControllerBase {
.eq(QuotationShoppingCart::getStatus, 0)
.in(QuotationShoppingCart::getId, cartIds)
.update();
return ApiResult.success();
return ApiResult.success(order.getId());
}
/**

View File

@ -25,6 +25,11 @@ public class ShoppingCartVO {
*/
private Long modelId;
/**
* 机型自增id
*/
private Integer modelKeyId;
/**
* 价格id
*/