Authored by qinchao

手机质检 add

... ... @@ -218,6 +218,19 @@ public class BuyerOrderController {
}
return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
}
@RequestMapping(value = "/getSendBackInfoByOrderCode")
public ApiResponse getSendBackInfoByOrderCode(BuyerOrderReq req) {
if(null == req || StringUtils.isEmpty(req.getOrderCode())) {
return new ApiResponse.ApiResponseBuilder().code(500).message("参数有误").build();
}
BuyerOrderResp result = buyerOrderService.getSendBackInfoByOrderCode(req);
if(null == result) {
return new ApiResponse.ApiResponseBuilder().code(500).message("获取寄回信息失败").build();
}
return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
}
@RequestMapping(value = "/getSendBackInfoBySkup")
public ApiResponse getSendBackInfoBySkup(BuyerOrderReq req) {
... ... @@ -245,6 +258,15 @@ public class BuyerOrderController {
return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
}
/**
* 获取平台的发货信息, phone 端使用
*/
@RequestMapping(value = "/queryPlatformExpressList")
public ApiResponse queryPlatformExpressList(BuyerOrderReq req) {
List<ExpressInfoResp> result = buyerOrderService.queryPlatformExpressList(req.getOrderCode());
return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
}
@RequestMapping(value = "/queryExpressList")
public ApiResponse queryExpressList(BuyerOrderReq req) {
List<ExpressInfoResp> result = buyerOrderService.queryExpressList(req.getOrderCode(), req.getExpressTypeStr());
... ...
... ... @@ -54,6 +54,8 @@ public interface IBuyerOrderService {
BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req);
List<ExpressCompany> queryAllExpressCompanyList();
BuyerOrderResp getSendBackInfoByOrderCode(BuyerOrderReq req);
BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req);
... ... @@ -62,7 +64,9 @@ public interface IBuyerOrderService {
OrderDetailResp getOrderDetail(String orderCode);
Map<String,Object> queryExpressListAndAddressInfo(String orderCode, String expressType);
List<ExpressInfoResp> queryPlatformExpressList(String orderCode);
List<ExpressInfoResp> queryExpressList(String orderCode, String expressType);
List<JSONObject> getAreaNames(String parentCode);
... ...
... ... @@ -865,6 +865,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue());
BuyerOrderResp result = new BuyerOrderResp();
result.setReceiveTitle("买家地址");
result.setPlatformWaybillTitle("发货信息");
result.setReceiveName(metaValue.getString("consignee"));
result.setReceiveMobile(metaValue.getString("mobile"));
result.setReceiveAddress(getAddressInfo(metaValue.getString("areaCode")) + metaValue.getString("address"));
... ... @@ -878,14 +880,39 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return result;
}
public BuyerOrderResp getSendBackInfoByOrderCode(BuyerOrderReq req){
LOGGER.info("getSendBackInfoByOrderCode enter ,req is {}", req);
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
if(null == buyerOrder) {
LOGGER.warn("getSendBackInfoByOrderCode return buyerOrder is null ,req is {}", req);
return null;
}
//查询buyer_order_goods
List<BuyerOrderGoods> goodsList = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(buyerOrder.getOrderCode()));
if(CollectionUtils.isEmpty(goodsList)) {
LOGGER.warn("getSendBackInfoByOrderCode return BuyerOrderGoods is null ,req is {}", req);
return null;
}
BuyerOrderGoods goods = goodsList.get(0);
Integer skup = goods.getSkup();
req.setSkup(skup);
return this.getSendBackInfoBySkup(req);
}
public BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req) {
LOGGER.info("getSendBackInfoBySkup enter ,req is {}", req);
SellerOrderMeta meta = sellerOrderMetaMapper.selectBySkupAndKey(req.getSkup(), SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS);
if(null == meta) {
return null;
}
JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue());
BuyerOrderResp result = new BuyerOrderResp();
result.setReceiveTitle("卖家地址");
result.setPlatformWaybillTitle("寄回信息");
result.setReceiveName(metaValue.getString("consignee"));
result.setReceiveMobile(metaValue.getString("mobile"));
result.setReceiveAddress(getAddressInfo(metaValue.getString("areaCode")) + metaValue.getString("address"));
... ... @@ -1049,6 +1076,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
//如果是鉴定不通过或者已取消(买家再卖家发货后取消),则地址是卖家地址
BuyerOrderResp buyerOrderResp = null;
if(buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()
||buyerOrder.getStatus().byteValue() == Constant.CANCEL_QUALITY_CHECK_FAKE.getByteVal()
||buyerOrder.getStatus().byteValue() == Constant.CANCEL_MINI_FAULT_REJECT.getByteVal()
||buyerOrder.getStatus().byteValue() == Constant.CANCEL_MINI_FAULT_OUT_TIME_REJECT.getByteVal()
||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Arrays.asList(orderCode));
if(CollectionUtils.isNotEmpty(buyerGoodsList)) {
... ... @@ -1068,6 +1098,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
map.put("expressInfoRespList",expressInfoRespList);
return map;
}
//平台的发货物流信息
public List<ExpressInfoResp> queryPlatformExpressList(String orderCode){
LOGGER.info("queryPlatformExpressList orderCode is {}", orderCode);
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if(null == buyerOrder) {
return null;
}
String expressType = EXPRESS_TYPE_JUDGE_TO_BUYER+","+EXPRESS_TYPE_JUDGE_TO_SELLER+","+EXPRESS_TYPE_RETURN_BACK_TO_SELLER;
List<ExpressInfoResp> list = queryExpressList(orderCode, expressType);
if(CollectionUtils.isEmpty(list)) {
return Lists.newArrayList();
}
return list;
}
public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);
... ...