| | |
| | | package com.yeshi.fanli.controller.client;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.JsonElement;
|
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | |
| | | data.put("tbPidInfo", clientTBPid);
|
| | |
|
| | | JSONObject taobaoJson = JSONObject.fromObject(gson.toJson(taoBaoGoodsBriefExtra));
|
| | | if (taoBaoGoodsBriefExtra.getImgList() != null)
|
| | | taoBaoGoodsBriefExtra.getImgList().add(0, taoBaoGoodsBriefExtra.getPictUrl());
|
| | | taobaoJson.put("imgList", taoBaoGoodsBriefExtra.getImgList());
|
| | | taobaoJson.put("saleCount", taoBaoGoodsBriefExtra.getSalesCount());// 销量(和salesCount一致,此处处理兼容)
|
| | | if (taoBaoGoodsBriefExtra.getTaoBaoQuanInfo() != null)
|
| | | taobaoJson.put("coupon", true);
|
| | | else
|
| | | taobaoJson.put("coupon", false);
|
| | |
|
| | | // taoBaoGoodsBriefExtra.setAuctionUrl(null);
|
| | | data.put("taobao", taobaoJson);
|
| | | String info = configService.get("detail_prompt");
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | |
|
| | | GsonBuilder gsonBuilder = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder());
|
| | | gsonBuilder.excludeFieldsWithoutExposeAnnotation();
|
| | | gsonBuilder.registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | | return new JsonPrimitive(value.getTime() + "");
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | if (list != null) {
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | for (ScanHistoryV2 sh : list) {
|
| | | TaoBaoGoodsBrief goods = TaoBaoUtil.convert(sh.getCommonGoods());
|
| | | goods.setId(sh.getId());
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion.toString(), "")));
|
| | | TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion.toString(), "");
|
| | | extra.setCreatetime(sh.getCreateTime());
|
| | | array.add(gson.toJson(extra));
|
| | | }
|
| | | }
|
| | | data.put("data", array);
|
| | |
| | |
|
| | | List<String> finalImgList = new ArrayList<>();
|
| | | for (String img : tb.getImgList()) {
|
| | | finalImgList.add(img);
|
| | | finalImgList.add(TbImgUtil.getTBSizeImg(img, 600));
|
| | | }
|
| | |
|
| | | JSONObject goods = new JSONObject();
|
| | |
| | | data.put("goods", goods);
|
| | | data.put("shareUsers", listShareUser);
|
| | | data.put("couponUsers", listCouponUser);
|
| | | data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|