yujian
2019-04-08 5c4ecf9e8b47efbbf5d21c9e109be0a60cb7e26d
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java
@@ -19,10 +19,10 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.ClassRecommendGoods;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.taobao.SearchFilter;
@@ -33,13 +33,14 @@
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.goods.ClassRecommendGoodsService;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.SuperGoodsClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
@@ -67,9 +68,6 @@
   @Resource
   private GoodsSecondClassService goodsSecondClassService;
   @Resource
   private ClassRecommendGoodsService classRecommendGoodsService;
   @Resource
   private GoodsClassService goodsClassService;
@@ -108,6 +106,12 @@
   @Resource
   private MonitorService monitorService;
   @Resource
   private HomeNavbarService homeNavbarService;
   @Resource
   private SwiperPictureService swiperPictureService;
   @Resource(name = "taskExecutor")
   private TaskExecutor executor;
@@ -158,22 +162,30 @@
    * @param out
    */
   @RequestMapping(value = "getgoodssecondclass", method = RequestMethod.POST)
   public void getGoodsSecondClass(AcceptData acceptData, long gcid, PrintWriter out) {
   public void getGoodsSecondClass(AcceptData acceptData, long gcid, Long swpid, PrintWriter out) {
      try {
         GoodsClass goodsClass = goodsClassService.getGoodsClassCache(gcid);
         if (goodsClass == null) {
            out.print(JsonUtil.loadFalseResult("暂无数据"));
            return;
         }
         // 轮播图
         List<SwiperPicture> picList = null;
         if (swpid != null) {
            picList = swiperPictureService.getByBannerId(swpid);
         }
         if (picList == null) {
            picList = new ArrayList<SwiperPicture>();
         }
         List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1);
         if (goodsSubClassList == null) {
            goodsSubClassList = new ArrayList<GoodsSubClass>();
         }
         JSONObject data = new JSONObject();
         data.put("picList", JsonUtil.getApiCommonGson().toJson(picList));
         data.put("count", goodsSubClassList.size());
         data.put("goodsSecondClassList", JsonUtil.getApiCommonGson().toJson(goodsSubClassList));
         out.print(JsonUtil.loadTrueResult(data));
@@ -197,7 +209,12 @@
                     goodsClass.setIosClick(1L);
                  }
               }
               goodsClassService.updateByPrimaryKeySelective(goodsClass);
               GoodsClass gc = new GoodsClass();
               gc.setId(goodsClass.getId());
               gc.setIosClick(goodsClass.getIosClick());
               gc.setAndroidClick(goodsClass.getAndroidClick());
               goodsClassService.updateByPrimaryKeySelective(gc);
            }
         });
@@ -212,20 +229,6 @@
   }
   @RequestMapping(value = "getclassrecommendgoods", method = RequestMethod.POST)
   public void getClassRecommendGoods(AcceptData acceptData, long goodsClassId, PrintWriter out) {
      List<ClassRecommendGoods> classRecommendGoodsList = classRecommendGoodsService
            .getClassRecommendGoodsByGoodsClassId(goodsClassId);
      if (classRecommendGoodsList == null) {
         out.print(JsonUtil.loadFalseResult("暂无数据"));
         return;
      }
      JSONObject data = new JSONObject();
      data.put("count", classRecommendGoodsList.size());
      data.put("classRecommendGoodsList", JsonUtil.getApiCommonGson().toJson(classRecommendGoodsList));
      String result = JsonUtil.loadTrueResult(data);
      out.print(result);
   }
   @RequestMapping(value = "getCouponGoods", method = RequestMethod.POST)
   public void getCouponGoods(AcceptData acceptData, int page, long gcid, PrintWriter out) {
@@ -774,7 +777,7 @@
      if (meterialId > 0)
         result = TaoKeApiUtil.getMaterialByMaterialId(meterialId, page, 20);
      else
         result = TaoKeApiUtil.searchCouple(goodsClassService.getKwById(id), null, page, 20);
         result = TaoKeApiUtil.searchCouple(goodsClassService.getKeysById(id), null, page, 20);
      List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
      if (result.getNavList() != null)