|
@@ -132,44 +132,53 @@ public class ApiOrderController extends ApiBaseAction {
|
|
|
|
|
|
//查询物流轨迹
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
+
|
|
|
+ if(orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())
|
|
|
+ && orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_301.getItem())){
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("AcceptStation", "交易完成,用户已提走");
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
OrderProcessRecordEntity entity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrder_sn());
|
|
|
- if(entity !=null){
|
|
|
- if(Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend())){
|
|
|
+ if (entity != null) {
|
|
|
+ if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend())) {
|
|
|
Map map = new HashMap();
|
|
|
- map.put("AcceptTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getCustomsSuccTime()));
|
|
|
+ map.put("AcceptTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getCustomsSuccTime()));
|
|
|
map.put("AcceptStation", "订单清关完成,等待仓库发货");
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
- if(Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsPaymentSend())){
|
|
|
+ if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsPaymentSend())) {
|
|
|
Map map = new HashMap();
|
|
|
- map.put("AcceptTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getPaySuccTime()));
|
|
|
+ map.put("AcceptTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getPaySuccTime()));
|
|
|
map.put("AcceptStation", "订单支付成功,等待海关清关");
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
- if(Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsAddOrderSend())){
|
|
|
+ if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsAddOrderSend())) {
|
|
|
Map map = new HashMap();
|
|
|
- map.put("AcceptTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getAddOrderSuccTime()));
|
|
|
+ map.put("AcceptTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getAddOrderSuccTime()));
|
|
|
map.put("AcceptStation", "订单提交成功");
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no())) {
|
|
|
- JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
|
|
|
- if(Traces != null){
|
|
|
- mapList = (List<Map>) Traces.get("Traces");
|
|
|
- String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
|
|
|
- if(Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)){
|
|
|
- Map noDataMap = new HashMap();
|
|
|
- noDataMap.put("AcceptTime","");
|
|
|
- noDataMap.put("AcceptStation",Traces.get("Reason"));
|
|
|
- mapList.add(noDataMap);
|
|
|
+ if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
|
|
|
+ if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no())) {
|
|
|
+ JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
|
|
|
+ if (Traces != null) {
|
|
|
+ mapList = (List<Map>) Traces.get("Traces");
|
|
|
+ String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
|
|
|
+ if (Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)) {
|
|
|
+ Map noDataMap = new HashMap();
|
|
|
+ noDataMap.put("AcceptTime", "");
|
|
|
+ noDataMap.put("AcceptStation", Traces.get("Reason"));
|
|
|
+ mapList.add(noDataMap);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
resultObj.put("wuliu", mapList != null && mapList.size() > 0 ? mapList.get(0) : null);
|
|
|
|
|
|
if(orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_401.getItem()) || orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_402.getItem()) ) {
|
|
|
- MallOrderRefund refundInfo = apiOrderRefundService.queryObjectByOrderSn(String.valueOf(orderInfo.getId()));
|
|
|
+ MallOrderRefund refundInfo = apiOrderRefundService.queryObjectByOrderId(String.valueOf(orderInfo.getId()));
|
|
|
resultObj.put("refundInfo", refundInfo);
|
|
|
}
|
|
|
|
|
@@ -290,28 +299,35 @@ public class ApiOrderController extends ApiBaseAction {
|
|
|
}
|
|
|
List<WuliuVo> wuliuList = new ArrayList<WuliuVo>();
|
|
|
|
|
|
- if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no())) {
|
|
|
- // 快递
|
|
|
- JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
|
|
|
- List<Map> mapList = (List<Map>) Traces.get("Traces");
|
|
|
- for (int i=0;i<mapList.size();i++){
|
|
|
- WuliuVo vo = new WuliuVo();
|
|
|
- vo.setAcceptTime((String)mapList.get(i).get("AcceptTime"));
|
|
|
- vo.setAcceptStation((String)mapList.get(i).get("AcceptStation"));
|
|
|
- wuliuList.add(vo);
|
|
|
- }
|
|
|
+ if(orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())
|
|
|
+ && orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_301.getItem())){
|
|
|
+ WuliuVo vo = new WuliuVo();
|
|
|
+ vo.setAcceptStation("交易完成,用户已提走");
|
|
|
+ wuliuList.add(vo);
|
|
|
+ }
|
|
|
+ if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())) {
|
|
|
+ if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no())) {
|
|
|
+ // 快递
|
|
|
+ JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
|
|
|
+ List<Map> mapList = (List<Map>) Traces.get("Traces");
|
|
|
+ for (int i = 0; i < mapList.size(); i++) {
|
|
|
+ WuliuVo vo = new WuliuVo();
|
|
|
+ vo.setAcceptTime((String) mapList.get(i).get("AcceptTime"));
|
|
|
+ vo.setAcceptStation((String) mapList.get(i).get("AcceptStation"));
|
|
|
+ wuliuList.add(vo);
|
|
|
+ }
|
|
|
|
|
|
- String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
|
|
|
- String Reason = (String) Traces.get("Reason");
|
|
|
- if(Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)){
|
|
|
- WuliuVo wuliuVo = new WuliuVo();
|
|
|
- wuliuVo.setAcceptStation(Reason);
|
|
|
- wuliuList.add(wuliuVo);
|
|
|
+ String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
|
|
|
+ String Reason = (String) Traces.get("Reason");
|
|
|
+ if (Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)) {
|
|
|
+ WuliuVo wuliuVo = new WuliuVo();
|
|
|
+ wuliuVo.setAcceptStation(Reason);
|
|
|
+ wuliuList.add(wuliuVo);
|
|
|
+ }
|
|
|
+ map.put("State", Traces.get("State")); //物流状态:2-在途中,3-签收,4-问题件
|
|
|
+ map.put("Reason", Traces.get("Reason"));
|
|
|
}
|
|
|
- map.put("State", Traces.get("State")); //物流状态:2-在途中,3-签收,4-问题件
|
|
|
- map.put("Reason", Traces.get("Reason"));
|
|
|
}
|
|
|
-
|
|
|
OrderProcessRecordEntity entity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrder_sn());
|
|
|
if(entity !=null){
|
|
|
if(Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend())){
|
|
@@ -359,9 +375,7 @@ public class ApiOrderController extends ApiBaseAction {
|
|
|
// orderVo.setOrder_status(Integer.parseInt(Dict.orderStatus.item_400.getItem()));
|
|
|
// orderVo.setId(orderInfo.getId());
|
|
|
// orderService.update(orderVo);//修改状态为维权申请中
|
|
|
-
|
|
|
- MallOrderRefund mallOrderRefund = apiOrderRefundService.queryObjectByOrderSn(orderInfo.getId()+"");
|
|
|
-
|
|
|
+ MallOrderRefund mallOrderRefund = apiOrderRefundService.queryObjectByOrderId(orderInfo.getId()+"");
|
|
|
MallOrderRefund orderRefund = new MallOrderRefund();
|
|
|
orderRefund.setOrderId(Integer.parseInt(orderId));
|
|
|
orderRefund.setUserId(Integer.parseInt(orderInfo.getUser_id()+""));
|
|
@@ -374,10 +388,9 @@ public class ApiOrderController extends ApiBaseAction {
|
|
|
apiOrderRefundService.update(orderRefund);
|
|
|
}else{
|
|
|
orderRefund.setCreateTime(new Date());
|
|
|
- if (apiOrderRefundService.save(orderRefund)>0) {
|
|
|
- return toResponsMsgSuccess("退款申请成功");
|
|
|
- }
|
|
|
+ apiOrderRefundService.save(orderRefund);
|
|
|
}
|
|
|
+ return toResponsMsgSuccess("退款申请成功");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|