|
@@ -21,10 +21,7 @@ import com.google.zxing.qrcode.QRCodeWriter;
|
|
|
import com.zhongzheng.common.config.WxSmallConfig;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
-import com.zhongzheng.common.utils.AES;
|
|
|
-import com.zhongzheng.common.utils.DateUtils;
|
|
|
-import com.zhongzheng.common.utils.ServletUtils;
|
|
|
-import com.zhongzheng.common.utils.SnowflakeIdUtils;
|
|
|
+import com.zhongzheng.common.utils.*;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.ip.IpUtils;
|
|
|
import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
@@ -51,6 +48,8 @@ import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderPayService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
+import com.zhongzheng.modules.order.vo.OrderShareGoodsVo;
|
|
|
+import com.zhongzheng.modules.order.vo.OrderShareToOldVo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvVideoAddBo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvVideoEditBo;
|
|
|
import com.zhongzheng.modules.polyv.bo.PolyvVideoQueryBo;
|
|
@@ -69,6 +68,7 @@ import com.zhongzheng.modules.user.domain.User;
|
|
|
import com.zhongzheng.modules.user.domain.UserExamGoods;
|
|
|
import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.UserExamGoodsVo;
|
|
|
+import com.zhongzheng.modules.user.vo.UserVo;
|
|
|
import com.zhongzheng.modules.wx.service.IWxPayService;
|
|
|
import com.zhongzheng.modules.wx.vo.WxPayVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -116,6 +116,9 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
|
@Value("${wx.wepay.notifyUrl}")
|
|
|
private String notifyUrl;
|
|
|
|
|
|
+ @Value("${oldStudySys.sharePath}")
|
|
|
+ private String SHARE_PATH;
|
|
|
+
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
@@ -406,6 +409,7 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
|
//商品是否绑定活动模考
|
|
|
// iUserMockSubscribeService.addActivityMock(g.getGoodsId(),order.getUserId());
|
|
|
}
|
|
|
+ shareToOldSys(order,goodsList);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -460,6 +464,44 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean shareToOldSys(Order order,List<OrderGoods> goodsList) {
|
|
|
+ if (Validator.isNotEmpty(order)) {
|
|
|
+ UserVo user = iUserService.queryById(order.getUserId());
|
|
|
+ if(Validator.isNotEmpty(user.getShareCode())){
|
|
|
+ OrderShareToOldVo vo = new OrderShareToOldVo();
|
|
|
+ vo.setOrderId(order.getOrderId());
|
|
|
+ vo.setSharecode(user.getShareCode());
|
|
|
+ vo.setOrderprice(order.getPayPrice());
|
|
|
+ vo.setOrderno(order.getOrderSn());
|
|
|
+ List<OrderShareGoodsVo> shareGoodsVoList = new ArrayList<>();
|
|
|
+ for(OrderGoods goods : goodsList){
|
|
|
+ GoodsVo goodsVo = iGoodsService.queryById(goods.getGoodsId());
|
|
|
+ OrderShareGoodsVo shareGoodsVo = BeanUtil.toBean(goodsVo, OrderShareGoodsVo.class);
|
|
|
+ shareGoodsVo.setEducationId(goodsVo.getEducationTypeId());
|
|
|
+ shareGoodsVoList.add(shareGoodsVo);
|
|
|
+ }
|
|
|
+ vo.setGoodsList(shareGoodsVoList);
|
|
|
+ //分销下单
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(nowTime.toString()+"pubilc2022");
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
+ params.put("sign", sign);
|
|
|
+ params.put("jsonstr", JSONObject.toJSONString(vo));
|
|
|
+ String respone = "";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(SHARE_PATH, params);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new CustomException("同步请求错误"+e.getMessage());
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void updateUserExamGoods(OrderGoods g, Order order) {
|
|
|
GoodsVo goodsVo = iGoodsService.queryById(g.getGoodsId());
|