| | |
| | | String notifyImg = configService.getAppHomeFloatNotifyImg();
|
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | | //
|
| | | String config = configService.get("home_float_img_new");
|
| | | if (!StringUtil.isNullOrEmpty(config)) {
|
| | | data.put("floatImgDetail", config);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | |
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult(3, "商品已下架"));
|
| | | return;
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "获取商品简版详情出错", auctionId + "");
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | pid = Constant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | |
| | | volist.add(vo);
|
| | | }
|
| | |
|
| | | Long time = userInfoService.getUserById(uid).getCreatetime();
|
| | | Long time = userInfoService.selectByPKey(uid).getCreatetime();
|
| | | if (time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd"))
|
| | | count++;// 计算欢迎语的数量
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.order.OrderHongBaoMap; |
| | | |
| | | public interface OrderHongBaoMapMapper extends BaseMapper<OrderHongBaoMap>{ |
| | | |
| | | |
| | | } |
| | |
| | | public class MsgMoneyDetail {
|
| | | public enum MsgTypeMoneyTypeEnum {
|
| | | share("分享奖金"), invite("邀请奖金"), fanli("返利到账"), extract("提现"), extractValid("提现账号验证"), shareWeiQuan(
|
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除");
|
| | | "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"),orderReward("奖励订单");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeMoneyTypeEnum(String desc) {
|
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
|
| | | /**
|
| | | * 订单与红包关联(用于订单活动)
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_order_hongbaov2_map")
|
| | | public class OrderHongBaoMap {
|
| | | @Column(name = "ohm_id")
|
| | | private Long id;
|
| | | @Column(name = "ohm_order_id")
|
| | | private Order order;// 订单
|
| | | @Column(name = "ohm_hongbao_id")
|
| | | private HongBaoV2 hongBao;
|
| | | @Column(name = "ohm_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Order getOrder() {
|
| | | return order;
|
| | | }
|
| | |
|
| | | public void setOrder(Order order) {
|
| | | this.order = order;
|
| | | }
|
| | |
|
| | | public HongBaoV2 getHongBao() {
|
| | | return hongBao;
|
| | | }
|
| | |
|
| | | public void setHongBao(HongBaoV2 hongBao) {
|
| | | this.hongBao = hongBao;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.OrderHongBaoMapMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.OrderHongBaoMap"> |
| | | <id column="ohm_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="ohm_create_time" property="createTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <association property="order" column="ohm_order_id" |
| | | javaType="com.yeshi.fanli.entity.bus.user.Order"> |
| | | <id column="ohm_order_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | <association property="hongBao" column="ohm_hongbao_id" |
| | | javaType="com.yeshi.fanli.entity.bus.user.HongBaoV2"> |
| | | <id column="ohm_hongbao_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ohm_id,ohm_order_id,ohm_hongbao_id,ohm_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_order_hongbaov2_map where ohm_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_order_hongbaov2_map where ohm_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.OrderHongBaoMap" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_order_hongbaov2_map |
| | | (ohm_id,ohm_order_id,ohm_hongbao_id,ohm_create_time) values |
| | | (#{id,jdbcType=BIGINT},#{order.id,jdbcType=BIGINT},#{hongBao.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.OrderHongBaoMap" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_order_hongbaov2_map |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ohm_id,</if> |
| | | <if test="order != null">ohm_order_id,</if> |
| | | <if test="hongBao != null">ohm_hongbao_id,</if> |
| | | <if test="createTime != null">ohm_create_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="order != null">#{order.id,jdbcType=BIGINT},</if> |
| | | <if test="hongBao != null">#{hongBao.id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.OrderHongBaoMap">update |
| | | yeshi_ec_order_hongbaov2_map set ohm_order_id = |
| | | #{order.id,jdbcType=BIGINT},ohm_hongbao_id = |
| | | #{hongBao.id,jdbcType=BIGINT},ohm_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP} where ohm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.OrderHongBaoMap"> |
| | | update yeshi_ec_order_hongbaov2_map |
| | | <set> |
| | | <if test="order != null">ohm_order_id=#{order.id,jdbcType=BIGINT},</if> |
| | | <if test="hongBao != null">ohm_hongbao_id=#{hongBao.id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">ohm_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where ohm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderReward(Long uid, String orderId, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderRewardMsg(uid, orderId, money, balance, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderHongBaoMapMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.order.OrderHongBaoMap;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMapService;
|
| | |
|
| | | @Service
|
| | | public class OrderHongBaoMapServiceImpl implements OrderHongBaoMapService {
|
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMapMapper orderHongBaoMapMapper;
|
| | |
|
| | | @Override
|
| | | public void addOrderHongBaoMap(HongBaoV2 hongBao, Order order) {
|
| | | if (hongBao == null)
|
| | | return;
|
| | | if (order == null)
|
| | | return;
|
| | | OrderHongBaoMap map = new OrderHongBaoMap();
|
| | | map.setCreateTime(new Date());
|
| | | map.setHongBao(hongBao);
|
| | | map.setOrder(order);
|
| | | orderHongBaoMapMapper.insertSelective(map);
|
| | | }
|
| | | }
|
| | |
| | | if (!StringUtil.isNullOrEmpty(mainUser.getPhone()) && !StringUtil.isNullOrEmpty(lessUser.getPhone()))
|
| | | throw new UserAccountException(9, "两个账号都绑定了手机号码,请解绑其中一个");
|
| | |
|
| | | if (lessUser.getMyHongBao().compareTo(new BigDecimal("20")) >= 0
|
| | | && mainUser.getMyHongBao().compareTo(new BigDecimal("20")) > 0)
|
| | | throw new UserAccountException(10, String.format("账户ID:%s 的资金超过20元,为保证资金安全请联系客服打通", lessUser.getId() + ""));
|
| | | if (lessUser.getMyHongBao().compareTo(new BigDecimal("10")) >= 0
|
| | | && mainUser.getMyHongBao().compareTo(new BigDecimal("10")) > 0)
|
| | | throw new UserAccountException(10, String.format("账户ID:%s 的资金超过10元,为保证资金安全请联系客服打通", lessUser.getId() + ""));
|
| | |
|
| | | // 判定是否绑定了同一支付宝
|
| | | List<BindingAccount> mainUserAccountList = bindingAccountMapper.selectByUid(mainUser.getId());
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Override
|
| | | public void addUserMoneyDetail(UserMoneyDetail detail) throws UserMoneyDetailException {
|
| | | if (detail == null || detail.getMoney() == null || detail.getType() == null || detail.getUserInfo() == null)
|
| | | throw new UserMoneyDetailException(1, "信息不完整");
|
| | | userMoneyDetailMapper.insertSelective(detail);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime) {
|
| | | List<UserMoneyDetailHistoryVO> finalList = new ArrayList<>();
|
| | | List<UserMoneyDetail> list = null;
|
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponRecordVO;
|
| | |
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMapService orderHongBaoMapService;
|
| | |
|
| | | @Resource
|
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | |
|
| | | // 券失效图片
|
| | | public final static String PIC_INVALID= "http://192.168.1.200/icon/mian_invalid.png";
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public int insertSelective(UserSystemCoupon record) {
|
| | |
| | | state = UserSystemCoupon.STATE_END_USE;
|
| | | userCouponVO.setState(state);
|
| | | }
|
| | | |
| | |
|
| | | // 按钮跳转
|
| | |
|
| | |
| | | listCouponId.add(systemCoupon.getId());
|
| | | }
|
| | |
|
| | | List<UserSystemCouponVO> listVO = userSystemCouponMapper.getEnableListByCouponId(uid, activated,
|
| | | listCouponId);
|
| | | List<UserSystemCouponVO> listVO = userSystemCouponMapper.getEnableListByCouponId(uid, activated, listCouponId);
|
| | |
|
| | | if (listVO == null || listVO.size() == 0) {
|
| | | return null;
|
| | |
| | | userSystemCouponRecordService.insertSelective(couponRecord);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo) throws UserSystemCouponException, Exception {
|
| | |
|
| | |
| | | // 条件: A:必须是返利订单 、B:必须已经处于已到账状态
|
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType && HongBaoV2.STATE_YILINGQU == hongBaoState || hongBao != null) {
|
| | |
|
| | | Order order = orderService.findOrderByOrderIdAndType(orderNo, Order.ORDER_TYPE_TAOBAO);
|
| | | if (order == null)
|
| | | return;
|
| | |
|
| | | /* 奖金计算 以及相关红包信息处理 */
|
| | |
|
| | | // 转换成小数点
|
| | |
| | | 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、订单关联红包表
|
| | | HongBaoOrder hongBaoOrder = new HongBaoOrder();
|
| | | hongBaoOrder.setHongBaoV2(hongBaoV2);
|
| | | hongBaoOrder.setCommonOrder(new CommonOrder(commonOrderId));
|
| | | hongBaoOrderService.insertSelective(hongBaoOrder);
|
| | | // 2.插入关联
|
| | | orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
|
| | |
|
| | | // TODO 红包相关信息插入以及通知
|
| | | // 3.插入资金明细,用户余额
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(orderNo, money,
|
| | | new UserInfo(uid));
|
| | | userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
|
| | | userInfoService.addMoney(new UserInfo(uid), money);
|
| | |
|
| | | // 插入资金通知
|
| | | userMoneyMsgNotificationService.orderReward(uid, orderNo, money,
|
| | | userInfoService.selectByPKey(uid).getMyHongBao());
|
| | |
|
| | | /* 用户券信息状态及记录处理 */
|
| | |
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public UserSystemCouponRecordVO getRewardCouponRecord(String orderNo) throws UserSystemCouponException, Exception {
|
| | |
| | | return userRecordVO;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public UserSystemCouponRecordVO getFreeCouponRecord(String orderNo) throws UserSystemCouponException, Exception {
|
| | |
|
| | |
| | | ClientTextStyleVO payMoney = new ClientTextStyleVO();
|
| | | payMoney.setContent("实付款:¥"+ orderVO.getPayment().setScale(2, BigDecimal.ROUND_DOWN));
|
| | | payMoney.setColor("#000000"); // 默认黑色
|
| | | |
| | |
|
| | | String progressMsg = "";
|
| | | String progressColor = "";
|
| | |
| | | */
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 奖励订单到账
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | */
|
| | | public void orderReward(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
|
| | | /**
|
| | | * 订单红包对应表用于活动)
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface OrderHongBaoMapService {
|
| | |
|
| | | /**
|
| | | * 添加红包订单映射
|
| | | * |
| | | * @param hongBao
|
| | | * @param order
|
| | | */
|
| | | public void addOrderHongBaoMap(HongBaoV2 hongBao, Order order);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
|
| | | /**
|
| | |
| | | public interface UserMoneyDetailService {
|
| | |
|
| | | /**
|
| | | * 添加用户资金记录
|
| | | * |
| | | * @param detail
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public void addUserMoneyDetail(UserMoneyDetail detail) throws UserMoneyDetailException;
|
| | |
|
| | | /**
|
| | | * 客户端查询用户的资金记录
|
| | | *
|
| | | * @param uid
|
| | |
| | | public static final String TAOBAO_RELATION_PID_DEFAULT = "mm_124933865_56750082_87140050199";
|
| | | public static final String TAOBAO_SPECIAL_PID_DEFAULT = "mm_124933865_56750082_89555600043";
|
| | |
|
| | | // 返回给客户端的账号封禁提示语
|
| | | public static final String FORBIDDEN_USER_REASON_DESC = "你的账号或绑定的第三方账号已被封禁,封禁原因可在帮助中心的相关规则中参看,如有疑问或申诉解除封禁请联系客服";
|
| | |
|
| | | // 用户被封禁
|
| | | public static final int CODE_FORBIDDEN_USER = 80001;
|
| | |
|
| | | // 来源-淘宝
|
| | | public static final int SOURCE_TYPE_TAOBAO = 1;
|
| | | // 来源-京东
|
| | |
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId+"-"+hbId));
|
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbId));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanli);
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返利奖励
|
| | | * |
| | | * @param orderId
|
| | | * @param money
|
| | | * @param user
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createOrderReward(String orderId, BigDecimal money, UserInfo user)
|
| | | throws UserMoneyDetailException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | | throw new UserMoneyDetailException(1, "订单号不能为空");
|
| | | if (user == null)
|
| | | throw new UserMoneyDetailException(1, "UID不能为空");
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "金额不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + "老版本" + "-" + orderId));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.hongbao.getDesc());
|
| | | detail.setSubTitle("返利奖励");
|
| | | detail.setType(UserMoneyDetailTypeEnum.hongbao);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(user);
|
| | | detail.setDescInfo("订单号:" + orderId);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | public static MsgMoneyDetail createOrderRewardMsg(Long uid, String orderId, BigDecimal money, BigDecimal balance,
|
| | | String beiZhu) {
|
| | | if (money == null || orderId == 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.orderReward);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.orderReward) {//奖励订单
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | |
|
| | | 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("¥" + MoneyBigDecimalUtil.getWithNoZera(msg.getMoney()) + "",
|
| | | COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("奖金扣除", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(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_invite_money.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | }
|
| | |
|
| | | return null;
|