| | |
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | vo.setLastMonthExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | | |
| | |
|
| | | // 本月提现
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.extractReject);
|
| | | vo.setMonthExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | | |
| | | |
| | |
|
| | | if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 上月收入
|
| | | typeList.clear();
|
| | |
| | |
|
| | | vo.setLatestThreeMonthRecievedMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | | |
| | |
|
| | | // 本月到账
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanli);
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.hongbaoDeduct);
|
| | | vo.setMonthRecievedMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | | |
| | | |
| | |
|
| | | minDate = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(timeStamp, "yyyy-MM"), "yyyy-MM"));
|
| | | Calendar ca = Calendar.getInstance();
|
| | | ca.setTime(new Date(timeStamp));
|
| | |
| | | // 本月未到账
|
| | | BigDecimal monthUnRecievedMoney = hongBaoV2Service.getUnRecievedMoneyWithPreGetTime(uid, minDate, maxDate);
|
| | | vo.setMonthUnRecievedMoney(monthUnRecievedMoney);
|
| | | |
| | |
|
| | | // 全部未到账
|
| | | minDate = new Date(0);
|
| | | maxDate = new Date(timeStamp);
|
| | | vo.setTotalUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithCreateTime(uid, minDate, maxDate));
|
| | | |
| | |
|
| | | // 总的到账
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanli);
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.hongbao);
|
| | | typeList.add(UserMoneyDetailTypeEnum.hongbaoDeduct);
|
| | | typeList.add(UserMoneyDetailTypeEnum.subsidy);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderTeamDividents);
|
| | | typeList.add(UserMoneyDetailTypeEnum.teamReward);
|
| | | vo.setTotalRecievedMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | | }
|
| | | |
| | |
|
| | | minDate = new Date(0L);
|
| | | maxDate = new Date(timeStamp);
|
| | | |
| | |
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 总的自购返利
|
| | | typeList.clear();
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.orderReward);
|
| | | vo.setTotalFanLiMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | | |
| | |
|
| | | // 累计成功提现
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.extract);
|
| | |
| | | vo.setTotalExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | | }
|
| | | |
| | |
|
| | | // 总的分享赚
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.share);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | vo.setTotalShareMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | | |
| | |
|
| | | // 总的邀请赚
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.invite);
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.inviteAndShare);
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | typeList.add(UserMoneyDetailTypeEnum.subsidy);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderTeamDividents);
|
| | | typeList.add(UserMoneyDetailTypeEnum.teamReward);
|
| | | }
|
| | | |
| | | vo.setTotalInviteMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | | |
| | | |
| | |
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | | if (extractingMoney.compareTo(new BigDecimal(0)) > 0)
|
| | | vo.setExtractingMoneyInfo("提现中:¥" + extractingMoney.setScale(2, RoundingMode.HALF_UP));
|
| | | |
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()) && !VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
|
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())
|
| | | && !VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 获取是否绑定了微信
|
| | | if (!StringUtil.isNullOrEmpty(user.getWxUnionId())) {
|
| | | vo.setBindingWX(true);
|
| | |
| | | public enum UserMoneyDetailTypeEnum {
|
| | | share("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
|
| | | invite("团队奖金", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
|
| | | |
| | | inviteAndShare("奖金收入", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
|
| | | fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | fanliWeiQuan("返利扣除",
|
| | |
| | | extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | subsidy("额外补贴", "http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", ""),
|
| | | orderTeamDividents("团队分红", "http://img.flqapp.com/resource/msg/icon_msg_team_reward.png", "");
|
| | | |
| | | |
| | | teamReward("团队收益", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
|
| | | fanliNew("自购返利", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | orderRewardNew("返利再返", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
|
| | | shareNew("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
|
| | | systemEqualizeNew("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""),
|
| | | fanliWeiQuanNew("返利退回",
|
| | | "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
|
| | | "http://apph5.banliapp.com/AppPage/1.8.0/all_help_content.html?id=214"),
|
| | | extractNew("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractVerifyNew("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | systemTakeOff("系统扣除", "http://img.flqapp.com/resource/money_detail/icon_extract.png", "");
|
| | | |
| | | |
| | |
|
| | | private final String desc;
|
| | | private final String picture;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type, Date maxTime) {
|
| | | public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type,
|
| | | Date maxTime) {
|
| | | List<UserMoneyDetailHistoryVO> finalList = new ArrayList<>();
|
| | | List<UserMoneyDetail> list = null;
|
| | | if (userMoneyDetailId == null) {// 首次请求
|
| | | if (maxTime == null)// 没有筛选时间
|
| | | {
|
| | | Date date = new Date(System.currentTimeMillis() + 1000 * 60 * 60L);
|
| | | list = userMoneyDetailMapper.selectByMaxCreateTime(uid, date, 20, type);
|
| | | list = userMoneyDetailMapper.selectByMaxCreateTime(uid, date, 20, type);
|
| | | System.out.println("maxTime == null");
|
| | | } else {// 筛选了时间
|
| | | System.out.println("maxTime != null");
|
| | |
| | | } else {// 二次请求
|
| | |
|
| | | int size = 21;
|
| | | List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size, type);
|
| | | List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size,
|
| | | type);
|
| | | Set<Date> dateSet = new HashSet<>();// 用于储存是否在同一时间上面(精确到秒)
|
| | | if (tempList.size() > 0) {
|
| | | for (UserMoneyDetail umd : tempList) {
|
| | |
| | | inType = true;
|
| | | break;
|
| | | }
|
| | | if (inType)
|
| | | if (inType) {
|
| | | detail.setTitle(detail.getTitle() + "【" + Constant.getSourceName(detail.getOrderType()) + "】");
|
| | | }
|
| | | return detail;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId,Integer type, Date maxTime) {
|
| | | //TODO 增加type筛选
|
| | | public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type, Date maxTime) {
|
| | | // TODO 增加type筛选
|
| | | long monthCount = 0L;
|
| | | long detailCount = 0L;
|
| | | // 未通过时间筛选,查询所有
|
| | |
| | | BigDecimal money = userMoneyDetailMapper.getTotalMoneyByTypeAndUidWithDate(uid, list, minDate, maxDate, show);
|
| | | return money == null ? new BigDecimal(0) : money;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public UserMoneyDetail selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum type, Long uid,
|
| | | Long sourceIdentifyId) {
|
| | | return userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(type, uid, sourceIdentifyId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<UserMoneyDetail> listQuery(int page, int pageSize, String key, Integer keyType) {
|
| | | return userMoneyDetailMapper.listQuery((page - 1) * pageSize, pageSize, key, keyType);
|
| | |
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer keyType) {
|
| | | Long count = userMoneyDetailMapper.countQuery(key, keyType);
|
| | | if (count == null) {
|
| | | count = 0L;
|
| | | }
|
| | | return count;
|
| | | Long count = userMoneyDetailMapper.countQuery(key, keyType);
|
| | | if (count == null) {
|
| | | count = 0L;
|
| | | }
|
| | | return count;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | updateExtract.setId(id);
|
| | | updateExtract.setState(Extract.STATE_PROCESSING);
|
| | | extractMapper.updateByPrimaryKeySelective(updateExtract);
|
| | | // TODO 新版部署后删除
|
| | | // 改变资金记录状态
|
| | | UserMoneyDetail detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.extract, find.getUserInfo().getId(), find.getId());
|
| | |
| | | // 新版资金详情
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtract(extract);
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtract(extract, null);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | |
| | | if (payInfoList != null && payInfoList.size() > 0)
|
| | | alipayNo = payInfoList.get(0).getOrderId();
|
| | |
|
| | | UserMoneyDetail detailNew = null;
|
| | | try {
|
| | | detailNew = UserMoneyDetailFactory.createExtract(updateExtract, alipayNo);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 外显账户明细
|
| | | UserMoneyDetail userMoneyDetail = userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.extract, extract.getUserInfo().getId(), extract.getId());
|
| | | if (userMoneyDetail != null) {
|
| | | UserMoneyDetail detail = new UserMoneyDetail(userMoneyDetail.getId());
|
| | | detail.setShow(true);
|
| | | detail.setUpdateTime(new Date());
|
| | | if (detailNew != null)
|
| | | detail.setDescInfo(detailNew.getDescInfo());
|
| | | userMoneyDetailMapper.updateByPrimaryKeySelective(detail);
|
| | | }
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.extractSuccess(extract, alipayNo);
|
| | | }
|
| | |
| | |
|
| | | // 更新提现记录审核表
|
| | | extractAuditRecordMapper.updateByPrimaryKeySelective(auditRecord);
|
| | | }
|
| | |
|
| | | // 外显账户明细
|
| | | UserMoneyDetail userMoneyDetail = userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.extract, extract.getUserInfo().getId(), extract.getId());
|
| | | if (userMoneyDetail != null) {
|
| | | UserMoneyDetail detail = new UserMoneyDetail(userMoneyDetail.getId());
|
| | | detail.setShow(true);
|
| | | detail.setUpdateTime(new Date());
|
| | | userMoneyDetailMapper.updateByPrimaryKeySelective(detail);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.HashSet;
|
| | |
| | | if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | // 添加新版详情记录
|
| | | try {
|
| | | // 计算本月的有效订单,失效订单,维权订单
|
| | | Calendar ca = Calendar.getInstance();
|
| | |
|
| | | Date maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | Date minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS,
|
| | | minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO);
|
| | | long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ,
|
| | | minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO);
|
| | |
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, Constant.SOURCE_TYPE_TAOBAO,
|
| | | (int) validCount, (int) weiQuanCount, sharemoney, new Date());
|
| | | sharemoney, new Date());
|
| | | // 添加资金
|
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
|
| | |
|
| | |
| | | if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | // 添加新版详情记录
|
| | | try {
|
| | | // 计算本月的有效订单,失效订单,维权订单
|
| | | Calendar ca = Calendar.getInstance();
|
| | |
|
| | | Date maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | Date minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS,
|
| | | minDate, maxDate, sourceType);
|
| | | long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ,
|
| | | minDate, maxDate, sourceType);
|
| | |
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, (int) validCount,
|
| | | (int) weiQuanCount, sharemoney, new Date());
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, sharemoney,
|
| | | new Date());
|
| | | // 添加资金
|
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
|
| | |
|
| | |
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void inviteSubsidySettle(Long uid, String taskKey,Date maxPreGetTime)
|
| | | public void inviteSubsidySettle(Long uid, String taskKey, Date maxPreGetTime)
|
| | | throws OrderMoneySettleException, TeamEincomeRecordException, ParamsException {
|
| | | teamSubsidyManager.addToTeamEincome(uid, taskKey,maxPreGetTime);
|
| | | teamSubsidyManager.addToTeamEincome(uid, taskKey, maxPreGetTime);
|
| | | }
|
| | |
|
| | | private String getTaskKey(Long uid) {
|
| | |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | |
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteService userInviteService;
|
| | |
|
| | |
| | | return userSystemCouponMapper.countUserCouponList(uid);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public UserSystemCoupon freeCouponWin(Long uid, CouponTypeEnum typeEnum, String source, int num, boolean notify) throws UserSystemCouponException, Exception{
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public UserSystemCoupon freeCouponWin(Long uid, CouponTypeEnum typeEnum, String source, int num, boolean notify)
|
| | | throws UserSystemCouponException, Exception {
|
| | | if (typeEnum == null || uid == null || StringUtil.isNullOrEmpty(source) || num < 1) {
|
| | | throw new UserSystemCouponException(1, "参数不正确");
|
| | | }
|
| | | |
| | |
|
| | | SystemCoupon coupon = systemCouponService.getCouponByType(typeEnum.name());
|
| | | if (coupon == null) {
|
| | | throw new UserSystemCouponException(1, "券类型不正确");
|
| | | }
|
| | | |
| | |
|
| | | // 激活状态
|
| | | int stateActivated = 0;
|
| | | // 自购免单券、赠送免单券可直接使用
|
| | | if (coupon.getType() == CouponTypeEnum.freeCouponBuy || coupon.getType() == CouponTypeEnum.freeCouponGive) {
|
| | | stateActivated = 1;
|
| | | }
|
| | | |
| | |
|
| | | // 有效时长
|
| | | Integer expiryDay = null;
|
| | | if (stateActivated == 0)
|
| | | expiryDay = coupon.getActivateDay();
|
| | | if (expiryDay == null || expiryDay == 0)
|
| | | expiryDay = coupon.getExpiryDay();
|
| | | |
| | |
|
| | | // 计算结束日期
|
| | | Date nowTime = new Date();
|
| | | String endDay = DateUtil.plusDay(expiryDay - 1, nowTime);
|
| | |
| | | endDay += " 23:59:59";
|
| | | }
|
| | | Date endTime = format.parse(endDay);
|
| | | |
| | |
|
| | | UserSystemCoupon userSystemCoupon = null;
|
| | | for (int i = 0; i < num; i ++) {
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | for (int i = 0; i < num; i++) {
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | userCoupon.setUid(uid);
|
| | | userCoupon.setSource(source);
|
| | | userCoupon.setSystemCoupon(coupon);
|
| | |
| | | if (typeEnum == CouponTypeEnum.freeCoupon) {
|
| | | userSystemCouponActivateService.addActivateRecord(userCoupon.getId());
|
| | | }
|
| | | |
| | |
|
| | | if (num == 1) {
|
| | | userSystemCoupon = userCoupon;
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() { |
| | | public void run() {
|
| | | if (notify) { // 消息推送
|
| | | try {
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, typeEnum.getDesc(), source, |
| | | num, "成功获得", nowTime, endTime);
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, typeEnum.getDesc(), source, num, "成功获得",
|
| | | nowTime, endTime);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 福利中心红点
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null) {
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | updateExtra.setId(extra.getId());
|
| | | if (extra.getCouponNews() == null) {
|
| | | updateExtra.setCouponNews(1);
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | return userSystemCoupon;
|
| | |
|
| | | return userSystemCoupon;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public UserSystemCoupon rewardCouponWin(Long uid, String source, int num, boolean notify, |
| | | BigDecimal percent) throws UserSystemCouponException, Exception{
|
| | | if (uid == null || percent == null|| StringUtil.isNullOrEmpty(source) || num < 1) {
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public UserSystemCoupon rewardCouponWin(Long uid, String source, int num, boolean notify, BigDecimal percent)
|
| | | throws UserSystemCouponException, Exception {
|
| | | if (uid == null || percent == null || StringUtil.isNullOrEmpty(source) || num < 1) {
|
| | | throw new UserSystemCouponException(1, "参数不正确");
|
| | | }
|
| | | |
| | |
|
| | | String name = CouponTypeEnum.rebatePercentCoupon.name();
|
| | | SystemCoupon coupon = systemCouponService.getCouponByTypeAndPercent(name, percent);
|
| | | if (coupon == null) {
|
| | | throw new UserSystemCouponException(1, "券类型不正确");
|
| | | }
|
| | | |
| | |
|
| | | // 计算结束日期
|
| | | Date nowTime = new Date();
|
| | | Integer expiryDay = coupon.getExpiryDay();
|
| | |
| | | endDay += " 23:59:59";
|
| | | }
|
| | | Date endTime = format.parse(endDay);
|
| | | |
| | |
|
| | | UserSystemCoupon userSystemCoupon = null;
|
| | | for (int i = 0; i < num; i ++) {
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | for (int i = 0; i < num; i++) {
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | userCoupon.setUid(uid);
|
| | | userCoupon.setSource(source);
|
| | | userCoupon.setSystemCoupon(coupon);
|
| | |
| | | userSystemCouponMapper.insertSelective(userCoupon);
|
| | | if (num == 1) {
|
| | | userSystemCoupon = userCoupon;
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() { |
| | | public void run() {
|
| | | if (notify) { // 消息推送
|
| | | try {
|
| | | userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, num, "成功获得", nowTime, endTime);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 福利中心红点
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null) {
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | updateExtra.setId(extra.getId());
|
| | | if (extra.getCouponNews() == null) {
|
| | | updateExtra.setCouponNews(1);
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | return userSystemCoupon;
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | return userSystemCoupon;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid, boolean changeJump)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
| | | return hasCoupon;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getOrderCouponList(Long uid) throws UserSystemCouponException, Exception {
|
| | |
|
| | |
| | | return getEnableListByCouponId(uid, 1, couponList);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
| | |
|
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public long countGiveFreeCoupon(Long uid) {
|
| | | if (uid == null)
|
| | |
| | |
|
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public long countUsableRewardCoupon(Long uid) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (weiquan) {
|
| | | throw new UserSystemCouponException(1, "亲,很遗憾,售后维权订单不能使用返利奖励券~");
|
| | | }
|
| | |
|
| | | |
| | | // 订单
|
| | | List<CommonOrderVO> listVo = commonOrderService.listGroupOrderNoByUid(0, 1, uid, 2, 1,1, orderNo, null, |
| | | null, null, sourceType);
|
| | | if (listVo == null || listVo.size() == 0) |
| | | List<CommonOrderVO> listVo = commonOrderService.listGroupOrderNoByUid(0, 1, uid, 2, 1, 1, orderNo, null, null,
|
| | | null, sourceType);
|
| | | if (listVo == null || listVo.size() == 0)
|
| | | throw new UserSystemCouponException(1, "亲,很遗憾,该订单已不能使用返利奖励券~");
|
| | | |
| | |
|
| | | CommonOrderVO orderVO = listVo.get(0);
|
| | | |
| | |
|
| | | // 2.1新版
|
| | | Date thirdCreateTime = orderVO.getThirdCreateTime();
|
| | | Date accountTime = orderVO.getAccountTime();
|
| | | if (thirdCreateTime == null || accountTime == null) |
| | | if (thirdCreateTime == null || accountTime == null)
|
| | | throw new UserSystemCouponException(1, "该订单不能使用奖励券");
|
| | | |
| | |
|
| | | long downOrderTime = thirdCreateTime.getTime();
|
| | | long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
|
| | | if (downOrderTime > limitDate) {
|
| | |
| | | valid = true;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (!valid)
|
| | | throw new UserSystemCouponException(1, "该订单不能使用奖励券");
|
| | | }
|
| | |
| | |
|
| | | UserSystemCouponUseMQMsg mqMsg = new UserSystemCouponUseMQMsg(userSystemCoupon.getId(), order.getOrderId(),
|
| | | sourceType, systemCoupon.getType().name());
|
| | | |
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
|
| | | } else { // 事务消息
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
|
| | | Order order) throws Exception {
|
| | | org.springframework.transaction.TransactionStatus transactionStatus = transactionManager
|
| | |
| | | // 2.插入关联
|
| | | orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
|
| | |
|
| | | // 计算该订单原有返利
|
| | | List<HongBaoOrder> hongBaoOrderlist = hongBaoOrderService
|
| | | .listDetailByOrderIdAndSourceType(order.getOrderId(), order.getOrderType());
|
| | | BigDecimal originalMoney = new BigDecimal(0);
|
| | | if (hongBaoOrderlist != null)
|
| | | for (HongBaoOrder ho : hongBaoOrderlist) {
|
| | | if (ho.getHongBaoV2() != null && ho.getHongBaoV2().getState() == HongBaoV2.STATE_YILINGQU)
|
| | | originalMoney = originalMoney.add(ho.getHongBaoV2().getMoney());
|
| | | }
|
| | |
|
| | | // 3.插入资金明细,用户余额
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(order.getOrderId(),
|
| | | order.getOrderType(), money, new UserInfo(uid));
|
| | | order.getOrderType(), money, originalMoney, new UserInfo(uid));
|
| | | userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
|
| | | userInfoService.addMoney(new UserInfo(uid), money);
|
| | |
|
| | |
| | | return userRecordVO;
|
| | | }
|
| | |
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void updateStateByDrawback(String orderNo) throws Exception {
|
| | |
|
| | |
| | | sendBackCoupon(record.getUserSystemCoupon(), record);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void updateStateByArrivalAccount(String orderNo) throws Exception {
|
| | |
|
| | |
| | | record.setState(UserSystemCouponRecord.STATE_SUCCESS);
|
| | | userSystemCouponRecordService.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<UserSystemCoupon> getCounponNowInvalid(int count) {
|
| | | return userSystemCouponMapper.getCounponNowInvalid(count);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long auctionId)
|
| | | throws Exception {
|
| | |
| | | return isfree;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 随机券比例
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent)
|
| | | throws UserSystemCouponException, Exception {
|
| | | if (couponType == null || uid == null) {
|
| | |
| | | insertSelective(userCoupon);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getCouponList(AcceptData acceptData, long start, int count, Long uid)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | |
| | | try { // 消息推送
|
| | | Long uid = userCoupon.getUid();
|
| | | String source = userCoupon.getSource();
|
| | | if (baseCoupon.getType() == CouponTypeEnum.freeCoupon || baseCoupon.getType() == CouponTypeEnum.freeCouponBuy) {
|
| | | userOtherMsgNotificationService.freeCouponEndMsg(uid, "自购免单券", source, 1, "已过期");
|
| | | } else if (baseCoupon.getType() == CouponTypeEnum.freeCouponGive) {
|
| | | userOtherMsgNotificationService.freeCouponEndMsg(uid, "赠送免单券", source, 1, "已过期");
|
| | | } if (baseCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
|
| | | userOtherMsgNotificationService.rewardCouponEndMsg(uid, source, 1, "已过期");
|
| | | if (baseCoupon.getType() == CouponTypeEnum.freeCoupon
|
| | | || baseCoupon.getType() == CouponTypeEnum.freeCouponBuy) {
|
| | | userOtherMsgNotificationService.freeCouponEndMsg(uid, "自购免单券", source, 1, "已过期");
|
| | | } else if (baseCoupon.getType() == CouponTypeEnum.freeCouponGive) {
|
| | | userOtherMsgNotificationService.freeCouponEndMsg(uid, "赠送免单券", source, 1, "已过期");
|
| | | }
|
| | | if (baseCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
|
| | | userOtherMsgNotificationService.rewardCouponEndMsg(uid, source, 1, "已过期");
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | | Long uid = userCoupon.getUid();
|
| | | String source = userCoupon.getSource();
|
| | | Date startTime = userCoupon.getStartTime();
|
| | | if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType()) |
| | | if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())
|
| | | || CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, "自购免单券", source, 1, "使用退回", startTime, endTime);
|
| | | }
|
| | |
| | | String source = userCoupon.getSource();
|
| | | CouponTypeEnum type = systemCoupon.getType();
|
| | | if (CouponTypeEnum.freeCouponGive == type) {
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回", |
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回",
|
| | | userCoupon.getStartTime(), userCoupon.getEndTime());
|
| | | } else if (CouponTypeEnum.rebatePercentCoupon == systemCoupon.getType()) {
|
| | | userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回",
|
| | | userCoupon.getStartTime(), userCoupon.getEndTime());
|
| | | userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回", userCoupon.getStartTime(),
|
| | | userCoupon.getEndTime());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | String source = userCoupon.getSource();
|
| | | CouponTypeEnum type = systemCoupon.getType();
|
| | | if (CouponTypeEnum.freeCouponGive == type) {
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回", |
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回",
|
| | | userCoupon.getStartTime(), userCoupon.getEndTime());
|
| | | } else if (CouponTypeEnum.rebatePercentCoupon == systemCoupon.getType()) {
|
| | | userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回",
|
| | | userCoupon.getStartTime(), userCoupon.getEndTime());
|
| | | userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回", userCoupon.getStartTime(),
|
| | | userCoupon.getEndTime());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public boolean getValidRebateCoupon(Long uid) {
|
| | | // 过期券
|
| | | updateInvalidSate(uid);
|
| | | |
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid, CouponTypeEnum.rebatePercentCoupon.name());
|
| | |
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid,
|
| | | CouponTypeEnum.rebatePercentCoupon.name());
|
| | | if (listCoupon == null || listCoupon.size() == 0)
|
| | | return false;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserSystemCouponVO> listIncludeNotExchange(Long uid) throws Exception {
|
| | |
| | | // 退回券
|
| | | sendBackTimeOutCoupon(uid);
|
| | |
|
| | |
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid, CouponTypeEnum.rebatePercentCoupon.name());
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid,
|
| | | CouponTypeEnum.rebatePercentCoupon.name());
|
| | | if (listCoupon == null || listCoupon.size() == 0)
|
| | | return null;
|
| | |
|
| | |
| | | public void run() {
|
| | | Long uid = coupon.getUid();
|
| | | String source = coupon.getSource();
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, "自购免单券", source, 1,
|
| | | "激活成功", nowDate, endTime);
|
| | | userOtherMsgNotificationService.freeCouponWinMsg(uid, "自购免单券", source, 1, "激活成功", nowDate, endTime);
|
| | | }
|
| | | });
|
| | | } catch (Exception e) {
|
| | |
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.exception.ParamsException;
|
| | | import com.yeshi.fanli.exception.money.TeamEincomeRecordException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.service.inter.money.TeamEincomeRecordService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.factory.money.TeamEincomeRecordFactory;
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * @throws UserMoneyDetailException |
| | | * 到账到用户余额
|
| | | * @Title: addTOUserAccount
|
| | | * @Description:
|
| | |
| | | * @throws
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addTOUserAccount(Date preSendTime, Long uid) {
|
| | | public void addTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | | Date now = new Date();
|
| | | List<TeamEincomeRecord> list = teamEincomeRecordService.listCanRecieveRecord(preSendTime, uid);
|
| | | BigDecimal money = new BigDecimal(0);
|
| | |
| | | teamEincomeRecordService.setRecieved(record.getId());
|
| | | }
|
| | |
|
| | | // TODO 到账
|
| | | UserMoneyDetail detail = null;
|
| | | UserMoneyDetail detail = UserMoneyDetailFactory.createTeamReward(uid, money, preSendTime);
|
| | |
|
| | | userMoneyService.addUserMoney(uid, money, detail);
|
| | | // 发送消息
|
| | | BigDecimal balance = userMoneyService.getBalance(uid);
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addDividentsSourceOrder(List<CommonOrder> commonOrderList) throws TeamDividentsSourceOrderException {
|
| | | if (commonOrderList.get(0).getThirdCreateTime().getTime() < Constant.NEW_ORDER_FANLI_RULE_TIME)
|
| | | return;
|
| | |
|
| | | UserLevelEnum level = UserLevelUtil.getByOrderRank(commonOrderList.get(0).getUrank());
|
| | | if (level == null)
|
| | | level = UserLevelEnum.daRen;
|
| | |
| | | } catch (ParamsException e) {
|
| | | throw new TeamDividentsSourceOrderException(101, "参数不完整");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | public static String getInviteCode(int base, Long uid) {
|
| | |
|
| | | long num = base * 100000000L + uid ;
|
| | | long num = base * 100000000L + uid;
|
| | |
|
| | | return convert10To36(num);
|
| | | }
|
| | |
| | | return account;
|
| | | }
|
| | |
|
| | | public static String filterAlipayName(String name) {
|
| | | String st = "";
|
| | | for (int i = 0; i < name.length(); i++) {
|
| | | if (i == 0)
|
| | | st += name.charAt(i);
|
| | | else
|
| | | st += "*";
|
| | | }
|
| | | return st;
|
| | | }
|
| | |
|
| | | public static String filterOrderId(String orderId) {
|
| | | if (orderId == null || orderId.length() <= 6)
|
| | | return orderId;
|
| | |
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbIds));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanli);
|
| | | detail.setDescInfo("订单号:" + orderId);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanliNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanliNew);
|
| | | detail.setDescInfo(Constant.getSourceName(orderType) + ":" + orderId);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | detail.setOrderType(orderType);
|
| | |
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createShare(Long uid, int orderType, int validCount, int weiQuanCount,
|
| | | BigDecimal money, Date time) throws UserMoneyDetailException {
|
| | | public static UserMoneyDetail createShare(Long uid, int orderType, BigDecimal money, Date time)
|
| | | throws UserMoneyDetailException {
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "返利金额为空");
|
| | |
|
| | |
| | | ca.setTime(time);
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
|
| | | String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.share.name() + "-" + orderType + "-" + uid + "-" + timeF));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(timeF + UserMoneyDetailTypeEnum.share.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.share);
|
| | | detail.setDescInfo(String.format("有效订单:%s笔 维权订单:%s笔", validCount, weiQuanCount));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.shareNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.shareNew);
|
| | | detail.setDescInfo(Constant.getSourceName(orderType) + ":" + timeF);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | detail.setOrderType(orderType);
|
| | |
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuanNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuanNew);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + drawBack.getOrderId());
|
| | | detail.setDescInfo(
|
| | | Constant.getSourceName(Constant.SOURCE_TYPE_TAOBAO) + ":" + drawBack.getOrderId() + "-部分商品售后");
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | |
| | | * @param extract
|
| | | * @return
|
| | | */
|
| | | public static UserMoneyDetail createExtract(Extract extract) throws UserMoneyDetailException {
|
| | | public static UserMoneyDetail createExtract(Extract extract, String alipayNo) throws UserMoneyDetailException {
|
| | | if (extract == null)
|
| | | throw new UserMoneyDetailException(1, "提现记录不能为空");
|
| | | if (extract.getId() == null)
|
| | |
| | | if (extract.getUserInfo() == null || extract.getUserInfo().getId() == null)
|
| | | throw new UserMoneyDetailException(1, "提现用户不能为空");
|
| | |
|
| | | if (alipayNo != null && alipayNo.length() > 10)
|
| | | alipayNo = "*" + alipayNo.substring(alipayNo.length() - 10, alipayNo.length());
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extract.name() + ":" + extract.getId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(extract.getMoney()));
|
| | | detail.setSourceIdentifyId(extract.getId());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extract.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extract);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractNew);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setDescInfo("支付宝订单号:" + alipayNo);
|
| | | detail.setUserInfo(extract.getUserInfo());
|
| | | detail.setShow(false);
|
| | | return detail;
|
| | |
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractVerify.name() + ":" + aa.getId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setSourceIdentifyId(aa.getId());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractVerify.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractVerify);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractVerifyNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractVerifyNew);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(aa.getUid()));
|
| | | detail.setDescInfo(String.format("支付宝:%s -姓名-%s", UserUtil.filterAlipayAccount(aa.getAccount()),
|
| | | UserUtil.filterAlipayName(aa.getName())));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 系统扣除
|
| | | * @Title: createSystemTakeOff
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param money
|
| | | * @param desc
|
| | | * @return
|
| | | * @throws UserMoneyDetailException |
| | | * UserMoneyDetail 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static UserMoneyDetail createSystemTakeOff(Long uid, BigDecimal money, String desc)
|
| | | throws UserMoneyDetailException {
|
| | | if (uid == null)
|
| | | throw new UserMoneyDetailException(1, "UID不能为空");
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "金额不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(uid + "-" + UserMoneyDetailTypeEnum.systemTakeOff.name() + System.currentTimeMillis()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.systemTakeOff.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.systemTakeOff);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | detail.setDescInfo(desc);
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createOrderReward(String orderId, int orderType, BigDecimal money, UserInfo user)
|
| | | throws UserMoneyDetailException {
|
| | | public static UserMoneyDetail createOrderReward(String orderId, int orderType, BigDecimal money,
|
| | | BigDecimal originalMoney, UserInfo user) throws UserMoneyDetailException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | | throw new UserMoneyDetailException(1, "订单号不能为空");
|
| | | if (user == null)
|
| | |
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + "老版本" + "-" + orderId));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.orderReward.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.orderReward);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.orderRewardNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.orderRewardNew);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(user);
|
| | | detail.setOrderType(orderType);
|
| | | detail.setDescInfo("订单号:" + orderId);
|
| | | detail.setDescInfo(Constant.getSourceName(orderType) + ":" + orderId + "-原返利:" + originalMoney);
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | detail.setIdentifyCode(StringUtil.Md5(
|
| | | UserMoneyDetailTypeEnum.systemEqualize.name() + "-" + System.currentTimeMillis() + "-" + user.getId()));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.systemEqualize.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.systemEqualize);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.systemEqualizeNew.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.systemEqualizeNew);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(user);
|
| | | if (!StringUtil.isNullOrEmpty(desc)) {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 团队分红
|
| | | * @Title: createOrderTeamDividents
|
| | | * 团队收益
|
| | | * @Title: createTeamReward
|
| | | * @Description:
|
| | | * @param uid
|
| | | * @param money
|
| | |
| | | * UserMoneyDetail 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static UserMoneyDetail createOrderTeamDividents(Long uid, BigDecimal money, Date time)
|
| | |
|
| | | public static UserMoneyDetail createTeamReward(Long uid, BigDecimal money, Date time)
|
| | | throws UserMoneyDetailException {
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "返利金额为空");
|
| | |
| | | ca.setTime(time);
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
|
| | | String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.orderTeamDividents.name() + "-" + uid + "-" + timeF));
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.teamReward.name() + "-" + uid + "-" + timeF));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(timeF + UserMoneyDetailTypeEnum.orderTeamDividents.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.orderTeamDividents);
|
| | | detail.setDescInfo("团队分红");
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.teamReward.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.teamReward);
|
| | | detail.setDescInfo(timeF);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | return detail;
|