| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.InviteMaterial;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.push.OPPOPushUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "insertShop")
|
| | | public void insertShop(PrintWriter out) {
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "uploadInviteMaterial2")
|
| | | public void uploadInviteMaterial2(PrintWriter out) {
|
| | | try {
|
| | | dynamicInfoService.insertShopInfo();
|
| | | dynamicInfoService.insertTimeHotSale();
|
| | | dynamicInfoService.insertTimeRecommend();
|
| | | List<InviteMaterial> list = new ArrayList<InviteMaterial>();
|
| | | File picfile = new File("E:\\Invite\\pic.txt");// Text文件
|
| | | BufferedReader brp = new BufferedReader(new FileReader(picfile));// 构造一个BufferedReader类来读取文件
|
| | | String fileUrl = "";
|
| | | while ((fileUrl = brp.readLine()) != null) {// 使用readLine方法,一次读一行
|
| | | if (StringUtil.isNullOrEmpty(fileUrl)) {
|
| | | continue;
|
| | | }
|
| | | InviteMaterial inviteMaterial = new InviteMaterial();
|
| | | inviteMaterial.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | inviteMaterial.setState(0);
|
| | | inviteMaterial.setPicture(fileUrl);
|
| | | list.add(inviteMaterial);
|
| | | }
|
| | | brp.close();
|
| | |
|
| | | List<String> listTxt = new ArrayList<String>();
|
| | | File textfile = new File("E:\\Invite\\content.txt");// Text文件
|
| | | BufferedReader br = new BufferedReader(new FileReader(textfile));// 构造一个BufferedReader类来读取文件
|
| | | String s = "";
|
| | | while ((s = br.readLine()) != null) {// 使用readLine方法,一次读一行
|
| | | if (StringUtil.isNullOrEmpty(s)) {
|
| | | continue;
|
| | | }
|
| | | listTxt.add(s);
|
| | | }
|
| | | br.close();
|
| | |
|
| | | if (list.size() == 0 || listTxt.size() == 0 || listTxt.size() < list.size()) {
|
| | | return;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | InviteMaterial invite = list.get(i);
|
| | | invite.setText(listTxt.get(i));
|
| | | inviteMaterialService.insert(invite);
|
| | | }
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("上传成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("上传失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveInvite")
|
| | | public void saveInvite(InviteMaterial inviteMaterial, PrintWriter out) {
|
| | | try {
|
| | | inviteMaterial.setState(0);
|
| | | inviteMaterialService.insert(inviteMaterial);
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("上传成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("上传失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "insertTimeInvite")
|
| | | public void insertTimeInvite(PrintWriter out) {
|
| | | try {
|
| | | dynamicInfoService.insertTimeInvite();
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getJingFenList")
|
| | | public void getJingFenList(String callback, Integer page, Integer eliteId, PrintWriter out) {
|
| | | try {
|
| | | JDSearchResult result = JDApiUtil.getJingFenGoods(page, eliteId);
|
| | | long count = 0;
|
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | | if (result != null) {
|
| | | PageEntity pageEntity = result.getPageEntity();
|
| | | if (pageEntity != null) {
|
| | | count = pageEntity.getTotalCount();
|
| | | }
|
| | |
|
| | | List<JDGoods> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("count", count);
|
| | | data.put("list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getWaitingThreadsCount")
|
| | | public void getWaitingThreadsCount(PrintWriter out) {
|
| | |
| | |
|
| | | out.print("success");
|
| | | }
|
| | |
|
| | |
|
| | | |
| | |
|
| | | @RequestMapping("getLocalTime")
|
| | | public void getLocalTime(PrintWriter out) {
|