| | |
| | |
|
| | | // 判断是否需要显示订单找回提示
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | if (state == 0 && page == 1) {
|
| | | if (state != null && state == 0 && page == 1) {
|
| | | if (redisManager.frequencyLimit("orderlist-" + acceptData.getDevice(), 15, 3)) {// 15秒内请求3次触发
|
| | | // TODO 显示订单找回提醒
|
| | | }
|
| | |
| | | public enum MsgTypeMoneyTypeEnum {
|
| | | |
| | | share("分享奖金"), invite("邀请奖金"), fanli("返利到账"), extract("提现"), extractAutoWX("自动提现"), extractValid("提现账号验证"), shareWeiQuan(
|
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账"); |
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账"),subSidy("额外补贴"); |
| | | private final String desc;
|
| | |
|
| | | private MsgTypeMoneyTypeEnum(String desc) {
|
| | |
| | | String error = errorMsg + "\ntopic:" + topic + "\ntag:" + tag + "\nbody:" + data;
|
| | | mqLogger.error(error);
|
| | | }
|
| | | |
| | | public static void mqInfo(String extraInfo, String topic, String tag, Object data) {
|
| | | String info = extraInfo+"\n"+ "topic:" + topic + "\ntag:" + tag + "\nbody:" + data;
|
| | | mqLogger.info(info);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 登录信息
|
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="sumLeftMoneyByUid" resultType="java.math.BigDecimal"> |
| | | <select id="sumLeftMoneyByUid" resultType="java.math.BigDecimal" parameterType="java.lang.Long"> |
| | | select |
| | | sum(sd_left_money) |
| | | from yeshi_ec_invite_order_subsidy_debt where sd_uid = |
| | |
| | | ON |
| | | wo.`tmo_order_item_id`=co.`co_trade_id` |
| | | WHERE co.`co_id`>0 AND |
| | | wo.`tmo_id`>0 |
| | | |
| | | wo.`tmo_id`>0 and wo.tmo_state!='维权失败' |
| | | </select> |
| | | |
| | | <select id="sumWeiQuanOrderFanAmountByUid" resultType="java.math.BigDecimal"> |
| | |
| | | updateExtract.setId(id);
|
| | | updateExtract.setState(Extract.STATE_PROCESSING);
|
| | | extractMapper.updateByPrimaryKeySelective(updateExtract);
|
| | | //TODO 新版部署后删除
|
| | | // 改变资金记录状态
|
| | | UserMoneyDetail detail = userMoneyDetailService
|
| | | .selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum.extract, find.getUserInfo().getId(), find.getId());
|
| | | if (detail != null) {
|
| | | UserMoneyDetail update = new UserMoneyDetail(detail.getId());
|
| | | update.setShow(true);
|
| | | update.setUpdateTime(new Date());
|
| | | userMoneyDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | transfer(find, admin); // 提现通过,支付宝转账
|
| | |
|
| | | return null;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void extractFail(Extract extract, String stateDesc) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractFailMsg(extract, extract.getUserInfo().getId(),
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @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();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | hasUpdate = true;
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 通知用户的返利情况
|
| | | */
|
| | |
| | | // 修改状态
|
| | | InviteOrderSubsidy update = new InviteOrderSubsidy(old.getId());
|
| | | update.setMoney(orderSubsidy.getMoney());
|
| | | if (old.getState() == InviteOrderSubsidy.STATE_UNKNOWN) {// 状态未确定之前才可以更改原始补贴资金
|
| | | update.setOriginalMoney(orderSubsidy.getOriginalMoney());
|
| | | }
|
| | | update.setState(orderSubsidy.getState());
|
| | | update.setUpdateTime(new Date());
|
| | | inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
|
| | |
| | | rate = firstRate;
|
| | | else
|
| | | rate = secondRate;
|
| | | BigDecimal money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(totalMoney, rate),
|
| | | BigDecimal money = MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(totalMoney, rate),
|
| | | new BigDecimal(100));
|
| | | InviteOrderSubsidy orderSubsidy = new InviteOrderSubsidy();
|
| | | orderSubsidy.setMoney(money);
|
| | | orderSubsidy.setOriginalMoney(money);
|
| | | orderSubsidy.setUid(uid);
|
| | | orderSubsidy.setOrderNo(orderId);
|
| | | orderSubsidy.setSourceType(sourceType);
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void ziGouSettle(String orderId, int sourceType,String taskKey) throws OrderMoneySettleException {
|
| | | public void ziGouSettle(String orderId, int sourceType, String taskKey) throws OrderMoneySettleException {
|
| | | // 查询同一订单号的红包
|
| | | List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(sourceType, orderId);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // if (userMoney.isEmpty()) {
|
| | | // throw new OrderMoneySettleException(1, "没有需要结算的订单");
|
| | | // }
|
| | |
|
| | | Iterator<Long> its = userMoney.keySet().iterator();
|
| | |
|
| | | while (its.hasNext()) {
|
| | |
| | | }
|
| | |
|
| | | userMoneyService.addUserMoney(uid, money, userMoneyDetail);
|
| | | |
| | | List<Long> hbIdList=new ArrayList<>();
|
| | |
|
| | | List<Long> hbIdList = new ArrayList<>();
|
| | | // 添加资金明细与红包的映射关系
|
| | | for (HongBaoV2 v2 : userHongBao.get(uid)) {
|
| | | hbIdList.add(v2.getId());
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | //添加结算映射
|
| | | // 添加结算映射
|
| | | hongBaoV2SettleTempService.addTemp(hbIdList, taskKey);
|
| | |
|
| | | // 站内信+推送
|
| | |
| | | } else
|
| | | throw new OrderMoneySettleException(e.getCode(), "维权处理出错:" + e.getMsg());
|
| | | }
|
| | | |
| | | //添加结算映射
|
| | | |
| | | |
| | |
|
| | | // 添加结算映射
|
| | |
|
| | | }
|
| | |
|
| | | private HongBaoV2 filterWeiQuanINGHongBao(HongBaoV2 hongBao) {
|
| | |
| | | for (HongBaoV2SettleTemp temp : list) {
|
| | | Long hongBaoId = temp.getHongBaoId();
|
| | | HongBaoV2 hongBao = hongBaoV2Mapper.selectByPrimaryKey(hongBaoId);
|
| | | if (sourceType != null)
|
| | | if (hongBao != null)
|
| | | sourceType = hongBao.getOrderType();
|
| | | if (hongBao.getParent() != null)
|
| | | hongBao = hongBao.getParent();
|
| | |
| | | }
|
| | | // 添加资金
|
| | | userMoneyService.addUserMoney(uid, totalMoney, userMoneyDetail);
|
| | | // TODO 添加消息
|
| | | // 添加消息
|
| | | userMoneyMsgNotificationService.inviteOrderSubSidy(uid, new Date(), "系统自动下发", totalMoney,
|
| | | userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.SendResult;
|
| | | import com.aliyun.openservices.ons.api.transaction.LocalTransactionExecuter;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionProducer;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionStatus;
|
| | |
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if(1>0)
|
| | | return;
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.inviteSettleJD(uid);
|
| | |
| | | Message msg = new Message(MQTopicName.TOPIC_ORDER.name(),
|
| | | String.format(MQTagConstant.TAG_ORDER_STATISTIC_PREFIX + "%s-%s", sourceType, hongBaoType),
|
| | | new Gson().toJson(mqMsg).getBytes());
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | SendResult result= orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | int resultCode = 0;
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | if (resultCode != 0)
|
| | | return TransactionStatus.CommitTransaction;
|
| | | else
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | return TransactionStatus.CommitTransaction;
|
| | | // if (resultCode != 0)
|
| | | // return TransactionStatus.CommitTransaction;
|
| | | // else
|
| | | // return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | }, null);
|
| | | System.out.println(result);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.transaction.support.DefaultTransactionDefinition;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.entity.DateInfo;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.SendResult;
|
| | | import com.aliyun.openservices.ons.api.transaction.LocalTransactionExecuter;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionProducer;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionStatus;
|
| | |
| | |
|
| | | @Resource
|
| | | private TokenRecordService tokenRecordService;
|
| | |
|
| | | @Resource(name = "transactionManager")
|
| | | private DataSourceTransactionManager transactionManager;
|
| | |
|
| | | @Resource(name = "orderTransactionProducer")
|
| | | private TransactionProducer orderTransactionProducer;
|
| | |
| | | UserSystemCouponUseMQMsgDTO mqMsg = new UserSystemCouponUseMQMsgDTO(userSystemCoupon.getId(),
|
| | | order.getOrderId(), sourceType);
|
| | | // 事务消息
|
| | | Message msg = new Message(MQTopicName.TOPIC_SYSTEM_COUPON_USE.name(),systemCoupon.getType().name(),
|
| | | Message msg = new Message(MQTopicName.TOPIC_SYSTEM_COUPON_USE.name(), systemCoupon.getType().name(),
|
| | | new Gson().toJson(mqMsg).getBytes());
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
|
| | | return TransactionStatus.CommitTransaction;
|
| | | } catch (UserMoneyDetailException e) {
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | try {
|
| | | SendResult result = orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
|
| | | return TransactionStatus.CommitTransaction;
|
| | | } catch (Exception e) {
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | }
|
| | | }
|
| | | }, null);
|
| | |
|
| | | }, null);
|
| | | System.out.println(result);
|
| | | } catch (Exception e) {
|
| | | throw new Exception();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
|
| | | Order order) throws UserMoneyDetailException {
|
| | | // 1、插入红包数据
|
| | | HongBaoV2 hongBaoV2 = new HongBaoV2();
|
| | | hongBaoV2.setMoney(money);
|
| | | hongBaoV2.setType(HongBaoV2.TYPE_COUPON);
|
| | | hongBaoV2.setState(HongBaoV2.STATE_YILINGQU);
|
| | | hongBaoV2.setVersion(2);
|
| | | hongBaoV2.setCreateTime(new Date());
|
| | | hongBaoV2.setUpdateTime(new Date());
|
| | | hongBaoV2.setUserInfo(new UserInfo(uid));
|
| | | hongBaoV2.setPreGetTime(new Date());
|
| | | hongBaoV2.setGetTime(new Date());
|
| | |
|
| | | hongBaoV2Service.insertSelective(hongBaoV2);
|
| | |
|
| | | // 2.插入关联
|
| | | orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
|
| | |
|
| | | // 3.插入资金明细,用户余额
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(order.getOrderId(),
|
| | | order.getOrderType(), money, new UserInfo(uid));
|
| | | userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
|
| | | userInfoService.addMoney(new UserInfo(uid), money);
|
| | |
|
| | | // 插入资金通知
|
| | | userMoneyMsgNotificationService.orderReward(uid, order.getOrderId(), order.getOrderType(), money,
|
| | | userInfoService.selectByPKey(uid).getMyHongBao());
|
| | |
|
| | | /* 用户券信息状态及记录处理 */
|
| | |
|
| | | Date date = new Date();
|
| | | // 更新券状态:已使用
|
| | | userSystemCoupon.setState(UserSystemCoupon.STATE_END_USE);
|
| | | userSystemCoupon.setUseTime(date);
|
| | | userSystemCoupon.setUpdateTime(date);
|
| | | userSystemCouponMapper.updateByPrimaryKeySelective(userSystemCoupon);
|
| | |
|
| | | // 插入使用券记录
|
| | | UserSystemCouponRecord couponRecord = new UserSystemCouponRecord();
|
| | | couponRecord.setState(UserSystemCouponRecord.STATE_SUCCESS);
|
| | | couponRecord.setGoodSource(order.getOrderType());
|
| | | couponRecord.setOrderNo(order.getOrderId());
|
| | | couponRecord.setUserSystemCoupon(userSystemCoupon);
|
| | | couponRecord.setCouponType(userSystemCoupon.getSystemCoupon().getType().name());
|
| | | couponRecord.setCreateTime(date);
|
| | | couponRecord.setUpdateTime(date);
|
| | | userSystemCouponRecordService.insertSelective(couponRecord);
|
| | |
|
| | | // 消息推送
|
| | | public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
|
| | | Order order) throws Exception {
|
| | | org.springframework.transaction.TransactionStatus transactionStatus = transactionManager
|
| | | .getTransaction(new DefaultTransactionDefinition());
|
| | | try {
|
| | | userOtherMsgNotificationService.rewardCouponUsed(userSystemCoupon, hongBao, money, order.getOrderId());
|
| | | // 1、插入红包数据
|
| | | HongBaoV2 hongBaoV2 = new HongBaoV2();
|
| | | hongBaoV2.setMoney(money);
|
| | | hongBaoV2.setType(HongBaoV2.TYPE_COUPON);
|
| | | hongBaoV2.setState(HongBaoV2.STATE_YILINGQU);
|
| | | hongBaoV2.setVersion(2);
|
| | | hongBaoV2.setCreateTime(new Date());
|
| | | hongBaoV2.setUpdateTime(new Date());
|
| | | hongBaoV2.setUserInfo(new UserInfo(uid));
|
| | | hongBaoV2.setPreGetTime(new Date());
|
| | | hongBaoV2.setGetTime(new Date());
|
| | |
|
| | | hongBaoV2Service.insertSelective(hongBaoV2);
|
| | |
|
| | | // 2.插入关联
|
| | | orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
|
| | |
|
| | | // 3.插入资金明细,用户余额
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(order.getOrderId(),
|
| | | order.getOrderType(), money, new UserInfo(uid));
|
| | | userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
|
| | | userInfoService.addMoney(new UserInfo(uid), money);
|
| | |
|
| | | /* 用户券信息状态及记录处理 */
|
| | |
|
| | | Date date = new Date();
|
| | | // 更新券状态:已使用
|
| | | userSystemCoupon.setState(UserSystemCoupon.STATE_END_USE);
|
| | | userSystemCoupon.setUseTime(date);
|
| | | userSystemCoupon.setUpdateTime(date);
|
| | | userSystemCouponMapper.updateByPrimaryKeySelective(userSystemCoupon);
|
| | |
|
| | | SystemCoupon coupon = systemCouponService.selectByPrimaryKey(userSystemCoupon.getSystemCoupon().getId());
|
| | |
|
| | | // 插入使用券记录
|
| | | UserSystemCouponRecord couponRecord = new UserSystemCouponRecord();
|
| | | couponRecord.setState(UserSystemCouponRecord.STATE_SUCCESS);
|
| | | couponRecord.setGoodSource(order.getOrderType());
|
| | | couponRecord.setOrderNo(order.getOrderId());
|
| | | couponRecord.setUserSystemCoupon(userSystemCoupon);
|
| | | couponRecord.setCouponType(coupon.getType().name());
|
| | | couponRecord.setCreateTime(date);
|
| | | couponRecord.setUpdateTime(date);
|
| | | userSystemCouponRecordService.insertSelective(couponRecord);
|
| | |
|
| | | // 插入资金通知
|
| | | userMoneyMsgNotificationService.orderReward(uid, order.getOrderId(), order.getOrderType(), money,
|
| | | userInfoService.selectByPKey(uid).getMyHongBao());
|
| | | // 消息推送
|
| | | try {
|
| | | userOtherMsgNotificationService.rewardCouponUsed(userSystemCoupon, hongBao, money, order.getOrderId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | transactionManager.commit(transactionStatus);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | e.printStackTrace();
|
| | | transactionManager.rollback(transactionStatus);
|
| | | throw new Exception();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.money.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | |
| | | */
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /*
|
| | | /**
|
| | | * 自动提现消息-微信
|
| | | *
|
| | | * @param extractRecord
|
| | |
| | | */
|
| | | public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu);
|
| | |
|
| | | /**
|
| | | * 补贴消息
|
| | | * |
| | | * @param uid
|
| | | * @param date
|
| | | * @param from
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.util.factory.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 自动提现
|
| | | * 自动提现
|
| | | *
|
| | | * @param extract
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createExtractAutoMsg(ExtractWeiXinRecord extractRecord, String stateDesc, |
| | | String desc, String beiZhu) {
|
| | | public static MsgMoneyDetail createExtractAutoMsg(ExtractWeiXinRecord extractRecord, String stateDesc, String desc,
|
| | | String beiZhu) {
|
| | | if (extractRecord == null)
|
| | | return null;
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 提现失败消息
|
| | | *
|
| | |
| | | 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 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;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) { // 额外补贴
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getStateDesc(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getMoney()), COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("金额", COLOR_TITLE), contentList));
|
| | | |
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getDesc(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
|
| | |
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()), COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | }
|
| | |
|
| | | return null;
|
| | |
| | | import com.yeshi.fanli.exception.money.OrderMoneySettleException;
|
| | | import com.yeshi.fanli.exception.mq.MQUnSendInfoException;
|
| | | import com.yeshi.fanli.exception.order.InviteOrderSubsidyException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService;
|
| | | import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderMoneySettleService;
|
| | |
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
|
| | | if (!Constant.IS_TASK) {// 非任务服务器不能消费消息
|
| | | return Action.ReconsumeLater;
|
| | | }
|
| | | // if (!Constant.IS_TASK) {// 非任务服务器不能消费消息
|
| | | // return Action.ReconsumeLater;
|
| | | // }
|
| | | LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | |
|
| | | if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | // 查询上级红包
|
| | |
| | |
|
| | | Message msg = new Message(MQTopicName.TOPIC_FANLI.name(), "delay", new Gson().toJson(dto).getBytes());
|
| | | msg.setKey(dto.getSourceType() + "_" + dto.getOrderId());
|
| | | long delayTime = System.currentTimeMillis() + 1000 * 60 * 60 * 24L * day;
|
| | | long delayTime = System.currentTimeMillis() + (Constant.IS_TEST ? 1000 * 30L : 1000 * 60 * 60 * 24L * day);
|
| | | msg.setStartDeliverTime(delayTime);
|
| | | SendResult sendResult = producer.send(msg);
|
| | | if (sendResult != null) {
|