|
@@ -225,66 +225,56 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -225,66 +225,56 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
225
|
return result;
|
225
|
return result;
|
226
|
}
|
226
|
}
|
227
|
|
227
|
|
228
|
- public int updateOrderStatus(BuyerOrderReq req) {
|
228
|
+ public JSONObject updateOrderStatus(BuyerOrderReq req) {
|
229
|
if(null == req.getId() || null == req.getStatus()) {
|
229
|
if(null == req.getId() || null == req.getStatus()) {
|
230
|
- return 0;
|
230
|
+ return null;
|
231
|
}
|
231
|
}
|
232
|
|
232
|
|
233
|
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
|
233
|
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
|
234
|
if(null == buyerOrder) {
|
234
|
if(null == buyerOrder) {
|
235
|
- return 0;
|
235
|
+ return null;
|
236
|
}
|
236
|
}
|
237
|
|
237
|
|
238
|
//调用前台接口
|
238
|
//调用前台接口
|
239
|
String args = "";
|
239
|
String args = "";
|
240
|
int resultCode = 200;
|
240
|
int resultCode = 200;
|
|
|
241
|
+ JSONObject jsonObject = new JSONObject();
|
241
|
if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal()) {//鉴定通过
|
242
|
if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal()) {//鉴定通过
|
242
|
args = "orderAppraise.appraiseSuccess";
|
243
|
args = "orderAppraise.appraiseSuccess";
|
243
|
- resultCode = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
244
|
+ jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
244
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {//鉴定不通过
|
245
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {//鉴定不通过
|
245
|
args = "orderAppraise.appraiseFail";
|
246
|
args = "orderAppraise.appraiseFail";
|
246
|
- resultCode = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
247
|
+ jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
247
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货
|
248
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货
|
248
|
args = "ufo-gateway.confirmReceive";
|
249
|
args = "ufo-gateway.confirmReceive";
|
249
|
- resultCode = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
250
|
+ jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
250
|
}
|
251
|
}
|
251
|
|
252
|
|
252
|
- if(resultCode != 200) {
|
|
|
253
|
- return 0;
|
253
|
+ if(resultCode == 200) {
|
|
|
254
|
+ buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
|
254
|
}
|
255
|
}
|
255
|
|
256
|
|
256
|
- return buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
|
257
|
+ return jsonObject;
|
257
|
}
|
258
|
}
|
258
|
|
259
|
|
259
|
- private int asyncCallConfirmReceive(String args, String orderCode) {
|
260
|
+ private JSONObject asyncCallConfirmReceive(String args, String orderCode) {
|
260
|
OrderRequest request = new OrderRequest();
|
261
|
OrderRequest request = new OrderRequest();
|
261
|
request.setOrderCode(Long.valueOf(orderCode));
|
262
|
request.setOrderCode(Long.valueOf(orderCode));
|
262
|
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5);
|
263
|
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5);
|
263
|
LOGGER.info("call ufo-gateway interface is {},result is {}", args, jsonObject.toJSONString());
|
264
|
LOGGER.info("call ufo-gateway interface is {},result is {}", args, jsonObject.toJSONString());
|
264
|
- return jsonObject.getIntValue("code");
|
265
|
+ return jsonObject;
|
265
|
}
|
266
|
}
|
266
|
|
267
|
|
267
|
- private int asyncCallAppraise(String args, String orderCode, BuyerOrderReq req) {
|
268
|
+ private JSONObject asyncCallAppraise(String args, String orderCode, BuyerOrderReq req) {
|
268
|
AppraiseExpressInfoBo bo = new AppraiseExpressInfoBo();
|
269
|
AppraiseExpressInfoBo bo = new AppraiseExpressInfoBo();
|
269
|
bo.setOrderCode(Long.valueOf(orderCode));
|
270
|
bo.setOrderCode(Long.valueOf(orderCode));
|
270
|
bo.setExpressCompanyId(req.getExpressCompanyId());
|
271
|
bo.setExpressCompanyId(req.getExpressCompanyId());
|
271
|
bo.setWayBillCode(req.getWaybillCode());
|
272
|
bo.setWayBillCode(req.getWaybillCode());
|
272
|
bo.setDepotNum(req.getDepotNo());
|
273
|
bo.setDepotNum(req.getDepotNo());
|
273
|
- JSONObject jsonObject = null;
|
|
|
274
|
- LOGGER.info("appraise orderCode is {},startTime is {}", orderCode, DateUtil.getCurrentTimeSecond());
|
|
|
275
|
- try {
|
|
|
276
|
- jsonObject = serviceCaller.asyncCall(args, bo, JSONObject.class).get(5);
|
|
|
277
|
- } catch (Exception e) {
|
|
|
278
|
- LOGGER.error("appraise fail!!! orderCode is {}, error is {}", orderCode,e.getMessage());
|
|
|
279
|
- }finally {
|
|
|
280
|
- LOGGER.info("appraise orderCode is {}, endTime is {}", orderCode, DateUtil.getCurrentTimeSecond());
|
|
|
281
|
- }
|
274
|
+ JSONObject jsonObject = serviceCaller.asyncCall(args, bo, JSONObject.class).get(5);
|
|
|
275
|
+ LOGGER.info("call ufo-gateway interface is {},result is {}", args, jsonObject.toJSONString());
|
282
|
|
276
|
|
283
|
- if(null == jsonObject) {
|
|
|
284
|
- return 0;
|
|
|
285
|
- }
|
|
|
286
|
- LOGGER.info("call ufo-gateway interface is {}, result is {}", args, jsonObject.toJSONString());
|
|
|
287
|
- return jsonObject.getIntValue("code");
|
277
|
+ return jsonObject;
|
288
|
}
|
278
|
}
|
289
|
|
279
|
|
290
|
public BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req) {
|
280
|
public BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req) {
|