| | |
| | |
|
| | | import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
|
| | | 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.activity.RecommendActivityTaoBaoGoods;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | |
| | | import com.yeshi.fanli.service.inter.dynamic.InviteMaterialService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.QrCodeService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Service
|
| | | public class DynamicInfoServiceImpl implements DynamicInfoService {
|
| | | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DynamicInfoDao dynamicInfoDao;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoShopService taoBaoShopService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private InviteMaterialService inviteMaterialService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private QrCodeService qrCodeService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Override
|
| | | public void insert(DynamicInfo record) {
|
| | | dynamicInfoDao.insert(record);
|
| | | dynamicInfoDao.insert(record);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public DynamicInfo getById(String id) {
|
| | | return dynamicInfoDao.getById(id);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insertTimeInvite() {
|
| | | InviteMaterial inviteMaterial = inviteMaterialService.getInviteMaterial();
|
| | | if (inviteMaterial == null) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Date date = new Date();
|
| | | String materialId = inviteMaterial.getId();
|
| | | String content = inviteMaterial.getText();
|
| | | |
| | | ActivityUser user=activityUserService.selectByPrimaryKey(2L);
|
| | | |
| | |
|
| | | ActivityUser user = activityUserService.selectByPrimaryKey(2L);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(content)) {
|
| | | DynamicInfo dynamicTxt= new DynamicInfo();
|
| | | DynamicInfo dynamicTxt = new DynamicInfo();
|
| | | dynamicTxt.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicTxt.setInviteMaterialId(materialId);
|
| | | dynamicTxt.setClassId(4L);
|
| | |
| | | dynamicTxt.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | dynamicTxt.setCreateTime(date);
|
| | | dynamicTxt.setUpdateTime(date);
|
| | | |
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
|
| | | |
| | |
|
| | | StringBuffer buffer = new StringBuffer();
|
| | | buffer.append("-------------------\n");
|
| | | buffer.append("今天 : " + format.format(date));
|
| | |
| | | buffer.append("早安~\n");
|
| | | buffer.append("我的邀请码:【邀请码】\n");
|
| | | buffer.append("购物省钱返利券App:【邀请链接】");
|
| | | |
| | | |
| | |
|
| | | content = content.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
|
| | | .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
|
| | |
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | | row1.setContent(content + "\n" + buffer.toString());
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | listtitle.add(row1);
|
| | | dynamicTxt.setTitle(listtitle);
|
| | | |
| | |
|
| | | // 空数据
|
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | dynamicTxt.setImgs(listImg);
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicTxt);
|
| | | }
|
| | | |
| | |
|
| | | String picture = inviteMaterial.getPicture();
|
| | | if (!StringUtil.isNullOrEmpty(picture)) {
|
| | | DynamicInfo dynamicPic = new DynamicInfo();
|
| | |
| | | dynamicPic.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | dynamicPic.setCreateTime(date);
|
| | | dynamicPic.setUpdateTime(date);
|
| | | |
| | |
|
| | | try {
|
| | | // 画图
|
| | | String url = qrCodeService.drawInviteToGreet(picture, null, null, null, content, new Date());
|
| | | |
| | |
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | dynamicPic.setTitle(listtitle);
|
| | | |
| | |
|
| | | GoodsPicture p2 = new GoodsPicture();
|
| | | p2.setW(100);
|
| | | p2.setH(100);
|
| | |
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | listImg.add(p2);
|
| | | dynamicPic.setImgs(listImg);
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicPic);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | inviteMaterialService.updateState(1, materialId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void insertShopInfo() {
|
| | | List<String> brandIdList = DaTaoKeApiUtil.getBrandIdList();
|
| | |
| | | LogHelper.test("大淘客品牌id获取失败(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | Long classId = 3L;
|
| | | Long subclassId = 0L;
|
| | | List<DynamicInfo> listInfo = dynamicInfoDao.query(classId, subclassId);
|
| | |
| | | if (listInfo != null && listInfo.size() > 0) {
|
| | | for (int i = 0; i < brandIdList.size(); i++) {
|
| | | String brandId = brandIdList.get(i);
|
| | | |
| | |
|
| | | for (int j = 0; j < listInfo.size(); j++) {
|
| | | String id = listInfo.get(j).getId();
|
| | | if (brandId.equals(id)) {
|
| | | brandIdList.remove(brandId);
|
| | | i--;
|
| | | |
| | |
|
| | | listInfo.remove(listInfo.get(j));
|
| | | j--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (brandIdList == null || brandIdList.size() == 0) {
|
| | | LogHelper.test("大淘客品牌已全部爬取(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int index = (int) (Math.random() * brandIdList.size());
|
| | | String brandId = brandIdList.get(index);
|
| | | |
| | |
|
| | | TaoBaoShopDTO dynamicShopInfo = DaTaoKeApiUtil.getDynamicShopInfo(brandId);
|
| | | if (dynamicShopInfo == null) {
|
| | | LogHelper.test("大淘客品牌信息爬取失败(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | List<TaoBaoGoodsBrief> listGoods = dynamicShopInfo.getListGoods();
|
| | | if (listGoods == null || listGoods.size() == 0) {
|
| | | LogHelper.test("大淘客品牌商品信息爬取失败(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Long sellerId = dynamicShopInfo.getSellerId();
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = listGoods.get(0);
|
| | | TaoBaoShop taoBaoShop = taoBaoShopService.getTaoBaoShop(taoBaoGoodsBrief.getAuctionId(), sellerId);
|
| | |
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | DynamicInfo dynamicVO = new DynamicInfo();
|
| | | dynamicVO.setId(brandId);
|
| | | dynamicVO.setClassId(classId);
|
| | | dynamicVO.setSubclassId(subclassId);
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_TWO);
|
| | | dynamicVO.setShop(taoBaoShop);
|
| | | dynamicVO.setUser(activityUserService.listRand(1).get(0));
|
| | | dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8)); |
| | | List<ActivityRuleUser> userList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAODIAN, 1, 50);
|
| | | dynamicVO.setUser(userList.get((int) (userList.size() * Math.random())).getActivityUser());
|
| | | dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
|
| | | dynamicVO.setUpdateTime(new Date());
|
| | | |
| | |
|
| | | // 介绍内容
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | |
| | | List<ClientTextStyleVO> listTitle = new ArrayList<ClientTextStyleVO>();
|
| | | listTitle.add(row1);
|
| | | dynamicVO.setTitle(listTitle);
|
| | | |
| | |
|
| | | // 商品信息
|
| | | List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
|
| | | for (TaoBaoGoodsBrief goodsBrief : listGoods) {
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null);
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
|
| | | proportion.toString(), null);
|
| | | taoBaoGoodsBriefExtra.setCouponInfo(null);
|
| | | taoBaoGoodsBriefExtra.setUpdatetime(new Date());
|
| | | |
| | |
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | |
| | |
|
| | | String goodsId = goodsBrief.getAuctionId().toString();
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("id", goodsId);
|
| | | item.put("from", "dynamics");
|
| | | |
| | |
|
| | | GoodsPicture goodsPicture = new GoodsPicture();
|
| | | goodsPicture.setH(100);
|
| | | goodsPicture.setW(100);
|
| | |
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | goodsPicture.setParams(item.toString());
|
| | | goodsPicture.setGoods(taoBaoGoodsBriefExtra);
|
| | | |
| | |
|
| | | listPicture.add(goodsPicture);
|
| | | }
|
| | | dynamicVO.setImgs(listPicture);
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicVO);
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insertTimeRecommend() {
|
| | | try {
|
| | |
| | | List<GoodsClass> list = DaTaoKeUtil.goodsClasses;
|
| | | int index = (int) (Math.random() * list.size());
|
| | | Long subclassId = list.get(index).getId();
|
| | | int cid = Integer.parseInt(subclassId +"");
|
| | | int cid = Integer.parseInt(subclassId + "");
|
| | | int count = 0;
|
| | | double random = Math.random();
|
| | | if (random > 0.4) {
|
| | |
| | | // 分享奖金
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | |
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | |
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief);
|
| | | shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
|
| | | // 商品图片
|
| | |
| | | taoBaoGoodsBriefExtra.setCouponInfo(null);
|
| | | GoodsPicture goodsPicture = getGoodsPicture(daTaoKe);
|
| | | goodsPicture.setGoods(taoBaoGoodsBriefExtra);
|
| | | |
| | |
|
| | | listPicture.add(goodsPicture);
|
| | | }
|
| | |
|
| | |
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | |
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | taoBaoGoodsBriefExtra.setTkRate(taoBaoGoodsBrief.getTkRate());
|
| | | |
| | |
|
| | | // 分享奖金
|
| | | BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief);
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | |
| | | if (pic.equals(img)) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | listimgs.add(img);
|
| | | GoodsPicture picture = new GoodsPicture();
|
| | | picture.setH(100);
|
| | |
| | | listPicture.add(picture);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | taoBaoGoodsBriefExtra.setImgList(imgList);
|
| | |
|
| | | // 组织动态信息
|
| | |
| | | dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_ONE);
|
| | | dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | |
| | |
|
| | | String desc = DaTaoKeUtil.getDesc(daTaoKe);
|
| | | if (!StringUtil.isNullOrEmpty(desc)) {
|
| | | int index = desc.lastIndexOf("\n");
|
| | | String newDesc = desc.substring(index + 1);
|
| | | if(StringUtil.isNullOrEmpty(newDesc)) {
|
| | | if (StringUtil.isNullOrEmpty(newDesc)) {
|
| | | desc = desc.substring(0, index);
|
| | | }
|
| | | }
|
| | |
| | | goodsPicture.setW(100);
|
| | | goodsPicture.setUrl(TbImgUtil.getTBSize320Img(daTaoKe.getPic()));
|
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | |
| | |
|
| | | String goodsId = daTaoKe.getGoodsId().toString();
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("id", goodsId);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateShareCount(DynamicInfo record) {
|
| | | dynamicInfoDao.updateShareCount(record);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void insertInviteMaterial(String title, String picUrl, Long activityId, ActivityUser activityUser) {
|
| | | |
| | | DynamicInfo existInfo = null;
|
| | | if (activityId != null) {
|
| | | existInfo = dynamicInfoDao.getByActivityId(activityId);
|
| | | if (existInfo != null) {
|
| | | dynamicInfoDao.deleteById(existInfo.getId());
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | title = title.replace("<p>", "");
|
| | | title = title.replace("</p>", "");
|
| | | }
|
| | | public void insertInviteActivity(RecommendActivity activity) throws Exception {
|
| | |
|
| | | String title = activity.getTitle();
|
| | |
|
| | | String picUrl = null;
|
| | | List<String> imageList = activity.getImageList();
|
| | | if (imageList != null && imageList.size() > 0) {
|
| | | picUrl = imageList.get(0);
|
| | | }
|
| | | |
| | | DynamicInfo dynamicVO = new DynamicInfo();
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(picUrl)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | // 判断是否已存在
|
| | | String dynamicInfoId = null;
|
| | |
|
| | | Long activityId = activity.getId();
|
| | | DynamicInfo dynamicVO = dynamicInfoDao.getByActivityId(activityId);
|
| | | if (dynamicVO == null) {
|
| | | dynamicVO = new DynamicInfo();
|
| | | dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
|
| | | } else {
|
| | | dynamicInfoId = dynamicVO.getId();
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | title = title.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll("<br>", "\n");
|
| | |
|
| | | int index = title.lastIndexOf("\n");
|
| | | String newDesc = title.substring(index + 1);
|
| | | if (StringUtil.isNullOrEmpty(newDesc)) {
|
| | | title = title.substring(0, index);
|
| | | }
|
| | |
|
| | | title = title.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
|
| | | .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
|
| | | }
|
| | |
|
| | | dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicVO.setActivityId(activityId);
|
| | | dynamicVO.setClassId(4L);
|
| | | dynamicVO.setSubclassId(0L);
|
| | | dynamicVO.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
|
| | | dynamicVO.setUpdateTime(new Date());
|
| | | |
| | | if (existInfo != null) {
|
| | | dynamicVO.setCreateTime(existInfo.getCreateTime());
|
| | | dynamicVO.setShareCount(existInfo.getShareCount());
|
| | | } else {
|
| | | dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
|
| | |
|
| | | Integer shareCount = activity.getShareCount();
|
| | | if (shareCount == null || shareCount <= 0) {
|
| | | dynamicVO.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | } else {
|
| | | dynamicVO.setShareCount(shareCount);
|
| | | }
|
| | | |
| | |
|
| | | // 发布用户
|
| | | ActivityUser activityUser = activity.getActivityUser();
|
| | | if (activityUser == null) {
|
| | | dynamicVO.setUser(activityUserService.listRand(1).get(0));
|
| | | dynamicVO.setUser(activityUserService.selectByPrimaryKey(2L));
|
| | | } else {
|
| | | dynamicVO.setUser(activityUser);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 介绍内容
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | |
| | | |
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | if(StringUtil.isNullOrEmpty(picUrl)) {
|
| | | dynamicVO.setImgs(listImg);
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
|
| | | |
| | | // 介绍内容
|
| | | SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
|
| | | StringBuffer buffer = new StringBuffer();
|
| | | buffer.append("-------------------\n");
|
| | | buffer.append("今天 : " + format.format(new Date()));
|
| | | buffer.append(" ");
|
| | | buffer.append(DateLunarUtil.getWeekd(new Date()) + "\n");
|
| | | buffer.append("各位亲爱的你");
|
| | | buffer.append(" ");
|
| | | buffer.append("早安~\n");
|
| | | buffer.append("我的邀请码:【邀请码】\n");
|
| | | buffer.append("购物省钱返利券App:【邀请链接】");
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | | row1.setContent(title + "\n" + buffer.toString());
|
| | | |
| | | row1.setContent(title);
|
| | | listtitle.add(row1);
|
| | | dynamicVO.setTitle(listtitle);
|
| | | dynamicInfoDao.insert(dynamicVO);
|
| | | }
|
| | |
|
| | | // 图片
|
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | if (StringUtil.isNullOrEmpty(picUrl)) {
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
|
| | | } else {
|
| | | try {
|
| | | dynamicVO.setTitle(listtitle);
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ONE);
|
| | | |
| | | // 图片
|
| | | String imgLink = qrCodeService.drawInviteQrCodeNew(picUrl , null, null, null);
|
| | | GoodsPicture p2 = new GoodsPicture();
|
| | | p2.setW(100);
|
| | | p2.setH(100);
|
| | | p2.setUrl(imgLink);
|
| | | p2.setUrlOriginal(picUrl);
|
| | | listImg.add(p2);
|
| | | dynamicVO.setImgs(listImg);
|
| | | |
| | | |
| | | dynamicInfoDao.insert(dynamicVO);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ONE);
|
| | | RecommendActivityInviteInfo inviteInfo = activity.getInviteInfo();
|
| | |
|
| | | Integer pX = null;
|
| | | Integer pY = null;
|
| | | Integer size = null;
|
| | | if (inviteInfo != null) {
|
| | | pX = inviteInfo.getPx();
|
| | | pY = inviteInfo.getPy();
|
| | | size = inviteInfo.getSize();
|
| | | }
|
| | |
|
| | | // 图片
|
| | | String imgLink = qrCodeService.drawInviteQrCodeNew(picUrl, null, null, pX, pY, size, null);
|
| | | GoodsPicture p2 = new GoodsPicture();
|
| | | p2.setW(100);
|
| | | p2.setH(100);
|
| | | p2.setUrl(imgLink);
|
| | | p2.setUrlOriginal(picUrl);
|
| | | p2.setPx(pX);
|
| | | p2.setPy(pY);
|
| | | p2.setSize(size);
|
| | |
|
| | | listImg.add(p2);
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public void removeByDate(Date createTime) {
|
| | | dynamicInfoDao.removeByDate(createTime);
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 更新商品信息
|
| | | */
|
| | | public void updateGoodInfo(List<DynamicInfo> list) {
|
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | |
|
| | | dynamicVO.setImgs(listImg);
|
| | | dynamicVO.setTitle(listtitle);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
|
| | | dynamicInfoDao.deleteById(dynamicInfoId);
|
| | | }
|
| | | |
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (DynamicInfo dynamicInfo: list) {
|
| | | // 邀请数据不做更新
|
| | | long classId = dynamicInfo.getClassId();
|
| | | if (classId == 4) {
|
| | | break;
|
| | | }
|
| | | |
| | | // 更新商品信息
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null || imgs.size() == 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | | // 是否一个小时之内已更新
|
| | | Date updateTime = dynamicInfo.getUpdateTime();
|
| | | if (updateTime != null) {
|
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数 |
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数 |
| | | long diff = System.currentTimeMillis() - updateTime.getTime(); |
| | | long day = diff / nd;// 计算差多少天 |
| | | long hour = diff % nd / nh + day * 24;// 计算差多少小时 |
| | | if (hour < 1) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | |
| | | // 更新
|
| | | BigDecimal shareMoney = new BigDecimal(0);
|
| | | // 商品列表
|
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | |
| | | for (GoodsPicture goodsPicture: imgs) {
|
| | | TaoBaoGoodsBriefExtra oldExtra = goodsPicture.getGoods();
|
| | | if (oldExtra == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | Integer state = oldExtra.getState();
|
| | | if (state != null && state == 1) {
|
| | | continue;
|
| | | }
|
| | | |
| | | try {
|
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(oldExtra.getAuctionId());
|
| | | listGoods.add(goodsBrief);
|
| | | |
| | | TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null);
|
| | | |
| | | if (!newExtra.isCoupon()) {
|
| | | newExtra.setState(1);
|
| | | }
|
| | | newExtra.setUpdatetime(new Date());
|
| | | newExtra.setTkRate(goodsBrief.getTkRate());
|
| | | goodsPicture.setGoods(newExtra);
|
| | | |
| | | |
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | | if (classId == 1) {
|
| | | BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(goodsBrief);
|
| | | shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
|
| | | }
|
| | | |
| | | } catch (TaobaoGoodsDownException e) {
|
| | | oldExtra.setState(1);
|
| | | oldExtra.setCoupon(false);
|
| | | oldExtra.setUpdatetime(new Date());
|
| | | goodsPicture.setGoods(oldExtra);
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | | if (classId == 1) {
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | | shareMoneyDesc.setColor("#FFFFFF");
|
| | | shareMoneyDesc.setBottomColor("#E8AE48");
|
| | | shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
|
| | | dynamicInfo.setDesc(shareMoneyDesc);
|
| | | }
|
| | | |
| | | |
| | | // 更新商品
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = dynamicInfo.getListGoodsBrief();
|
| | | if (listGoods != null && listGoods.size() > 0 && listGoodsBrief != null && listGoodsBrief.size() > 0) {
|
| | | |
| | | for (int i =0; i < listGoodsBrief.size(); i ++) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = listGoodsBrief.get(i);
|
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId();
|
| | | |
| | | boolean isadd = true;
|
| | | for (TaoBaoGoodsBrief goods: listGoods) {
|
| | | if(goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) {
|
| | | isadd = false;
|
| | | break;
|
| | | } |
| | | }
|
| | | |
| | | // 商品已下架 则添加原来商品信息
|
| | | if (isadd) {
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | }
|
| | | }
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | }
|
| | | |
| | | dynamicInfo.setImgs(imgs);
|
| | | dynamicInfo.setUpdateTime(new Date());
|
| | | dynamicInfoDao.updateGoodInfo(dynamicInfo);
|
| | | }
|
| | |
|
| | | dynamicInfoDao.insert(dynamicVO);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void deleteActivity(Long activityId) {
|
| | | DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activityId);
|
| | | if (dynamicInfo != null) {
|
| | | // 删除之前的
|
| | | dynamicInfoDao.deleteById(dynamicInfo.getId());
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void saveActivityRecommend(RecommendActivity activity) {
|
| | | public void insertActivityRecommend(RecommendActivity activity) {
|
| | | if (activity == null || activity.getGoodsList() == null) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | DynamicInfo existInfo = dynamicInfoDao.getByActivityId(activity.getId());
|
| | | if (existInfo != null) {
|
| | | dynamicInfoDao.deleteById(existInfo.getId());
|
| | | String dynamicInfoId = null;
|
| | | DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activity.getId());
|
| | | if (dynamicInfo == null) {
|
| | | dynamicInfo = new DynamicInfo();
|
| | | dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicInfo.setCreateTime(new Date());
|
| | | } else {
|
| | | dynamicInfoId = dynamicInfo.getId();
|
| | | }
|
| | | |
| | | DynamicInfo dynamicInfo = new DynamicInfo();
|
| | | dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | |
|
| | | dynamicInfo.setClassId(2L);
|
| | | dynamicInfo.setSubclassId(0L);
|
| | | dynamicInfo.setUser(activity.getActivityUser());
|
| | | dynamicInfo.setActivityId(activity.getId());
|
| | | |
| | | dynamicInfo.setUpdateTime(new Date());
|
| | |
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | String title = activity.getTitle();
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | title = title.replace("<p>", "");
|
| | | title = title.replace("</p>", "");
|
| | | dynamicInfo.setTitle(convertIntroduce(title));
|
| | | title = title.replaceAll("<p>", "");
|
| | | title = title.replaceAll("</p>", "");
|
| | | title = title.replaceAll("<br>", "\n");
|
| | |
|
| | | int index = title.lastIndexOf("\n");
|
| | | String newDesc = title.substring(index + 1);
|
| | | if (StringUtil.isNullOrEmpty(newDesc)) {
|
| | | title = title.substring(0, index);
|
| | | }
|
| | |
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | | row1.setContent(title);
|
| | | listtitle.add(row1);
|
| | | }
|
| | | |
| | | if (existInfo != null) {
|
| | | dynamicInfo.setCreateTime(existInfo.getCreateTime());
|
| | | dynamicInfo.setShareCount(existInfo.getShareCount());
|
| | | } else {
|
| | | dynamicInfo.setCreateTime(new Date());
|
| | | dynamicInfo.setUpdateTime(new Date());
|
| | | dynamicInfo.setTitle(listtitle);
|
| | |
|
| | | Integer shareCount = activity.getShareCount();
|
| | | if (shareCount == null || shareCount <= 0) {
|
| | | dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | } else {
|
| | | dynamicInfo.setShareCount(shareCount);
|
| | | }
|
| | |
|
| | | // 发布用户
|
| | | ActivityUser activityUser = activity.getActivityUser();
|
| | | if (activityUser == null) {
|
| | | dynamicInfo.setUser(activityUserService.selectByPrimaryKey(2L));
|
| | | } else {
|
| | | dynamicInfo.setUser(activityUser);
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
| | |
|
| | | if (activity.getGoodsList() != null) {
|
| | | for (RecommendActivityTaoBaoGoods activityGoods : activity.getGoodsList()) {
|
| | | |
| | |
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = null;
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null;
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null;
|
| | | String auctionId = activityGoods.getAuctionId();
|
| | | try {
|
| | | taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
|
| | | |
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | |
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief);
|
| | | shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | taoBaoGoodsBriefExtra.setCoupon(false);
|
| | | taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | taoBaoGoodsBriefExtra.setCoupon(false);
|
| | | }
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | |
| | |
|
| | | // 商品图片
|
| | | taoBaoGoodsBriefExtra.setCouponInfo(null);
|
| | | taoBaoGoodsBriefExtra.setUpdatetime(new Date());
|
| | | |
| | |
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("id", auctionId);
|
| | | item.put("from", "dynamics");
|
| | | |
| | |
|
| | | GoodsPicture goodsPicture = new GoodsPicture();
|
| | | goodsPicture.setH(100);
|
| | | goodsPicture.setW(100);
|
| | |
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | goodsPicture.setParams(item.toString());
|
| | | goodsPicture.setGoods(taoBaoGoodsBriefExtra);
|
| | | |
| | |
|
| | | listPicture.add(goodsPicture);
|
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(listPicture);
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | |
| | |
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | | shareMoneyDesc.setColor("#FFFFFF");
|
| | | shareMoneyDesc.setBottomColor("#E8AE48");
|
| | |
| | | dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_THREE);
|
| | | dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
|
| | | dynamicInfoDao.deleteById(dynamicInfoId);
|
| | | }
|
| | | // 保存信息
|
| | | dynamicInfoDao.insert(dynamicInfo);
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void deleteActivity(Long activityId) {
|
| | | DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activityId);
|
| | | if (dynamicInfo != null) {
|
| | | // 删除之前的
|
| | | dynamicInfoDao.deleteById(dynamicInfo.getId());
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void removeByDate(Date createTime) {
|
| | | dynamicInfoDao.removeByDate(createTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateShareCount(DynamicInfo record) {
|
| | | dynamicInfoDao.updateShareCount(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "dynamicCache", key = "'count-'+#cid+'-'+#subId")
|
| | | public long count(Long cid, Long subId) {
|
| | |
| | | @Cacheable(value = "dynamicCache", key = "'query-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
|
| | | public List<DynamicInfo> query(int start, int count, Long cid, Long subId) {
|
| | | List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
|
| | | |
| | |
|
| | | // 更新商品信息
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | |
| | | updateGoodInfo(list);
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新商品信息
|
| | | */
|
| | | public void updateGoodInfo(List<DynamicInfo> list) {
|
| | |
|
| | | // 外网进行更新
|
| | | if (!Constant.IS_OUTNET) {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | | }
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (DynamicInfo dynamicInfo : list) {
|
| | | // 邀请数据不做更新
|
| | | long classId = dynamicInfo.getClassId();
|
| | | if (classId == 4) {
|
| | | break;
|
| | | }
|
| | |
|
| | | // 更新商品信息
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null || imgs.size() == 0) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // 是否一个小时之内已更新
|
| | | Date updateTime = dynamicInfo.getUpdateTime();
|
| | | if (updateTime != null) {
|
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
|
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数
|
| | | long diff = System.currentTimeMillis() - updateTime.getTime();
|
| | | long day = diff / nd;// 计算差多少天
|
| | | long hour = diff % nd / nh + day * 24;// 计算差多少小时
|
| | | if (hour < 1) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | // 已下架ID
|
| | | List<Long> listDown = new ArrayList<Long>();
|
| | | // 商品列表
|
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | TaoBaoGoodsBriefExtra oldExtra = goodsPicture.getGoods();
|
| | | if (oldExtra == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | Integer state = oldExtra.getState();
|
| | | if (state != null && state == 1) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | try {
|
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(oldExtra.getAuctionId());
|
| | |
|
| | | // 更新商品信息
|
| | | try {
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(goodsBrief);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | listGoods.add(goodsBrief);
|
| | |
|
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | | if (classId == 1) {
|
| | | BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(goodsBrief);
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | | shareMoneyDesc.setColor("#FFFFFF");
|
| | | shareMoneyDesc.setBottomColor("#E8AE48");
|
| | | shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
|
| | | dynamicInfo.setDesc(shareMoneyDesc);
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
|
| | | proportion.toString(), null);
|
| | |
|
| | | if (!newExtra.isCoupon()) {
|
| | | newExtra.setState(1);
|
| | | }
|
| | | newExtra.setUpdatetime(new Date());
|
| | | goodsPicture.setGoods(oldExtra);
|
| | |
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | listDown.add(oldExtra.getAuctionId());
|
| | |
|
| | | oldExtra.setState(1);
|
| | | oldExtra.setCoupon(false);
|
| | | oldExtra.setUpdatetime(new Date());
|
| | | goodsPicture.setGoods(oldExtra);
|
| | |
|
| | | // 商品真实下架
|
| | | goodsPicture.setGoodState(1);
|
| | |
|
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | | if (classId == 1) {
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | | shareMoneyDesc.setColor("#FFFFFF");
|
| | | shareMoneyDesc.setBottomColor("#E8AE48");
|
| | | shareMoneyDesc.setContent("预估分享奖金:¥" + new BigDecimal(0));
|
| | | dynamicInfo.setDesc(shareMoneyDesc);
|
| | | }
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(imgs);
|
| | |
|
| | | // 商品已下架
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = dynamicInfo.getListGoodsBrief();
|
| | | if (listGoodsBrief != null && listGoodsBrief.size() > 0) {
|
| | |
|
| | | if (listGoods.size() > 0) {
|
| | | if (classId == 1) {
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | } else {
|
| | | for (int i = 0; i < listGoodsBrief.size(); i++) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = listGoodsBrief.get(i);
|
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId();
|
| | |
|
| | | boolean isadd = true;
|
| | | for (TaoBaoGoodsBrief goods : listGoods) {
|
| | | if (goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) {
|
| | | isadd = false;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (isadd) {
|
| | | // 商品已下架 则添加原来商品信息
|
| | | if (listDown.size() > 0 && listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
|
| | | taoBaoGoodsBrief.setState(1);
|
| | | }
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | }
|
| | | }
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | }
|
| | | } else {
|
| | | if (listDown.size() > 0) {
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
|
| | | taoBaoGoodsBrief.setState(1);
|
| | | }
|
| | | }
|
| | | dynamicInfo.setListGoodsBrief(listGoodsBrief);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | dynamicInfo.setUpdateTime(new Date());
|
| | | dynamicInfoDao.updateGoodInfo(dynamicInfo);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|