| | |
| | | import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
|
| | | import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoods;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.entity.shop.ChargeTypeEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackDetailException;
|
| | | import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
|
| | | import com.yeshi.fanli.exception.shop.FuLuChargeException;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
|
| | |
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.charge.FuLuChargeApiUtil;
|
| | | import com.yeshi.fanli.util.email.MailSenderUtil;
|
| | | import com.yeshi.fanli.util.factory.RedPackDetailFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void payOrderByMoney(Long orderId, BigDecimal money) throws BanLiShopOrderException {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | |
| | | * 支付成功
|
| | | */
|
| | | private void paySuccess(BanLiShopOrder order) {
|
| | | ThreadUtil.run(new Runnable() {
|
| | | |
| | | @Override
|
| | | public void run() {
|
| | | long[] targetUids = new long[] { 3L, 4L };
|
| | | Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
|
| | | String[] sts = config.getValue().split(",");
|
| | | String account = sts[0];
|
| | | String pwd = sts[1];
|
| | | for (long adminId : targetUids) {
|
| | | AdminUser adminUser = adminUserService.selectByPrimaryKey(adminId);
|
| | | String msg = "有新的红包商城订单";
|
| | | boolean isS = MailSenderUtil.sendEmail(adminUser.getEmail(), account, pwd, "有新的红包商城订单", msg);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | |
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void refund(Long orderId) throws BanLiShopOrderException {
|
| | | // 订单退款
|
| | |
| | | order.setMoneyPaymentState(BanLiShopOrder.PAY_STATE_REFUNDING);
|
| | | // 发送退款消息
|
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
|
| | | Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
|
| | | OrderTopicTagEnum.banLiShopOrderRefund.name(), new Gson().toJson(msg).getBytes());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER,
|
| | | OrderTopicTagEnum.banLiShopOrderRefund, msg);
|
| | | message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 * 5L);// 延时24小时通知检测微信退款状态
|
| | | SendResult result = producer.send(message);
|
| | | if (result == null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void charge(Long orderId) throws BanLiShopOrderException {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKey(orderId);
|