|
@@ -426,9 +426,14 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
product.setRecommendType(0);
|
|
product.setRecommendType(0);
|
|
product.setInvoiceType(0);
|
|
product.setInvoiceType(0);
|
|
product.setAnnounType(secondDto.getAnnounType());
|
|
product.setAnnounType(secondDto.getAnnounType());
|
|
|
|
+ Integer shopId = 1252;
|
|
if (newFlag) {
|
|
if (newFlag) {
|
|
// 默认发布到二手供应商
|
|
// 默认发布到二手供应商
|
|
- product.setShopId(1252);
|
|
|
|
|
|
+ boolean b = 3 == secondDto.getUserIdentity();
|
|
|
|
+ if (b) {
|
|
|
|
+ shopId = secondHandMapper.findShopIdByUser(secondDto.getUserId());
|
|
|
|
+ }
|
|
|
|
+ product.setShopId(shopId);
|
|
product.setValidFlag(1);
|
|
product.setValidFlag(1);
|
|
product.setVisibility(1);
|
|
product.setVisibility(1);
|
|
product.setAddTime(current);
|
|
product.setAddTime(current);
|
|
@@ -458,11 +463,11 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
}
|
|
}
|
|
if (null != secondDto.getProductImages()) {
|
|
if (null != secondDto.getProductImages()) {
|
|
List<String> productImages = secondDto.getProductImages();
|
|
List<String> productImages = secondDto.getProductImages();
|
|
- Integer shopId = newFlag ? 1252 : null;
|
|
|
|
|
|
+ Integer finalShopId = shopId;
|
|
productImages.forEach(image -> {
|
|
productImages.forEach(image -> {
|
|
ProductImagePo imagePo = new ProductImagePo();
|
|
ProductImagePo imagePo = new ProductImagePo();
|
|
imagePo.setProductId(product.getProductId());
|
|
imagePo.setProductId(product.getProductId());
|
|
- imagePo.setShopId(shopId);
|
|
|
|
|
|
+ imagePo.setShopId(finalShopId);
|
|
imagePo.setAddTime(current);
|
|
imagePo.setAddTime(current);
|
|
imagePo.setImage(image);
|
|
imagePo.setImage(image);
|
|
imagePo.setMainFlag(3);
|
|
imagePo.setMainFlag(3);
|
|
@@ -471,7 +476,6 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
}
|
|
}
|
|
if (null != secondDto.getImage()) {
|
|
if (null != secondDto.getImage()) {
|
|
String[] images = secondDto.getImage().split(",");
|
|
String[] images = secondDto.getImage().split(",");
|
|
- Integer shopId = newFlag ? 1252 : null;
|
|
|
|
/* 保存商品图片信息*/
|
|
/* 保存商品图片信息*/
|
|
for (int i = 0; i < images.length; i++) {
|
|
for (int i = 0; i < images.length; i++) {
|
|
ProductImagePo imagePo = new ProductImagePo();
|
|
ProductImagePo imagePo = new ProductImagePo();
|