| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | EventProperties eventProperties; |
| | | |
| | | /** |
| | | * 根据购物车ID 或者 外部系统ID 或者 custId 或者 channelId 查询订单信息 |
| | | * @param orderList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String queryOrderInfo(OrderList orderList) throws Exception{ |
| | | |
| | | |
| | | List<OrderList> orderLists = iOrderServiceDao.queryOrderListAndAttr(orderList); |
| | | // |
| | | JSONArray orderListsArray = new JSONArray(); |
| | | for (OrderList orderListTmp : orderLists){ |
| | | // |
| | | BusiOrder busiOrderTmp = new BusiOrder(); |
| | | busiOrderTmp.setBoId(orderListTmp.getOlId()); |
| | | |
| | | List<BusiOrder> busiOrders = iOrderServiceDao.queryBusiOrderAndAttr(busiOrderTmp); |
| | | |
| | | JSONObject orderListJSON = JSONObject.parseObject(JSONObject.toJSONString(orderListTmp)); |
| | | |
| | | orderListJSON.put("busiOrders",JSONObject.parseArray(JSONObject.toJSONString(busiOrders))); |
| | | |
| | | orderListsArray.add(orderListJSON); |
| | | } |
| | | |
| | | JSONObject orderListTmpO = new JSONObject(); |
| | | orderListTmpO.put("orderLists",orderListsArray); |
| | | |
| | | return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"查询成功",orderListTmpO); |
| | | } |
| | | |
| | | /** |
| | | * 订单调度 |
| | | * |
| | | * orderListInfo 中字段 asyn 如果为 A 表示 异步处理订单,其他表同步处理订单 |
| | | * @param orderInfo 订单信息 |
| | | * @return 订单处理接口 |
| | | * @throws Exception |
| | |
| | | |
| | | try { |
| | | //发布事件 |
| | | AppEventPublishing.multicastEvent(actionTypeCd,orderInfo.toJSONString(), data.toJSONString()); |
| | | AppEventPublishing.multicastEvent(actionTypeCd,orderInfo.toJSONString(), data.toJSONString(),orderListTmp.getString("asyn")); |
| | | }catch (Exception e){ |
| | | //这里补偿事物 |
| | | throw e; |
| | |
| | | return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",JSONObject.parseObject(JSONObject.toJSONString(orderList))); |
| | | } |
| | | |
| | | /** |
| | | * 作废订单 |
| | | * 根据业务动作作废 |
| | | * 请求协议: |
| | | * { |
| | | * "orderList":{ |
| | | * "transactionId": "1000000200201704113137002690", |
| | | "channelId": "700212896", |
| | | "remarks": "", |
| | | "custId": "701008023904", |
| | | "statusCd": "S", |
| | | "reqTime": "20170411163709", |
| | | "extSystemId": "310013698777", |
| | | "olTypeCd": "15", |
| | | * "oldOlId":"123456789", |
| | | * "asyn":"S" |
| | | * }, |
| | | * "busiOrder":[{ |
| | | * "actionTypeCd":"ALL" |
| | | * }] |
| | | * } |
| | | * |
| | | * , |
| | | * |
| | | * 根据 订单项ID作废 |
| | | * |
| | | * { |
| | | * "orderList":{ |
| | | * "transactionId": "1000000200201704113137002690", |
| | | "channelId": "700212896", |
| | | "remarks": "", |
| | | "custId": "701008023904", |
| | | "statusCd": "S", |
| | | "reqTime": "20170411163709", |
| | | "extSystemId": "310013698777", |
| | | "olTypeCd": "15", |
| | | "asyn":"A" |
| | | * }, |
| | | * "busiOrder":[{ |
| | | * "oldBoId":"123456789" |
| | | * }, |
| | | * { |
| | | * "oldBoId":"123456799" |
| | | * }] |
| | | * } |
| | | * @param orderInfo |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String deleteOrder(JSONObject orderInfo) throws Exception { |
| | | return null; |
| | | } |
| | | |
| | | public IPrimaryKeyService getiPrimaryKeyService() { |
| | | return iPrimaryKeyService; |
| | | } |