fix(shopping): 修复查看密码验证逻辑
- 当用户未设置查看密码时直接返回验证结果 - 避免未设置密码情况下的空指针异常 - 简化密码验证流程提高代码可读性
This commit is contained in:
parent
9eb62258b6
commit
6d87095160
|
|
@ -340,6 +340,13 @@ public class ShoppingController extends ControllerBase {
|
||||||
QuotationShoppingCart cart = shoppingCartService.getById(id);
|
QuotationShoppingCart cart = shoppingCartService.getById(id);
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(cart)).throwMessage("未找到购物车信息");
|
VUtils.trueThrowBusinessError(Objects.isNull(cart)).throwMessage("未找到购物车信息");
|
||||||
ShoppingCartVO vo = Convert.convert(ShoppingCartVO.class, cart);
|
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();
|
// Long categoryId = getCategoryId();
|
||||||
// List<ModelConfigEffectiveDTO> parts = modelConfigService.getEffectives(cart.getConfigId(), cart.getPriceId(), categoryId, MultilingualUtil.getLanguage());
|
// List<ModelConfigEffectiveDTO> parts = modelConfigService.getEffectives(cart.getConfigId(), cart.getPriceId(), categoryId, MultilingualUtil.getLanguage());
|
||||||
|
|
@ -429,7 +436,7 @@ public class ShoppingController extends ControllerBase {
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("/quotation/generate")
|
@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()
|
List<QuotationShoppingCart> carts = shoppingCartService.lambdaQuery()
|
||||||
.eq(QuotationShoppingCart::getStatus, 0)
|
.eq(QuotationShoppingCart::getStatus, 0)
|
||||||
.eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
|
.eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
|
||||||
|
|
@ -484,7 +491,7 @@ public class ShoppingController extends ControllerBase {
|
||||||
.eq(QuotationShoppingCart::getStatus, 0)
|
.eq(QuotationShoppingCart::getStatus, 0)
|
||||||
.in(QuotationShoppingCart::getId, cartIds)
|
.in(QuotationShoppingCart::getId, cartIds)
|
||||||
.update();
|
.update();
|
||||||
return ApiResult.success();
|
return ApiResult.success(order.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ public class ShoppingCartVO {
|
||||||
*/
|
*/
|
||||||
private Long modelId;
|
private Long modelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机型自增id
|
||||||
|
*/
|
||||||
|
private Integer modelKeyId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 价格id
|
* 价格id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue