| | |
| | | */
|
| | | @RequestMapping(value = "getShareGoodsV2", method = RequestMethod.POST)
|
| | | public void getShareGoodsV2(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | List<ShareHotGoods> listHot = shareHotGoodsService.listByDay(day);
|
| | | if (listHot == null) {
|
| | |
| | | public class MsgMoneyDetail {
|
| | | public enum MsgTypeMoneyTypeEnum {
|
| | | share("分享奖金"), invite("邀请奖金"), fanli("返利到账"), extract("提现"), extractValid("提现账号验证"), shareWeiQuan(
|
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐");
|
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeMoneyTypeEnum(String desc) {
|
| | |
| | | "http://apph5.yeshitv.com/apppage/flq_whyMoneyDel.html"), weiQuan("售后订单扣款", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", "http://apph5.yeshitv.com/apppage/flq_whyMoneyDel.html"), 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","");
|
| | | ""), 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","")
|
| | | ;
|
| | | private final String desc;
|
| | | private final String picture;
|
| | | private final String helpUrl;
|
| | |
| | | <select id="listCanBalanceHongBaoByTypeAndUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{uid} and `hb_version`=2 |
| | | from yeshi_ec_hongbao_v2 where `hb_version`=2 |
| | | <if test="uid!=null"> |
| | | and hb_uid=#{uid} |
| | | </if> |
| | | |
| | | <foreach collection="types" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | |
| | | return elmeHongBaoOrderMapMapper.selectByOrderId(orderId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ElmeHongBaoOrderMap selectByHongBaoId(Long hongBaoId) {
|
| | | return elmeHongBaoOrderMapMapper.selectByHongBaoId(hongBaoId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | elmeOrderMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ElmeOrder selectByPrimaryKey(Long id) {
|
| | | return elmeOrderMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createElmeFanliMsg(uid, orderId, money, balance, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.jd.JDOrderItem;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | |
| | | import com.yeshi.fanli.exception.order.OrderItemException;
|
| | | import com.yeshi.fanli.exception.order.TaoBaoWeiQuanException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.elme.ElmeHongBaoOrderMapService;
|
| | | import com.yeshi.fanli.service.inter.elme.ElmeOrderService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | |
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void elmeFanli() {
|
| | |
|
| | | }
|
| | |
|
| | | // 饿了么订单
|
| | | @Resource
|
| | | private ElmeHongBaoOrderMapService elmeHongBaoOrderMapService;
|
| | |
|
| | | @Resource
|
| | | private ElmeOrderService elmeOrderService;
|
| | |
|
| | | /**
|
| | | * 获取饿了么可以返利的红包
|
| | | * |
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public List<HongBaoV2> getCanBalanceElmeFanliHongBao() {
|
| | | List<Integer> list = new ArrayList<>();
|
| | | list.add(HongBaoV2.TYPE_ELME);
|
| | | return hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(list, null, 0, 1000);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void elmeFanli(Long hongBaoId) {
|
| | | // 查询详情
|
| | | HongBaoV2 hongBao = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hongBaoId);
|
| | | if (hongBao.getType() == HongBaoV2.TYPE_ELME && hongBao.getState() == HongBaoV2.STATE_KELINGQU
|
| | | && hongBao.getPreGetTime() != null && System.currentTimeMillis() > hongBao.getPreGetTime().getTime()) {// 可以到账了
|
| | | // 判断用户状态
|
| | | UserInfo user = userInfoMapper.selectByPrimaryKey(hongBao.getUserInfo().getId());
|
| | | if (user == null || user.getState() != UserInfo.STATE_NORMAL)
|
| | | return;
|
| | | ElmeHongBaoOrderMap map = elmeHongBaoOrderMapService.selectByHongBaoId(hongBaoId);
|
| | | if (map == null)
|
| | | return;
|
| | | ElmeOrder order = elmeOrderService.selectByPrimaryKey(map.getElmeOrder().getId());
|
| | | if (order == null)
|
| | | return;
|
| | |
|
| | | // 到账,加数据
|
| | | HongBaoV2 update = new HongBaoV2(hongBao.getId());
|
| | | update.setUpdateTime(new Date());
|
| | | update.setGetTime(new Date());
|
| | | update.setState(HongBaoV2.STATE_YILINGQU);
|
| | | hongBaoV2Mapper.updateByPrimaryKeySelective(update);
|
| | | // 增加资金
|
| | | UserMoneyDetail detail = null;
|
| | | try {
|
| | | detail = UserMoneyDetailFactory.createElmeFanLi(hongBao.getUserInfo().getId(), order.getOrderId(),
|
| | | hongBao.getId(), hongBao.getMoney());
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | userMoneyService.addUserMoney(hongBao.getUserInfo().getId(), hongBao.getMoney(), detail);
|
| | | BigDecimal balance = userInfoMapper.selectByPrimaryKey(hongBao.getUserInfo().getId()).getMyHongBao();
|
| | | // 添加消息
|
| | | userMoneyMsgNotificationService.elmeFanli(hongBao.getUserInfo().getId(), order.getOrderId(),
|
| | | hongBao.getMoney(), balance);
|
| | | }
|
| | | // 返利到账
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public ElmeHongBaoOrderMap selectByOrderId(Long orderId);
|
| | |
|
| | | /**
|
| | | * 根据hongBaoId查询
|
| | | * |
| | | * @param hongBaoId
|
| | | * @return
|
| | | */
|
| | | public ElmeHongBaoOrderMap selectByHongBaoId(Long hongBaoId);
|
| | | }
|
| | |
| | | * @param order
|
| | | */
|
| | | public void addOrder(ElmeOrder order) throws ElmeOrderException;
|
| | |
|
| | | public ElmeOrder selectByPrimaryKey(Long id);
|
| | |
|
| | | }
|
| | |
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void fanliOrderReceived(Long uid, String orderId,int orderType, int goodsCount, BigDecimal money, BigDecimal balance);
|
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 返利订单维权
|
| | |
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId,int orderType, BigDecimal money, BigDecimal balance);
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 分享赚订单被统计
|
| | |
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void shareOrderReceived(Long uid,int orderType, int orderCount, int goodsCount, BigDecimal money, BigDecimal balance);
|
| | | public void shareOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 分享订单维权
|
| | |
| | | * @param balance
|
| | | */
|
| | |
|
| | | public void shareOrderWeiQuan(Long uid, String orderId,int orderType, BigDecimal money, BigDecimal balance);
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 邀请赚订单被统计
|
| | |
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void inviteOrderReceived(Long uid,int orderType, int orderCount, int goodsCount, BigDecimal money, BigDecimal balance);
|
| | | public void inviteOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 邀请订单维权
|
| | |
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId,int orderType, BigDecimal money, BigDecimal balance);
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 奖励订单到账
|
| | |
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void orderReward(Long uid, String orderId,int orderType, BigDecimal money, BigDecimal balance);
|
| | | public void orderReward(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 系统补齐
|
| | |
| | | */
|
| | | public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 饿了么返利到账
|
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void doTaoBaoSellerNotPaid(TaoBaoOrder order);
|
| | |
|
| | | /**
|
| | | * 获取可以返利的饿了么红包
|
| | | * @return
|
| | | */
|
| | | public List<HongBaoV2> getCanBalanceElmeFanliHongBao();
|
| | |
|
| | | /**
|
| | | * 饿了么返利
|
| | | * @param hongBaoId
|
| | | */
|
| | | public void elmeFanli(Long hongBaoId);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 饿了么返利
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param hbId
|
| | | * @param money
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createElmeFanLi(Long uid, String orderId, Long hbId, BigDecimal money)
|
| | | throws UserMoneyDetailException {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | | throw new UserMoneyDetailException(1, "订单号为空");
|
| | |
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "返利金额为空");
|
| | |
|
| | | if (uid == null)
|
| | | throw new UserMoneyDetailException(1, "UID为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.elmeFanli.name() + "-" + hbId));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.elmeFanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.elmeFanli);
|
| | | detail.setDescInfo("订单号:" + orderId);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | detail.setOrderType(Constant.SOURCE_TYPE_ELME);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享奖金到账
|
| | | *
|
| | | * @param uid
|
| | |
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | public static MsgMoneyDetail createElmeFanliMsg(Long uid, String orderId, BigDecimal money, BigDecimal balance,
|
| | | String beiZhu) {
|
| | | if (money == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.fanliElme);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(orderId, COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList, true));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList, false));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getType().getDesc(), COLOR_CONTENT));
|
| | |
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.fanliElme) {
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("饿了么", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("渠道来源", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | // 返利到账
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), 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("¥" + filterMoney(msg.getBalance()) + "", COLOR_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_fanli.png", "返利到账",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.invite || msg.getMsgType() == MsgTypeMoneyTypeEnum.share) {
|
| | |
|
| | | contentList = new ArrayList<>();
|