Merge remote-tracking branch 'origin/div' into div
| | |
| | |
|
| | | @RequestMapping("findLostOrder")
|
| | | public void findLostOrder(AcceptData acceptData, LostOrder lostOrder, HttpServletRequest request, PrintWriter out) {
|
| | | boolean orderNum = true;
|
| | | Integer type = lostOrder.getType();
|
| | | if (type == null) {
|
| | | type = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | if (!NumberUtil.isNumeric(lostOrder.getOrderId())) {
|
| | | boolean orderNum = true;
|
| | | String orderId = lostOrder.getOrderId();
|
| | | if (type == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 12 || orderId.length() > 20)) {
|
| | | orderNum = false;
|
| | | } else if (lostOrder.getOrderId().length() < 12 || lostOrder.getOrderId().length() > 20) {
|
| | | } else {
|
| | | orderNum = Utils.isOrderNum(orderId);
|
| | | }
|
| | | } else if (type == Constant.SOURCE_TYPE_JD) {
|
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 6 || orderId.length() > 20)) {
|
| | | orderNum = false;
|
| | | } else
|
| | | orderNum = Utils.isOrderNum(lostOrder.getOrderId());
|
| | | }
|
| | | } else if (type == Constant.SOURCE_TYPE_PDD) {
|
| | | if (!orderId.contains("-")) {
|
| | | orderNum = false;
|
| | | } else {
|
| | | String[] split = orderId.split("-");
|
| | | if (split == null || split.length != 2) {
|
| | | orderNum = false;
|
| | | } else {
|
| | | if (!NumberUtil.isNumeric(split[0]) || !NumberUtil.isNumeric(split[1])) {
|
| | | orderNum = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (lostOrder.getUserInfo() == null || lostOrder.getUserInfo().getId() == null
|
| | | || lostOrder.getUserInfo().getId() <= 0) {
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "accordtorage", method = RequestMethod.POST)
|
| | | public void accordtorage(AcceptData acceptData, Long uid, Long auctionId, Integer goodsType, PrintWriter out) {
|
| | | public void accordtorage(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
|
| | |
|
| | | if (auctionId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("未选择商品"));
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | try {
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, auctionId, goodsType);
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | boolean storageState = false;
|
| | | if (userGoodsStorage != null) {
|
| | | // 取消加入选品库
|
| | |
| | | // 加入选品库
|
| | | Set<Long> set = new HashSet<Long>();
|
| | | set.add(auctionId);
|
| | | userGoodsStorageService.save(uid, set, goodsType);
|
| | | userGoodsStorageService.save(uid, set, Constant.SOURCE_TYPE_TAOBAO);
|
| | | storageState = true;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.dto.money.AccountDetails;
|
| | | import com.yeshi.fanli.dto.order.OrderItem;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage;
|
| | |
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | | import com.yeshi.fanli.util.factory.OrderItemFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping("collectionGoods")
|
| | | public void collectionGoods(AcceptData acceptData, long uid, long auctionId, int type, Integer goodsType,
|
| | | PrintWriter out) {
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId, goodsType);
|
| | | public void collectionGoods(AcceptData acceptData, long uid, long auctionId, int type, PrintWriter out) {
|
| | | try {
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (type == 1) {
|
| | | if (find != null) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(auctionId);
|
| | | if (jdGoods == null) {
|
| | | jdGoods = JDApiUtil.getGoodsDetail(auctionId);
|
| | | }
|
| | |
|
| | | if (jdGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | } else {
|
| | | try {
|
| | | collectionGoodsV2Service.addJDCollection(uid, jdGoods);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(auctionId);
|
| | | if (pddGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | collectionGoodsV2Service.addPDDCollection(uid, pddGoods);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | |
|
| | | } else {
|
| | | try {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | collectionGoodsV2Service.addCollection(uid, taoBaoGoodsBrief);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | } catch (CollectionGoodsException e1) {
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | }
|
| | | }
|
| | | } else {
|
| | | if (find == null) {
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | return;
|
| | | } else {
|
| | | try {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, auctionId, goodsType);
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | | } catch (CollectionGoodsException e1) {
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * h5收藏
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("userInfo", userInfo);
|
| | |
|
| | | Integer goodsType = null; // 版本区分
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } |
| | | |
| | | /* 总订单统计 */
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countHistoryOrder(uid, null, null);
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countHistoryOrder(uid, null, goodsType);
|
| | | int self = 0;
|
| | | if (countOrder.get("totalSelf") != null) {
|
| | | self = countOrder.get("totalSelf").intValue();
|
| | |
| | | data.put("invite", invite);
|
| | |
|
| | | /* 今日订单统计 */
|
| | | Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, null);
|
| | | Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, goodsType);
|
| | |
|
| | | int todaySelf = 0;
|
| | | if (countToday.get("totalSelf") != null) {
|
| | |
| | | data.put("today", todaydata);
|
| | |
|
| | | /* 昨日订单统计 */
|
| | | Map<String, BigDecimal> countYesterday = commonOrderService.countHistoryOrder(uid, 2, null);
|
| | | Map<String, BigDecimal> countYesterday = commonOrderService.countHistoryOrder(uid, 2, goodsType);
|
| | | int yesterdaySelf = 0;
|
| | | if (countYesterday.get("totalSelf") != null) {
|
| | | yesterdaySelf = countYesterday.get("totalSelf").intValue();
|
| | |
| | | Object inviteCount = 0;
|
| | | BigDecimal inviteMoney = new BigDecimal(0.00);
|
| | |
|
| | | Integer goodsType = null; // 版本区分
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } |
| | |
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null,
|
| | | null);
|
| | | null, goodsType);
|
| | | if (shareMap != null) {
|
| | | Object totalNum = shareMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | |
| | |
|
| | | // 邀请统计
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3, dateType, null,
|
| | | null);
|
| | | null, goodsType);
|
| | | if (inviteMap != null) {
|
| | | Object totalNum = inviteMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | |
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.goods.CollectionGoodsException;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | |
| | | @Resource
|
| | | private ScanHistoryV2Service scanHistoryV2Service;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private JDGoodsCacheUtil jdGoodsCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | |
|
| | | /**
|
| | | * 收藏商品
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param type
|
| | | * @param goodsType
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping("collectionGoods")
|
| | | public void collectionGoods(AcceptData acceptData, long uid, long id, int type, Integer goodsType,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | if (type != 1) {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, id, goodsType);
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | return;
|
| | | }
|
| | |
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, goodsType);
|
| | | if (find != null) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(id);
|
| | | if (jdGoods == null) {
|
| | | jdGoods = JDApiUtil.getGoodsDetail(id);
|
| | | }
|
| | | if (jdGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | return;
|
| | | }
|
| | | collectionGoodsV2Service.addJDCollection(uid, jdGoods);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(id);
|
| | | if (pddGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | return;
|
| | | }
|
| | | collectionGoodsV2Service.addPDDCollection(uid, pddGoods);
|
| | | } else {
|
| | | try {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(id);
|
| | | collectionGoodsV2Service.addCollection(uid, taoBaoGoodsBrief);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除收藏
|
| | | * |
| | | * @param acceptData
|
| | | * @param ids
|
| | | * @param type
|
| | |
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 收藏列表
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 删除足迹
|
| | | * |
| | | * @param acceptData
|
| | | * @param type
|
| | | * @param uid
|
| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取浏览记录
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param page
|
| | |
| | | }
|
| | |
|
| | | long count = 0;
|
| | | List<DynamicInfo> list = dynamicInfoService.queryV2((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,
|
| | | |
| | | int platform = 1;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | platform = 2;
|
| | | }
|
| | | int version = Integer.parseInt(acceptData.getVersion());
|
| | | List<DynamicInfo> list = dynamicInfoService.queryV2(platform, version, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,
|
| | | subId);
|
| | | if (list == null) {
|
| | | list = new ArrayList<DynamicInfo>();
|
| | |
| | | * @param out
|
| | | */
|
| | | private void getIndexPDDGoods(AcceptData acceptData, int page, PrintWriter out) {
|
| | | PDDGoodsResult result = pddGoodsService.getIndexPDDGoods(page);
|
| | | PDDGoodsResult result = pddGoodsService.getTopGoodsList(page, 1);
|
| | | int count = 0;
|
| | | JSONArray array = new JSONArray();
|
| | | if (result != null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePathJD(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goodsId + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | String couponUrl = null;
|
| | | JDCouponInfo couponInfo = goods.getCouponInfo();
|
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsId + ".html";
|
| | | String shortLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid+ "");
|
| | |
|
| | | String content = shareGoodsTextTemplateService.createContentByTemplateJD(template, uid, goods, shortLink,
|
| | | hasCoupon);
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 创建京东分享模板
|
| | | * 创建拼多多分享模板
|
| | | *
|
| | | * @param uid
|
| | | * @param template
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 创建h5连接
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goodsId + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | // // 创建h5连接
|
| | | // String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | // Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | // goodsId + "");
|
| | | // String shortLink = HttpUtil.getShortLink(url);
|
| | | |
| | | String shortLink = PinDuoDuoApiUtil.convert(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
|
| | |
|
| | | // 创建口令
|
| | | String token = PinDuoDuoApiUtil.createGenerate(goodsId);
|
| | |
| | | @Resource
|
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 单个商品加入选品库
|
| | | * |
| | | * @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) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | |
| | | try {
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, id, goodsType);
|
| | | boolean storageState = false;
|
| | | if (userGoodsStorage != null) {
|
| | | // 取消加入选品库
|
| | | userGoodsStorageService.deleteByPrimaryKey(userGoodsStorage.getId());
|
| | | } else {
|
| | | // 加入选品库
|
| | | Set<Long> set = new HashSet<Long>();
|
| | | set.add(id);
|
| | | userGoodsStorageService.save(uid, set, goodsType);
|
| | | storageState = true;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("storageState", storageState);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 批量添加选品库
|
| | | *
|
| | |
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | |
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | // 过期
|
| | | userTaoLiJinOriginService.overdueHongBao(uid);
|
| | | }
|
| | | });
|
| | | /*
|
| | | * executor.execute(new Runnable() {
|
| | | * |
| | | * @Override public void run() { // 过期
|
| | | * userTaoLiJinOriginService.overdueHongBao(uid); } });
|
| | | */
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", array.size());
|
| | |
| | | * @return |
| | | */ |
| | | Map<String, Object> countBonusOrderMoneyAndNumber(@Param("uid") Long uid, @Param("type") Integer type, |
| | | @Param("day") Integer day, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | @Param("day") Integer day, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | int countByOrderNOAndOrderType(@Param("orderNO") String orderNO, @Param("orderType") int orderType); |
| | | |
| | |
| | |
|
| | | public enum PDDCommonContentTypeEnum {
|
| | |
|
| | | _1k9("1.9包邮", "0"), todayTop("今日爆款", "1"), brandClear("品牌清仓", "2"), brandGoods("品牌好货", null);
|
| | | _1k9("1.9包邮", "0"), todayTop("今日爆款", "1"), brandClear("品牌清仓", "2"), hotSaleGoods("热卖爆款", null);
|
| | | private final String desc;
|
| | | private final String content;
|
| | |
|
| | |
| | | yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id |
| | | IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <if test="day != null and day == 4"> |
| | | AND co.`co_state` = 2 |
| | | <!-- 上月 :统计已收货 --> |
| | | </if> |
| | | <if test="day != null and day == 4">AND co.`co_state` = 2</if> <!-- 上月 :统计已收货 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | <sql id="SELECT_HONGBAO_STATE"> |
| | |
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.InviteMaterial;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "dynamicCache", key = "'queryV2-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
|
| | | public List<DynamicInfo> queryV2(int start, int count, Long cid, Long subId) {
|
| | | @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
|
| | | public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId) {
|
| | | List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate, shareRate);
|
| | | goodsPicture.setGoodsVO(detailVO);
|
| | | goodsPicture.setGoods(null);
|
| | | |
| | | JumpDetailV2 jumpDetail = goodsPicture.getJumpDetail();
|
| | | if (jumpDetail != null) {
|
| | | JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache(jumpDetail.getType(), platform, version);
|
| | | if (jumpDetailV2 != null) {
|
| | | goodsPicture.setJumpDetail(jumpDetailV2);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(imgs);
|
| | |
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dto.common.CommonContentNav;
|
| | | import com.yeshi.fanli.dto.common.PDDCommonContentTypeEnum;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
|
| | | @Service
|
| | | public class PDDCommonTemplateContentServiceImpl implements PDDCommonTemplateContentService {
|
| | |
|
| | | @Resource
|
| | | private PDDGoodsService pddGoodsService;
|
| | | |
| | |
|
| | | @Cacheable(value = "pddCommonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
|
| | | @Override
|
| | |
| | | if (type == PDDCommonContentTypeEnum._1k9 || type == PDDCommonContentTypeEnum.todayTop
|
| | | || type == PDDCommonContentTypeEnum.brandClear) {
|
| | | return PinDuoDuoApiUtil.searchByChannelType(page - 1, pageSize, type.getContent());
|
| | | } else if (type == PDDCommonContentTypeEnum.brandGoods) {
|
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(pageSize);
|
| | | pddfilter.setSortType(22);
|
| | | if ("-1".equalsIgnoreCase(cid)) {
|
| | | pddfilter.setOptId(-1L);
|
| | | } else {
|
| | | long catId = Long.parseLong(cid);
|
| | | pddfilter.setCatId(catId);
|
| | | pddfilter.setOptId(catId);
|
| | | }
|
| | | return PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | } else if (type == PDDCommonContentTypeEnum.hotSaleGoods) {
|
| | | return pddGoodsService.getTopGoodsList(page, 2);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | @Override
|
| | | public List<CommonContentNav> getNavList(PDDCommonContentTypeEnum type) {
|
| | | List<CommonContentNav> navList = new ArrayList<>();
|
| | | if (type == PDDCommonContentTypeEnum.brandGoods) {
|
| | | navList.add(new CommonContentNav("-1", "精选"));
|
| | | //navList.add(new CommonContentNav("-11", "清仓"));
|
| | | navList.add(new CommonContentNav("15", "百货 "));
|
| | | navList.add(new CommonContentNav("4", "母婴"));
|
| | | navList.add(new CommonContentNav("1", "食品"));
|
| | | navList.add(new CommonContentNav("14", "女装"));
|
| | | navList.add(new CommonContentNav("18", "电器"));
|
| | | navList.add(new CommonContentNav("1281", "鞋包"));
|
| | | navList.add(new CommonContentNav("1282", "内衣"));
|
| | | navList.add(new CommonContentNav("16", "美妆"));
|
| | | navList.add(new CommonContentNav("743", "男装"));
|
| | | navList.add(new CommonContentNav("13", "水果"));
|
| | | navList.add(new CommonContentNav("818", "家纺"));
|
| | | navList.add(new CommonContentNav("2478", "文具"));
|
| | | navList.add(new CommonContentNav("1451", "运动"));
|
| | | navList.add(new CommonContentNav("590", "虚拟"));
|
| | | navList.add(new CommonContentNav("2048", "汽车"));
|
| | | navList.add(new CommonContentNav("1917", "家装"));
|
| | | navList.add(new CommonContentNav("2974", "家具"));
|
| | | navList.add(new CommonContentNav("3279", "医药"));
|
| | | if (type == PDDCommonContentTypeEnum.hotSaleGoods) {
|
| | | |
| | | }
|
| | | return navList;
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public Map<String, Object> countBonusOrderMoneyAndNumber(Long uid, Integer type, Integer day, String startTime,
|
| | | String endTime) {
|
| | | return commonOrderMapper.countBonusOrderMoneyAndNumber(uid, type, day, startTime, endTime);
|
| | | String endTime, Integer source) {
|
| | | return commonOrderMapper.countBonusOrderMoneyAndNumber(uid, type, day, startTime, endTime, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.HongBaoOrderMapper;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Service
|
| | | public class HongBaoOrderServiceImpl implements HongBaoOrderService {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByOrderNoAndHongBaoType(String orderNo, int type) {
|
| | | return hongBaoOrderMapper.countByOrderNoAndHongBaoType(orderNo, type, Constant.SOURCE_TYPE_TAOBAO);
|
| | | public long countByOrderNoAndHongBaoType(String orderNo, int hongBaotype, int sourceType) {
|
| | | return hongBaoOrderMapper.countByOrderNoAndHongBaoType(orderNo, hongBaotype, sourceType);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
|
| | | @Service
|
| | |
| | | }
|
| | |
|
| | | // 是否为分享赚订单
|
| | | if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0)
|
| | | if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS, type) > 0)
|
| | | return -5;
|
| | |
|
| | | // 次数限制
|
| | |
| | | lostOrderwriteLock.unlock();
|
| | | }
|
| | |
|
| | | Order or = orderService.getSystemOrderByUid(Constant.TAOBAO, lostOrder.getUserInfo().getId());
|
| | | Order or = orderService.getSystemOrderByUid(type, lostOrder.getUserInfo().getId());
|
| | | if (or != null) {
|
| | | boolean b = Utils.isUserOrder(or.getOrderId(), lostOrder.getOrderId());
|
| | | if (b) {
|
| | |
| | | if (find != null) {
|
| | | return false;
|
| | | }
|
| | |
|
| | | Integer orderType = order.getOrderType();
|
| | | if (orderType == null) {
|
| | | orderType = Order.ORDER_TYPE_TAOBAO;
|
| | | }
|
| | | // 查找是否存在分享赚订单
|
| | | if (hongBaoOrderService.countByOrderNoAndHongBaoType(order.getOrderId(), HongBaoV2.TYPE_SHARE_GOODS) > 0)
|
| | | if (hongBaoOrderService.countByOrderNoAndHongBaoType(order.getOrderId(), HongBaoV2.TYPE_SHARE_GOODS, orderType) > 0)
|
| | | return false;
|
| | | orderMapper.insertSelective(order);
|
| | | } finally {
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "pddSpecialCache", key = "'getIndexPDDGoods-'+#page")
|
| | | public PDDGoodsResult getIndexPDDGoods(int page) {
|
| | | return PinDuoDuoApiUtil.getTopList(PinDuoDuoApiUtil.PID_FANLI, page, Constant.PAGE_SIZE, 1);
|
| | | @Cacheable(value = "pddSpecialCache", key = "'getTopGoodsList-' + #page + '-' + #sortType")
|
| | | public PDDGoodsResult getTopGoodsList(int page, Integer sortType) {
|
| | | return PinDuoDuoApiUtil.getTopList(PinDuoDuoApiUtil.PID_FANLI, page, Constant.PAGE_SIZE, sortType);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | |
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void addCommonGoods(Long uid, Set<Long> ids) throws UserGoodsStorageException {
|
| | |
|
| | | if (uid == null) {
|
| | |
| | | * @param subId
|
| | | * @return
|
| | | */
|
| | | public List<DynamicInfo> queryV2(int start, int count, Long cid, Long subId);
|
| | | public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public Map<String, Object> countBonusOrderMoneyAndNumber(Long uid, Integer type, Integer day, String startTime,
|
| | | String endTime);
|
| | | String endTime, Integer source);
|
| | |
|
| | | /**
|
| | | * 根据条件统计
|
| | |
| | | * 根据订单号和订单来源获取数量
|
| | | *
|
| | | * @param orderNo
|
| | | * @param type
|
| | | * @param hongBaotype
|
| | | * @param sourceType
|
| | | * @return
|
| | | */
|
| | | public long countByOrderNoAndHongBaoType(String orderNo, int type);
|
| | | public long countByOrderNoAndHongBaoType(String orderNo, int hongBaotype, int sourceType);
|
| | |
|
| | | /**
|
| | | * 获取详情
|
| | |
| | | public List<PDDGoodsDetail> specialSearch(Integer page, Long cid) throws PDDOrderException;
|
| | |
|
| | | /**
|
| | | * 首页底部商品
|
| | | * 爆款排行商品接口
|
| | | * @param page
|
| | | * @param sortType 1-实时热销榜;2-实时收益榜
|
| | | * @return
|
| | | */
|
| | | public PDDGoodsResult getIndexPDDGoods(int page);
|
| | | public PDDGoodsResult getTopGoodsList(int page, Integer sortType);
|
| | |
|
| | | }
|
| | |
| | | return d1.divide(d2,2, BigDecimal.ROUND_DOWN);
|
| | | }
|
| | |
|
| | | public static BigDecimal div3(BigDecimal d1, BigDecimal d2) {// 进行除法运算
|
| | | return d1.divide(d2, 3, BigDecimal.ROUND_DOWN);
|
| | | }
|
| | | |
| | | public static BigDecimal getWithNoZera(BigDecimal num) {// 进行除法运算
|
| | | while (num.toString().endsWith("0") && num.toString().indexOf(".") > -1) {
|
| | | num = new BigDecimal(num.toString().substring(0, num.toString().length()-1));
|
| | |
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
|
| | | public class PinDuoDuoUtil {
|
| | |
|
| | |
|
| | | /**
|
| | | * 商品佣金计算
|
| | | * |
| | | * @param goods
|
| | | * @param rate
|
| | | * @return
|
| | |
| | | BigDecimal hundred = new BigDecimal(100);
|
| | | rate = MoneyBigDecimalUtil.div(rate, hundred);
|
| | | BigDecimal price = MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinGroupPrice()), hundred).setScale(2);
|
| | | BigDecimal promotionRate = MoneyBigDecimalUtil.div(new BigDecimal(goods.getPromotionRate()), new BigDecimal(1000));
|
| | | BigDecimal promotionRate = MoneyBigDecimalUtil.div3(new BigDecimal(goods.getPromotionRate()),
|
| | | new BigDecimal(1000));
|
| | |
|
| | | Boolean hasCoupon = goods.getHasCoupon();
|
| | | if (hasCoupon == null || !hasCoupon) {
|
| | |
| | | }
|
| | | return BigDecimalUtil.getWithNoZera(money).setScale(2);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 计算商品券后价,没有券则返回原价
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public static List<String> getDetailImages(Long id) {
|
| | | List<String> imgList = new ArrayList<>();
|
| | | try {
|
| | | Document doc = Jsoup.connect("http://yangkeduo.com/goods.html?goods_id=" + id)
|
| | | .userAgent(
|
| | | Document doc = Jsoup.connect("http://yangkeduo.com/goods.html?goods_id=" + id).userAgent(
|
| | | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36")
|
| | | .get();
|
| | | Elements els = doc.getElementsByTag("script");
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | | |
| | | public static List<Long> getRecommendGoodsId(Long id) {
|
| | | List<Long> list = new ArrayList<Long>();
|
| | | JSONObject params = new JSONObject();
|
| | |
| | | PostMethod pm = new PostMethod("https://mobile.yangkeduo.com/proxy/api/api/tesla/query");
|
| | | pm.setRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko");
|
| | | pm.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
| | | pm.setRequestHeader("Referer", "https://union.jd.com/proManager/index?pageNo=1&keywords=%E9%9E%8B%E5%AD%90");
|
| | | pm.setRequestHeader("Referer", "https://jinbao.pinduoduo.com/promotion/brand-promotion");
|
| | | pm.setRequestBody(params.toString());
|
| | | try {
|
| | | client.executeMethod(pm);
|
| | |
| | |
|
| | | /**
|
| | | * 搜索候选词
|
| | | * |
| | | * @param key
|
| | | * @return
|
| | | */
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 多多进宝爬取数据-品牌好货
|
| | | * @param sf
|
| | | * @return
|
| | | */
|
| | | public static PDDGoodsResult getBrandGoods(PDDSearchFilter sf) {
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("pageNumber", sf.getPage());
|
| | | params.put("pageSize", sf.getPageSize());
|
| | |
|
| | | if (sf.getSortType() != null) {
|
| | | params.put("sortType", sf.getSortType());
|
| | | }
|
| | |
|
| | | if (sf.getHasCoupon() != null) {
|
| | | params.put("withCoupon", sf.getHasCoupon() ? 1 : 0);
|
| | | }
|
| | |
|
| | | if (sf.getKw() != null) {
|
| | | params.put("keyword", sf.getKw());
|
| | | } else {
|
| | | params.put("keyword", "");
|
| | | }
|
| | |
|
| | | if (sf.getOptId() != null) {
|
| | | params.put("optId", sf.getOptId());
|
| | | }
|
| | |
|
| | | if (sf.getCatId() != null) {
|
| | | params.put("categoryId", sf.getCatId());
|
| | | }
|
| | |
|
| | | System.out.println(params.toString());
|
| | | |
| | | HttpClient client = new HttpClient();
|
| | | PostMethod pm = new PostMethod("https://jinbao.pinduoduo.com/network/api/common/brand/goodsList");
|
| | | pm.setRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko");
|
| | | pm.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
| | | pm.setRequestHeader("Referer", "https://jinbao.pinduoduo.com/promotion/brand-promotion");
|
| | | pm.setRequestBody(params.toString());
|
| | |
|
| | | PDDGoodsResult goodsResult = null;
|
| | |
|
| | | try {
|
| | | client.executeMethod(pm);
|
| | | String result = pm.getResponseBodyAsString();
|
| | | System.out.println(result);
|
| | | |
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | Boolean code = json.optBoolean("success");
|
| | | if (code != null && code) {
|
| | | JSONObject root = json.optJSONObject("result");
|
| | | if (root == null) {
|
| | | return null;
|
| | | }
|
| | | JSONArray array = root.optJSONArray("goodsList");
|
| | | if (array == null) {
|
| | | return null;
|
| | | }
|
| | | |
| | | List<PDDGoodsDetail> goodsList = new ArrayList<PDDGoodsDetail>();
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | PDDGoodsDetail parseGoods = parseGoods(array.getJSONObject(i));
|
| | | if (parseGoods != null) {
|
| | | goodsList.add(parseGoods);
|
| | | }
|
| | | }
|
| | | int totalCount = root.optInt("total");
|
| | | |
| | | goodsResult = new PDDGoodsResult();
|
| | | goodsResult.setGoodsList(goodsList);
|
| | | goodsResult.setTotalCount(totalCount);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return goodsResult;
|
| | | }
|
| | | |
| | | |
| | | |
| | | private static PDDGoodsDetail parseGoods(JSONObject json) {
|
| | | PDDGoodsDetail goods = new PDDGoodsDetail();
|
| | | goods.setMallName(json.optString("mallName"));
|
| | | goods.setMerchantType(json.optInt("merchantType"));
|
| | | goods.setGoodsId(json.optLong("goodsId"));
|
| | | goods.setGoodsName(json.optString("goodsName"));
|
| | | goods.setGoodsDesc(json.optString("goodsDesc"));
|
| | | goods.setSalesTip(json.optString("salesTip"));
|
| | | |
| | | if (json.optString("goodsImageUrl") != null) {
|
| | | goods.setGoodsImageUrl("http:" + json.optString("goodsImageUrl"));
|
| | | }
|
| | | |
| | | if (json.optString("goodsThumbnailUrl") != null) {
|
| | | goods.setGoodsThumbnailUrl("http:" + json.optString("goodsThumbnailUrl"));
|
| | | }
|
| | | |
| | | if (json.optString("minGroupPrice") != null) {
|
| | | goods.setMinGroupPrice(json.getLong("minGroupPrice")/10);
|
| | | }
|
| | | |
| | | if (json.optString("categoryId") != null) {
|
| | | goods.setCategoryId(json.getLong("categoryId"));
|
| | | }
|
| | | |
| | | goods.setCategoryName(json.optString("categoryName"));
|
| | | goods.setHasCoupon(json.optBoolean("hasCoupon"));
|
| | | |
| | | if (json.optString("couponMinOrderAmount") != null) {
|
| | | goods.setCouponMinOrderAmount(json.getLong("couponMinOrderAmount")/10);
|
| | | }
|
| | | |
| | | if (json.optString("couponDiscount") != null) {
|
| | | goods.setCouponDiscount(json.getLong("couponDiscount")/10);
|
| | | }
|
| | | |
| | | if (json.optString("couponTotalQuantity") != null) {
|
| | | goods.setCouponTotalQuantity(json.getLong("couponTotalQuantity"));
|
| | | }
|
| | | |
| | | if (json.optString("couponRemainQuantity") != null) {
|
| | | goods.setCouponRemainQuantity(json.getLong("couponRemainQuantity"));
|
| | | }
|
| | | |
| | | if (json.optString("couponStartTime") != null) {
|
| | | goods.setCouponStartTime(json.getLong("couponStartTime"));
|
| | | }
|
| | | |
| | | if (json.optString("couponEndTime") != null) {
|
| | | goods.setCouponEndTime(json.getLong("couponEndTime"));
|
| | | }
|
| | | |
| | | if (json.optString("promotionRate") != null) {
|
| | | goods.setPromotionRate(json.getLong("promotionRate"));
|
| | | }
|
| | | |
| | | if (json.optString("optId") != null) {
|
| | | goods.setOptId(json.getLong("optId"));
|
| | | }
|
| | | |
| | | return goods;
|
| | | }
|
| | | |
| | | }
|