fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -677,7 +677,6 @@ if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()), acceptData.getSystem())) otherInfo.setRewardCoupon(null); goodsDetail.setOtherInfo(otherInfo); } extraVO.setFanliValid(fanliValid); fanli/src/main/java/com/yeshi/fanli/job/order/vipshop/UpdateVipShopOrderJob.java
@@ -11,6 +11,8 @@ import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.mq.cmq.order.OrdersCMQManager; import com.yeshi.fanli.util.vipshop.DingDanXiaApiUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.xxl.job.core.biz.model.ReturnT; @@ -27,6 +29,8 @@ //从淘宝爬去订单更新 @Component public class UpdateVipShopOrderJob { private Logger logger = LoggerFactory.getLogger("debugLog"); @Resource private VipShopOrderService vipShopOrderService; @@ -76,6 +80,8 @@ @XxlJob("updateVipShopOrderHandler") public ReturnT<String> updateVipShopSoonOrder(String param) throws Exception { LogHelper.test("updateVipShopOrderHandler:" + param); logger.info("唯品会订单更新开始:updateVipShopSoonOrder 参数:"+param); try { long endTime = System.currentTimeMillis(); if ("1hour".equalsIgnoreCase(param)) {// 更新1小时内的订单 updateByOrderTime(endTime - 1000 * 60 * 60 * 1L, endTime); @@ -100,6 +106,12 @@ * updateByOrderTime(endTime - 1000 * 60 * 60 * 24 * 3L, endTime); * updateByUpdateTime(endTime - 1000 * 60 * 60 * 24 * 3L, endTime); } */ }catch(Exception e){ logger.error("唯品会订单更新异常:",e); }finally { logger.info("唯品会订单更新结束:updateVipShopSoonOrder 参数:"+ param); } return ReturnT.SUCCESS; } @@ -107,15 +119,15 @@ //根据订单号更新 @XxlJob("order-vip-updateByOrderSn") public ReturnT<String> updateByOrderSn(String param) throws Exception { logger.info(String.format("唯品会订单更新:%s", param)); try { String[] ps = param.split(","); for (String p : ps) { List<VipShopOrder> orders = vipShopOrderService.listByOrderSn(p); if (orders == null || orders.size() == 0) { if (orders == null || orders.size() == 0) { // 请求订单详情 saveVipShopOrders( Arrays.asList(new VipShopOrder[]{ DingDanXiaApiUtil.getOrderDetail(p)})); } else { } else { Thread.sleep(1000); VipShopOrder vipShopOrder = DingDanXiaApiUtil.getOrderDetail(p); if (vipShopOrder != null) { @@ -125,6 +137,10 @@ } } } logger.info("唯品会订单更新成功"); }catch(Exception e){ logger.info(String.format("唯品会订单更新失败:%s", e.getMessage())); } return ReturnT.SUCCESS; } fanli/src/main/java/com/yeshi/fanli/util/vipshop/VipShopApiUtil.java
@@ -6,6 +6,7 @@ import java.net.URLEncoder; import java.util.*; import com.yeshi.fanli.util.Constant; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.methods.PostMethod; @@ -40,7 +41,8 @@ /** * 获取签名 * * @param params * @param systemParams * @param taskParams * @return */ private static String getSign(Map<String, String> systemParams, JSONObject taskParams) { @@ -141,6 +143,14 @@ if (searchFilter.getFieldName() != null) taskParams.put("fieldName", searchFilter.getFieldName() + ""); //新增参数 taskParams.put("chanTag", "default_pid"); taskParams.put("openId", "default_open_id"); taskParams.put("realCall", "true"); JSONObject root = new JSONObject(); root.put("request", JSONObject.fromObject(taskParams)); String result = baseRequest("com.vip.adp.api.open.service.UnionGoodsService", "query", root); @@ -177,6 +187,11 @@ taskParams.put("page", page + ""); taskParams.put("pageSize", 20 + ""); taskParams.put("requestId", System.currentTimeMillis() + "_" + UUID.randomUUID()); //新增参数 taskParams.put("chanTag", "default_pid"); taskParams.put("openId", "default_open_id"); taskParams.put("realCall", "true"); JSONObject root = new JSONObject(); @@ -263,6 +278,13 @@ JSONObject params = new JSONObject(); params.put("goodsIdList", goodsIdList); params.put("requestId", UUID.randomUUID()); //新增参数 params.put("chanTag", "default_pid"); JSONObject request = new JSONObject(); request.put("openId", "default_open_id"); request.put("realCall", "true"); params.put("request", request); String result = baseRequest("com.vip.adp.api.open.service.UnionGoodsService", "getByGoodsIds", JSONObject.fromObject(params)); System.out.println(result); @@ -319,9 +341,17 @@ } public static void main(String[] args) { // VIPSearchFilter sf=new VIPSearchFilter(); // sf.setKeyword("花卉"); // sf.setPage(1); // sf.setPageSize(Constant.PAGE_SIZE); // search(sf); getGoodsDetail("6919981305334511260"); // convertLinkByUrl("https://t.vip.com/T7RyKKCJLj9", "437032"); // convertLink("560392904","437032"); getOrderList(VipShopOrderQueryModel.createOrderSn(Arrays.asList(new String[]{"23090254293903"}),1)); // getOrderList(VipShopOrderQueryModel.createOrderSn(Arrays.asList(new String[]{"23090254293903"}),1)); } } fanli/src/main/resource/dubbo/consumer.xml
@@ -11,8 +11,8 @@ <dubbo:annotation package="com.yeshi.fanli"></dubbo:annotation> <!--<dubbo:registry address="zookeeper://172.16.16.46:2181"/>--> <dubbo:registry address="zookeeper://193.112.35.168:2182"/> <dubbo:registry address="zookeeper://172.16.16.46:2181"/> <!--<dubbo:registry address="zookeeper://193.112.35.168:2182"/>--> <!-- url=dubbo://192.168.3.122:20882/com.yeshi.goods.facade.service.TaoBaoCouponCacheService -->