| | |
| | | package com.yeshi.goods.facade.dto.taobao.haodanku; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | public class HaoDanKuPDDGoodsInfo { |
| | | |
| | |
| | | private String couponnum; |
| | | private String couponstarttime; |
| | | private String couponendtime; |
| | | private String pdd_image; |
| | | private List<String> pdd_image; |
| | | private String shopname; |
| | | private String start_time; |
| | | |
| | |
| | | this.couponendtime = couponendtime; |
| | | } |
| | | |
| | | public String getPdd_image() { |
| | | public List<String> getPdd_image() { |
| | | return pdd_image; |
| | | } |
| | | |
| | | public void setPdd_image(String pdd_image) { |
| | | public void setPdd_image(List<String> pdd_image) { |
| | | this.pdd_image = pdd_image; |
| | | } |
| | | |
| | |
| | | @Document(collection = "taoBaoCouponCache") |
| | | public class TaoBaoCouponCache implements Serializable { |
| | | private String id;//主键 |
| | | private Long auctionId;//商品Id |
| | | private String auctionId;//商品Id |
| | | private String activityId;//券ID |
| | | private BigDecimal couponAmount;//券面额 |
| | | private BigDecimal couponStartPrice;//使用券的最小价格 |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | @Indexed |
| | | @Column(name = "auctionId") |
| | | @Expose |
| | | private Long auctionId;// 商品ID |
| | | private String auctionId;// 商品ID |
| | | |
| | | @Field |
| | | @Column(name = "couponLink") |
| | |
| | | this.title = title; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | private Long id;// 商品ID |
| | | @Indexed |
| | | @Field |
| | | private Long goodsId;// 淘宝商品ID |
| | | private String goodsId;// 淘宝商品ID |
| | | @Field |
| | | private String title;// 标题 |
| | | @Field |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getGoodsId() { |
| | | public String getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | public void setGoodsId(String goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | |
| | | |
| | | @Field |
| | | @Indexed |
| | | private Long itemid;// 宝贝ID |
| | | private String itemid;// 宝贝ID |
| | | @Field |
| | | private String itemtitle;// 宝贝标题 |
| | | @Field |
| | |
| | | this.product_id = product_id; |
| | | } |
| | | |
| | | public Long getItemid() { |
| | | public String getItemid() { |
| | | return itemid; |
| | | } |
| | | |
| | | public void setItemid(Long itemid) { |
| | | public void setItemid(String itemid) { |
| | | this.itemid = itemid; |
| | | } |
| | | |
| | |
| | | * @param goodsIdList |
| | | * @return |
| | | */ |
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<Long> goodsIdList); |
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<String> goodsIdList); |
| | | |
| | | /** |
| | | * 过滤淘宝商品信息 |
| | |
| | | * DaTaoKeDetailV2 返回类型 |
| | | * @throws |
| | | */ |
| | | public DaTaoKeDetailV2 selectByAuctionId(Long auctionId); |
| | | public DaTaoKeDetailV2 selectByAuctionId(String auctionId); |
| | | |
| | | public DaTaoKeDetailV2 selectByAuctionIdCache(Long auctionId); |
| | | public DaTaoKeDetailV2 selectByAuctionIdCache(String auctionId); |
| | | } |
| | |
| | | |
| | | public class TaoBaoCouponCacheFactory { |
| | | |
| | | public static TaoBaoCouponCache create(Long auctionId, String activityId, BigDecimal couponAmount, BigDecimal couponStartPrice, Date startTime, Date endTime, String pid, String couponLink) { |
| | | public static TaoBaoCouponCache create(String auctionId, String activityId, BigDecimal couponAmount, BigDecimal couponStartPrice, Date startTime, Date endTime, String pid, String couponLink) { |
| | | TaoBaoCouponCache cache = new TaoBaoCouponCache(); |
| | | cache.setAuctionId(auctionId); |
| | | cache.setPid(pid); |
| | |
| | | import org.jsoup.nodes.Document; |
| | | import org.jsoup.nodes.Element; |
| | | import org.jsoup.select.Elements; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.yeshi.utils.HttpUtil; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import org.yeshi.utils.StringUtil; |
| | |
| | | import java.util.*; |
| | | |
| | | public class DaTaoKeApiUtil { |
| | | static Logger logger = LoggerFactory.getLogger(DaTaoKeApiUtil.class); |
| | | |
| | | final static String API_CHARSET = "UTF-8";//"ISO-8859-1"; |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static DaTaoKeDetailV2 getGoodsDetailByGoodsId(Long goodsId) { |
| | | public static DaTaoKeDetailV2 getGoodsDetailByGoodsId(String goodsId) { |
| | | TaoKeAppInfo app = getRandomApp(); |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v1.1.1"); |
| | |
| | | JSONObject itemGoods = arrayGoods.optJSONObject(i); |
| | | |
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief(); |
| | | taoBaoGoods.setAuctionId(itemGoods.optLong("goodsid")); |
| | | taoBaoGoods.setAuctionId(itemGoods.optString("goodsid")); |
| | | taoBaoGoods.setBiz30day(itemGoods.optInt("xiaoliang")); |
| | | taoBaoGoods.setCouponAmount(new BigDecimal(itemGoods.optString("quan_jine"))); |
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", itemGoods.optString("quan_tiaojian"), |
| | |
| | | /** |
| | | * 各大榜单 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | | public static String getHotWords() { |
| | |
| | | * @Title: convertLink |
| | | * @Description: |
| | | */ |
| | | public static String convertLink(Long auctionId, String pid) { |
| | | public static String convertLink(String auctionId, String pid) { |
| | | TaoKeAppInfo app = APP_KEYS[1]; |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v1.1.1"); |
| | |
| | | * @param content |
| | | * @return |
| | | */ |
| | | public static Long parseTaoBaoToken(String content) { |
| | | public static String parseTaoBaoToken(String content) { |
| | | TaoKeAppInfo app = getRandomApp(); |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v1.0.0"); |
| | |
| | | if (resultObj.optInt("code") == 0) { |
| | | String goodsId = resultObj.optJSONObject("data").optString("goodsId"); |
| | | if (!StringUtil.isNullOrEmpty(goodsId)) { |
| | | return Long.parseLong(goodsId); |
| | | return goodsId; |
| | | } |
| | | } |
| | | return null; |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public static TaoBaoGoodsImportantInfo getGoodsImportantInfo(Long auctionId) { |
| | | public static TaoBaoGoodsImportantInfo getGoodsImportantInfo(String auctionId) { |
| | | |
| | | try { |
| | | TaoKeAppInfo app = getRandomApp(); |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v1.2.3"); |
| | |
| | | String detailPictures = resultObj.optJSONObject("data").optString("detailPics"); |
| | | String shopLogo = resultObj.optJSONObject("data").optString("shopLogo"); |
| | | taoBaoGoodsImportantInfo.setShopLogo(shopLogo); |
| | | JSONArray array = JSONArray.fromObject(detailPictures); |
| | | |
| | | List<TaoBaoImg> imgList = new ArrayList<>(); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(detailPictures)) { |
| | | JSONArray array = JSONArray.fromObject(detailPictures); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject item = array.optJSONObject(i); |
| | | String img = item.optString("img"); |
| | |
| | | imgList.add(taoBaoImg); |
| | | } |
| | | } |
| | | } |
| | | taoBaoGoodsImportantInfo.setDetailImages(imgList); |
| | | return taoBaoGoodsImportantInfo; |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("获取大淘客商品详情出错:" + auctionId, e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(4, null, 50); |
| | | System.out.println(result); |
| | | // DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(4, null, 50); |
| | | // System.out.println(result); |
| | | getGoodsImportantInfo(672479015817L+""); |
| | | |
| | | } |
| | | } |
| | |
| | | System.out.println(result); |
| | | } |
| | | |
| | | public String convertLink(Long auctionId, String pid, String activityId, String specialId, String relationId) { |
| | | public String convertLink(String auctionId, String pid, String activityId, String specialId, String relationId) { |
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>(); |
| | | params.add(new ParamsKeyValue("itemid", auctionId + "")); |
| | | params.add(new ParamsKeyValue("pid", pid)); |
| | |
| | | <groupId>com.yeshi</groupId> |
| | | <artifactId>utils</artifactId> |
| | | <version>0.0.2-SNAPSHOT</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-mongodb</artifactId> |
| | | </exclusion> |
| | | |
| | | <exclusion> |
| | | <groupId>org.mongodb</groupId> |
| | | <artifactId>mongo-java-driver</artifactId> |
| | | </exclusion> |
| | | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.yeshi</groupId> |
| | | <artifactId>goods.facade</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-mongodb</artifactId> |
| | | </exclusion> |
| | | |
| | | <exclusion> |
| | | <groupId>org.mongodb</groupId> |
| | | <artifactId>mongo-java-driver</artifactId> |
| | | </exclusion> |
| | | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>lib-common</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-mongodb</artifactId> |
| | | </exclusion> |
| | | |
| | | <exclusion> |
| | | <groupId>org.mongodb</groupId> |
| | | <artifactId>mongo-java-driver</artifactId> |
| | | </exclusion> |
| | | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <version>0.0.1</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>lib-common</artifactId> |
| | | <version>0.0.1</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | <dependency> |
| | |
| | | <!-- logback日志配置结束 --> |
| | | |
| | | |
| | | |
| | | <!-- kafka --> |
| | | |
| | | <dependency> |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <!-- 腾讯云日志采集CLS --> |
| | | <dependency> |
| | | <groupId>com.tencentcloudapi.cls</groupId> |
| | | <artifactId>tencentcloud-cls-logback-appender</artifactId> |
| | | <version>1.0.3</version> |
| | | <exclusions> |
| | | <!--<exclusion>--> |
| | | <!--<groupId>ch.qos.logback</groupId>--> |
| | | <!--<artifactId>*</artifactId>--> |
| | | <!--</exclusion>--> |
| | | |
| | | <!--<exclusion>--> |
| | | <!--<groupId>org.slf4j</groupId>--> |
| | | <!--<artifactId>*</artifactId>--> |
| | | <!--</exclusion>--> |
| | | |
| | | |
| | | <!--<exclusion>--> |
| | | <!--<groupId>com.google.guava</groupId>--> |
| | | <!--<artifactId>*</artifactId>--> |
| | | <!--</exclusion>--> |
| | | |
| | | <!--<exclusion>--> |
| | | <!--<groupId>com.google.errorprone</groupId>--> |
| | | <!--<artifactId>*</artifactId>--> |
| | | <!--</exclusion>--> |
| | | |
| | | <!--<exclusion>--> |
| | | <!--<groupId>com.google.code.gson</groupId>--> |
| | | <!--<artifactId>*</artifactId>--> |
| | | <!--</exclusion>--> |
| | | |
| | | <!--<exclusion>--> |
| | | <!--<groupId>com.google.protobuf</groupId>--> |
| | | <!--<artifactId>protobuf-java</artifactId>--> |
| | | <!--</exclusion>--> |
| | | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | </dependencies> |
| | |
| | | String callback = request.getParameter("callback"); |
| | | |
| | | String sign = request.getParameter("sign"); |
| | | Map<String, String> parameterMap = request.getParameterMap(); |
| | | Map<String, String[]> parameterMap = request.getParameterMap(); |
| | | // 参数-、sign 均不能为空 |
| | | if (parameterMap == null || StringUtil.isNullOrEmpty(sign)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("签名错误")); |
| | |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | private boolean signIsRight(String sign, Map<String, String> map, SystemEnum system) { |
| | | private boolean signIsRight(String sign, Map<String, String[]> map, SystemEnum system) { |
| | | int i = 0; |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | |
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData)); |
| | | |
| | | final String url = request.getRequestURI(); |
| | | @SuppressWarnings("unchecked") |
| | | final Map<String, Object> params = request.getParameterMap(); |
| | | @SuppressWarnings("unchecked") final Map<String, String[]> params = request.getParameterMap(); |
| | | ThreadUtil.run(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | private boolean signIsRight(HttpServletRequest request) { |
| | | Map<String, Object> map = request.getParameterMap(); |
| | | Map<String, String[]> map = request.getParameterMap(); |
| | | Iterator<String> its = map.keySet().iterator(); |
| | | List<String> list = new ArrayList<>(); |
| | | boolean fromWEB = false; |
| | |
| | | if (key.equalsIgnoreCase("sign") || key.equalsIgnoreCase("callback") || key.equalsIgnoreCase("_")) { |
| | | continue; |
| | | } |
| | | Object value = map.get(key); |
| | | Object[] values = (Object[]) value; |
| | | list.add(key + "=" + values[0].toString()); |
| | | String[] values = map.get(key); |
| | | list.add(key + "=" + values[0]); |
| | | } |
| | | Collections.sort(list); |
| | | String str = ""; |
| | |
| | | |
| | | final String url = request.getRequestURI(); |
| | | @SuppressWarnings("unchecked") |
| | | final Map<String, Object> params = request.getParameterMap(); |
| | | final Map<String, String[]> params = request.getParameterMap(); |
| | | ThreadUtil.run(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | private boolean signIsRight(HttpServletRequest request) { |
| | | Map<String, Object> map = request.getParameterMap(); |
| | | Map<String, String[]> map = request.getParameterMap(); |
| | | Iterator<String> its = map.keySet().iterator(); |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | |
| | | JSONObject item = array.optJSONObject(i); |
| | | String title = item.optString("itemName"); |
| | | String doc = item.optString("cusShareText"); |
| | | long itemId = item.optLong("itemId"); |
| | | String itemId = item.optString("itemId"); |
| | | String publishTime = item.optString("cusPublishTime"); |
| | | JSONArray imageArray = item.optJSONArray("imageList"); |
| | | List<String> imgList = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | @RequestMapping("getShareGoodsInfo") |
| | | public void getShareGoodsInfo(HttpServletRequest request, long uid, long id, String sign, PrintWriter out) { |
| | | public void getShareGoodsInfo(HttpServletRequest request, long uid, String id, String sign, PrintWriter out) { |
| | | |
| | | if (!StringUtil.Md5("" + uid + id + Constant.WEBPAGE_SIGN_KEY).equalsIgnoreCase(sign)) { |
| | | out.print(JsonUtil.loadFalseResult(-1, "签名错误")); |
| | |
| | | } |
| | | |
| | | try { |
| | | OPPOPushUtil.pushGoods(registerIds, "测试商品网页推送", "测试商品推送内容", 1, 577628549116L, androidBaseActivity); |
| | | OPPOPushUtil.pushGoods(registerIds, "测试商品网页推送", "测试商品推送内容", 1, 577628549116L+"", androidBaseActivity); |
| | | } catch (PushException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | } |
| | | |
| | | @RequestMapping("getTBGoodsCate") |
| | | public void getTaoBaoGoodsCat(Long id, PrintWriter out) { |
| | | public void getTaoBaoGoodsCat(String id, PrintWriter out) { |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = TaoKeApiUtil.getSimpleGoodsInfo(id); |
| | |
| | | TaoBaoCouponCache cache = new TaoBaoCouponCache(); |
| | | cache.setActivityId("123123123"); |
| | | cache.setPid("mm_12_12_12"); |
| | | cache.setAuctionId(123123L); |
| | | cache.setAuctionId(123123L+""); |
| | | taoBaoCouponCacheService.save(cache); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | JSONArray array = JSONArray.fromObject(actionIds); |
| | | List<Long> auctionIds = new ArrayList<>(); |
| | | List<String> auctionIds = new ArrayList<>(); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | auctionIds.add(array.optLong(i)); |
| | | auctionIds.add(array.optString(i)); |
| | | } |
| | | |
| | | try { |
| | |
| | | |
| | | |
| | | JSONArray array = JSONArray.fromObject(actionIds); |
| | | List<Long> auctionIds = new ArrayList<>(); |
| | | List<String> auctionIds = new ArrayList<>(); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | auctionIds.add(array.optLong(i)); |
| | | auctionIds.add(array.optString(i)); |
| | | } |
| | | try { |
| | | activityService.updateShareGoodsRecommendActivity(uid, auctionIds, activity); |
| | |
| | | * 更新邀请动态 |
| | | * |
| | | * @param callback |
| | | * @param id |
| | | * @param uid |
| | | * @param title |
| | | * @param img |
| | | * @param top |
| | | * @param shareCount |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "updateInviteActivity") |
| | |
| | | return; |
| | | } |
| | | } else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(commonGoods.getGoodsId()); |
| | | JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong( commonGoods.getGoodsId())); |
| | | goodsDetail = GoodsDetailVOFactory.convertJDGoods(goodsInfo, params); |
| | | } else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(commonGoods.getGoodsId()); |
| | | PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(commonGoods.getGoodsId())); |
| | | goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goodsInfo, params); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param callback |
| | | * @param labIds |
| | | * @param goodIds |
| | | * @param request |
| | | * @param out |
| | | */ |
| | |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | List<Long> goodsIdList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {}.getType()); |
| | | List<String> goodsIdList = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {}.getType()); |
| | | if (goodsIdList == null || goodsIdList.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择需操作的商品")); |
| | | return; |
| | |
| | | } |
| | | |
| | | // 单个处理 |
| | | Long goodsId = goodsIdList.get(0); |
| | | String goodsId = goodsIdList.get(0); |
| | | labelGoodsService.singleGoodsAddLables(goodsId, labIdList, admin); |
| | | } else { |
| | | if (StringUtil.isNullOrEmpty(labIds)) { |
| | |
| | | * |
| | | * @param callback |
| | | * @param labIds |
| | | * @param goodIds |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "singleGoodsAddLables") |
| | | public void singleGoodsAddLables(AdminAcceptData acceptData,String callback, String labIds, Long goodsId, |
| | | public void singleGoodsAddLables(AdminAcceptData acceptData,String callback, String labIds, String goodsId, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | |
| | | try { |
| | |
| | | * 新增/修改 |
| | | * |
| | | * @param callback |
| | | * @param special |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "save") |
| | |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType()); |
| | | List<String> list = gson.fromJson(idArray, new TypeToken<ArrayList<String>>() {}.getType()); |
| | | |
| | | convertVersion(pushGoods, arrayIOS, arrayAndroid); |
| | | |
| | |
| | | * 新增/修改 |
| | | * |
| | | * @param callback |
| | | * @param special |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveInfo") |
| | |
| | | * 查询 |
| | | * |
| | | * @param callback |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param key |
| | | * 模糊查询:说明、标识 |
| | | * @param out |
| | | */ |
| | |
| | | * 保存修改精品库商品关联信息 |
| | | * |
| | | * @param callback |
| | | * @param label |
| | | * @param request |
| | | * @param out |
| | | */ |
| | |
| | | public void removeGoods(AdminAcceptData acceptData,String callback, String ids, PrintWriter out) { |
| | | try { |
| | | Gson gson = new Gson(); |
| | | List<Long> goodsIds = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() { |
| | | List<String> goodsIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() { |
| | | }.getType()); |
| | | |
| | | if (goodsIds == null || goodsIds.size() == 0) { |
| | |
| | | Long id = taoBaoGoodsBrief.getId(); |
| | | idBuf.append(id + ","); |
| | | |
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (auctionId != null) { |
| | | j++; |
| | | auctionIdBuf.append(auctionId + ","); |
| | |
| | | |
| | | /* 商品销售状态: 0 在售 1停售 */ |
| | | int saleStae = 1; |
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (auctionId != null) { |
| | | if (goodsBriefList != null && goodsBriefList.size() > 0) { |
| | | for (TaoBaoGoodsBrief tb : goodsBriefList) { |
| | | Long auctionIdTB = tb.getAuctionId(); |
| | | String auctionIdTB = tb.getAuctionId(); |
| | | if (auctionId.equals(auctionIdTB)) { |
| | | saleStae = 0; |
| | | } |
| | |
| | | } |
| | | |
| | | /* 商品标签列表 */ |
| | | Long id = taoBaoGoodsBrief.getId(); |
| | | String id = taoBaoGoodsBrief.getAuctionId(); |
| | | int totalLabels = labelGoodsService.getCountQueryByGoodsId(id); |
| | | |
| | | // List<LabelGoods> labelList = labelService.getByGoodsId(id); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "addGoodsLable") |
| | | public void addGoodsLable(AdminAcceptData acceptData,String callback, Long id, Long labId, HttpServletRequest request, PrintWriter out) { |
| | | public void addGoodsLable(AdminAcceptData acceptData,String callback, String id, Long labId, HttpServletRequest request, PrintWriter out) { |
| | | |
| | | try { |
| | | // 获取当前操作用户 |
| | |
| | | return; |
| | | } |
| | | |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = taoBaoGoodsBriefService.selectByPrimaryKey(id); |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = taoBaoGoodsBriefService.selectByGoodsId(id); |
| | | if (taoBaoGoodsBrief == null) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("该商品已不存在"))); |
| | | return; |
| | |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() { |
| | | List<String> idList = gson.fromJson(ids, new TypeToken<ArrayList<String>>() { |
| | | }.getType()); |
| | | if (idList == null || idList.size() == 0) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请传递正确参数:102"))); |
| | |
| | | return; |
| | | } |
| | | |
| | | Long id = idList.get(0); |
| | | String id = idList.get(0); |
| | | |
| | | if (id == null) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请传递正确参数:104"))); |
| | |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param key |
| | | * @param id |
| | | * @param request |
| | | * @param out |
| | | */ |
| | |
| | | } |
| | | |
| | | // 插入商品集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : listTaoBaoGoods) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | int existence = 0; |
| | | |
| | | /* 查询商品是否已存在商品精选库中 */ |
| | | Long localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (localAuctionId != null) { |
| | | if (listHas != null && listHas.size() > 0) { |
| | | for (QualityFactory selectionGoods : listHas) { |
| | | TaoBaoGoodsBrief hasgoodsBrief = selectionGoods.getTaoBaoGoodsBrief(); |
| | | Long hasId = hasgoodsBrief.getAuctionId(); |
| | | if (localAuctionId.equals(hasId) || localAuctionId == hasId) { |
| | | String hasId = hasgoodsBrief.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual( localAuctionId,hasId)) { |
| | | existence = 1; // 存在商品中 |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | Gson gson2 = new Gson(); |
| | | List<Long> listTaoBaoId = gson2.fromJson(auctionIds, new TypeToken<ArrayList<Long>>() { |
| | | List<String> listTaoBaoId = gson2.fromJson(auctionIds, new TypeToken<ArrayList<String>>() { |
| | | }.getType()); |
| | | if (listTaoBaoId == null || listTaoBaoId.size() == 0) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请选择正确的商品入库"))); |
| | |
| | | |
| | | List<TaoBaoGoodsBrief> listAddGoods = new ArrayList<TaoBaoGoodsBrief>(); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listTaoBaoGoods) { |
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (listTaoBaoId.contains(auctionId)) { |
| | | listAddGoods.add(taoBaoGoodsBrief); |
| | | listTaoBaoId.remove(auctionId); |
| | |
| | | } |
| | | |
| | | if (listTaoBaoId != null && listTaoBaoId.size() > 0) { |
| | | for (Long auctionId : listTaoBaoId) { |
| | | for (String auctionId : listTaoBaoId) { |
| | | /* 根据auctionId 获取淘宝商品 */ |
| | | TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(auctionId); |
| | | if (goodsBrief != null) { |
| | |
| | | } |
| | | |
| | | boolean islink = false; |
| | | Long auctionId = null; |
| | | String auctionId = null; |
| | | /* 判断是否是商品链接搜索 */ |
| | | if (key != null && key.contains("//") && key.contains("&")) { |
| | | String[] keyArray = key.split("\\?")[1].split("&"); |
| | | if (keyArray != null && keyArray.length > 0) { |
| | | String id = keyArray[0].replace("id=", "").trim(); |
| | | if (!StringUtil.isNullOrEmpty(id)) { |
| | | auctionId = Long.parseLong(id); |
| | | auctionId = id; |
| | | islink = true; |
| | | } |
| | | } |
| | |
| | | int existence = 0; |
| | | |
| | | /* 查询商品是否已存在商品精选库中 */ |
| | | Long localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | |
| | | if (localAuctionId != null) { |
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefList = taoBaoGoodsBriefService |
| | |
| | | TaoBaoGoodsBrief goodsBrief = taoBaoGoodsBriefList.get(0); |
| | | |
| | | if (goodsBrief != null) { |
| | | Long id = goodsBrief.getId(); |
| | | String id = goodsBrief.getAuctionId(); |
| | | // 查询精选库 |
| | | Long has = qualityFactoryService.queryCountByGoodsId(id); |
| | | |
| | |
| | | * |
| | | * @param callback |
| | | * @param pageIndex |
| | | * @param key |
| | | * 关键词 |
| | | * @param startPrice |
| | | * 价格小值 |
| | | * @param endPrice |
| | | * 价格大值 |
| | | * @param startTkRate |
| | | * 佣金小值 |
| | | * @param endTkRate |
| | | * 佣金大值 |
| | | * @param sort |
| | | * 排序 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "searchMaterial") |
| | |
| | | } |
| | | |
| | | // 插入商品集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : taoBaoGoodsBriefs) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | int existence = 0; |
| | | |
| | | /* 查询商品是否已存在商品精选库中 */ |
| | | Long localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (localAuctionId != null) { |
| | | if (listHas != null && listHas.size() > 0) { |
| | | for (QualityFactory selectionGoods : listHas) { |
| | | TaoBaoGoodsBrief hasgoodsBrief = selectionGoods.getTaoBaoGoodsBrief(); |
| | | Long hasId = hasgoodsBrief.getAuctionId(); |
| | | if (localAuctionId.equals(hasId) || localAuctionId == hasId) { |
| | | String hasId = hasgoodsBrief.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual( localAuctionId,hasId)) { |
| | | existence = 1; // 存在商品中 |
| | | } |
| | | } |
| | |
| | | private List<Map<String, Object>> filterTaoBaoGoodsWithQulity(List<TaoBaoGoodsBrief> goodsList) { |
| | | |
| | | // 插入商品集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsList) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | int existence = 0; |
| | | |
| | | /* 查询商品是否已存在商品精选库中 */ |
| | | Long localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (localAuctionId != null) { |
| | | if (listHas != null && listHas.size() > 0) { |
| | | for (QualityFactory selectionGoods : listHas) { |
| | | TaoBaoGoodsBrief hasgoodsBrief = selectionGoods.getTaoBaoGoodsBrief(); |
| | | Long hasId = hasgoodsBrief.getAuctionId(); |
| | | if (localAuctionId.equals(hasId) || localAuctionId == hasId) { |
| | | String hasId = hasgoodsBrief.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual(localAuctionId,hasId)) { |
| | | existence = 1; // 存在商品中 |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 插入商品集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : taoBaoGoodsBriefs) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | int existence = 0; |
| | | |
| | | /* 查询商品是否已存在商品精选库中 */ |
| | | Long localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String localAuctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | if (localAuctionId != null) { |
| | | if (listHas != null && listHas.size() > 0) { |
| | | for (QualityFactory selectionGoods : listHas) { |
| | | TaoBaoGoodsBrief hasgoodsBrief = selectionGoods.getTaoBaoGoodsBrief(); |
| | | Long hasId = hasgoodsBrief.getAuctionId(); |
| | | if (localAuctionId.equals(hasId) || localAuctionId == hasId) { |
| | | String hasId = hasgoodsBrief.getAuctionId(); |
| | | if ( TaoBaoUtil.isEqual(localAuctionId,hasId)) { |
| | | existence = 1; // 存在商品中 |
| | | } |
| | | } |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping("getFlashSale") |
| | | public void getFlashSale(AcceptData acceptData, String callback, Integer page, Long auctionId, PrintWriter out) { |
| | | public void getFlashSale(AcceptData acceptData, String callback, Integer page, String auctionId, PrintWriter out) { |
| | | |
| | | if (page == null) |
| | | page = 1; |
| | |
| | | } |
| | | |
| | | @RequestMapping("getFlashSaleNew") |
| | | public void getFlashSaleNew(AcceptData acceptData, String callback, Integer page, Long auctionId, String time, PrintWriter out) { |
| | | public void getFlashSaleNew(AcceptData acceptData, String callback, Integer page, String auctionId, String time, PrintWriter out) { |
| | | List<DaTaoKeDetailV2> detailList0 = daTaoKeGoodsDetailV2Service.getDingDongQiangData(time); |
| | | if (detailList0 == null) |
| | | detailList0 = new ArrayList<>(); |
| | |
| | | if (page == 1) { |
| | | if (auctionId != null && detailList != null) |
| | | for (int i = 0; i < detailList.size(); i++) { |
| | | if (detailList.get(i).getGoodsId().longValue() == auctionId) { |
| | | if ( TaoBaoUtil.isEqual(detailList.get(i).getGoodsId(), auctionId)) { |
| | | DaTaoKeDetailV2 goods = detailList.get(i); |
| | | detailList.remove(i); |
| | | detailList.add(0, goods); |
| | |
| | | return; |
| | | } |
| | | |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (QualityFactory qualityFactory : listQuery) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief(); |
| | | |
| | |
| | | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | boolean stateSale = false; // 默认停售 |
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | String goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | stateSale = true; // 在售 |
| | | break; |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.JsonUtil; |
| | |
| | | * |
| | | * @param callback |
| | | * @param shareId 分享id |
| | | * @param source 来源 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getList") |
| | |
| | | |
| | | List<UserShareGoodsGroup> list = userShareGoodsRecordService.listByRecordId(shareId); |
| | | if (list != null && list.size() > 0) { |
| | | List<Long> listIdTB = new ArrayList<Long>(); |
| | | List<String> listIdTB = new ArrayList<>(); |
| | | List<Long> listIdJD = new ArrayList<Long>(); |
| | | List<Long> listIdPDD = new ArrayList<Long>(); |
| | | |
| | |
| | | if (Constant.SOURCE_TYPE_TAOBAO == goodsType) { |
| | | listIdTB.add(commonGoods.getGoodsId()); |
| | | } else if (Constant.SOURCE_TYPE_JD == goodsType) { |
| | | listIdJD.add(commonGoods.getGoodsId()); |
| | | listIdJD.add(Long.parseLong(commonGoods.getGoodsId())); |
| | | } else if (Constant.SOURCE_TYPE_PDD == goodsType) { |
| | | listIdPDD.add(commonGoods.getGoodsId()); |
| | | listIdPDD.add(Long.parseLong(commonGoods.getGoodsId())); |
| | | } |
| | | } |
| | | |
| | |
| | | if (goodsType == null) { |
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO; |
| | | } |
| | | Long commonGid = commonGoods.getGoodsId(); |
| | | String commonGid = commonGoods.getGoodsId(); |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO && listTB != null && listTB.size() > 0) { |
| | | int state = 1; // 默认停售 |
| | | for (TaoBaoGoodsBrief goodsDetail : listTB) { |
| | | Long goodsId = goodsDetail.getAuctionId(); |
| | | if (goodsId == commonGid || goodsId.equals(commonGid)) { |
| | | String goodsId = goodsDetail.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual(goodsId, commonGid)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | int state = 1; // 默认停售 |
| | | for (JDGoods goodsDetail : listJD) { |
| | | Long goodsId = goodsDetail.getSkuId(); |
| | | if (goodsId == commonGid || goodsId.equals(commonGid)) { |
| | | if (goodsId == Long.parseLong(commonGid)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | int state = 1; // 默认停售 |
| | | for (PDDGoodsDetail goodsDetail : listPDD) { |
| | | Long goodsId = goodsDetail.getGoodsId(); |
| | | if (goodsId == commonGid || goodsId.equals(commonGid)) { |
| | | if (goodsId == Long.parseLong(commonGid)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | TaoBaoGoodsBrief goods = getTaoBaoGoods(Long.parseLong(goodsId)); |
| | | TaoBaoGoodsBrief goods = getTaoBaoGoods(goodsId); |
| | | |
| | | //加载资金信息 |
| | | com.yeshi.fanli.vo.goods.GoodsDetailVO goodsDetailVO1 = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | |
| | | GoodsDetailVOLijinFactory.fillRights(goodsDetailVO.getGoods()); |
| | | |
| | | // 店铺信息 |
| | | TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getId(), goods.getSellerId()); |
| | | TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getAuctionId(), goods.getSellerId()); |
| | | if (shop != null) { |
| | | String shopLink = shop.getShopLink(); |
| | | if (StringUtil.isNullOrEmpty(shopLink)) { |
| | |
| | | //是否收藏 |
| | | extraVO.setCollected(false); |
| | | if (uid != null) { |
| | | CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsType == Constant.SOURCE_TYPE_SUNING ? goodsIdSuning : Long.parseLong(goodsDetailVO.getGoods().getGoodsId()), goodsType); |
| | | CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsType == Constant.SOURCE_TYPE_SUNING ? goodsIdSuning+"" : goodsDetailVO.getGoods().getGoodsId(), goodsType); |
| | | if (collectionGoodsV2 != null) { |
| | | extraVO.setCollected(true); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private TaoBaoGoodsBrief getTaoBaoGoods(Long id) { |
| | | private TaoBaoGoodsBrief getTaoBaoGoods(String id) { |
| | | try { |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(id); |
| | | if (goods != null) { |
| | |
| | | |
| | | if (listGoodsBrief.size() > 0) { |
| | | for (int i = 0; i < listGoods.size(); i++) { |
| | | long id = listGoods.get(i).getAuctionId(); |
| | | String id = listGoods.get(i).getAuctionId(); |
| | | boolean isRepeat = false; |
| | | for (TaoBaoGoodsBrief goodsBrief : listGoodsBrief) { |
| | | long auctionId = goodsBrief.getAuctionId(); |
| | | if (auctionId == id) { |
| | | String auctionId = goodsBrief.getAuctionId(); |
| | | if (auctionId.equalsIgnoreCase( id)) { |
| | | isRepeat = true; |
| | | break; |
| | | } |
| | |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | if (listGoodsBrief.size() > 0) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { |
| | | listGid.add(taoBaoGoodsBrief.getAuctionId()); |
| | | } |
| | |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | boolean stateSale = false; // 默认停售 |
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | String goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | stateSale = true; // 在售 |
| | | break; |
| | |
| | | * 粘贴板信息推荐 |
| | | * |
| | | * @param acceptData |
| | | * @param url |
| | | * 商品链接 |
| | | * @param out |
| | | */ |
| | |
| | | List<String> tokenList = TaoBaoUtil.getTokenListFromText(text); |
| | | if (tokenList != null && tokenList.size() > 0) { |
| | | String token = tokenList.get(0); |
| | | Long auctionId = taoBaoTokenAuctionIdMapManager.getAuctionIdByToken(token); |
| | | String auctionId = taoBaoTokenAuctionIdMapManager.getAuctionIdByToken(token); |
| | | if (auctionId != null) { |
| | | TaoBaoGoodsBrief tb = null; |
| | | try { |
| | |
| | | @Resource |
| | | private UserFunctionsLimitService userFunctionsLimitService; |
| | | |
| | | private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) { |
| | | private void doTaoLiJinBuy(AcceptData acceptData, Long uid, String auctionId, PrintWriter out) { |
| | | JSONObject data = new JSONObject(); |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | |
| | | } |
| | | |
| | | |
| | | private void getTaoBaoLinkWithoutFanLi(AcceptData acceptData, Long auctionId, String from, String source, |
| | | private void getTaoBaoLinkWithoutFanLi(AcceptData acceptData, String auctionId, String from, String source, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | |
| | | try { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "gettaobaolink") |
| | | public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId, String from, String source, |
| | | public void getTaoBaoLink(AcceptData acceptData, Long uid, String auctionId, String from, String source, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | |
| | | if (auctionId == null || auctionId <= 0) { |
| | | if (StringUtil.isNullOrEmpty(auctionId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "商品ID不能为空")); |
| | | return; |
| | | } |
| | |
| | | if ("TB".equalsIgnoreCase(goodsType)) { |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(goodsId)); |
| | | goods = TaoKeApiUtil.getSimpleGoodsInfo(goodsId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "deleteRecommendGoods") |
| | | public void deleteRecommendGoods(AcceptData acceptData, Long goodsId, Integer source, Long uid, String reason, |
| | | public void deleteRecommendGoods(AcceptData acceptData, String goodsId, Integer source, Long uid, String reason, |
| | | PrintWriter out) { |
| | | if (goodsId == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "请上传商品")); |
| | |
| | | |
| | | TaoBaoGoodsBrief simpleGoods = null; |
| | | try { |
| | | simpleGoods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | simpleGoods = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (NumberFormatException e2) { |
| | | e2.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e2) { |
| | |
| | | app.setAppKey(clientTBPid.getAppKey()); |
| | | app.setAppSecret(config.getAppSecret()); |
| | | app.setPid(clientTBPid.getPid()); |
| | | tb = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app); |
| | | tb = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | } catch (NumberFormatException e1) { |
| | | e1.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e1) { |
| | |
| | | taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl()); |
| | | if (uid != null && !"".equals(uid.trim())) { |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), |
| | | Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO); |
| | | id, Constant.SOURCE_TYPE_TAOBAO); |
| | | data.put("collection", collectionGoods != null ? true : false); |
| | | } |
| | | |
| | |
| | | app.setAppSecret(config.getAppSecret()); |
| | | app.setPid(clientPid); |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | if (goods != null) { |
| | | ticket.put("clickUrl", goods.getAuctionUrl()); |
| | | // 测试使用 |
| | |
| | | } |
| | | } else { |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | goods = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "商品下架")); |
| | |
| | | // 商品下架 |
| | | ThreadUtil.run(new Runnable() { |
| | | public void run() { |
| | | taoBaoGoodsUpdateService.deleteTaoBaoGoods(Long.parseLong(id)); |
| | | taoBaoGoodsUpdateService.deleteTaoBaoGoods(id); |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | } |
| | | } else if (task.equalsIgnoreCase("imgs")) {// 获取图文详情 |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(Long.parseLong(id), acceptData.getSystem()); |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(id, acceptData.getSystem()); |
| | | if (imgs != null && imgs.size() > 0) { |
| | | detailImgs.clear(); |
| | | detailImgsSize.clear(); |
| | |
| | | // 判断收藏 |
| | | if (!StringUtil.isNullOrEmpty(uid)) { |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), |
| | | Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO); |
| | | id, Constant.SOURCE_TYPE_TAOBAO); |
| | | data.put("collected", collectionGoods != null ? true : false); |
| | | } else |
| | | data.put("collected", false); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "gettaobaolink") |
| | | public void getTaobaoLink(AcceptData acceptData, String uid, Long id, PrintWriter out) { |
| | | public void getTaobaoLink(AcceptData acceptData, String uid, String id, PrintWriter out) { |
| | | ClientTBPid clientTBPid = null; |
| | | // 用户已经登录 |
| | | if (!StringUtil.isNullOrEmpty(uid)) { |
| | |
| | | |
| | | // 根据商品获取推荐 |
| | | @RequestMapping(value = "getgoodsrecommend", method = RequestMethod.POST) |
| | | public void getGoodsRecommend(final AcceptData acceptData, long id, PrintWriter out) { |
| | | public void getGoodsRecommend(final AcceptData acceptData, String id, PrintWriter out) { |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | | if (system == null) { |
| | |
| | | // } |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | goods = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getgoodsinfo", method = RequestMethod.POST) |
| | | public void getGoodsInfo(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) { |
| | | public void getGoodsInfo(AcceptData acceptData, String id, Long uid, String from, PrintWriter out) { |
| | | |
| | | if (id == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id")); |
| | |
| | | List<String> detailImgs = new ArrayList<>(); |
| | | JSONArray detailImgsSize = new JSONArray(); |
| | | |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(Long.parseLong(id), acceptData.getSystem()); |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(id, acceptData.getSystem()); |
| | | |
| | | if (imgs != null && imgs.size() > 0) { |
| | | |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getgoodsderivation", method = RequestMethod.POST) |
| | | public void getRecommendGoods(AcceptData acceptData, long id, PrintWriter out) { |
| | | public void getRecommendGoods(AcceptData acceptData, String id, PrintWriter out) { |
| | | |
| | | try { |
| | | |
| | |
| | | app.setPid(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_TAOBAO, SystemPIDInfo.PidType.fanli)); |
| | | app.setAdzoneId(app.getPid().split("_")[3]); |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | List<String> ids = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : goodsList) |
| | | ids.add(goods.getAuctionId()); |
| | | |
| | |
| | | } |
| | | }); |
| | | |
| | | List<TaoBaoGoodsBrief> listQuality = new ArrayList<TaoBaoGoodsBrief>(); |
| | | List<TaoBaoGoodsBrief> listQuality = new ArrayList<>(); |
| | | |
| | | // 取偶数个数据 |
| | | if (listExtra.size() % 2 != 0) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "gettaobaosharelink") |
| | | public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, String source, Integer totalNum, |
| | | public void getTaobaoShareLink(AcceptData acceptData, Long uid, String auctionId, String source, Integer totalNum, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | |
| | | if (uid == null || uid <= 0) { |
| | |
| | | return; |
| | | } |
| | | |
| | | if (auctionId == null || auctionId <= 0) { |
| | | if (StringUtil.isNullOrEmpty( auctionId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "商品ID不能为空")); |
| | | return; |
| | | } |
| | |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void createTaoLijin(Long uid, Long auctionId, int totalNum, String relationId, SystemEnum system, HttpServletRequest request, |
| | | public void createTaoLijin(Long uid, String auctionId, int totalNum, String relationId, SystemEnum system, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | try { |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoLiJinLinkForShare(system, uid, auctionId, relationId, null); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "sharedetail", method = RequestMethod.POST) |
| | | public void shareDetail(AcceptData acceptData, Long uid, Long auctionId, String type, PrintWriter out) { |
| | | public void shareDetail(AcceptData acceptData, Long uid, String auctionId, String type, PrintWriter out) { |
| | | try { |
| | | userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO); |
| | | out.print(JsonUtil.loadTrueResult("分享成功")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "viewShareTextTemplate", method = RequestMethod.POST) |
| | | public void preViewShareTextTemplate(AcceptData acceptData, Long uid, String template, Long goodsId, Long tljId, |
| | | public void preViewShareTextTemplate(AcceptData acceptData, Long uid, String template, String goodsId, Long tljId, |
| | | Boolean hasCoupon, PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "resetShareTextTemplate", method = RequestMethod.POST) |
| | | public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Long tljId, Boolean hasCoupon, |
| | | public void resetShareTextTemplate(AcceptData acceptData, Long uid, String goodsId, Long tljId, Boolean hasCoupon, |
| | | PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | |
| | | dynamicInfo.getListGoodsBrief()); |
| | | data.put("shareId", shareRecord.getRedisKey()); |
| | | |
| | | Long auctionId = dynamicInfo.getImgs().get(0).getGoods().getAuctionId(); |
| | | String auctionId = dynamicInfo.getImgs().get(0).getGoods().getAuctionId(); |
| | | // 商品分享链接 |
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(acceptData.getSystem()), |
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodsCouponList", method = RequestMethod.POST) |
| | | public void getGoodsCouponList(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) { |
| | | public void getGoodsCouponList(AcceptData acceptData, Long uid, String auctionId, PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | |
| | | BigDecimal priceLimit = BigDecimal.valueOf(9.9); |
| | | switch (goodsType) { |
| | | case Constant.SOURCE_TYPE_TAOBAO: |
| | | state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit); |
| | | state = checkCanUsedTB(goodsId, priceLimit); |
| | | break; |
| | | case Constant.SOURCE_TYPE_JD: |
| | | state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit); |
| | | state = checkCanUsedTB(goodsId, priceLimit); |
| | | break; |
| | | case Constant.SOURCE_TYPE_PDD: |
| | | state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit); |
| | | state = checkCanUsedTB(goodsId, priceLimit); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | |
| | | |
| | | private boolean checkCanUsedTB(Long goodsId, BigDecimal priceLimit) { |
| | | private boolean checkCanUsedTB(String goodsId, BigDecimal priceLimit) { |
| | | try { |
| | | TaoBaoGoodsBrief goods = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | | if (goods == null) |
| | |
| | | /** |
| | | * 单个商品加入选品库 |
| | | * |
| | | * @param callback |
| | | * @param storageIds |
| | | * id数组 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "accordtorage", method = RequestMethod.POST) |
| | | public void accordtorage(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) { |
| | | public void accordtorage(AcceptData acceptData, Long uid, String auctionId, PrintWriter out) { |
| | | |
| | | if (auctionId == null) { |
| | | out.print(JsonUtil.loadFalseResult("未选择商品")); |
| | |
| | | userGoodsStorageService.deleteByPrimaryKey(userGoodsStorage.getId()); |
| | | } else { |
| | | // 加入选品库 |
| | | Set<Long> set = new HashSet<Long>(); |
| | | Set<String> set = new HashSet<>(); |
| | | set.add(auctionId); |
| | | userGoodsStorageService.save(uid, set, Constant.SOURCE_TYPE_TAOBAO); |
| | | storageState = true; |
| | |
| | | * @param acceptData |
| | | * @param uid |
| | | * 用户id |
| | | * @param auctionId |
| | | * 淘宝商品id |
| | | * @param out |
| | | */ |
| | |
| | | public void addStorage(AcceptData acceptData, Long uid, String auctionIds, Integer goodsType,PrintWriter out) { |
| | | try { |
| | | Gson gson = new Gson(); |
| | | Set<Long> set = gson.fromJson(auctionIds, new TypeToken<HashSet<Long>>() {}.getType()); |
| | | Set<String> set = gson.fromJson(auctionIds, new TypeToken<HashSet<String>>() {}.getType()); |
| | | if (set == null || set.size() == 0) { |
| | | out.print(JsonUtil.loadFalseResult("未选择商品")); |
| | | return; |
| | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param callback |
| | | * @param storageIds |
| | | * id数组 |
| | | * @param out |
| | |
| | | /** |
| | | * 分享商品返回二维码图片 |
| | | * |
| | | * @param callback |
| | | * @param storageIds |
| | | * id数组 |
| | | * @param out |
| | |
| | | } |
| | | |
| | | @RequestMapping("collectionGoods") |
| | | public void collectionGoods(AcceptData acceptData, long uid, long auctionId, int type, PrintWriter out) { |
| | | public void collectionGoods(AcceptData acceptData, long uid, String auctionId, int type, PrintWriter out) { |
| | | try { |
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId, |
| | | Constant.SOURCE_TYPE_TAOBAO); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping("collectionGoodsJp") |
| | | public void collectionGoodsJp(String callback, AcceptData acceptData, Long uid, Long auctionId, Integer goodsType, |
| | | public void collectionGoodsJp(String callback, AcceptData acceptData, Long uid, String auctionId, Integer goodsType, |
| | | PrintWriter out) { |
| | | |
| | | if (uid == null || auctionId == null) { |
| | |
| | | |
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate(acceptData.getSystem()); |
| | | |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) { |
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods(); |
| | | if (commonGoods == null) { |
| | |
| | | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | |
| | | if (!StringUtil.isNullOrEmpty(ids)) { |
| | | Arrays.asList(ids.split(",")).parallelStream().forEach(auctionIdStr -> { |
| | | try { |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, Long.parseLong(auctionIdStr), |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, (auctionIdStr), |
| | | goodsType); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | return; |
| | | } |
| | | |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (QualityFactory qualityFactory : listQuery) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief(); |
| | | if (taoBaoGoodsBrief == null) { |
| | |
| | | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | boolean stateSale = false; // 默认停售 |
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | String goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual( goodsId , auctionId) ) { |
| | | stateSale = true; // 在售 |
| | | break; |
| | | } |
| | |
| | | |
| | | if (listGoodsBrief.size() > 0) { |
| | | for (int i = 0; i < listGoods.size(); i++) { |
| | | long id = listGoods.get(i).getAuctionId(); |
| | | String id = listGoods.get(i).getAuctionId(); |
| | | boolean isRepeat = false; |
| | | for (TaoBaoGoodsBrief goodsBrief : listGoodsBrief) { |
| | | long auctionId = goodsBrief.getAuctionId(); |
| | | String auctionId = goodsBrief.getAuctionId(); |
| | | if (auctionId == id) { |
| | | isRepeat = true; |
| | | break; |
| | |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | if (listGoodsBrief.size() > 0) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { |
| | | listGid.add(taoBaoGoodsBrief.getAuctionId()); |
| | | } |
| | |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | boolean stateSale = false; // 默认停售 |
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | String goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | stateSale = true; // 在售 |
| | | break; |
| | |
| | | |
| | | if (listGoodsBrief.size() > 0) { |
| | | for (int i = 0; i < listGoods.size(); i++) { |
| | | long aid = listGoods.get(i).getAuctionId(); |
| | | String aid = listGoods.get(i).getAuctionId(); |
| | | boolean isRepeat = false; |
| | | for (TaoBaoGoodsBrief goodsBrief : listGoodsBrief) { |
| | | long auctionId = goodsBrief.getAuctionId(); |
| | | if (auctionId == aid) { |
| | | String auctionId = goodsBrief.getAuctionId(); |
| | | if (auctionId == aid||auctionId.equals(aid)) { |
| | | isRepeat = true; |
| | | break; |
| | | } |
| | |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | if (listGoodsBrief.size() > 0) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { |
| | | listGid.add(taoBaoGoodsBrief.getAuctionId()); |
| | | } |
| | |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | boolean stateSale = false; // 默认停售 |
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | String goodsId = taoBaoGoodsBrief.getAuctionId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | stateSale = true; // 在售 |
| | | break; |
| | |
| | | @RequestMapping(value = "getShowAd") |
| | | public void showAd(AcceptData acceptData, Long uid, PrintWriter out) { |
| | | String value = configService.getValue(ConfigKeyEnum.showSplashAd.getKey(), acceptData.getSystem()); |
| | | |
| | | boolean show = false; |
| | | try { |
| | | JSONObject configData = JSONObject.fromObject(value); |
| | | if (configData != null) { |
| | | String channel = acceptData.getChannel().toLowerCase(); |
| | | if (configData.optString(channel) == null) { |
| | | channel = "qq"; |
| | | } |
| | | int version = configData.optInt(channel); |
| | | JSONObject data = new JSONObject(); |
| | | boolean show; |
| | | |
| | | |
| | | if (Integer.parseInt(acceptData.getVersion()) >= version) { |
| | | show = false; |
| | | } else { |
| | | show = true; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (show) { |
| | | data.put("show", true); |
| | | //加载广告数据 |
| | |
| | | if (type != 1) { |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | String[] sts = SuningUtil.getGoodsIdDetail(id); |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, Long.parseLong(sts[1]), goodsType); |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, sts[1], goodsType); |
| | | } else |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, Long.parseLong(id), goodsType); |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, id, goodsType); |
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功")); |
| | | return; |
| | | } |
| | | Long goodsId = null; |
| | | String goodsId = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | String[] sts = SuningUtil.getGoodsIdDetail(id); |
| | | goodsId = Long.parseLong(sts[1]); |
| | | goodsId =sts[1]; |
| | | } else |
| | | goodsId = Long.parseLong(id); |
| | | goodsId = id; |
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsId, goodsType); |
| | | if (find != null) { |
| | | out.print(JsonUtil.loadFalseResult("")); |
| | |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (jdGoods == null) { |
| | | jdGoods = JDApiUtil.getGoodsDetail(goodsId); |
| | | jdGoods = JDApiUtil.getGoodsDetail(Long.parseLong(goodsId)); |
| | | } |
| | | if (jdGoods == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架")); |
| | |
| | | } |
| | | collectionGoodsV2Service.addJDCollection(uid, jdGoods); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (pddGoods == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架")); |
| | | return; |
| | |
| | | long count = collectionGoodsV2Service.getCollectionGoodsCount(uid, goodsType, notBackSuVip); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>(); |
| | | List<GoodsDetailVO> list = new ArrayList<>(); |
| | | |
| | | if (collectionGoodsList != null && collectionGoodsList.size() > 0) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) { |
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods(); |
| | | if (commonGoods == null || commonGoods.getGoodsType() != Constant.SOURCE_TYPE_TAOBAO) { |
| | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0 |
| | | && commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | |
| | | package com.yeshi.fanli.controller.client.v2; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.net.MalformedURLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ks.lib.common.exception.ParamsException; |
| | | import com.google.gson.*; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.exception.pdd.PDDAuthException; |
| | | import com.yeshi.fanli.exception.pdd.PDDGoodsException; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.service.inter.pdd.PDDAuthService; |
| | | import com.yeshi.fanli.service.inter.user.UserFunctionsLimitService; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.jd.JDConvertLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.pdd.PDDConvertLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.tb.TBConvertLinkManager; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.exception.ExceptionConstant; |
| | | import com.yeshi.fanli.util.goods.GoodsJumpUtil; |
| | | import com.yeshi.fanli.util.goods.GoodsTextUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.vo.goods.ConvertLinkJumpVO; |
| | | import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.*; |
| | | import org.yeshi.utils.entity.FileUploadResult; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.JsonElement; |
| | | import com.google.gson.JsonPrimitive; |
| | | import com.google.gson.JsonSerializationContext; |
| | | import com.google.gson.JsonSerializer; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo; |
| | |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkException; |
| | | import com.yeshi.fanli.exception.pdd.PDDAuthException; |
| | | import com.yeshi.fanli.exception.pdd.PDDGoodsException; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | |
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; |
| | | import com.yeshi.fanli.service.inter.pdd.PDDAuthService; |
| | | import com.yeshi.fanli.service.inter.user.QrCodeService; |
| | | import com.yeshi.fanli.service.inter.user.UserFunctionsLimitService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.jd.JDConvertLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.pdd.PDDConvertLinkManager; |
| | | import com.yeshi.fanli.service.manger.goods.tb.TBConvertLinkManager; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.exception.ExceptionConstant; |
| | | import com.yeshi.fanli.util.goods.GoodsJumpUtil; |
| | | import com.yeshi.fanli.util.goods.GoodsTextUtil; |
| | | import com.yeshi.fanli.util.jd.JDApiUtil; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil; |
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.vo.dynamic.ArticleVO; |
| | | import com.yeshi.fanli.vo.goods.ConvertLinkJumpVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.homemodule.BannerVO; |
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | |
| | | import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.*; |
| | | import org.yeshi.utils.entity.FileUploadResult; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.net.MalformedURLException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 动态 |
| | |
| | | @Controller |
| | | @RequestMapping("api/v2/dynamic") |
| | | public class DynamicControllerV2 { |
| | | |
| | | private Logger logger= LoggerFactory.getLogger(DynamicControllerV2.class); |
| | | |
| | | @Resource |
| | | private TaoBaoLinkManager taoBaoLinkManager; |
| | |
| | | if (JDUtil.isJDLink(url)) { |
| | | try { |
| | | url = jdConvertLinkManager.convertShortUrl(url, uid, acceptData.getSystem(), uid == null ? SystemPIDInfo.PidType.coupon : SystemPIDInfo.PidType.fanli); |
| | | } catch (ParamsException e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s",url), e); |
| | | } |
| | | convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getJDJumpInfo(url), Constant.SOURCE_TYPE_JD); |
| | | outPrintConvertResult(convertLinkJumpVO, out); |
| | |
| | | TaoKeApiUtil.TokenConvertResult convertResult = TaoKeApiUtil.tokenConvert(tokenList.get(0)); |
| | | if (convertResult != null) { |
| | | String originUrl = convertResult.getOrigin_url(); |
| | | long goodsId = convertResult.getNum_iid(); |
| | | String goodsId = convertResult.getNum_iid(); |
| | | TaoBaoLink taoBaoLink = tbConvertLinkManager.convertGoods(goodsId, uid, acceptData.getSystem(), uid == null ? SystemPIDInfo.PidType.coupon : SystemPIDInfo.PidType.fanli); |
| | | convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getTBJumpInfo(taoBaoLink), Constant.SOURCE_TYPE_TAOBAO); |
| | | outPrintConvertResult(convertLinkJumpVO, out); |
| | |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param id |
| | | * @param type |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "evaluateCopyRecommend", method = RequestMethod.POST) |
| | |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, user.getId(), Long.parseLong(goodsVO.getGoodsId()), |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, user.getId(),goodsVO.getGoodsId(), |
| | | relationId, null); |
| | | } catch (TaoBaoConvertLinkException e) { |
| | | e.printStackTrace(); |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html"; |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(system, Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | user.getId() + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s",materialId,couponUrl), e); |
| | | } |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail pddGoodsDetail = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(goodsVO.getGoodsId())); |
| | | if (pddGoodsDetail == null) { |
| | |
| | | import com.yeshi.fanli.vo.suning.SuningConvertLinkResult; |
| | | import com.yeshi.goods.facade.dto.taobao.TaoBaoGoodsImportantInfo; |
| | | import org.json.simple.JSONArray; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | @Controller |
| | | @RequestMapping("api/v2/goods") |
| | | public class GoodsControllerV2 { |
| | | |
| | | |
| | | Logger logger = LoggerFactory.getLogger(GoodsControllerV2.class); |
| | | |
| | | @Resource |
| | | private BusinessSystemService businessSystemService; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getDetailTB", method = RequestMethod.POST) |
| | | public void getDetialTB(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) { |
| | | public void getDetialTB(AcceptData acceptData, String id, Long uid, String from, PrintWriter out) { |
| | | if (id == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品id不能为空")); |
| | | return; |
| | | } |
| | | |
| | | logger.debug("获取商品详情-开始:{}", id + ""); |
| | | |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | |
| | | TaoBaoGoodsBrief goods = null; |
| | | |
| | | if (!convertInServer) { |
| | | logger.debug("获取商品详情-不在服务端转链:{}", id + ""); |
| | | try { |
| | | goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(id); |
| | | if (goods == null) { |
| | |
| | | }); |
| | | } |
| | | |
| | | logger.debug("获取商品详情-获取商品详情成功:{}", id + ""); |
| | | |
| | | TaoBaoGoodsBrief tb = goods; |
| | | |
| | | //创建时间设置为空,防止前端用long解析 |
| | |
| | | |
| | | tb.setImgList(finalImgList); |
| | | |
| | | logger.debug("获取商品详情-开始大淘客商品过滤:{}", id + ""); |
| | | |
| | | // 大淘客商品过滤 |
| | | try { |
| | | goods = filterDaTaoKeGoodsInfo(acceptData.getSystem(), goods); |
| | |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | |
| | | logger.debug("获取商品详情-结束大淘客商品过滤:{}", id + ""); |
| | | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem()); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem())); |
| | | |
| | | logger.debug("获取商品详情-获取到返利比例:{}", id + ""); |
| | | |
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) { |
| | |
| | | } |
| | | goodsDetail.setShopInfo(ShopInfoVOFactory.convertTaoBaoShop(shop)); |
| | | } |
| | | logger.debug("获取商品详情-获取店铺信息结束:{}", id + ""); |
| | | |
| | | |
| | | // 免单商品 |
| | | if (!StringUtil.isNullOrEmpty(from) && "miandan".equals(from)) { |
| | |
| | | } |
| | | extraVO.setListShareUser(listShareUser); |
| | | |
| | | logger.debug("获取商品详情-分享赚人提示结束:{}", id + ""); |
| | | |
| | | // 领券人列表 |
| | | List<ShamUser> listCouponUser = new ArrayList<ShamUser>(); |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null |
| | |
| | | } |
| | | extraVO.setListCouponUser(listCouponUser); |
| | | |
| | | logger.debug("获取商品详情- 领券人列表结束:{}", id + ""); |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | Constant.SOURCE_TYPE_TAOBAO); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | logger.debug("获取商品详情- 收藏结束:{}", id + ""); |
| | | // 是否加入选品库 |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_TAOBAO)); |
| | | logger.debug("获取商品详情- 选品库结束:{}", id + ""); |
| | | } |
| | | |
| | | // 测试 |
| | |
| | | goodsDetail.setLabels(labels); |
| | | |
| | | } else {// 普通购买 |
| | | logger.debug("获取商品详情- 奖励券开始:{}", id + ""); |
| | | OtherInfo otherInfo = new OtherInfo(); |
| | | RewardCouponVO rewardCoupon = new RewardCouponVO(); |
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem())); |
| | |
| | | rewardCoupon.setParams(params1.toString()); |
| | | |
| | | otherInfo.setRewardCoupon(rewardCoupon); |
| | | logger.debug("获取商品详情- 奖励券结束:{}", id + ""); |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) |
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()), acceptData.getSystem())) |
| | | otherInfo.setRewardCoupon(null); |
| | |
| | | goodsDetail.setCouponInfoList(couponInfoList); |
| | | } |
| | | |
| | | logger.debug("获取商品详情- 分享信息结束:{}", id + ""); |
| | | |
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | getCloudInfo(acceptData, uid, goodsDetail, extraVO); // 云发单文案信息 |
| | | } |
| | | //云发单关闭 |
| | | // if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // getCloudInfo(acceptData, uid, goodsDetail, extraVO); // 云发单文案信息 |
| | | // logger.debug("获取商品详情- 云发单文案结束:{}", id + ""); |
| | | // } |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO)); |
| | | object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail)); |
| | | out.print(JsonUtil.loadTrueResult(object.toString())); |
| | | |
| | | logger.debug("获取商品详情-详情结束:{}", id + ""); |
| | | |
| | | final TaoBaoGoodsBrief goodsInfo = tb; |
| | | ThreadUtil.run(new Runnable() { |
| | |
| | | if (couponInfo != null) { |
| | | // 券链接处理 |
| | | String materialId = "https://item.jd.com/" + id + ".html"; |
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), null, |
| | | String url = null; |
| | | try { |
| | | url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), null, |
| | | pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.coupon), null); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponInfo.getLink()), e); |
| | | } |
| | | couponInfo.setLink(url); |
| | | } |
| | | |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_JD); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | // 是否加入选品库 |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_JD)); |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id+"", Constant.SOURCE_TYPE_JD)); |
| | | } |
| | | |
| | | // 图文详情 |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_PDD); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | // 是否加入选品库 |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_PDD)); |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id+"", Constant.SOURCE_TYPE_PDD)); |
| | | } |
| | | |
| | | extraVO.setIsNative(true); |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_VIP); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | // 是否加入选品库 |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_VIP)); |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id+"", Constant.SOURCE_TYPE_VIP)); |
| | | } |
| | | |
| | | extraVO.setIsNative(true); |
| | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, |
| | | Long.parseLong(suningGoodsInfo.getCommodityInfo().getCommodityCode()), Constant.SOURCE_TYPE_SUNING); |
| | | (suningGoodsInfo.getCommodityInfo().getCommodityCode()), Constant.SOURCE_TYPE_SUNING); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | // 是否加入选品库 |
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, |
| | | Long.parseLong(suningGoodsInfo.getCommodityInfo().getCommodityCode()), |
| | | (suningGoodsInfo.getCommodityInfo().getCommodityCode()), |
| | | Constant.SOURCE_TYPE_SUNING)); |
| | | } |
| | | |
| | |
| | | * @param goodsDetail |
| | | */ |
| | | private void getCloudInfo(AcceptData acceptData, Long uid, GoodsDetailVO goodsDetail, GoodsDetailExtraVO extraVO) { |
| | | if (1 > 0) { |
| | | return; |
| | | } |
| | | // 云发单是否开启 |
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenGoodsDetail.getKey(), acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem()); |
| | | if (!cloudOpen && uid != null) { |
| | |
| | | return; |
| | | } |
| | | |
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(Long.parseLong(id), 10); |
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(id, 10); |
| | | // 初始化 |
| | | if (goodsList == null) { |
| | | goodsList = new ArrayList<TaoBaoGoodsBrief>(); |
| | | goodsList = new ArrayList<>(); |
| | | } |
| | | |
| | | List<GoodsDetailVO> listExtra = new ArrayList<GoodsDetailVO>(); |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | |
| | | |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pid, |
| | | ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | if (jumpLink == null) { |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null, pid, |
| | | ""); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | logger.warn(String.format("京东转链出错:materialId-%s ", materialId), e); |
| | | } |
| | | } |
| | | } else { |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pid, |
| | | ""); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | if (StringUtil.isNullOrEmpty(jumpLink)) { |
| | | jumpLink = couponUrl; |
| | | } |
| | |
| | | if (couponInfo != null) { |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pid, |
| | | uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | if (jumpLink == null) { |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null, pid, |
| | | uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s", materialId), e); |
| | | } |
| | | } |
| | | } else { |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pid, |
| | | uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | if (StringUtil.isNullOrEmpty(jumpLink)) { |
| | | jumpLink = couponUrl; |
| | | } |
| | |
| | | String jumpLink = null; |
| | | String materialId = "https://item.jd.com/" + id + ".html"; |
| | | |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.fanli), null); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | if (StringUtil.isNullOrEmpty(jumpLink)) { |
| | | jumpLink = couponUrl; |
| | | } |
| | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(goodsId)); |
| | | goods = TaoKeApiUtil.getSimpleGoodsInfo(goodsId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject obj = array.optJSONObject(i); |
| | | CommonGoods cg = new CommonGoods(); |
| | | cg.setGoodsId(obj.optLong("goodsId")); |
| | | cg.setGoodsId(obj.optString("goodsId")); |
| | | cg.setGoodsType(obj.optInt("goodsType")); |
| | | commonGoodsList.add(cg); |
| | | } |
| | |
| | | } |
| | | |
| | | // 分离各个平台的商品信息 |
| | | List<Long> tbGoodsList = new ArrayList<>(); |
| | | List<String> tbGoodsList = new ArrayList<>(); |
| | | List<Long> jdGoodsList = new ArrayList<>(); |
| | | List<Long> pddGoodsList = new ArrayList<>(); |
| | | |
| | |
| | | if (cg.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | tbGoodsList.add(cg.getGoodsId()); |
| | | } else if (cg.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | jdGoodsList.add(cg.getGoodsId()); |
| | | jdGoodsList.add(Long.parseLong( cg.getGoodsId())); |
| | | } else if (cg.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | pddGoodsList.add(cg.getGoodsId()); |
| | | pddGoodsList.add(Long.parseLong(cg.getGoodsId())); |
| | | } |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | link = JDApiUtil.convertLinkWithSubUnionId(link, null, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.fanli), uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s", link), e); |
| | | } |
| | | |
| | | |
| | | GoodsJumpLinkVO vo = GoodsJumpUtil.getJDJumpInfo(link); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "getTaoBaoGoodsDetailImgs") |
| | | public void getTaoBaoGoodsDetailImgs(AcceptData acceptData, Long id, PrintWriter out) { |
| | | public void getTaoBaoGoodsDetailImgs(AcceptData acceptData, String id, PrintWriter out) { |
| | | TaoBaoGoodsImportantInfo info = DaTaoKeApiUtil.getGoodsImportantInfo(id); |
| | | if (info == null || info.getDetailImages() == null) { |
| | | out.print(JsonUtil.loadFalseResult("")); |
| | |
| | | record = integralGetService.addScanPushHistory(uid); |
| | | } else if (TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event)) { |
| | | JSONObject json = JSONObject.fromObject(data); |
| | | record = integralGetService.addScanGoodsDetail(uid, json.optInt("goodsType"), json.optLong("goodsId")); |
| | | record = integralGetService.addScanGoodsDetail(uid, json.optInt("goodsType"), json.optString("goodsId")); |
| | | } else if (TaskUniqueKeyEnum.scanHomeBanner.name().equalsIgnoreCase(event)) { |
| | | JSONObject json = JSONObject.fromObject(data); |
| | | record = integralGetService.addScanRecommendBanner(uid, json.optString("id")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping("getSpikeGoodsList") |
| | | public void getSpikeGoodsList(AcceptData acceptData, Integer page, Long goodsId, String qtime, PrintWriter out) { |
| | | public void getSpikeGoodsList(AcceptData acceptData, Integer page, String goodsId, String qtime, PrintWriter out) { |
| | | List<DaTaoKeDetailV2> detailList0 = daTaoKeGoodsDetailV2Service.getDingDongQiangData(qtime); |
| | | if (detailList0 == null) |
| | | detailList0 = new ArrayList<>(); |
| | |
| | | JSONArray array = new JSONArray(); |
| | | if (page == 1 && goodsId != null && detailList != null) { |
| | | for (int i = 0; i < detailList.size(); i++) { |
| | | if (detailList.get(i).getGoodsId().longValue() == goodsId) { |
| | | if ( TaoBaoUtil.isEqual( detailList.get(i).getGoodsId(), goodsId)) { |
| | | DaTaoKeDetailV2 goods = detailList.get(i); |
| | | detailList.remove(i); |
| | | detailList.add(0, goods); |
| | |
| | | */ |
| | | private void searchTaoBaoGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | Long goodsId = null; |
| | | String goodsId = null; |
| | | //是否包含淘宝链接/口令 |
| | | if (page == 1) { |
| | | List<String> linkList = HttpUtil.getUrlListFromText(key); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | if (goodsId == null) { |
| | | Long id = DaTaoKeApiUtil.parseTaoBaoToken(key); |
| | | String id = DaTaoKeApiUtil.parseTaoBaoToken(key); |
| | | if (id != null) { |
| | | goodsId = id; |
| | | } |
| | |
| | | if (linkList != null && linkList.size() > 0) { |
| | | String tempGoodsId = clipboardAnalysisManager.parseTBAuctionIdFromLink(linkList.get(0)); |
| | | if (!StringUtil.isNullOrEmpty(tempGoodsId)) { |
| | | goodsId = Long.parseLong(tempGoodsId); |
| | | goodsId = tempGoodsId; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | @Controller |
| | | @RequestMapping("api/v2/share") |
| | | public class ShareControllerV2 { |
| | | |
| | | Logger logger = LoggerFactory.getLogger(ShareControllerV2.class); |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | |
| | | |
| | | // 淘宝 |
| | | if (goodsType == null || goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | createTaoBaoShare(acceptData, uid, Long.parseLong(goodsId), totalNum, source, needGoods, request, out); |
| | | createTaoBaoShare(acceptData, uid, goodsId, totalNum, source, needGoods, request, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void createTaoBaoShare(AcceptData acceptData, Long uid, Long goodsId, Integer totalNum, String source, |
| | | public void createTaoBaoShare(AcceptData acceptData, Long uid, String goodsId, Integer totalNum, String source, |
| | | Boolean needGoods, HttpServletRequest request, PrintWriter out) { |
| | | if (needGoods == null) |
| | | needGoods = false; |
| | |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void createTaoLijin(Long uid, Long auctionId, int totalNum, String relationId, AcceptData acceptData, HttpServletRequest request, |
| | | public void createTaoLijin(Long uid, String auctionId, int totalNum, String relationId, AcceptData acceptData, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | try { |
| | | TaoBaoGoodsBrief goods = null; |
| | |
| | | } |
| | | } |
| | | |
| | | public void createCommonTaoBaoShare(String platform, String version, Long goodsId, String inviteCode, Long uid, |
| | | public void createCommonTaoBaoShare(String platform, String version, String goodsId, String inviteCode, Long uid, |
| | | boolean needGoods, String relationId, AcceptData acceptData, PrintWriter out) { |
| | | |
| | | SystemEnum system = SystemInfoUtil.getSystem(acceptData); |
| | |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String pid = pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share); |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pid, uid + ""); |
| | | String jumpLink = null; |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pid, uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | if (StringUtil.isNullOrEmpty(jumpLink)) { |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null, pid, uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | } |
| | | |
| | | ShareInfoVO shareInfo = new ShareInfoVO(); |
| | |
| | | BigDecimal shareMoney = JDUtil.getGoodsFanLiMoney(jdGoods, shareRate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | try { |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId, |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId+"", |
| | | Constant.SOURCE_TYPE_JD, false); |
| | | shareInfo.setShareId(shareRecord.getRedisKey()); |
| | | } catch (Exception e) { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getPicUrl()); |
| | | history.setShareImg(jumpLinkNew); |
| | | |
| | |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | | try { |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId, |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId+"", |
| | | Constant.SOURCE_TYPE_PDD, false); |
| | | shareInfo.setShareId(shareRecord.getRedisKey()); |
| | | } catch (Exception e) { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getGoodsImageUrl()); |
| | | history.setShareImg(jumpLink); |
| | | List<String> imgList = null; |
| | |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | | try { |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId, |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId+"", |
| | | Constant.SOURCE_TYPE_VIP, false); |
| | | shareInfo.setShareId(shareRecord.getRedisKey()); |
| | | } catch (Exception e) { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getGoodsThumbUrl()); |
| | | history.setShareImg(jumpLink.getUrl()); |
| | | List<String> imgList = goods.getGoodsDetailPictures(); |
| | |
| | | |
| | | try { |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, |
| | | Long.parseLong(sts[1]), Constant.SOURCE_TYPE_SUNING, false); |
| | | Long.parseLong(sts[1])+"", Constant.SOURCE_TYPE_SUNING, false); |
| | | shareInfo.setShareId(shareRecord.getRedisKey()); |
| | | } catch (Exception e) { |
| | | try { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(Long.parseLong(sts[1])); |
| | | history.setGoodsId(Long.parseLong(sts[1])+""); |
| | | if (goods.getCommodityInfo().getPictureUrl() != null |
| | | && goods.getCommodityInfo().getPictureUrl().size() > 0) |
| | | history.setPostPicture(goods.getCommodityInfo().getPictureUrl().get(0).getPicUrl()); |
| | |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | createTaoBaoViewText(acceptData.getSystem(), goodsType, uid, template, Long.parseLong(goodsId), tljId, hasCoupon, out); |
| | | createTaoBaoViewText(acceptData.getSystem(), goodsType, uid, template, goodsId, tljId, hasCoupon, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | * @param hasCoupon |
| | | * @param out |
| | | */ |
| | | private void createTaoBaoViewText(SystemEnum system, Integer goodsType, Long uid, String template, Long goodsId, Long tljId, |
| | | private void createTaoBaoViewText(SystemEnum system, Integer goodsType, Long uid, String template, String goodsId, Long tljId, |
| | | Boolean hasCoupon, PrintWriter out) { |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(goodsId); |
| | | if (goods == null) |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(system, Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | String shortLink = null; |
| | | try { |
| | | shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(system, Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | uid + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | |
| | | String content = shareGoodsTextTemplateService.createContentJD(template, goods, shortLink, hasCoupon); |
| | | JSONObject data = new JSONObject(); |
| | |
| | | |
| | | // API网络接口验证是否在售 |
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null; |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (UserShareGoodsGroup goodsGroup : list) { |
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods(); |
| | | Integer goodsType = commonGoods.getGoodsType(); |
| | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0 && goodsType != null |
| | | && goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual(goodsId , auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem())); |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(Long.parseLong(goodsId)); |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(goodsId); |
| | | if (goods == null) { |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | | goods = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | goods = null; |
| | | } |
| | |
| | | /** |
| | | * 单个商品加入选品库 |
| | | * |
| | | * @param callback |
| | | * @param storageIds |
| | | * id数组 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "accordtorage", method = RequestMethod.POST) |
| | | public void accordtorage(AcceptData acceptData, Long uid, long id, Integer goodsType, PrintWriter out) { |
| | | public void accordtorage(AcceptData acceptData, Long uid, String id, Integer goodsType, PrintWriter out) { |
| | | |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | |
| | | userGoodsStorageService.deleteByPrimaryKey(userGoodsStorage.getId()); |
| | | } else { |
| | | // 加入选品库 |
| | | Set<Long> set = new HashSet<Long>(); |
| | | Set<String> set = new HashSet<>(); |
| | | set.add(id); |
| | | userGoodsStorageService.save(uid, set, goodsType); |
| | | storageState = true; |
| | |
| | | // API网络接口验证是否在售 |
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (UserGoodsStorage userGoodsStorage : listStorage) { |
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods(); |
| | | if (commonGoods == null) { |
| | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | |
| | | /** |
| | | * 分享商品返回二维码图片 |
| | | * |
| | | * @param callback |
| | | * @param storageIds |
| | | * id数组 |
| | | * @param out |
| | |
| | | * @param callback |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "switchCircleState") |
| | |
| | | userCloudService.sendByDynamic(uid, evaluate.getId()); |
| | | } else { |
| | | |
| | | Long gid = null; |
| | | String gid = null; |
| | | Long sellerId = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { // 苏宁 |
| | | String[] ids = SuningUtil.getGoodsIdDetail(goodsId); |
| | | gid = Long.parseLong(ids[1]); |
| | | gid = ids[1]; |
| | | sellerId = Long.parseLong(ids[0]); |
| | | } else { |
| | | gid = Long.parseLong(goodsId); |
| | | gid = goodsId; |
| | | } |
| | | userCloudService.sendCustomGoods(uid, gid, goodsType, sellerId); |
| | | } |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "getGoodsDetail") |
| | | public void getGoodsDetail(String sign, long id, String callback, PrintWriter out) { |
| | | public void getGoodsDetail(String sign, String id, String callback, PrintWriter out) { |
| | | GoodsDetailExtraVO extraVO = new GoodsDetailExtraVO(); |
| | | extraVO.setIsNative(false); |
| | | TaoBaoGoodsBrief goods = null; |
| | |
| | | return; |
| | | } |
| | | |
| | | Long auctionId = record.getGoodsId(); |
| | | String auctionId = record.getGoodsId(); |
| | | String tljLink = record.getSendUrl(); |
| | | BigDecimal tljMoney = record.getPerFace(); |
| | | |
| | |
| | | // 查询是否有分享记录 |
| | | UserShareGoodsHistory shareHistory = null; |
| | | try { |
| | | shareHistory = shareGoodsService.getShareGoodsHistoryDetail(Long.parseLong(uid), Long.parseLong(id)); |
| | | shareHistory = shareGoodsService.getShareGoodsHistoryDetail(Long.parseLong(uid), id); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (ShareGoodsException e) { |
| | |
| | | goods = redisManager.getTaoBaoGoodsTemp(Long.parseLong(id)); |
| | | if (goods == null) |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id)); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET); |
| | | |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | app.setAppSecret(configList.get(0).getAppSecret()); |
| | | app.setPid(pid); |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | url = goods.getCouponLink(); |
| | | } |
| | | if (!url.contains("uland.taobao.com") && !url.contains("s.click.taobao.com")) { |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(Long.parseLong(id), app, null, null); |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(id, app, null, null); |
| | | url = linkInfo.getCouponLink(); |
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | url = linkInfo.getAuctionUrl(); |
| | |
| | | } |
| | | |
| | | String materialId = "https://item.jd.com/" + id + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | String jumpLink = null; |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | uid); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | int priceType = 1; |
| | | BigDecimal price = jdGoods.getPrice(); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSuperHongBaoToken") |
| | | public void getSuperHongBaoToken(String sign, Long uid, String callback, PrintWriter out) { |
| | | public void getSuperHongBaoToken(String sign, Long uid, String callback, String sceneId, PrintWriter out) { |
| | | if (!StringUtil.Md5(uid + "@?,223Hbb88lll").equalsIgnoreCase(sign)) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "签名错误"))); |
| | | return; |
| | |
| | | try { |
| | | TaoKeOfficialActivityConvertResultDTO dto = null; |
| | | try { |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, "mm_124933865_56750082_19507100253", "20150318020008790", info.getRelationId(), false); |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, "mm_124933865_56750082_19507100253", sceneId, info.getRelationId(), false); |
| | | } catch (ConvertLinkException e) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getCode(), e.getMessage()))); |
| | | return; |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "getYuShouToken") |
| | | public void getYuShouToken(String sign, Long uid, String callback, PrintWriter out) { |
| | | public void getYuShouToken(String sign, Long uid, String callback, String sceneId, PrintWriter out) { |
| | | if (!StringUtil.Md5(uid + "@?,223Hbb88lll").equalsIgnoreCase(sign)) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "签名错误"))); |
| | | return; |
| | |
| | | TaoKeOfficialActivityConvertResultDTO dto = null; |
| | | try { |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, "mm_124933865_56750082_19507100253", |
| | | "20150318020008790", info.getRelationId(), true); |
| | | sceneId, info.getRelationId(), true); |
| | | } catch (ConvertLinkException e) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getCode(), e.getMessage()))); |
| | | return; |
| | |
| | | // 获取商品详情 |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optLong(i)); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optString(i)); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | // 获取商品详情 |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optLong(i)); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optString(i)); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | // 获取商品详情 |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optLong(i)); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optString(i)); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | } |
| | | TaoBaoGoodsBrief tb = null; |
| | | try { |
| | | tb = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | tb = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (NumberFormatException e1) { |
| | | e1.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e1) { |
| | |
| | | |
| | | if (uid != null && !"".equals(uid.trim())) { |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), |
| | | Long.parseLong(id), goodsType); |
| | | id, goodsType); |
| | | data.put("collection", collectionGoods != null ? true : false); |
| | | } |
| | | taoBaoGoodsBriefExtra.setAuctionUrl(null); |
| | |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param id |
| | | * @param type |
| | | * @param goodsType |
| | | * @param out |
| | | */ |
| | | @RequestMapping("collectionGoods") |
| | | public void collectionGoods(WXMPAcceptData acceptData, Long uid, Long goodsId, int type, Integer goodsType, |
| | | public void collectionGoods(WXMPAcceptData acceptData, Long uid, String goodsId, int type, Integer goodsType, |
| | | PrintWriter out) { |
| | | try { |
| | | if (goodsType == null || goodsType < 2 || goodsType > 3) { |
| | |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (jdGoods == null) { |
| | | jdGoods = JDApiUtil.getGoodsDetail(goodsId); |
| | | jdGoods = JDApiUtil.getGoodsDetail(Long.parseLong(goodsId)); |
| | | } |
| | | if (jdGoods == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架")); |
| | |
| | | } |
| | | collectionGoodsV2Service.addJDCollection(uid, jdGoods); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (pddGoods == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架")); |
| | | return; |
| | |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>(); |
| | | |
| | | if (collectionGoodsList != null && collectionGoodsList.size() > 0) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) { |
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods(); |
| | | if (commonGoods == null || commonGoods.getGoodsType() != Constant.SOURCE_TYPE_TAOBAO) { |
| | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0 |
| | | && commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | |
| | | @RequestMapping("/wxmp/api/v1/dynamic") |
| | | public class DynamicController { |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private WXMPDynamicInfoService wxmpDynamicInfoService; |
| | | |
| | |
| | | JSONObject paramsJson = JSONObject.fromObject(params); |
| | | // 京东转链 |
| | | String url = paramsJson.optString("url"); |
| | | String link = JDApiUtil.convertLinkWithSubUnionId(url, null, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.fanli), uid + ""); |
| | | String link = null; |
| | | try { |
| | | link = JDApiUtil.convertLinkWithSubUnionId(url, null, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.fanli), uid + ""); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(link)) { |
| | | out.print(JsonUtil.loadFalseResult("转链失败")); |
| | |
| | | if (couponInfo != null) { |
| | | // 券链接处理 |
| | | String materialId = "https://item.jd.com/" + id + ".html"; |
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), |
| | | String url = null; |
| | | try { |
| | | url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), |
| | | null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.coupon), null); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | couponInfo.setLink(url); |
| | | } |
| | | |
| | |
| | | extraVO.setListShareUser(listShareUser); |
| | | |
| | | // 领券人列表 |
| | | List<ShamUser> listCouponUser = new ArrayList<ShamUser>(); |
| | | List<ShamUser> listCouponUser = new ArrayList<>(); |
| | | if (goodsDetail.isHasCoupon() && Integer.parseInt(inOrderCount30Days.toString()) >= 1000) { |
| | | listCouponUser = shamUserService.listRandCouponUser(5, 1, 300); |
| | | } |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_JD); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | } |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_PDD); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | } |
| | |
| | | if (share) { |
| | | position = Long.parseLong(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share)); |
| | | } |
| | | String jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, position + "", subUnionId); |
| | | String jdLink = null; |
| | | try { |
| | | jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, position + "", subUnionId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | jumpLink = "/pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(jdLink, "UTF-8"); |
| | | } catch (Exception e) { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getPicUrl()); |
| | | history.setPictures(JsonUtil.getGson().toJson(goods.getImgList())); |
| | | history.setShareImg(posterLink); |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getPicUrl()); |
| | | history.setPictures(JsonUtil.getGson().toJson(goods.getImgList())); |
| | | history.setShareImg(posterLink); |
| | |
| | | } |
| | | |
| | | |
| | | public List<PullNewGoods> getByItemid(Long itemid) { |
| | | public List<PullNewGoods> getByItemid(String itemid) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("itemid").is(itemid)); |
| | | return mongoTemplate.find(query, getEntityClass()); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<Long> goodsIdList) { |
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<String> goodsIdList) { |
| | | if (goodsIdList == null || goodsIdList.size() == 0) |
| | | return null; |
| | | Query query = new Query(); |
| | |
| | | * DaTaoKeDetailV2 返回类型 |
| | | * @throws |
| | | */ |
| | | public DaTaoKeDetailV2 selectByAuctionId(Long auctionId) { |
| | | public DaTaoKeDetailV2 selectByAuctionId(String auctionId) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("goodsId").is(auctionId)); |
| | | query.limit(1); |
| | |
| | | |
| | | int updateByPrimaryKey(UserShareGoodsHistory record); |
| | | |
| | | UserShareGoodsHistory selectByUidAndAuctionId(@Param("uid")Long uid,@Param("auctionId")Long auctionId); |
| | | UserShareGoodsHistory selectByUidAndAuctionId(@Param("uid")Long uid,@Param("auctionId")String auctionId); |
| | | |
| | | |
| | | long countUserShares(Long userId); |
| | |
| | | |
| | | int updateByPrimaryKey(RecommendActivityTaoBaoGoods record); |
| | | |
| | | int updateStateByAuctionId(@Param("auctionId") Long auctionId, @Param("state") int state); |
| | | int updateStateByAuctionId(@Param("auctionId") String auctionId, @Param("state") int state); |
| | | |
| | | |
| | | List<RecommendActivityTaoBaoGoods> selectByActivityId(Long activityId); |
| | | |
| | | List<RecommendActivityTaoBaoGoods> selectByAuctionId(Long auctionId); |
| | | List<RecommendActivityTaoBaoGoods> selectByAuctionId(String auctionId); |
| | | |
| | | List<RecommendActivityTaoBaoGoods> selectList(@Param("start") Long start, @Param("count") int count); |
| | | |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | CollectionGoodsV2 selectByUidAndGoodsType(@Param("uid") Long uid, @Param("goodsId") Long goodsId, |
| | | CollectionGoodsV2 selectByUidAndGoodsType(@Param("uid") Long uid, @Param("goodsId") String goodsId, |
| | | @Param("goodsType") Integer goodsType); |
| | | |
| | | /** |
| | |
| | | * @param goodsType |
| | | * @return |
| | | */ |
| | | CommonGoods selectByGoodsIdAndGoodsType(@Param("goodsId") Long goodsId, @Param("goodsType") Integer goodsType); |
| | | CommonGoods selectByGoodsIdAndGoodsType(@Param("goodsId") String goodsId, @Param("goodsType") Integer goodsType); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<CommonGoods> getByListGoodsId(@Param("list") List<Long> list, @Param("goodsType") Integer goodsType); |
| | | List<CommonGoods> getByListGoodsId(@Param("list") List<String> list, @Param("goodsType") Integer goodsType); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 判断是否已贴过标签 |
| | | * @param title |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | Long getRelationNum( @Param("labelId") Long labelId); |
| | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | int deleteBatchByPK(List<Long> list); |
| | |
| | | |
| | | /** |
| | | * 判断是否已贴过标签 |
| | | * @param title |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | Long isExistence(@Param("goodsId") Long goodsId, @Param("labelId") Long labelId); |
| | | Long isExistence(@Param("goodsId") String goodsId, @Param("labelId") Long labelId); |
| | | |
| | | /** |
| | | * 查询商品当前是否包含 9k9类目 |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | int getCountByGoodsId(@Param("goodsId") Long goodsId); |
| | | int getCountByGoodsId(@Param("goodsId") String goodsId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param record |
| | | * @return |
| | | */ |
| | | List<LabelGoods> queryByGoodsId(@Param("start") int start, @Param("count") int count, @Param("goodsId") Long record); |
| | | List<LabelGoods> queryByGoodsId(@Param("start") int start, @Param("count") int count, @Param("goodsId") String record); |
| | | |
| | | int getCountQueryByGoodsId(@Param("goodsId") Long record); |
| | | int getCountQueryByGoodsId(@Param("goodsId") String record); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | int deleteByGoodsId(Long goodsId); |
| | | int deleteByGoodsId(String goodsId); |
| | | |
| | | |
| | | int deleteBatchByGoodsId(List<Long> list); |
| | | int deleteBatchByGoodsId(List<String> list); |
| | | |
| | | |
| | | /** |
| | | * 根据标签id批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | int deleteByLabId(Long labId); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | |
| | | int deleteByGoodsIdAndLabId(Long goodsId, Long labId); |
| | | int deleteByGoodsIdAndLabId(String goodsId, Long labId); |
| | | |
| | | |
| | | /** |
| | | * 查询所有数据+条件 |
| | | * @param start |
| | | * @param count |
| | | * @param goodsId |
| | | * @param labIds |
| | | * @return |
| | | */ |
| | |
| | | * 根据商品id 批量删除 |
| | | * @param list |
| | | */ |
| | | void deleteBatchByGoodsId(List<Long> list); |
| | | void deleteBatchByGoodsId(List<String> list); |
| | | |
| | | /** |
| | | * 统计总行数 |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | QualityFactory getByAuctionId(@Param("auctionId") Long auctionId); |
| | | QualityFactory getByAuctionId(@Param("auctionId") String auctionId); |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<QualityFactory> listQueryGoodsByGoodsId(List<Long> list); |
| | | |
| | | Long queryCountByGoodsId(@Param("goodsId") Long goodsId); |
| | | Long queryCountByGoodsId(@Param("goodsId") String goodsId); |
| | | |
| | | List<QualityFactory> listQueryByAuctionId(List<Long> list); |
| | | List<QualityFactory> listQueryByAuctionId(List<String> list); |
| | | |
| | | // 精选库查询 -- 查询所有 |
| | | List<QualityFactory> queryAll(@Param("start") long start, @Param("count") int count, @Param("days") Integer days); |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | int deleteByGoodsId(Long goodsId); |
| | | int deleteByGoodsId(String goodsId); |
| | | |
| | | /** |
| | | * 查询精选商品数据应用前端 |
| | |
| | | * 商品来源 |
| | | * @return |
| | | */ |
| | | List<Long> getAuctionIdbyClassId(@Param("systemCid") Long systemCid, @Param("goodsSource") Integer goodsSource, |
| | | List<String> getAuctionIdbyClassId(@Param("systemCid") Long systemCid, @Param("goodsSource") Integer goodsSource, |
| | | @Param("beforeTime") String beforeTime); |
| | | |
| | | /** |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int deleteByGoodsId(Long qid); |
| | | int deleteByGoodsId(String qid); |
| | | |
| | | /** |
| | | * 根据精选id 批量删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int deleteBatchByQualityID(List<Long> list); |
| | | int deleteBatchByQualityID(List<String> list); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 根据类型,用户ID,唯一标识查询 |
| | | * |
| | | * @param type |
| | | * @param uid |
| | | * @param sourceIdentifyId |
| | |
| | | @Param("uid") Long uid, @Param("sourceIdentifyId") Long sourceIdentifyId); |
| | | |
| | | |
| | | UserMoneyDetail selectByIdentifyCode(@Param("identifyCode") String identifyCode); |
| | | |
| | | |
| | | /** |
| | | * 查询明细 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | @Param("key") String key,@Param("keyType") Integer keyType); |
| | | |
| | | Long countQuery(@Param("key") String key, @Param("keyType")Integer keyType); |
| | | |
| | | |
| | | } |
| | |
| | | public interface TaoBaoGoodsBriefMapper extends BaseMapper<TaoBaoGoodsBrief>{ |
| | | |
| | | |
| | | int deleteByAuctionId(Long auctionId); |
| | | int deleteByAuctionId(String auctionId); |
| | | |
| | | /* |
| | | * 根据商品id 批量删除 |
| | | * @param list |
| | | */ |
| | | void deleteBatchByGoodsId(List<Long> list); |
| | | void deleteBatchByGoodsId(List<String> list); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | List<TaoBaoGoodsBrief> queryByAuctionId(@Param("auctionId") Long auctionId); |
| | | List<TaoBaoGoodsBrief> queryByAuctionId(@Param("auctionId") String auctionId); |
| | | |
| | | |
| | | TaoBaoGoodsBrief selectOneByAuctionId(@Param("auctionId") String auctionId); |
| | | |
| | | /** |
| | | * 批量插入 |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<TaoBaoGoodsBrief> queryGoodsByAuctionId(List<Long> list); |
| | | List<TaoBaoGoodsBrief> queryGoodsByAuctionId(List<String> list); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<Long> listExistById(List<Long> list); |
| | | List<Long> listExistById(List<String> list); |
| | | |
| | | /** |
| | | * 批量更新 |
| | |
| | | List<TaoBaoGoodsBrief> queryGoodsByMaxUpdateTime(@Param("maxTime") Date maxTime, @Param("start") int start, |
| | | @Param("count") int count); |
| | | |
| | | List<Long> queryCanDeleteGoods(@Param("maxTime") Date maxTime,@Param("start")int start,@Param("count")int count); |
| | | List<String> queryCanDeleteGoods(@Param("maxTime") Date maxTime,@Param("start")int start,@Param("count")int count); |
| | | |
| | | Long queryCanDeleteGoodsCount(@Param("maxTime") Date maxTime); |
| | | |
| | |
| | | /** |
| | | * 长时间未更新的商品 |
| | | */ |
| | | List<Long> listNeedUpdateGoodsId(@Param("start") long start, @Param("count") int count, @Param("hour") int hour); |
| | | List<String> listNeedUpdateGoodsId(@Param("start") long start, @Param("count") int count, @Param("hour") int hour); |
| | | |
| | | } |
| | |
| | | |
| | | List<TaoBaoOrder> getStateByOrderIdAndPayment(@Param("orderId") String orderId, @Param("payment") String payment); |
| | | |
| | | TaoBaoOrder selectLatestByAuctionId(long auctionId); |
| | | TaoBaoOrder selectLatestByAuctionId(String auctionId); |
| | | |
| | | /** |
| | | * 统计所有订单 |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | TaoBaoToken selectByAuctionId(@Param("auctionId") Long auctionId,@Param("pid") String pid); |
| | | TaoBaoToken selectByAuctionId(@Param("auctionId") String auctionId,@Param("pid") String pid); |
| | | |
| | | } |
| | |
| | | * @param auctionId 淘宝商品 id |
| | | * @return |
| | | */ |
| | | UserGoodsStorage getByUidAndAuctionId(@Param("uid") Long uid, @Param("auctionId") Long auctionId, @Param("gooodsType") Integer gooodsType); |
| | | UserGoodsStorage getByUidAndAuctionId(@Param("uid") Long uid, @Param("auctionId") String auctionId, @Param("gooodsType") Integer gooodsType); |
| | | |
| | | |
| | | /** |
| | |
| | | return mongoTemplate.find(query, ShareHotGoods.class); |
| | | } |
| | | |
| | | public void deleteByGoodsId(Long goodsId) { |
| | | public void deleteByGoodsId(String goodsId) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(goodsId); |
| | | query.addCriteria(ca); |
| | |
| | | } |
| | | } |
| | | |
| | | public List<ShareHotGoods> listByAuctionId(Long auctionid) { |
| | | public List<ShareHotGoods> listByAuctionId(String auctionid) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionid); |
| | | query.addCriteria(ca); |
| | |
| | | return mongoTemplate.count(query, TLJBuyGoods.class); |
| | | } |
| | | |
| | | public void deleteByGoodsId(Long goodsId) { |
| | | public void deleteByGoodsId(String goodsId) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(goodsId); |
| | | query.addCriteria(ca); |
| | |
| | | } |
| | | } |
| | | |
| | | public List<TLJBuyGoods> listByAuctionId(Long auctionid) { |
| | | public List<TLJBuyGoods> listByAuctionId(String auctionid) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionid); |
| | | query.addCriteria(ca); |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void deleteByAuctionId(Long auctionId) { |
| | | public void deleteByAuctionId(String auctionId) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId); |
| | | query.addCriteria(ca); |
| | |
| | | mongoTemplate.updateFirst(query, update, TLJBuyGoods.class); |
| | | } |
| | | |
| | | public TLJBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) { |
| | | public TLJBuyGoods selectByAuctionIdAndDay(String auctionId, String day) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId).and("day").is(day); |
| | | query.addCriteria(ca); |
| | |
| | | } |
| | | |
| | | |
| | | public List<TLJFreeBuyGoods> listByGoodsId(Long auctionid) { |
| | | public List<TLJFreeBuyGoods> listByGoodsId(String auctionid) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionid); |
| | | query.addCriteria(ca); |
| | | return mongoTemplate.find(query, TLJFreeBuyGoods.class); |
| | | } |
| | | |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) { |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(String auctionId, String day) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId).and("day").is(day); |
| | | query.addCriteria(ca); |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void deleteByGoodsId(Long auctionId) { |
| | | public void deleteByGoodsId(String auctionId) { |
| | | Query query = new Query(); |
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId); |
| | | query.addCriteria(ca); |
| | |
| | | * @param auctionIds |
| | | * @return |
| | | */ |
| | | public List<TaoBaoGoodsBrief> listByAuctionIds(List<Long> auctionIds) { |
| | | public List<TaoBaoGoodsBrief> listByAuctionIds(List<String> auctionIds) { |
| | | if (auctionIds == null || auctionIds.size() == 0) |
| | | return null; |
| | | Query query = new Query(); |
| | |
| | | @Repository |
| | | public class UserTLJBuyHistoryDao extends MongodbBaseDao<UserTLJBuyHistory> { |
| | | |
| | | public List<UserTLJBuyHistory> listByDayAndUidAndAuctionId(Long uid, Long auctionId, String day) { |
| | | public List<UserTLJBuyHistory> listByDayAndUidAndAuctionId(Long uid, String auctionId, String day) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("uid").is(uid).andOperator(Criteria.where("auctionId").is(auctionId), |
| | | Criteria.where("day").is(day))); |
| | |
| | | private String picture;// 图片 |
| | | |
| | | @Expose |
| | | private Long auctionId;// 商品ID |
| | | private String auctionId;// 商品ID |
| | | |
| | | @Expose |
| | | private String title;// 商品名称 |
| | |
| | | this.order = order; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | package com.yeshi.fanli.dto.push; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | |
| | | //推送内容 |
| | | public class PushContentDetailDTO { |
| | | private PushTypeEnum type; |
| | | private Long uid; |
| | | private String url; |
| | | private String webUrl; |
| | | private Long goodsId; |
| | | private String goodsId; |
| | | private PushBaseContent content; |
| | | |
| | | |
| | | public PushContentDetailDTO(PushTypeEnum type, Long uid, String url, String webUrl, Long goodsId, PushBaseContent content) { |
| | | public PushContentDetailDTO(PushTypeEnum type, Long uid, String url, String webUrl, String goodsId, PushBaseContent content) { |
| | | this.type = type; |
| | | this.uid = uid; |
| | | this.url = url; |
| | |
| | | this.webUrl = webUrl; |
| | | } |
| | | |
| | | public Long getGoodsId() { |
| | | public String getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | public void setGoodsId(String goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | |
| | | private String sharePictureUrl; |
| | | private String redisKey; |
| | | private ShareSourceTypeEnum source; |
| | | private Long auctionId; |
| | | private String auctionId; |
| | | private Integer goodsType; |
| | | private List<CommonGoods> listGoods; |
| | | private List<Long> listId; |
| | |
| | | this.sharePictureUrl = sharePictureUrl; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | @Column(name = "sgus_goods_type") |
| | | private Integer goodsType; |
| | | @Column(name = "sgus_goods_id") |
| | | private Long goodsId; |
| | | private String goodsId; |
| | | @Column(name = "sgus_post_picture") |
| | | private String postPicture; |
| | | |
| | |
| | | this.goodsType = goodsType; |
| | | } |
| | | |
| | | public Long getGoodsId() { |
| | | public String getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | public void setGoodsId(String goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | |
| | | private Long uid; // 用户id |
| | | |
| | | @Column(name = "utlj_goods_id") |
| | | private Long goodsId; // 商品id |
| | | private String goodsId; // 商品id |
| | | |
| | | @Column(name = "utlj_total_num") |
| | | private Integer totalNum; // 淘礼金总个数 |
| | |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public Long getGoodsId() { |
| | | public String getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | public void setGoodsId(String goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | |
| | | private String task; |
| | | @Map("outnetwork") |
| | | private String outNetWork; |
| | | @Map("mq_pub") |
| | | private String mqPub; |
| | | |
| | | public String getTest() { |
| | | return test; |
| | |
| | | this.outNetWork = outNetWork; |
| | | } |
| | | |
| | | public String getMqPub() { |
| | | return mqPub; |
| | | } |
| | | |
| | | public void setMqPub(String mqPub) { |
| | | this.mqPub = mqPub; |
| | | } |
| | | } |
| | |
| | | @Column(name = "cg_title") |
| | | private String title; |
| | | @Column(name = "cg_goods_id") |
| | | private Long goodsId;// 第三方商品ID |
| | | private String goodsId;// 第三方商品ID |
| | | @Column(name = "cg_goods_type") |
| | | private Integer goodsType;// 第三方类型 |
| | | @Column(name = "cg_shop_type") |
| | |
| | | this.title = title; |
| | | } |
| | | |
| | | public Long getGoodsId() { |
| | | public String getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | public void setGoodsId(String goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | |
| | | private Integer product_id;// 自增ID |
| | | @Field |
| | | @Indexed |
| | | private Long itemid;// 宝贝ID |
| | | private String itemid;// 宝贝ID |
| | | @Field |
| | | private String itemtitle;// 宝贝标题 |
| | | @Field |
| | |
| | | this.product_id = product_id; |
| | | } |
| | | |
| | | public Long getItemid() { |
| | | public String getItemid() { |
| | | return itemid; |
| | | } |
| | | |
| | | public void setItemid(Long itemid) { |
| | | public void setItemid(String itemid) { |
| | | this.itemid = itemid; |
| | | } |
| | | |
| | |
| | | @Column(name = "ud_uid") |
| | | private Long uid; |
| | | @Column(name = "ud_goods_id") |
| | | private Long goodsId; |
| | | private String goodsId; |
| | | @Column(name = "ud_goods_source") |
| | | private Integer goodsSource; |
| | | @Column(name = "ud_reason") |
| | |
| | | @Column(name = "ud_beizhu") |
| | | private String beiZhu; |
| | | |
| | | public RecommendGoodsDeleteHistory(Long goodsId, Integer goodsSource) { |
| | | public RecommendGoodsDeleteHistory(String goodsId, Integer goodsSource) { |
| | | this.goodsId = goodsId; |
| | | this.goodsSource = goodsSource; |
| | | } |
| | |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public Long getGoodsId() { |
| | | public String getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | public void setGoodsId(String goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | |
| | | private Long id; |
| | | |
| | | @Column(name="auctionId") |
| | | private Long auctionId; |
| | | private String auctionId; |
| | | |
| | | @Column(name="sid") |
| | | private BusinessSystem system; |
| | |
| | | this.system = system; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | @Column(name = "to_title") |
| | | private String title; // 商品名称 |
| | | @Column(name = "to_auction_id") |
| | | private Long auctionId; // 商品ID |
| | | private String auctionId; // 商品ID |
| | | @Column(name = "to_manager_wangwang") |
| | | private String managerWangWang; // 掌柜旺旺 |
| | | @Column(name = "to_shop") |
| | |
| | | this.title = title; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | @Column(name = "tt_token") |
| | | private String token;// 口令 |
| | | @Column(name = "tt_auction_id") |
| | | private Long auctionId;// 商品Id |
| | | private String auctionId;// 商品Id |
| | | @Column(name = "tt_create_time") |
| | | private Date createTime;// 创建时间 |
| | | @Column(name = "tt_expire_time") |
| | |
| | | this.token = token; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | private Long uid; |
| | | @Field |
| | | @Indexed |
| | | private Long auctionId; |
| | | private String auctionId; |
| | | @Field |
| | | @Indexed |
| | | private String day;// 如:2019-01-01 |
| | |
| | | this.rightsId = rightsId; |
| | | } |
| | | |
| | | public UserTLJBuyHistory(String id, Long uid, Long auctionId, String day, String rightsId, Date createTime) { |
| | | public UserTLJBuyHistory(String id, Long uid, String auctionId, String day, String rightsId, Date createTime) { |
| | | this.id = id; |
| | | this.uid = uid; |
| | | this.auctionId = auctionId; |
| | |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | public class SuperTaoBaoGoods { |
| | | @Id |
| | | @Field |
| | | private Long auctionId; |
| | | private String auctionId; |
| | | @Indexed |
| | | @Field |
| | | private int finalPrice;// 分为单位 |
| | |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public SuperTaoBaoGoods(Long auctionId, int finalPrice, TaoBaoGoodsBrief goods) { |
| | | public SuperTaoBaoGoods(String auctionId, int finalPrice, TaoBaoGoodsBrief goods) { |
| | | this.auctionId = auctionId; |
| | | this.finalPrice = finalPrice; |
| | | this.goods = goods; |
| | |
| | | this.finalPrice = finalPrice; |
| | | } |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | |
| | | public class HongBaoException extends BaseException { |
| | | |
| | | //订单维权 |
| | | public final static int CODE_ORDER_WEIQUAN = 3; |
| | | |
| | | //类型错误 |
| | | public final static int CODE_TYPE_ERROR = 2; |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public HongBaoException(int code, String msg) { |
| | |
| | | while (result.getGoodsList() != null && result.getGoodsList().size() > 0) { |
| | | for (DaTaoKeDetailV2 detailV2 : result.getGoodsList()) { |
| | | try { |
| | | Long goodsId = detailV2.getGoodsId(); |
| | | String goodsId = detailV2.getGoodsId(); |
| | | |
| | | String circleText = detailV2.getCircleText(); |
| | | if (circleText == null) { |
| | |
| | | if (!Constant.IS_TASK) |
| | | return; |
| | | |
| | | List<Long> list = taoBaoGoodsUpdateService.listNeedUpdateGoodsId(0, 2000, 4); |
| | | List<String> list = taoBaoGoodsUpdateService.listNeedUpdateGoodsId(0, 2000, 4); |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (Long id : list) { |
| | | for (String id : list) { |
| | | try { |
| | | CMQManager.getInstance().addNeedUpdateTaoBaoGoodsId(id); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | private void loadMaterialLibsType(List<TaoBaoGoodsBrief> goodsBriefList) { |
| | | |
| | | List<Long> auctionIds = new ArrayList<>(); |
| | | List<String> auctionIds = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsBriefList) { |
| | | auctionIds.add(goodsBrief.getAuctionId()); |
| | | } |
| | | |
| | | try { |
| | | List<TaoBaoGoodsBrief> tempList = TaoKeApiUtil.getBatchGoodsInfo(auctionIds); |
| | | Map<Long, TaoBaoGoodsBrief> tempMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> tempMap = new HashMap<>(); |
| | | for (TaoBaoGoodsBrief temp : tempList) { |
| | | tempMap.put(temp.getAuctionId(), temp); |
| | | } |
| | |
| | | * @param url |
| | | * @param map |
| | | */ |
| | | public static void requestInfo(String url, Map<String, Object> map) { |
| | | public static void requestInfo(String url, Map<String, String[]> map) { |
| | | try { |
| | | Iterator<String> its = map.keySet().iterator(); |
| | | List<String> list = new ArrayList<>(); |
| | |
| | | teamLogger.info(info); |
| | | } |
| | | |
| | | public static void requestTime(String url, Map<String, Object> params, long time) { |
| | | public static void requestTime(String url, Map<String, String[]> params, long time) { |
| | | String paramsStr = ""; |
| | | try { |
| | | Iterator<String> its = params.keySet().iterator(); |
| | |
| | | // log |
| | | private static Logger tljLogger = Logger.getLogger("tljLog"); |
| | | |
| | | public static void info(Long auctionId, String msg) { |
| | | public static void info(String auctionId, String msg) { |
| | | String message = String.format("商品ID:%s 错误信息:%s", auctionId + "", msg); |
| | | tljLogger.info(message); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void downTaoBaoGoods(Long auctionId) { |
| | | public void downTaoBaoGoods(String auctionId) { |
| | | recommendActivityTaoBaoGoodsMapper.updateStateByAuctionId(auctionId, |
| | | RecommendActivityTaoBaoGoods.STATE_UNSHELVE); |
| | | } |
| | |
| | | @Resource |
| | | private RecommendActivityMapper recommendActivityMapper; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private SpreadUserImgService spreadUserImgService; |
| | | |
| | |
| | | |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager |
| | | .getTaoBaoGoodsBrief(Long.parseLong(goodsActivity.getAuctionId())); |
| | | .getTaoBaoGoodsBrief(goodsActivity.getAuctionId()); |
| | | listGoodsBrief.add(goodsBrief); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | |
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType( |
| | | Long.parseLong(goodsActivity.getAuctionId()), CommonGoods.GOODS_TYPE_TB); |
| | | goodsActivity.getAuctionId(), CommonGoods.GOODS_TYPE_TB); |
| | | if (commonGoods != null) { |
| | | TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods); |
| | | goodsBrief.setState(1); |
| | |
| | | activity.getGoodsList().stream().parallel().forEach(goodsActivity -> { |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager |
| | | .getTaoBaoGoodsBrief(Long.parseLong(goodsActivity.getAuctionId())); |
| | | .getTaoBaoGoodsBrief(goodsActivity.getAuctionId()); |
| | | listGoodsBrief.add(goodsBrief); |
| | | |
| | | } catch (TaobaoGoodsDownException e) { |
| | | |
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType( |
| | | Long.parseLong(goodsActivity.getAuctionId()), CommonGoods.GOODS_TYPE_TB); |
| | | goodsActivity.getAuctionId(), CommonGoods.GOODS_TYPE_TB); |
| | | if (commonGoods != null) { |
| | | TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods); |
| | | goodsBrief.setState(1); |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList, |
| | | public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<String> goodsList, |
| | | RecommendActivity activity) throws ActivityException, Exception { |
| | | |
| | | if (goodsList == null || goodsList.size() == 0 || goodsList.size() > 9) |
| | |
| | | List<CommonGoods> listCommonGoods = new ArrayList<CommonGoods>(); |
| | | |
| | | BigDecimal taotaoMoney = new BigDecimal(0); |
| | | for (long auctionId : goodsList) { |
| | | for (String auctionId : goodsList) { |
| | | TaoBaoGoodsBrief tb = null; |
| | | try { |
| | | tb = redisManager.getTaoBaoGoodsBrief(auctionId); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid, |
| | | List<Long> goodsList, RecommendActivity activity) throws ActivityException, Exception { |
| | | List<String> goodsList, RecommendActivity activity) throws ActivityException, Exception { |
| | | |
| | | if (goodsList == null || goodsList.size() == 0 || goodsList.size() > 9) |
| | | throw new ActivityException(1, "商品数量错误:10>商品数量>0"); |
| | |
| | | |
| | | List<RecommendActivityTaoBaoGoods> listgoods = new ArrayList<RecommendActivityTaoBaoGoods>(); |
| | | BigDecimal taotaoMoney = new BigDecimal(0); |
| | | for (long auctionId : goodsList) { |
| | | for (String auctionId : goodsList) { |
| | | TaoBaoGoodsBrief tb = null; |
| | | |
| | | try { |
| | |
| | | if (goods.getState() == RecommendActivityTaoBaoGoods.STATE_UNSHELVE) |
| | | continue; |
| | | try { |
| | | TaoBaoGoodsBrief tbGoods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(goods.getAuctionId())); |
| | | TaoBaoGoodsBrief tbGoods = TaoKeApiUtil.searchGoodsDetail((goods.getAuctionId())); |
| | | if (tbGoods != null) { |
| | | RecommendActivityTaoBaoGoods update = new RecommendActivityTaoBaoGoods(); |
| | | update.setPictUrl(TbImgUtil.getTBSize220ImgWebp(tbGoods.getPictUrl())); |
| | |
| | | update.setId(goods.getId()); |
| | | update.setState(RecommendActivityTaoBaoGoods.STATE_UNSHELVE); |
| | | recommendActivityTaoBaoGoodsMapper.updateByPrimaryKeySelective(update); |
| | | taoBaoGoodsUpdateService.offlineTaoBaoGoods(Long.parseLong(goods.getAuctionId())); |
| | | taoBaoGoodsUpdateService.offlineTaoBaoGoods((goods.getAuctionId())); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void downTaoBaoGoods(Long auctionId) { |
| | | public void downTaoBaoGoods(String auctionId) { |
| | | recommendActivityTaoBaoGoodsMapper.updateStateByAuctionId(auctionId, |
| | | RecommendActivityTaoBaoGoods.STATE_UNSHELVE); |
| | | } |
| | |
| | | } |
| | | |
| | | // 淘宝商品信息过滤 |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | | |
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate(system); |
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) { |
| | |
| | | * @param listInfo |
| | | * @return |
| | | */ |
| | | private Map<Long, TaoBaoGoodsBrief> getFilterTaoBaoGoods(List<TaoBaoShopVO> listInfo) { |
| | | private Map<String, TaoBaoGoodsBrief> getFilterTaoBaoGoods(List<TaoBaoShopVO> listInfo) { |
| | | // 过滤商品 |
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); |
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) { |
| | | goodsList.addAll(taoBaoShopVO.getListGoodsBrief()); |
| | | } |
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList); |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | for (TaoBaoGoodsBrief goods : goodsList) |
| | | goodsMap.put(goods.getAuctionId(), goods); |
| | | return goodsMap; |
| | |
| | | cid = null; |
| | | } |
| | | |
| | | List<TaoBaoShop> listShop = new ArrayList<TaoBaoShop>(); |
| | | List<TaoBaoShop> listShop = new ArrayList<>(); |
| | | // 第一页 查询全部分类下店铺 |
| | | if (page == 1 && cid != null) { |
| | | List<BrandClassShop> list = brandClassShopMapper.listEffective(cid,system); |
| | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | |
| | | // 淘宝商品信息过滤 |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | | |
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) { |
| | | |
| | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = |
| | | orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | // 淘宝商品信息过滤 |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | | |
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) { |
| | | String shopNameCustom = taoBaoShopVO.getShopNameCustom(); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addBrandShopTB(BrandInfo brandInfo, Long auctionId, Long sellerId) { |
| | | public boolean addBrandShopTB(BrandInfo brandInfo, String auctionId, Long sellerId) { |
| | | TaoBaoShop taoBaoShop = taoBaoShopService.getTaoBaoShop(auctionId, sellerId); |
| | | if (taoBaoShop == null) |
| | | return true; |
| | |
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null; |
| | | String auctionId = activityGoods.getAuctionId(); |
| | | try { |
| | | taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId)); |
| | | taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId); |
| | | |
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, |
| | | proportion.toString(), null); |
| | |
| | | return list; |
| | | } |
| | | |
| | | private Map<Long, TaoBaoGoodsBrief> getFilterGoodsMap(List<DynamicInfo> list) { |
| | | private Map<String, TaoBaoGoodsBrief> getFilterGoodsMap(List<DynamicInfo> list) { |
| | | // 提取过滤商品 |
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); |
| | | for (DynamicInfo dynamicInfo : list) { |
| | |
| | | } |
| | | } |
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList); |
| | | Map<Long, TaoBaoGoodsBrief> map = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> map = new HashMap<>(); |
| | | if (goodsList != null) |
| | | for (TaoBaoGoodsBrief goods : goodsList) |
| | | map.put(goods.getAuctionId(), goods); |
| | |
| | | List<TaoBaoGoodsBrief> taoBaoGoodsUpdateList = new ArrayList<>(); |
| | | if (list != null && list.size() > 0) { |
| | | // 提取商品 |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterGoodsMap(list); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = getFilterGoodsMap(list); |
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(SystemEnum.blks); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(SystemEnum.blks); |
| | |
| | | |
| | | boolean needUpdate = false; |
| | | // 已下架ID |
| | | List<Long> listDown = new ArrayList<Long>(); |
| | | List<String> listDown = new ArrayList<>(); |
| | | // 商品列表 |
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>(); |
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<>(); |
| | | |
| | | for (GoodsPicture goodsPicture : listPicture) { |
| | | TaoBaoGoodsBriefExtra oldExtra = goodsPicture.getGoods(); |
| | |
| | | listNew.add(taoBaoGoodsBrief); |
| | | } else { |
| | | boolean isUpdate = false; |
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | String auctionId = taoBaoGoodsBrief.getAuctionId(); |
| | | for (TaoBaoGoodsBrief goods : listGoods) { |
| | | if (goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) { |
| | | listNew.add(goods); |
| | |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | | goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | throw new GoodsEvaluateException(1, "商品已下架"); |
| | |
| | | String commentText = ""; |
| | | if (addComment) { |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, Long.parseLong(goodsId), "0", null); |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, goodsId, "0", null); |
| | | String template = configService.getValue(ConfigKeyEnum.quickShareTBCommentText.getKey(), system); |
| | | commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | |
| | | private String createTokenAndLink(GoodsDetailVO goodsDetailVO, SystemEnum system) throws Exception { |
| | | String commentText = ""; |
| | | if (goodsDetailVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, Long.parseLong(goodsDetailVO.getGoodsId()), "0", null); |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, goodsDetailVO.getGoodsId(), "0", null); |
| | | String template = configService.getValue(ConfigKeyEnum.quickShareTBCommentText.getKey(), system); |
| | | commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | } else if (goodsDetailVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | |
| | | return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | public GoodsDetailVO getGoodsDetailVO(Long goodsId, Integer goodsType, SystemEnum system) throws GoodsEvaluateException { |
| | | public GoodsDetailVO getGoodsDetailVO(String goodsId, Integer goodsType, SystemEnum system) throws GoodsEvaluateException { |
| | | GoodsDetailVO goodsDetail = null; |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | |
| | | throw new GoodsEvaluateException(1, "商品已下架"); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | goodsDetail = GoodsDetailVOFactory.convertJDGoods(goodsInfo, params); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goodsInfo, params); |
| | | } |
| | | if (goodsDetail != null) |
| | |
| | | for (int i = 0; i < goodsArray.length && i < 9; i++) { |
| | | String goodsids = goodsArray[i]; |
| | | String[] g = goodsids.split("-"); |
| | | GoodsDetailVO goodsDetailVO = getGoodsDetailVO(Long.parseLong(g[0]), Integer.parseInt(g[1]), resultObj.getSystem()); |
| | | GoodsDetailVO goodsDetailVO = getGoodsDetailVO(g[0], Integer.parseInt(g[1]), resultObj.getSystem()); |
| | | if (goodsDetailVO == null) { |
| | | continue; |
| | | } |
| | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods; |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | | goods = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | | if (goods != null) { |
| | | vo = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | } |
| | |
| | | |
| | | TaoBaoGoodsBrief goodsBrief = null; |
| | | try { |
| | | goodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | | goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | throw new GoodsEvaluateException(1, "商品已下架"); |
| | | } |
| | |
| | | } |
| | | Date limitDate = DateUtil.reduceDay(new Date(), 7); |
| | | |
| | | Long goodsId = goodsBrief.getAuctionId(); |
| | | String goodsId = goodsBrief.getAuctionId(); |
| | | List<GoodsEvaluate> evaluateList = goodsEvaluateDao.queryExistLimitTime(Constant.SOURCE_TYPE_TAOBAO, goodsId + "", limitDate); |
| | | if (evaluateList != null && evaluateList.size() > 0) |
| | | throw new GoodsEvaluateException(1, "该商品已存在"); |
| | |
| | | |
| | | // 商品图片信息 |
| | | int i = 0; |
| | | List<ImgInfo> imgList = new ArrayList<ImgInfo>(); |
| | | List<ImgInfo> imgList = new ArrayList<>(); |
| | | |
| | | for (String img : imgs) { |
| | | ImgInfo imgInfo = new ImgInfo(); |
| | |
| | | switch (source) { |
| | | case "tb": |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id)); |
| | | TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(id); |
| | | if (goodsBrief != null && goodsBrief.getImgList() != null) { |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | goods = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void cancelCollectionByAuctionId(Long uid, Long auctionId, Integer goodsType) |
| | | public void cancelCollectionByAuctionId(Long uid, String auctionId, Integer goodsType) |
| | | throws CollectionGoodsException { |
| | | CollectionGoodsV2 goodsV2 = collectionGoodsV2Mapper.selectByUidAndGoodsType(uid, auctionId, goodsType); |
| | | if (goodsV2 == null) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public CollectionGoodsV2 findByUidAndAuctionId(Long uid, Long actionId, Integer goodsType) { |
| | | public CollectionGoodsV2 findByUidAndAuctionId(Long uid, String actionId, Integer goodsType) { |
| | | CollectionGoodsV2 v2 = collectionGoodsV2Mapper.selectByUidAndGoodsType(uid, actionId, goodsType); |
| | | return v2; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void offlineCommonGoods(Long goodsId, Integer goodsType) { |
| | | public void offlineCommonGoods(String goodsId, Integer goodsType) { |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType); |
| | | if (goods == null) |
| | | return; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(Long goodsId, Integer goodsType) { |
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(String goodsId, Integer goodsType) { |
| | | return commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CommonGoods> getByListGoodsId(List<Long> list, Integer goodsType) { |
| | | public List<CommonGoods> getByListGoodsId(List<String> list, Integer goodsType) { |
| | | return commonGoodsMapper.getByListGoodsId(list, goodsType); |
| | | } |
| | | |
| | |
| | | List<QualityFactory> listQuery = qualityGoodsService.listFreeGoods((page - 1) * pageSize, pageSize); |
| | | long count = qualityGoodsService.countFreeGoods(); |
| | | result.setCount(count); |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); |
| | | for (QualityFactory qualityFactory : listQuery) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief(); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | if (listTaoKeGoods != null) |
| | | for (TaoBaoGoodsBrief goods : listTaoKeGoods) |
| | | goodsMap.put(goods.getAuctionId(), goods); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public UserShareGoodsHistory addShareGoodsHistory(Long uid, Long auctionId) throws ShareGoodsException { |
| | | public UserShareGoodsHistory addShareGoodsHistory(Long uid, String auctionId) throws ShareGoodsException { |
| | | TBPid tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_SHARE_GOODS); |
| | | if (tbPid == null) { |
| | | throw new ShareGoodsException(1, "获取PID失败"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public UserShareGoodsHistory getShareGoodsHistoryDetail(Long uid, Long auctionId) throws ShareGoodsException { |
| | | public UserShareGoodsHistory getShareGoodsHistoryDetail(Long uid, String auctionId) throws ShareGoodsException { |
| | | UserShareGoodsHistory userShareGoodsHistory = userShareGoodsHistoryMapper.selectByUidAndAuctionId(uid, |
| | | auctionId); |
| | | if (userShareGoodsHistory == null) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException { |
| | | public TaoBaoLink getTaoBaoLink(Long uid, String auctionId, String pid) throws ShareGoodsException { |
| | | |
| | | if (uid == null || uid <= 0) { |
| | | throw new ShareGoodsException(1, "用户ID不能为空"); |
| | | } |
| | | |
| | | if (auctionId == null || auctionId <= 0) { |
| | | if (StringUtil.isNullOrEmpty(auctionId)) { |
| | | throw new ShareGoodsException(2, "商品ID不能为空"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public UserShareGoodsHistory getShareGoodsHistory(Long uid, Long auctionId) { |
| | | public UserShareGoodsHistory getShareGoodsHistory(Long uid, String auctionId) { |
| | | return userShareGoodsHistoryMapper.selectByUidAndAuctionId(uid, auctionId); |
| | | } |
| | | |
| | | @Override |
| | | public TaoBaoLink getTaoLiJinLinkForBuyWithOutFanLi(Long uid, Long auctionId, TaoKeAppInfo app) |
| | | public TaoBaoLink getTaoLiJinLinkForBuyWithOutFanLi(Long uid, String auctionId, TaoKeAppInfo app) |
| | | throws ShareGoodsException, TaoLiJinCreateException { |
| | | if (uid == null || uid <= 0) { |
| | | throw new ShareGoodsException(1, "用户ID不能为空"); |
| | | } |
| | | |
| | | if (auctionId == null || auctionId <= 0) { |
| | | if (StringUtil.isNullOrEmpty(auctionId)) { |
| | | throw new ShareGoodsException(2, "商品ID不能为空"); |
| | | } |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteBatchByGoodsId(List<Long> list) { |
| | | public void deleteBatchByGoodsId(List<String> list) { |
| | | taoBaoGoodsBriefMapper.deleteBatchByGoodsId(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<TaoBaoGoodsBrief> queryByAuctionId(Long auctionId) { |
| | | public List<TaoBaoGoodsBrief> queryByAuctionId(String auctionId) { |
| | | return taoBaoGoodsBriefMapper.queryByAuctionId(auctionId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> listExistById(List<Long> list) { |
| | | public List<Long> listExistById(List<String> list) { |
| | | if (list != null && list.size() > 0) |
| | | return taoBaoGoodsBriefMapper.listExistById(list); |
| | | else |
| | |
| | | @Override |
| | | public TaoBaoGoodsBrief selectByPrimaryKey(Long id) { |
| | | return taoBaoGoodsBriefMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | @Override |
| | | public TaoBaoGoodsBrief selectByGoodsId(String goodsId) { |
| | | List<TaoBaoGoodsBrief> list = queryByAuctionId(goodsId); |
| | | if(list!=null&&list.size()>0){ |
| | | return list.get(list.size()-1); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TaoBaoGoodsBrief getTaoBaoGoodsDetailForShare(Long auctionId, Long uid) throws ShareGoodsException { |
| | | public TaoBaoGoodsBrief getTaoBaoGoodsDetailForShare(String auctionId, Long uid) throws ShareGoodsException { |
| | | if (uid == null || uid == 0) |
| | | throw new ShareGoodsException(201, "用户ID为空"); |
| | | if (auctionId == null || auctionId == 0) |
| | | if (StringUtil.isNullOrEmpty(auctionId)) |
| | | throw new ShareGoodsException(202, "商品ID为空"); |
| | | // 获取PID信息 |
| | | TBPid tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_SHARE_GOODS); |
| | |
| | | ids += goods.getAuctionId() + ","; |
| | | } |
| | | ids = ids.endsWith(",") ? ids.substring(0, ids.length() - 1) : ids; |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | try { |
| | | List<TaoBaoGoodsBrief> finalList = TaoKeApiUtil.getBatchGoodsInfos(ids); |
| | | if (finalList != null) |
| | |
| | | if (list.size() > 20) |
| | | list = list.subList(0, 20); |
| | | List<TaoBaoGoodsBrief> finalList = new ArrayList<>(); |
| | | Map<Long, TLJBuyGoods> map = new ConcurrentHashMap<>(); |
| | | Map<String, TLJBuyGoods> map = new ConcurrentHashMap<>(); |
| | | if (list != null) |
| | | for (TLJBuyGoods goods : list) { |
| | | try { |
| | | if (goods.getGoods().getAuctionId() == null) { |
| | | goods.getGoods().setAuctionId(goods.getGoods().getId()); |
| | | goods.getGoods().setAuctionId(goods.getGoods().getAuctionId()); |
| | | } |
| | | map.put(goods.getGoods().getAuctionId(), goods); |
| | | finalList.add(goods.getGoods()); |
| | |
| | | if (goodsList == null || goodsList.size() == 0) |
| | | return goodsList; |
| | | |
| | | Map<Long, TaoBaoGoodsBrief> resultMap = new ConcurrentHashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> resultMap = new ConcurrentHashMap<>(); |
| | | List<RecommendGoodsDeleteHistory> hlist = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : goodsList) { |
| | | hlist.add(new RecommendGoodsDeleteHistory(goods.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO)); |
| | |
| | | |
| | | if (ids != null && ids.size() > 0) { |
| | | for (String gid: ids) { |
| | | Long goodsId = Long.parseLong(gid); |
| | | labelGoodsMapper.deleteByGoodsId(goodsId); |
| | | labelGoodsMapper.deleteByGoodsId(gid); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int deleteByGoodsIdAndLabId(Long goodsId, Long labId){ |
| | | public int deleteByGoodsIdAndLabId(String goodsId, Long labId){ |
| | | return labelGoodsMapper.deleteByGoodsIdAndLabId(goodsId, labId); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<LabelGoods> queryByGoodsId(int start, int count, Long goodsId) throws LabelClassException { |
| | | public List<LabelGoods> queryByGoodsId(int start, int count, String goodsId) throws LabelClassException { |
| | | return labelGoodsMapper.queryByGoodsId(start, count, goodsId); |
| | | } |
| | | |
| | | @Override |
| | | public int getCountQueryByGoodsId(Long goodsId){ |
| | | public int getCountQueryByGoodsId(String goodsId){ |
| | | return labelGoodsMapper.getCountQueryByGoodsId(goodsId); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getCountByGoodsId(Long goodsId){ |
| | | public int getCountByGoodsId(String goodsId){ |
| | | return labelGoodsMapper.getCountByGoodsId(goodsId); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Long isExistence(Long goodsId, Long labId){ |
| | | public Long isExistence(String goodsId, Long labId){ |
| | | return labelGoodsMapper.isExistence(goodsId, labId); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor=Exception.class) |
| | | public void batchGoodsAddLables(List<Long> goodsIdList, List<Long> labIdList, AdminUser admin) throws Exception { |
| | | public void batchGoodsAddLables(List<String> goodsIdList, List<Long> labIdList, AdminUser admin) throws Exception { |
| | | |
| | | /* 商品id 为空 不处理 */ |
| | | if (goodsIdList == null || goodsIdList.size() == 0) { |
| | |
| | | } |
| | | |
| | | |
| | | for (Long goodsId: goodsIdList) { |
| | | for (String goodsId: goodsIdList) { |
| | | |
| | | TaoBaoGoodsBrief goodsBrief = taoBaoGoodsBriefService.selectByPrimaryKey(goodsId); |
| | | TaoBaoGoodsBrief goodsBrief = taoBaoGoodsBriefService.selectByGoodsId(goodsId); |
| | | |
| | | if (goodsBrief != null) { |
| | | /* 贴上标签 : 已贴不处理则 */ |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor=Exception.class) |
| | | public void singleGoodsAddLables(Long goodsId, List<Long> labIdList, AdminUser admin) throws Exception { |
| | | public void singleGoodsAddLables(String goodsId, List<Long> labIdList, AdminUser admin) throws Exception { |
| | | |
| | | /* 商品id 为空 不处理 */ |
| | | if (goodsId == null) { |
| | |
| | | return; |
| | | } |
| | | |
| | | TaoBaoGoodsBrief goodsBrief = taoBaoGoodsBriefService.selectByPrimaryKey(goodsId); |
| | | TaoBaoGoodsBrief goodsBrief = taoBaoGoodsBriefService.selectByGoodsId(goodsId); |
| | | if (goodsBrief == null) { |
| | | return; |
| | | } |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void deleteByTaoBaoGoodsId(Long auctionId) { |
| | | public void deleteByTaoBaoGoodsId(String auctionId) { |
| | | if (auctionId == null) |
| | | return; |
| | | |
| | |
| | | package com.yeshi.fanli.service.impl.lable; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public void deleteByTaoBaoGoodsId(Long auctionId) { |
| | | public void deleteByTaoBaoGoodsId(String auctionId) { |
| | | if (auctionId == null) { |
| | | return; |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public void deleteBatchByTaoBaoGoodsId(List<Long> listGid) { |
| | | public void deleteBatchByTaoBaoGoodsId(List<String> listGid) { |
| | | |
| | | if (listGid == null || listGid.size() == 0) { |
| | | return; |
| | |
| | | |
| | | if (ids != null && ids.size() > 0) { |
| | | for (String goodsId : ids) { |
| | | qualityFactoryMapper.deleteByGoodsId(Long.parseLong(goodsId)); |
| | | qualityFactoryMapper.deleteByGoodsId(goodsId); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime){ |
| | | public List<String> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime){ |
| | | return qualityFactoryMapper.getAuctionIdbyClassId(systemCid, goodsSource, dateTime); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Long queryCountByGoodsId(Long goodsId) { |
| | | public Long queryCountByGoodsId(String goodsId) { |
| | | return qualityFactoryMapper.queryCountByGoodsId(goodsId); |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityFactory> listQueryByAuctionId(List<Long> list) { |
| | | public List<QualityFactory> listQueryByAuctionId(List<String> list) { |
| | | return qualityFactoryMapper.listQueryByAuctionId(list); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 插入商品淘宝ID集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : listTaoBaoGoods) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 遍历商品 |
| | | for (TaoBaoGoodsBrief newGoodsBrief : listTaoBaoGoods) { |
| | | Long auctionId = newGoodsBrief.getAuctionId(); |
| | | String auctionId = newGoodsBrief.getAuctionId(); |
| | | // 设置成主键 |
| | | newGoodsBrief.setId(auctionId); |
| | | newGoodsBrief.setAuctionId(auctionId); |
| | | newGoodsBrief.setState(0); // 状态启用 |
| | | newGoodsBrief.setCreatetime(new Date()); |
| | | newGoodsBrief.setUpdatetime(new Date()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateQualityGoods(Long goodsId) { |
| | | public void updateQualityGoods(String goodsId) { |
| | | if (goodsId == null) { |
| | | return; |
| | | } |
| | |
| | | // 移除精选库 |
| | | if (isDelete) { |
| | | deleteByTaoBaoGoodsId(goodsId); |
| | | taoBaoGoodsBriefService.deleteByPrimaryKey(goodsId); |
| | | taoBaoGoodsBriefService.deleteBatchByGoodsId(Arrays.asList(new String[]{ goodsId})); |
| | | return; |
| | | } |
| | | |
| | | goods.setId(goodsId); |
| | | goods.setAuctionId(goodsId); |
| | | goods.setCreatetime(new Date()); |
| | | goods.setUpdatetime(new Date()); |
| | | try { |
| | |
| | | List<QualityFactory> listUpdateQuality = new ArrayList<QualityFactory>(); |
| | | |
| | | // 插入商品淘宝ID集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsList) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 遍历商品 |
| | | for (TaoBaoGoodsBrief newGoodsBrief : goodsList) { |
| | | Long auctionId = newGoodsBrief.getAuctionId(); |
| | | String auctionId = newGoodsBrief.getAuctionId(); |
| | | // 设置成主键 |
| | | newGoodsBrief.setId(auctionId); |
| | | newGoodsBrief.setAuctionId(auctionId); |
| | | newGoodsBrief.setState(0); // 状态启用 |
| | | newGoodsBrief.setCreatetime(new Date()); |
| | | newGoodsBrief.setUpdatetime(new Date()); |
| | |
| | | |
| | | /** |
| | | * 限时秒杀 |
| | | * @param listinsert |
| | | * @param listUpdate |
| | | * @param listGoods |
| | | * @param autoRule |
| | | */ |
| | | public void updateQualityFlashSale(List<TaoBaoGoodsBrief> listGoods, BoutiqueAutoRule autoRule) { |
| | |
| | | /** |
| | | * 创建新对象QualityFlashSale |
| | | * |
| | | * @param qfId |
| | | * @param i |
| | | * @return |
| | | */ |
| | | public QualityFlashSale getNewQualityFlashSale(TaoBaoGoodsBrief taoBaoGoodsBrief, int startWeight, |
| | |
| | | * 商品加入精选库-new QualityFactory() |
| | | * |
| | | * @param goodsBrief |
| | | * @param admin |
| | | * @param autoRule |
| | | * @return |
| | | */ |
| | | public QualityFactory getNewQualityFactory(TaoBaoGoodsBrief goodsBrief, BoutiqueAutoRule autoRule) { |
| | |
| | | */ |
| | | @Override |
| | | public void deleteNotUpdateGoods(Long systemCid, String formatDate, int source) { |
| | | List<Long> list = qualityFactoryMapper.getAuctionIdbyClassId(systemCid, source, formatDate); |
| | | List<String> list = qualityFactoryMapper.getAuctionIdbyClassId(systemCid, source, formatDate); |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | for (int i = 0; i < count; i++) { |
| | | List<Long> sublist = new ArrayList<Long>(); |
| | | List<String> sublist = new ArrayList<>(); |
| | | if (i == count - 1) { |
| | | sublist = list.subList(start, list.size()); |
| | | deleteBatchByTaoBaoGoodsId(sublist); |
| | |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param classId |
| | | * 分类id |
| | | * @param labId |
| | | * 标签id |
| | | * @return |
| | | */ |
| | |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param labId |
| | | * @return |
| | | */ |
| | | public List<QualityFactory> listQueryByKeyAndlabIDs(long start, int count, String key, List<Long> listId, |
| | |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param labId |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param labId |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityFactory> recommendByAuctionId(Long auctionId) { |
| | | public List<QualityFactory> recommendByAuctionId(String auctionId) { |
| | | |
| | | List<Long> list = new ArrayList<Long>(); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(auctionId); |
| | | List<QualityFactory> listTaoBaoGoods = qualityFactoryMapper.listQueryByAuctionId(list); |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | List<LabelGoods> listLab = labelGoodsMapper.queryByGoodsId(0, 200, goodsBrief.getId()); |
| | | List<LabelGoods> listLab = labelGoodsMapper.queryByGoodsId(0, 200, goodsBrief.getAuctionId()); |
| | | if (listLab == null || listLab.size() == 0) { |
| | | return null; |
| | | } |
| | |
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : list) { |
| | | weiQuanDrawBack = taoBaoWeiQuanDrawBackMapper.selectByOrderItemIdAndUid(weiQuanOrder.getOrderItemId(), |
| | | uid); |
| | | if (weiQuanDrawBack != null) |
| | | if (weiQuanDrawBack != null) { |
| | | weiQuanDrawBack = null; |
| | | continue; |
| | | } |
| | | // 计算结算金额 |
| | | TaoBaoOrder taoBaoOrder = taoBaoOrderMapper.selectTaoBaoOrderByTradeId(weiQuanOrder.getOrderItemId()); |
| | | if (taoBaoOrder == null) |
| | |
| | | UserMoneyDetail userMoneyDetail = null; |
| | | // 新版资金记录 |
| | | try { |
| | | userMoneyDetail = UserMoneyDetailFactory.createFanLiWeiQuan(uid, weiQuanDrawBack, drawBackMoney); |
| | | userMoneyDetail = UserMoneyDetailFactory.createFanLiWeiQuan(uid, orderId, newWeiQuanDrawBackList, drawBackMoney); |
| | | } catch (UserMoneyDetailException e) { |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | |
| | | UserMoneyDetail userMoneyDetail = null; |
| | | // 新版资金记录 |
| | | try { |
| | | userMoneyDetail = UserMoneyDetailFactory.createFanLiWeiQuan(uid, weiQuanDrawBack, drawBackMoney); |
| | | userMoneyDetail = UserMoneyDetailFactory.createFanLiWeiQuan(uid, orderId, newWeiQuanDrawBackList, drawBackMoney); |
| | | } catch (UserMoneyDetailException e) { |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.service.inter.order.pdd.PDDOrderService; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Service |
| | | public class CommonOrderServiceImpl implements CommonOrderService { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(CommonOrderService.class); |
| | | |
| | | |
| | | @Resource |
| | | private CommonOrderMapper commonOrderMapper; |
| | |
| | | taoBaoGoods.getRootCategoryName(), taoBaoGoods.getLeafName())); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), ""); |
| | | logger.warn("淘宝商品下架:{}", taoBaoOrder.getAuctionId(), e); |
| | | try { |
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId()); |
| | | // 记录商品分类 |
| | | |
| | | } catch (Exception e1) { |
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType( |
| | | taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO); |
| | |
| | | hongBao.setState(HongBaoV2.STATE_SHIXIAO); |
| | | hongBao.setMoney(new BigDecimal(0)); |
| | | } else { |
| | | throw new HongBaoException(3, "维权订单不能创建红包"); |
| | | throw new HongBaoException(HongBaoException.CODE_ORDER_WEIQUAN, "维权订单不能创建红包"); |
| | | } |
| | | |
| | | if (mianDanMoney != null) |
| | |
| | | } |
| | | BigDecimal rate = null; |
| | | if (order.getThirdCreateTime().getTime() >= Constant.NEW_ORDER_FANLI_RULE_TIME) { |
| | | rate = getTeamRewardRate(buyer, bossLevelList, order.getThirdCreateTime(), 2, system).getRate(); |
| | | UserTeamRate teamRate = getTeamRewardRate(buyer, bossLevelList, order.getThirdCreateTime(), 2, system); |
| | | if (teamRate != null) { |
| | | rate = teamRate.getRate(); |
| | | } |
| | | if (rate == null) |
| | | return null; |
| | | if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ) |
| | |
| | | @Override |
| | | public TransactionStatus execute(Message arg0, Object arg1) { |
| | | try { |
| | | fanLiShareTB(hongBaoList, uid, taskKey); |
| | | fanLiShareTB(hongBaoList, uid, taskKey,maxPregetTime); |
| | | } catch (TaoBaoWeiQuanException e) { |
| | | return TransactionStatus.RollbackTransaction; |
| | | } |
| | |
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() { |
| | | @Override |
| | | public TransactionStatus execute(Message arg0, Object arg1) { |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey); |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey,maxPregetTime); |
| | | return TransactionStatus.CommitTransaction; |
| | | } |
| | | }, null); |
| | |
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() { |
| | | @Override |
| | | public TransactionStatus execute(Message arg0, Object arg1) { |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey); |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey,maxPregetTime); |
| | | return TransactionStatus.CommitTransaction; |
| | | } |
| | | }, null); |
| | |
| | | Map<Long, Integer> userGoodsCount = new HashMap<>(); |
| | | for (CommonOrder co : orderList) { |
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(co.getId()); |
| | | if (hongBaoOrder == null) { |
| | | continue; |
| | | } |
| | | hongBaoList.add(hongBaoOrder.getHongBaoV2()); |
| | | Long uid = co.getUserInfo().getId(); |
| | | if (userGoodsCount.get(uid) == null) |
| | |
| | | * @param uid |
| | | * @throws TaoBaoWeiQuanException |
| | | */ |
| | | private void fanLiShareTB(List<HongBaoV2> hongBaoList, Long uid, String key) throws TaoBaoWeiQuanException { |
| | | private void fanLiShareTB(List<HongBaoV2> hongBaoList, Long uid, String key,Date recieveMonth) throws TaoBaoWeiQuanException { |
| | | BigDecimal sharemoney = new BigDecimal(0); |
| | | List<Long> hbIdList = new ArrayList<>(); |
| | | Set<String> drawBackOrders = new HashSet<String>(); |
| | |
| | | // 添加新版详情记录 |
| | | try { |
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, Constant.SOURCE_TYPE_TAOBAO, |
| | | sharemoney, new Date()); |
| | | sharemoney,recieveMonth); |
| | | // 添加资金 |
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail); |
| | | |
| | |
| | | * @param uid |
| | | * @param sourceType |
| | | */ |
| | | private void fanLiShareOther(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key) { |
| | | private void fanLiShareOther(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key,Date recieveMonth) { |
| | | BigDecimal sharemoney = new BigDecimal(0); |
| | | List<Long> hbIdList = new ArrayList<>(); |
| | | List<Long> recieveHongBaoIds = new ArrayList<>(); |
| | |
| | | // 添加新版详情记录 |
| | | try { |
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, sharemoney, |
| | | new Date()); |
| | | recieveMonth); |
| | | // 添加资金 |
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail); |
| | | |
| | |
| | | else |
| | | result = hongBaoV2AddManager.addHongBao(coList, hongBaoType); |
| | | } catch (HongBaoException e) { |
| | | if (e.getCode() != HongBaoException.CODE_ORDER_WEIQUAN) { |
| | | try { |
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + orderId); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } catch (UserAccountException e) { |
| | | |
| | | } |
| | | if (result == null) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (!Constant.IS_TEST) |
| | | if (result.getResultCode() == HongBaoAddResult.CODE_ADD) {// 只发送新增消息 |
| | | OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD, |
| | |
| | | |
| | | } |
| | | |
| | | private CommonOrderGoods getCommonOrderGoods(Long auctionId) { |
| | | private CommonOrderGoods getCommonOrderGoods(String auctionId) { |
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(auctionId + "", |
| | | Constant.SOURCE_TYPE_TAOBAO); |
| | | CommonOrderGoods cog = null; |
| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addOrder(CommonOrder commonOrder, int type, Long firstUid, Long secondUid) throws Exception { |
| | | public void addOrder(CommonOrder commonOrder, int type, Long firstUid, Long secondUid) throws HongBaoException { |
| | | // 增加commonOrder |
| | | commonOrder.setCreateTime(commonOrder.getThirdCreateTime()); |
| | | // 不存在就插入,存在就不管 |
| | |
| | | hongBao.setState(HongBaoV2.STATE_SHIXIAO); |
| | | hongBao.setMoney(new BigDecimal(0)); |
| | | } else { |
| | | throw new HongBaoException(3, "维权订单不能创建红包"); |
| | | throw new HongBaoException(HongBaoException.CODE_ORDER_WEIQUAN, "维权订单不能创建红包"); |
| | | } |
| | | |
| | | if (mianDanMoney != null) |
| | |
| | | } |
| | | |
| | | } else |
| | | throw new HongBaoException(2, "type错误"); |
| | | throw new HongBaoException(HongBaoException.CODE_TYPE_ERROR, "type错误"); |
| | | |
| | | // 添加 |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, PushBaseContent baseContent) |
| | | public void pushGoods(Long uid, String auctionId, PushBaseContent baseContent) |
| | | throws PushException { |
| | | addPushQueue(PushTypeEnum.goodsdetail, uid, null, null, auctionId, baseContent); |
| | | } |
| | |
| | | |
| | | //添加到推送队列 |
| | | private void addPushQueue(PushTypeEnum type, Long uid, String url, String webUrl, |
| | | Long goodsId, PushBaseContent content) { |
| | | String goodsId, PushBaseContent content) { |
| | | //添加到推送队列 |
| | | PushContentDetailDTO dto = new PushContentDetailDTO(type, uid, url, webUrl, goodsId, content); |
| | | PushCMQManager.getInstance().addHWPush(dto); |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, String title, String content, String versionCodes, SystemEnum system) |
| | | public void pushGoods(Long uid, String auctionId, String title, String content, String versionCodes, SystemEnum system) |
| | | throws PushException { |
| | | |
| | | String url = "https://item.taobao.com/item.htm?id=" + auctionId; |
| | |
| | | |
| | | /** |
| | | * 保存推送内容只队列中 |
| | | * |
| | | * @param json |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addPushIOSQueue(MessageInfo info, String url, int type, String versionCodes,SystemEnum system) throws PushException { |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, PushBaseContent baseContent) |
| | | public void pushGoods(Long uid, String auctionId, PushBaseContent baseContent) |
| | | throws PushException { |
| | | push(PushTypeEnum.goodsdetail, uid, null, null, auctionId, baseContent); |
| | | } |
| | |
| | | * @param webUrl |
| | | */ |
| | | private void push(PushTypeEnum type, Long uid, String url, String webUrl, |
| | | Long goodsId, PushBaseContent content) throws PushException { |
| | | String goodsId, PushBaseContent content) throws PushException { |
| | | int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); |
| | | List<Integer> newVersionList = getVersionCodeList(content.getVersionCodeList(), content.getSystem()); |
| | | // 1.6.5后开始推送 |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor=Exception.class) |
| | | public void save(PushGoods record, List<Long> goodsIds) throws PushGoodsException, Exception { |
| | | public void save(PushGoods record, List<String> goodsIds) throws PushGoodsException, Exception { |
| | | // 定时时间 |
| | | if (StringUtil.isNullOrEmpty(record.getControlTime_str())) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor=Exception.class) |
| | | public void saveGoodsInfo(boolean isAdd, Long pushId, List<Long> goodsIds) throws Exception { |
| | | public void saveGoodsInfo(boolean isAdd, Long pushId, List<String> goodsIds) throws Exception { |
| | | if (goodsIds == null || goodsIds.size() == 0) { |
| | | if (!isAdd) { |
| | | pushGoodsGroupService.deleteByPushId(pushId); |
| | |
| | | } |
| | | |
| | | // 商品信息获取与保存 |
| | | List<Long> listCommonId = new ArrayList<Long>(); |
| | | for (Long auctionId : goodsIds) { |
| | | List<Long> listCommonId = new ArrayList<>(); |
| | | for (String auctionId : goodsIds) { |
| | | // 获取商品详情 |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(auctionId); |
| | |
| | | throw new PushGoodsException(1, "商品详细信息已不存在"); |
| | | } |
| | | |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | String url = "https://item.taobao.com/item.htm?id=" + goodsId; |
| | | pushService.pushGoods(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url,listIOS, listAndroid,pushGoods.getSystem()); |
| | | } else { |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes, system); |
| | | iosPushService.pushGoods(uid, gid, title, content, codes, system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions, system); |
| | | xmPushService.pushGoods(uid, gid, title, content, versions, system); |
| | | } |
| | | // 华为推送 |
| | | if (listAndroid == null || listAndroid.size() > 0) { |
| | | List<Integer> versionCodeList = null; |
| | | if (listAndroid != null) |
| | | versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system); |
| | | hwPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system)); |
| | | hwPushService.pushGoods(uid, gid, new PushBaseContent(title, content, versionCodeList, system)); |
| | | } |
| | | |
| | | // OPPO推送 |
| | |
| | | List<Integer> versionCodeList = null; |
| | | if (listAndroid != null) |
| | | versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system); |
| | | oPPOPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system)); |
| | | oPPOPushService.pushGoods(uid, gid, new PushBaseContent(title, content, versionCodeList, system)); |
| | | } |
| | | // VIVO推送 |
| | | if (listAndroid == null || listAndroid.size() > 0) { |
| | | List<Integer> versionCodeList = null; |
| | | if (listAndroid != null) |
| | | versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system); |
| | | vIVOPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system)); |
| | | vIVOPushService.pushGoods(uid, gid, new PushBaseContent(title, content, versionCodeList, system)); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, PushBaseContent content) |
| | | public void pushGoods(Long uid, String auctionId, PushBaseContent content) |
| | | throws PushException { |
| | | push(PushTypeEnum.goodsdetail, uid, null, null, auctionId, content); |
| | | } |
| | |
| | | * @param webUrl |
| | | */ |
| | | private void push(PushTypeEnum type, Long uid, String url, String webUrl, |
| | | Long goodsId, PushBaseContent content) throws PushException { |
| | | String goodsId, PushBaseContent content) throws PushException { |
| | | |
| | | String androidBaseActivity=getAndroidBaseActivity(content.getSystem()); |
| | | int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, String title, String content, String versions, SystemEnum system) |
| | | public void pushGoods(Long uid, String auctionId, String title, String content, String versions, SystemEnum system) |
| | | throws PushException { |
| | | |
| | | String gid = auctionId + ""; |
| | |
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList); |
| | | // 添加大淘客信息 |
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList); |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | if (goodsList != null) |
| | | for (TaoBaoGoodsBrief g : goodsList) |
| | | goodsMap.put(g.getAuctionId(), g); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByGoodsId(Long goodsId) { |
| | | public void deleteByGoodsId(String goodsId) { |
| | | shareHotGoodsDao.deleteByGoodsId(goodsId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean verifyCanCreateTLJ(Long auctionId, TaoKeAppInfo info) { |
| | | public boolean verifyCanCreateTLJ(String auctionId, TaoKeAppInfo info) { |
| | | try { |
| | | TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金验证", new BigDecimal("1.00"), 1, new Date(), |
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6), new Date(), |
| | |
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList); |
| | | // 添加大淘客信息 |
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList); |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | if (goodsList != null) |
| | | for (TaoBaoGoodsBrief g : goodsList) |
| | | goodsMap.put(g.getAuctionId(), g); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByGoodsId(Long goodsId) { |
| | | public void deleteByGoodsId(String goodsId) { |
| | | tljBuyGoodsDao.deleteByGoodsId(goodsId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean verifyCanCreateTLJ(Long auctionId, TaoKeAppInfo app) { |
| | | public boolean verifyCanCreateTLJ(String auctionId, TaoKeAppInfo app) { |
| | | TaoLiJinDTO taoLiJinDTO = null; |
| | | try { |
| | | taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金验证", new BigDecimal("1.00"), 1, new Date(), |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void subHongBaoLeftCount(Long auctionId, String day, int count) { |
| | | public void subHongBaoLeftCount(String auctionId, String day, int count) { |
| | | TLJBuyGoods goods = tljBuyGoodsDao.selectByAuctionIdAndDay(auctionId, day); |
| | | if (goods != null) { |
| | | tljBuyGoodsDao.subHongBaoCount(goods.getId(), count); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TLJBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) { |
| | | public TLJBuyGoods selectByAuctionIdAndDay(String auctionId, String day) { |
| | | return tljBuyGoodsDao.selectByAuctionIdAndDay(auctionId, day); |
| | | } |
| | | |
| | | @Override |
| | | public void removeGoods(Long auctionId) { |
| | | public void removeGoods(String auctionId) { |
| | | tljBuyGoodsDao.deleteByAuctionId(auctionId); |
| | | // 清除列表缓存 |
| | | ehCacheCacheManager.getCache("commonContentCache") |
| | |
| | | // 添加大淘客信息 |
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList); |
| | | |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>(); |
| | | if (goodsList != null) |
| | | for (TaoBaoGoodsBrief g : goodsList) |
| | | goodsMap.put(g.getAuctionId(), g); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByGoodsId(Long auctionId) { |
| | | public void deleteByGoodsId(String auctionId) { |
| | | tljFreeBuyGoodsDao.deleteByGoodsId(auctionId); |
| | | // 清除列表缓存 |
| | | ehCacheCacheManager.getCache("commonContentCache") |
| | |
| | | |
| | | |
| | | @Override |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) { |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(String auctionId, String day) { |
| | | return tljFreeBuyGoodsDao.selectByAuctionIdAndDay(auctionId, day); |
| | | } |
| | | |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void deleteTaoBaoGoods(Long auctionId) { |
| | | public void deleteTaoBaoGoods(String auctionId) { |
| | | // 删除精选库相关的数据 |
| | | qualityFactoryGoodsUpdateService.deleteByTaoBaoGoodsId(auctionId); |
| | | |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void offlineTaoBaoGoods(Long auctionId) { |
| | | public void offlineTaoBaoGoods(String auctionId) { |
| | | // 更新动态数据 |
| | | activityGoodsUpdateService.downTaoBaoGoods(auctionId); |
| | | |
| | |
| | | if (goods == null) |
| | | throw new TaobaoGoodsUpdateException(1, "商品为空"); |
| | | |
| | | if (goods.getAuctionId() == null || goods.getAuctionId() == 0) |
| | | if (StringUtil.isNullOrEmpty( goods.getAuctionId())) |
| | | throw new TaobaoGoodsUpdateException(2, "商品ID为空"); |
| | | |
| | | // 设置商品正常上线 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | TaoBaoGoodsBrief tb = taoBaoGoodsBriefMapper.selectByPrimaryKey(goods.getAuctionId()); |
| | | TaoBaoGoodsBrief tb = taoBaoGoodsBriefMapper.selectOneByAuctionId(goods.getAuctionId()); |
| | | if (tb != null) { |
| | | goods.setId(tb.getId()); |
| | | TaoBaoGoodsBrief updateGoods = getUpdateTaoBaoGoodsBrief(goods); |
| | |
| | | |
| | | @Override |
| | | public void deleteOutOfDate() { |
| | | List<Long> list = taoBaoGoodsBriefMapper |
| | | List<String> list = taoBaoGoodsBriefMapper |
| | | .queryCanDeleteGoods(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), 0, 2000); |
| | | for (Long auctionId : list) { |
| | | for (String auctionId : list) { |
| | | deleteTaoBaoGoods(auctionId); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> listNeedUpdateGoodsId(long start, int count, int hour) { |
| | | public List<String> listNeedUpdateGoodsId(long start, int count, int hour) { |
| | | return taoBaoGoodsBriefMapper.listNeedUpdateGoodsId(start, count, hour); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByTaoKeGoodsDetail(Long id) { |
| | | public void updateByTaoKeGoodsDetail(String goodsId) { |
| | | try { |
| | | TaoBaoGoodsBrief oldGoods = taoBaoGoodsBriefMapper.selectByPrimaryKey(id); |
| | | TaoBaoGoodsBrief oldGoods = taoBaoGoodsBriefMapper.selectOneByAuctionId(goodsId); |
| | | if (oldGoods == null) { |
| | | return; |
| | | } |
| | | |
| | | TaoBaoGoodsBrief newGoods = TaoKeApiUtil.searchGoodsDetail(id); |
| | | TaoBaoGoodsBrief newGoods = TaoKeApiUtil.searchGoodsDetail(oldGoods.getAuctionId()); |
| | | if (newGoods == null) { |
| | | return; |
| | | } |
| | | |
| | | // 更新精选商品 |
| | | newGoods.setId(id); |
| | | newGoods.setId(oldGoods.getId()); |
| | | TaoBaoGoodsBrief updateGoods = getUpdateTaoBaoGoodsBrief(newGoods); |
| | | taoBaoGoodsBriefMapper.updateByPrimaryKeySelective(updateGoods); |
| | | |
| | |
| | | } |
| | | |
| | | } catch (TaobaoGoodsDownException e) { |
| | | offlineTaoBaoGoods(id); |
| | | offlineTaoBaoGoods(goodsId); |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | |
| | | return; |
| | | } |
| | | goods.setUpdatetime(new Date()); |
| | | if (goods.getId() == null) |
| | | goods.setId(goods.getAuctionId()); |
| | | taoBaoGoodsUpdateDao.save(goods); |
| | | taoBaoGoodsCacheUtil.addUpdateHistory(goods.getAuctionId()); |
| | | } |
| | | |
| | | @Async |
| | | @Override |
| | | public void addUpdateQueueAsync(Long auctionId) { |
| | | public void addUpdateQueueAsync(String auctionId) { |
| | | addUpdateQueueSync(auctionId); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | private void addUpdateQueueSync(Long auctionId) { |
| | | private void addUpdateQueueSync(String auctionId) { |
| | | try { |
| | | if (taoBaoGoodsCacheUtil.canAddToUpdateQueue(auctionId)) { |
| | | // 添加到更新队列 |
| | |
| | | |
| | | // 商品过滤不允许出错 |
| | | try { |
| | | Map<Long, TaoBaoGoodsBrief> finalMap = new HashMap<>(); |
| | | Map<String, TaoBaoGoodsBrief> finalMap = new HashMap<>(); |
| | | // 原始数据全覆盖 |
| | | for (TaoBaoGoodsBrief goods : goodsList) { |
| | | finalMap.put(goods.getAuctionId(), goods); |
| | |
| | | } |
| | | |
| | | // 再从mongodb中取覆盖 |
| | | List<Long> auctionIds = new ArrayList<>(); |
| | | List<String> auctionIds = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : tempGoodsList) { |
| | | auctionIds.add(goods.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 商品过滤不允许出错 |
| | | try { |
| | | Map<Long, CommonGoods> finalMap = new HashMap<>(); |
| | | Map<String, CommonGoods> finalMap = new HashMap<>(); |
| | | // 原始数据全覆盖 |
| | | List<CommonGoods> tempGoodsList = new ArrayList<>(); |
| | | for (CommonGoods goods : goodsList) { |
| | |
| | | } |
| | | |
| | | // 再从mongodb中取覆盖 |
| | | List<Long> auctionIds = new ArrayList<>(); |
| | | List<String> auctionIds = new ArrayList<>(); |
| | | for (CommonGoods goods : tempGoodsList) { |
| | | auctionIds.add(goods.getGoodsId()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TaoBaoShop getTaoBaoShop(Long auctionId, Long sellerId) { |
| | | public TaoBaoShop getTaoBaoShop(String auctionId, Long sellerId) { |
| | | TaoBaoShop shop = taoBaoShopMapper.selectByPrimaryKey(sellerId); |
| | | if (shop != null) |
| | | return shop; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TaoBaoToken getTaoBaoToken(Long auctionId, String pid) { |
| | | public TaoBaoToken getTaoBaoToken(String auctionId, String pid) { |
| | | TaoBaoToken token = taoBaoTokenMapper.selectByAuctionId(auctionId, pid); |
| | | if (token != null && token.getExpireTime().getTime() >= System.currentTimeMillis()) |
| | | return token; |
| | |
| | | private UserTLJBuyHistoryDao userTLJBuyHistoryDao; |
| | | |
| | | @Override |
| | | public boolean canBuy(Long uid, Long auctionId) { |
| | | public boolean canBuy(Long uid, String auctionId) { |
| | | if (uid == null || auctionId == null) |
| | | return false; |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"); |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | private void addGoodsList(List<DaTaoKeDetailV2> goodsList) { |
| | | for (DaTaoKeDetailV2 goods : goodsList) { |
| | | goods.setUpdateTime(new Date()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<Long> goodsIdList) { |
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<String> goodsIdList) { |
| | | if (goodsIdList == null || goodsIdList.size() == 0) |
| | | return null; |
| | | List<DaTaoKeDetailV2> goodsList = daTaoKeGoodsDetailV2Dao.listByGoodsIds(goodsIdList); |
| | |
| | | |
| | | @Override |
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) { |
| | | List<Long> goodsIdList = new ArrayList<>(); |
| | | List<String> goodsIdList = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : goodsList) |
| | | goodsIdList.add(goods.getAuctionId()); |
| | | |
| | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | Map<Long, DaTaoKeDetailV2> map = new HashMap<>(); |
| | | Map<String, DaTaoKeDetailV2> map = new HashMap<>(); |
| | | if (dtList != null) |
| | | for (DaTaoKeDetailV2 goods : dtList) |
| | | map.put(goods.getGoodsId(), goods); |
| | |
| | | } |
| | | |
| | | // 去重 |
| | | Map<Long, DaTaoKeDetailV2> goodsMap = new HashMap<>(); |
| | | Map<String, DaTaoKeDetailV2> goodsMap = new HashMap<>(); |
| | | for (DaTaoKeDetailV2 v2 : goodsList) { |
| | | goodsMap.put(v2.getGoodsId(), v2); |
| | | } |
| | | goodsList.clear(); |
| | | for (Iterator<Long> its = goodsMap.keySet().iterator(); its.hasNext();) { |
| | | for (Iterator<String> its = goodsMap.keySet().iterator(); its.hasNext();) { |
| | | goodsList.add(goodsMap.get(its.next())); |
| | | } |
| | | Comparator<DaTaoKeDetailV2> cm = new Comparator<DaTaoKeDetailV2>() { |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Async |
| | | private void updateGoods(Long id) { |
| | | // TODO暂时关闭服务 |
| | | DaTaoKeDetailV2 v2 = null;// DaTaoKeApiUtil.getGoodsDetail(id); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DaTaoKeDetailV2 selectByAuctionId(Long auctionId) { |
| | | public DaTaoKeDetailV2 selectByAuctionId(String auctionId) { |
| | | return daTaoKeGoodsDetailV2Dao.selectByAuctionId(auctionId); |
| | | } |
| | | |
| | | @Cacheable(value = "daTaoKeGoodsCache", key = "'selectByAuctionId-'+#auctionId") |
| | | @Override |
| | | public DaTaoKeDetailV2 selectByAuctionIdCache(Long auctionId) { |
| | | public DaTaoKeDetailV2 selectByAuctionIdCache(String auctionId) { |
| | | return selectByAuctionId(auctionId); |
| | | } |
| | | |
| | | @Override |
| | | public DaTaoKeFilterResult filterTaoBaoGoods(TaoBaoGoodsBrief goods) { |
| | | List<Long> goodsIdList = new ArrayList<>(); |
| | | List<String> goodsIdList = new ArrayList<>(); |
| | | goodsIdList.add(goods.getAuctionId()); |
| | | |
| | | List<DaTaoKeDetailV2> daTaoKeList = listByGoodsIds(goodsIdList); |
| | |
| | | } |
| | | |
| | | |
| | | private String createTaoLiJin(Long auctionId, BigDecimal perface, int totalNum, String pid) throws UserTaoLiJinNewbiesException { |
| | | private String createTaoLiJin(String auctionId, BigDecimal perface, int totalNum, String pid) throws UserTaoLiJinNewbiesException { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, Long auctionId, BigDecimal perface, int totalNum, |
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, String auctionId, BigDecimal perface, int totalNum, |
| | | String name, Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, String pid) |
| | | throws UserTaoLiJinRecordException { |
| | | |
| | |
| | | return list; |
| | | } |
| | | |
| | | List<Long> listGoodsId = new ArrayList<Long>(); |
| | | List<String> listGoodsId = new ArrayList<>(); |
| | | for (UserTaoLiJinRecordVO userTaoLiJinRecordVO : list) { |
| | | listGoodsId.add(userTaoLiJinRecordVO.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 组织相关数据 |
| | | for (UserTaoLiJinRecordVO userTaoLiJinRecordVO : list) { |
| | | long auctionId = userTaoLiJinRecordVO.getAuctionId().longValue(); |
| | | String auctionId = userTaoLiJinRecordVO.getAuctionId(); |
| | | |
| | | // 商品信息 |
| | | for (int i = 0; i < listGoods.size(); i++) { |
| | | CommonGoods commonGoods = listGoods.get(i); |
| | | long goodsId = commonGoods.getGoodsId().longValue(); |
| | | if (auctionId == goodsId) { |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | if (TaoBaoUtil.isEqual(auctionId , goodsId)) { |
| | | userTaoLiJinRecordVO.setTitle(commonGoods.getTitle()); |
| | | userTaoLiJinRecordVO.setPictUrl(commonGoods.getPicture()); |
| | | if (CommonGoods.SHOP_TYPE_TB == commonGoods.getShopType()) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public UserGoodsStorage getByUidAndAuctionId(Long uid, Long auctionId, Integer goodsType) { |
| | | public UserGoodsStorage getByUidAndAuctionId(Long uid, String auctionId, Integer goodsType) { |
| | | return userGoodsStorageMapper.getByUidAndAuctionId(uid, auctionId, goodsType); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void save(Long uid, Set<Long> auctionIds, Integer goodsType) throws UserGoodsStorageException { |
| | | public void save(Long uid, Set<String> auctionIds, Integer goodsType) throws UserGoodsStorageException { |
| | | |
| | | if (uid == null) { |
| | | throw new UserGoodsStorageException(1, "用户尚未登录"); |
| | |
| | | throw new UserGoodsStorageException(1, "商品ID为空"); |
| | | } |
| | | |
| | | for (Long auctionId : auctionIds) { |
| | | for (String auctionId : auctionIds) { |
| | | CommonGoods commonGoods = null; |
| | | if (goodsType == null) { |
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO; |
| | |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | // 京东 |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(auctionId); |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(auctionId)); |
| | | if (jdGoods == null) { |
| | | jdGoods = JDApiUtil.getGoodsDetail(auctionId); |
| | | jdGoods = JDApiUtil.getGoodsDetail(Long.parseLong( auctionId)); |
| | | } |
| | | if (jdGoods == null) { |
| | | throw new UserGoodsStorageException(1, auctionId + "商品已下架"); |
| | |
| | | |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | // 拼多多 |
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(auctionId); |
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(auctionId)); |
| | | if (pddGoods == null) { |
| | | throw new UserGoodsStorageException(1, auctionId + "商品已下架"); |
| | | } |
| | |
| | | |
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null; |
| | | if (source == Constant.SOURCE_TYPE_TAOBAO) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (UserGoodsStorage userGoodsStorage : listStorage) { |
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods(); |
| | | if (commonGoods == null) { |
| | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0 && goodsType != null |
| | | && goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean isExistStorage(Long uid, Long auctionId, Integer goodType) { |
| | | public boolean isExistStorage(Long uid, String auctionId, Integer goodType) { |
| | | boolean state = false; |
| | | if (uid != null && auctionId != null) { |
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageMapper.getByUidAndAuctionId(uid, auctionId, goodType); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void saveSingleShareRecord(Long uid, Long goodsId, Integer goodsType) throws UserShareGoodsRecordException { |
| | | public void saveSingleShareRecord(Long uid, String goodsId, Integer goodsType) throws UserShareGoodsRecordException { |
| | | if (goodsId == null) { |
| | | throw new UserShareGoodsRecordException(1, "分享商品不能为空"); |
| | | } |
| | |
| | | |
| | | CommonGoods convertGoods = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = redisManager.getJDGoods(goodsId); |
| | | JDGoods jdGoods = redisManager.getJDGoods(Long.parseLong( goodsId)); |
| | | if (jdGoods == null) { |
| | | throw new UserShareGoodsRecordException(1, "商品已下架"); |
| | | } |
| | | convertGoods = CommonGoodsFactory.create(jdGoods); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail pddGoods = redisManager.getPDDGoodsDetail(goodsId); |
| | | PDDGoodsDetail pddGoods = redisManager.getPDDGoodsDetail(Long.parseLong( goodsId)); |
| | | if (pddGoods == null) { |
| | | throw new UserShareGoodsRecordException(1, "商品已下架"); |
| | | } |
| | |
| | | |
| | | List<UserShareGoodsGroup> list = userShareGoodsGroupService.listByRecordId(recordId, true); |
| | | |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (UserShareGoodsGroup goodsGroup : list) { |
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods(); |
| | | if (commonGoods == null) { |
| | |
| | | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual(goodsId ,auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | |
| | | if (list != null && list.size() > 0) { |
| | | |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (UserShareGoodsGroup goodsGroup : list) { |
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods(); |
| | | if (commonGoods == null) { |
| | |
| | | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual( goodsId , auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) |
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, String auctionId, Integer goodsType, boolean isTaolijin) |
| | | throws UserShareGoodsRecordException { |
| | | if (auctionId == null || uid == null || uid <= 0) { |
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public UserCloudGoods addGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException { |
| | | public UserCloudGoods addGoods(Long uid, String goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException { |
| | | if (uid == null) |
| | | throw new UserCloudGoodsException(1, "用户尚未登录"); |
| | | if (goodsId == null || goodsType == null) |
| | |
| | | throw new UserCloudGoodsException(1, goodsId + "商品已下架"); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { // 京东 |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong( goodsId)); |
| | | if (goods == null) |
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息"); |
| | | commonGoods = CommonGoodsFactory.create(goods); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { // 拼多多 |
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (goods == null) |
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息"); |
| | | commonGoods = CommonGoodsFactory.create(goods); |
| | |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Service |
| | | public class UserCloudServiceImpl implements UserCloudService { |
| | | |
| | | Logger logger = LoggerFactory.getLogger(UserCloudService.class); |
| | | |
| | | @Resource |
| | | private UserCloudMapper userCloudMapper; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void sendCustomGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudException { |
| | | public void sendCustomGoods(Long uid, String goodsId, Integer goodsType, Long sellerId) throws UserCloudException { |
| | | sendCircleByGoods(uid, goodsId, goodsType, null, sellerId, UserCloudSendRecord.SEND_WAY_MANUAL); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void sendCircleByGoods(Long uid, Long goodsId, Integer goodsType, Long storeId, Long sellerId, int way) |
| | | private void sendCircleByGoods(Long uid, String goodsId, Integer goodsType, Long storeId, Long sellerId, int way) |
| | | throws UserCloudException { |
| | | long begainTime = java.lang.System.currentTimeMillis(); |
| | | |
| | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | sendTaoBaoGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId()); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | sendJDGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId()); |
| | | sendJDGoods(user, robotId, wxId, Long.parseLong(goodsId), relationId, listOpen, result.getId()); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | sendPDDGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId()); |
| | | sendPDDGoods(user, robotId, wxId, Long.parseLong(goodsId), relationId, listOpen, result.getId()); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | sendVIPGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId()); |
| | | sendVIPGoods(user, robotId, wxId, Long.parseLong(goodsId), relationId, listOpen, result.getId()); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | sendSuNingGoods(user, robotId, wxId, goodsId, sellerId, relationId, listOpen, result.getId()); |
| | | sendSuNingGoods(user, robotId, wxId, Long.parseLong(goodsId), sellerId, relationId, listOpen, result.getId()); |
| | | } |
| | | // 更新发单记录 |
| | | if (storeId != null) { |
| | |
| | | * @param listOpen |
| | | * @throws UserCloudException |
| | | */ |
| | | private void sendTaoBaoGoods(UserInfo user, int robotId, String wxId, Long goodsId, String relationId, |
| | | private void sendTaoBaoGoods(UserInfo user, int robotId, String wxId, String goodsId, String relationId, |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(user.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | String jumpLink = null; |
| | | try { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(user.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | user.getId() + ""); |
| | | } catch (Exception e) { |
| | | logger.warn(String.format("京东转链出错:materialId-%s couponUrl-%s", materialId, couponUrl), e); |
| | | } |
| | | |
| | | boolean coupon = false; |
| | | if (couponInfo != null) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | @IntegralGetVersionLimit(uid = "#uid") |
| | | @Async() |
| | | |
| | | private void addInShopLevelOne(Long uid) { |
| | | try { |
| | | UserInfo boss = getBossByUid(uid); |
| | |
| | | } |
| | | } |
| | | |
| | | @IntegralGetVersionLimit(uid = "#uid") |
| | | @Async() |
| | | private void addInShopLevelTwo(Long uid) { |
| | | try { |
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelTwo.name()); |
| | |
| | | |
| | | @IntegralGetFrequencyLimit(key = "'addScanGoodsDetail-'+#uid+'-'+#goodsType+'-'+#goodsId") |
| | | @Override |
| | | public IntegralTaskRecord addScanGoodsDetail(Long uid, int goodsType, Long goodsId) { |
| | | public IntegralTaskRecord addScanGoodsDetail(Long uid, int goodsType, String goodsId) { |
| | | try { |
| | | return addEventStatistic(uid, TaskUniqueKeyEnum.scanGoods.name()); |
| | | } catch (IntegralGetException e) { |
| | |
| | | @IntegralGetFrequencyLimit(key = "'taoLiJinBuy-'+#uid", time = 30) |
| | | @Async() |
| | | @Override |
| | | public void addTaoLiJinBuy(Long uid, Long goodsId) { |
| | | public void addTaoLiJinBuy(Long uid, String goodsId) { |
| | | try { |
| | | addEventStatistic(uid, TaskUniqueKeyEnum.taoLiJinBuy.name()); |
| | | } catch (Exception e) { |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void downTaoBaoGoods(Long auctionId); |
| | | public void downTaoBaoGoods(String auctionId); |
| | | } |
| | |
| | | * @param top |
| | | * @return |
| | | */ |
| | | public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList,RecommendActivity activity) throws ActivityException, Exception; |
| | | public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<String> goodsList,RecommendActivity activity) throws ActivityException, Exception; |
| | | |
| | | /** |
| | | * 修改商品分享动态 |
| | |
| | | * @return |
| | | * @throws ActivityException |
| | | */ |
| | | public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList, |
| | | public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid, List<String> goodsList, |
| | | RecommendActivity activity) throws ActivityException, Exception; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void downTaoBaoGoods(Long auctionId); |
| | | public void downTaoBaoGoods(String auctionId); |
| | | |
| | | public RecommendActivity getRecommendActivityDetail(Long activityId); |
| | | |
| | |
| | | * @param auctionId |
| | | * @param sellerId |
| | | */ |
| | | public boolean addBrandShopTB(BrandInfo brandInfo, Long auctionId, Long sellerId); |
| | | public boolean addBrandShopTB(BrandInfo brandInfo, String auctionId, Long sellerId); |
| | | |
| | | /** |
| | | * 添加京东店铺信息 |
| | |
| | | * -商品ID |
| | | * @throws CollectionGoodsException |
| | | */ |
| | | public void cancelCollectionByAuctionId(Long uid, Long auctionId, Integer goodsType) |
| | | public void cancelCollectionByAuctionId(Long uid, String auctionId, Integer goodsType) |
| | | throws CollectionGoodsException; |
| | | |
| | | /** |
| | |
| | | * @param actionId |
| | | * @return |
| | | */ |
| | | public CollectionGoodsV2 findByUidAndAuctionId(Long uid, Long actionId, Integer goodsType); |
| | | public CollectionGoodsV2 findByUidAndAuctionId(Long uid, String actionId, Integer goodsType); |
| | | |
| | | /** |
| | | * 京东收藏 |
| | |
| | | * @param goodsId |
| | | * @param goodsType |
| | | */ |
| | | public void offlineCommonGoods(Long goodsId, Integer goodsType); |
| | | public void offlineCommonGoods(String goodsId, Integer goodsType); |
| | | |
| | | /** |
| | | * 根据商品ID和商品类型查询库商品 |
| | |
| | | * @param goodsType |
| | | * @return |
| | | */ |
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(Long goodsId, Integer goodsType); |
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(String goodsId, Integer goodsType); |
| | | |
| | | /** |
| | | * 批量更新 |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<CommonGoods> getByListGoodsId(List<Long> list, Integer goodsType); |
| | | public List<CommonGoods> getByListGoodsId(List<String> list, Integer goodsType); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param uid |
| | | * @param auctionId |
| | | */ |
| | | public UserShareGoodsHistory addShareGoodsHistory(Long uid, Long auctionId) throws ShareGoodsException; |
| | | public UserShareGoodsHistory addShareGoodsHistory(Long uid, String auctionId) throws ShareGoodsException; |
| | | |
| | | /** |
| | | * 添加分享 |
| | |
| | | * @return |
| | | * @throws ShareGoodsException |
| | | */ |
| | | public UserShareGoodsHistory getShareGoodsHistoryDetail(Long uid, Long auctionId) throws ShareGoodsException; |
| | | public UserShareGoodsHistory getShareGoodsHistoryDetail(Long uid, String auctionId) throws ShareGoodsException; |
| | | |
| | | /** |
| | | * 获取分享记录 |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public UserShareGoodsHistory getShareGoodsHistory(Long uid, Long auctionId); |
| | | public UserShareGoodsHistory getShareGoodsHistory(Long uid, String auctionId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws ShareGoodsException |
| | | */ |
| | | public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException; |
| | | public TaoBaoLink getTaoBaoLink(Long uid, String auctionId, String pid) throws ShareGoodsException; |
| | | |
| | | /** |
| | | * |
| | |
| | | * @return |
| | | * @throws ShareGoodsException |
| | | */ |
| | | public TaoBaoLink getTaoLiJinLinkForBuyWithOutFanLi(Long uid, Long auctionId,TaoKeAppInfo app) throws ShareGoodsException,TaoLiJinCreateException; |
| | | public TaoBaoLink getTaoLiJinLinkForBuyWithOutFanLi(Long uid, String auctionId,TaoKeAppInfo app) throws ShareGoodsException,TaoLiJinCreateException; |
| | | |
| | | public String createTaoBaoToken(Long uid, TaoBaoGoodsBrief goods); |
| | | |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | List<TaoBaoGoodsBrief> queryByAuctionId(Long auctionId); |
| | | List<TaoBaoGoodsBrief> queryByAuctionId(String auctionId); |
| | | |
| | | |
| | | public TaoBaoGoodsBrief selectByPrimaryKey(Long id); |
| | | |
| | | |
| | | public TaoBaoGoodsBrief selectByGoodsId(String goodsId); |
| | | |
| | | /** |
| | | * 设置默认值 |
| | |
| | | * 获取商品详情(用于分享) |
| | | * |
| | | * @param auctionId |
| | | * @param info |
| | | * @param uid |
| | | * @return 返回的淘宝链接是通过转链了的 |
| | | */ |
| | | public TaoBaoGoodsBrief getTaoBaoGoodsDetailForShare(Long auctionId, Long uid) throws ShareGoodsException; |
| | | public TaoBaoGoodsBrief getTaoBaoGoodsDetailForShare(String auctionId, Long uid) throws ShareGoodsException; |
| | | |
| | | /** |
| | | * 批量插入商品 |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<Long> listExistById(List<Long> list); |
| | | public List<Long> listExistById(List<String> list); |
| | | |
| | | /** |
| | | * 根据店铺id查询 |
| | |
| | | * 批量删除 |
| | | * @param list |
| | | */ |
| | | public void deleteBatchByGoodsId(List<Long> list); |
| | | public void deleteBatchByGoodsId(List<String> list); |
| | | |
| | | /** |
| | | * 主键删除 |
| | |
| | | public Long getRelationNum(Long labelId) throws LabelGoodsException; |
| | | |
| | | |
| | | public Long isExistence(Long goodsId, Long labId); |
| | | public Long isExistence(String goodsId, Long labId); |
| | | |
| | | public int deleteByGoodsIdAndLabId(Long goodsId, Long labId); |
| | | public int deleteByGoodsIdAndLabId(String goodsId, Long labId); |
| | | |
| | | /** |
| | | * 查询商品对应标签 --分页 |
| | |
| | | * @return |
| | | * @throws LabelClassException |
| | | */ |
| | | public List<LabelGoods> queryByGoodsId(int start, int count, Long goodsId) throws LabelClassException; |
| | | public List<LabelGoods> queryByGoodsId(int start, int count, String goodsId) throws LabelClassException; |
| | | |
| | | public int getCountQueryByGoodsId(Long goodsId); |
| | | public int getCountQueryByGoodsId(String goodsId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | public int getCountByGoodsId(Long goodsId); |
| | | public int getCountByGoodsId(String goodsId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param admin |
| | | * @throws Exception |
| | | */ |
| | | public void batchGoodsAddLables(List<Long> goodsIdList, List<Long> labIdList, AdminUser admin) throws Exception; |
| | | public void batchGoodsAddLables(List<String> goodsIdList, List<Long> labIdList, AdminUser admin) throws Exception; |
| | | |
| | | /** |
| | | * 单个商品贴标签 |
| | |
| | | * @param admin |
| | | * @throws Exception |
| | | */ |
| | | public void singleGoodsAddLables(Long goodsId, List<Long> labIdList, AdminUser admin) throws Exception; |
| | | public void singleGoodsAddLables(String goodsId, List<Long> labIdList, AdminUser admin) throws Exception; |
| | | |
| | | } |
| | |
| | | * |
| | | * @param goodsList |
| | | */ |
| | | public void deleteByTaoBaoGoodsId(Long auctionId); |
| | | public void deleteByTaoBaoGoodsId(String auctionId); |
| | | |
| | | } |
| | |
| | | * @param listId |
| | | * @throws QualityFactoryException |
| | | */ |
| | | public void deleteBatchByTaoBaoGoodsId(List<Long> listId); |
| | | public void deleteBatchByTaoBaoGoodsId(List<String> listId); |
| | | |
| | | /** |
| | | * 根据淘宝id 删除 |
| | |
| | | * @param auctionId |
| | | * @throws QualityFactoryException |
| | | */ |
| | | public void deleteByTaoBaoGoodsId(Long auctionId); |
| | | public void deleteByTaoBaoGoodsId(String auctionId); |
| | | |
| | | /** |
| | | * 统计商品id 是存在精品库 |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | public Long queryCountByGoodsId(Long goodsId); |
| | | public Long queryCountByGoodsId(String goodsId); |
| | | |
| | | |
| | | /** |
| | |
| | | * 更新精选库商品 |
| | | * |
| | | * @param goodsList |
| | | * @param systemCid |
| | | * @param labels |
| | | */ |
| | | public void autoInsertOrUpadateStorage(BoutiqueAutoRule autoRule, List<TaoBaoGoodsBrief> goodsList, List<Label> listLabs); |
| | | |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<QualityFactory> listQueryByAuctionId(List<Long> list); |
| | | public List<QualityFactory> listQueryByAuctionId(List<String> list); |
| | | |
| | | /** |
| | | * 根据时间 获取当前时间之前创建的商品信息 |
| | |
| | | * 商品来源 |
| | | * @return |
| | | */ |
| | | public List<Long> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime); |
| | | public List<String> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime); |
| | | |
| | | /** |
| | | * 更新权重 |
| | |
| | | /** |
| | | * 根据精选库商品id 更新商品信息 |
| | | * |
| | | * @param gid |
| | | * @param goodsId |
| | | * 商品主键 |
| | | */ |
| | | public void updateQualityGoods(Long goodsId); |
| | | public void updateQualityGoods(String goodsId); |
| | | |
| | | /** |
| | | * 根据最低销量查询精选库(按创建时间倒叙排列) |
| | |
| | | /** |
| | | * 单个商品根据标签推荐商品 |
| | | * @param paramLong |
| | | * @param paramString1 |
| | | * @param paramString2 |
| | | * @return |
| | | */ |
| | | public List<QualityFactory> recommendByAuctionId(Long paramLong); |
| | | public List<QualityFactory> recommendByAuctionId(String paramLong); |
| | | |
| | | |
| | | |
| | |
| | | * @param content |
| | | * @throws PushException |
| | | */ |
| | | void pushGoods(Long uid, Long auctionId, String title, String content, String versions, SystemEnum system) throws PushException; |
| | | void pushGoods(Long uid, String auctionId, String title, String content, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 推送链接 |
| | |
| | | * @param uid |
| | | * @throws PushException |
| | | */ |
| | | void pushGoods(Long uid, Long auctionId, PushBaseContent baseContent) |
| | | void pushGoods(Long uid, String auctionId, PushBaseContent baseContent) |
| | | throws PushException; |
| | | |
| | | /** |
| | |
| | | |
| | | * @throws PushException |
| | | */ |
| | | void pushGoods(Long uid, Long auctionId, PushBaseContent baseContent) |
| | | void pushGoods(Long uid, String auctionId, PushBaseContent baseContent) |
| | | throws PushException; |
| | | |
| | | /** |
| | |
| | | |
| | | public int updateByPrimaryKey(PushGoods record) throws PushGoodsException; |
| | | |
| | | public void save(PushGoods record, List<Long> goodsId) throws PushGoodsException,Exception; |
| | | public void save(PushGoods record, List<String> goodsId) throws PushGoodsException,Exception; |
| | | |
| | | /** |
| | | * 批量删除 |
| | |
| | | * @param content |
| | | * @throws PushException |
| | | */ |
| | | void pushGoods(Long uid, Long auctionId, PushBaseContent content) |
| | | void pushGoods(Long uid, String auctionId, PushBaseContent content) |
| | | throws PushException; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param goodsId |
| | | */ |
| | | public void deleteByGoodsId(Long goodsId); |
| | | public void deleteByGoodsId(String goodsId); |
| | | |
| | | /** |
| | | * 验证是否可以创建淘礼金 |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public boolean verifyCanCreateTLJ(Long auctionId,TaoKeAppInfo info); |
| | | public boolean verifyCanCreateTLJ(String auctionId,TaoKeAppInfo info); |
| | | |
| | | /** |
| | | * 更新分享库商品 |
| | |
| | | * |
| | | * @param goodsId |
| | | */ |
| | | public void deleteByGoodsId(Long goodsId); |
| | | public void deleteByGoodsId(String goodsId); |
| | | |
| | | /** |
| | | * 验证是否可以创建淘礼金 |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public boolean verifyCanCreateTLJ(Long auctionId, TaoKeAppInfo app); |
| | | public boolean verifyCanCreateTLJ(String auctionId, TaoKeAppInfo app); |
| | | |
| | | /** |
| | | * 更新商品 |
| | |
| | | * @param day |
| | | * @param count |
| | | */ |
| | | public void subHongBaoLeftCount(Long auctionId, String day, int count); |
| | | public void subHongBaoLeftCount(String auctionId, String day, int count); |
| | | |
| | | /** |
| | | * 根据商品ID和日期查询 |
| | |
| | | * @param day |
| | | * @return |
| | | */ |
| | | public TLJBuyGoods selectByAuctionIdAndDay(Long auctionId, String day); |
| | | public TLJBuyGoods selectByAuctionIdAndDay(String auctionId, String day); |
| | | |
| | | /* |
| | | * 删除商品 |
| | | * |
| | | */ |
| | | public void removeGoods(Long auctionId); |
| | | public void removeGoods(String auctionId); |
| | | |
| | | } |
| | |
| | | * |
| | | * @param goodsId |
| | | */ |
| | | public void deleteByGoodsId(Long goodsId); |
| | | public void deleteByGoodsId(String goodsId); |
| | | |
| | | /** |
| | | * 根据商品ID和日期查询 |
| | |
| | | * @param day |
| | | * @return |
| | | */ |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(Long auctionId, String day); |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(String auctionId, String day); |
| | | |
| | | /** |
| | | * 预选商品 |
| | |
| | | /** |
| | | * 淘宝商品批量更新 |
| | | * |
| | | * @param goods |
| | | * 需要携带券信息 |
| | | */ |
| | | public void updateTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) throws TaobaoGoodsUpdateException; |
| | |
| | | * @param auctionId |
| | | */ |
| | | |
| | | public void deleteTaoBaoGoods(Long auctionId); |
| | | public void deleteTaoBaoGoods(String auctionId); |
| | | |
| | | /** |
| | | * 下架某个商品的数据 |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void offlineTaoBaoGoods(Long auctionId); |
| | | public void offlineTaoBaoGoods(String auctionId); |
| | | |
| | | /** |
| | | * 淘宝商品更新信息 |
| | |
| | | * @param hour |
| | | * @return |
| | | */ |
| | | public List<Long> listNeedUpdateGoodsId(long start, int count, int hour); |
| | | public List<String> listNeedUpdateGoodsId(long start, int count, int hour); |
| | | |
| | | /** |
| | | * 根据taoke更新商品信息 |
| | | * |
| | | * @param id |
| | | * @param goodsId |
| | | */ |
| | | public void updateByTaoKeGoodsDetail(Long id); |
| | | public void updateByTaoKeGoodsDetail(String goodsId); |
| | | |
| | | /** |
| | | * 批量加入更新队列 |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void addUpdateQueueAsync(Long auctionId); |
| | | public void addUpdateQueueAsync(String auctionId); |
| | | |
| | | /** |
| | | * 更新淘宝重要的商品 |
| | |
| | | * @param sellerId |
| | | * @return |
| | | */ |
| | | public TaoBaoShop getTaoBaoShop(Long auctionId, Long sellerId); |
| | | public TaoBaoShop getTaoBaoShop(String auctionId, Long sellerId); |
| | | |
| | | public int insertSelective(TaoBaoShop record); |
| | | |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public TaoBaoToken getTaoBaoToken(Long auctionId,String pid); |
| | | public TaoBaoToken getTaoBaoToken(String auctionId,String pid); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface UserTLJBuyHistoryService { |
| | | |
| | | public boolean canBuy(Long uid, Long auctionId); |
| | | public boolean canBuy(Long uid, String auctionId); |
| | | |
| | | public void addHistory(UserTLJBuyHistory history) throws Exception; |
| | | |
| | |
| | | * @param perface |
| | | * @throws UserTaoLiJinRecordException |
| | | */ |
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, Long auctionId, BigDecimal perface, int totalNum, String name, Date sendStartTime, |
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, String auctionId, BigDecimal perface, int totalNum, String name, Date sendStartTime, |
| | | Date sendEndTime, Date useStartTime, Date useEndTime,String pid) throws UserTaoLiJinRecordException; |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws UserGoodsStorageException |
| | | */ |
| | | public void save(Long uid, Set<Long> auctionIds, Integer goodsType) throws UserGoodsStorageException; |
| | | public void save(Long uid, Set<String> auctionIds, Integer goodsType) throws UserGoodsStorageException; |
| | | |
| | | /** |
| | | * 批量删除 |
| | |
| | | * @param auctionId 淘宝商品 id |
| | | * @return |
| | | */ |
| | | public UserGoodsStorage getByUidAndAuctionId(Long uid, Long auctionId, Integer goodsType); |
| | | public UserGoodsStorage getByUidAndAuctionId(Long uid, String auctionId, Integer goodsType); |
| | | |
| | | /** |
| | | * 判断是否属于选品库 |
| | |
| | | * @param auctionId 商品id |
| | | * @return |
| | | */ |
| | | public boolean isExistStorage(Long uid, Long auctionId, Integer goodType); |
| | | public boolean isExistStorage(Long uid, String auctionId, Integer goodType); |
| | | |
| | | /** |
| | | * 选品库分享商品 |
| | |
| | | * @param type |
| | | * @throws UserShareGoodsRecordException |
| | | */ |
| | | public void saveSingleShareRecord(Long uid, Long auctionId, Integer goodsType) throws UserShareGoodsRecordException; |
| | | public void saveSingleShareRecord(Long uid, String auctionId, Integer goodsType) throws UserShareGoodsRecordException; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws UserShareGoodsRecordException |
| | | */ |
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException; |
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, String auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException; |
| | | |
| | | /** |
| | | * 选品库商品分享 |
| | |
| | | */ |
| | | public List<UserSystemCouponVO> getFreeCouponList(Long uid); |
| | | |
| | | public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId) throws UserSystemCouponException, Exception; |
| | | public List<UserSystemCouponVO> getGoodsCouponList(Long uid, String auctionId) throws UserSystemCouponException, Exception; |
| | | |
| | | } |
| | |
| | | * @param goodsType |
| | | * @throws UserCloudGoodsException |
| | | */ |
| | | public UserCloudGoods addGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException; |
| | | public UserCloudGoods addGoods(Long uid, String goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param goodsType |
| | | * @throws UserCloudException |
| | | */ |
| | | public void sendCustomGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudException; |
| | | public void sendCustomGoods(Long uid, String goodsId, Integer goodsType, Long sellerId) throws UserCloudException; |
| | | |
| | | /** |
| | | * 定时发送云发单 |
| | |
| | | * @param goodsType |
| | | * @param goodsId |
| | | */ |
| | | public IntegralTaskRecord addScanGoodsDetail(Long uid, int goodsType, Long goodsId); |
| | | public IntegralTaskRecord addScanGoodsDetail(Long uid, int goodsType, String goodsId); |
| | | |
| | | /** |
| | | * 推荐banner浏览 |
| | |
| | | * 自购立减 |
| | | * @param uid |
| | | */ |
| | | public void addTaoLiJinBuy(Long uid, Long goodsId); |
| | | public void addTaoLiJinBuy(Long uid, String goodsId); |
| | | |
| | | /** |
| | | * 直接邀请 |
| | |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil; |
| | | import org.jsoup.Jsoup; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.HttpUtil; |
| | | import org.yeshi.utils.NumberUtil; |
| | |
| | | |
| | | Set<ClipboardContentType> typeSet = parseContentType(text, platform, version); |
| | | //新版口令 |
| | | Long goodsId = null; |
| | | String goodsId = null; |
| | | if (text.contains("https://m.tb.cn/")) { |
| | | try { |
| | | TaoKeApiUtil.TokenConvertResult result = TaoKeApiUtil.tokenConvert(text); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | if (goodsId == null) { |
| | | Long auctionId = DaTaoKeApiUtil.parseTaoBaoToken(text); |
| | | String auctionId = DaTaoKeApiUtil.parseTaoBaoToken(text); |
| | | if (auctionId != null) { |
| | | typeSet.add(ClipboardContentType.taoBaoToken); |
| | | goodsId = auctionId; |
| | |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //TODO 解析链接中的title |
| | | // Jsoup.connect(text).get(); |
| | | |
| | | |
| | | resultListener.none(); |
| | | } else { |
| | |
| | | if (simpleGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(simpleGoods.getGoodsId())); |
| | | goods = redisManager.getTaoBaoGoodsBrief(simpleGoods.getGoodsId()); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | } |
| | | |
| | | private CommonGoods parseTaoBaoToken(String token) throws TaoBaoTokenParseException { |
| | | Long auctionId = taoBaoTokenAuctionIdMapManager.getAuctionIdByToken(token); |
| | | String auctionId = taoBaoTokenAuctionIdMapManager.getAuctionIdByToken(token); |
| | | if (auctionId != null) {// |
| | | return getTaoBaoGoods(auctionId); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | private CommonGoods getTaoBaoGoods(Long auctionId) { |
| | | private CommonGoods getTaoBaoGoods(String auctionId) { |
| | | TaoBaoGoodsBrief goods = TaoBaoUtil.isAlimama(auctionId + ""); |
| | | if (goods == null) { |
| | | goods = TaoBaoUtil.getTaoBaoGoodsBriefNotInPub(auctionId); |
| | |
| | | public void run() { |
| | | super.run(); |
| | | try { |
| | | Map<String, Long> map = CMQManager.getInstance().consumeNeedUpdateTaoBaoGoodsIdMsg(16); |
| | | Map<String, String> map = CMQManager.getInstance().consumeNeedUpdateTaoBaoGoodsIdMsg(16); |
| | | if (map != null) { |
| | | Iterator<String> its = map.keySet().iterator(); |
| | | while (its.hasNext()) { |
| | | String key = its.next(); |
| | | taoBaoGoodsUpdateService.updateByTaoKeGoodsDetail(Long.parseLong(key)); |
| | | taoBaoGoodsUpdateService.updateByTaoKeGoodsDetail(map.get(key)); |
| | | CMQManager.getInstance().deleteNeedUpdateTaoBaoGoodsIdMsg(key); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void run() { |
| | | super.run(); |
| | | Map<String, Long> map = CMQManager.getInstance().consumeTBImpGoodsUpdateMsg(16); |
| | | Map<String, String> map = CMQManager.getInstance().consumeTBImpGoodsUpdateMsg(16); |
| | | if (map != null) { |
| | | Iterator<String> its = map.keySet().iterator(); |
| | | while (its.hasNext()) { |
| | |
| | | tokenSet.addAll(tokenList); |
| | | Map<String, String> tokenMap = new HashMap<>(); |
| | | for (String token : tokenSet) { |
| | | Long auctionId = taoBaoTokenAuctionIdMapManager.getAuctionIdByToken(token); |
| | | String auctionId = taoBaoTokenAuctionIdMapManager.getAuctionIdByToken(token); |
| | | if (auctionId == null) |
| | | throw new Exception("从淘口令获取商品失败"); |
| | | TaoBaoGoodsBrief simpleGoods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId); |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public TaoBaoLink getTaoBaoLinkForRecieveCoupon(SystemEnum system, Long auctionId, String specialId, String pid) throws TaoBaoConvertLinkException { |
| | | if (auctionId == null || auctionId <= 0) { |
| | | public TaoBaoLink getTaoBaoLinkForRecieveCoupon(SystemEnum system, String auctionId, String specialId, String pid) throws TaoBaoConvertLinkException { |
| | | if (StringUtil.isNullOrEmpty(auctionId)) { |
| | | throw new TaoBaoConvertLinkException(2, "商品ID不能为空"); |
| | | } |
| | | |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public TaoBaoLink getTaoBaoLinkForBuy(SystemEnum system, Long uid, Long auctionId, String specialId, String pid) throws TaoBaoConvertLinkException { |
| | | public TaoBaoLink getTaoBaoLinkForBuy(SystemEnum system, Long uid, String auctionId, String specialId, String pid) throws TaoBaoConvertLinkException { |
| | | if (uid == null || uid <= 0) { |
| | | throw new TaoBaoConvertLinkException(1, "用户ID不能为空"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private void cacheCouponInfo(Long auctionId, String link, String pid) { |
| | | private void cacheCouponInfo(String auctionId, String link, String pid) { |
| | | String activityId = TaoBaoUtil.getActivityIdFromCouponLink(link); |
| | | if (StringUtil.isNullOrEmpty(activityId)) |
| | | return; |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public TaoBaoLink getTaoBaoLinkForShare(SystemEnum system, Long uid, Long auctionId, String relationId, String pid) throws |
| | | public TaoBaoLink getTaoBaoLinkForShare(SystemEnum system, Long uid, String auctionId, String relationId, String pid) throws |
| | | TaoBaoConvertLinkException { |
| | | if (uid == null || uid <= 0) { |
| | | throw new TaoBaoConvertLinkException(1, "用户ID不能为空"); |
| | | } |
| | | |
| | | if (auctionId == null || auctionId <= 0) { |
| | | if (StringUtil.isNullOrEmpty(auctionId)) { |
| | | throw new TaoBaoConvertLinkException(2, "商品ID不能为空"); |
| | | } |
| | | |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, Long auctionId, String pid) throws TaoBaoConvertLinkException { |
| | | public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String auctionId, String pid) throws TaoBaoConvertLinkException { |
| | | if (uid == null || uid <= 0) |
| | | throw new TaoBaoConvertLinkException(1, "用户ID不能为空"); |
| | | |
| | | if (auctionId == null || auctionId <= 0) |
| | | if (StringUtil.isNullOrEmpty(auctionId)) |
| | | throw new TaoBaoConvertLinkException(1, "商品ID不能为空"); |
| | | |
| | | TaoBaoGoodsBrief goods = null; |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public TaoBaoLink getTaoLiJinLinkForShare(SystemEnum system, Long uid, Long auctionId, String relationId, String pid) throws |
| | | public TaoBaoLink getTaoLiJinLinkForShare(SystemEnum system, Long uid, String auctionId, String relationId, String pid) throws |
| | | TaoBaoConvertLinkException { |
| | | if (uid == null || uid <= 0) { |
| | | throw new TaoBaoConvertLinkException(1, "用户ID不能为空"); |
| | | } |
| | | |
| | | if (auctionId == null || auctionId <= 0) { |
| | | if (StringUtil.isNullOrEmpty(auctionId)) { |
| | | throw new TaoBaoConvertLinkException(2, "商品ID不能为空"); |
| | | } |
| | | |
| | |
| | | * @return |
| | | * @throws ParamsException |
| | | */ |
| | | public String convertShortUrl(String shortLink, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws ParamsException { |
| | | public String convertShortUrl(String shortLink, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws Exception { |
| | | if (StringUtil.isNullOrEmpty(shortLink)) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "短链为空"); |
| | | } |
| | |
| | | * @return |
| | | * @throws ParamsException |
| | | */ |
| | | public String convertGoodsUrl(String materialId, String couponUrl, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws ParamsException { |
| | | public String convertGoodsUrl(String materialId, String couponUrl, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws Exception { |
| | | if (StringUtil.isNullOrEmpty(materialId)) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "materialId为空"); |
| | | } |
| | |
| | | * @throws TaoBaoAuthException |
| | | * @throws TaoBaoConvertLinkException |
| | | */ |
| | | public TaoBaoLink convertGoods(Long auctionId, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws TaobaoGoodsDownException, TaoBaoAuthException, TaoBaoConvertLinkException { |
| | | public TaoBaoLink convertGoods(String auctionId, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws TaobaoGoodsDownException, TaoBaoAuthException, TaoBaoConvertLinkException { |
| | | |
| | | //验证商品是否在线 |
| | | TaoBaoGoodsBrief goods = null; |
| | |
| | | } |
| | | |
| | | |
| | | public TaoBaoLink convertGoods(Long auctionId, String specialId, String relationId, SystemEnum system, SystemPIDInfo.PidType pidType) throws TaoBaoConvertLinkException { |
| | | public TaoBaoLink convertGoods(String auctionId, String specialId, String relationId, SystemEnum system, SystemPIDInfo.PidType pidType) throws TaoBaoConvertLinkException { |
| | | String pid = pidManager.getPidCache(system, Constant.SOURCE_TYPE_TAOBAO, pidType); |
| | | TaoKeAppInfo app = new TaoKeAppInfo(); |
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY); |
| | |
| | | @Resource |
| | | private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil; |
| | | |
| | | public Long getAuctionIdByToken(String token) { |
| | | public String getAuctionIdByToken(String token) { |
| | | if (StringUtil.isNullOrEmpty(token)) |
| | | return null; |
| | | Long auctionId = taoBaoGoodsCacheUtil.getGoodsIdByToken(token); |
| | | String auctionId = taoBaoGoodsCacheUtil.getGoodsIdByToken(token); |
| | | if (auctionId != null) |
| | | return auctionId; |
| | | try { |
| | |
| | | hongBao.setState(HongBaoV2.STATE_SHIXIAO); |
| | | hongBao.setMoney(new BigDecimal(0)); |
| | | } else { |
| | | throw new HongBaoException(3, "维权订单不能创建红包"); |
| | | throw new HongBaoException(HongBaoException.CODE_ORDER_WEIQUAN, "维权订单不能创建红包"); |
| | | } |
| | | |
| | | if (mianDanMoney != null) |
| | |
| | | return response; |
| | | } |
| | | |
| | | public static void main(String[] args) throws AlipayTransferException, AlipayApiException { |
| | | |
| | | AlipayUtil.transfer("test-test","18581318252","贺小辉",new BigDecimal("0.1"),"板栗快省提现","提现"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.push.PushQueueRecord; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static CMQManager cmqManager; |
| | | private static CMQUtil cmqUtil; |
| | | private static TDMQUtil tdmqUtil; |
| | | // 订单处理队列 |
| | | public static String QUEUENAME_ORDER = "fanli-orders"; |
| | |
| | | |
| | | static { |
| | | |
| | | if (Constant.IS_TEST) { |
| | | QUEUENAME_ORDER = "test-" + QUEUENAME_ORDER; |
| | | QUEUENAME_NEW_ORDER = "test-" + QUEUENAME_NEW_ORDER; |
| | | EXTRACT_RESULT = "test-" + EXTRACT_RESULT; |
| | | PUSH_IOS = "test-" + PUSH_IOS; |
| | | FANLI_ORDER = "test-" + FANLI_ORDER; |
| | | FANLI_ORDER_NEW = "test-" + FANLI_ORDER_NEW; |
| | | |
| | | ORDER_WEIQUAN = "test-" + ORDER_WEIQUAN; |
| | | IMPORTANT_GOODS_UPDATE = "test-" + IMPORTANT_GOODS_UPDATE; |
| | | TEJIA_VIP = "test-" + TEJIA_VIP; |
| | | FANLI_SHARE_ORDER = "test-" + FANLI_SHARE_ORDER; |
| | | } |
| | | |
| | | QUEUENAME_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | QUEUENAME_NEW_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | EXTRACT_RESULT += "-" + Constant.systemCommonConfig.getProjectName(); |
| | |
| | | FANLI_SHARE_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | TEJIA_VIP += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | tdmqUtil = TDMQUtil.getInstance(); |
| | | // 最大消息为1M |
| | |
| | | */ |
| | | public List<String> consumeTaoBaoOrderMsg(int count) { |
| | | List<String> resultList = new ArrayList<>(); |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, QUEUENAME_ORDER) : cmqUtil.recieveMsg(count, QUEUENAME_ORDER); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, QUEUENAME_ORDER); |
| | | |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | resultList.add(result); |
| | | // 删除消息 |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(QUEUENAME_ORDER, msg.receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(QUEUENAME_ORDER, msg.receiptHandle); |
| | | } |
| | | } |
| | | return resultList; |
| | | } |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteTaoBaoOrderMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | tdmqUtil.deleteMsg(QUEUENAME_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(QUEUENAME_ORDER, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public List<String> consumeTaoBaoNewOrderMsg(int count) { |
| | | List<String> resultList = new ArrayList<>(); |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, QUEUENAME_NEW_ORDER) : cmqUtil.recieveMsg(count, QUEUENAME_NEW_ORDER); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, QUEUENAME_NEW_ORDER); |
| | | |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | resultList.add(result); |
| | | // 删除消息 |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(QUEUENAME_NEW_ORDER, msg.receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(QUEUENAME_NEW_ORDER, msg.receiptHandle); |
| | | } |
| | | } |
| | | return resultList; |
| | | } |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteTaoBaoNewOrderMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | tdmqUtil.deleteMsg(QUEUENAME_NEW_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(QUEUENAME_NEW_ORDER, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, AlipayTransferResultInfo> consumeExtractResultMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, EXTRACT_RESULT) : cmqUtil.recieveMsg(count, EXTRACT_RESULT); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, EXTRACT_RESULT); |
| | | Map<String, AlipayTransferResultInfo> map = new HashMap<>(); |
| | | |
| | | if (list != null) |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteExtractResultMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | tdmqUtil.deleteMsg(EXTRACT_RESULT, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(EXTRACT_RESULT, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 订单返利 |
| | |
| | | } |
| | | |
| | | public Map<String, HongBao> consumeFanLiMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, FANLI_ORDER) : cmqUtil.recieveMsg(count, FANLI_ORDER); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, FANLI_ORDER); |
| | | Map<String, HongBao> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public Map<String, HongBaoV2> consumeFanLiMsgNew(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, FANLI_ORDER_NEW) : cmqUtil.recieveMsg(count, FANLI_ORDER_NEW); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, FANLI_ORDER_NEW); |
| | | Map<String, HongBaoV2> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void deleteFanLiMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | tdmqUtil.deleteMsg(FANLI_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(FANLI_ORDER, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void deleteFanLiMsgNew(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | tdmqUtil.deleteMsg(FANLI_ORDER_NEW, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(FANLI_ORDER_NEW, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | public Map<String, UidDateDTO> consumeFanLiShareMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, FANLI_SHARE_ORDER) : cmqUtil.recieveMsg(count, FANLI_SHARE_ORDER); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, FANLI_SHARE_ORDER); |
| | | Map<String, UidDateDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void deleteFanLiShareMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(FANLI_SHARE_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(FANLI_SHARE_ORDER, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | // 维权订单 |
| | |
| | | } |
| | | |
| | | public Map<String, TaoBaoWeiQuanOrder> consumeWeiQuanOrderMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, ORDER_WEIQUAN) : cmqUtil.recieveMsg(count, ORDER_WEIQUAN); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, ORDER_WEIQUAN); |
| | | Map<String, TaoBaoWeiQuanOrder> map = new HashMap<>(); |
| | | Gson gson = new Gson(); |
| | | if (list != null) |
| | |
| | | } |
| | | |
| | | public void deleteWeiQuanOrderMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(ORDER_WEIQUAN, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(ORDER_WEIQUAN, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param count |
| | | */ |
| | | public Map<String, PushQueueRecord> consumeIOSPushMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, PUSH_IOS) : cmqUtil.recieveMsg(count, PUSH_IOS); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, PUSH_IOS); |
| | | if (list == null) { |
| | | return null; |
| | | } |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteIOSPushMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(PUSH_IOS, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(PUSH_IOS, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param goodsId |
| | | */ |
| | | public void addNeedUpdateTaoBaoGoodsId(Long goodsId) { |
| | | public void addNeedUpdateTaoBaoGoodsId(String goodsId) { |
| | | tdmqUtil.sendMsg(GOODS_UPDATE, goodsId + ""); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param count |
| | | */ |
| | | public Map<String, Long> consumeNeedUpdateTaoBaoGoodsIdMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, GOODS_UPDATE) : cmqUtil.recieveMsg(count, GOODS_UPDATE); |
| | | public Map<String, String> consumeNeedUpdateTaoBaoGoodsIdMsg(int count) { |
| | | List<Message> list = tdmqUtil.recieveMsg(count, GOODS_UPDATE); |
| | | if (list == null) { |
| | | return null; |
| | | } |
| | | |
| | | Map<String, Long> map = new HashMap<>(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | if (!StringUtil.isNullOrEmpty(result)) { |
| | | map.put(msg.receiptHandle, Long.parseLong(result)); |
| | | map.put(msg.receiptHandle, result); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteNeedUpdateTaoBaoGoodsIdMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | tdmqUtil.deleteMsg(GOODS_UPDATE, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(GOODS_UPDATE, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param actionId |
| | | */ |
| | | public void addTBImpGoodsUpdate(Long actionId) { |
| | | public void addTBImpGoodsUpdate(String actionId) { |
| | | tdmqUtil.sendMsg(IMPORTANT_GOODS_UPDATE, actionId + ""); |
| | | } |
| | | |
| | |
| | | * @param count |
| | | * @return |
| | | */ |
| | | public Map<String, Long> consumeTBImpGoodsUpdateMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, IMPORTANT_GOODS_UPDATE) : cmqUtil.recieveMsg(count, IMPORTANT_GOODS_UPDATE); |
| | | public Map<String, String> consumeTBImpGoodsUpdateMsg(int count) { |
| | | List<Message> list = tdmqUtil.recieveMsg(count, IMPORTANT_GOODS_UPDATE); |
| | | if (list == null) { |
| | | return null; |
| | | } |
| | | |
| | | Map<String, Long> map = new HashMap<>(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | if (!StringUtil.isNullOrEmpty(result)) { |
| | | map.put(msg.receiptHandle, Long.parseLong(result)); |
| | | map.put(msg.receiptHandle, result); |
| | | } |
| | | } |
| | | return map; |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteTBImpGoodsUpdateMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(IMPORTANT_GOODS_UPDATE, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(IMPORTANT_GOODS_UPDATE, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | public static int PAGE_SIZE = 20; |
| | | |
| | | //是否为TDMQ消息消费 |
| | | public final static boolean TDMQ_CONSUMER = true; |
| | | |
| | | //TDMQ是否为公网 |
| | | public final static boolean TDMQ_PUBLIC = false; |
| | | public static boolean TDMQ_PUBLIC = false; |
| | | |
| | | // 新的规则生效时间 |
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-28 16:00:00", "yyyy-MM-dd HH:mm:ss"); |
| | |
| | | IS_OUTNET = Boolean.parseBoolean(constantConfig.getOutNetWork()); |
| | | IS_TASK = Boolean.parseBoolean(constantConfig.getTask()); |
| | | IS_TEST = Boolean.parseBoolean(constantConfig.getTest()); |
| | | TDMQ_PUBLIC = Boolean.parseBoolean(constantConfig.getMqPub()); |
| | | |
| | | System.out.println("IS_OUTNET:" + IS_OUTNET); |
| | | System.out.println("IS_TASK:" + IS_TASK); |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.yeshi.fanli.dto.HongBao; |
| | |
| | | |
| | | @Override |
| | | public int compare(OrderItem o1, OrderItem o2) { |
| | | return o1.getAuctionId().longValue() == o2.getAuctionId() ? o1.getPayMoney().compareTo(o2.getPayMoney()) |
| | | : (int) ((o1.getAuctionId() - o2.getAuctionId()) |
| | | / Math.abs(o1.getAuctionId() - o2.getAuctionId())); |
| | | return TaoBaoUtil.isEqual( o1.getAuctionId(), o2.getAuctionId()) ? o1.getPayMoney().compareTo(o2.getPayMoney()) |
| | | : o1.getAuctionId().compareTo (o2.getAuctionId()); |
| | | } |
| | | }; |
| | | |
| | |
| | | HongBao hongBao = hongBaoList.get(n); |
| | | |
| | | if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算")) { |
| | | if (taoBaoOrder.getAuctionId().longValue() == hongBao.getAuctionId() |
| | | if ( TaoBaoUtil.isEqual(taoBaoOrder.getAuctionId(), hongBao.getAuctionId()+"") |
| | | &&( taoBaoOrder.getSettlement().compareTo(hongBao.getPayMoney()) == 0||taoBaoOrder.getPayment().compareTo(hongBao.getPayMoney()) == 0)) { |
| | | validHongBaoList.add(hongBao); |
| | | hongBaoList.remove(n); |
| | |
| | | } |
| | | |
| | | else { |
| | | |
| | | if (taoBaoOrder.getAuctionId().longValue() == hongBao.getAuctionId() |
| | | if (TaoBaoUtil.isEqual( taoBaoOrder.getAuctionId() ,hongBao.getAuctionId()+"") |
| | | && taoBaoOrder.getPayment().compareTo(hongBao.getPayMoney()) == 0) { |
| | | validHongBaoList.add(hongBao); |
| | | hongBaoList.remove(n); |
| | |
| | | |
| | | @Override |
| | | public int compare(TaoBaoOrder o1, TaoBaoOrder o2) { |
| | | return o1.getAuctionId().longValue() == o2.getAuctionId() ? o1.getPayment().compareTo(o2.getPayment()) |
| | | : (int) ((o1.getAuctionId() - o2.getAuctionId()) |
| | | / Math.abs(o1.getAuctionId() - o2.getAuctionId())); |
| | | return TaoBaoUtil.isEqual(o1.getAuctionId(), o2.getAuctionId()) ? o1.getPayment().compareTo(o2.getPayment()) |
| | | : o1.getAuctionId().compareTo( o2.getAuctionId()); |
| | | } |
| | | }; |
| | | |
| | |
| | | * 删除某个键值 |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | | public void removeKey(String key) { |
| | | Jedis jedis = getJedis(); |
| | |
| | | removeKey(key); |
| | | } |
| | | |
| | | public TaoBaoGoodsBrief getTaoBaoGoodsBrief(long auctionId) throws TaobaoGoodsDownException { |
| | | public TaoBaoGoodsBrief getTaoBaoGoodsBrief(String auctionId) throws TaobaoGoodsDownException { |
| | | long startTime = System.currentTimeMillis(); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoGoods, auctionId + ""); |
| | | String value = ""; |
| | |
| | | } |
| | | } |
| | | |
| | | public List<ImageInfo> getTaoBaoGoodsDetailImgs(long auctionId, SystemEnum system) { |
| | | public List<ImageInfo> getTaoBaoGoodsDetailImgs(String auctionId, SystemEnum system) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoGoodsDetailimgs, auctionId + ""); |
| | | String value = ""; |
| | | if (Constant.IS_OUTNET) |
| | |
| | | * @param sellerId |
| | | * @return |
| | | */ |
| | | public TaoBaoShopInfo getTBShopInfo(String shopTitle, Long sellerId, Long auctionId) { |
| | | public TaoBaoShopInfo getTBShopInfo(String shopTitle, Long sellerId, String auctionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoShop, sellerId + ""); |
| | | String value = ""; |
| | | if (Constant.IS_OUTNET) |
| | |
| | | * |
| | | * @param phone |
| | | * @param type |
| | | * @param code |
| | | */ |
| | | public void clearSMSVCode(String phone, int type) { |
| | | // if (!Constant.IS_OUTNET) |
| | |
| | | * @param auctionId |
| | | * @param token |
| | | */ |
| | | public void saveCommonTaoToken(Long auctionId, String token) { |
| | | public void saveCommonTaoToken(String auctionId, String token) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoTokenCommon, auctionId + ""); |
| | | if (Constant.IS_OUTNET) { |
| | | if (!StringUtil.isNullOrEmpty(token)) { |
| | |
| | | /** |
| | | * 获取用户短连接 |
| | | * |
| | | * @param uid |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public String getCommonTaoToken(Long auctionId) { |
| | | public String getCommonTaoToken(String auctionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoTokenCommon, auctionId + ""); |
| | | if (Constant.IS_OUTNET) { |
| | | return getCommonString(key); |
| | |
| | | /** |
| | | * 保存对象 |
| | | * |
| | | * @param T |
| | | * @param clazz |
| | | * @param key |
| | | * @param seconds |
| | | */ |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public TaoBaoGoodsBrief getCommonTaoBaoGoodsInfo(long auctionId) { |
| | | public TaoBaoGoodsBrief getCommonTaoBaoGoodsInfo(String auctionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoGoodsCommon, auctionId + ""); |
| | | String value = redisManager.getCommonString(key); |
| | | if (!StringUtil.isNullOrEmpty(value)) { |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public boolean canAddToUpdateQueue(Long auctionId) { |
| | | public boolean canAddToUpdateQueue(String auctionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoQueue, auctionId + ""); |
| | | String value = redisManager.getCommonString(key); |
| | | if (StringUtil.isNullOrEmpty(value)) |
| | |
| | | * |
| | | * @param auctionId |
| | | */ |
| | | public void addAddToQueueHistory(Long auctionId) { |
| | | public void addAddToQueueHistory(String auctionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoQueue, auctionId + ""); |
| | | redisManager.cacheCommonString(key, "1", 60 * 60 * 2);// 有效期2个小时 |
| | | } |
| | |
| | | * @param actionId |
| | | * @return |
| | | */ |
| | | public boolean needUpdate(Long actionId) { |
| | | public boolean needUpdate(String actionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoUpdate, actionId + ""); |
| | | String value = redisManager.getCommonString(key); |
| | | if (StringUtil.isNullOrEmpty(value)) |
| | |
| | | * @param actionId |
| | | * @return |
| | | */ |
| | | public void addUpdateHistory(Long actionId) { |
| | | public void addUpdateHistory(String actionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoUpdate, actionId + ""); |
| | | redisManager.cacheCommonString(key, "1", 60 * 60 * 1);// 有效期1个小时 |
| | | } |
| | |
| | | * @param token |
| | | * @param auctionId |
| | | */ |
| | | public void saveTokenGoodsIdMap(String token, Long auctionId) { |
| | | public void saveTokenGoodsIdMap(String token, String auctionId) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoTokenGoodsMap, StringUtil.Md5(token)); |
| | | redisManager.cacheCommonString(key, auctionId + "", 60 * 30);// 有效期30分钟 |
| | | } |
| | |
| | | * @param token |
| | | * @return |
| | | */ |
| | | public Long getGoodsIdByToken(String token) { |
| | | public String getGoodsIdByToken(String token) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoTokenGoodsMap, StringUtil.Md5(token)); |
| | | String goodsId = redisManager.getCommonString(key); |
| | | if (StringUtil.isNullOrEmpty(goodsId)) |
| | | return null; |
| | | return Long.parseLong(goodsId); |
| | | return goodsId; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @Title: cacheBaseConvertLink |
| | | * @Description: |
| | | */ |
| | | public void cacheBaseConvertLink(Long auctionId, String pid, String link) { |
| | | public void cacheBaseConvertLink(String auctionId, String pid, String link) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoBaseLink, StringUtil.Md5(auctionId + "#" + pid)); |
| | | // |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | redisManager.cacheCommonString(key, link, second);// 有效期30分钟 |
| | | } |
| | | |
| | | public String getBaseConvertLink(Long auctionId, String pid) { |
| | | public String getBaseConvertLink(String auctionId, String pid) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoBaseLink, StringUtil.Md5(auctionId + "#" + pid)); |
| | | String url = redisManager.getCommonString(key); |
| | | |
| | |
| | | cg.setSellerName(shopInfo.getShopName() == null ? "" : shopInfo.getShopName()); |
| | | } |
| | | |
| | | cg.setGoodsId(goods.getSkuId()); |
| | | cg.setGoodsId(goods.getSkuId()+""); |
| | | cg.setTitle(goods.getSkuName()); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_JD); |
| | | cg.setPicture(goods.getPicUrl()); |
| | |
| | | } |
| | | |
| | | cg.setCouponTotalCount(Integer.parseInt(goods.getCouponTotalQuantity() + "")); |
| | | cg.setGoodsId(goods.getGoodsId()); |
| | | cg.setGoodsId(goods.getGoodsId()+""); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_PDD); |
| | | cg.setPicture(goods.getGoodsThumbnailUrl()); |
| | | cg.setPictureWhite(null); |
| | |
| | | cg.setCouponAmount(new BigDecimal(0)); |
| | | |
| | | cg.setCouponTotalCount(0); |
| | | cg.setGoodsId(Long.parseLong(goods.getGoodsId())); |
| | | cg.setGoodsId(Long.parseLong(goods.getGoodsId())+""); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_VIP); |
| | | cg.setPicture(goods.getGoodsThumbUrl()); |
| | | cg.setPictureWhite(null); |
| | |
| | | cg.setCouponAmount(new BigDecimal(0)); |
| | | } |
| | | |
| | | cg.setGoodsId(Long.parseLong(goods.getCommodityInfo().getCommodityCode())); |
| | | cg.setGoodsId(Long.parseLong(goods.getCommodityInfo().getCommodityCode())+""); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_SUNING); |
| | | if (goods.getCommodityInfo().getPictureUrl() != null && goods.getCommodityInfo().getPictureUrl().size() > 0) |
| | | cg.setPicture(goods.getCommodityInfo().getPictureUrl().get(0).getPicUrl()); |
| | |
| | | cg.setRate(goods.getPromotion_rate()); |
| | | cg.setSellerName(goods.getShopname()); |
| | | |
| | | cg.setGoodsId(Long.parseLong(goods.getGoods_id())); |
| | | cg.setGoodsId(Long.parseLong(goods.getGoods_id())+""); |
| | | cg.setTitle(goods.getGoodsname()); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_PDD); |
| | | cg.setPicture(goods.getItempic()); |
| | |
| | | cg.setRate(goods.getCommissionshare()); |
| | | cg.setSellerName(goods.getShopname()); |
| | | |
| | | cg.setGoodsId(Long.parseLong(goods.getSkuid())); |
| | | cg.setGoodsId(goods.getSkuid()); |
| | | cg.setTitle(goods.getGoodsname()); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_JD); |
| | | cg.setPicture(goods.getItempic()); |
| | |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static JSONObject createGoodsPush(Long auctionId, String title, String body) { |
| | | public static JSONObject createGoodsPush(String auctionId, String title, String body) { |
| | | JSONObject alert = new JSONObject(); |
| | | alert.put("title", title); |
| | | alert.put("body", body); |
| | |
| | | |
| | | public class JumpDetailParamsFactory { |
| | | |
| | | /** |
| | | * 百川的跳转参数 |
| | | * |
| | | * @param clientTBPid |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String createWEEXParams(ClientTBPid clientTBPid, String url) { |
| | | JSONObject data = new JSONObject(); |
| | | if (clientTBPid != null) |
| | | data.put("tbPidInfo", JsonUtil.getGson().toJson(clientTBPid)); |
| | | data.put("url", url); |
| | | return data.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 百川的跳转参数 |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public static String createWEEXParams(ClientTBPid clientTBPid, Long auctionId) { |
| | | public static String createWEEXParams(ClientTBPid clientTBPid, String auctionId) { |
| | | JSONObject data = new JSONObject(); |
| | | if (clientTBPid != null) |
| | | data.put("tbPidInfo", JsonUtil.getGson().toJson(clientTBPid)); |
| | |
| | | /** |
| | | * web的跳转参数 |
| | | * |
| | | * @param clientTBPid |
| | | * @param auctionId |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String createWEBParams(String url) { |
| | |
| | | /** |
| | | * weex的跳转参数 |
| | | * |
| | | * @param clientTBPid |
| | | * @param auctionId |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String createWEEXParams(String url) { |
| | |
| | | /** |
| | | * 商品详情的跳转参数 |
| | | * |
| | | * @param clientTBPid |
| | | * @param goodsType |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public static String createGoodsParams(Long auctionId, Integer goodsType) { |
| | | public static String createGoodsParams(String auctionId, Integer goodsType) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("id", auctionId); |
| | | if (goodsType != null) |
| | |
| | | if (request == null) |
| | | throw new Exception("request 为空"); |
| | | ClientAPIMonitor monitor = new ClientAPIMonitor(); |
| | | Map<String, Object> params = (Map<String, Object>) request.getParameterMap(); |
| | | Map<String, String[]> params = request.getParameterMap(); |
| | | if (params != null) { |
| | | Iterator<String> its = params.keySet().iterator(); |
| | | JSONObject json = new JSONObject(); |
| | |
| | | public static OrderItem create(HongBaoOrder hongBaoOrder) { |
| | | OrderItem orderItem = new OrderItem(); |
| | | |
| | | orderItem.setAuctionId(Long.parseLong(hongBaoOrder.getCommonOrder().getCommonOrderGoods().getGoodsId())); |
| | | orderItem.setAuctionId((hongBaoOrder.getCommonOrder().getCommonOrderGoods().getGoodsId())); |
| | | orderItem.setCreateTime(hongBaoOrder.getHongBaoV2().getCreateTime().getTime()); |
| | | orderItem.setFanMoney(hongBaoOrder.getHongBaoV2().getMoney()); |
| | | orderItem.setId(hongBaoOrder.getHongBaoV2().getId()); |
| | |
| | | package com.yeshi.fanli.util.factory; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | import com.yeshi.fanli.dto.HongBao; |
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory; |
| | |
| | | * 分享奖金到账 |
| | | * |
| | | * @param uid |
| | | * @param validCount |
| | | * @param weiQuanCount |
| | | * @param invalidCount |
| | | * @param money |
| | | * @param time |
| | | * @param month 月份 |
| | | * @return |
| | | * @throws UserMoneyDetailException |
| | | */ |
| | | public static UserMoneyDetail createShare(Long uid, int orderType, BigDecimal money, Date time) |
| | | public static UserMoneyDetail createShare(Long uid, int orderType, BigDecimal money, Date recieveMonth) |
| | | throws UserMoneyDetailException { |
| | | if (money == null) |
| | | throw new UserMoneyDetailException(1, "返利金额为空"); |
| | |
| | | if (uid == null) |
| | | throw new UserMoneyDetailException(1, "UID为空"); |
| | | |
| | | if (time == null) |
| | | if (recieveMonth == null) |
| | | throw new UserMoneyDetailException(1, "发生时间为空"); |
| | | |
| | | Calendar ca = Calendar.getInstance(); |
| | | ca.setTime(time); |
| | | ca.setTime(recieveMonth); |
| | | ca.add(Calendar.MONTH, -1); |
| | | |
| | | String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月"); |
| | | |
| | | UserMoneyDetail detail = new UserMoneyDetail(); |
| | | detail.setCreateTime(new Date()); |
| | | //暂时处理 |
| | | // detail.setIdentifyCode( |
| | | // StringUtil.Md5(UserMoneyDetailTypeEnum.share.name() + "-" + orderType + "-" + uid + "-" + TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月d日"))); |
| | | |
| | | detail.setIdentifyCode( |
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.share.name() + "-" + orderType + "-" + uid + "-" + timeF)); |
| | | detail.setMoney(money); |
| | |
| | | */ |
| | | public static UserMoneyDetail createFanLiWeiQuan(Long uid, TaoBaoWeiQuanDrawBack drawBack, BigDecimal money) |
| | | throws UserMoneyDetailException { |
| | | if (drawBack == null) |
| | | return createFanLiWeiQuan(uid, drawBack.getOrderId(), Arrays.asList(new TaoBaoWeiQuanDrawBack[]{drawBack}), money); |
| | | } |
| | | |
| | | |
| | | public static UserMoneyDetail createFanLiWeiQuan(Long uid, String orderId, List<TaoBaoWeiQuanDrawBack> drawBackList, BigDecimal money) |
| | | throws UserMoneyDetailException { |
| | | if (drawBackList == null || drawBackList.size() == 0) |
| | | throw new UserMoneyDetailException(1, "退款为空"); |
| | | for (TaoBaoWeiQuanDrawBack drawBack : drawBackList) { |
| | | if (drawBack.getId() == null) |
| | | throw new UserMoneyDetailException(1, "退款ID为空"); |
| | | if (StringUtil.isNullOrEmpty(drawBack.getOrderId())) |
| | | throw new UserMoneyDetailException(1, "订单号为空"); |
| | | if (StringUtil.isNullOrEmpty(drawBack.getOrderItemId())) |
| | | throw new UserMoneyDetailException(1, "子订单号为空"); |
| | | } |
| | | if (money == null) |
| | | throw new UserMoneyDetailException(1, "退款金额为空"); |
| | | if (uid == null) |
| | | throw new UserMoneyDetailException(1, "UID为空"); |
| | | |
| | | Comparator<TaoBaoWeiQuanDrawBack> cm = (o1, o2) -> |
| | | o1.getId() - o2.getId() > 0 ? 1 : -1; |
| | | List<TaoBaoWeiQuanDrawBack> tempList = new ArrayList<>(); |
| | | tempList.addAll(drawBackList); |
| | | |
| | | List<String> orderItemIdList = new ArrayList<>(); |
| | | for (TaoBaoWeiQuanDrawBack drawBack : tempList) { |
| | | orderItemIdList.add(drawBack.getOrderItemId()); |
| | | } |
| | | |
| | | |
| | | UserMoneyDetail detail = new UserMoneyDetail(); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setIdentifyCode(StringUtil |
| | | .Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId())); |
| | | .Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + StringUtil.concat(orderItemIdList, "#"))); |
| | | detail.setMoney(new BigDecimal("0").subtract(money)); |
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuanNew.getDesc()); |
| | | detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuanNew); |
| | | detail.setSourceIdentifyId(drawBack.getId()); |
| | | //暂时只能写入第一个的id |
| | | detail.setSourceIdentifyId(tempList.get(0).getId()); |
| | | detail.setDescInfo( |
| | | Constant.getSourceName(Constant.SOURCE_TYPE_TAOBAO) + ":" + drawBack.getOrderId() + "-部分商品售后"); |
| | | Constant.getSourceName(Constant.SOURCE_TYPE_TAOBAO) + ":" + orderId + "-部分商品售后"); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setUserInfo(new UserInfo(uid)); |
| | | detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO); |
| | |
| | | |
| | | /** |
| | | * 系统扣除 |
| | | * @Title: createSystemTakeOff |
| | | * @Description: |
| | | * |
| | | * @param uid |
| | | * @param money |
| | | * @param desc |
| | | * @return |
| | | * @throws UserMoneyDetailException |
| | | * UserMoneyDetail 返回类型 |
| | | * @throws UserMoneyDetailException UserMoneyDetail 返回类型 |
| | | * @throws |
| | | * @Title: createSystemTakeOff |
| | | * @Description: |
| | | */ |
| | | public static UserMoneyDetail createSystemTakeOff(Long uid, BigDecimal money, String desc) |
| | | throws UserMoneyDetailException { |
| | |
| | | * 邀请奖金到账 |
| | | * |
| | | * @param uid |
| | | * @param validCount |
| | | * @param weiQuanCount |
| | | * @param invalidCount |
| | | * @param money |
| | | * @param time |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 团队收益 |
| | | * @Title: createTeamReward |
| | | * @Description: |
| | | * |
| | | * @param uid |
| | | * @param money |
| | | * @param time |
| | | * @return |
| | | * @throws UserMoneyDetailException |
| | | * UserMoneyDetail 返回类型 |
| | | * @throws UserMoneyDetailException UserMoneyDetail 返回类型 |
| | | * @throws |
| | | * @Title: createTeamReward |
| | | * @Description: |
| | | */ |
| | | |
| | | public static UserMoneyDetail createTeamReward(Long uid, BigDecimal money, Date time) |
| | |
| | | |
| | | /** |
| | | * 团队分红 |
| | | * @Title: createTeamDividents |
| | | * @Description: |
| | | * |
| | | * @param uid |
| | | * @param money |
| | | * @param time |
| | | * @return |
| | | * @throws UserMoneyDetailException |
| | | * UserMoneyDetail 返回类型 |
| | | * @throws UserMoneyDetailException UserMoneyDetail 返回类型 |
| | | * @throws |
| | | * @Title: createTeamDividents |
| | | * @Description: |
| | | */ |
| | | public static UserMoneyDetail createTeamDividents(Long uid, BigDecimal money, Date time) |
| | | throws UserMoneyDetailException { |
| | |
| | | return detail; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.jd.JDOrderItem; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.common.entity.PageEntity; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | |
| | | } |
| | | |
| | | public static String convertLinkWithSubUnionId(String materialId, String couponUrl, String giftCouponKey, String positionId, |
| | | String subUnionId) { |
| | | String subUnionId) throws Exception { |
| | | String log = "京东转链出错:"; |
| | | try { |
| | | JSONObject json = new JSONObject(); |
| | | |
| | | json.put("siteId", APP_ID); |
| | |
| | | |
| | | resultJson = JSONObject.fromObject(result); |
| | | return resultJson.optJSONObject("data").optString("shortURL"); |
| | | } catch (Exception e) { |
| | | LogHelper.error(log); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static JDGoods queryGoodsDetail(Long skuId) { |
| | |
| | | package com.yeshi.fanli.util.mq.cmq; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.dto.ad.DouYinDeviceActiveQueueDTO; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class DouYinDeviceActiveCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static DouYinDeviceActiveCMQManager jdOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | public static String DOUYIN_DEVICE_ACTIVE = "douyin-device-active"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | | DOUYIN_DEVICE_ACTIVE += "-" + Constant.systemCommonConfig.getProjectName(); |
| | |
| | | } |
| | | |
| | | public Map<String, DouYinDeviceActiveQueueDTO> consume(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, DOUYIN_DEVICE_ACTIVE) : cmqUtil.recieveMsg(count, DOUYIN_DEVICE_ACTIVE); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, DOUYIN_DEVICE_ACTIVE); |
| | | Map<String, DouYinDeviceActiveQueueDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void delete(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(DOUYIN_DEVICE_ACTIVE, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(DOUYIN_DEVICE_ACTIVE, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.util.mq.cmq; |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.util.Constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | |
| | | public class HongBaoRecieveCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static HongBaoRecieveCMQManager userMoneyChangeCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | private final static String TOPIC_NAME = "topic_hongbao"; |
| | | |
| | |
| | | public static String SUBSCRIBE_INTEGRAL = "integral"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, Long> consumeQueueMsg(String queueName, int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, queueName) : cmqUtil.recieveMsg(count, queueName); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, queueName); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | |
| | | if (list != null) |
| | |
| | | } |
| | | |
| | | public void deleteQueueMsg(String queueName, String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(queueName, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(queueName, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.dto.push.PushContentDetailDTO; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static PushCMQManager pushCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | public static String PUSH_HW = "push-hw"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | | PUSH_HW += "-" + Constant.systemCommonConfig.getProjectName(); |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, PushContentDetailDTO> consumeHWPush(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, PUSH_HW) : cmqUtil.recieveMsg(count, PUSH_HW); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, PUSH_HW); |
| | | Map<String, PushContentDetailDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteHWPush(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(PUSH_HW, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(PUSH_HW, receiptHandle); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 消费消息 |
| | | public Message recieveMsg(String queueName) throws Exception { |
| | | com.qcloud.cmq.Queue queue = account.getQueue(queueName); |
| | | try { |
| | | return queue.receiveMessage(); |
| | | } catch (Exception e) { |
| | | if (e.getMessage() != null && !e.getMessage().contains("no message")) |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.yeshi.fanli.util.mq.cmq; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.dto.money.UserMoneyChangeDTO; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.util.Constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class UserMoneyChangeCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static UserMoneyChangeCMQManager userMoneyChangeCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | private static TDMQUtil tdmqUtil; |
| | | |
| | | private final static String TOPIC_NAME = "topic_user_money"; |
| | |
| | | public static String SUBSCRIBE_DEBT = "debt"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | tdmqUtil = TDMQUtil.getInstance(); |
| | | // 创建主题,添加订阅 |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, UserMoneyChangeDTO> consumeQueueMsg(String queueName, int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? tdmqUtil.recieveMsg(count, queueName) : cmqUtil.recieveMsg(count, queueName); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, queueName); |
| | | Map<String, UserMoneyChangeDTO> map = new HashMap<>(); |
| | | |
| | | if (list != null) |
| | |
| | | } |
| | | |
| | | public void deleteQueueMsg(String queueName, String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | tdmqUtil.deleteMsg(queueName, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(queueName, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.util.mq.cmq.order; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class JDOrderCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static JDOrderCMQManager jdOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | public static String JD_ORDER = "order-jd"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | | JD_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, String> consumeJDOrder(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, JD_ORDER) : cmqUtil.recieveMsg(count, JD_ORDER); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, JD_ORDER); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteJDOrder(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(JD_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(JD_ORDER, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.util.mq.cmq.order; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class PDDOrderCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static PDDOrderCMQManager pddOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | public static String PDD_ORDER = "order-pdd"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | PDD_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | TDMQUtil.getInstance().createQueue(PDD_ORDER); |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, String> consumePDDOrder(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, PDD_ORDER) : cmqUtil.recieveMsg(count, PDD_ORDER); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, PDD_ORDER); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deletePDDOrder(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(PDD_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(PDD_ORDER, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.bus.user.Order; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static PlaceOrderCMQManager placeOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | private final static String TOPIC_NAME = "topic_place_order"; |
| | | |
| | |
| | | public static String SUBSCRIBE_INTEGRAL = "integral"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | | // 创建主题,添加订阅 |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, Order> consumeQueueMsg(String queueName, int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, queueName) : cmqUtil.recieveMsg(count, queueName); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, queueName); |
| | | Map<String, Order> map = new HashMap<>(); |
| | | |
| | | if (list != null) |
| | |
| | | } |
| | | |
| | | public void deleteQueueMsg(String queueName, String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | TDMQUtil.getInstance().deleteMsg(queueName, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(queueName, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.util.mq.cmq.order; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import scala.collection.immutable.Stream; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class SuningOrderCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static SuningOrderCMQManager suningOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | public static String SUNING_ORDER = "order-suning"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | | SUNING_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, String> consumeSuningOrder(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, SUNING_ORDER) : cmqUtil.recieveMsg(count, SUNING_ORDER); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, SUNING_ORDER); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteSuningOrder(String receiptHandle) { |
| | | |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(SUNING_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(SUNING_ORDER, receiptHandle); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.util.mq.cmq.order; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.dto.mq.UidDateDTO; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class TeamOrderCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static TeamOrderCMQManager jdOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | // 团队分红 |
| | | public static String TEAM_DIVIDENTS_PRE = "team_dividents_pre"; |
| | |
| | | public static String FANLI_TEAM_INCOME_ORDER = "fanli-team-income-order"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | |
| | | if (Constant.IS_TEST) { |
| | | TEAM_DIVIDENTS_PRE = "test-" + TEAM_DIVIDENTS_PRE; |
| | | FANLI_TEAM_INCOME_ORDER_PRE = "test-" + FANLI_TEAM_INCOME_ORDER_PRE; |
| | | TEAM_DIVIDENTS = "test-" + TEAM_DIVIDENTS; |
| | | FANLI_TEAM_INCOME_ORDER = "test-" + FANLI_TEAM_INCOME_ORDER; |
| | | } |
| | | |
| | | TEAM_DIVIDENTS_PRE += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | FANLI_TEAM_INCOME_ORDER_PRE += "-" + Constant.systemCommonConfig.getProjectName(); |
| | |
| | | |
| | | public Map<String, UidDateDTO> consumeTeamDividentsPreMsg(int count) { |
| | | Gson gson = new Gson(); |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, TEAM_DIVIDENTS_PRE) : cmqUtil.recieveMsg(count, TEAM_DIVIDENTS_PRE); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, TEAM_DIVIDENTS_PRE); |
| | | Map<String, UidDateDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void deleteTeamDividentsPreMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | TDMQUtil.getInstance().deleteMsg(TEAM_DIVIDENTS_PRE, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(TEAM_DIVIDENTS_PRE, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 团队收益预到账 |
| | |
| | | } |
| | | |
| | | public Map<String, UidDateDTO> consumeFanLiTeamIncomePreMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, FANLI_TEAM_INCOME_ORDER_PRE) : cmqUtil.recieveMsg(count, FANLI_TEAM_INCOME_ORDER_PRE); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, FANLI_TEAM_INCOME_ORDER_PRE); |
| | | Map<String, UidDateDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void deleteTeamIncomePreMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | TDMQUtil.getInstance().deleteMsg(FANLI_TEAM_INCOME_ORDER_PRE, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(FANLI_TEAM_INCOME_ORDER_PRE, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 团队分红到账 |
| | |
| | | |
| | | public Map<String, UidDateDTO> consumeTeamDividentsMsg(int count) { |
| | | Gson gson = new Gson(); |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, TEAM_DIVIDENTS) : cmqUtil.recieveMsg(count, TEAM_DIVIDENTS); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, TEAM_DIVIDENTS); |
| | | Map<String, UidDateDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void deleteTeamDividentsMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | TDMQUtil.getInstance().deleteMsg(TEAM_DIVIDENTS, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(TEAM_DIVIDENTS, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 团队收益到账 |
| | |
| | | } |
| | | |
| | | public Map<String, UidDateDTO> consumeFanLiTeamIncomeMsg(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, FANLI_TEAM_INCOME_ORDER) : cmqUtil.recieveMsg(count, FANLI_TEAM_INCOME_ORDER); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, FANLI_TEAM_INCOME_ORDER); |
| | | Map<String, UidDateDTO> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | } |
| | | |
| | | public void deleteTeamIncomeMsg(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | TDMQUtil.getInstance().deleteMsg(FANLI_TEAM_INCOME_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(FANLI_TEAM_INCOME_ORDER, receiptHandle); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.yeshi.fanli.util.mq.cmq.order; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.mq.cmq.TDMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class VipShopOrderCMQManager { |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static VipShopOrderCMQManager vipShopOrderCMQManager; |
| | | private static CMQUtil cmqUtil; |
| | | |
| | | public static String VIPSHOP_ORDER = "order-vipshop"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | VIPSHOP_ORDER += "-" + Constant.systemCommonConfig.getProjectName(); |
| | | TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); |
| | | TDMQUtil.getInstance().createQueue(VIPSHOP_ORDER); |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, String> consumeVipShopOrder(int count) { |
| | | List<Message> list = Constant.TDMQ_CONSUMER ? TDMQUtil.getInstance().recieveMsg(count, VIPSHOP_ORDER) : cmqUtil.recieveMsg(count, VIPSHOP_ORDER); |
| | | List<Message> list = TDMQUtil.getInstance().recieveMsg(count, VIPSHOP_ORDER); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if (list != null) |
| | | for (Message msg : list) { |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteVipShopOrder(String receiptHandle) { |
| | | if (Constant.TDMQ_CONSUMER) { |
| | | |
| | | TDMQUtil.getInstance().deleteMsg(VIPSHOP_ORDER, receiptHandle); |
| | | } else { |
| | | cmqUtil.deleteMsg(VIPSHOP_ORDER, receiptHandle); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // PDDConvertLinkResultVO vo = getAuthLink(PID_SHARE, PinDuoDuoUtil.getCustomParams(437032l)); |
| | | |
| | | PDDConvertLinkResultVO vo = getAuthLink("8590899_72067894", 437032+""); |
| | | // |
| | | // System.out.println(vo); |
| | | System.out.println(vo); |
| | | // PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(227873724698L); |
| | | |
| | | PDDConvertLinkResultVO vo = convertChannel("0", PID_DEFAULT, null); |
| | | // PDDConvertLinkResultVO vo = convertChannel("0", PID_DEFAULT, null); |
| | | |
| | | System.out.println(vo); |
| | | // System.out.println(vo); |
| | | // PinDuoDuoApiUtil.convert(goods.getGoodsSign(), PID_DEFAULT + "", "437032", false); |
| | | } |
| | | } |
| | |
| | | appSecret = config.getAppSecret(); |
| | | } |
| | | |
| | | private static String getIntent(String type, String activity, String url, String webUrl, Long id) { |
| | | private static String getIntent(String type, String activity, String url, String webUrl, String id) { |
| | | net.sf.json.JSONObject data = new net.sf.json.JSONObject(); |
| | | if (type != null) |
| | | data.put("type", type); |
| | |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> deviceTokens, String title, String content, int goodsType, Long goodsId, String androidBaseActivityName) |
| | | public static void pushGoods(List<String> deviceTokens, String title, String content, int goodsType, String goodsId, String androidBaseActivityName) |
| | | throws PushException { |
| | | if (deviceTokens != null && deviceTokens.size() > 100) |
| | | throw new PushException(1, "设备数不能超过100个"); |
| | |
| | | /** |
| | | * 方法说明: IOS 多推 |
| | | * |
| | | * @param deviceToken |
| | | * @param packages |
| | | * @param alert |
| | | * @return |
| | | * @throws Exception |
| | | * @author mawurui createTime 2018年5月8日 上午10:19:57 |
| | |
| | | |
| | | JSONObject json = null; |
| | | if (type == PushTypeEnum.goodsdetail.getCode()) { |
| | | Long auctionId = null; |
| | | String auctionId = null; |
| | | if (url.contains("id=")) { |
| | | String[] sts = url.split("\\?")[1].split("&"); |
| | | for (String st : sts) { |
| | | if (st.contains("id=")) { |
| | | auctionId = Long.parseLong(st.replace("id=", "").trim()); |
| | | auctionId = (st.replace("id=", "").trim()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param info |
| | | * @param json |
| | | * @param pushRecord |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param info |
| | | * @param params |
| | | * @param pushRecord |
| | | * @return 1:都成功 2:仅android 成功 3.仅IOS成功 4.都失败 |
| | | * @throws Exception |
| | |
| | | /** |
| | | * 方法说明: IOS 多推 |
| | | * |
| | | * @param deviceToken |
| | | * @param packages |
| | | * @param alert |
| | | * @return |
| | | * @throws Exception |
| | | * @author mawurui createTime 2018年5月8日 上午10:19:57 |
| | |
| | | // json自定义传值 |
| | | JSONObject json = null; |
| | | if (type == PushTypeEnum.goodsdetail.getCode()) { |
| | | Long auctionId = null; |
| | | String auctionId = null; |
| | | if (url.contains("id=")) { |
| | | String[] sts = url.split("\\?")[1].split("&"); |
| | | for (String st : sts) { |
| | | if (st.contains("id=")) { |
| | | auctionId = Long.parseLong(st.replace("id=", "").trim()); |
| | | auctionId = (st.replace("id=", "").trim()); |
| | | } |
| | | } |
| | | } |
| | |
| | | masterSecret = config.getAppSecret(); |
| | | } |
| | | |
| | | private static Map<String, String> getParams(String type, String activity, String url, String webUrl, Long id) { |
| | | private static Map<String, String> getParams(String type, String activity, String url, String webUrl, String id) { |
| | | Map<String, String> data = new HashMap<>(); |
| | | if (type != null) |
| | | data.put("type", type); |
| | |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId,String androidBaseActivity) |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, String goodsId,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 100) |
| | | throw new PushException(1, "设备数不能超过100个"); |
| | |
| | | * 最大值1000 |
| | | * @param title |
| | | * @param content |
| | | * @param url |
| | | * -网页链接 |
| | | * @throws PushException |
| | | */ |
| | |
| | | } |
| | | |
| | | private static Message.Builder getMessageBuidler(PushTypeEnum type, String title, String content, String activity, |
| | | String url, String webUrl, Long id) { |
| | | String url, String webUrl, String id) { |
| | | Map<String, String> data = new HashMap<>(); |
| | | if (type != null) |
| | | data.put("type", type.name()); |
| | |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId,String androidBaseActivity) |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, String goodsId,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 500) |
| | | throw new PushException(1, "设备数不能超过500个"); |
| | |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject data = array.optJSONObject(i); |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setAuctionId(data.optLong("url")); |
| | | goods.setAuctionId(data.optString("url")); |
| | | goods.setBiz30day(data.optInt("nums")); |
| | | goods.setPictUrl(data.optString("img").split(".jpg")[0] + ".jpg"); |
| | | goods.setCouponAmount(new BigDecimal(data.optString("quan"))); |
| | |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject data = array.optJSONObject(i); |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setAuctionId(data.optLong("url")); |
| | | goods.setAuctionId(data.optString("url")); |
| | | goods.setBiz30day(data.optInt("nums")); |
| | | goods.setPictUrl(data.optString("img").split(".jpg")[0] + ".jpg"); |
| | | goods.setCouponAmount(new BigDecimal(data.optString("quan"))); |
| | |
| | | /** |
| | | * 获取热推榜 |
| | | * |
| | | * @param cid |
| | | * @return |
| | | */ |
| | | public static List<DaTaoKeDetailV2> getCurrentHotSalesRank() { |
| | |
| | | else if (c == titleColumn) |
| | | orderRecord.setTitle(content); |
| | | else if (c == auctionIdColumn) |
| | | orderRecord.setAuctionId(Long.parseLong(content)); |
| | | orderRecord.setAuctionId(content); |
| | | else if (c == managerWangWangColumn) |
| | | orderRecord.setManagerWangWang(content); |
| | | else if (c == shopColumn) |
| | |
| | | String tradeId = taoBaoOrder.getTradeId(); |
| | | String orderByStr = tradeId.substring(startIndex, endIndex + 1); |
| | | if (orderByStr.length() > 8) { |
| | | LogHelper.error(taoBaoOrder.getOrderId() + "-订单的orderBy超过8位:" + taoBaoOrder.getOrderBy()); |
| | | LogHelper.error(taoBaoOrder.getOrderId() + "-订单的orderBy超过8位:" + orderByStr); |
| | | } |
| | | int orderBy = Integer.parseInt(orderByStr); |
| | | // taoBaoOrder.setOrderBy(orderBy); |
| | |
| | | |
| | | public class TaoBaoShopUtil { |
| | | |
| | | public static TaoBaoShopInfo getTaoBaoShopInfo(String title, Long sellerId, Long auctionId) { |
| | | public static TaoBaoShopInfo getTaoBaoShopInfo(String title, Long sellerId, String auctionId) { |
| | | int page = 1; |
| | | TaoBaoShopInfo shop = null; |
| | | while (shop == null && page < 4) { |
| | |
| | | String id = st.replace("id=", "").trim(); |
| | | TaoBaoGoodsBrief tb = null; |
| | | try { |
| | | tb = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id)); |
| | | tb = TaoKeApiUtil.searchGoodsDetail(id); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | String id = st.replace("id=", "").trim(); |
| | | TaoBaoGoodsBrief tb = null; |
| | | try { |
| | | tb = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id)); |
| | | tb = TaoKeApiUtil.searchGoodsDetail(id); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public static TaoBaoLink getTbLink(long auctionId, String pid, TaoBaoUnionConfig config) { |
| | | public static TaoBaoLink getTbLink(String auctionId, String pid, TaoBaoUnionConfig config) { |
| | | TaoBaoLink tbk = null; |
| | | String cookie = TaoBaoOrderUtil.getTaoBaoCookie(config.getAccount()); |
| | | String adzoneid = pid.split("_")[3]; |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public static TaoBaoLink getTbLinkForShare(long auctionId, String pid, TaoBaoUnionConfig config) { |
| | | public static TaoBaoLink getTbLinkForShare(String auctionId, String pid, TaoBaoUnionConfig config) { |
| | | TaoBaoLink tbk = null; |
| | | String cookie = TaoBaoOrderUtil.getTaoBaoCookie(config.getAccount()); |
| | | selfAdzoneCreate(pid, cookie); |
| | |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public static TaoBaoLink getTbLinkWithCoupon(String picture, String title, String activityId, long auctionId, |
| | | public static TaoBaoLink getTbLinkWithCoupon(String picture, String title, String activityId, String auctionId, |
| | | String pid) { |
| | | activityId = StringUtil.isNullOrEmpty(activityId) ? "da75a5880d4c41ab88a82256b069a38c" : activityId; |
| | | String url = String.format("https://uland.taobao.com/coupon/edetail?activityId=%s&pid=%s&itemId=%s", activityId, |
| | |
| | | * 获取未参与推广的淘宝商品详情 @Title: getTaoBaoGoodsBrief @Description: @param |
| | | * id @return TaoBaoGoodsBrief 包含(标题与图片) @throws |
| | | */ |
| | | public static TaoBaoGoodsBrief getTaoBaoGoodsBriefNotInPub(Long id) { |
| | | public static TaoBaoGoodsBrief getTaoBaoGoodsBriefNotInPub(String id) { |
| | | TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(id + ""); |
| | | return tb; |
| | | } |
| | |
| | | return new ArrayList<>(); |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = null; |
| | | try { |
| | | taoBaoGoodsBrief = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(auctionId)); |
| | | taoBaoGoodsBrief = TaoKeApiUtil.getSimpleGoodsInfo(auctionId); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | return null; |
| | | TaoBaoGoodsBrief tb = null; |
| | | try { |
| | | tb = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(auctionId)); |
| | | tb = TaoKeApiUtil.getSimpleGoodsInfo(auctionId); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | taoBaoGoodsBriefExtra.setTaoBaoHongBaoInfo(taobaoHongbaoInfo); |
| | | taoBaoGoodsBriefExtra.setTaoBaoQuanInfo(taobaoQuanInfo); |
| | | |
| | | taoBaoGoodsBriefExtra.setAuctionId(Long.parseLong(taoBaoCoupon.getAuctionId())); |
| | | taoBaoGoodsBriefExtra.setAuctionId(taoBaoCoupon.getAuctionId()); |
| | | taoBaoGoodsBriefExtra.setAuctionUrl(taoBaoCoupon.getAuctionUrl()); |
| | | taoBaoGoodsBriefExtra.setBaoyou(true); |
| | | taoBaoGoodsBriefExtra.setBiz30day(taoBaoCoupon.getBiz30day()); |
| | |
| | | imgStrs.add(attr); |
| | | } |
| | | taobao = new TaoBaoGoodsBrief(); |
| | | taobao.setAuctionId(Long.parseLong(auctionId)); |
| | | taobao.setAuctionId(auctionId); |
| | | taobao.setTitle(title); |
| | | taobao.setZkPrice(new BigDecimal(price)); |
| | | taobao.setImgList(imgStrs); |
| | |
| | | taoBaoGoodsBrief.setTitle(title); |
| | | taoBaoGoodsBrief.setImgList(imgs); |
| | | taoBaoGoodsBrief.setPictUrl(imgs.get(0)); |
| | | taoBaoGoodsBrief.setAuctionId(Long.parseLong(auctionId)); |
| | | taoBaoGoodsBrief.setAuctionId(auctionId); |
| | | taoBaoGoodsBrief.setUserType(1); |
| | | } else { |
| | | Connection connect2 = Jsoup.connect(String.format(TB_URL, auctionId)); |
| | |
| | | taoBaoGoodsBrief.setPictUrl(imgs.get(0)); |
| | | taoBaoGoodsBrief.setImgList(imgs); |
| | | taoBaoGoodsBrief.setZkPrice(new BigDecimal(price)); |
| | | taoBaoGoodsBrief.setAuctionId(Long.parseLong(auctionId)); |
| | | taoBaoGoodsBrief.setAuctionId(auctionId); |
| | | taoBaoGoodsBrief.setUserType(0); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | /** |
| | | * 获取图文详情 |
| | | * |
| | | * @param auctionId |
| | | * @param id |
| | | */ |
| | | public static List<String> getGoodsTextAndImageDetails(Long id) { |
| | | if (id == null) { |
| | |
| | | return taoBaoProvinceList; |
| | | } |
| | | |
| | | public static List<ImageInfo> getTBDetailImageWithSize(Long auctionId) { |
| | | public static List<ImageInfo> getTBDetailImageWithSize(String auctionId) { |
| | | |
| | | List<ImageInfo> imgList = new ArrayList<>(); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | |
| | | public static List<ImageInfo> getTBDetailImageWithSizev2(Long auctionId, ProxyIP ip) { |
| | | public static List<ImageInfo> getTBDetailImageWithSizev2(String auctionId, ProxyIP ip) { |
| | | List<ImageInfo> imgList = new ArrayList<>(); |
| | | try { |
| | | Map<String, String> headers = new HashMap<>(); |
| | |
| | | * @param adzoneId |
| | | * @return |
| | | */ |
| | | public static String getBaiChuanConvertLink(Long auctionId, String appKey, String adzoneId) { |
| | | public static String getBaiChuanConvertLink(String auctionId, String appKey, String adzoneId) { |
| | | String url = "http://acs4baichuan.m.taobao.com/gw-open/mtop.taobao.tbk.sdk.item.convert/1.0/"; |
| | | JSONObject params = new JSONObject(); |
| | | params.put("mcid", "tunion4android@862977040115210"); |
| | |
| | | * @param actionId |
| | | * @return |
| | | */ |
| | | public static TaoBaoGoodsBrief getSimpleGoodsBrief(Long actionId) { |
| | | public static TaoBaoGoodsBrief getSimpleGoodsBrief(String actionId) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("itemNumId", actionId + ""); |
| | | |
| | |
| | | JSONObject seller = data.optJSONObject("seller"); |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setTitle(item.optString("title")); |
| | | goods.setAuctionId(item.optLong("itemId")); |
| | | goods.setAuctionId(item.optString("itemId")); |
| | | goods.setTitle(item.optString("title")); |
| | | if (item.optJSONArray("images") != null && item.optJSONArray("images").size() > 0) { |
| | | String picture = item.optJSONArray("images").optString(0); |
| | |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | public static TaoBaoShop getTaoBaoShopDetailByAuctionId(Long auctionId) { |
| | | public static TaoBaoShop getTaoBaoShopDetailByAuctionId(String auctionId) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("itemNumId", auctionId + ""); |
| | | |
| | |
| | | /** |
| | | * 是否可以加入淘礼金的预选商品库 |
| | | * |
| | | * @param v2 |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | public static boolean canAddToTLJBuyGoods(TaoBaoGoodsBrief goods) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static boolean isEqual(String auctionId1,String auctionId2){ |
| | | |
| | | return auctionId1.equals(auctionId2); |
| | | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(isHaveNewVersionTaoBaoToken("復至\uD83D\uDC8B9.0₪sDO0X7l3Twm₪/ 去táo寶抢")); |
| | |
| | | JSONObject item = array.optJSONObject(i); |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setPictUrl(item.optString("pict_url")); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | * @param id -商品AuctionId |
| | | * @return |
| | | */ |
| | | public static TaoBaoGoodsBrief getSimpleGoodsInfo(Long id) throws TaobaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief getSimpleGoodsInfo(String id) throws TaobaoGoodsDownException { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.item.info.get"); |
| | | map.put("num_iids", id + ""); |
| | |
| | | |
| | | private static TaoBaoGoodsBrief parseSimpleGoodsInfo(JSONObject item) { |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (item.optJSONObject("small_images") != null) { |
| | |
| | | return goods; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> getBatchGoodsInfo(List<Long> listId) |
| | | public static List<TaoBaoGoodsBrief> getBatchGoodsInfo(List<String> listId) |
| | | throws TaoKeApiException, TaobaoGoodsDownException { |
| | | if (listId == null || listId.size() == 0) { |
| | | throw new TaobaoGoodsDownException(1, "淘宝商品ID不能为空"); |
| | |
| | | } |
| | | |
| | | StringBuffer ids = new StringBuffer(); |
| | | for (Long id : listId) { |
| | | for (String id : listId) { |
| | | ids.append(id + ","); |
| | | } |
| | | |
| | |
| | | * @return |
| | | * @throws TaobaoGoodsDownException |
| | | */ |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(Long id, String specialId, String relationId) throws TaobaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(String id, String specialId, String relationId) throws TaobaoGoodsDownException { |
| | | TaoBaoGoodsBrief goods = getSimpleGoodsInfo(id); |
| | | if (goods == null) |
| | | return null; |
| | |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | System.out.println(goods.getAuctionId() + ":" + g.getAuctionId()); |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (goods.getAuctionId().equals(g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | g.setMaterialLibType(goods.getMaterialLibType()); |
| | | g.setProvcity(goods.getProvcity()); |
| | |
| | | |
| | | } |
| | | |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(Long id) throws TaobaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(String id) throws TaobaoGoodsDownException { |
| | | return searchGoodsDetail(id, null, null); |
| | | } |
| | | |
| | |
| | | * @return |
| | | * @throws TaobaoGoodsDownException |
| | | */ |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(Long id, TaoKeAppInfo app) throws TaobaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(String id, TaoKeAppInfo app) throws TaobaoGoodsDownException { |
| | | TaoBaoGoodsBrief goods = getSimpleGoodsInfo(id); |
| | | if (goods == null) |
| | | return null; |
| | |
| | | goods.getUserType(), app, null, null); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (goods.getAuctionId() == g.getAuctionId()|| goods.getAuctionId().equals(g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | // 判断是否有优惠券 |
| | | if (!StringUtil.isNullOrEmpty(g.getCouponActivityId())) { |
| | | // 获取优惠券详情 |
| | |
| | | * @return |
| | | * @throws TaobaoGoodsDownException |
| | | */ |
| | | public static TaoBaoGoodsBrief searchGoodsDetailForConvert(Long id, TaoKeAppInfo app, String specialId, String relationId) |
| | | public static TaoBaoGoodsBrief searchGoodsDetailForConvert(String id, TaoKeAppInfo app, String specialId, String relationId) |
| | | throws TaobaoGoodsDownException { |
| | | TaoBaoGoodsBrief goods = getSimpleGoodsInfo(id); |
| | | if (goods == null) |
| | |
| | | goods.getUserType(), app, specialId, relationId); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual( goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | return g; |
| | | } |
| | |
| | | goods.getUserType(), null, null); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if ( TaoBaoUtil.isEqual(goods.getAuctionId(),g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setAuctionUrl(goods.getAuctionUrl()); |
| | | g.setShopTitle(goods.getShopTitle()); |
| | | |
| | |
| | | if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null |
| | | && searchResult.getTaoBaoGoodsBriefs().size() > 0) { |
| | | for (TaoBaoGoodsBrief g : searchResult.getTaoBaoGoodsBriefs()) { |
| | | if (g.getAuctionId().longValue() == goods.getAuctionId()) { |
| | | if (TaoBaoUtil.isEqual( g.getAuctionId(), goods.getAuctionId())) { |
| | | g.setImgList(goods.getImgList()); |
| | | g.setId(goods.getAuctionId()); |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setAuctionUrl(goods.getAuctionUrl()); |
| | | g.setShopTitle(goods.getShopTitle()); |
| | | |
| | |
| | | goods.setPictUrlWhite(item.optString("white_image")); |
| | | } |
| | | |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl("https:" + item.optString("url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | public static QuanInfo getQuanInfo(Long auctionId, String activityId) { |
| | | public static QuanInfo getQuanInfo(String auctionId, String activityId) { |
| | | QuanInfo info = new TaoKeApiUtil.QuanInfo(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.coupon.get"); |
| | |
| | | if (url.contains("s.click.taobao.com/t?e=m")) { |
| | | TaoBaoGoodsBrief goods; |
| | | try { |
| | | goods = searchGoodsDetail(item.optLong("num_iid")); |
| | | goods = searchGoodsDetail(item.optString("num_iid")); |
| | | if (goods != null) |
| | | goodsList.add(goods); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | System.out.println(resultStr); |
| | | } |
| | | |
| | | public static void getTAEGoodsDetail(Long auctionId) { |
| | | public static void getTAEGoodsDetail(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tae.items.list"); |
| | | map.put("fields", "title,nick,pic_url,location,cid,price,post_fee,promoted_service,ju,shop_name"); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void specialConvertItem(Long auctionId, TaoKeAppInfo app) { |
| | | public static void specialConvertItem(String auctionId, TaoKeAppInfo app) { |
| | | String pid = app.getPid(); |
| | | String[] sts = pid.split("_"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | public static TaoBaoGoodsBrief specialConvertCoupon(Long auctionId, TaoKeAppInfo app, String specialId, String relationId) { |
| | | public static TaoBaoGoodsBrief specialConvertCoupon(String auctionId, TaoKeAppInfo app, String specialId, String relationId) { |
| | | String pid = app.getPid(); |
| | | String[] sts = pid.split("_"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | // 设置成320*320的图片尺寸 |
| | | goods.setPictUrl(TbImgUtil.getTBSize320Img("https:" + item.optString("pict_url"))); |
| | | goods.setAuctionId(item.optLong("item_id")); |
| | | goods.setAuctionId(item.optString("item_id")); |
| | | goods.setAuctionUrl("https://item.taobao.com/item.htm?id=" + goods.getAuctionId()); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (!StringUtil.isNullOrEmpty(item.optString("coupon_amount"))) { |
| | |
| | | // 淘礼金创建 |
| | | //{"result":{"msg_code":"FAIL_CHECK_ITEM_DAILY_SEND_NUM_CHECK_ERROR","msg_info":"今日该商品淘礼金创建数已超上限,请您明日再试","success":false},"request_id":"10p30v02qadkq"} |
| | | //{"result":{"msg_code":"ASSET_ACCOUNT_BALANCE_NOT_ENOUGH","msg_info":"账户预算不足","success":false},"request_id":"5caz9izr7jqp"} |
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum, |
| | | public static TaoLiJinDTO createTaoLiJin(String auctionId, String name, BigDecimal perface, int totalNum, |
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app) |
| | | throws TaoLiJinCreateException, TaoKeApiException { |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void getCouponByAuctionId(Long auctionId) { |
| | | public static void getCouponByAuctionId(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.itemid.coupon.get"); |
| | | map.put("platform", 2 + ""); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(Long auctionId, int count) { |
| | | public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(String auctionId, int count) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.dg.optimus.material"); |
| | | map.put("item_id", auctionId + ""); |
| | |
| | | return goodsList; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> getCouponListByItemId(Long auctionId) { |
| | | public static List<TaoBaoGoodsBrief> getCouponListByItemId(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.itemid.coupon.get"); |
| | | map.put("platform", auctionId + ""); |
| | |
| | | } |
| | | |
| | | public static class TokenConvertResult { |
| | | private Long num_iid;// 商品Id |
| | | private String num_iid;// 商品Id |
| | | private String click_url;//商品淘客转链 |
| | | private String seller_id;//店铺卖家ID |
| | | private String origin_url;//入参淘口令对应原始链接 |
| | | private String origin_pid;//入参淘口令推广链接中的pid,如果不属于当前调用的推广者则展示“0” |
| | | |
| | | public Long getNum_iid() { |
| | | public String getNum_iid() { |
| | | return num_iid; |
| | | } |
| | | |
| | | public void setNum_iid(Long num_iid) { |
| | | public void setNum_iid(String num_iid) { |
| | | this.num_iid = num_iid; |
| | | } |
| | | |
| | |
| | | TaoBaoOrder taoBaoOrder = new TaoBaoOrder(); |
| | | taoBaoOrder.setAdPositionId(item.optString("adzone_id")); |
| | | taoBaoOrder.setAdPositionName(item.optString("adzone_name")); |
| | | taoBaoOrder.setAuctionId(item.optLong("item_id")); |
| | | taoBaoOrder.setAuctionId(item.optString("item_id")); |
| | | taoBaoOrder.setClassName(item.optString("item_category_name")); |
| | | taoBaoOrder.setClickTime(item.optString("click_time")); |
| | | taoBaoOrder.setPayTime(item.optString("tb_paid_time")); |
| | |
| | | JSONObject item = array.optJSONObject(i); |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setPictUrl(item.optString("pict_url")); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | |
| | | private static TaoBaoGoodsBrief parseSimpleGoodsInfo(JSONObject item) { |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (item.optJSONObject("small_images") != null) { |
| | |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | System.out.println(goods.getAuctionId() + ":" + g.getAuctionId()); |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual( goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | g.setMaterialLibType(goods.getMaterialLibType()); |
| | | g.setProvcity(goods.getProvcity()); |
| | |
| | | goods.getUserType(), app); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | // 判断是否有优惠券 |
| | | if (!StringUtil.isNullOrEmpty(g.getCouponActivityId())) { |
| | | // 获取优惠券详情 |
| | |
| | | goods.getUserType(), app); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual( goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | return g; |
| | | } |
| | |
| | | goods.getUserType()); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if ( TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setAuctionUrl(goods.getAuctionUrl()); |
| | | g.setShopTitle(goods.getShopTitle()); |
| | | |
| | |
| | | if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null |
| | | && searchResult.getTaoBaoGoodsBriefs().size() > 0) { |
| | | for (TaoBaoGoodsBrief g : searchResult.getTaoBaoGoodsBriefs()) { |
| | | if (g.getAuctionId().longValue() == goods.getAuctionId()) { |
| | | if (TaoBaoUtil.isEqual(g.getAuctionId() , goods.getAuctionId())) { |
| | | g.setImgList(goods.getImgList()); |
| | | g.setId(goods.getAuctionId()); |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setAuctionUrl(goods.getAuctionUrl()); |
| | | g.setShopTitle(goods.getShopTitle()); |
| | | |
| | |
| | | /** |
| | | * 商品物料搜索 |
| | | * |
| | | * @param filter |
| | | * @return |
| | | */ |
| | | public static TaoBaoSearchResult searchWuLiaoForDetail(String title, BigDecimal zkPrice, String provcity, |
| | |
| | | /** |
| | | * 商品物料搜索 |
| | | * |
| | | * @param filter |
| | | * @return |
| | | */ |
| | | public static TaoBaoSearchResult searchWuLiaoForDetail(String title, BigDecimal zkPrice, String provcity, |
| | |
| | | goods.setPictUrlWhite(item.optString("white_image")); |
| | | } |
| | | |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl("https:" + item.optString("url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | public static TaoKeApiUtil.QuanInfo getQuanInfo(Long auctionId, String activityId) { |
| | | public static TaoKeApiUtil.QuanInfo getQuanInfo(String auctionId, String activityId) { |
| | | TaoKeApiUtil.QuanInfo info = new TaoKeApiUtil.QuanInfo(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.coupon.get"); |
| | |
| | | /** |
| | | * 店铺搜索 |
| | | * |
| | | * @param key -店铺名称 |
| | | * @param page -页码 |
| | | * @return |
| | | */ |
| | | public static List<TaoBaoShopInfo> searchShop(SearchShopFilter filter) { |
| | |
| | | System.out.println(resultStr); |
| | | } |
| | | |
| | | public static void getTAEGoodsDetail(Long auctionId) { |
| | | public static void getTAEGoodsDetail(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tae.items.list"); |
| | | map.put("fields", "title,nick,pic_url,location,cid,price,post_fee,promoted_service,ju,shop_name"); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void specialConvertItem(Long auctionId, TaoKeAppInfo app) { |
| | | public static void specialConvertItem(String auctionId, TaoKeAppInfo app) { |
| | | String pid = app.getPid(); |
| | | String[] sts = pid.split("_"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | public static TaoBaoGoodsBrief specialConvertCoupon(Long auctionId, TaoKeAppInfo app) { |
| | | public static TaoBaoGoodsBrief specialConvertCoupon(String auctionId, TaoKeAppInfo app) { |
| | | String pid = app.getPid(); |
| | | String[] sts = pid.split("_"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | // 设置成320*320的图片尺寸 |
| | | goods.setPictUrl(TbImgUtil.getTBSize320Img("https:" + item.optString("pict_url"))); |
| | | goods.setAuctionId(item.optLong("item_id")); |
| | | goods.setAuctionId(item.optString("item_id")); |
| | | goods.setAuctionUrl("https://item.taobao.com/item.htm?id=" + goods.getAuctionId()); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (!StringUtil.isNullOrEmpty(item.optString("coupon_amount"))) { |
| | |
| | | } |
| | | |
| | | // 淘礼金创建 |
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum, |
| | | public static TaoLiJinDTO createTaoLiJin(String auctionId, String name, BigDecimal perface, int totalNum, |
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app) |
| | | throws TaoLiJinCreateException, TaoKeApiException { |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void getCouponByAuctionId(Long auctionId) { |
| | | public static void getCouponByAuctionId(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.itemid.coupon.get"); |
| | | map.put("platform", 2 + ""); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(Long auctionId, int count) { |
| | | public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(String auctionId, int count) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.dg.optimus.material"); |
| | | map.put("item_id", auctionId + ""); |
| | |
| | | return goodsList; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> getCouponListByItemId(Long auctionId) { |
| | | public static List<TaoBaoGoodsBrief> getCouponListByItemId(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.itemid.coupon.get"); |
| | | map.put("platform", auctionId + ""); |
| | |
| | | |
| | | // 商品id |
| | | @Expose |
| | | private Long auctionId; |
| | | private String auctionId; |
| | | // 商品 |
| | | @Expose |
| | | private String title; |
| | |
| | | |
| | | |
| | | |
| | | public Long getAuctionId() { |
| | | public String getAuctionId() { |
| | | return auctionId; |
| | | } |
| | | |
| | | public void setAuctionId(Long auctionId) { |
| | | public void setAuctionId(String auctionId) { |
| | | this.auctionId = auctionId; |
| | | } |
| | | |
| | |
| | | appId=2018120462438303 |
| | | private_key=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC+x9VLP7eZ0sHVjkgNYMnqEP2CrDI+BdW7Il2o1e5Wp0o3GoJBkJH29SpUPQoWUDM3JoILzXPnlS6QeCzfPG3ROJyXlWjp7vNzGs7oWGCbsYac/bweV9DsxnEO5xqYRKUInLL+SoqepxUPYTFxroh5E4ZVWLWBHC0bFCZxiwy9jZhpbNcTAAp/WRJoCpbV0YAw+4pZQmV99HvzwfNKZtUWQWnyKglI3RogYJphFhB91e0X+phZzuE5WzgT2mGOGqw2w3DVK7YDgIX5nAI73Z8zlkDfSys3tB3KibuVMuR6/3yt+G867vhjfebonTHyqKpCJSuyFRfR/WR4lMx4+3aZAgMBAAECggEBAIudAeJHhrzzFxaJQQFJS3oXZO4zxbDN5FNGGvRrWjffxNf+dkQ04Byx3YA4CyG5H0HE1HZ+q8tVyPXAfFYBivwJSc9Eb7qCO3aIr9IomspVaAWLSheKfEJKFoKpbTTxRzS+N98P/dGMxES1A9IFv6mbODtM58bML9YZMOj2sSQlK+g0TKW5SipjWwnmSlEXDDYLMKWRR3zec1FBOB2DR+6Ajkz0+ml4gmlbQe6WNRGPZ7mhW+VLjIbZNd8UYwnRttCJ8G/vWP0xdsyB0wZ5jFhVQsZuqlxCL+LJjsB7o16MsH6r9L8QkGADeo0aICFhsFYmujX4pTBQB6oOQoj07YECgYEA//fOPwTN1hsvUHblXWChn0p5e7Z3S2hxhpnbL0og4Mx+TTQMQ5XgzUCwwFacV5Ctk/lxOepgu8+X928+IeJjPAFZzxLLb4iMpfwzxYhbRli32blNQEH2aXPwnGreXJPAjRAjDx5WbdYOcVyWQRk2MpWSI3eFzxSXS/uaSf6P9LUCgYEAvs3w0Ab9jal7awPMmEKT2+CIbUKTLXsRikxXMX8UsIKYo/5zeqMKwXDjE63agkTNLAUqaYuIA5SFDYbgpXuF5nta2gflgFw8k1mkBdPEhUFYeNmh7tSJgAtObWKOaiDO4/DdmUYd50GIbSGsbUPZ9/PZcju9eJqcf5peaI/m7NUCgYEAgQhdet0kGjN4BXr6IrlMoCz90oRn3KaY2/6BRHR84HWVkbuUFxndyfo7X6oJhAbVyYtsLYLeIq8Cb2QvkQs7dQtFR6K01NOj+ySIwKH9SRf+Dg5gR+04l24vs9oXn9mHrlSdJ8jmTtYiT7kZsVVRQeyuT5y34m0B2/bIj1Z5ISUCgYBXmSTd3Ne7mfvXfb8IiEhpwgPgZZg8YSwEWlgNmVJeVxbM850AyKm/dZxLBJ41AHFRrG10V2LygdU0CKBKWRN4ZVmoj8eFztLgs17ibf7jTsTXdtMpWtpltssi3QSVJMrXS1XxcId6DFQeBj+rSmNfuswx7ctm+1SuIKkHSEm0oQKBgCPwgwsEw4J5yN5J0UEcXbZt9eCNfG43e3NcvsUITxueH05IiHACMw4e6STdgqPMSaiDWb7/d6OTG0Ps1JjuWE4/2i1OeVA/ytznskDw/Y7AH+6Z12x1NPeDYJHOH04K9cV1JQvQoCoQ03ffhHsIU7c7K3pLmLwlHc9IU6tkkcU1 |
| | | public_key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvsfVSz+3mdLB1Y5IDWDJ6hD9gqwyPgXVuyJdqNXuVqdKNxqCQZCR9vUqVD0KFlAzNyaCC81z55UukHgs3zxt0Ticl5Vo6e7zcxrO6Fhgm7GGnP28HlfQ7MZxDucamESlCJyy/kqKnqcVD2Exca6IeROGVVi1gRwtGxQmcYsMvY2YaWzXEwAKf1kSaAqW1dGAMPuKWUJlffR788HzSmbVFkFp8ioJSN0aIGCaYRYQfdXtF/qYWc7hOVs4E9phjhqsNsNw1Su2A4CF+ZwCO92fM5ZA30srN7Qdyom7lTLkev98rfhvOu74Y33m6J0x8qiqQiUrshUX0f1keJTMePt2mQIDAQAB |
| | | private_key=MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCFD+LjXruk3kgV4iL62/hmQlI5qw+y2RCBqWbd3aEuFuDmjbFALpPsg7mFSdtbDYoI8z8ounZOw/pT1cKvxSvXHM2ZWwvPqvd3prnHTHEbkGmfbtf/COZx00yCyFazrIhEViJqH8ryasW/GzO5Ctk9R9I+LZEOxexqrWaYmU12bCeCfYHXs2DYkd5uBrjs4dIVgEfaE/DMOJ+KiTgzI6lTjWntyHc0jx9MGyPpMIuwg1kbElj7X8K+0cpWhyH5cGmMleKTMtzqYTaIRGzu+85ZF94+pkcglRw95Oy3l8z2egmT85IUqXvYxQpW7GX8vm+I4J0Z5VsBtF2vq7P7oqtBAgMBAAECggEAfbO8S7+61M2Im+O91+7mgvQ0aXZIplSZW2SFYSN2mOvUGvnQcSmPZOgr4tca+rGXrUzeZcOA8HgDjB9shFBoUhdLw4xXZB/HGKnQ5443bCrJHWzBcJUf3ngW15YbEjHzqVsVt9vBBbIIjblM64psH5Ax9btmReaEqWKWgaKRo0SxhgoG0anegTH/adOpkQYATqVJ6cZx024E44k0o4LI6l6TuDGp+dgpSegGecKpeg4NgE4cSAhmkB3GfX4z7y3YHSshp5ao3YUmn3neRV9VIaniSrsVo3OHwLrZ9teFZbw7WEKa6oIhp3WvoxtbrtYU/MiDPYAgUexvbxzJdCEAAQKBgQDs86HmFxb+uXK4npeTSFcqVVK0Zkc5lY+5Ohaykxdc/VRt5KDAsIprdpPLsgBl8TrJ13DGuijEdSvvSD49vN3E2SGwhUseMY/+A8TCOpzlV2BP5XZ0tmKHBVgkflzKU6OOy2aLhYSXJTHVf7aKCXp8v6Mi35KJc+wkUACBE12oQQKBgQCPwj+Nvp+O5ez2yfagHZ0CPHdwhkoapFFnYgUxyHCs36s3BWUZV4SbWNCMHAZ8wlQjoZgf8NAfblCVT7ItQNUrJ9ApHJdT29s6BSRHPRBeqlNor2buLKHhlUsTX11csGS/s6+2a5Am62HjmEgGUM5eeus+EKE5rcADzcWgdjxDAQKBgQDnuFIJS2dHb1/LP/yHIeVsFsisdqEMpUBKKY5sz/+3Bl58oWq7RWn4MZvTRZ2yE7gkDzXQgdjAVr3CYOnNQle124lgsNmHC3z/MfxG3T714P7k40d2V63+0LEj7xcbHbQDPtJnewjxLoSPfzepwh8ww8/rmKwbE2xJDpuPnrqmgQKBgH3e0JKlQ0N1IgP7Vctf4mdg1htaGWw2T2g7tNyf6bgTpu/n81s6+8qg+wiSSUPXSqBgDrh4u2GpzzjMrO9egsbkdyhn9j/gkpS8h8UwPDMG4z0XxwHnZl4Dv9ZYe4B6mdwX0lPg3jiVhAIpBXcyLV8gNPUEzoWYEjXCZ7VVkPIBAoGAHJmu46eX9vQGBDdXt+2WfyjeaSYAEraX366SPHUSND0BCJEp3hIHQz0Ou/6IxX+VYRscMKPiGR/LT2q9Xxesl/tj+dXq0pCcrPOJBk2xOjXwkwSm5V9P5S/uS5uWcO2FQqaZgqiB7QAXHVKaQZwCQQ+H1P/MSQYYZR4v1iJsQtI= |
| | | public_key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhQ/i4167pN5IFeIi+tv4ZkJSOasPstkQgalm3d2hLhbg5o2xQC6T7IO5hUnbWw2KCPM/KLp2TsP6U9XCr8Ur1xzNmVsLz6r3d6a5x0xxG5Bpn27X/wjmcdNMgshWs6yIRFYiah/K8mrFvxszuQrZPUfSPi2RDsXsaq1mmJlNdmwngn2B17Ng2JHebga47OHSFYBH2hPwzDifiok4MyOpU41p7ch3NI8fTBsj6TCLsINZGxJY+1/CvtHKVoch+XBpjJXikzLc6mE2iERs7vvOWRfePqZHIJUcPeTst5fM9noJk/OSFKl72MUKVuxl/L5viOCdGeVbAbRdr6uz+6KrQQIDAQAB |
| | | account_name=重庆快省科技有限公司 |
| | | app_cert_path=alipay/appCertPublicKey_2018120462438303.crt |
| | | alipay_root_cert_path=alipay/alipayRootCert.crt |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIIDrDCCApSgAwIBAgIQICAGCcf9EalgJMEEuqGAWDANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE |
| | | MIIDrDCCApSgAwIBAgIQICIFEMahB2edEZkTvIlBZDANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE |
| | | BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0 |
| | | aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs |
| | | YXNzIDIgUjEwHhcNMjAwNjA5MDMwMDU0WhcNMjIwNjA5MDMwMDU0WjCBjDELMAkGA1UEBhMCQ04x |
| | | YXNzIDIgUjEwHhcNMjIwNTEwMDIwMTA0WhcNMjcwNTA5MDIwMTA0WjCBjDELMAkGA1UEBhMCQ04x |
| | | JzAlBgNVBAoMHumHjeW6huW/q+ecgeenkeaKgOaciemZkOWFrOWPuDEPMA0GA1UECwwGQWxpcGF5 |
| | | MUMwQQYDVQQDDDrmlK/ku5jlrp0o5Lit5Zu9Kee9kee7nOaKgOacr+aciemZkOWFrOWPuC0yMDg4 |
| | | MjMxMzUzNjU2NzQxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHWEgMOlGb/VbN5p |
| | |
| | | RHn/vwXrGigu3Y2tRgPMUptqA14EYEfhpm3KjLXsqWdJBO6ziiqILHJtow65QzkeoLM2ZHpYH6oY |
| | | y2rIj/iSIpos18MKWvr4XrqSptJYIQp+G3dwqjlt2kk4bpgAXQSR6wKAtGTkAYvlOSpkQXVqI3tI |
| | | GZO3ZM9bFQurMBoJFX790wIDAQABoxIwEDAOBgNVHQ8BAf8EBAMCA/gwDQYJKoZIhvcNAQELBQAD |
| | | ggEBAEo++sORTzbqKf7CyLEcmg+RnX0Ez2aUOftQPkr2XGnDwNon4Air1c+j3snsRhWyTC2TMt18 |
| | | qCPotlr63Zk67agPaGfrKGk7bDxc9QA/kRrctl4+0h4Jh28jgMLQ4ibNgjkGWmMMwSK4D+19k/vt |
| | | hjlGk9LtTc5lsqgm2GTvifC9C4E0ZDiK+rGz/Mo048TiKNhywO8EKWXvbT9n359rbgKoXMJmKWZQ |
| | | bWdMg8NsP/X+p6mgRAtIJNSLyl/ZzzD2J/NpnHlQxq8/OFnS2EFcs0gN71xDtX+KWp+BJHBMwPM4 |
| | | asjhldpscYgoyx2c/D5CinNgMj7qfmORBQ37shpcKDw= |
| | | ggEBAJnAOI/qtOjfCcy4xE4Lqt2oa2mH1WTgUxsObhAXCPLa7ICXS/uV6vbcSpn3j51hI8k3ivUC |
| | | 6DMECiil6TAS8XJSmfmsixFFYiNnRSJRCoRbV/mGCLzCmeNrWPKobWFL3dmqEMF92DafnaxpIann |
| | | RD2EWj8Lq+sOAISjHSr2IK6j+dtm+zACGfXRi5iLW2veM3P0f06isnca1lkSuVoA0dX09yu46DNp |
| | | 2dCf5963gd6w60ATXdGeskPZUBwLhel0zzIpCQvED7pcz3uaNNDZwaT+VWPywqeXyDrnlTZ3uf/K |
| | | RB4l59YzmVsFG6uiFSzaxYjzlG21gmofdBEN7NNhyzo= |
| | | -----END CERTIFICATE----- |
| | | -----BEGIN CERTIFICATE----- |
| | | MIIE4jCCAsqgAwIBAgIIYsSr5bKAMl8wDQYJKoZIhvcNAQELBQAwejELMAkGA1UEBhMCQ04xFjAU |
| | | BgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEw |
| | | LwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMy |
| | | MjE0MzQxNVoXDTM3MTEyNjE0MzQxNVowgYIxCzAJBgNVBAYTAkNOMRYwFAYDVQQKDA1BbnQgRmlu |
| | | YW5jaWFsMSAwHgYDVQQLDBdDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTE5MDcGA1UEAwwwQW50IEZp |
| | | bmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBDbGFzcyAyIFIxMIIBIjANBgkqhkiG9w0B |
| | | AQEFAAOCAQ8AMIIBCgKCAQEAsLMfYaoRoPRbmDcAfXPCmKf43pWRN5yTXa/KJWO0l+mrgQvs89bA |
| | | NEvbDUxlkGwycwtwi5DgBuBgVhLliXu+R9CYgr2dXs8D8Hx/gsggDcyGPLmVrDOnL+dyeauheARZ |
| | | fA3du60fwEwwbGcVIpIxPa/4n3IS/ElxQa6DNgqxh8J9Xwh7qMGl0JK9+bALuxf7B541Gr4p0WEN |
| | | G8fhgjBV4w4ut9eQLOoa1eddOUSZcy46Z7allwowwgt7b5VFfx/P1iKJ3LzBMgkCK7GZ2kiLrL7R |
| | | iqV+h482J7hkJD+ardoc6LnrHO/hIZymDxok+VH9fVeUdQa29IZKrIDVj65THQIDAQABo2MwYTAf |
| | | BgNVHSMEGDAWgBRfdLQEwE8HWurlsdsio4dBspzhATAdBgNVHQ4EFgQUSqHkYINtUSAtDPnS8Xoy |
| | | oP9p7qEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIB |
| | | AIQ8TzFy4bVIVb8+WhHKCkKNPcJe2EZuIcqvRoi727lZTJOfYy/JzLtckyZYfEI8J0lasZ29wkTt |
| | | a1IjSo+a6XdhudU4ONVBrL70U8Kzntplw/6TBNbLFpp7taRALjUgbCOk4EoBMbeCL0GiYYsTS0mw |
| | | 7xdySzmGQku4GTyqutIGPQwKxSj9iSFw1FCZqr4VP4tyXzMUgc52SzagA6i7AyLedd3tbS6lnR5B |
| | | L+W9Kx9hwT8L7WANAxQzv/jGldeuSLN8bsTxlOYlsdjmIGu/C9OWblPYGpjQQIRyvs4Cc/mNhrh+ |
| | | 14EQgwuemIIFDLOgcD+iISoN8CqegelNcJndFw1PDN6LkVoiHz9p7jzsge8RKay/QW6C03KNDpWZ |
| | | EUCgCUdfHfo8xKeR+LL1cfn24HKJmZt8L/aeRZwZ1jwePXFRVtiXELvgJuM/tJDIFj2KD337iV64 |
| | | fWcKQ/ydDVGqfDZAdcU4hQdsrPWENwPTQPfVPq2NNLMyIH9+WKx9Ed6/WzeZmIy5ZWpX1TtTolo6 |
| | | OJXQFeItMAjHxW/ZSZTok5IS3FuRhExturaInnzjYpx50a6kS34c5+c8hYq7sAtZ/CNLZmBnBCFD |
| | | aMQqT8xFZJ5uolUaSeXxg7JFY1QsYp5RKvj4SjFwCGKJ2+hPPe9UyyltxOidNtxjaknOCeBHytOr |
| | | -----END CERTIFICATE----- |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIIEqzCCA5OgAwIBAgIQICAGCQ97tY3/xzVrWsTnITANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE |
| | | MIIEqzCCA5OgAwIBAgIQICIGEoeA63tY4wsfuButeTANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE |
| | | BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0 |
| | | aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs |
| | | YXNzIDEgUjEwHhcNMjAwNjA5MDMwMDU0WhcNMjIwNjA5MDMwMDU0WjBzMQswCQYDVQQGEwJDTjEn |
| | | YXNzIDEgUjEwHhcNMjIwNjEyMDMxNDUwWhcNMjcwNjExMDMxNDUwWjBzMQswCQYDVQQGEwJDTjEn |
| | | MCUGA1UECgwe6YeN5bqG5b+r55yB56eR5oqA5pyJ6ZmQ5YWs5Y+4MQ8wDQYDVQQLDAZBbGlwYXkx |
| | | KjAoBgNVBAMMITIwODgyMzEzNTM2NTY3NDEtMjAxODEyMDQ2MjQzODMwMzCCASIwDQYJKoZIhvcN |
| | | AQEBBQADggEPADCCAQoCggEBAL7H1Us/t5nSwdWOSA1gyeoQ/YKsMj4F1bsiXajV7lanSjcagkGQ |
| | | kfb1KlQ9ChZQMzcmggvNc+eVLpB4LN88bdE4nJeVaOnu83MazuhYYJuxhpz9vB5X0OzGcQ7nGphE |
| | | pQicsv5Kip6nFQ9hMXGuiHkThlVYtYEcLRsUJnGLDL2NmGls1xMACn9ZEmgKltXRgDD7illCZX30 |
| | | e/PB80pm1RZBafIqCUjdGiBgmmEWEH3V7Rf6mFnO4TlbOBPaYY4arDbDcNUrtgOAhfmcAjvdnzOW |
| | | QN9LKze0HcqJu5Uy5Hr/fK34bzru+GN95uidMfKoqkIlK7IVF9H9ZHiUzHj7dpkCAwEAAaOCASkw |
| | | ggElMB8GA1UdIwQYMBaAFHEH4gRhFuTl8mXrMQ/J4PQ8mtWRMB0GA1UdDgQWBBQhB0deYlZ4jgMS |
| | | BvhRouHKxOXxbjBABgNVHSAEOTA3MDUGB2CBHAFuAQEwKjAoBggrBgEFBQcCARYcaHR0cDovL2Nh |
| | | AQEBBQADggEPADCCAQoCggEBAIUP4uNeu6TeSBXiIvrb+GZCUjmrD7LZEIGpZt3doS4W4OaNsUAu |
| | | k+yDuYVJ21sNigjzPyi6dk7D+lPVwq/FK9cczZlbC8+q93emucdMcRuQaZ9u1/8I5nHTTILIVrOs |
| | | iERWImofyvJqxb8bM7kK2T1H0j4tkQ7F7GqtZpiZTXZsJ4J9gdezYNiR3m4GuOzh0hWAR9oT8Mw4 |
| | | n4qJODMjqVONae3IdzSPH0wbI+kwi7CDWRsSWPtfwr7RylaHIflwaYyV4pMy3OphNohEbO77zlkX |
| | | 3j6mRyCVHD3k7LeXzPZ6CZPzkhSpe9jFClbsZfy+b4jgnRnlWwG0Xa+rs/uiq0ECAwEAAaOCASkw |
| | | ggElMB8GA1UdIwQYMBaAFHEH4gRhFuTl8mXrMQ/J4PQ8mtWRMB0GA1UdDgQWBBRwKFTYsPx/M5g4 |
| | | Vk2bG0Akasd1+DBABgNVHSAEOTA3MDUGB2CBHAFuAQEwKjAoBggrBgEFBQcCARYcaHR0cDovL2Nh |
| | | LmFsaXBheS5jb20vY3BzLnBkZjAOBgNVHQ8BAf8EBAMCBsAwLwYDVR0fBCgwJjAkoCKgIIYeaHR0 |
| | | cDovL2NhLmFsaXBheS5jb20vY3JsNDIuY3JsMGAGCCsGAQUFBwEBBFQwUjAoBggrBgEFBQcwAoYc |
| | | cDovL2NhLmFsaXBheS5jb20vY3JsNjYuY3JsMGAGCCsGAQUFBwEBBFQwUjAoBggrBgEFBQcwAoYc |
| | | aHR0cDovL2NhLmFsaXBheS5jb20vY2E2LmNlcjAmBggrBgEFBQcwAYYaaHR0cDovL2NhLmFsaXBh |
| | | eS5jb206ODM0MC8wDQYJKoZIhvcNAQELBQADggEBAAIuuwxjgMUmDfOH0D0QHAE6J06pt1nhFcb/ |
| | | SMGsWVZgI71vV+v/kKywpczpcOyBMCN05WphITqX1RMJTB2CPIbYWRcf8Q3aoKZ7nkd8YCGar8Nz |
| | | BtsPDloyE5NprOfFB63stg46KWYDull/62qwfpiyXgvi4H86ODs+icvk1yLq7jxvPyhhSIZbaLdM |
| | | esquQLKZK08jmD28ASLYirI4uhwLYcjdwrWzIZx2mXdE7d505R36poShSSaGPS9nWgLnJTq5at7N |
| | | 6vCC44rVoe6fxcMbfEfvEJd/jkA7O5VuELm0VeDEmFWEZLlCT4sO+/Xqqh9K4HJekLxzNG9xMDDX |
| | | 4yM= |
| | | eS5jb206ODM0MC8wDQYJKoZIhvcNAQELBQADggEBADi3llH5lp0CtgW755u1nop82Ugp4EU9kKXH |
| | | C29nwWQ0zVx0p1TeYg+9KZLfXSYuy+ENj+lJrmdE6PoPQusE5WzYTeR960ihq7RwGzMVRv71vvaa |
| | | SI3lvjTBBtZ9OO6H1B2k0dTEaSravmiVFn/kNIwWuakfB4kuBdicOJZpA7w7x7SgWEP7YnkzyyDV |
| | | SgfjrAAreXRmM99HefVMLSR6kBjs3RQ/zDmxA0IBijiui5FCz7l0vnjZO1t7xSMCXrt18Xz1CajI |
| | | UoNa/JwN1RrBR2Du0jAPmkoNTAKENla70qHrc8N6cyTGUbLvpVxTNY5bXOrmrnPY2si31y0oL5mk |
| | | UEw= |
| | | -----END CERTIFICATE----- |
| | |
| | | |
| | | <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 --> |
| | | |
| | |
| | | task =false |
| | | outnetwork =false |
| | | test=true |
| | | mq_pub=true |
| | |
| | | task =false |
| | | outnetwork =true |
| | | test =false |
| | | mq_pub=false |
| | |
| | | task =true |
| | | outnetwork =true |
| | | test=false |
| | | mq_pub=false |
| | |
| | | task =false |
| | | outnetwork =true |
| | | test =false |
| | | mq_pub=false |
| | |
| | | task =false |
| | | outnetwork =true |
| | | test=true |
| | | mq_pub=true |
| | |
| | | <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"/> |
| | | |
| | | |
| | | <property resource="kafka_log.properties"></property> |
| | | <!--<property resource="kafka_log.properties"></property>--> |
| | | <property name="tencent.log.accesskey" value="AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"/> |
| | | |
| | | <property name="tencent.log.accessKeySecret" value="xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"/> |
| | | |
| | | <property name="tencent.log.endpoint" value="ap-guangzhou.cls.tencentyun.com"/> |
| | | <!--<property name="tencent.log.endpoint" value="ap-guangzhou.cls.tencentcs.com"/>--> |
| | | |
| | | |
| | | <!--appender是为了配置日志信息输出到哪个地方--> |
| | | <!--控制台设置,输出到控制台中--> |
| | |
| | | </layout> |
| | | </appender> |
| | | |
| | | <appender name="KAFKA_ERROR" class="com.tencentcloudapi.cls.LoghubAppender"> |
| | | <!--必选项--> |
| | | <endpoint>${tencent.log.endpoint}</endpoint> |
| | | <accessKeyId>${tencent.log.accesskey}</accessKeyId> |
| | | <accessKeySecret>${tencent.log.accessKeySecret}</accessKeySecret> |
| | | <topicId>b8a10057-81be-42cb-adbe-832e19531341</topicId> |
| | | |
| | | <!-- 读取配置文件中kafka的信息 --> |
| | | <property name="isSend" |
| | | value="${log.config.kafka.isSend}"/> |
| | | <property name="bootstrapServers" |
| | | value="${log.config.kafka.bootstrapServers}"/> |
| | | <property name="topic" |
| | | value="${log.config.kafka.topic}"/> |
| | | <property name="batchSize" |
| | | value="${log.config.kafka.batchSize}"/> |
| | | <property name="lingerMs" |
| | | value="${log.config.kafka.lingerMs}"/> |
| | | <property name="compressionType" |
| | | value="${log.config.kafka.compressionType}"/> |
| | | <property name="retries" |
| | | value="${log.config.kafka.retries}"/> |
| | | <property name="maxRequestSize" |
| | | value="${log.config.kafka.maxRequestSize}"/> |
| | | |
| | | |
| | | <appender name="KAFKA_ERROR" class="com.yeshi.fanli.log.KafkaAppender"> |
| | | <!-- encoder必须配置, 日志格式 --> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--<pattern>--> |
| | | <!--%red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %highlight(%-5level) %green([%thread]) %boldMagenta(%logger{10}) - %cyan(%msg%n)--> |
| | | <!--</pattern>--> |
| | | <!--为了便于分析将日志数据转为json格式--> |
| | | <!-- 可选项 设置时间格式 --> |
| | | <timeFormat>yyyy-MM-dd'T'HH:mm:ssZ</timeFormat> |
| | | <timeZone>Asia/Shanghai</timeZone> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | <!-- 控制台也要使用UTF-8,不要使用GBK,否则会中文乱码 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <bootstrapServers>${bootstrapServers}</bootstrapServers> |
| | | <topic>${topic}</topic> |
| | | <batchSize>${batchSize}</batchSize> |
| | | <lingerMs>${lingerMs}</lingerMs> |
| | | <compressionType>${compressionType}</compressionType> |
| | | <retries>${retries}</retries> |
| | | <maxRequestSize>${maxRequestSize}</maxRequestSize> |
| | | <isSend>${isSend}</isSend> |
| | | <mdcFields>THREAD_ID,MDC_KEY</mdcFields> |
| | | |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | |
| | | </appender> |
| | | |
| | | |
| | | <!-- 用户商品浏览 --> |
| | | <appender name="KAFKA_USER_GOODS_SCAN" class="com.yeshi.fanli.log.KafkaAppender"> |
| | | <!-- encoder必须配置, 日志格式 --> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--<pattern>--> |
| | | <!--%red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %highlight(%-5level) %green([%thread]) %boldMagenta(%logger{10}) - %cyan(%msg%n)--> |
| | | <!--</pattern>--> |
| | | <!--为了便于分析将日志数据转为json格式--> |
| | | <appender name="KAFKA_WARNING" class="com.tencentcloudapi.cls.LoghubAppender"> |
| | | <!--必选项--> |
| | | <endpoint>${tencent.log.endpoint}</endpoint> |
| | | <accessKeyId>${tencent.log.accesskey}</accessKeyId> |
| | | <accessKeySecret>${tencent.log.accessKeySecret}</accessKeySecret> |
| | | <topicId>6adfdb45-7378-4b73-be9c-7e15d8b253f2</topicId> |
| | | |
| | | <!-- 可选项 设置时间格式 --> |
| | | <timeFormat>yyyy-MM-dd'T'HH:mm:ssZ</timeFormat> |
| | | <timeZone>Asia/Shanghai</timeZone> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | <!-- 控制台也要使用UTF-8,不要使用GBK,否则会中文乱码 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <bootstrapServers>${bootstrapServers}</bootstrapServers> |
| | | <topic>log_fanli_user_goods_scan</topic> |
| | | <batchSize>${batchSize}</batchSize> |
| | | <lingerMs>${lingerMs}</lingerMs> |
| | | <compressionType>${compressionType}</compressionType> |
| | | <retries>${retries}</retries> |
| | | <maxRequestSize>${maxRequestSize}</maxRequestSize> |
| | | <isSend>${isSend}</isSend> |
| | | <mdcFields>THREAD_ID,MDC_KEY</mdcFields> |
| | | |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>WARN</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | |
| | | <!-- 用户商品浏览 --> |
| | | <appender name="KAFKA_USER_GOODS_SCAN" class="com.tencentcloudapi.cls.LoghubAppender"> |
| | | <!--必选项--> |
| | | <endpoint>${tencent.log.endpoint}</endpoint> |
| | | <accessKeyId>${tencent.log.accesskey}</accessKeyId> |
| | | <accessKeySecret>${tencent.log.accessKeySecret}</accessKeySecret> |
| | | <topicId>3f87a7c2-fa9d-4d95-8ea5-e4e51ebc88ee</topicId> |
| | | |
| | | <!-- 可选项 设置时间格式 --> |
| | | <timeFormat>yyyy-MM-dd'T'HH:mm:ssZ</timeFormat> |
| | | <timeZone>Asia/Shanghai</timeZone> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <mdcFields>THREAD_ID,MDC_KEY</mdcFields> |
| | | </appender> |
| | | |
| | | |
| | |
| | | </logger> |
| | | |
| | | |
| | | <!-- 排除不需要打印的日志 --> |
| | | <logger name="com.qcloud.cmq.CMQTool" level="OFF" additivity="false"/> |
| | | |
| | | |
| | | <!-- 一切logger都会继承自root,root默认的层级level为debug --> |
| | |
| | | <appender-ref ref="STDOUT"></appender-ref> |
| | | <appender-ref ref="ERROR_FILE"></appender-ref> |
| | | <appender-ref ref="KAFKA_ERROR"></appender-ref> |
| | | <appender-ref ref="KAFKA_WARNING"></appender-ref> |
| | | </root> |
| | | </configuration> |
| | |
| | | from yeshi_ec_share_goods_usershare where sgus_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByUidAndAuctionId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | <select id="selectByUidAndAuctionId" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_share_goods_usershare where sgus_uid = #{uid} and |
| | |
| | | SELECT COUNT(g.`lg_id`) FROM `yeshi_ec_label_goods` g WHERE g.`lg_goods_id` = ${goodsId} |
| | | </select> |
| | | |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_label_goods where lg_goods_id = #{goodsId,jdbcType=BIGINT} |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.String"> |
| | | delete from yeshi_ec_label_goods where lg_goods_id = #{goodsId} |
| | | </delete> |
| | | |
| | | |
| | |
| | | delete from yeshi_ec_label_goods where lg_label_id = #{labId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <delete id="deleteByGoodsIdAndLabId" parameterType="java.lang.Long"> |
| | | <delete id="deleteByGoodsIdAndLabId"> |
| | | delete from yeshi_ec_label_goods where lg_goods_id = #{goodsId,jdbcType=BIGINT} and lg_label_id = #{labId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | |
| | | |
| | | |
| | | |
| | | <select id="queryCountByGoodsId" resultType="java.lang.Long"> |
| | | <select id="queryCountByGoodsId" resultType="java.lang.String"> |
| | | SELECT COUNT(sg_id) |
| | | FROM yeshi_ec_quality_factory WHERE sg_goods_id = |
| | | ${goodsId} |
| | |
| | | FROM yeshi_ec_quality_factory |
| | | </select> |
| | | |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.Long"> |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.String"> |
| | | delete from |
| | | yeshi_ec_quality_factory where sg_goods_id = |
| | | #{goodsId,jdbcType=BIGINT} |
| | | #{goodsId} |
| | | </delete> |
| | | |
| | | <select id="countTotalRows" resultType="java.lang.Long"> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="getAuctionIdbyClassId" resultType="java.lang.Long"> |
| | | <select id="getAuctionIdbyClassId" resultType="java.lang.String"> |
| | | SELECT h.`sg_goods_id` FROM `yeshi_ec_quality_factory` h |
| | | WHERE h.`sg_goods_source` = #{goodsSource} |
| | | AND h.`sg_updatetime` <![CDATA[<]]> |
| | |
| | | separator=",">#{item}</foreach> |
| | | </select> |
| | | |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_quality_flash_sale where fs_qfgoods_id = #{qid,jdbcType=BIGINT} |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.String"> |
| | | delete from yeshi_ec_quality_flash_sale where fs_qfgoods_id = #{qid} |
| | | </delete> |
| | | |
| | | <delete id="deleteBatchByQualityID" parameterType="java.util.List"> |
| | |
| | | <select id="selectByMaxCreateTime" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_user_money_detail d WHERE d.umd_uid=#{uid} and d.umd_show=1 and d.`umd_createtime`<![CDATA[<=]]>#{date} |
| | | FROM yeshi_ec_user_money_detail d WHERE d.umd_uid=#{uid} and d.umd_show=1 and d.`umd_createtime`<![CDATA[<=]]> |
| | | #{date} |
| | | <if test="type == 1">and d.umd_money<![CDATA[>]]>0</if> |
| | | <if test="type == 2">and d.umd_money<![CDATA[<=]]>0</if> |
| | | order by d.`umd_createtime` desc,d.umd_id desc limit ${count} |
| | |
| | | <if test="show != null"> AND umd_show = #{show}</if> |
| | | and umd_createtime>=#{minDate} and umd_createtime<![CDATA[<]]>#{maxDate} |
| | | <foreach collection="typeList" item="item" open=" and (" |
| | | separator=" or " close=")">umd_type=#{item}</foreach> |
| | | separator=" or " close=")">umd_type=#{item} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectByTypeAndUidAndIdentifyCode" resultMap="BaseResultMap"> |
| | | select |
| | |
| | | umd_type=#{type} and umd_source_identify_id=#{sourceIdentifyId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByIdentifyCode" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from yeshi_ec_user_money_detail where umd_identify_code=#{identifyCode} |
| | | </select> |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap"> |
| | | select <include refid="Base_Column_List" /> from yeshi_ec_user_money_detail |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from yeshi_ec_user_money_detail |
| | | <if test="key != null and key !=''"> |
| | | <if test="keyType == 1"> where umd_uid = #{key}</if> |
| | | <if test="keyType == 2"> where umd_uid like '${key}%'</if> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="queryCanDeleteGoods" resultType="java.lang.Long"> |
| | | <select id="queryCanDeleteGoods" resultType="java.lang.String"> |
| | | SELECT g.`auctionId` FROM yeshi_ec_taobao_goods g LEFT JOIN |
| | | `yeshi_ec_recommend_section_goods` sg ON sg.`goodsid`=g.`id` WHERE |
| | | sg.`id` IS NULL AND g.createtime <![CDATA[< |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="listNeedUpdateGoodsId" resultType="Long"> |
| | | <select id="selectOneByAuctionId" resultMap="BaseResultMap"> |
| | | <!-- 根据auctionId 查询商品信息 --> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_taobao_goods tg WHERE tg.`auctionId` = ${auctionId} order by id desc |
| | | </select> |
| | | |
| | | |
| | | <select id="listNeedUpdateGoodsId" resultType="java.lang.String"> |
| | | SELECT id FROM `yeshi_ec_taobao_goods` |
| | | WHERE TO_DAYS(updatetime) <![CDATA[<]]> TO_DAYS(NOW()) |
| | | OR (HOUR(NOW()) -HOUR(updatetime)) <![CDATA[>=]]> #{hour} |
| | |
| | | http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd |
| | | http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd |
| | | http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd |
| | | http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd"> |
| | | http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.10.2.xsd"> |
| | | <!-- 必须采用java8 --> |
| | | |
| | | |
| | |
| | | <!-- 引入配置文件 --> |
| | | <bean |
| | | class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
| | | <property name="locations"> <!-- PropertyPlaceholderConfigurer类中有个locations属性,接收的是一个数组,即我们可以在下面配好多个properties文件 --> |
| | | <property |
| | | name="locations"> <!-- PropertyPlaceholderConfigurer类中有个locations属性,接收的是一个数组,即我们可以在下面配好多个properties文件 --> |
| | | <array> |
| | | <value>classpath:redis.properties</value> |
| | | <value>classpath:druid.properties</value> |
| | |
| | | <import resource="classpath:xxl-job.xml" /> |
| | | <import resource="classpath:elasticsearch.xml" /> |
| | | <import resource="classpath:dubbo/consumer.xml" /> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!--异步定义推荐方式 <task:executor id="executor" pool-size="15" /> <task:scheduler |
| | |
| | | <property name="url" value="${druid.url}" /> |
| | | <property name="username" value="${druid.username}" /> |
| | | <property name="password" value="${druid.password}" /> |
| | | |
| | | |
| | | |
| | | <!-- 配置初始化大小、最小、最大 --> |
| | |
| | | <property name="basePackage" value="com.yeshi.fanli.dao.mybatis,com.yeshi.fanli.lijin.dao" /> |
| | | <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> |
| | | </bean> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 事物 --> |
| | |
| | | </bean> |
| | | |
| | | |
| | | |
| | | <!-- redis连接池 --> |
| | | <bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig"> |
| | | <property name="maxTotal" value="${redis.max_total}"></property> |
| | |
| | | |
| | | |
| | | <!-- mongodb --> |
| | | <mongo:mongo id="mongo" host="${mongo.host}" port="${mongo.port}"> |
| | | <mongo:options connections-per-host="${mongo.connectionsPerHost}" |
| | | <mongo:mongo-client id="mongoClient" host="${mongo.host}" port="${mongo.port}" |
| | | credentials="${mongo.username}:${mongo.password}@admin"> |
| | | <mongo:client-options connections-per-host="${mongo.connectionsPerHost}" |
| | | threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}" |
| | | connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}" |
| | | auto-connect-retry="${mongo.autoConnectRetry}" socket-keep-alive="${mongo.socketKeepAlive}" |
| | | socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}" |
| | | write-number="1" write-timeout="0" write-fsync="true" /> |
| | | </mongo:mongo> |
| | | socket-keep-alive="${mongo.socketKeepAlive}" |
| | | socket-timeout="${mongo.socketTimeout}"/> |
| | | </mongo:mongo-client> |
| | | |
| | | <mongo:db-factory id="mongoDbFactory" |
| | | dbname="${mongo.dbname}" |
| | | mongo-ref="mongoClient"/> |
| | | |
| | | |
| | | <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> |
| | | <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> |
| | | <constructor-arg ref="mongoDbFactory"/> |
| | | </bean> |
| | | <bean id="mongoDbFactory" |
| | | class="org.springframework.data.mongodb.core.SimpleMongoDbFactory"> |
| | | <constructor-arg name="mongo" ref="mongo" /> |
| | | <constructor-arg name="databaseName" value="${mongo.dbname}" /> |
| | | <constructor-arg name="credentials" ref="userCredentials" /> |
| | | <constructor-arg name="authenticationDatabaseName" |
| | | value="admin" /> |
| | | </bean> |
| | | <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> |
| | | <constructor-arg name="username" value="${mongo.username}" /> |
| | | <constructor-arg name="password" value="${mongo.password}" /> |
| | | </bean> |
| | | <!--<bean id="mongoDbFactory"--> |
| | | <!--class="org.springframework.data.mongodb.core.SimpleMongoDbFactory">--> |
| | | <!--<constructor-arg name="mongo" ref="mongo" />--> |
| | | <!--<constructor-arg name="databaseName" value="${mongo.dbname}" />--> |
| | | <!--<constructor-arg name="credentials" ref="userCredentials" />--> |
| | | <!--<constructor-arg name="authenticationDatabaseName"--> |
| | | <!--value="admin" />--> |
| | | <!--</bean>--> |
| | | <!--<bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials">--> |
| | | <!--<constructor-arg name="username" value="${mongo.username}" />--> |
| | | <!--<constructor-arg name="password" value="${mongo.password}" />--> |
| | | <!--</bean>--> |
| | | |
| | | <bean id="jobFactory" class="com.yeshi.fanli.job.JobFactory"></bean> |
| | | |
| | |
| | | |
| | | <properties> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <org.springframework-version>4.3.0.RELEASE</org.springframework-version> |
| | | <org.springframework-version>4.3.14.RELEASE</org.springframework-version> |
| | | <mybatis.version>3.4.1</mybatis.version> |
| | | <!-- <spring.mongodb.version>1.9.8.RELEASE</spring.mongodb.version> --> |
| | | <spring.mongodb.version>1.10.10.RELEASE</spring.mongodb.version> |
| | |
| | | <dependency> |
| | | <groupId>junit</groupId> |
| | | <artifactId>junit</artifactId> |
| | | <version>4.11</version> |
| | | <version>4.12</version> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | |
| | |
| | | <version>${org.springframework-version}</version> |
| | | <type>jar</type> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | <version>${org.springframework-version}</version> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | |
| | | |
| | |
| | | </dependency> |
| | | |
| | | <!-- mongodb --> |
| | | <dependency> |
| | | <groupId>org.mongodb</groupId> |
| | | <artifactId>mongo-java-driver</artifactId> |
| | | <version>2.13.0-rc0</version> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.mongodb</groupId>--> |
| | | <!--<artifactId>mongo-java-driver</artifactId>--> |
| | | <!--<version>2.14.3</version>--> |
| | | <!--</dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.data</groupId> |
| | |
| | | <version>${spring.mongodb.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-mongodb-cross-store</artifactId> |
| | | <version>${spring.mongodb.version}</version> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.data</groupId>--> |
| | | <!--<artifactId>spring-data-mongodb-cross-store</artifactId>--> |
| | | <!--<version>${spring.mongodb.version}</version>--> |
| | | <!--</dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-mongodb-log4j</artifactId> |
| | | <version>1.10.17.RELEASE</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> |
| | | <dependency> |
| | |
| | | <version>4.3.0</version> |
| | | </dependency> |
| | | |
| | | <!-- Servlet --> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | <version>3.0.1</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.tencentcloudapi</groupId> |