Commit 05b23181 by ping.wu

sku商品保存商品的spu商品货号

parent 6132d798
...@@ -3133,6 +3133,9 @@ public class OrderSdkAdapter { ...@@ -3133,6 +3133,9 @@ public class OrderSdkAdapter {
if (StringUtils.isNotBlank(product.getThirdProductSpecId())) { if (StringUtils.isNotBlank(product.getThirdProductSpecId())) {
extInfo.setThirdProductSpecId(product.getThirdProductSpecId()); extInfo.setThirdProductSpecId(product.getThirdProductSpecId());
} }
if (StringUtils.isNotBlank(product.getSpuProductCode())) {
extInfo.setSpuProductCode(product.getSpuProductCode());
}
//第三方商品属性id //第三方商品属性id
if (StringUtils.isNotBlank(product.getThirdProductPropertyId())) { if (StringUtils.isNotBlank(product.getThirdProductPropertyId())) {
extInfo.setThirdProductPropertyId(product.getThirdProductPropertyId()); extInfo.setThirdProductPropertyId(product.getThirdProductPropertyId());
......
...@@ -65,6 +65,9 @@ public class CreateOrderProductRequest extends BaseConfig { ...@@ -65,6 +65,9 @@ public class CreateOrderProductRequest extends BaseConfig {
* 商品货号,商品服务可重复 * 商品货号,商品服务可重复
*/ */
private String productCode; private String productCode;
//多规格商品的spu商品 商品货号,单规格即为单规格商品货号
private String spuProductCode;
/** /**
* 商品价格 单价分 * 商品价格 单价分
*/ */
......
...@@ -124,4 +124,7 @@ public class OrderProductAddInfoDto extends BaseConfig { ...@@ -124,4 +124,7 @@ public class OrderProductAddInfoDto extends BaseConfig {
//积分商品活动使用总积分 //积分商品活动使用总积分
private Long score; private Long score;
//多规格商品的spu商品 商品货号,单规格即为单规格商品货号
private String spuProductCode;
} }
...@@ -40,6 +40,9 @@ public class GetProductsVo { ...@@ -40,6 +40,9 @@ public class GetProductsVo {
*/ */
private String productCode; private String productCode;
//多规格商品的spu商品 商品货号,单规格即为单规格商品货号
private String spuProductCode;
/** /**
* 第三方商品规格编号 * 第三方商品规格编号
*/ */
......
...@@ -63,6 +63,8 @@ public class ItemServiceImpl implements ItemService{ ...@@ -63,6 +63,8 @@ public class ItemServiceImpl implements ItemService{
boolean toPosCustomerCode = productInfosDto.getData().getToPosProductIdType() != null && productInfosDto.getData().getToPosProductIdType() == 1; boolean toPosCustomerCode = productInfosDto.getData().getToPosProductIdType() != null && productInfosDto.getData().getToPosProductIdType() == 1;
productInfosDto.getData().getProducts().forEach(productBean -> { productInfosDto.getData().getProducts().forEach(productBean -> {
GetProductsVo spuProductsVo = new GetProductsVo(); GetProductsVo spuProductsVo = new GetProductsVo();
spuProductsVo.setSpuProductCode(productBean.getProductCode());
//保存货号到三方商品编号字段 //保存货号到三方商品编号字段
if(toPosCustomerCode){ if(toPosCustomerCode){
spuProductsVo.setCustomerCode(productBean.getProductCode()); spuProductsVo.setCustomerCode(productBean.getProductCode());
...@@ -108,6 +110,8 @@ public class ItemServiceImpl implements ItemService{ ...@@ -108,6 +110,8 @@ public class ItemServiceImpl implements ItemService{
if (CollectionUtils.isNotEmpty(productBean.getSkuList())) { if (CollectionUtils.isNotEmpty(productBean.getSkuList())) {
for (SkuProduct skuProductBean : productBean.getSkuList()) { for (SkuProduct skuProductBean : productBean.getSkuList()) {
GetProductsVo skuProductsVo = new GetProductsVo(); GetProductsVo skuProductsVo = new GetProductsVo();
skuProductsVo.setSpuProductCode(productBean.getProductCode());
//保存货号到三方商品编号字段 //保存货号到三方商品编号字段
if(toPosCustomerCode){ if(toPosCustomerCode){
skuProductsVo.setCustomerCode(skuProductBean.getProductCode()); skuProductsVo.setCustomerCode(skuProductBean.getProductCode());
...@@ -146,6 +150,8 @@ public class ItemServiceImpl implements ItemService{ ...@@ -146,6 +150,8 @@ public class ItemServiceImpl implements ItemService{
if (CollectionUtils.isNotEmpty(productBean.getProductComboList())) { if (CollectionUtils.isNotEmpty(productBean.getProductComboList())) {
for (ProductComboListDto productComboListDto : productBean.getProductComboList()) { for (ProductComboListDto productComboListDto : productBean.getProductComboList()) {
GetProductsVo comboProductsVo = new GetProductsVo(); GetProductsVo comboProductsVo = new GetProductsVo();
comboProductsVo.setSpuProductCode(productComboListDto.getProductCode());
//保存货号到三方商品编号字段 //保存货号到三方商品编号字段
if(toPosCustomerCode){ if(toPosCustomerCode){
comboProductsVo.setCustomerCode(productComboListDto.getProductCode()); comboProductsVo.setCustomerCode(productComboListDto.getProductCode());
...@@ -192,6 +198,7 @@ public class ItemServiceImpl implements ItemService{ ...@@ -192,6 +198,7 @@ public class ItemServiceImpl implements ItemService{
//多规格获取sku信息 //多规格获取sku信息
GetProductsVo groupProductsVo = new GetProductsVo(); GetProductsVo groupProductsVo = new GetProductsVo();
groupProductsVo.setSpuProductCode(groupDetailBean.getProductCode());
//保存货号到三方商品编号字段 //保存货号到三方商品编号字段
if(toPosCustomerCode){ if(toPosCustomerCode){
groupProductsVo.setCustomerCode(groupDetailBean.getProductCode()); groupProductsVo.setCustomerCode(groupDetailBean.getProductCode());
......
...@@ -2390,6 +2390,7 @@ public class OrderServiceImpl implements Orderservice { ...@@ -2390,6 +2390,7 @@ public class OrderServiceImpl implements Orderservice {
for (CreateOrderProductRequest productDto : createOrderDto.getProducts()) { for (CreateOrderProductRequest productDto : createOrderDto.getProducts()) {
String skuId = productDto.getSpecification(); String skuId = productDto.getSpecification();
if (products.get(skuId) != null) { if (products.get(skuId) != null) {
productDto.setSpuProductCode(products.get(skuId).getSpuProductCode());
productDto.setCustomerCode(products.get(skuId).getCustomerCode()); productDto.setCustomerCode(products.get(skuId).getCustomerCode());
productDto.setProductCode(products.get(skuId).getProductCode()); productDto.setProductCode(products.get(skuId).getProductCode());
productDto.setThirdProductSpecId(products.get(productDto.getSpecification()).getThirdProductSpecId()); productDto.setThirdProductSpecId(products.get(productDto.getSpecification()).getThirdProductSpecId());
...@@ -2407,6 +2408,7 @@ public class OrderServiceImpl implements Orderservice { ...@@ -2407,6 +2408,7 @@ public class OrderServiceImpl implements Orderservice {
for (CreateOrderProductRequest comboProduct : productDto.getComboProduct()) { for (CreateOrderProductRequest comboProduct : productDto.getComboProduct()) {
String comboSkuId = comboProduct.getSpecification(); String comboSkuId = comboProduct.getSpecification();
if (products.get(comboSkuId) != null) { if (products.get(comboSkuId) != null) {
comboProduct.setSpuProductCode(products.get(comboSkuId).getSpuProductCode());
comboProduct.setCustomerCode(products.get(comboSkuId).getCustomerCode()); comboProduct.setCustomerCode(products.get(comboSkuId).getCustomerCode());
comboProduct.setProductCode(products.get(comboSkuId).getProductCode()); comboProduct.setProductCode(products.get(comboSkuId).getProductCode());
comboProduct.setThirdProductSpecId(products.get(comboSkuId).getThirdProductSpecId()); comboProduct.setThirdProductSpecId(products.get(comboSkuId).getThirdProductSpecId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment