| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Query;
|
| | | import org.hibernate.SQLQuery;
|
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.order.OrderItemServcie;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountDetailsService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.MoneyRecordService;
|
| | |
| | |
|
| | | @Transactional
|
| | | public void updateHongBao(HongBao hongBao, TaoBaoOrder taoBaoOrder) {
|
| | | BigDecimal rate = new BigDecimal(hongBaoManageMapper.selectByKey("hongbao_goods_proportion").getValue())
|
| | | .divide(new BigDecimal(100));
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal rate = proportion.divide(new BigDecimal(100));
|
| | | // 更新红包项
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hongBao.getId());
|
| | |
| | | public void addHongBao(Order order, TaoBaoOrder taoBaoOrder, Long orderItemId) {
|
| | | OrderItem orderItem = orderItemMapper.selectByPrimaryKey(orderItemId);
|
| | | // 订单返利比例
|
| | | BigDecimal baseRate = new BigDecimal(hongBaoManageMapper.selectByKey("hongbao_goods_proportion").getValue())
|
| | | .divide(new BigDecimal(100));
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal baseRate = proportion.divide(new BigDecimal(100));
|
| | |
|
| | | // 创建红包
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | hongBao.setHasChild(true);
|
| | | }
|
| | |
|
| | | // 如果失效就判定已经失效
|
| | | if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单失效"))
|
| | | hongBao.setState(HongBao.STATE_SHIXIAO);
|
| | |
|
| | | hongBaoMapper.insertSelective(hongBao);
|
| | | // 通知用户订单被统计
|
| | | if (!taoBaoOrder.getOrderState().equalsIgnoreCase("订单失效")) {
|