Authored by caoyan

Merge branch 'test6.8.6.5' of http://git.yoho.cn/ufo/ufo-platform into test6.8.6.5

... ... @@ -122,7 +122,7 @@ public class BuyerOrderController {
}
}
//鉴定通过,phone端使用
//鉴定通过,手机质检端使用 phone
@RequestMapping(value = "/judgeCenterPass")
public ApiResponse judgeCenterPass(String orderCode) {
LOGGER.info("judgeCenterPass in. req is {}", orderCode);
... ... @@ -134,7 +134,7 @@ public class BuyerOrderController {
}
}
//鉴定通过,phone端使用
//鉴定不通过,只是在手机质检端使用 phone
@RequestMapping(value = "/judgeCenterNotPass")
public ApiResponse judgeCenterNotPass(String orderCode) {
LOGGER.info("judgeCenterNotPass in. req is {}", orderCode);
... ... @@ -146,29 +146,6 @@ public class BuyerOrderController {
}
}
//发货给买家
/*@RequestMapping(value = "/deliverGoods")
public ApiResponse deliverGoods(BuyerOrderReq req) {
LOGGER.info("deliverGoods in. req is {}", req);
JSONObject result = buyerOrderService.deliverGoods(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}*/
//发货给买家
@RequestMapping(value = "/deliveryGoodsToBuyer")
public ApiResponse deliveryGoodsToBuyer(BuyerOrderReq req) {
LOGGER.info("deliveryGoodsToBuyer in. req is {}", req);
JSONObject result = buyerOrderService.deliveryGoodsToBuyer(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
@RequestMapping(value = "/judgeRejectAndDelivery")
public ApiResponse judgeRejectAndDelivery(BuyerOrderReq req) {
... ... @@ -181,11 +158,11 @@ public class BuyerOrderController {
}
}
/*
@RequestMapping(value = "/updateOrderStatus")
public ApiResponse updateOrderStatus(BuyerOrderReq req) {
LOGGER.info("updateOrderStatus in. req is {}", req);
JSONObject result = buyerOrderService.updateOrderStatus(req);
//发货给买家 ,只在手机质检端使用 phone
@RequestMapping(value = "/deliveryGoodsToBuyer")
public ApiResponse deliveryGoodsToBuyer(BuyerOrderReq req) {
LOGGER.info("deliveryGoodsToBuyer in. req is {}", req);
JSONObject result = buyerOrderService.deliveryGoodsToBuyer(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新成功").build();
}else {
... ... @@ -193,9 +170,7 @@ public class BuyerOrderController {
}
}
*/
//寄回给卖家
//寄回给卖家,只在手机质检端使用 phone
@RequestMapping(value = "/sendBackGoodsToSeller")
public ApiResponse sendBackGoodsToSeller(BuyerOrderReq req) {
LOGGER.info("sendBackGoodsToSeller in. req is {}", req);
... ...
... ... @@ -40,16 +40,12 @@ public interface IBuyerOrderService {
JSONObject judgeCenterNotPass(String orderCode);
//JSONObject deliverGoods(BuyerOrderReq req);
JSONObject deliveryGoodsToBuyer(BuyerOrderReq req);
JSONObject judgeRejectAndDelivery(BuyerOrderReq req);
//JSONObject updateOrderStatus(BuyerOrderReq req);
JSONObject sendBackGoodsToSeller(BuyerOrderReq req);
JSONObject judgeRejectAndDelivery(BuyerOrderReq req);
JSONObject returnBackOrderCauseOfJudgeFailure(BuyerOrderReq req);
JSONObject returnBackOrder(BuyerOrderReq req);
... ...
... ... @@ -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()) {
... ...