| | |
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(cloudText) && !StringUtil.isNullOrEmpty(cloudPic)) {
|
| | | |
| | | cloudText = cloudText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetail.getZkPrice()) + "");
|
| | | if (!goodsDetail.isHasCoupon()) {
|
| | | cloudText = cloudText.replace("领券抢购", "抢购");
|
| | | cloudText = cloudText.replace("【券后价】[券后价]元", "");
|
| | | } else {
|
| | | cloudText = cloudText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetail.getCouponPrice()) + "");
|
| | | }
|
| | | cloudText = cloudText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | |
| | | extraVO.setCloudPic(cloudPic);
|
| | | extraVO.setCloudText(cloudText);
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | |
| | | @Repository |
| | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | /** |
| | | * 查询有效-倒序 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> queryValidSortASC(int start, int count, EvaluateEnum tyepEnum, boolean sortDesc) { |
| | | Date now = new Date(); |
| | | Query query = new Query(); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | |
| | | list.add(Criteria.where("type").is(tyepEnum.name())); |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("startTime").lte(now)); |
| | | list.add(Criteria.where("endTime").gte(now)); |
| | | |
| | | if (list.size() > 0) { |
| | | Criteria[] cas = new Criteria[list.size()]; |
| | | for (int i = 0; i < list.size(); i++) |
| | | cas[i] = list.get(i); |
| | | query.addCriteria(new Criteria().andOperator(cas)); |
| | | } |
| | | query.skip(start).limit(count); |
| | | |
| | | if (sortDesc) { |
| | | query.with(new Sort(Sort.Direction.DESC,"startTime")); |
| | | } else { |
| | | query.with(new Sort(Sort.Direction.ASC,"startTime")); |
| | | } |
| | | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询有效 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> queryExistLimitTime(int goodsType, String goodsId, Date limitTime) { |
| | | Query query = new Query(); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("imgList.goods.goodsId").is(goodsId)); |
| | | list.add(Criteria.where("imgList.goods.goodsType").is(goodsType)); |
| | | // 限制时间内 |
| | | list.add(Criteria.where("startTime").gte(limitTime)); |
| | | |
| | | if (list.size() > 0) { |
| | | Criteria[] cas = new Criteria[list.size()]; |
| | | for (int i = 0; i < list.size(); i++) |
| | | cas[i] = list.get(i); |
| | | query.addCriteria(new Criteria().andOperator(cas)); |
| | | } |
| | | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
| | | import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
|
| | | import com.yeshi.fanli.entity.goods.jd.NYouHuiGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService;
|
| | |
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.WXMPDynamicInfoService;
|
| | | import com.yeshi.fanli.service.inter.goods.jd.NYouHuiService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
|
| | |
|
| | | @Component
|
| | | public class DynamicInfoJob {
|
| | |
| | |
|
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | /**
|
| | | * 每10分钟 晚上00:00~06:00不下发任何一个商品
|
| | |
| | | */
|
| | | @Scheduled(cron = "0 0/3 * * * ?")
|
| | | public void activityNeedPublish() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | |
| | | */
|
| | | @Scheduled(cron = "0 0 6 * * ?")
|
| | | public void insertTimeInvite() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 动态发圈
|
| | | * |
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception
|
| | | * 好单库商品加入发圈
|
| | | */
|
| | | // @Scheduled(cron = "0 0 6,7,15,16,21,22,23 * * ? ")
|
| | | @XxlJob("dynamic-insertEvaluate")
|
| | | public ReturnT<String> insertEvaluate(String param) throws Exception {
|
| | | try {
|
| | | goodsEvaluateService.addGoodsEvaluateByDaTaoKe();
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | boolean addGoods = false;
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | | HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().listHotGoods(minId, 100, 1, null);
|
| | | if (dto != null) {
|
| | | minId = dto.getMinId();
|
| | | addGoods = addGoodsEvaluate(dto.getGoodsList());
|
| | | } else {
|
| | | minId = null;
|
| | | }
|
| | | |
| | | if(addGoods) {
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | // 大淘客备用
|
| | | if (!addGoods) {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_TIME, null);
|
| | | if (result != null) {
|
| | | List<DaTaoKeDetailV2> detailList = result.getGoodsList();
|
| | | if (detailList != null && detailList.size() > 0) {
|
| | | for (DaTaoKeDetailV2 daTaoKeV2: detailList) {
|
| | | if(goodsEvaluateService.addByDaTaoKeGoods(daTaoKeV2))
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | private boolean addGoodsEvaluate(List<HDKGoodsDetail> hdkList) {
|
| | | if (hdkList == null || hdkList.size() == 0) {
|
| | | return false;
|
| | | }
|
| | | for (HDKGoodsDetail hdkGoods: hdkList) {
|
| | | try {
|
| | | Long itemid = hdkGoods.getItemid();
|
| | | String itemdesc = hdkGoods.getItemdesc();
|
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | goodsEvaluateService.addGoodsEvaluate(itemid + "", null, user, itemdesc, null, new Date());
|
| | | return true;
|
| | | } catch (GoodsEvaluateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | |
| | | Calendar nowCalendar = Calendar.getInstance();
|
| | | nowCalendar.setTimeInMillis(java.lang.System.currentTimeMillis());
|
| | | int hour = nowCalendar.get(Calendar.HOUR_OF_DAY);
|
| | | if (hour < 9 && hour > 21)
|
| | | if (hour < 9 || hour > 21)
|
| | | return;
|
| | |
|
| | | // 一个小时之内最新发圈
|
| | | long rand = 1000 * 60 * 60;
|
| | | long time = java.lang.System.currentTimeMillis() - rand;
|
| | | Date lastTime = new Date(time);
|
| | |
|
| | | List<GoodsEvaluate> list = goodsEvaluateService.listByStartTime(lastTime);
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | |
|
| | | userCloudService.fixedTimeSend(list.get(0).getId());
|
| | | // 活动列表
|
| | | List<GoodsEvaluate> listActivity = goodsEvaluateService.queryValidSortASC(1, 100, EvaluateEnum.activity, false);
|
| | | // 单品商品
|
| | | List<GoodsEvaluate> listGoods = goodsEvaluateService.queryValidSortASC(1, 5, EvaluateEnum.single, true);
|
| | | // 执行发单
|
| | | userCloudService.fixedTimeSend(listActivity, listGoods);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | |
| | | return goodsEvaluateDao.listByStartTime(date); |
| | | } |
| | | |
| | | @Override |
| | | public List<GoodsEvaluate> queryValidSortASC(int start, int count, EvaluateEnum tyepEnum, boolean sortDesc) { |
| | | return goodsEvaluateDao.queryValidSortASC(start, count, tyepEnum, sortDesc); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveComment(String pid, CommentInfo commentInfo) throws GoodsEvaluateException { |
| | |
| | | throw new GoodsEvaluateException(1, "相关参数不能为空"); |
| | | } |
| | | |
| | | List<GoodsEvaluate> evaluateList = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, goodsId); |
| | | Date limitDate = DateUtil.reduceDay(new Date(), 7); |
| | | |
| | | List<GoodsEvaluate> evaluateList = goodsEvaluateDao.queryExistLimitTime(Constant.SOURCE_TYPE_TAOBAO, goodsId, limitDate); |
| | | if (evaluateList != null && evaluateList.size() > 0) |
| | | return; |
| | | throw new GoodsEvaluateException(1, "该商品已存在"); |
| | | |
| | | TaoBaoGoodsBrief goodsBrief = null; |
| | | try { |
| | |
| | | |
| | | // 白底图 |
| | | List<String> imgs = new ArrayList<>(); |
| | | if (!StringUtil.isNullOrEmpty(goodsBrief.getPictUrlWhite())) { |
| | | imgs.add(goodsBrief.getPictUrlWhite()); |
| | | } |
| | | imgs.addAll(goodsBrief.getImgList()); |
| | | |
| | | // 商品VO |
| | |
| | | |
| | | // 商品图片信息 |
| | | int i = 0; |
| | | if (imgList == null || imgList.size() == 0) |
| | | if (imgList == null) |
| | | imgList = new ArrayList<ImgInfo>(); |
| | | |
| | | if (imgList.size() == 0) |
| | | for (String img : imgs) { |
| | | ImgInfo imgInfo = new ImgInfo(); |
| | | imgInfo.setH(1); |
| | |
| | | } |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | boolean cerateGoods = cerateGoods(list.get(i)); |
| | | boolean cerateGoods = addByDaTaoKeGoods(list.get(i)); |
| | | if (cerateGoods) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private boolean cerateGoods(DaTaoKeDetailV2 daTaoKe) { |
| | | |
| | | @Override |
| | | public boolean addByDaTaoKeGoods(DaTaoKeDetailV2 daTaoKe) { |
| | | try { |
| | | Date limitDate = DateUtil.reduceDay(new Date(), 7); |
| | | |
| | | List<GoodsEvaluate> evaluateList = goodsEvaluateDao.queryExistLimitTime(Constant.SOURCE_TYPE_TAOBAO, |
| | | daTaoKe.getGoodsId()+"", limitDate); |
| | | if (evaluateList != null && evaluateList.size() > 0) |
| | | return false; |
| | | |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(daTaoKe.getGoodsId()); |
| | | if (goodsBrief == null) { |
| | | return false; |
| | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | // 发布用户 |
| | | ActivityUser user = activityUserService.getRandomByDaTaoKeCid(daTaoKe.getCid()); |
| | | |
| | | ActivityUser user = null; |
| | | if(daTaoKe.getCid() != null) { |
| | | user = activityUserService.getRandomByDaTaoKeCid(daTaoKe.getCid()); |
| | | } else { |
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20); |
| | | user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser(); |
| | | } |
| | | |
| | | |
| | | String desc = daTaoKe.getDesc().replace(",", ","); |
| | | String[] split = desc.split(","); |
| | |
| | | goodsEvaluate.setState(1); |
| | | goodsEvaluate.setDynamicType(1); |
| | | goodsEvaluate.setType(EvaluateEnum.single); |
| | | |
| | | goodsEvaluate.setShareNum((int) (Math.random() * 5000) + 1000); |
| | | goodsEvaluate.setShareNumReal(0); |
| | | goodsEvaluate.setWeight(0.0); |
| | |
| | | List<String> goodsimgs = goodsBrief.getImgList(); |
| | | |
| | | List<String> imgs = new ArrayList<>(); |
| | | if (!StringUtil.isNullOrEmpty(goodsBrief.getPictUrlWhite())) { |
| | | imgs.add(goodsBrief.getPictUrlWhite()); |
| | | } |
| | | imgs.addAll(goodsimgs); |
| | | |
| | | int i = 0; |
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void fixedTimeSend(String id) {
|
| | | if (StringUtil.isNullOrEmpty(id)) |
| | | public void fixedTimeSend(List<GoodsEvaluate> listActivity, List<GoodsEvaluate> listGoods) {
|
| | | if (listGoods == null && listActivity == null) |
| | | return;
|
| | | |
| | | // 一个小时之前
|
| | | long time = java.lang.System.currentTimeMillis() - 1000 * 60 * 60 ;
|
| | | Date lastTime = new Date(time);
|
| | | |
| | | Date lastTime = new Date(java.lang.System.currentTimeMillis() - 1000 * 60 * 60);
|
| | | for (int i = 0; i < 1000; i ++) {
|
| | | // 查询哪些用户开通
|
| | | List<Long> list = userCloudMapper.listValidUid(i*1000, 1000);
|
| | | if (list == null || list.size() == 0) {
|
| | | List<Long> listUser = userCloudMapper.listValidUid(i*1000, 1000);
|
| | | if (listUser == null || listUser.size() == 0) {
|
| | | break;
|
| | | }
|
| | |
|
| | | for (Long uid: list) {
|
| | | try {
|
| | | // 判断是否该 内容已发
|
| | | UserCloudSendRecord record = userCloudSendRecordService.getByUidAndSendId(uid, id);
|
| | | if (record != null) |
| | | // 遍历用户
|
| | | for (Long uid: listUser) {
|
| | | try {// 判断是否开通官方采集
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage == null || cloudManage.getOfficial() == null || !cloudManage.getOfficial()) {
|
| | | continue;
|
| | | |
| | | }
|
| | | // 是否在一个小时内已发送过
|
| | | UserCloudSendRecord last = userCloudSendRecordService.getLastByUid(uid, lastTime);
|
| | | if (last != null)
|
| | | continue;
|
| | |
|
| | | boolean official = false;
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | if (cloudManage.getOfficial() != null)
|
| | | official = cloudManage.getOfficial();
|
| | | String evaluateId = null;
|
| | | // 活动
|
| | | if (listActivity != null && listActivity.size() > 0) {
|
| | | for (GoodsEvaluate evaluate: listActivity) {
|
| | | UserCloudSendRecord record = userCloudSendRecordService.getByUidAndSendId(uid, evaluate.getId());
|
| | | if (record != null) |
| | | continue;
|
| | | |
| | | evaluateId = evaluate.getId();
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | if (!Constant.IS_TEST && official) {
|
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, id, UserCloudMQMsg.TYPE_EVALUATE);
|
| | | // 单品
|
| | | if (StringUtil.isNullOrEmpty(evaluateId) && listGoods != null && listGoods.size() > 0) {
|
| | | for (GoodsEvaluate evaluate: listGoods) {
|
| | | UserCloudSendRecord record = userCloudSendRecordService.getByUidAndSendId(uid, evaluate.getId());
|
| | | if (record != null) |
| | | continue;
|
| | | |
| | | evaluateId = evaluate.getId();
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | if(!StringUtil.isNullOrEmpty(evaluateId)) {
|
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, evaluateId, UserCloudMQMsg.TYPE_EVALUATE);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg);
|
| | | producer.send(message);
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2; |
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; |
| | | |
| | | public interface GoodsEvaluateService { |
| | |
| | | */ |
| | | public GoodsEvaluate queryExistSingle(String goodsId, int goodsType); |
| | | |
| | | /** |
| | | * 查询倒序 |
| | | * @param start |
| | | * @param count |
| | | * @param dynamicType |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> queryValidSortASC(int start, int count, EvaluateEnum tyepEnum, boolean sortDesc); |
| | | |
| | | |
| | | /** |
| | | * 添加大淘客商品 |
| | | * @param daTaoKe |
| | | * @return |
| | | */ |
| | | public boolean addByDaTaoKeGoods(DaTaoKeDetailV2 daTaoKe); |
| | | |
| | | } |
| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | |
|
| | | public interface UserCloudService {
|
| | |
| | | * 定时发送云发单
|
| | | * @param id
|
| | | */
|
| | | public void fixedTimeSend(String id);
|
| | | public void fixedTimeSend(List<GoodsEvaluate> listActivity, List<GoodsEvaluate> listGoods);
|
| | |
|
| | | public List<UserCloud> query(int page, int count, String key, Integer state);
|
| | |
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 商品爆单列表
|
| | | * @Title: listGoods
|
| | | * @Description: |
| | | * @param minId
|
| | | * @param catIds
|
| | | * @param pageSize
|
| | | * @return |
| | | * HDKGoodsListResultDTO 返回类型
|
| | | * @throws
|
| | | */
|
| | | public HDKGoodsListResultDTO listHotGoods(Integer minId, int pageSize, int saleType, List<Integer> catIds) {
|
| | | if (minId == null)
|
| | | minId = 1;
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("sale_type", saleType +""));
|
| | | params.add(new ParamsKeyValue("back", pageSize + ""));
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | params.add(new ParamsKeyValue("item_type", 1 + "")); // 是否只获取营销返利商品,1是,0否
|
| | | if (catIds != null && catIds.size() > 0) {
|
| | | params.add(new ParamsKeyValue("cid", StringUtil.concat(catIds, ",")));
|
| | | }
|
| | |
|
| | | String result = baseGetRequest("sales_list", params);
|
| | |
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | if (resultData.optInt("code") == 1) {
|
| | | Integer newMinId = resultData.optInt("min_id");
|
| | | Type type = new TypeToken<ArrayList<HDKGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<HDKGoodsDetail> list = new Gson().fromJson(resultData.optJSONArray("data").toString(), type);
|
| | | return new HDKGoodsListResultDTO(list, newMinId);
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 增量更新的商品
|
| | | * @Title: listAddGoods
|