| | |
| | | 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.factory.goods.TaoBaoGoodsFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | @Component
|
| | | public class DynamicInfoJob {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | for (HDKWXCircleContentDTO hdkGoods: list) {
|
| | | for (HDKWXCircleContentDTO circleContentDTO: list) {
|
| | | try {
|
| | | String itemid = hdkGoods.getItemid();
|
| | | List<String> pics = hdkGoods.getItempic();
|
| | | String copy_content = hdkGoods.getCopy_content();
|
| | | String itemid = circleContentDTO.getItemid();
|
| | | HDKGoodsDetail hdkGoods = HaoDanKuApiUtil.getInstance().getItemDetail(itemid);
|
| | | if (hdkGoods == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | List<String> pics = circleContentDTO.getItempic();
|
| | | String copy_content = circleContentDTO.getCopy_content();
|
| | | String showtitle = StringEscapeUtils.unescapeHtml(copy_content);
|
| | | showtitle = showtitle.replace("<br>", "\r\n");
|
| | |
|
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | |
|
| | | HDKGoodsDetail itemDetail = HaoDanKuApiUtil.getInstance().getItemDetail(itemid);
|
| | | if (itemDetail == null) {
|
| | | continue;
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoGoodsFactory.create(hdkGoods), pics, user, showtitle);
|
| | | if (addProcess == 0) {
|
| | | addResult = true;
|
| | | break;
|
| | | }
|
| | | |
| | | |
| | | |
| | | goodsEvaluateService.addGoodsEvaluate2(itemid, pics, user, showtitle, null);
|
| | | addResult = true;
|
| | | break;
|
| | | } catch (GoodsEvaluateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | |
| | | try {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getFriendsFircleList("1", 100);
|
| | | while (result.getGoodsList() != null && result.getGoodsList().size() > 0) {
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList()) {
|
| | | for (DaTaoKeDetailV2 detailV2 : result.getGoodsList()) {
|
| | | try {
|
| | | Long goodsId = v2.getGoodsId();
|
| | | String circleText = v2.getCircleText();
|
| | | Long goodsId = detailV2.getGoodsId();
|
| | | |
| | | String circleText = detailV2.getCircleText();
|
| | | if (circleText == null) {
|
| | | continue;
|
| | | }
|
| | | String showtitle = URLDecoder.decode(circleText, "UTF-8");
|
| | | showtitle = showtitle.replace(" ", " ");
|
| | |
|
| | | DaTaoKeDetailV2 tkGoods = DaTaoKeApiUtil.getGoodsDetailByGoodsId(goodsId);
|
| | | if(tkGoods == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | ActivityUser user = null;
|
| | | if (v2.getCid() != null) {
|
| | | user = activityUserService.getRandomByDaTaoKeCid(v2.getCid());
|
| | | if (detailV2.getCid() != null) {
|
| | | user = activityUserService.getRandomByDaTaoKeCid(detailV2.getCid());
|
| | | }
|
| | | if (user == null) {
|
| | | List<ActivityRuleUser> ruleList = activityUserService
|
| | | .listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | }
|
| | | goodsEvaluateService.addGoodsEvaluate2(goodsId + "", null, user, showtitle, null);
|
| | | addResult = true;
|
| | | break;
|
| | | |
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoUtil.convert(tkGoods), null, user, showtitle);
|
| | | if (addProcess == 0) {
|
| | | addResult = true;
|
| | | break;
|
| | | }
|
| | | } catch (GoodsEvaluateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | result = DaTaoKeApiUtil.listAll(result.getPageId());
|
| | | result = DaTaoKeApiUtil.getFriendsFircleList(result.getPageId(), 100);
|
| | | } catch (Exception e) {
|
| | | result = DaTaoKeApiUtil.listAll(result.getPageId());
|
| | | result = DaTaoKeApiUtil.getFriendsFircleList(result.getPageId(), 100);
|
| | | }
|
| | | try {
|
| | | Thread.sleep(10);
|