| | |
| | |
|
| | | DaTaoKeGoodsResult result = null;
|
| | | if ("-1".equalsIgnoreCase(cid)) {
|
| | | result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", null, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null,
|
| | | new BigDecimal("10"),null, page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | result.setGoodsList(
|
| | | daTaoKeGoodsDetailV2Service.listByMaxPrice(null, new BigDecimal("10"), null, page, pageSize));
|
| | | result.setTotalCount(daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | }
|
| | |
|
| | | } else if ("0".equalsIgnoreCase(cid)) {
|
| | | result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", null, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_CREATETIME);
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null,
|
| | | new BigDecimal("10"),"createTime", page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null, new BigDecimal("10"), "createTime",
|
| | | page, pageSize));
|
| | | result.setTotalCount(daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | }
|
| | | } else {
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(Integer.parseInt(cid));
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, new BigDecimal("10"), page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | result =
|
| | | DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(Integer.parseInt(cid),
|
| | | new BigDecimal("10"),null, page, pageSize));
|
| | | new BigDecimal("10"), null, page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(Integer.parseInt(cid), new BigDecimal("10")));
|
| | | }
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(4);// 居家生活
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(6);// 美食
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | if ("1".equalsIgnoreCase(cid)) {// 大淘客数据
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(2);// 母婴
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(1);// 女装
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | cidList.add(7);
|
| | | cidList.add(13);
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | |
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createFailiMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, null);
|
| | | uid, "若需再返请使用返利奖励券");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private void saveHongBao(CommonOrder commonOrder, int type, boolean vip, Map<Integer, HongBaoOrder> notificationMap)
|
| | | throws HongBaoException, UserAccountException {
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | |
| | |
|
| | | if (shareRate.compareTo(new BigDecimal(0)) <= 0)
|
| | | return;
|
| | | HongBaoV2 hongBao = createShareHongBao(commonOrder, shareRate,vip);
|
| | | HongBaoV2 hongBao = createShareHongBao(commonOrder, shareRate, vip);
|
| | | if (hongBao == null)
|
| | | return;
|
| | | addFanLiOrShareHongBao(hongBao, commonOrder, notificationMap);
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | public static DaTaoKeDetailV2 getGoodsDetailByGoodsId(Long goodsId) {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | |
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | key = "";
|
| | | params.put("keyWords", key);
|
| | | |
| | |
|
| | | if (sort != null)
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | |
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | public static DaTaoKeGoodsResult search(String key, List<Integer> cidList, BigDecimal priceLowerLimit,
|
| | | BigDecimal priceUpperLimit, Integer couponPriceLowerLimit, int page, int pageSize, Integer sort) {
|
| | |
|
| | |
| | | params.put("priceLowerLimit", priceLowerLimit + "");
|
| | | if (priceUpperLimit != null)
|
| | | params.put("priceUpperLimit", priceUpperLimit + "");
|
| | | |
| | |
|
| | | if (couponPriceLowerLimit != null)
|
| | | params.put("couponPriceLowerLimit", couponPriceLowerLimit + "");
|
| | | |
| | |
|
| | | String cids = "";
|
| | | if (cidList != null && cidList.size() > 0)
|
| | | for (Integer cid : cidList) {
|
| | |
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | key = "%";
|
| | | params.put("keyWords", key);
|
| | | |
| | |
|
| | | if (sort != null)
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | |
| | |
|
| | | /**
|
| | | * 商品列表
|
| | | * |
| | | * @param key
|
| | | * @param cidList
|
| | | * @param priceLowerLimit
|
| | |
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", pageSize + "");
|
| | | params.put("pageId", pageId + "");
|
| | | |
| | |
|
| | | if (priceLowerLimit != null)
|
| | | params.put("priceLowerLimit", priceLowerLimit + "");
|
| | | if (priceUpperLimit != null)
|
| | | params.put("priceUpperLimit", priceUpperLimit + "");
|
| | | |
| | |
|
| | | if (couponPriceLowerLimit != null)
|
| | | params.put("couponPriceLowerLimit", couponPriceLowerLimit + "");
|
| | | |
| | |
|
| | | if (sort != null)
|
| | | params.put("sort", sort +"");
|
| | | |
| | | params.put("sort", sort + "");
|
| | |
|
| | | if (cidList != null && cidList.size() > 0) {
|
| | | String cids = "";
|
| | | for (int cid : cidList)
|
| | | cids += cid + ",";
|
| | | cids = cids.endsWith(",") ? cids.substring(0, cids.length() - 1) : cids;
|
| | | |
| | | params.put("cids", cids + "");
|
| | | }
|
| | |
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-goods-list", params, new HashMap<>());
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | |
| | | .Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单维权");
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + drawBack.getOrderId());
|
| | |
| | | .Md5(UserMoneyDetailTypeEnum.shareWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.shareWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单维权");
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + UserUtil.filterOrderId(drawBack.getOrderId()));
|
| | |
| | | .Md5(UserMoneyDetailTypeEnum.inviteWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.inviteWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单维权");
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.inviteWeiQuan);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + UserUtil.filterOrderId(drawBack.getOrderId()));
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("返利订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单维权", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("扣除说明", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单维权", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("扣除说明", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单维权", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("扣除说明", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | |
|
| | | #返利到账
|
| | | money_fanli_recieved_title=返利到账
|
| | | money_fanli_recieved_msg=[订单类型]订单[订单号],返利[金额]元,已存入到你的账户余额中,请注意查收。
|
| | | money_fanli_recieved_msg=[订单类型]订单[订单号],返利[金额]元,已存入到你的账户余额中,需再返请使用返利奖励券。
|
| | |
|
| | | #分享奖金到账
|
| | | money_share_recieved_title=分享奖金到账
|