| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private QrCodeService qrCodeService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | 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());
|
| | |
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | title = title.replaceAll("<p>", "");
|
| | | title = title.replaceAll("</p>", "");
|
| | | title = title.replaceAll("<br>", "\n");
|
| | | 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("-", ""));
|
| | |
| | | * 更新商品信息
|
| | | */
|
| | | public void updateGoodInfo(List<DynamicInfo> list) {
|
| | | |
| | | // 外网进行更新
|
| | | if (!Constant.IS_OUTNET) {
|
| | | return;
|
| | | }
|
| | | |
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 已下架ID
|
| | | List<Long> listDown = new ArrayList<Long>();
|
| | | // 商品列表
|
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | |
| | |
|
| | | try {
|
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(oldExtra.getAuctionId());
|
| | | |
| | | // 更新商品信息
|
| | | try {
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(goodsBrief);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | listGoods.add(goodsBrief);
|
| | |
|
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | |
| | | newExtra.setState(1);
|
| | | }
|
| | | newExtra.setUpdatetime(new Date());
|
| | | goodsPicture.setGoods(newExtra);
|
| | | goodsPicture.setGoods(oldExtra);
|
| | |
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | listDown.add(oldExtra.getAuctionId());
|
| | | |
| | | oldExtra.setState(1);
|
| | | oldExtra.setCoupon(false);
|
| | | oldExtra.setUpdatetime(new Date());
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(imgs);
|
| | |
|
| | | // 更新商品
|
| | | // 商品已下架
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = dynamicInfo.getListGoodsBrief();
|
| | | if (listGoods != null && listGoods.size() > 0 && listGoodsBrief != null && listGoodsBrief.size() > 0) {
|
| | | if (listGoodsBrief != null && listGoodsBrief.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 (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);
|
| | | }
|
| | | }
|
| | | |
| | | // 商品已下架 则添加原来商品信息
|
| | | if (isadd) {
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | }
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | }
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | } else {
|
| | | if (listDown.size() > 0) {
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief: listGoodsBrief) {
|
| | | if (listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
|
| | | taoBaoGoodsBrief.setState(1);
|
| | | }
|
| | | }
|
| | | dynamicInfo.setListGoodsBrief(listGoodsBrief);
|
| | | }
|
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(imgs);
|
| | | |
| | | dynamicInfo.setUpdateTime(new Date());
|
| | | dynamicInfoDao.updateGoodInfo(dynamicInfo);
|
| | | }
|