yujian
2020-01-03 598d537f468c7c20a840c6ff8c9f742b6f542286
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java
@@ -15,7 +15,6 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
@@ -24,6 +23,7 @@
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
@@ -68,6 +68,9 @@
   @Resource
   private BanLiShopGoodsSetService banLiShopGoodsSetService;
   @Resource
   private RedPackForbidService redPackForbidService;
   /**
    * 商品列表
    * 
@@ -77,14 +80,15 @@
    * @param out
    */
   @RequestMapping(value = "goodsList")
   public void goodsList(AcceptData acceptData, int page,Long uid, String callback, PrintWriter out) {
   public void goodsList(AcceptData acceptData, int page, Long uid, String callback, PrintWriter out) {
      if (page <= 0)
         page = 1;
      List<BanLiShopGoods> goodsList = banLiShopGoodsService.listGoods(null, BanLiShopGoods.STATE_ONLINE, page,
            Constant.PAGE_SIZE);
      long count = banLiShopGoodsService.countGoods(null, BanLiShopGoods.STATE_ONLINE);
      // 获取banner
      List<SwiperPicture> pictureList = swiperPictureService.getByBannerCard("hongbao_exchange_goods_list");
      List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("hongbao_exchange_goods_list",
            acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
      JSONObject data = new JSONObject();
      if (pictureList != null && pictureList.size() > 0) {
@@ -92,14 +96,8 @@
      }
      data.put("data", goodsList);
      data.put("count", count);
      RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
      if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
         data.put("redPackLock", true);
      } else {
         data.put("redPackLock", false);
      }
      data.put("redPackLock", redPackForbidService.verifyForbid(uid));
      if (!StringUtil.isNullOrEmpty(callback))
         out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
      else
@@ -184,6 +182,7 @@
            }
         }
      BigDecimal money = redPackBalanceService.getBalance(uid);
      JSONObject data = new JSONObject();
      data.put("goods", goods);
      data.put("hongBaoBalance", money);