| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.exception.pdd.PDDOrderException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | |
| | | public class PinDuoDuoControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | | |
| | | @Resource
|
| | | private SpecialService specialService;
|
| | |
|
| | | @Resource
|
| | | private PDDGoodsService pddGoodsService;
|
| | | |
| | |
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @RequestMapping(value = "getClass")
|
| | | public void getJDClass(AcceptData acceptData, PrintWriter out) {
|
| | | List<GoodsClass> list = new ArrayList<GoodsClass>();
|
| | | list.add(new GoodsClass(1L, "精选"));
|
| | | list.add(new GoodsClass(2L, "女装"));
|
| | | list.add(new GoodsClass(3L, "男装"));
|
| | | list.add(new GoodsClass(4L, "美妆"));
|
| | | list.add(new GoodsClass(5L, "美食"));
|
| | | list.add(new GoodsClass(6L, "居家"));
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("list", list);
|
| | | root.put("list", pddGoodsService.getSpecialClass());
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getGoodsInfo")
|
| | | public void getGoodsInfo(AcceptData acceptData, Integer cid, Integer page, PrintWriter out) {
|
| | | public void getGoodsInfo(AcceptData acceptData, Long cid, Integer page, PrintWriter out) {
|
| | | JSONObject root = new JSONObject();
|
| | | if (cid == 1 && page == 1) {
|
| | | List<SwiperPicture> topPicList = swiperPictureService.getByBannerCard("pdd_top");
|
| | | List<BannerVO> topPicList = swiperPictureService.getByBannerCardAndVersion("pinduoduo_special_index",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (topPicList == null) {
|
| | | topPicList = new ArrayList<SwiperPicture>();
|
| | | topPicList = new ArrayList<BannerVO>();
|
| | | }
|
| | | root.put("listPic", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
|
| | | List<Special> listSpecial = specialService.listByPlaceKey("pinduoduo_special_index", platformCode, Integer.parseInt(acceptData.getVersion()));
|
| | | if (listSpecial == null) {
|
| | | listSpecial = new ArrayList<Special>();
|
| | | }
|
| | | root.put("listSpe", JsonUtil.getApiCommonGson().toJson(listSpecial));
|
| | | }
|
| | |
|
| | | // TODO
|
| | | |
| | | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | try {
|
| | | List<PDDGoodsDetail> goodsList = pddGoodsService.specialSearch(page, cid);
|
| | | JSONArray array = new JSONArray();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | | root.put("list", array);
|
| | | root.put("count", 1000);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | } catch (PDDOrderException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|