From 88b54772dbcf5ecab1e2316e4e4626ac901b8908 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期二, 22 一月 2019 15:58:24 +0800 Subject: [PATCH] 邀请码添加返回状态 --- fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java | 49 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 34 insertions(+), 15 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java index 8fba11d..e6f5c50 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java @@ -44,9 +44,11 @@ import com.yeshi.fanli.service.inter.user.BindingAccountService; import com.yeshi.fanli.service.inter.user.ExtractService; import com.yeshi.fanli.service.inter.user.ShamUserService; +import com.yeshi.fanli.service.inter.user.SpreadUserImgService; import com.yeshi.fanli.service.inter.user.TBPidService; import com.yeshi.fanli.service.inter.user.UserAccountService; import com.yeshi.fanli.service.inter.user.UserInfoService; +import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.GsonUtil; import com.yeshi.fanli.util.RedisManager; @@ -74,7 +76,7 @@ @Resource private HongBaoService hongBaoService; - + @Resource private HongBaoV2Service hongBaoV2Service; @@ -128,6 +130,12 @@ @Resource private TaoBaoUnionConfigService taoBaoUnionConfigService; + + @Resource + private SpreadUserImgService spreadUserImgService; + + @Resource + private UserShareGoodsRecordService userShareGoodsRecordService; private static final String PASSWORD_MAX_ERROR = "password_max_error"; private static final String EXTRACT_MIN_MONEY = "extract_min_money"; @@ -839,6 +847,7 @@ */ @RequestMapping(value = "getusermoney") public void getMoneyDetail(AcceptData acceptData, Long uid, PrintWriter out) { + UserInfo user = userInfoService.getUserByIdWithMybatis(uid); if (user == null) { out.print(JsonUtil.loadFalseResult(2, "鐢ㄦ埛涓嶅瓨鍦�")); @@ -857,29 +866,39 @@ BigDecimal unOpenmoney = hongBaoV2Service.getUnRecievedFanLiMoney(uid); BigDecimal totalFanMoney = hongBaoV2Service.getTotalFanLiMoney(uid); JSONObject data = new JSONObject(); + int spreadImgCount = spreadUserImgService.countUserSpreadImg(uid); + long shareCount = userShareGoodsRecordService.countShareRecordByUid(uid); + // IOS绔暟瀛楁寜鐓у瓧绗︿覆澶勭悊 if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 33) { 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()); - data.put("money", user.getMyHongBao().toString()); - data.put("unGetMoney", unOpenmoney.toString()); - data.put("totalFanLiMoney", totalFanMoney.toString());// 绱杩斿埄 - data.put("totalTiChengMoney", hongBaoV2Service.getTotalTiChengMoney(uid).toString());// 绱鎻愭垚 - data.put("totalUnGetTiChengMoney", hongBaoV2Service.getUnGetTiChengMoney(uid).toString()); // 鏈埌璐︽彁鎴� + data.put("moneyLastMonth", moneyLastMonth.setScale(2, BigDecimal.ROUND_DOWN).toString()); + data.put("money", user.getMyHongBao().setScale(2, BigDecimal.ROUND_DOWN).toString()); + data.put("unGetMoney", unOpenmoney.setScale(2, BigDecimal.ROUND_DOWN).toString()); + data.put("totalFanLiMoney", totalFanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());// 绱杩斿埄 + data.put("totalTiChengMoney", + hongBaoV2Service.getTotalTiChengMoney(uid).setScale(2, BigDecimal.ROUND_DOWN).toString());// 绱鎻愭垚 + data.put("totalUnGetTiChengMoney", + hongBaoV2Service.getUnGetTiChengMoney(uid).setScale(2, BigDecimal.ROUND_DOWN).toString()); // 鏈埌璐︽彁鎴� // 灞曠ず鎻愭垚鏁版嵁 - data.put("showTiCheng", hongBaoService.getTotalTiChengCount(uid) > 0); + if (configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) + data.put("showTiCheng", false); + else + data.put("showTiCheng", spreadImgCount + shareCount > 0); } else { data.put("moneyToday", moneyToday.setScale(2, BigDecimal.ROUND_DOWN)); data.put("moneyMonth", moneyMonth.setScale(2, BigDecimal.ROUND_DOWN)); - data.put("moneyLastMonth", moneyLastMonth); - data.put("money", user.getMyHongBao()); - data.put("unGetMoney", unOpenmoney); - data.put("totalFanLiMoney", totalFanMoney);// 绱杩斿埄 - data.put("totalTiChengMoney", hongBaoV2Service.getTotalTiChengMoney(uid));// 绱鎻愭垚 - data.put("totalUnGetTiChengMoney", hongBaoV2Service.getUnGetTiChengMoney(uid)); // 鏈埌璐︽彁鎴� + data.put("moneyLastMonth", moneyLastMonth.setScale(2, BigDecimal.ROUND_DOWN)); + data.put("money", user.getMyHongBao().setScale(2, BigDecimal.ROUND_DOWN)); + data.put("unGetMoney", unOpenmoney.setScale(2, BigDecimal.ROUND_DOWN)); + data.put("totalFanLiMoney", totalFanMoney.setScale(2, BigDecimal.ROUND_DOWN));// 绱杩斿埄 + data.put("totalTiChengMoney", + hongBaoV2Service.getTotalTiChengMoney(uid).setScale(2, BigDecimal.ROUND_DOWN));// 绱鎻愭垚 + data.put("totalUnGetTiChengMoney", + hongBaoV2Service.getUnGetTiChengMoney(uid).setScale(2, BigDecimal.ROUND_DOWN)); // 鏈埌璐︽彁鎴� // 灞曠ず鎻愭垚鏁版嵁 - data.put("showTiCheng", hongBaoV2Service.getTotalTiChengCount(uid) > 0); + data.put("showTiCheng", spreadImgCount + shareCount > 0); } user.setNoOpenHongBao(unOpenmoney); -- Gitblit v1.8.0