Authored by qinchao

手机质检 add

@@ -218,6 +218,19 @@ public class BuyerOrderController { @@ -218,6 +218,19 @@ public class BuyerOrderController {
218 } 218 }
219 return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build(); 219 return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
220 } 220 }
  221 +
  222 + @RequestMapping(value = "/getSendBackInfoByOrderCode")
  223 + public ApiResponse getSendBackInfoByOrderCode(BuyerOrderReq req) {
  224 + if(null == req || StringUtils.isEmpty(req.getOrderCode())) {
  225 + return new ApiResponse.ApiResponseBuilder().code(500).message("参数有误").build();
  226 + }
  227 +
  228 + BuyerOrderResp result = buyerOrderService.getSendBackInfoByOrderCode(req);
  229 + if(null == result) {
  230 + return new ApiResponse.ApiResponseBuilder().code(500).message("获取寄回信息失败").build();
  231 + }
  232 + return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
  233 + }
221 234
222 @RequestMapping(value = "/getSendBackInfoBySkup") 235 @RequestMapping(value = "/getSendBackInfoBySkup")
223 public ApiResponse getSendBackInfoBySkup(BuyerOrderReq req) { 236 public ApiResponse getSendBackInfoBySkup(BuyerOrderReq req) {
@@ -245,6 +258,15 @@ public class BuyerOrderController { @@ -245,6 +258,15 @@ public class BuyerOrderController {
245 return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build(); 258 return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
246 } 259 }
247 260
  261 + /**
  262 + * 获取平台的发货信息, phone 端使用
  263 + */
  264 + @RequestMapping(value = "/queryPlatformExpressList")
  265 + public ApiResponse queryPlatformExpressList(BuyerOrderReq req) {
  266 + List<ExpressInfoResp> result = buyerOrderService.queryPlatformExpressList(req.getOrderCode());
  267 + return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
  268 + }
  269 +
248 @RequestMapping(value = "/queryExpressList") 270 @RequestMapping(value = "/queryExpressList")
249 public ApiResponse queryExpressList(BuyerOrderReq req) { 271 public ApiResponse queryExpressList(BuyerOrderReq req) {
250 List<ExpressInfoResp> result = buyerOrderService.queryExpressList(req.getOrderCode(), req.getExpressTypeStr()); 272 List<ExpressInfoResp> result = buyerOrderService.queryExpressList(req.getOrderCode(), req.getExpressTypeStr());
@@ -54,6 +54,8 @@ public interface IBuyerOrderService { @@ -54,6 +54,8 @@ public interface IBuyerOrderService {
54 BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req); 54 BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req);
55 55
56 List<ExpressCompany> queryAllExpressCompanyList(); 56 List<ExpressCompany> queryAllExpressCompanyList();
  57 +
  58 + BuyerOrderResp getSendBackInfoByOrderCode(BuyerOrderReq req);
57 59
58 BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req); 60 BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req);
59 61
@@ -62,7 +64,9 @@ public interface IBuyerOrderService { @@ -62,7 +64,9 @@ public interface IBuyerOrderService {
62 OrderDetailResp getOrderDetail(String orderCode); 64 OrderDetailResp getOrderDetail(String orderCode);
63 65
64 Map<String,Object> queryExpressListAndAddressInfo(String orderCode, String expressType); 66 Map<String,Object> queryExpressListAndAddressInfo(String orderCode, String expressType);
65 - 67 +
  68 + List<ExpressInfoResp> queryPlatformExpressList(String orderCode);
  69 +
66 List<ExpressInfoResp> queryExpressList(String orderCode, String expressType); 70 List<ExpressInfoResp> queryExpressList(String orderCode, String expressType);
67 71
68 List<JSONObject> getAreaNames(String parentCode); 72 List<JSONObject> getAreaNames(String parentCode);
@@ -865,6 +865,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -865,6 +865,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
865 } 865 }
866 JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue()); 866 JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue());
867 BuyerOrderResp result = new BuyerOrderResp(); 867 BuyerOrderResp result = new BuyerOrderResp();
  868 + result.setReceiveTitle("买家地址");
  869 + result.setPlatformWaybillTitle("发货信息");
