| | |
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderItemServcie;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.MoneyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.PassWordErrorRecordService;
|
| | | 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;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | private HongBaoService hongBaoService;
|
| | |
|
| | | @Resource
|
| | | private MoneyRecordService moneyRecordService;
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | @Resource
|
| | | private ExtractService extractService;
|
| | |
|
| | | @Resource
|
| | | private PassWordErrorRecordService passWordErrorRecordService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
| | | @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";
|
| | | private static final String EXTRACT_MAX_MONEY = "extract_max_money";
|
| | |
| | | * @param tbOpenid
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @param tbSession(淘宝session数据,加密)
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "login")
|
| | | public void login(AcceptData acceptData, String code, String vcode, String phone, boolean wxinstall,
|
| | | String tbOpenid, String tbNickName, String tbPortrait, int loginType, Boolean first, HttpSession session,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | | String tbOpenid, String tbNickName, String tbPortrait, String tbSession, int loginType, Boolean first,
|
| | | HttpSession session, HttpServletRequest request, PrintWriter out) {
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (loginType == 3)// 验证短信验证码
|
| | | if (loginType == 3 && !Constant.IS_TEST)// 验证短信验证码
|
| | | {
|
| | | String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
|
| | | if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
|
| | |
| | | * @param tbOpenid
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @param tbSession
|
| | | * -淘宝授权session
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "bindTaoBao")
|
| | | public void bindTaoBao(AcceptData acceptData, Long uid, String tbOpenid, String tbNickName, String tbPortrait,
|
| | | PrintWriter out) {
|
| | | String tbSession, PrintWriter out) {
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tbSession)) {
|
| | | JSONObject session = JSONObject.fromObject(tbSession);
|
| | | tbOpenid = session.optString("openId");
|
| | | tbNickName = session.optString("nick");
|
| | | tbPortrait = session.optString("avatarUrl");
|
| | | }
|
| | |
|
| | | try {
|
| | |
| | | */
|
| | | @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, "用户不存在"));
|
| | |
| | | }
|
| | |
|
| | | BigDecimal moneyLastMonth = inviteGetMoneyService.getMoneyLastMonth(uid + "");
|
| | | BigDecimal unOpenmoney = hongBaoService.getUnOpenHongBaoByUid(uid);
|
| | | BigDecimal totalFanMoney = hongBaoService.getMyTotalHongBaoByUid(user.getId());
|
| | | 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", hongBaoService.getTotalTiChengMoney(uid).toString());// 累计提成
|
| | | data.put("totalUnGetTiChengMoney", hongBaoService.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", hongBaoService.getTotalTiChengMoney(uid));// 累计提成
|
| | | data.put("totalUnGetTiChengMoney", hongBaoService.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", hongBaoService.getTotalTiChengCount(uid) > 0);
|
| | | data.put("showTiCheng", spreadImgCount + shareCount > 0);
|
| | | }
|
| | |
|
| | | user.setNoOpenHongBao(unOpenmoney);
|