| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | BigDecimal pro = hongBaoManageService.getFanLiRate(acceptData.getSystem()); |
| | | if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品 |
| | | pro = new BigDecimal(100); |
| | | List<TaoBaoGoodsBrief> goodsList = result.getGoodsList(); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { |
| | | TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), ""); |
| | | if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品 |
| | | { |
| | | extra.getTaoBaoHongBaoInfo().setRate("¥" + TaoBaoUtil.getCouponPrice(taoBaoGoodsBrief)); |
| | | extra.getTaoBaoHongBaoInfo().setHongbao(TaoBaoUtil.getCouponPrice(taoBaoGoodsBrief)); |
| | | } |
| | | array.add(gson.toJson(extra)); |
| | | List<CommonGoods> goodsList = result.getGoodsList(); |
| | | for (CommonGoods taoBaoGoodsBrief : goodsList) { |
| | | // TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), ""); |
| | | // if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品 |
| | | // { |
| | | // extra.getTaoBaoHongBaoInfo().setRate("¥" + TaoBaoUtil.getCouponPrice(taoBaoGoodsBrief)); |
| | | // extra.getTaoBaoHongBaoInfo().setHongbao(TaoBaoUtil.getCouponPrice(taoBaoGoodsBrief)); |
| | | // } |
| | | array.add(gson.toJson(taoBaoGoodsBrief)); |
| | | } |
| | | root.put("goodsList", array); |
| | | root.put("goodsCount", result.getCount()); |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | | |
| | | // 更新前5页数据 |
| | | if (page <= 5) |
| | | try { |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(goodsList); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | } |