yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
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);