Authored by qinchao

手机质检 add

@@ -219,6 +219,19 @@ public class BuyerOrderController { @@ -219,6 +219,19 @@ public class BuyerOrderController {
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 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 + }
  234 +
222 @RequestMapping(value = "/getSendBackInfoBySkup") 235 @RequestMapping(value = "/getSendBackInfoBySkup")
223 public ApiResponse getSendBackInfoBySkup(BuyerOrderReq req) { 236 public ApiResponse getSendBackInfoBySkup(BuyerOrderReq req) {
224 if(null == req || null == req.getSkup()) { 237 if(null == req || null == req.getSkup()) {
@@ -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());
@@ -55,6 +55,8 @@ public interface IBuyerOrderService { @@ -55,6 +55,8 @@ public interface IBuyerOrderService {
55 55
56 List<ExpressCompany> queryAllExpressCompanyList(); 56 List<ExpressCompany> queryAllExpressCompanyList();
57 57
  58 + BuyerOrderResp getSendBackInfoByOrderCode(BuyerOrderReq req);
  59 +
58 BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req); 60 BuyerOrderResp getSendBackInfoBySkup(BuyerOrderReq req);
59 61
60 Map<String, Integer> getCountByOrderStatus(); 62 Map<String, Integer> getCountByOrderStatus();
@@ -63,6 +65,8 @@ public interface IBuyerOrderService { @@ -63,6 +65,8 @@ public interface IBuyerOrderService {
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"));
@@ -879,13 +881,38 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -879,13 +881,38 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
879 return result; 881 return result;
880 } 882 }
881 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 + }
  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)) {
@@ -1069,6 +1099,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1069,6 +1099,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1069 return map; 1099 return map;
1070 } 1100 }
1071 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 + }
  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);
1074 List<ExpressInfo> list = getExpressInfoListByStage(orderCode, expressType); 1120 List<ExpressInfo> list = getExpressInfoListByStage(orderCode, expressType);