| | |
| | | import com.yeshi.fanli.entity.order.HongBaoOrder; |
| | | |
| | | public interface HongBaoOrderMapper extends BaseMapper<HongBaoOrder> { |
| | | |
| | | /** |
| | | * 根据订单ID查询对象 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | HongBaoOrder selectByCommonOrderId(Long id); |
| | | |
| | | |
| | | } |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_hongbao_order where ho_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByCommonOrderId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_hongbao_order where ho_order_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_hongbao_order where ho_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.HongBaoOrder" |
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.HongBaoException;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private OrderMapper orderMapper;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Override
|
| | | public int insert(HongBaoV2 record) {
|
| | |
| | | orderId = hb.getOrderId();
|
| | |
|
| | | int count = commonOrderMapper.countByOrderNOAndOrderType(orderId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | |
| | |
|
| | | // 已经插入订单
|
| | | if (count > 0)
|
| | |
| | | commonOrder.setCommonOrderGoods(goods);
|
| | |
|
| | | commonOrder.setUserInfo(list.get(i).getUserInfo());
|
| | | commonOrder.setCreateTime(new Date(list.get(i).getCreatetime())); |
| | | commonOrder.setCreateTime(new Date(list.get(i).getCreatetime()));
|
| | |
|
| | | // TODO 维权判断
|
| | | commonOrderMapper.insertSelective(commonOrder);
|
| | |
|
| | | // 插入红包
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Override
|
| | | public void addHongBao(CommonOrder commonOrder, int type) throws HongBaoException {
|
| | | if (commonOrder == null || commonOrder.getId() == null || commonOrder.getUserInfo() == null)
|
| | | throw new HongBaoException(1, "订单信息不完整");
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder == null) {
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
|
| | |
|
| | | } else if (type == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | |
|
| | | } else
|
| | | throw new HongBaoException(2, "type错误");
|
| | |
|
| | | } else {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | hongBaoMap.put("fontColor", hongbaoInfoFontColor);
|
| | | order.setHongBaoInfo(hongBaoMap);
|
| | | }
|
| | | }
|
| | | |
| | | } |
| | |
|
| | | @Override
|
| | | public List<CommonOrder> listBySourceTypeAndOrderId(int sourceType, String orderId) {
|
| | | |
| | | |
| | | |
| | | return null;
|
| | | } |
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.HongBaoException;
|
| | |
|
| | | public interface HongBaoV2Service {
|
| | |
|
| | |
| | |
|
| | | public HongBaoV2 selectByPrimaryKey(Long id);
|
| | |
|
| | |
|
| | | /**
|
| | | * 添加红包
|
| | | * @param commonOrder 订单对象
|
| | | * @param type 类型
|
| | | * @throws HongBaoException
|
| | | */
|
| | | public void addHongBao(CommonOrder commonOrder,int type) throws HongBaoException;
|
| | |
|
| | | /**
|
| | | * 将老版本的红包对象转为新版本的对象
|
| | | *
|
| | |
| | | public int insertSelective(CommonOrder record);
|
| | |
|
| | | public int updateByPrimaryKey(CommonOrder record);
|
| | | |
| | | public int updateByPrimaryKeySelective(CommonOrder record);
|
| | | |
| | | public int deleteByPrimaryKey(Long id);
|
| | | |
| | | public CommonOrder selectByPrimaryKey(Long id);
|
| | |
|
| | | public int updateByPrimaryKeySelective(CommonOrder record);
|
| | |
|
| | | public int deleteByPrimaryKey(Long id);
|
| | |
|
| | | public CommonOrder selectByPrimaryKey(Long id);
|
| | |
|
| | | /**
|
| | | * 查询用户订单 并订单号分组
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param state
|
| | | * @param type
|
| | | * @param orderNo 订单号
|
| | | * @param startTime 起始系统录入时间
|
| | | * @param endTime 结束系统录入时间
|
| | | * @param orderNo
|
| | | * 订单号
|
| | | * @param startTime
|
| | | * 起始系统录入时间
|
| | | * @param endTime
|
| | | * 结束系统录入时间
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state,
|
| | | Integer type,Integer orderState,String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
|
| | | throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 统计查询
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @param type
|
| | |
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | long countGroupOrderNoByUid(Long uid, Integer state, Integer type,Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | | |
| | | long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
|
| | | String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 移动段订单列表
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid 用户id
|
| | | * @param type 到账状态
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param type
|
| | | * 到账状态
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | | public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 统计订单-根据红包类型 自购 邀请 分享
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public Map<String, BigDecimal> countOrderByHongBaoType(Long uid, Integer day);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 统计订单
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countOrder(Long uid, Integer type, Integer isToday);
|
| | | |
| | |
|
| | | /**
|
| | | * 统计订单
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countOrderMoney(Long uid, Integer type, Integer isToday);
|
| | | public BigDecimal countOrderMoney(Long uid, Integer type, Integer isToday);
|
| | |
|
| | | /**
|
| | | * 根据条件统计
|
| | | * |
| | | * @param uid
|
| | | * @param type
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime,
|
| | | String endTime, Integer day);
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day);
|
| | |
|
| | | /**
|
| | | * 根据订单号与订单类型查询订单
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrder> listBySourceTypeAndOrderId(int sourceType, String orderId);
|
| | |
|
| | | }
|