| | |
| | | }
|
| | | }
|
| | |
|
| | | // 获取维权资金
|
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | try {
|
| | | Map<Long, BigDecimal> userSubMoneyMap = taoBaoWeiQuanDrawBackService.doWeiQuanFanli(orderId, false);
|
| | | if (userSubMoneyMap != null) {
|
| | | for (Iterator<Long> its = userMoney.keySet().iterator(); its.hasNext();) {
|
| | | Long uid = its.next();
|
| | | if (userSubMoneyMap.get(uid) != null) {
|
| | | // 减去维权资金
|
| | | userMoney.put(uid, userMoney.get(uid).subtract(userSubMoneyMap.get(uid)));
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | throw new OrderMoneySettleException(2, "维权订单出错");
|
| | | }
|
| | | }
|
| | |
|
| | | // if (userMoney.isEmpty()) {
|
| | | // throw new OrderMoneySettleException(1, "没有需要结算的订单");
|
| | | // }
|
| | |
| | | userSystemCouponService.updateStateByArrivalAccount(orderId);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 维权扣款(2018-08-05后开始实行)
|
| | |
|
| | | try {
|
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO)
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanFanli(orderId);
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | if (e.getCode() == TaoBaoWeiQuanException.CODE_NEDD_UPDATE_ORDER) {
|
| | | List<TaoBaoOrder> olist = taoBaoOrderService.getTaoBaoOrderByOrderId(orderId);
|
| | | if (olist != null && olist.size() > 0) {
|
| | | long time = TimeUtil.convertToTimeTemp(olist.get(0).getCreateTime(), "yyyy-MM-dd HH:mm:ss");
|
| | | olist = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(time, time + 1000 * 2L, 1);
|
| | | if (olist != null && olist.size() > 0) {
|
| | | for (int i = 0; i < olist.size(); i++) {
|
| | | if (!olist.get(i).getOrderId().equalsIgnoreCase(orderId)) {// 删除无关订单
|
| | | olist.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | taoBaoOrderService.addTaoBaoOrderList(olist);
|
| | | }
|
| | | }
|
| | | } else
|
| | | throw new OrderMoneySettleException(e.getCode(), "维权处理出错:" + e.getMsg());
|
| | | }
|
| | |
|
| | | // 添加结算映射
|