|
@@ -4,6 +4,7 @@ import java.util.*;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.ruoyi.common.utils.http.HttpUtils;
|
|
import com.ruoyi.common.utils.http.HttpUtils;
|
|
|
|
+import com.ruoyi.scm.domain.SupplierInfo;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -12,6 +13,7 @@ import com.ruoyi.scm.mapper.ProductInfoMapper;
|
|
import com.ruoyi.scm.domain.ProductInfo;
|
|
import com.ruoyi.scm.domain.ProductInfo;
|
|
import com.ruoyi.scm.service.IProductInfoService;
|
|
import com.ruoyi.scm.service.IProductInfoService;
|
|
import com.ruoyi.common.core.text.Convert;
|
|
import com.ruoyi.common.core.text.Convert;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 商品Service业务层处理
|
|
* 商品Service业务层处理
|
|
@@ -71,25 +73,40 @@ public class ProductInfoServiceImpl implements IProductInfoService
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int updateProductInfo(ProductInfo productInfo)
|
|
|
|
- {
|
|
|
|
|
|
+ public Map<String, Object> updateProductInfo(ProductInfo productInfo) {
|
|
//查询商品信息
|
|
//查询商品信息
|
|
ProductInfo productInfo1 = productInfoMapper.selectProductInfoById(productInfo.getId());
|
|
ProductInfo productInfo1 = productInfoMapper.selectProductInfoById(productInfo.getId());
|
|
- if ("20".equals(productInfo.getType())){
|
|
|
|
|
|
+ String resultJson = null;
|
|
|
|
+ Map<String, Object> resultMap = null;
|
|
|
|
+ if ("20".equals(productInfo.getType())) {
|
|
//下架的情况
|
|
//下架的情况
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("token", "123456");
|
|
map.put("token", "123456");
|
|
map.put("supplierCode", productInfo1.getSupplierId());
|
|
map.put("supplierCode", productInfo1.getSupplierId());
|
|
Set<String> strings = new HashSet<>();
|
|
Set<String> strings = new HashSet<>();
|
|
strings.add(productInfo1.getThirdSpuId());
|
|
strings.add(productInfo1.getThirdSpuId());
|
|
- map.put("thirdSkuIds",strings);
|
|
|
|
|
|
+ map.put("thirdSkuIds", strings);
|
|
map.put("type", 20);
|
|
map.put("type", 20);
|
|
map.put("typeMsg", "测试");
|
|
map.put("typeMsg", "测试");
|
|
String string = JSON.toJSONString(map);
|
|
String string = JSON.toJSONString(map);
|
|
- String s = HttpUtils.sendPost(zsDown, string);
|
|
|
|
- log.info(s);
|
|
|
|
|
|
+ resultJson = HttpUtils.JSONdoPost(zsDown, string);
|
|
|
|
+ //解析数据
|
|
|
|
+ resultMap = JSON.parseObject(resultJson, Map.class);
|
|
|
|
+ if (!CollectionUtils.isEmpty(resultMap)) {
|
|
|
|
+ if (resultMap.get("resultCode").equals("00")) {
|
|
|
|
+ productInfoMapper.updateProductInfo(productInfo);
|
|
|
|
+
|
|
|
|
+// ProductInfo productInfo2 = productInfoMapper.selectProductInfoById(productInfo1.getId());
|
|
|
|
+// productInfo2.setType("10");
|
|
|
|
+//// supplierInfoNew1.setRefuseMsg(null);
|
|
|
|
+// //直接进行数据修改
|
|
|
|
+// productInfoMapper.updateProductInfo(productInfo2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ log.info(resultJson);
|
|
}
|
|
}
|
|
- return productInfoMapper.updateProductInfo(productInfo);
|
|
|
|
|
|
+
|
|
|
|
+ return resultMap;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|