| | |
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoMessageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleRankService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoMessageService hongBaoMessageService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleRankService threeSaleRankService;
|
| | |
|
| | | @Resource
|
| | |
| | | @RequestMapping("coupon")
|
| | | public String conpon(Model model) {
|
| | | List<TaoBaoCoupon> couponList = taoBaoCouponService.getTaoBaoCouponList("", 1);
|
| | | String proportion = hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | String jsonArr = Utils.imgListSize(JsonUtil.getApiCommonGson().toJson(couponList));
|
| | | JSONArray jsonArray = JSONArray.fromObject(jsonArr);
|
| | | List<TaoBaoCoupon> collection = (List<TaoBaoCoupon>) JSONArray.toCollection(jsonArray, TaoBaoCoupon.class);
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping("findThreeFriendsCount")
|
| | | public void findThreeFriendsCount(long id, PrintWriter out) {
|
| | | public void findThreeFriendsCount(long id, String callback, PrintWriter out) {
|
| | | int count1 = userInfoService.findFriendsCount(id, 1);
|
| | | int count2 = userInfoService.findFriendsCount(id, 2);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count1", count1);
|
| | | data.put("count2", count2);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeFriends")
|
| | | public void findThreeFriends(long id, int type, int page, PrintWriter out) {
|
| | | public void findThreeFriends(long id, int type, int page, String callback, PrintWriter out) {
|
| | | int pageSize = 30;
|
| | | List<InviteUser> list = userInfoService.getFriendsList(id, type, page, pageSize);
|
| | | JSONArray array = new JSONArray();
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", array);
|
| | | data.put("pages", count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeSales")
|
| | |
| | | @RequestMapping(value = "getConpon", method = RequestMethod.POST)
|
| | | public void getConpon(int page, PrintWriter out) {
|
| | | List<TaoBaoCoupon> taoBaoCouponList = taoBaoCouponService.getTaoBaoCouponList("", page);
|
| | | String proportion = hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("taoBaoCouponList", Utils.imgListSize(JsonUtil.getApiCommonGson().toJson(taoBaoCouponList)));
|
| | | data.put("proportion", proportion);
|
| | |
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | List<TaoBaoGoodsBriefExtra> list = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (RecommendSectionGoods recommendSectionGoods : recommendSectionGoodsList) {
|
| | | list.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(recommendSectionGoods.getTaoBaoGoodsBrief(), proportion,
|
| | | fcRate, ""));
|
| | | list.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(recommendSectionGoods.getTaoBaoGoodsBrief(),
|
| | | proportion.toString(), ""));
|
| | | }
|
| | |
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|