|
|
@@ -965,8 +965,14 @@ public class CmsAccountController {
|
|
|
}
|
|
|
}
|
|
|
account.setType(2);
|
|
|
- if (account.getGoodsId() == 26 && account.getPreSkuId() == null) {
|
|
|
- throw BusinessRuntimeException.getInstance("请选择对应规格id");
|
|
|
+ if (account.getGoodsId() == 26) {
|
|
|
+ String preSkuIds = account.getPreSkuIds();
|
|
|
+ if (StrUtil.isEmpty(preSkuIds)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请选择对应规格id");
|
|
|
+ }
|
|
|
+ String[] split = preSkuIds.split(",");
|
|
|
+ String skuSetStr = Arrays.stream(split).distinct().collect(Collectors.joining(","));
|
|
|
+ account.setPreSkuIds(skuSetStr);
|
|
|
}
|
|
|
accountService.save(account);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|