| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private MonitorService monitorService;
|
| | | |
| | | @Resource
|
| | | private HomeNavbarService homeNavbarService;
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
| | | public void getGoodsClass(AcceptData acceptData, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<GoodsClass> goodsClassList = goodsClassService.getListClassCache(system.getId());
|
| | | List<GoodsClass> goodsClassList = goodsClassService.getEffectiveClassCache();
|
| | | if (goodsClassList == null || goodsClassList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", goodsClassList.size());
|
| | | data.put("goodsClassList", goodsClassList);
|
| | | data.put("goodsClassList", JsonUtil.getApiCommonGson().toJson(goodsClassList));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | |
| | | * @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>();
|
| | | }
|
| | |
|
| | | |
| | | boolean changePicture = false;
|
| | | String version = acceptData.getVersion();
|
| | | int tversion = Integer.parseInt(version);
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform) && tversion > 38) {
|
| | | changePicture = true;
|
| | | } else if (tversion > 47){
|
| | | changePicture = true;
|
| | | }
|
| | | |
| | | // 1.5.3新版图片替换
|
| | | if (changePicture) {
|
| | | for (GoodsSubClass goodsSubClass: goodsSubClassList) {
|
| | | String pictureSecond = goodsSubClass.getPictureSecond();
|
| | | if (pictureSecond != null && pictureSecond.trim().length() > 0) {
|
| | | goodsSubClass.setPicture(pictureSecond);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | 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));
|
| | |
| | | filter = new SearchFilter();
|
| | | }
|
| | |
|
| | | // String searchKey = goodsClass.getName();
|
| | | // String key = goodsClass.getKey();
|
| | | // if (key != null && !"".equals(key.trim())) {
|
| | | // searchKey = key;
|
| | | // }
|
| | | // filter.setKey(searchKey);
|
| | |
|
| | | filter.setMaterialId("6707");
|
| | | filter.setPage(page);
|
| | | filter.setPageSize(pageSize);
|
| | |
| | | data.put("result", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | /*
|
| | | * // 测试取消缓存 GoodsClass goodsClass =
|
| | | * goodsClassService.getGoodsClassCache(gcid); if (goodsClass == null) {
|
| | | * out.append(JsonUtil.loadFalseResult("不存在该分类")); return; }
|
| | | * |
| | | * SearchFilter sf = new SearchFilter(); sf.setKey(goodsClass.getKey());
|
| | | * sf.setPage(page); sf.setPageSize(Constant.PAGE_SIZE); sf.setQuan(1);
|
| | | * |
| | | * TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
|
| | | * |
| | | * List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav(); if
|
| | | * (result.getNavList() != null) navList.addAll(result.getNavList());
|
| | | * Gson gson = new GsonBuilder().create(); JSONObject data = new
|
| | | * JSONObject(); data.put("nav", gson.toJson(navList));
|
| | | * List<TaoBaoGoodsBriefExtra> re = new
|
| | | * ArrayList<TaoBaoGoodsBriefExtra>(); List<TaoBaoGoodsBrief>
|
| | | * taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs(); Map<String,
|
| | | * String> map = manageService.convertMap(); String proportion =
|
| | | * map.get("hongbao_goods_proportion"); String fcRate =
|
| | | * map.get("hongbao_fc_ratio");
|
| | | * |
| | | * TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra; if (taoBaoGoodsBriefs !=
|
| | | * null) for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | * int count = taoBaoGoodsBrief.getBiz30day(); if (count >= 10000) {
|
| | | * double sales = count; String salesCountMidea = String.format("%.1f",
|
| | | * sales / 10000); taoBaoGoodsBrief.setSalesCount(salesCountMidea +
|
| | | * "万"); taoBaoGoodsBriefExtra =
|
| | | * TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion,
|
| | | * fcRate, ""); re.add(taoBaoGoodsBriefExtra); } else {
|
| | | * taoBaoGoodsBrief.setSalesCount(count + ""); taoBaoGoodsBriefExtra =
|
| | | * TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion,
|
| | | * fcRate, ""); re.add(taoBaoGoodsBriefExtra); } }
|
| | | * |
| | | * Gson gson2 = JsonUtil.getApiCommonGson(); data.put("result",
|
| | | * gson2.toJson(re)); data.put("count",
|
| | | * result.getTaoBaoHead().getDocsfound());
|
| | | * out.print(JsonUtil.loadTrueResult(data));
|
| | | */
|
| | |
|
| | | }
|
| | |
|
| | |
| | | @RequestMapping(value = { "getcategory" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
|
| | | public void getcategory(AcceptData acceptData, PrintWriter out) {
|
| | | try {
|
| | | com.yeshi.fanli.entity.system.BusinessSystem system = this.businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | |
| | | boolean changePicture = false;
|
| | | String version = acceptData.getVersion();
|
| | | int tversion = Integer.parseInt(version);
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform) && tversion > 38) {
|
| | | changePicture = true;
|
| | | } else if (tversion > 47){
|
| | | changePicture = true;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache(system.getId());
|
| | | |
| | | |
| | | List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache(changePicture);
|
| | | if (listCache == null) {
|
| | | listCache = new ArrayList<Map<String, Object>>();
|
| | | }
|