Merge remote-tracking branch 'origin/div' into div
| | |
| | | @Resource |
| | | private AdminUserService adminUserService; |
| | | |
| | | // @Around("execution(public * com.yeshi.fanli.controller.admin..*.*(..))") |
| | | @Around("execution(public * com.yeshi.fanli.controller.admin..*.*(..))") |
| | | public Object verifyLoginState(ProceedingJoinPoint joinPoint) throws IOException { |
| | | |
| | | Signature signature = joinPoint.getSignature(); |
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | // 邀请成功时间
|
| | | Long succeedTime = threeSale.getSucceedTime();
|
| | | if (succeedTime == null) {
|
| | |
| | | array.add(loginJson);
|
| | |
|
| | | // 查询粉丝等级
|
| | | UserInviteLevelEnum level = null;
|
| | | UserLevelEnum level = null;
|
| | | UserInviteLevelEnum inviteLevel = null;
|
| | | UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(workerId);
|
| | | if (vipLevel != null) {
|
| | | if (vipLevel.getLevel() == UserVIPLevel.LEVEL_3) {
|
| | | level = UserInviteLevelEnum.actived;
|
| | | } else if (vipLevel.getLevel() == UserVIPLevel.LEVEL_7) {
|
| | | level = UserInviteLevelEnum.actived;
|
| | | } else if (vipLevel.getLevel() == UserVIPLevel.LEVEL_10) {
|
| | | level = UserInviteLevelEnum.actived;
|
| | | if (vipLevel != null && vipLevel.getLevelEnum() != null) {
|
| | | inviteLevel = vipLevel.getLevelEnum();
|
| | | if (UserInviteLevelEnum.vipPre1 == inviteLevel) {
|
| | | level = UserLevelEnum.normalVIP;
|
| | | } else if (UserInviteLevelEnum.vipPre2 == inviteLevel || UserInviteLevelEnum.vipApply == inviteLevel) {
|
| | | level = UserLevelEnum.highVIP;
|
| | | inviteLevel = UserInviteLevelEnum.vipPre2;
|
| | | } else if (UserInviteLevelEnum.vip == inviteLevel || UserInviteLevelEnum.tearcherApply == inviteLevel) {
|
| | | level = UserLevelEnum.superVIP;
|
| | | inviteLevel = UserInviteLevelEnum.vip;
|
| | | } else if (UserInviteLevelEnum.tearcher == inviteLevel ) {
|
| | | level = UserLevelEnum.tearcher;
|
| | | }
|
| | | }
|
| | |
|
| | | if(level == null) {
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | level = UserInviteLevelEnum.noActive;
|
| | | } else {
|
| | | level = UserInviteLevelEnum.actived;
|
| | | }
|
| | | level = UserLevelEnum.daRen;
|
| | | }
|
| | | |
| | | if (inviteLevel == null) {
|
| | | inviteLevel = UserInviteLevelEnum.actived;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | object.put("inviteTime", format.format(new Date(succeedTime)) + " 加入");
|
| | | object.put("state", state? 1 : 2);
|
| | | object.put("recentMsg", array);
|
| | | object.put("level", level.name());
|
| | | object.put("level", inviteLevel.name());
|
| | | object.put("validFans", validFans);
|
| | |
|
| | |
|
| | |
| | |
|
| | | String shareRate = "可享佣金的<label style=\"color:#E5005C;\">%s</label>";
|
| | | String fansRate = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
|
| | | String fansIndirect = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
|
| | | String teamBonus = "可享佣金的<label style=\"color:#E5005C;\">%s</label>";
|
| | | String fansIndirect = "团队分红池<label style=\"color:#E5005C;\">%s</label>";
|
| | | String teamBonus = "团队分红池<label style=\"color:#E5005C;\">%s</label>";
|
| | | // 达人版
|
| | | JSONObject jsonrRed1 = new JSONObject();
|
| | | jsonrRed1.put("shareRate", String.format(shareRate, "152%"));
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.ESOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | |
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.CurrentBonusVO;
|
| | | import com.yeshi.fanli.vo.order.GoodsRebateVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | | @Resource
|
| | | private OrderHongBaoMapService orderHongBaoMapService;
|
| | |
|
| | | /**
|
| | | * 订单列表
|
| | |
| | | BigDecimal weiQuanMoney = commonOrderService.getWeiQuanMoney(listWQ, sourceType, uid);
|
| | |
|
| | | orderRebateVO.setWq(true);
|
| | | orderRebateVO.setWqMoney("-¥"+ weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN));
|
| | | orderRebateVO.setWqMoney("¥"+ weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN));
|
| | | if (hongBao.compareTo(weiQuanMoney) > 0) {
|
| | | orderRebateVO.setWqDesc("部分售后退回");
|
| | | } else {
|
| | |
| | | UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(hongBaoV2.getUrank());
|
| | | if (userLevel == null)
|
| | | userLevel = UserLevelEnum.daRen;
|
| | | |
| | | UserLevelEnum upperLevel = UserLevelUtil.getNextLevel(userLevel);
|
| | | |
| | | UserLevelEnum upperLevel = UserLevelEnum.superVIP;
|
| | | |
| | | BigDecimal upperTotalMoney = new BigDecimal(0);
|
| | | List<GoodsRebateVO> voList = new ArrayList<>();
|
| | | for (HongBaoOrder hongBaoOrder : hoList) {
|
| | |
| | | if (payment == null)
|
| | | payment = new BigDecimal(0);
|
| | | goodsVO.setActualPay("¥" + payment.setScale(2));
|
| | |
|
| | |
|
| | | BigDecimal commission = orderHongBaoMoneyComputeService.computeBaseFanliMoney(commonOrder);
|
| | | if (type == 3) { // 奖金
|
| | | goodsVO.setBonus(hongBaoOrder.getHongBaoV2().getMoney() +"");
|
| | | goodsVO.setBonus("¥" + hongBaoOrder.getHongBaoV2().getMoney() +"");
|
| | | } else { // 佣金
|
| | | goodsVO.setCommision("¥" +commission);
|
| | | }
|
| | |
|
| | | // 平台补贴
|
| | | BigDecimal vipFanli = hongBaoOrder.getHongBaoV2().getMoney();
|
| | | goodsVO.setSubsidy(vipFanli.subtract(commission).setScale(2) + "");
|
| | | goodsVO.setSubsidy("¥" + vipFanli.subtract(commission).setScale(2));
|
| | | // 达人补贴
|
| | | if (userLevel != UserLevelEnum.daRen) {
|
| | | BigDecimal darenFanli = orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, UserLevelEnum.daRen);
|
| | |
| | | }
|
| | |
|
| | | voList.add(goodsVO);
|
| | | if (upperLevel != null) {
|
| | | upperTotalMoney = upperTotalMoney
|
| | | .add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel));
|
| | | }
|
| | | |
| | | upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel));
|
| | | }
|
| | |
|
| | | // 团队补贴
|
| | |
| | | orderRebateVO.setOriginSubsidy("¥" + lowerSubsidy.setScale(2));
|
| | | }
|
| | | orderRebateVO.setSubsidyDesc("团队补贴");
|
| | | orderRebateVO.setSubsidy(teamSubsidy.setScale(2) +"");
|
| | | orderRebateVO.setSubsidy("¥" + teamSubsidy.setScale(2) +"");
|
| | | }
|
| | |
|
| | | orderRebateVO.setType(type);
|
| | | orderRebateVO.setStateDesc(stateDesc);
|
| | | orderRebateVO.setListGoods(voList);
|
| | | orderRebateVO.setUserLevel(userLevel.name());
|
| | |
|
| | | // 上级返利
|
| | | if (upperLevel != null) {
|
| | | orderRebateVO.setUpperFanLi("¥" + upperTotalMoney);
|
| | | orderRebateVO.setUserLevel(upperLevel.name());
|
| | | orderRebateVO.setJumpLink(upperLevel.getDetailLink());
|
| | | }
|
| | |
|
| | | // 奖励券使用
|
| | | Date accountTime = hongBaoCountVO.getAccountTime();
|
| | | if (accountTime != null) {
|
| | | boolean vip = userInviteService.verifyVIP(uid);
|
| | | Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime);
|
| | | long currentTime = java.lang.System.currentTimeMillis();
|
| | | if (endDay.getTime() > currentTime && !vip) {
|
| | | UserSystemCouponRecord couponRecord = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null);
|
| | | if (couponRecord == null |
| | | || (couponRecord.getCouponType() == CouponTypeEnum.rebatePercentCoupon.name() && couponRecord.getState() != UserSystemCouponRecord.STATE_SUCCESS)) {
|
| | | orderRebateVO.setCoupon(true);
|
| | | int freeState = 0;
|
| | | boolean rewardSuccess = false;
|
| | | List<String> listNo = new ArrayList<String>();
|
| | | listNo.add(orderNo);
|
| | | List<UserSystemCouponRecord> useRecord = userSystemCouponRecordService.getRecordByOrderNoList(sourceType, listNo);
|
| | | if (useRecord != null && useRecord.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : useRecord) {
|
| | | Integer state = couponRecord.getState();
|
| | | String cType = couponRecord.getCouponType();
|
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(cType) && UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | rewardSuccess = true;
|
| | | break;
|
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(cType) || CouponTypeEnum.welfareFreeCoupon.name().equals(cType)
|
| | | || CouponTypeEnum.freeCouponBuy.name().equals(cType)) {
|
| | | freeState = state;
|
| | | break;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | |
| | | if (rewardSuccess) { // 已使用奖励券
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("orderNo", orderNo);
|
| | | params.put("goodsType", sourceType + "");
|
| | | BigDecimal couponMoney = orderHongBaoMapService.getCouponHongbaoByOrderNo(orderNo, uid);
|
| | | if (couponMoney == null) {
|
| | | couponMoney = new BigDecimal(0);
|
| | | }
|
| | | orderRebateVO.setCouponType(1);
|
| | | orderRebateVO.setCouponUse(true);
|
| | | orderRebateVO.setCouponText("奖励成功");
|
| | | orderRebateVO.setCouponDesc("已再返¥" +couponMoney.setScale(2));
|
| | | orderRebateVO.setCouponParams(params.toString());
|
| | | orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | | } else if (freeState > 0) { // 已使用免单券
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("orderNo", orderNo);
|
| | | params.put("goodsType", sourceType + "");
|
| | | orderRebateVO.setCouponType(2);
|
| | | orderRebateVO.setCouponUse(true);
|
| | | orderRebateVO.setCouponParams(params.toString());
|
| | | orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
|
| | | if (UserSystemCouponRecord.STATE_FREE_ON == freeState) {
|
| | | orderRebateVO.setCouponText("免单中");
|
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == freeState) {
|
| | | orderRebateVO.setCouponText("免单成功");
|
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == freeState
|
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == freeState) {
|
| | | orderRebateVO.setCouponText("免单失败");
|
| | | }
|
| | | } else {
|
| | | Date accountTime = hongBaoV2.getGetTime();
|
| | | if (accountTime != null) { |
| | | boolean vip = userInviteService.verifyVIP(uid);
|
| | | Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime);
|
| | | long currentTime = java.lang.System.currentTimeMillis();
|
| | | if (endDay.getTime() > currentTime && !vip) {
|
| | | UserSystemCouponRecord couponRecord = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null);
|
| | | if (couponRecord == null |
| | | || (couponRecord.getCouponType() == CouponTypeEnum.rebatePercentCoupon.name() && couponRecord.getState() != UserSystemCouponRecord.STATE_SUCCESS)) {
|
| | | orderRebateVO.setCoupon(true);
|
| | | orderRebateVO.setCouponType(1);
|
| | | orderRebateVO.setCouponText("立即使用");
|
| | | orderRebateVO.setCouponDesc("返利再返");
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public final static int STATE_SX = 4;// 未付款/已退款
|
| | |
|
| | | public enum MsgTypeOrderTypeEnum {
|
| | | fanli("返利订单被统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | share("分享订单被统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | invite("团队订单被统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | fanli("订单统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | share("订单统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | invite("订单统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | found("订单找回", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), // 老版
|
| | | foundSucceed("订单找回成功", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | foundFail("订单找回失败", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | foundSucceed("订单找回", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | foundFail("订单找回", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | elme("饿了么订单", "http://img.flqapp.com/resource/msg/icon_msg_order.png");
|
| | |
|
| | | private final String desc;
|
| | |
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class MsgMoneyDetailServiceImpl implements MsgMoneyDetailService {
|
| | |
| | |
|
| | | @Override
|
| | | public void addMsgMoneyDetail(MsgMoneyDetail detail) throws MsgMoneyDetailException {
|
| | | if (detail == null)
|
| | | throw new MsgMoneyDetailException(1, "消息为空");
|
| | | if (detail == null || detail.getUser() == null || StringUtil.isNullOrEmpty(detail.getExtraInfo()))
|
| | | throw new MsgMoneyDetailException(1, "消息信息不全");
|
| | | if (detail.getMsgType() == MsgTypeMoneyTypeEnum.extract) {
|
| | | if (detail.getExtract() == null || detail.getUser() == null)
|
| | | if (detail.getExtract() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | MsgMoneyDetail msg = msgMoneyDetailMapper.selectBySourceIdAndMsgType(detail.getExtract().getId(),
|
| | | MsgTypeMoneyTypeEnum.extract);
|
| | |
| | | update.setRead(false);
|
| | | update.setStateDesc(detail.getStateDesc());
|
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
|
| | | msgExtraService.updateMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | }
|
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.extractValid) {
|
| | | if (detail.getAlipayAccountValid() == null || detail.getUser() == null)
|
| | | if (detail.getAlipayAccountValid() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | MsgMoneyDetail msg = msgMoneyDetailMapper.selectBySourceIdAndMsgType(detail.getAlipayAccountValid().getId(),
|
| | | MsgTypeMoneyTypeEnum.extractValid);
|
| | |
| | | update.setRead(false);
|
| | | update.setStateDesc(detail.getStateDesc());
|
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
|
| | | msgExtraService.updateMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | }
|
| | | } else {
|
| | | if(detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | }
|
| | | userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.config.push.PushMsgFactory;
|
| | | import com.yeshi.fanli.exception.msg.MsgMoneyDetailException;
|
| | |
| | | extract, null, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | extract, reason, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | extract, null, alipayNo);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), limitDay, change);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), limitDay, change);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | uid, Constant.TYPE_REBATE, downTime, false);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | goodsCount, downTime, Constant.TYPE_REBATE);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | uid, Constant.TYPE_SHAER, downTime, false);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | goodsCount, downTime, Constant.TYPE_SHAER);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void inviteOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | // MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteReceivedMsg(money, balance, orderType, orderCount, goodsCount,
|
| | | // uid, null);
|
| | | public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance) {
|
| | | // MsgMoneyDetail detail = MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money, balance, null);
|
| | | // try {
|
| | | // msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // } catch (MsgMoneyDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | //
|
| | | // PushContentDTO dto = PushMsgFactory.createMoneyInviteRecieved(orderType, money);
|
| | | // PushContentDTO dto = PushMsgFactory.createMoneySystemCompensate(reason, money);
|
| | | // try {
|
| | | // pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | // } catch (NumberFormatException e) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteWeiQuanMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyOrderShareOrInviteWeiquan(orderType, orderId, false, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderReward(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderRewardMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneySystemReward("使用返利奖励券", money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money, balance, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneySystemCompensate(reason, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createElmeFanliMsg(uid, orderId, money, balance, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteOrderSubSidyMsg(uid, date, from, money, balance,
|
| | | null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void addMsgExtra(long rid, String content, String type){
|
| | | MsgExtra msgExtra = new MsgExtra();
|
| | | msgExtra.setRid(rid);
|
| | | msgExtra.setType(type);
|
| | | msgExtra.setContent(content);
|
| | | msgExtra.setCreateTime(new Date());
|
| | | msgExtraMapper.insertSelective(msgExtra);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateMsgExtra(long rid, String content, String type) {
|
| | | MsgExtra msgExtra = msgExtraMapper.getByRidAndType(rid, type);
|
| | | if (msgExtra == null) {
|
| | | addMsgExtra(rid, content, type);
|
| | | msgExtra = new MsgExtra();
|
| | | msgExtra.setRid(rid);
|
| | | msgExtra.setType(type);
|
| | | msgExtra.setContent(content);
|
| | | msgExtra.setCreateTime(new Date());
|
| | | msgExtraMapper.insertSelective(msgExtra);
|
| | | } else {
|
| | | MsgExtra upExtra = new MsgExtra();
|
| | | upExtra.setId(msgExtra.getId());
|
| | |
| | | msgExtraMapper.updateByPrimaryKeySelective(upExtra);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | return listVO; |
| | | } |
| | | |
| | | /** |
| | | * 订单信息加工 |
| | | * |
| | | * @param acceptData |
| | | * @param listOrder |
| | | * @param listGoods |
| | | * @param uid |
| | | */ |
| | | private void orderVOFactoryNew(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, |
| | | Long uid) throws Exception { |
| | | List<String> listTB = new ArrayList<String>(); |
| | | List<String> listJD = new ArrayList<String>(); |
| | | List<String> listPDD = new ArrayList<String>(); |
| | | for (CommonOrderVO commonOrderVO : listOrder) { |
| | | Integer sourceType = commonOrderVO.getSourceType(); |
| | | if (sourceType == null) { |
| | | continue; |
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | listTB.add(commonOrderVO.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) { |
| | | listJD.add(commonOrderVO.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | listPDD.add(commonOrderVO.getOrderNo()); |
| | | } |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordTB = null; |
| | | if (listTB.size() > 0) { |
| | | listRecordTB = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_TAOBAO, listTB); |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordJD = null; |
| | | if (listJD.size() > 0) { |
| | | listRecordJD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_JD, listJD); |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordPDD = null; |
| | | if (listPDD.size() > 0) { |
| | | listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD); |
| | | } |
| | | |
| | | // 需要查询是否为VIP的用户ID,只有邀请订单才需要查询 |
| | | List<Long> needSelectVIPUidList = new ArrayList<>(); |
| | | |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) |
| | | needSelectVIPUidList.add(Long.parseLong(order.getUserId())); |
| | | } |
| | | |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | Integer urank = order.getUrank(); |
| | | if (urank != null) { |
| | | String levelName = UserLevelUtil.getLevelName(urank); |
| | | if (!StringUtil.isNullOrEmpty(levelName)) { |
| | | order.setOrderDesc("订单来源:" + levelName); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | | SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd"); |
| | | // 2019.8.1开始返回维权信息 |
| | | Date august = TimeUtil.parse("2019-08-01"); |
| | | |
| | | // 当前用户是否可以使用奖励券 |
| | | boolean isvip = userInviteService.verifyVIP(uid); |
| | | // 是否存在奖励券 |
| | | boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid); |
| | | |
| | | for (CommonOrderVO order : listOrder) { |
| | | String orderNo = order.getOrderNo(); |
| | | Integer sourceType = order.getSourceType(); |
| | | Integer hongBaoType = order.getHongBaoType(); |
| | | |
| | | // 商品信息组合 |
| | | for (CommonOrderVO commonOrder : listGoods) { |
| | | CommonOrderGoods goods = commonOrder.getCommonOrderGoods(); |
| | | if (goods == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (sourceType.equals(commonOrder.getSourceType()) && orderNo.equals(commonOrder.getOrderNo())) { |
| | | CommonOrderGoodsVO commonGoodsVO = new CommonOrderGoodsVO(); |
| | | PropertyUtils.copyProperties(commonGoodsVO, goods); |
| | | if (commonGoodsVO.getGoodsType() == null) { |
| | | commonGoodsVO.setGoodsType(sourceType); |
| | | } |
| | | |
| | | // 淘宝商品图片处理 |
| | | String picture = commonGoodsVO.getPicture(); |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO && !StringUtil.isNullOrEmpty(picture) |
| | | && !picture.contains("320x320")) { |
| | | commonGoodsVO.setPicture(TbImgUtil.getTBSize320Img(picture)); |
| | | } |
| | | |
| | | // 购买数量 |
| | | commonGoodsVO.setActualCount(commonOrder.getTotalCount() + "件"); |
| | | |
| | | // 实付款 |
| | | BigDecimal totalSettlement = commonOrder.getTotalSettlement(); |
| | | if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) { |
| | | totalSettlement = commonOrder.getTotalPayment(); |
| | | } |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | // 邀请订单信息保护 |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | Map<String, String> titleMap = new HashMap<String, String>(); |
| | | titleMap.put("content", "为保障用户隐私,商品信息已隐藏!"); |
| | | titleMap.put("fontColor", "#888888"); |
| | | titleMap.put("bottomColor", "#E9E9E9"); |
| | | commonGoodsVO.setTitle(null); |
| | | commonGoodsVO.setGoodsTitle(titleMap); |
| | | } |
| | | |
| | | // 订单类型为空时 已商品类为准 |
| | | String shopType = commonGoodsVO.getShopType(); |
| | | if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) { |
| | | order.setOrderType(1); |
| | | } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) { |
| | | order.setOrderType(2); |
| | | } |
| | | |
| | | Integer goodsType = commonGoodsVO.getGoodsType(); |
| | | if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) { |
| | | order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单 |
| | | } |
| | | |
| | | order.getListOrderGoods().add(commonGoodsVO); |
| | | } |
| | | } |
| | | |
| | | // 订单类型 |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | Integer orderType = order.getOrderType(); |
| | | if (orderType == null) { |
| | | order.setOrderType(1); |
| | | } |
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) { |
| | | order.setOrderType(3); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | order.setOrderType(4); |
| | | } |
| | | |
| | | Date thirdCreateTime = order.getThirdCreateTime(); |
| | | if (thirdCreateTime != null) { |
| | | order.setDownTime("下单时间:" + format.format(thirdCreateTime)); |
| | | order.setObtainTime(thirdCreateTime.getTime()); |
| | | } |
| | | |
| | | Date settleTime = order.getSettleTime(); |
| | | if (settleTime != null) { |
| | | order.setReceiveTime("收货时间:" + format.format(settleTime)); |
| | | } |
| | | |
| | | /* 订单状态 转换处理 */ |
| | | String orderStateContent = ""; |
| | | Map<String, String> orderStateMap = new HashMap<String, String>(); |
| | | // 订单状态 |
| | | Integer orderState = order.getState(); |
| | | // 红包状态 |
| | | Integer hongBaoState = order.getHongBaoState(); |
| | | |
| | | Integer stateWholeOrder = order.getStateWholeOrder(); |
| | | if (CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO == stateWholeOrder) { |
| | | // 整个订单部分失效:判断真实状态 订单、红包 |
| | | CommonOrderVO buFenOrder = commonOrderMapper.getBuFenOrderState(uid, order.getOrderNo()); |
| | | if (buFenOrder != null) { |
| | | // 有效的订单状态 |
| | | orderState = buFenOrder.getState(); |
| | | // 有效的红包状态 |
| | | hongBaoState = buFenOrder.getHongBaoState(); |
| | | } |
| | | } |
| | | |
| | | // 2.1显示返利说明连接> 未失效-自购-分享 |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | if (CommonOrder.STATE_SX != orderState |
| | | && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME) |
| | | && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) |
| | | || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType)) { |
| | | String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey()); |
| | | order.setRebateLink(rebateLink + "?orderNo=" + orderNo + "&sourceType=" + sourceType); |
| | | } |
| | | } |
| | | |
| | | BigDecimal hongBao = order.getHongBao(); |
| | | if (hongBao == null) { |
| | | hongBao = new BigDecimal(0); |
| | | } |
| | | |
| | | if (CommonOrder.STATE_FK == orderState) { |
| | | orderStateContent = "已付款"; |
| | | } else if (CommonOrder.STATE_JS == orderState) { |
| | | orderStateContent = "已收货"; |
| | | } else if (CommonOrder.STATE_SX == orderState) { |
| | | orderStateContent = "未付款/已退款"; |
| | | } else if (CommonOrder.STATE_WQ == orderState) { |
| | | orderStateContent = "已售后"; |
| | | if (sourceType != null && sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | /* 订单维权 判断是否全部维权 */ |
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper |
| | | .selectListByOrderIdAndState(order.getOrderNo(), "维权成功"); |
| | | |
| | | BigDecimal weiQuanMoney = getWeiQuanMoney(listWQ, sourceType, uid); |
| | | if (settleTime != null && august != null && settleTime.getTime() > august.getTime()) { |
| | | orderStateContent = "售后成功"; |
| | | WeiQuanInfo weiQuanInfo = new WeiQuanInfo(); |
| | | weiQuanInfo.setOldHongBao("¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString()); |
| | | weiQuanInfo.setWqHongBao("售后:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString()); |
| | | hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney); |
| | | order.setWeiQuanInfo(weiQuanInfo); |
| | | } |
| | | } |
| | | } |
| | | orderStateMap.put("content", orderStateContent); |
| | | orderStateMap.put("fontColor", "#666666"); |
| | | order.setOrderState(orderStateMap); |
| | | |
| | | String hongbaoInfo = ""; |
| | | // 订单标识 |
| | | List<String> signList = new ArrayList<String>(); |
| | | /* 订单返利类型 转换 */ |
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) { |
| | | // 自购 |
| | | hongbaoInfo = "返利"; |
| | | order.setOrderOrigin("1"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_FANLI); |
| | | signList.add(CommonOrder.TYPE_FANLI); |
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) { |
| | | // 分享 |
| | | hongbaoInfo = "奖金"; |
| | | order.setOrderOrigin("2"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_SHARE); |
| | | signList.add(CommonOrder.TYPE_SHARE); |
| | | |
| | | } else if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | // 下级的分享订单: 显示邀请 |
| | | hongbaoInfo = "奖金"; |
| | | order.setOrderOrigin("3"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE); |
| | | signList.add(CommonOrder.TYPE_INVITE); |
| | | |
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_ERJI == hongBaoType) { |
| | | // 邀请订单 |
| | | hongbaoInfo = "奖金"; |
| | | order.setOrderOrigin("3"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE); |
| | | signList.add(CommonOrder.TYPE_INVITE); |
| | | |
| | | // 超级会员补贴信息 |
| | | InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), |
| | | sourceType); |
| | | if (orderSubsidy != null) { |
| | | ClientTextStyleVO subsidyInfo = new ClientTextStyleVO(); |
| | | subsidyInfo.setContent("(补贴¥" + orderSubsidy.getMoney() + ")"); |
| | | if (orderSubsidy.getState() == InviteOrderSubsidy.STATE_SUBSIDIZED) { |
| | | subsidyInfo.setColor("#E5005C"); |
| | | } else { |
| | | subsidyInfo.setColor("#888888"); |
| | | } |
| | | order.setSubsidy(subsidyInfo); |
| | | |
| | | // 解释信息(问号) |
| | | List<String> subsidyList = new ArrayList<String>(); |
| | | subsidyList.add("额外补贴能否获得由系统算法自动判断,人为无法干涉;"); |
| | | subsidyList.add("额外补贴到账时间以及金额请以实际到账为准;"); |
| | | subsidyList.add("额外补贴产生后将会在消息-资金消息中提醒你。"); |
| | | order.setSubsidyList(subsidyList); |
| | | } |
| | | } |
| | | order.setSignList(signList); |
| | | |
| | | String hongBaoDate = null; |
| | | String hongBaoState_Str = ""; |
| | | String hongbaoInfoFontColor = "#E5005C"; |
| | | |
| | | /* 红包状态 转换 */ |
| | | String stateContent = ""; |
| | | String stateFontColor = "#E5005C"; |
| | | Integer orderHongBaoState = null; |
| | | |
| | | if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) { |
| | | orderHongBaoState = 1; |
| | | stateContent = "未到账"; |
| | | hongBaoState_Str = "预估"; |
| | | |
| | | Date preAccountTime = order.getPreAccountTime(); |
| | | if (preAccountTime != null) { |
| | | hongBaoDate = "预计到账时间:" + formatday.format(preAccountTime); |
| | | } |
| | | |
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) { |
| | | orderHongBaoState = 3; |
| | | stateContent = "已到账"; |
| | | |
| | | Date accountTime = order.getAccountTime(); |
| | | if (accountTime != null) { |
| | | hongBaoDate = "到账时间:" + formatday.format(accountTime); |
| | | } |
| | | |
| | | } else if (HongBaoV2.STATE_BUFENSHIXIAO == hongBaoState) { |
| | | stateContent = "部分失效"; |
| | | orderHongBaoState = 3; |
| | | Date accountTime = order.getAccountTime(); |
| | | if (accountTime != null) { |
| | | hongBaoDate = "到账时间:" + formatday.format(accountTime); |
| | | } |
| | | |
| | | } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) { |
| | | orderHongBaoState = 4; |
| | | stateContent = "已失效"; |
| | | hongbaoInfoFontColor = "#888888"; |
| | | } |
| | | order.setHongBaoState(orderHongBaoState); |
| | | order.setHongBaoDate(hongBaoDate); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(order.getStateDesc())) { |
| | | stateContent = stateContent + "-" + order.getStateDesc(); |
| | | } |
| | | |
| | | Map<String, String> stateMap = new HashMap<String, String>(); |
| | | stateMap.put("content", stateContent); |
| | | stateMap.put("fontColor", stateFontColor); |
| | | order.setAccountState(stateMap); |
| | | |
| | | hongbaoInfo = hongBaoState_Str + hongbaoInfo; |
| | | |
| | | Map<String, String> hongBaoMap = new HashMap<String, String>(); |
| | | hongBaoMap.put("content", hongbaoInfo + " ¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString()); |
| | | hongBaoMap.put("fontColor", hongbaoInfoFontColor); |
| | | order.setHongBaoInfo(hongBaoMap); |
| | | |
| | | // 显示返利、免单详情 |
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType) { |
| | | // 奖励订单、免单 使用记录 |
| | | if (sourceType == null) { |
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, null, uid, isvip); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, uid, isvip); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) { |
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, uid, isvip); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, uid, isvip); |
| | | } |
| | | } |
| | | |
| | | // 分享、邀请 隐藏订单号 |
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType || HongBaoV2.TYPE_YAOQING == hongBaoType |
| | | || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订单: 免单标识 奖励标识 |
| | | * |
| | | * @param order |
| | | * @param hasRewardCoupon |
| | | * @param hongBaoState |
| | | * @param list |
| | | * @param signList |
| | | */ |
| | | private void couponFactoryNew(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState, |
| | | Integer hongBaoType, List<UserSystemCouponRecord> list, Long uid, boolean vip) throws Exception { |
| | | // 是否免单商品 |
| | | boolean freeOrder = false; |
| | | // 是否奖励成功 |
| | | boolean rewardSuccess = false; |
| | | if (list != null && list.size() > 0) { |
| | | for (UserSystemCouponRecord couponRecord : list) { |
| | | int goodSource = couponRecord.getGoodSource(); |
| | | if (goodSource == 0) |
| | | goodSource = 1; |
| | | |
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo()) && goodSource == order.getSourceType()) { |
| | | Integer state = couponRecord.getState(); |
| | | String systemCouponType = couponRecord.getCouponType(); |
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType) |
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) { |
| | | rewardSuccess = true; |
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) |
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) |
| | | || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { |
| | | |
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) { |
| | | // 免单中 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_ON); |
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) { |
| | | // 免单成功 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_SUCCEED); |
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state |
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) { |
| | | // 规则不匹配、退款 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_FAIL); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 免单详情 |
| | | if (freeOrder) { |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setContent("免单详情 >"); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 1); // 页面跳转 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail")); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | |
| | | // 已使用奖励券 |
| | | if (rewardSuccess) { |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | rewardStyleVO.setContent("已使用奖励券 >"); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 1); // 1 常规跳转页面 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail")); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | |
| | | // 是否可使用奖励券 |
| | | if (!rewardSuccess && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType |
| | | && HongBaoV2.STATE_YILINGQU == hongBaoState && !vip && CommonOrder.STATE_WQ != order.getState()) { |
| | | // 下单时间 |
| | | Date thirdCreateTime = order.getThirdCreateTime(); |
| | | // 到账时间 |
| | | Date accountTime = order.getAccountTime(); |
| | | if (thirdCreateTime == null || accountTime == null) |
| | | return; |
| | | |
| | | // 下单日期是否是符合上线日期 |
| | | long downOrderTime = thirdCreateTime.getTime(); |
| | | long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME); |
| | | if (downOrderTime > limitDate) { |
| | | // 2.1 开始新版 |
| | | rewardCounponLimitTime(order, accountTime); |
| | | } else if (hasRewardCoupon) { |
| | | // 在2.1新版上线之前订单-存在则显示奖励券可使用 |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | rewardStyleVO.setContent("使用奖励券"); |
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 2); // 弹框 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail")); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Date getThirdCreateTime(String orderId, int sourceType) { |
| | |
| | | return list.get(0).getThirdCreateTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CommonOrderVO> getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, |
| | |
| | | order.setHongBaoInfo(hongBaoMap); |
| | | |
| | | // 分享、邀请 隐藏订单号 |
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType || HongBaoV2.TYPE_YAOQING == hongBaoType |
| | | || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo())); |
| | | } |
| | |
| | | * 订单: 免单标识 奖励标识 |
| | | * |
| | | * @param order |
| | | * @param hasRewardCoupon |
| | | * @param hongBaoState |
| | | * @param list |
| | | * @param signList |
| | | */ |
| | | private void couponUseFactory(CommonOrderVO order, List<UserSystemCouponRecord> list) throws Exception { |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | // 是否免单商品 |
| | | boolean freeOrder = false; |
| | | // 是否奖励成功 |
| | | boolean rewardSuccess = false; |
| | | String text = null; |
| | | for (UserSystemCouponRecord couponRecord : list) { |
| | | int goodSource = couponRecord.getGoodSource(); |
| | | if (goodSource == 0) |
| | |
| | | String systemCouponType = couponRecord.getCouponType(); |
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType) |
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) { |
| | | // 已使用奖励券 |
| | | rewardSuccess = true; |
| | | text = "已奖励"; |
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) |
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) |
| | | || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { |
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) { |
| | | // 免单中 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_ON); |
| | | text = "免单中"; |
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) { |
| | | // 免单成功 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_SUCCEED); |
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state |
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) { |
| | | // 规则不匹配、退款 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_FAIL); |
| | | } |
| | | text = "免单成功"; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // 免单详情 |
| | | if (freeOrder) { |
| | | if (!StringUtil.isNullOrEmpty(text)) { |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setContent("免单详情 >"); |
| | | rewardStyleVO.setContent(text); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 1); // 页面跳转 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail")); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | |
| | | // 已使用奖励券 |
| | | if (rewardSuccess) { |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | rewardStyleVO.setContent("已使用奖励券 >"); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 1); // 1 常规跳转页面 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail")); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | } |
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgOrderDetailMapper;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import redis.clients.jedis.Jedis;
|
| | | import redis.clients.jedis.JedisPool;
|
| | |
| | |
|
| | | @Resource
|
| | | private JedisPool jedisPool;
|
| | | |
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | | |
| | |
|
| | | @Override
|
| | | public void addMsgOrderDetail(MsgOrderDetail detail, boolean needNotify) throws MsgOrderDetailException {
|
| | | if (detail == null)
|
| | | throw new MsgOrderDetailException(1, "消息为空");
|
| | | if (detail.getOrderId() == null || detail.getType() == null || detail.getUser() == null)
|
| | | if (detail.getOrderId() == null || detail.getType() == null || detail.getUser() == null
|
| | | || StringUtil.isNullOrEmpty(detail.getExtraInfo()))
|
| | | throw new MsgOrderDetailException(2, "消息不完整");
|
| | | // 锁住订单号
|
| | | Jedis jedis = jedisPool.getResource();
|
| | |
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgOrderDetailMapper.insertSelective(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } else {
|
| | | MsgOrderDetail update = new MsgOrderDetail();
|
| | | update.setId(old.getId());
|
| | |
| | | update.setRead(false);
|
| | | update.setBeiZhu(detail.getBeiZhu());
|
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update);
|
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | }
|
| | | if (needNotify)
|
| | | userMsgReadStateService.addOrderMsgUnReadCount(detail.getUser().getId(), 1);
|
| | |
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | | |
| | |
|
| | | @Override
|
| | | public void orderFanLiStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | |
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createOrderStatistics(uid, orderId, source, type, goodsCount, payMoney, money, downTime, beiZhu);
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, needNotify);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(),detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createOrderFoundSuccess(uid, orderId, orderSource, type, goodsCount, payMoney, money, submitTime, "");
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createOrderFoundFail(uid, orderId, "");
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserLevelUpgradedNotifyService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | | |
| | | @Resource
|
| | | private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | info.setUpdateTime(upgradeTime);
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | |
|
| | | // 升级弹框提示
|
| | | UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
|
| | | notify.setUid(uid);
|
| | | notify.setFromLevel(UserLevelEnum.highVIP);
|
| | | notify.setToLevel(UserLevelEnum.superVIP);
|
| | | notify.setValid(true);
|
| | | notify.setCreateTime(new Date());
|
| | | userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
|
| | | |
| | | try {
|
| | | // 赠送免单券
|
| | | String giveCoupon = userVipConfigService.getValueByKey("vip_pre_10_gift_givefree_coupon");
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.integral.IntegralDetail;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserLevelUpgradedNotifyService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInviteMsgNotificationService userInviteMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
|
| | |
|
| | | @Override
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
|
| | |
| | | int daysBetween = DateUtil.daysBetween(registerTime, new Date());
|
| | | userAccountMsgNotificationService.vipPreUpgrade(uid, "快省达人", "普通会员", daysBetween, targetNum1, targetNum2, type);
|
| | |
|
| | | |
| | | // 升级弹框提示
|
| | | UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
|
| | | notify.setUid(uid);
|
| | | notify.setFromLevel(UserLevelEnum.daRen);
|
| | | notify.setToLevel(UserLevelEnum.normalVIP);
|
| | | notify.setValid(true);
|
| | | notify.setCreateTime(new Date());
|
| | | userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
|
| | | |
| | | // 赠送金币
|
| | | String goldcoin = userVipConfigService.getValueByKey("vip_pre_3_gift_goldcoin");
|
| | | if (!StringUtil.isNullOrEmpty(goldcoin)) {
|
| | |
| | | info.setUpdateTime(upgradeTime);
|
| | | addUserVIPPreInfo(info);
|
| | |
|
| | | // 升级弹框提示
|
| | | UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
|
| | | notify.setUid(uid);
|
| | | notify.setFromLevel(UserLevelEnum.normalVIP);
|
| | | notify.setToLevel(UserLevelEnum.highVIP);
|
| | | notify.setValid(true);
|
| | | notify.setCreateTime(new Date());
|
| | | userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
|
| | | |
| | | // 升级消息
|
| | | UserVIPPreInfo pre1 = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
|
| | | int daysBetween = DateUtil.daysBetween(pre1.getCreateTime(), upgradeTime);
|
| | |
| | |
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money,BigDecimal fanliMoney, int goodsCount, Date downTime);
|
| | |
|
| | | /**
|
| | | * 邀请赚订单被统计
|
| | | * |
| | | * @param uid
|
| | | * @param orderCount
|
| | | * @param goodsCount
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void inviteOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 邀请订单维权
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 奖励订单到账
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void orderReward(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 系统补齐
|
| | |
| | | */
|
| | | public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 饿了么返利到账
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | |
| | | /**
|
| | | * 补贴消息
|
| | | * |
| | | * @param uid
|
| | | * @param date
|
| | | * @param from
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 红包消息
|
| | |
| | |
|
| | | public void addMsgExtra(long rid, String content, String type);
|
| | |
|
| | | |
| | | |
| | | public void updateMsgExtra(long rid, String content, String type);
|
| | | |
| | | }
|
| | |
| | | public static final BigDecimal VIP_ORDER_PAY = new BigDecimal("1");
|
| | |
|
| | | // 订单列表显> 时间 TODO
|
| | | public static final String ORDER_SHOW_BRACE_TIME = "2012-03-01";
|
| | | public static final String ORDER_SHOW_BRACE_TIME = "1999-03-01";
|
| | |
|
| | |
|
| | | // 奖励券倒计时 - 天数
|
| | |
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class MsgAccountDetailFactory {
|
| | | public final static int TYPE_WX = 1;// 微信
|
| | | public final static int TYPE_TB = 2;// 淘宝
|
| | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("邀约原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("尊敬的"+ nickname+",你已符合成长为一名资深导师的条件,希望你能加入板栗快省运营团队,与我们共创辉煌", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("对应权益", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如果你接受邀约,你将获得该账户等级对应的全部权益 ", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("邀约原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("与你共创辉煌", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | |
| | | return null;
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("",ClientTextStyleVO.COLOR_CONTENT, portrait));
|
| | | contentList.add(new ClientTextStyleVO("、" + nickName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("直接粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | |
| | | return null;
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("",ClientTextStyleVO.COLOR_CONTENT, portrait));
|
| | | contentList.add(new ClientTextStyleVO("、" + nickName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("间接粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + extract.getMoney().setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | if (!StringUtil.isNullOrEmpty(alipayNo)) {
|
| | | contentList.add(new ClientTextStyleVO(String.format("&支付宝订单号: %s", "*" + alipayNo.substring(alipayNo.length() - 10)), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(String.format("&支付宝订单号: %s", "*" + alipayNo.substring(alipayNo.length() - 10)), ClientTextStyleVO.COLOR_CONTENT));
|
| | | }
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现金额", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | |
|
| | |
| | | sourceName += "-返利订单";
|
| | | typeEnum = MsgTypeMoneyTypeEnum.fanli;
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | fanliName = "分享奖金:";
|
| | | fanliName = "分享奖金:";
|
| | | sourceName += "-分享订单";
|
| | | typeEnum = MsgTypeMoneyTypeEnum.share;
|
| | | }
|
| | |
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("件商品", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单相关", ClientTextStyleVO.COLOR_TITLE), contentList));
|
| | |
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("件商品", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单相关", ClientTextStyleVO.COLOR_TITLE), contentList));
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请赚维权
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createInviteWeiQuanMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | BigDecimal balance, String beiZhu) {
|
| | | if (money == null || orderId == null || money == null || uid == null)
|
| | | return null;
|
| | | // /**
|
| | | // * 邀请赚维权
|
| | | // * |
| | | // * @param uid
|
| | | // * @param orderId
|
| | | // * @param money
|
| | | // * @param balance
|
| | | // * @param beiZhu
|
| | | // * @return
|
| | | // */
|
| | | // public static MsgMoneyDetail createInviteWeiQuanMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | // BigDecimal balance, String beiZhu) {
|
| | | // if (money == null || orderId == null || money == null || uid == null)
|
| | | // return null;
|
| | | //
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.inviteWeiQuan);
|
| | | // detail.setOrderId(orderId);
|
| | | // detail.setRead(false);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | // detail.setOrderType(orderType);
|
| | | //
|
| | | // return detail;
|
| | | // }
|
| | | //
|
| | | // /**
|
| | | // * 分享赚到账
|
| | | // * |
| | | // * @param money
|
| | | // * @param balance
|
| | | // * @param orderCount
|
| | | // * @param goodsCount
|
| | | // * @param uid
|
| | | // * @param beiZhu
|
| | | // * @return
|
| | | // */
|
| | | // public static MsgMoneyDetail createShareMsg(BigDecimal money, BigDecimal balance, int orderType, int orderCount,
|
| | | // int goodsCount, Long uid, String beiZhu) {
|
| | | // if (money == null || balance == null || uid == null)
|
| | | // return null;
|
| | | //
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setGoodsCount(goodsCount);
|
| | | // detail.setOrderType(orderType);
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.share);
|
| | | // detail.setOrderCount(orderCount);
|
| | | // detail.setRead(false);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | //
|
| | | // return detail;
|
| | | // }
|
| | | //
|
| | | // /**
|
| | | // * 分享赚维权
|
| | | // * |
| | | // * @param uid
|
| | | // * @param orderId
|
| | | // * @param money
|
| | | // * @param balance
|
| | | // * @param beiZhu
|
| | | // * @return
|
| | | // */
|
| | | // public static MsgMoneyDetail createShareWeiQuanMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | // BigDecimal balance, String beiZhu) {
|
| | | // if (money == null || orderId == null || money == null || uid == null)
|
| | | // return null;
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.shareWeiQuan);
|
| | | // detail.setOrderId(orderId);
|
| | | // detail.setRead(false);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | // detail.setOrderType(orderType);
|
| | | // return detail;
|
| | | // }
|
| | | //
|
| | | // public static MsgMoneyDetail createOrderRewardMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | // BigDecimal balance, String beiZhu) {
|
| | | // if (money == null || orderId == null || money == null || uid == null)
|
| | | // return null;
|
| | | //
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.orderReward);
|
| | | // detail.setOrderId(orderId);
|
| | | // detail.setRead(false);
|
| | | // detail.setOrderType(orderType);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | // return detail;
|
| | | // }
|
| | | //
|
| | | // public static MsgMoneyDetail createSystemEqualizeMsg(Long uid, String reason, BigDecimal money, BigDecimal balance,
|
| | | // String beiZhu) {
|
| | | // if (money == null || money == null || uid == null)
|
| | | // return null;
|
| | | //
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.systemEqualize);
|
| | | // detail.setOrderId(reason);
|
| | | // detail.setRead(false);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | // return detail;
|
| | | // }
|
| | | //
|
| | | // public static MsgMoneyDetail createElmeFanliMsg(Long uid, String orderId, BigDecimal money, BigDecimal balance,
|
| | | // String beiZhu) {
|
| | | // if (money == null || money == null || uid == null)
|
| | | // return null;
|
| | | //
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.fanliElme);
|
| | | // detail.setOrderId(orderId);
|
| | | // detail.setRead(false);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | // return detail;
|
| | | // }
|
| | | // |
| | | // |
| | | //
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.inviteWeiQuan);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setOrderType(orderType);
|
| | |
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享赚到账
|
| | | * |
| | | * @param money
|
| | | * @param balance
|
| | | * @param orderCount
|
| | | * @param goodsCount
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createShareMsg(BigDecimal money, BigDecimal balance, int orderType, int orderCount,
|
| | | int goodsCount, Long uid, String beiZhu) {
|
| | | if (money == null || balance == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setGoodsCount(goodsCount);
|
| | | detail.setOrderType(orderType);
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.share);
|
| | | detail.setOrderCount(orderCount);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | |
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享赚维权
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createShareWeiQuanMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | BigDecimal balance, String beiZhu) {
|
| | | if (money == null || orderId == null || money == null || uid == null)
|
| | | return null;
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.shareWeiQuan);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setOrderType(orderType);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | public static MsgMoneyDetail createOrderRewardMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | BigDecimal balance, String beiZhu) {
|
| | | if (money == null || orderId == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.orderReward);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setRead(false);
|
| | | detail.setOrderType(orderType);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | public static MsgMoneyDetail createSystemEqualizeMsg(Long uid, String reason, BigDecimal money, BigDecimal balance,
|
| | | String beiZhu) {
|
| | | if (money == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.systemEqualize);
|
| | | detail.setOrderId(reason);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | public static MsgMoneyDetail createElmeFanliMsg(Long uid, String orderId, BigDecimal money, BigDecimal balance,
|
| | | String beiZhu) {
|
| | | if (money == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.fanliElme);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 邀请订单补贴
|
| | | * |
| | | * @param uid
|
| | | * @param date
|
| | | * @param from
|
| | | * @param money
|
| | | * @param balance
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createInviteOrderSubSidyMsg(Long uid, Date date, String from, BigDecimal money,
|
| | | BigDecimal balance, String beiZhu) {
|
| | | if (money == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.subSidy);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(date);
|
| | | detail.setStateDesc(String.format("%s年%s月额外补贴到账", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)));
|
| | | detail.setDesc(from);
|
| | |
|
| | | return detail;
|
| | | }
|
| | | |
| | | /**
|
| | | * 团队奖励
|
| | | * @Title: createOrderTeamRewardMsg
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param date
|
| | | * @param from
|
| | | * @param money
|
| | | * @param balance
|
| | | * @param beiZhu
|
| | | * @return |
| | | * MsgMoneyDetail 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static MsgMoneyDetail createOrderTeamRewardMsg(Long uid, Date date, String from, BigDecimal money,
|
| | | BigDecimal balance, String beiZhu) {
|
| | | if (money == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.orderTeamReward);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(date);
|
| | | detail.setStateDesc(String.format("%s年%s月团队奖励到账", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)));
|
| | | detail.setDesc(from);
|
| | |
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | // |
| | | // /**
|
| | | // * 团队奖励
|
| | | // * @Title: createOrderTeamRewardMsg
|
| | | // * @Description: |
| | | // * @param uid
|
| | | // * @param date
|
| | | // * @param from
|
| | | // * @param money
|
| | | // * @param balance
|
| | | // * @param beiZhu
|
| | | // * @return |
| | | // * MsgMoneyDetail 返回类型
|
| | | // * @throws
|
| | | // */
|
| | | // public static MsgMoneyDetail createOrderTeamRewardMsg(Long uid, Date date, String from, BigDecimal money,
|
| | | // BigDecimal balance, String beiZhu) {
|
| | | // if (money == null || money == null || uid == null)
|
| | | // return null;
|
| | | //
|
| | | // MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | // detail.setBalance(balance);
|
| | | // detail.setBeiZhu(beiZhu);
|
| | | // detail.setCreateTime(new Date());
|
| | | // detail.setMoney(money);
|
| | | // detail.setMsgType(MsgTypeMoneyTypeEnum.orderTeamReward);
|
| | | // detail.setRead(false);
|
| | | // detail.setUser(new UserInfo(uid));
|
| | | // Calendar calendar = Calendar.getInstance();
|
| | | // calendar.setTime(date);
|
| | | // detail.setStateDesc(String.format("%s年%s月团队奖励到账", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)));
|
| | | // detail.setDesc(from);
|
| | | //
|
| | | // return detail;
|
| | | // }
|
| | | // |
| | | // |
| | | /**
|
| | | * 红包相关信息
|
| | | * @param uid
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | public class MsgOrderDetailFactory {
|
| | |
|
| | | |
| | | |
| | |
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 创建订单被统计消息
|
| | |
| | | MsgTypeOrderTypeEnum typeEnum = null;
|
| | | String sourceName = Constant.getSourceName(source);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | fanliName = "返利:";
|
| | | fanliName = "预估返利:";
|
| | | sourceName += "-返利订单";
|
| | | typeEnum = MsgTypeOrderTypeEnum.fanli;
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | fanliName = "奖金:";
|
| | | fanliName = "预估奖金:";
|
| | | sourceName += "-分享订单";
|
| | | typeEnum = MsgTypeOrderTypeEnum.share;
|
| | | } else if (Constant.TYPE_INVITE == type) {
|
| | | fanliName = "收益:";
|
| | | fanliName = "预估收益:";
|
| | | sourceName += "-团队订单";
|
| | | typeEnum = MsgTypeOrderTypeEnum.invite;
|
| | | }
|
| | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(sourceName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | // 订单号可点击
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | | |
| | | if (Constant.TYPE_INVITE == type) {
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(UserUtil.filterOrderId(orderId), ClientTextStyleVO.COLOR_CONTENT), true));
|
| | | } else {
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | | }
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList
|
| | | .add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | .add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("件商品", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单相关", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList));
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("实付款:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("实付款:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | |
| | | String fanliName = "";
|
| | | String sourceName = Constant.getSourceName(source);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | fanliName = "返利:";
|
| | | fanliName = "预估返利:";
|
| | | sourceName += "-返利订单";
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | fanliName = "奖金:";
|
| | | fanliName = "预估奖金:";
|
| | | sourceName += "-分享订单";
|
| | | }
|
| | |
|
| | |
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("提交时间:" + TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("提交时间:" + TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("件商品", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单相关", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("实付款:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("实付款:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | |
| | |
|
| | |
|
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setOrderId(orderId);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setOrderType(source);
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | public class MsgOtherDetailFactory {
|
| | |
|
| | | /**
|
| | | * 券相关信息的通知
|
| | | * |
| | | * @param uid
|
| | | * @param content
|
| | | * @param type
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgOtherDetail createCouponMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
|
| | | MsgTypeOtherTypeEnum type, String beiZhu) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCoupnContent(content);
|
| | | detail.setType(type);
|
| | | detail.setSourceId(userCouponId);
|
| | | return detail;
|
| | | }
|
| | | |
| | | /**
|
| | | * 券相关信息的通知
|
| | | * |
| | | * @param uid
|
| | | * @param content
|
| | | * @param type
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgOtherDetail createTaoLiJinMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
|
| | | MsgTypeOtherTypeEnum type, String beiZhu) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCoupnContent(content);
|
| | | detail.setType(type);
|
| | | detail.setSourceId(userCouponId);
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | |
| | | userMsgVO.setJumpDetail(jumpDetail);
|
| | | if (params != null)
|
| | | userMsgVO.setParams(params.toString());
|
| | | |
| | | return userMsgVO;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
|
| | | public class OrderRebateVO {
|
| | | private int type; // 订单类型 : 1返利 2分享 3邀请团队
|
| | | private String stateDesc; // 到账状态
|
| | | private boolean coupon; // 使用券
|
| | | private boolean wq; // 是否维权
|
| | | private String wqDesc; // 维权文字
|
| | | private String wqMoney; // 维权金额
|
| | |
|
| | | private String fanLi; // 预估总返利
|
| | | private String fanLiDesc; // 返利说明
|
| | | |
| | |
|
| | | private String upperFanLi; // 升级返利
|
| | | private String userLevel; // 用户等级
|
| | | private String jumpLink; // 跳转链接
|
| | | |
| | |
|
| | | private String subsidyDesc; // 团队说明
|
| | | private String subsidy; // 团队补贴
|
| | | private String originSubsidy; // 小一等级补贴
|
| | | |
| | |
|
| | | private Integer couponType; // 券图标:1-奖励券 2-免单券
|
| | | private boolean coupon; // 使用奖励券
|
| | | private boolean couponUse; // 已使用券
|
| | | private String couponText; // 状态说明
|
| | | private String couponDesc; // 使用说明
|
| | | private String couponParams;
|
| | | private JumpDetailV2 couponJumpDetail;
|
| | |
|
| | | private List<GoodsRebateVO> listGoods;
|
| | |
|
| | |
|
| | | public String getFanLi() {
|
| | | return fanLi;
|
| | |
| | | this.subsidyDesc = subsidyDesc;
|
| | | }
|
| | |
|
| | | |
| | | public String getCouponParams() {
|
| | | return couponParams;
|
| | | }
|
| | |
|
| | | public void setCouponParams(String couponParams) {
|
| | | this.couponParams = couponParams;
|
| | | }
|
| | |
|
| | | public JumpDetailV2 getCouponJumpDetail() {
|
| | | return couponJumpDetail;
|
| | | }
|
| | |
|
| | | public void setCouponJumpDetail(JumpDetailV2 couponJumpDetail) {
|
| | | this.couponJumpDetail = couponJumpDetail;
|
| | | }
|
| | |
|
| | | public boolean isCouponUse() {
|
| | | return couponUse;
|
| | | }
|
| | |
|
| | | public void setCouponUse(boolean couponUse) {
|
| | | this.couponUse = couponUse;
|
| | | }
|
| | |
|
| | | public String getCouponText() {
|
| | | return couponText;
|
| | | }
|
| | |
|
| | | public void setCouponText(String couponText) {
|
| | | this.couponText = couponText;
|
| | | }
|
| | |
|
| | | public String getCouponDesc() {
|
| | | return couponDesc;
|
| | | }
|
| | |
|
| | | public void setCouponDesc(String couponDesc) {
|
| | | this.couponDesc = couponDesc;
|
| | | }
|
| | |
|
| | | public Integer getCouponType() {
|
| | | return couponType;
|
| | | }
|
| | |
|
| | | public void setCouponType(Integer couponType) {
|
| | | this.couponType = couponType;
|
| | | }
|
| | |
|
| | | }
|