| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | //统计分享订单的数据
|
| | | try {
|
| | | hongBao.setAuctionId(order.getAuctionId());
|
| | | userShareGoodsGroupService.updateOrderRecord(hongBao);
|
| | | } catch (UserShareGoodsRecordException e1) {
|
| | | try {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | try {
|
| | | // 第三方提成订单被统计的通知
|
| | | userNotificationService.tiChengStatisticed(hongBao.getUserInfo().getId(),
|
| | | hongBao.getOrderId(), hongBao.getMoney());
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | PidOrder updatePidOrder = new PidOrder();
|
| | | updatePidOrder.setId(order.getId());
|
| | |
| | | hongBao2.setOrderId(order.getOrderId());
|
| | |
|
| | | hongBaoMapper.insertSelective(hongBao2);
|
| | | try {
|
| | | // 第三方提成订单被统计的通知
|
| | | userNotificationService.tiChengStatisticed(hongBao2.getUserInfo().getId(),
|
| | | hongBao2.getOrderId(), hongBao2.getMoney());
|
| | | } catch (Exception e) {
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | |
| | | hongBao3.setOrderId(order.getOrderId());
|
| | | hongBaoMapper.insertSelective(hongBao3);
|
| | |
|
| | | try {
|
| | | // 第三方提成订单被统计的通知
|
| | | userNotificationService.tiChengStatisticed(hongBao3.getUserInfo().getId(),
|
| | | hongBao3.getOrderId(), hongBao3.getMoney());
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | // 结算到账户
|
| | |
|
| | | @Override
|
| | | public void balanceOrder() {
|
| | | // 获取到该月25日可结算的订单
|
| | | List<PidOrder> list = pidOrderMapper.getCanBalanceList(1000);
|
| | | if (list != null) {
|
| | | Map<String, List<PidOrder>> map = parseOrderMap(list);
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String orderId = its.next();
|
| | | List<PidOrder> orders = map.get(orderId);
|
| | | for (int i = 0; i < orders.size(); i++)
|
| | | balanceOrder(orders.get(i));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void compareOrderAndHongBao() {
|
| | | List<PidOrder> list = pidOrderMapper.selectByState("订单付款", 100);
|
| | | list.addAll(pidOrderMapper.selectByState("订单结算", 100));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void balanceOrder(PidOrder pidOrder) {
|
| | | if (pidOrder.getHongBao() == null)
|
| | | return;
|
| | | // 查找红包
|
| | | HongBao hongBao = hongBaoMapper.selectByPrimaryKey(pidOrder.getHongBao().getId());
|
| | | if (hongBao.getState() == HongBao.STATE_SHIXIAO || hongBao.getState() == HongBao.STATE_YILINGQU)
|
| | | return;
|
| | |
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hongBao.getId());
|
| | | updateHongBao.setGetTime(System.currentTimeMillis());
|
| | | updateHongBao.setState(HongBao.STATE_YILINGQU);
|
| | | hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
|
| | |
|
| | | // 加入用户余额
|
| | | userInfoMapper.addHongBaoByUid(hongBao.getUserInfo().getId(), hongBao.getMoney());
|
| | | // 加入账户明细
|
| | | AccountDetails ad = AccountDetailsFactory.create("+" + hongBao.getMoney(), AccountDetailsFactory.SHARE_GOODS,
|
| | | null, null, hongBao.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | try {
|
| | | userNotificationService.tiChengRecieved(hongBao.getUserInfo().getId(), hongBao.getMoney());
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | PidOrder updatePidOrder = new PidOrder();
|
| | | updatePidOrder.setId(pidOrder.getId());
|
| | | updatePidOrder.setAccountBalance(true);
|
| | | updatePidOrder.setAccountBalanceTime(new Date());
|
| | | pidOrderMapper.updateByPrimaryKeySelective(updatePidOrder);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void weiQuan(String orderId) {
|
| | |
| | | AccountDetails ad = AccountDetailsFactory.create("-" + hongBao.getMoney(),
|
| | | AccountDetailsFactory.SHARE_GOODS_DRAWBACK, null, null, hongBao.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | |
| | | |
| | | |
| | |
|
| | | // 维权通知
|
| | | try {
|