From 92c681fabac989d1a9f16fa13202d7f5ccac52d9 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期一, 14 一月 2019 10:22:22 +0800 Subject: [PATCH] 订单优化 + 后台提现曲线图 --- fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java | 127 +++++++++++++++++++----------------------- 1 files changed, 58 insertions(+), 69 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java index 7beb824..8cb3109 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java @@ -10,29 +10,27 @@ 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.yeshi.fanli.entity.accept.AcceptData; -import com.yeshi.fanli.entity.admin.EveryDayTask; import com.yeshi.fanli.entity.admin.InviteGetMoney; -import com.yeshi.fanli.entity.bus.user.UserRankings; +import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; import com.yeshi.fanli.entity.system.System; import com.yeshi.fanli.entity.system.SystemClientParams; import com.yeshi.fanli.exception.NotExistObjectException; -import com.yeshi.fanli.exception.UserRankingsException; -import com.yeshi.fanli.service.inter.config.EveryDayTaskService; +import com.yeshi.fanli.exception.banner.SwiperPictureException; +import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.config.InviteGetMoneyService; import com.yeshi.fanli.service.inter.config.SystemClientParamsService; import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; +import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; import com.yeshi.fanli.service.inter.user.QrCodeService; import com.yeshi.fanli.service.inter.user.SpreadUserImgService; import com.yeshi.fanli.service.inter.user.UserRankingsService; import com.yeshi.fanli.tag.PageEntity; import com.yeshi.fanli.util.Constant; -import com.yeshi.fanli.util.Utils; -import com.yeshi.fanli.util.account.UserUtil; -import com.yeshi.fanli.util.taobao.TaoBaoUtil; -import org.yeshi.utils.JsonUtil; +import net.sf.json.JSONArray; import net.sf.json.JSONObject; /** @@ -51,9 +49,6 @@ private InviteGetMoneyService inviteGetMoneyService; @Resource - private EveryDayTaskService everyDayTaskService; - - @Resource private SystemClientParamsService systemClientParamsService; @Resource @@ -64,70 +59,45 @@ @Resource private TaoBaoGoodsBriefService taoBaoGoodsBriefService; - + @Resource private UserRankingsService userRankingsService; - /** - * - * 鏂规硶璇存槑: 杩斿洖鍒板墠绔帴鍙� - * - * @author mawurui createTime 2018骞�3鏈�29鏃� 涓嬪崍2:37:38 - * @throws NotExistObjectException - */ + @Resource + private ConfigService configService; + + @Resource + private SwiperPictureService swiperPictureService; + @RequestMapping(value = "/inviteGetMoney", method = RequestMethod.POST) public void everyDayTaskList(AcceptData acceptData, int pageIndex, PrintWriter out, String uid) throws NotExistObjectException { // 鏌ヨ鍟嗗搧鎬绘暟 - Integer totalCount = everyDayTaskService.getCount(); + Integer totalCount = 0; int totalPage = totalCount % Constant.PAGE_SIZE == 0 ? totalCount / Constant.PAGE_SIZE : totalCount / Constant.PAGE_SIZE + 1; PageEntity pageEntity = new PageEntity(pageIndex, Constant.PAGE_SIZE, totalCount, totalPage); - // 鍒嗛〉鏌ヨ鎵�鏈夋瘡鏃ュ晢鍝� - List<EveryDayTask> everyDayTaskList = everyDayTaskService.everyDayTaskListCache(pageIndex - 1, ""); - for (EveryDayTask everyDayTask : everyDayTaskList) { - // 璁$畻鐢ㄦ埛寰楀埌鐨勪剑閲� - BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(everyDayTask.getEtGoods()); - String getMoney = money.toString(); - everyDayTask.setGetMoney("璧�" + "楼" + getMoney); - // 璁$畻鍒稿悗浠� - BigDecimal quanhoujia = TaoBaoUtil.getAfterUseCouplePrice(everyDayTask.getEtGoods()); - if (Integer.parseInt(acceptData.getVersion()) >= 20) - everyDayTask.setQuanhoujiaStr("楼" + quanhoujia.toString()); - else - everyDayTask.setQuanhoujiaStr(quanhoujia.toString()); - everyDayTask.getEtGoods().setSalesCount(TaoBaoUtil.getSaleCount(everyDayTask.getEtGoods().getBiz30day())); - } - /* - // 鍒嗛〉鏌ヨ閭�璇锋彁鎴愭 - List<InviteGetMoney> inviteGetMoneyList = inviteGetMoneyService.inviteGetMoneyList(pageIndex - 1, ""); - - // 鍚嶅瓧*澶勭悊 - for (InviteGetMoney inviteGetMoney : inviteGetMoneyList) { + * // 鍒嗛〉鏌ヨ閭�璇锋彁鎴愭 List<InviteGetMoney> inviteGetMoneyList = + * inviteGetMoneyService.inviteGetMoneyList(pageIndex - 1, ""); + * + * // 鍚嶅瓧*澶勭悊 for (InviteGetMoney inviteGetMoney : inviteGetMoneyList) { + * + * String name = inviteGetMoney.getName(); if (name != null) { if + * (name.length() > 2) { name = Utils.getStarString(name, 1, + * name.length() - 1); } else { name = name.substring(0, 1) + "**" + + * name.substring(name.length() - 1); } } inviteGetMoney.setName(name); + * inviteGetMoney.setRankIcon(UserUtil.getRankIcon(3)); } + */ - String name = inviteGetMoney.getName(); - if (name != null) { - if (name.length() > 2) { - name = Utils.getStarString(name, 1, name.length() - 1); - } else { - name = name.substring(0, 1) + "**" + name.substring(name.length() - 1); - } - } - inviteGetMoney.setName(name); - inviteGetMoney.setRankIcon(UserUtil.getRankIcon(3)); - } - */ - - - List<InviteGetMoney> inviteGetMoneyList = userRankingsService.getRank(0,5); - - - JSONObject data = new JSONObject(); + List<InviteGetMoney> inviteGetMoneyList = userRankingsService.getRank(0, 5); + + com.alibaba.fastjson.JSONObject data = new com.alibaba.fastjson.JSONObject(); data.put("pageEntity", JsonUtil.getSimpleGsonWithDate().toJson(pageEntity)); - data.put("everyDayTaskList", JsonUtil.getSimpleGsonWithDateAndSerialization().toJson(everyDayTaskList)); - data.put("inviteGetMoneyList", JsonUtil.getSimpleGsonWithDate().toJson(inviteGetMoneyList)); + data.put("everyDayTaskList", new JSONArray()); + data.put("inviteGetMoneyList", + JSONArray.fromObject(JsonUtil.getSimpleGsonWithDate().toJson(inviteGetMoneyList))); if (uid.equals("0") || uid == null) { data.put("myTeam", "---"); data.put("moneyToday", "---"); @@ -140,21 +110,20 @@ int myTeamCount = myFirstTeamCount + mySecondTeamCount; data.put("myTeam", myTeamCount); // 浠婃棩 鏈湀棰勪及鏀剁泭 - BigDecimal moneyToday = inviteGetMoneyService.getMoneyToday(uid); + BigDecimal moneyToday = inviteGetMoneyService.getMoneyToday(uid + ""); if (moneyToday == null) { moneyToday = new BigDecimal(0); } - - BigDecimal moneyMonth = inviteGetMoneyService.getMoneyMonth(uid); + BigDecimal moneyMonth = inviteGetMoneyService.getMoneyMonth(uid + ""); if (moneyMonth == null) { moneyMonth = new BigDecimal(0); } - BigDecimal moneyLastMonth = inviteGetMoneyService.getMoneyLastMonth(uid); + BigDecimal moneyLastMonth = inviteGetMoneyService.getMoneyLastMonth(uid + ""); - data.put("moneyToday", moneyToday.setScale(2, BigDecimal.ROUND_DOWN)); - data.put("moneyMonth", moneyMonth.setScale(2, BigDecimal.ROUND_DOWN)); - data.put("moneyLastMonth", moneyLastMonth); + data.put("moneyToday", moneyToday.setScale(2, BigDecimal.ROUND_DOWN).toString()); + data.put("moneyMonth", moneyMonth.setScale(2, BigDecimal.ROUND_DOWN).toString()); + data.put("moneyLastMonth", moneyLastMonth.toString()); } // 娲诲姩瑙勫垯 @@ -171,7 +140,27 @@ data.put("activityRules", valueBr); data.put("inviteList", String.format("http://%s/%s/client/share/friends_new.html", Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName())); - out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "鎴愬姛")); + try { + List<SwiperPicture> pictureList = swiperPictureService.getByBannerCard("invite_top_banner"); + if (pictureList != null && pictureList.size() > 0) { + SwiperPicture picture = pictureList.get(0); + com.alibaba.fastjson.JSONObject pictureJson = new com.alibaba.fastjson.JSONObject(); + pictureJson.put("src", picture.getSrc()); + pictureJson.put("jumpDetail", picture.getJumpDetail()); + pictureJson.put("params", picture.getParams()); + data.put("topBanner", pictureJson); + } + + } catch (SwiperPictureException e) { + e.printStackTrace(); + } + + data.put("desc", configService.get("invite_desc")); + + com.alibaba.fastjson.JSONObject root = new com.alibaba.fastjson.JSONObject(); + root.put("code", 0); + root.put("data", data); + out.print(root.toString()); } /** -- Gitblit v1.8.0