...
|
...
|
@@ -778,6 +778,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
//qualityCheckMapper.insert(record);
|
|
|
LOGGER.info("qualityCheckNotPass insert db success! orderCode={},record={}", orderCode,record);
|
|
|
|
|
|
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,请重新刷新列表");
|
|
|
}
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_NOT_PASS.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
...
|
...
|
@@ -818,6 +822,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
//qualityCheckMapper.insert(record);
|
|
|
LOGGER.info("miniFaultCreate insert db success! orderCode={}, record={}", orderCode,record);
|
|
|
|
|
|
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,请重新刷新列表");
|
|
|
}
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_MINI_FAULT.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
...
|
...
|
@@ -885,7 +893,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
//鉴定通过 :更新订单状态为judge_pass ,期望状态有两种情况:平台鉴定中或者瑕疵接受了
|
|
|
//鉴定通过 :平台收货后,直接鉴定通过
|
|
|
public JSONObject judgeCenterPass(String orderCode){
|
|
|
if(StringUtils.isBlank(orderCode)){
|
|
|
throw new ServiceException(400,"参数错误");
|
...
|
...
|
@@ -896,8 +904,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
throw new ServiceException(400,"订单不存在");
|
|
|
}
|
|
|
|
|
|
if( Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()!=buyerOrder.getStatus().byteValue()
|
|
|
&& Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,鉴定通过失败,请重新刷新列表");
|
|
|
}
|
|
|
|
...
|
...
|
@@ -915,24 +922,32 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
//发货
|
|
|
public JSONObject deliveryGoodsToBuyer(BuyerOrderReq req){
|
|
|
LOGGER.info("deliveryGoodsToBuyer enter, req is {}", req);
|
|
|
BuyerOrder buyerOrder = checkForPlatformExpress(req);
|
|
|
String args = "orderAppraise.deliveryGoodsToBuyer";
|
|
|
if( Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,不允许平台发货");
|
|
|
//鉴定不通过 : 平台收货后,直接鉴定不通过
|
|
|
public JSONObject judgeCenterNotPass(String orderCode){
|
|
|
if(StringUtils.isBlank(orderCode)){
|
|
|
throw new ServiceException(400,"参数错误");
|
|
|
}
|
|
|
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
if(null == buyerOrder) {
|
|
|
throw new ServiceException(400,"订单不存在");
|
|
|
}
|
|
|
|
|
|
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,鉴定不通过失败,请重新刷新列表");
|
|
|
}
|
|
|
//重新设置mobile
|
|
|
restMobileFromBuyer(req,buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
|
|
|
int operateType =OperateTypeEnum.ONLY_JUDGE_REJECT.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
|
|
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
LOGGER.info("deliveryGoodsToBuyer saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
String args = "orderAppraise.judgeCenterNotPass";
|
|
|
LOGGER.info("judgeCenterNotPass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
|
|
JSONObject jsonObject = asyncCallJudgeResultUpdate(args, buyerOrder.getOrderCode());
|
|
|
LOGGER.info("judgeCenterNotPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -967,6 +982,30 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return buyerOrder;
|
|
|
}
|
|
|
|
|
|
//发货
|
|
|
public JSONObject deliveryGoodsToBuyer(BuyerOrderReq req){
|
|
|
LOGGER.info("deliveryGoodsToBuyer enter, req is {}", req);
|
|
|
BuyerOrder buyerOrder = checkForPlatformExpress(req);
|
|
|
String args = "orderAppraise.deliveryGoodsToBuyer";
|
|
|
|
|
|
//鉴定通过后或者用户接受瑕疵,可直接发货
|
|
|
if( Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal()!=buyerOrder.getStatus().byteValue()
|
|
|
&& Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,不允许平台发货");
|
|
|
}
|
|
|
//重新设置mobile
|
|
|
restMobileFromBuyer(req,buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
|
|
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
LOGGER.info("deliveryGoodsToBuyer saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
public JSONObject sendBackGoodsToSeller(BuyerOrderReq req){
|
|
|
LOGGER.info("sendBackGoodsToSeller enter, req is {}", req);
|
|
|
BuyerOrder buyerOrder = checkForPlatformExpress(req);
|
...
|
...
|
@@ -996,39 +1035,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
//鉴定通过 :更新订单状态为judge_pass ,期望状态有两种情况:平台鉴定中或者瑕疵接受了
|
|
|
public JSONObject judgeCenterNotPass(String orderCode){
|
|
|
if(StringUtils.isBlank(orderCode)){
|
|
|
throw new ServiceException(400,"参数错误");
|
|
|
}
|
|
|
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
if(null == buyerOrder) {
|
|
|
throw new ServiceException(400,"订单不存在");
|
|
|
}
|
|
|
|
|
|
if( Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()!=buyerOrder.getStatus().byteValue()
|
|
|
&& Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,鉴定通过失败,请重新刷新列表");
|
|
|
}
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.ONLY_JUDGE_REJECT.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
|
|
|
|
|
|
String args = "orderAppraise.judgeCenterNotPass";
|
|
|
LOGGER.info("judgeCenterNotPass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
|
|
JSONObject jsonObject = asyncCallJudgeResultUpdate(args, buyerOrder.getOrderCode());
|
|
|
LOGGER.info("judgeCenterNotPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//鉴定不通过
|
|
|
public JSONObject judgeRejectAndDelivery(BuyerOrderReq req){
|
|
|
if(null == req.getId()) {
|
...
|
...
|
|