| | |
| | | @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("返利到账"),subSidy("额外补贴"); |
| | |
|
| | | share("分享奖金"),
|
| | | invite("邀请奖金"),
|
| | | fanli("返利到账"),
|
| | | extract("提现"),
|
| | | extractAutoWX("自动提现"),
|
| | | extractValid("提现账号验证"),
|
| | | shareWeiQuan("分享奖金扣除"),
|
| | | inviteWeiQuan("邀请奖金扣除"),
|
| | | fanliWeiQuan("返利扣除"),
|
| | | orderReward("返利奖励"),
|
| | | systemEqualize("系统补齐"),
|
| | | fanliElme("返利到账"),
|
| | | subSidy("额外补贴");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeMoneyTypeEnum(String desc) {
|
| | |
| | | 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",""),
|
| | | 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", ""),
|
| | | 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;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.money.extract;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | } 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) {
|
| | |
| | | update.setStateDesc(detail.getStateDesc());
|
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | } 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);
|
| | |
| | | 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))));
|
| | |
| | | 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) {
|
| | |
| | | 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());
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | }
|