Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
# Conflicts:
# fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java
# fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
# fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java
# fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
6个文件已添加
12 文件已复制
30个文件已修改
4 文件已重命名
| | |
| | |
|
| | | // 判断是否需要显示订单找回提示
|
| | | 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 显示订单找回提醒
|
| | | }
|
| | |
| | | private String orderId;// 订单号
|
| | | private BigDecimal money;// 到账金额
|
| | | private Date date;// 到账时间
|
| | | private Boolean orderFirst;// 该订单是否是首次到账
|
| | |
|
| | | public Boolean getOrderFirst() {
|
| | | return orderFirst;
|
| | | }
|
| | |
|
| | | public void setOrderFirst(Boolean orderFirst) {
|
| | | this.orderFirst = orderFirst;
|
| | | }
|
| | |
|
| | | public OrderMoneyRecievedMQMsgDTO() {
|
| | |
|
| | |
| | | @Table("yeshi_ec_msg_account")
|
| | | public class MsgAccountDetail {
|
| | | public enum MsgTypeAccountTypeEnum {
|
| | | bingding("账号绑定"), cancelBinding("取消绑定"), bingdingChange("绑定更换"), update("账号修改"), level("账号等级"), connect("账号合并"),taoBaoAuthFail("账号绑定");
|
| | | bingding("账号绑定"),
|
| | | cancelBinding("取消绑定"),
|
| | | bingdingChange("绑定更换"),
|
| | | update("账号修改"),
|
| | | level("账号等级"),
|
| | | connect("账号合并"),
|
| | | taoBaoAuthFail("账号绑定");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeAccountTypeEnum(String desc) {
|
| | |
| | | @Table("yeshi_ec_msg_invite")
|
| | | public class MsgInviteDetail {
|
| | | public enum MsgTypeInviteTypeEnum {
|
| | | invite("邀请消息"), exchangeCode("恭喜你,邀请码兑换成功"), receiveGift ("领取礼品");
|
| | | invite("邀请消息"), exchangeCode("恭喜你,邀请码兑换成功"), receiveGift("领取礼品");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeInviteTypeEnum(String desc) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Column(name="mi_id")
|
| | | @Column(name = "mi_id")
|
| | | private Long id;
|
| | | @Column(name="mi_uid")
|
| | | @Column(name = "mi_uid")
|
| | | private UserInfo user;
|
| | | @Column(name="mi_type")
|
| | | @Column(name = "mi_type")
|
| | | private MsgTypeInviteTypeEnum msgType;// 消息类型
|
| | | @Column(name="mi_invite_id")
|
| | | @Column(name = "mi_invite_id")
|
| | | private ThreeSale inviteUser;// 邀请信息
|
| | | @Column(name="mi_desc")
|
| | | @Column(name = "mi_desc")
|
| | | private String desc;// 说明
|
| | | @Column(name="mi_beizhu")
|
| | | @Column(name = "mi_beizhu")
|
| | | private String beiZhu;// 备注
|
| | | @Column(name="mi_read")
|
| | | @Column(name = "mi_read")
|
| | | private Boolean read;// 是否已读
|
| | | @Column(name="mi_create_time")
|
| | | @Column(name = "mi_create_time")
|
| | | private Date createTime;
|
| | | @Column(name="mi_update_time")
|
| | | @Column(name = "mi_update_time")
|
| | | private Date updateTime;
|
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | @Table("yeshi_ec_msg_money")
|
| | | public class MsgMoneyDetail {
|
| | | public enum MsgTypeMoneyTypeEnum {
|
| | | |
| | | share("分享奖金"), invite("邀请奖金"), fanli("返利到账"), extract("提现"), extractAutoWX("自动提现"), extractValid("提现账号验证"), shareWeiQuan(
|
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账"), |
| | | redPackGiveOff("赠送红包完成"),redPackReceiveOff("赠送红包领取"),redPackExchangePass("红包提现成功"),redPackExchangeReject("红包提现失败");
|
| | | |
| | | |
| | | share("分享奖金"),
|
| | | invite("邀请奖金"),
|
| | | fanli("返利到账"),
|
| | | extract("提现"),
|
| | | extractAutoWX("自动提现"),
|
| | | extractValid("提现账号验证"),
|
| | | shareWeiQuan("分享奖金扣除"),
|
| | | inviteWeiQuan("邀请奖金扣除"),
|
| | | fanliWeiQuan("返利扣除"),
|
| | | orderReward("返利奖励"),
|
| | | systemEqualize("系统补齐"),
|
| | | fanliElme("返利到账"),
|
| | | subSidy("额外补贴"),
|
| | | redPackGiveOff("赠送红包完成"),
|
| | | redPackReceiveOff("赠送红包领取"),
|
| | | redPackExchangePass("红包提现成功"),
|
| | | redPackExchangeReject("红包提现失败");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeMoneyTypeEnum(String desc) {
|
| | |
| | | private Boolean read;
|
| | | @Column(name = "mm_content") // 消息内容
|
| | | private String content;
|
| | | |
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
| | | public final static int STATE_SX = 4;// 未付款/已退款
|
| | |
|
| | | public enum MsgTypeOrderTypeEnum {
|
| | | fanli("返利订单"), share("分享订单"), invite("邀请订单"), found("订单找回"),elme("饿了么订单");
|
| | | fanli("返利订单"), share("分享订单"), invite("邀请订单"), found("订单找回"), elme("饿了么订单");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeOrderTypeEnum(String desc) {
|
| | |
| | | @Table("yeshi_ec_msg_other")
|
| | | public class MsgOtherDetail {
|
| | | public enum MsgTypeOtherTypeEnum {
|
| | | couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), freeCouponBuy("自购免单券"), |
| | | freeCouponGive("赠送免单券"), couponReward("奖励券"), taoLiJin("推广红包"), give("赠送"), exchange("金币兑换")
|
| | | , couponActivate("免单券激活"), firstOrderReward("队员首单奖励邀请人金币"),systemGive("系统赠送");
|
| | | |
| | | couponMianDan("免单券"),
|
| | | couponWelfareMianDan("福利免单券"),
|
| | | freeCouponBuy("自购免单券"),
|
| | | freeCouponGive("赠送免单券"),
|
| | | couponReward("奖励券"),
|
| | | taoLiJin("推广红包"),
|
| | | give("赠送"),
|
| | | exchange("金币兑换"),
|
| | | couponActivate("免单券激活"),
|
| | | firstOrderReward("队员首单奖励邀请人金币"),
|
| | | systemGive("系统赠送");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeOtherTypeEnum(String desc) {
|
| | |
| | |
|
| | | // 淘礼金参数
|
| | | private MsgOtherTaoLiJinContentDTO taoLiJinContent;
|
| | | |
| | |
|
| | | // 赠送信息
|
| | | private MsgOtherGiveContentDTO giveContent;
|
| | | |
| | |
|
| | | // 金币兑换信息
|
| | | private MsgOtherExchangeContentDTO exchangeContent;
|
| | | |
| | | |
| | |
|
| | | public MsgOtherCouponContentDTO getCoupnContent() {
|
| | | return coupnContent;
|
| | | }
|
| | |
| | | public UserMoneyDetail(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | | |
| | |
|
| | | public UserMoneyDetail() {
|
| | | }
|
| | |
|
| | | public enum UserMoneyDetailTypeEnum {
|
| | | share("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""), invite("邀请奖金", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""), inviteAndShare("奖金收入", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""), fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
|
| | | ""), fanliWeiQuan("返利扣除", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), inviteWeiQuan("邀请奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_invite.png", "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), shareWeiQuan("分享奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_share.png",
|
| | | "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), weiQuan("售后订单扣款", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), systemEqualize("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""), scoreConvert("金币兑换", "http://img.flqapp.com/resource/money_detail/icon_score.png",
|
| | | ""), hongbao("官方红包", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""), hongbaoDeduct("红包退款", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png",
|
| | | ""), buyScore("购买积分", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""), extract("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png",
|
| | | ""), extractVerify("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""), extractReject("提现被拒", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),orderReward("返利奖励金","http://img.flqapp.com/resource/money_detail/icon_order_reward.png",""),repeatStatistic("重复统计返利/奖金扣除","http://img.flqapp.com/resource/money_detail/icon_fanli.png",""), |
| | | elmeFanli("饿了么返利到账","http://img.flqapp.com/resource/money_detail/icon_fanli.png",""),
|
| | | redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png",""),
|
| | | extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | subsidy("额外补贴","","");
|
| | | |
| | | share("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
|
| | | invite("邀请奖金", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
|
| | | inviteAndShare("奖金收入", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
|
| | | fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | fanliWeiQuan("返利扣除",
|
| | | "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
|
| | | "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
|
| | | inviteWeiQuan("邀请奖金扣除",
|
| | | "http://img.flqapp.com/resource/money_detail/icon_invite.png",
|
| | | "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
|
| | | shareWeiQuan("分享奖金扣除",
|
| | | "http://img.flqapp.com/resource/money_detail/icon_share.png",
|
| | | "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
|
| | | weiQuan("售后订单扣款",
|
| | | "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
|
| | | "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
|
| | | systemEqualize("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""),
|
| | | scoreConvert("金币兑换", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
|
| | | hongbao("官方红包", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""),
|
| | | hongbaoDeduct("红包退款", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""),
|
| | | buyScore("购买积分", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
|
| | | extract("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractVerify("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractReject("提现被拒", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | orderReward("返利奖励金", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
|
| | | repeatStatistic("重复统计返利/奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | elmeFanli("饿了么返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
|
| | | extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | subsidy("额外补贴", "http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", "");
|
| | |
|
| | | private final String desc;
|
| | | private final String picture;
|
| | |
| | | @Expose
|
| | | @Column(name = "umd_type")
|
| | | private UserMoneyDetailTypeEnum type;
|
| | | |
| | |
|
| | | @Column(name = "umd_order_type")
|
| | | private Integer orderType;//和订单相关数据才处理
|
| | | |
| | | private Integer orderType;// 和订单相关数据才处理
|
| | |
|
| | | @Expose
|
| | | @Column(name = "umd_title")
|
| | | private String title;// 标题
|
| | |
| | | private Date createTime;
|
| | | @Column(name = "umd_updatetime")
|
| | | private Date updateTime;
|
| | | |
| | | private Integer state;//老版明细适用该字段
|
| | | |
| | |
|
| | | private Integer state;// 老版明细适用该字段
|
| | |
|
| | | @Column(name = "umd_show")
|
| | | private Boolean show;//是否显示
|
| | | private Boolean show;// 是否显示
|
| | |
|
| | | public Boolean getShow() {
|
| | | return show;
|
| | |
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | |
| | |
|
| | | public Integer getOrderType() {
|
| | | return orderType;
|
| | | }
|
| | |
| | | public void setOrderType(Integer orderType) {
|
| | | this.orderType = orderType;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.aliyun.openservices.ons.api.SendResult;
|
| | | import com.yeshi.fanli.entity.mq.MQUnSendInfo;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | /**
|
| | | * 消息任务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Component
|
| | | public class MQJob {
|
| | |
|
| | | @Resource
|
| | | private MQUnSendInfoService mqUnSendInfoService;
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | public MQJob() {
|
| | | }
|
| | |
|
| | | /**
|
| | | * 重新发送消息(2分钟重发一次)
|
| | | */
|
| | | @Scheduled(cron = "0 0/2 * * * ? ")
|
| | | public void retrySendMsg() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | Long maxSendTime = System.currentTimeMillis() - 1000 * 60 * 10L;// 获取10分钟以前发送的消息
|
| | | List<MQUnSendInfo> list = mqUnSendInfoService.listByMaxSendTime(new Date(maxSendTime), 1, 50);
|
| | | if (list != null)
|
| | | for (MQUnSendInfo sendInfo : list) {
|
| | | Message msg = new Message(sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody().getBytes());
|
| | | if (!StringUtil.isNullOrEmpty(sendInfo.getKey()))
|
| | | msg.setKey(sendInfo.getKey());
|
| | | if (sendInfo.getDeliverTime() != null)
|
| | | msg.setStartDeliverTime(sendInfo.getDeliverTime().getTime());
|
| | | SendResult sendResult = producer.send(msg);
|
| | | if (sendResult != null) {
|
| | | mqUnSendInfoService.deleteByPrimaryKey(sendInfo.getId());
|
| | | LogHelper.mqInfo("消息重发成功", sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | @Scheduled(cron = "0 1 5 * * ? ")
|
| | | public void autoAddTLJBuyGoods2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | // if (!Constant.IS_TASK)
|
| | | // return;
|
| | | LogHelper.test("自购立减开始选品");
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd");
|
| | | // 重试3次
|
| | |
| | | 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"> |
| | |
| | | package com.yeshi.fanli.service.impl.money.extract;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | 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;
|
| | |
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.extractAutoWX) {
|
| | | if (detail.getMoney() == null || detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | |
| | |
|
| | | MsgMoneyDetail msg = msgMoneyDetailMapper.selectBySourceIdAndMsgType(detail.getExtract().getId(),
|
| | | MsgTypeMoneyTypeEnum.extractAutoWX);
|
| | | if (msg == null) {
|
| | |
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) {
|
| | | if (detail.getMoney() == null || detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | }
|
| | |
|
| | | userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
|
| | |
| | | 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;
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 通知用户的返利情况
|
| | | */
|
| | |
| | | MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
|
| | | if (mianDan)
|
| | | hongBao.setMoney(commonOrder.getPayment());
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
|
| | | hongBao.setState(HongBaoV2.STATE_KELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
|
| | |
| | | hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
|
| | | hongBao.setState(HongBaoV2.STATE_KELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
|
| | |
| | | }
|
| | |
|
| | | // 以实际收入为准计算预估收益
|
| | | if (CommonOrder.STATE_JS == commonOrder.getState()) {
|
| | | if (CommonOrder.STATE_JS == commonOrder.getState()||CommonOrder.STATE_WQ == commonOrder.getState()) {
|
| | | childUpdate.setMoney(
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), rate.divide(new BigDecimal(100))));
|
| | | if (commonOrder.getThirdCreateTime().getTime() > TimeUtil.convertToTimeTemp("2019-04-16",
|
| | |
| | | hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS||CommonOrder.STATE_WQ == commonOrder.getState()) {
|
| | | hongBao.setState(HongBaoV2.STATE_KELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
|
| | |
| | | hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), shareRate.divide(new BigDecimal(100))));
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
|
| | | hongBao.setState(HongBaoV2.STATE_KELINGQU);
|
| | | hongBao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), shareRate.divide(new BigDecimal(100))));
|
| | |
| | | child.setState(HongBaoV2.STATE_BUKELINGQU);
|
| | | child.setMoney(MoneyBigDecimalUtil.mul(commonOrder.getEstimate(),
|
| | | firstLevelRate.divide(new BigDecimal(100))));
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
|
| | | child.setState(HongBaoV2.STATE_KELINGQU);
|
| | | child.setMoney(MoneyBigDecimalUtil.mul(commonOrder.geteIncome(),
|
| | | firstLevelRate.divide(new BigDecimal(100))));
|
| | |
| | | // 修改状态
|
| | | 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;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | // 查询该订单之前是否有到账
|
| | | List<HongBaoOrder> list = hongBaoOrderMapper.listByOrderIdAndSourceType(
|
| | | hongBaoOrder.getCommonOrder().getOrderNo(), hongBaoOrder.getCommonOrder().getSourceType());
|
| | | List<Long> hongBaoIdList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (HongBaoOrder ho : list) {
|
| | | hongBaoIdList.add(ho.getHongBaoV2().getId());
|
| | | }
|
| | | }
|
| | |
|
| | | List<HongBaoV2> allHongBaoList = hongBaoV2Mapper.listByIds(hongBaoIdList);
|
| | | boolean first = true;
|
| | | for (HongBaoV2 v2 : allHongBaoList)
|
| | | if (v2.getState() == HongBaoV2.STATE_YILINGQU) {
|
| | | first = false;
|
| | | break;
|
| | | }
|
| | |
|
| | | // 自购到账事务消息
|
| | | OrderMoneyRecievedMQMsgDTO mqMsg = new OrderMoneyRecievedMQMsgDTO(OrderMoneyRecievedMQMsgDTO.TYPE_ZIGOU,
|
| | | mainUser.getId(), hongBaoOrder.getCommonOrder().getSourceType(),
|
| | | hongBaoOrder.getCommonOrder().getOrderNo(), null, new Date());
|
| | | mqMsg.setOrderFirst(first);
|
| | | Message msg = new Message(MQTopicName.TOPIC_FANLI.name(), "actual", new Gson().toJson(mqMsg).getBytes());
|
| | | String key = mainUser.getId() + "-" + UUID.randomUUID().toString();
|
| | | msg.setKey(key);
|
| | |
| | | } 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 com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgOrderDetailService msgOrderDetailService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Override
|
| | | public void addWeiQuanOrder(TaoBaoWeiQuanOrder order) {
|
| | |
| | |
|
| | | try {
|
| | | if (order.getState().contains("维权成功")) {
|
| | | // 更改CommonOrder的状态
|
| | | CommonOrder commonOrder = commonOrderService
|
| | | .selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getOrderItemId());
|
| | | if (commonOrder != null) {
|
| | | CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | updateCommonOrder.setState(CommonOrder.STATE_WQ);
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | }
|
| | |
|
| | | List<MsgOrderDetail> msgList = msgOrderDetailService.listMsgOrderByOrderId(order.getOrderId());
|
| | | for (MsgOrderDetail msg : msgList) {
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.fanli) {
|
| | |
| | |
|
| | | 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.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | |
| | | */
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /*
|
| | | /**
|
| | | * 自动提现消息-微信
|
| | | *
|
| | | * @param extractRecord
|
| | |
| | | * 红包消息
|
| | | */
|
| | | public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, 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);
|
| | |
|
| | | }
|
| | |
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.subsidy.name() + "-" + orderType + "-" + uid + "-" + timeF));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(
|
| | | timeF + UserMoneyDetailTypeEnum.subsidy.getDesc() + "[" + Constant.getSourceName(orderType) + "]");
|
| | | timeF + UserMoneyDetailTypeEnum.subsidy.getDesc() + "【" + Constant.getSourceName(orderType) + "】");
|
| | | detail.setType(UserMoneyDetailTypeEnum.subsidy);
|
| | | detail.setDescInfo("邀请订单补贴");
|
| | | detail.setUpdateTime(new Date());
|
| | |
| | | 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/msg/icon_msg_subsidy.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.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",
|
| | | dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现成功
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现拒绝
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.coupon;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | | import com.aliyun.openservices.ons.api.ConsumeContext;
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.order.OrderMoneyRecievedMQMsgDTO;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Component
|
| | | public class SystemCouponMessageListener implements MessageListener {
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | if (MQTopicName.TOPIC_FANLI.name().equalsIgnoreCase(message.getTopic())) {
|
| | | OrderMoneyRecievedMQMsgDTO orderMoneyRecievedMQMsgDTO = new Gson().fromJson(new String(message.getBody()),
|
| | | OrderMoneyRecievedMQMsgDTO.class);
|
| | | if (orderMoneyRecievedMQMsgDTO != null) {
|
| | | if (orderMoneyRecievedMQMsgDTO.getOrderFirst() != null
|
| | | && orderMoneyRecievedMQMsgDTO.getOrderFirst() == true) {
|
| | | // 首次到账返利
|
| | | // TODO 业务代码添加
|
| | |
|
| | | // 业务代码执行成功后返回
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | |
| | | 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) {
|
| | |
| | | task =false
|
| | | outnetwork =false
|
| | | test =false |
| | | test =true |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | | <bean id="systemCouponMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 系统券相关的消息订阅 -->
|
| | | <!-- 订阅到账 -->
|
| | | <entry value-ref="systemCouponMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_FANLI" />
|
| | | <property name="expression" value="actual" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | | </beans> |
copy from fanli/src/main/resource/spring.xml
copy to fanli/src/main/resource/env-dev/spring.xml
File was copied from fanli/src/main/resource/spring.xml |
| | |
| | | </property>
|
| | | </bean>
|
| | |
|
| | | <!-- |
| | | <import resource="classpath:/rocket/consumer.xml"/>
|
| | | <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
|
| | | <import resource="classpath:/rocket/producer.xml"/>
|
| | | <import resource="classpath:/rocket/transactionProducer.xml"/>
|
| | | -->
|
| | |
|
| | | <!--异步定义推荐方式 <task:executor id="executor" pool-size="15" /> <task:scheduler
|
| | | id="scheduler" pool-size="30" /> <task:annotation-driven executor="executor"
|
copy from fanli/src/main/resource/rocket/consumer.xml
copy to fanli/src/main/resource/env-pro-by/rocket/consumer.xml
copy from fanli/src/main/resource/rocket/producer.xml
copy to fanli/src/main/resource/env-pro-by/rocket/producer.xml
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | | <bean id="systemCouponMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 系统券相关的消息订阅 -->
|
| | | <!-- 订阅到账 -->
|
| | | <entry value-ref="systemCouponMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_FANLI" />
|
| | | <property name="expression" value="actual" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | | </beans> |
copy from fanli/src/main/resource/rocket/transactionProducer.xml
copy to fanli/src/main/resource/env-pro-by/rocket/transactionProducer.xml
File was renamed from fanli/src/main/resource/spring.xml |
| | |
| | | </array>
|
| | | </property>
|
| | | </bean>
|
| | | |
| | | <!-- |
| | | <import resource="classpath:/rocket/consumer.xml"/>
|
| | | <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
|
| | | -->
|
| | | <import resource="classpath:/rocket/producer.xml"/>
|
| | | <import resource="classpath:/rocket/transactionProducer.xml"/>
|
| | |
|
copy from fanli/src/main/resource/rocket/consumer.xml
copy to fanli/src/main/resource/env-pro-job/rocket/consumer.xml
copy from fanli/src/main/resource/rocket/producer.xml
copy to fanli/src/main/resource/env-pro-job/rocket/producer.xml
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | | <bean id="systemCouponMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 系统券相关的消息订阅 -->
|
| | | <!-- 订阅到账 -->
|
| | | <entry value-ref="systemCouponMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_FANLI" />
|
| | | <property name="expression" value="actual" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | | </beans> |
copy from fanli/src/main/resource/rocket/transactionProducer.xml
copy to fanli/src/main/resource/env-pro-job/rocket/transactionProducer.xml
copy from fanli/src/main/resource/spring.xml
copy to fanli/src/main/resource/env-pro-job/spring.xml
File was copied from fanli/src/main/resource/spring.xml |
| | |
| | | </bean>
|
| | |
|
| | | <import resource="classpath:/rocket/consumer.xml"/>
|
| | | <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
|
| | | <import resource="classpath:/rocket/producer.xml"/>
|
| | | <import resource="classpath:/rocket/transactionProducer.xml"/>
|
| | |
|
copy from fanli/src/main/resource/rocket/consumer.xml
copy to fanli/src/main/resource/env-pro/rocket/consumer.xml
copy from fanli/src/main/resource/rocket/producer.xml
copy to fanli/src/main/resource/env-pro/rocket/producer.xml
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | | <bean id="systemCouponMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 系统券相关的消息订阅 -->
|
| | | <!-- 订阅到账 -->
|
| | | <entry value-ref="systemCouponMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_FANLI" />
|
| | | <property name="expression" value="actual" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | | </beans> |
copy from fanli/src/main/resource/rocket/transactionProducer.xml
copy to fanli/src/main/resource/env-pro/rocket/transactionProducer.xml
copy from fanli/src/main/resource/spring.xml
copy to fanli/src/main/resource/env-pro/spring.xml
File was copied from fanli/src/main/resource/spring.xml |
| | |
| | | </array>
|
| | | </property>
|
| | | </bean>
|
| | | |
| | | <!--
|
| | | <import resource="classpath:/rocket/consumer.xml"/>
|
| | | <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
|
| | | -->
|
| | | <import resource="classpath:/rocket/producer.xml"/>
|
| | | <import resource="classpath:/rocket/transactionProducer.xml"/>
|
| | |
|
| | |
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.order.HongBaoV2SettleTemp;
|
| | |
|
| | | //@Ignore
|
| | | public class MyBatisProduce {
|
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | MyBatisMapperUtil.createMapper(ElmeOrder.class);
|
| | | MyBatisMapperUtil.createMapper(ElmeHongBaoOrderMap.class);
|
| | | MyBatisMapperUtil.createMapper(HongBaoV2SettleTemp.class);
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | ColumnParseUtil.parseColumn(DeviceActive.class,
|
| | | "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\push\\DeviceActiveMapper.xml");
|
| | | ColumnParseUtil.parseColumn(HongBaoV2.class,
|
| | | "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\hongbao\\HongBaoV2Mapper.xml");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | System.out.println(TaoBaoUtil.filterTaoToken("¥RuPdYM9Knxe¥"));
|
| | | String url = TaoKeApiUtil.officialActivityConvert("19507100253", "1539329391766", "20211660");
|
| | | System.out.println(TaoBaoUtil.filterTaoToken(TaoKeApiUtil.getTKToken(
|
| | | "http://ec-1255749512.file.myqcloud.com/img/FloatAD/a43fdefe735c41f4955a261d43870ff8.png", "淘口令",
|
| | | url)));
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test2() {
|
| | |
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = TaoKeApiUtil.searchGoodsDetail(601535036423L);
|
| | |
|
| | | // goods = TaoKeApiUtil.searchGoodsDetail(601535036423L, new
|
| | | // TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | // TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
|
| | | } catch (TaobaoGoodsDownException e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | System.out.println(goods);
|
| | |
|
| | | // goods = TaoKeApiUtil.searchGoodsDetail(auctionId);
|
| | | String link = TaoKeApiUtil.officialActivityConvert("87140050199", "1571120794546", "20211660");
|
| | | System.out.println(TaoKeApiUtil.getTKToken("http://","母婴预售",link));
|
| | | //https://s.click.taobao.com/t?e=m%3D2%26s%3DW%2Fys7R71JXMcQipKwQzePCperVdZeJviyK8Cckff7TVRAdhuF14FMXC%2FEJQELlNo5x%2BIUlGKNpVpS9y0ojX%2FfMsvmRQfeMsreH9%2FasRClvq63GoCXmcqkTiRUN2xVR4GdesO8XD8dsNdITvXwTxvKDqJgCOacH%2BU%2FVJqtNeEg5OOvkjnk315zzvflh4%2Fhqj8BmyXDtEFdgwjGkouqJtJeds5wF0j1Yhhp1953%2FcnpLUV6UUID4c8TeTEWJdP8jmRdTEuB5K8MGvkLv1nNhnYz%2FB0z8qlrv%2Bjr%2B%2FiM5RbEEle7auY0HPYWszlTEcWhO9mli2vZjCuAmyG1kYtrC7hgcEnE%2FQxigjMfFc2hYciEyAdpuz3kb9JWJVVX36lFeRKtwLUkdbL0syg%2BG8%2FlCRQJ1YlOPkYHNIul3paqKYwK75NNUki5Nwcg2GYz3Bez8Z8OusR9%2BDFlSU%2BcenL13XDY2hrrfx7OMbmkUtLKDKbz1CCoC2zoKs%2FmnEqY%2Bakgpmw&pvid=24980167&union_lens=lensId:0b013a8d_0cec_16df214d979_38a1
|
| | | |
| | | }
|
| | |
|
| | | @Test
|