868 result.setReceiveName(metaValue.getString("consignee")); 870 result.setReceiveName(metaValue.getString("consignee"));
869 result.setReceiveMobile(metaValue.getString("mobile")); 871 result.setReceiveMobile(metaValue.getString("mobile"));
870 result.setReceiveAddress(getAddressInfo(metaValue.getString("areaCode")) + metaValue.getString("address")); 872 result.setReceiveAddress(getAddressInfo(metaValue.getString("areaCode")) + metaValue.getString("address"));
@@ -878,14 +880,39 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -878,14 +880,39 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
878 880
879 return result; 881 return result;
880 } 882 }
  883 +
  884 + public BuyerOrderResp getSendBackInfoByOrderCode(BuyerOrderReq req){
  885 + LOGGER.info("getSendBackInfoByOrderCode enter ,req is {}", req);
  886 + BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
  887 + if(null == buyerOrder) {
  888 + LOGGER.warn("getSendBackInfoByOrderCode return buyerOrder is null ,req is {}", req);
  889 + return null;
  890 + }
  891 +
  892 + //查询buyer_order_goods
  893 + List<BuyerOrderGoods> goodsList = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(buyerOrder.getOrderCode()));
  894 + if(CollectionUtils.isEmpty(goodsList)) {
  895 + LOGGER.warn("getSendBackInfoByOrderCode return BuyerOrderGoods is null ,req is {}", req);
  896 + return null;
  897 + }
  898 +
  899 + BuyerOrderGoods goods = goodsList.get(0);
  900 + Integer skup = goods.getSkup();
  901 + req.setSkup(skup);
  902 + return this.getSendBackInfoBySkup(req);
  903 +
  904 + }
881 905
882 public BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req) { 906 public BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req) {
  907 + LOGGER.info("getSendBackInfoBySkup enter ,req is {}", req);
883 SellerOrderMeta meta = sellerOrderMetaMapper.selectBySkupAndKey(req.getSkup(), SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS); 908 SellerOrderMeta meta = sellerOrderMetaMapper.selectBySkupAndKey(req.getSkup(), SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS);
884 if(null == meta) { 909 if(null == meta) {
885 return null; 910 return null;
886 } 911 }
887 JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue()); 912 JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue());
888 BuyerOrderResp result = new BuyerOrderResp(); 913 BuyerOrderResp result = new BuyerOrderResp();
  914 + result.setReceiveTitle("卖家地址");
  915 + result.setPlatformWaybillTitle("寄回信息");
889 result.setReceiveName(metaValue.getString("consignee")); 916 result.setReceiveName(metaValue.getString("consignee"));
890 result.setReceiveMobile(metaValue.getString("mobile")); 917 result.setReceiveMobile(metaValue.getString("mobile"));
891 result.setReceiveAddress(getAddressInfo(metaValue.getString("areaCode")) + metaValue.getString("address")); 918 result.setReceiveAddress(getAddressInfo(metaValue.getString("areaCode")) + metaValue.getString("address"));
@@ -1049,6 +1076,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1049,6 +1076,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1049 //如果是鉴定不通过或者已取消(买家再卖家发货后取消),则地址是卖家地址 1076 //如果是鉴定不通过或者已取消(买家再卖家发货后取消),则地址是卖家地址
1050 BuyerOrderResp buyerOrderResp = null; 1077 BuyerOrderResp buyerOrderResp = null;
1051 if(buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal() 1078 if(buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()
  1079 + ||buyerOrder.getStatus().byteValue() == Constant.CANCEL_QUALITY_CHECK_FAKE.getByteVal()
  1080 + ||buyerOrder.getStatus().byteValue() == Constant.CANCEL_MINI_FAULT_REJECT.getByteVal()
  1081 + ||buyerOrder.getStatus().byteValue() == Constant.CANCEL_MINI_FAULT_OUT_TIME_REJECT.getByteVal()
1052 ||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){ 1082 ||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){
1053 List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Arrays.asList(orderCode)); 1083 List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Arrays.asList(orderCode));
1054 if(CollectionUtils.isNotEmpty(buyerGoodsList)) { 1084 if(CollectionUtils.isNotEmpty(buyerGoodsList)) {
@@ -1068,6 +1098,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1068,6 +1098,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1068 map.put("expressInfoRespList",expressInfoRespList); 1098 map.put("expressInfoRespList",expressInfoRespList);
1069 return map; 1099 return map;
1070 } 1100 }
  1101 +
  1102 + //平台的发货物流信息
  1103 + public List<ExpressInfoResp> queryPlatformExpressList(String orderCode){
  1104 + LOGGER.info("queryPlatformExpressList orderCode is {}", orderCode);
  1105 + BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
  1106 + if(null == buyerOrder) {
  1107 + return null;
  1108 + }
  1109 +
  1110 + String expressType = EXPRESS_TYPE_JUDGE_TO_BUYER+","+EXPRESS_TYPE_JUDGE_TO_SELLER+","+EXPRESS_TYPE_RETURN_BACK_TO_SELLER;
  1111 + List<ExpressInfoResp> list = queryExpressList(orderCode, expressType);
  1112 + if(CollectionUtils.isEmpty(list)) {
  1113 + return Lists.newArrayList();
  1114 + }
  1115 + return list;
  1116 + }
1071 1117
1072 public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) { 1118 public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
1073 LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType); 1119 LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);