| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v1/class")
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | JSONArray array = new JSONArray();
|
| | | List<TaoBaoGoodsBrief> taobaoList = taoKeGoodsService.searchWuLiaoList(sf);
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taobaoList) {
|
| | | int biz30day = taoBaoGoodsBrief.getBiz30day();
|
| | | if (biz30day >= 10000) {
|
| | |
| | | } else {
|
| | | taoBaoGoodsBrief.setSalesCount(biz30day + "");
|
| | | }
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, null)));
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nav", new JSONArray());
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | |
|
| | | // 遍历列表数据
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
| | | taoBaoGoodsBrief.setSalesCount(biz30day + "");
|
| | | }
|
| | |
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, null)));
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | public void getCouponList(AcceptData acceptData, int page, HttpServletRequest request, PrintWriter out) {
|
| | | page = page > 0 ? page : 1;
|
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = taoBaoCouponService.getTaoBaoCouponList(page);
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | JSONArray array = new JSONArray();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra;
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, "");
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), "");
|
| | | array.add(gson.toJson(taoBaoGoodsBriefExtra));
|
| | | }
|
| | | int count = 10000;
|
| | |
| | | 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");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra;
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, "");
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), "");
|
| | | re.add(taoBaoGoodsBriefExtra);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | private void setTaoBaoCouponHongBao(List<TaoBaoCoupon> taoBaoCoupons) {
|
| | | if (taoBaoCoupons.size() > 0) {
|
| | | String proportion = hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
|
| | | BigDecimal proportion= hongBaoManageService.getFanLiRate();
|
| | | |
| | | for (TaoBaoCoupon taoBaoCoupon : taoBaoCoupons) {
|
| | | BigDecimal hb = TaoBaoUtil.getCouponHongBaoInfo(taoBaoCoupon, new BigDecimal(proportion));
|
| | | BigDecimal hb = TaoBaoUtil.getCouponHongBaoInfo(taoBaoCoupon,proportion);
|
| | | taoBaoCoupon.setHongbao(hb);
|
| | | }
|
| | | }
|