|
@@ -1,5 +1,6 @@
|
|
|
package zs.payment.service.paysupply.impl;
|
|
package zs.payment.service.paysupply.impl;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -8,7 +9,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import zs.payment.dto.OrderDetailDTO;
|
|
import zs.payment.dto.OrderDetailDTO;
|
|
|
import zs.payment.entity.Orders;
|
|
import zs.payment.entity.Orders;
|
|
|
|
|
+import zs.payment.enums.CallbackMessageType;
|
|
|
import zs.payment.enums.ProductSupplyRedis;
|
|
import zs.payment.enums.ProductSupplyRedis;
|
|
|
|
|
+import zs.payment.messages.KafkaProducer;
|
|
|
import zs.payment.req.*;
|
|
import zs.payment.req.*;
|
|
|
import zs.payment.req.aftersales.AfterSalesOrderReq;
|
|
import zs.payment.req.aftersales.AfterSalesOrderReq;
|
|
|
import zs.payment.req.aftersales.AfterSalesOrderTypeReq;
|
|
import zs.payment.req.aftersales.AfterSalesOrderTypeReq;
|
|
@@ -45,7 +48,8 @@ public class PaySupplyServiceImpl implements PaySupplyService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisUtils redisUtils;
|
|
private RedisUtils redisUtils;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private KafkaProducer kafkaProducer;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Result detailList(ProductDetailReq req) {
|
|
public Result detailList(ProductDetailReq req) {
|
|
@@ -376,6 +380,13 @@ public class PaySupplyServiceImpl implements PaySupplyService {
|
|
|
if (respJson.getIntValue("code") != 0) {
|
|
if (respJson.getIntValue("code") != 0) {
|
|
|
return Result.fail(respJson.getString("msg"));
|
|
return Result.fail(respJson.getString("msg"));
|
|
|
}
|
|
}
|
|
|
|
|
+ //把选品库中的商品同步到企云商城中
|
|
|
|
|
+ JSONArray array = respJson.getJSONObject("data").getJSONArray("list");
|
|
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
|
|
+ json.put("product_id", array.getInteger(i));
|
|
|
|
|
+ kafkaProducer.sendMessage(CallbackMessageType.GOODS_ALTER, json.toJSONString());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
return Result.success(respJson.getJSONObject("data"));
|
|
return Result.success(respJson.getJSONObject("data"));
|