Authored by qinchao

发货不再传仓库编号

@@ -1015,6 +1015,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1015,6 +1015,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1015 && Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal()!=buyerOrder.getStatus().byteValue()){ 1015 && Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal()!=buyerOrder.getStatus().byteValue()){
1016 throw new ServiceException(400,"错误:订单状态变化,不允许平台发货"); 1016 throw new ServiceException(400,"错误:订单状态变化,不允许平台发货");
1017 } 1017 }
  1018 + //设订单的归属仓库
  1019 + req.setDepotNo(resetDepot(buyerOrder.getOrderCode()));
  1020 +
1018 //重新设置mobile 1021 //重新设置mobile
1019 restMobileFromBuyer(req,buyerOrder.getOrderCode()); 1022 restMobileFromBuyer(req,buyerOrder.getOrderCode());
1020 1023
@@ -1031,8 +1034,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1031,8 +1034,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1031 public JSONObject sendBackGoodsToSeller(BuyerOrderReq req){ 1034 public JSONObject sendBackGoodsToSeller(BuyerOrderReq req){
1032 LOGGER.info("sendBackGoodsToSeller enter, req is {}", req); 1035 LOGGER.info("sendBackGoodsToSeller enter, req is {}", req);
1033 BuyerOrder buyerOrder = checkForPlatformExpress(req); 1036 BuyerOrder buyerOrder = checkForPlatformExpress(req);
1034 - //重新设置mobile  
1035 - resetMobileFromSeller(req,buyerOrder.getOrderCode());  
1036 1037
1037 //调用前台接口 1038 //调用前台接口
1038 String args ; 1039 String args ;
@@ -1047,6 +1048,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1047,6 +1048,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1047 throw new ServiceException(400,"错误:订单状态不合法,不允许平台寄回"); 1048 throw new ServiceException(400,"错误:订单状态不合法,不允许平台寄回");
1048 } 1049 }
1049 1050
  1051 +
  1052 + //设订单的归属仓库
  1053 + req.setDepotNo(resetDepot(buyerOrder.getOrderCode()));
  1054 +
  1055 + //重新设置mobile
  1056 + resetMobileFromSeller(req,buyerOrder.getOrderCode());
  1057 +
1050 //记录操作日志 1058 //记录操作日志
1051 int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode(); 1059 int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
1052 UserHelper userHelper = new UserHelper(); 1060 UserHelper userHelper = new UserHelper();
@@ -1131,6 +1139,25 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1131,6 +1139,25 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1131 return jsonObject; 1139 return jsonObject;
1132 } 1140 }
1133 */ 1141 */
  1142 +
  1143 +
  1144 + private Integer resetDepot(String orderCode){
  1145 + Integer depotNum=null ;
  1146 + List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Arrays.asList(orderCode));
  1147 + if(CollectionUtils.isNotEmpty(buyerGoodsList)){
  1148 + List<SellerOrderGoods> sellerGoodsList = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(buyerGoodsList.get(0).getSkup()));
  1149 + if(CollectionUtils.isNotEmpty(sellerGoodsList)){
  1150 + depotNum = sellerGoodsList.get(0).getDepotNo();
  1151 + }
  1152 + }
  1153 + LOGGER.info("resetDepot enter, orderCode {} ,depotNum is {}",orderCode, depotNum);
  1154 + if(depotNum==null){
  1155 + LOGGER.warn("resetDepot enter,orderCode {} , depotNum is null", orderCode);
  1156 + throw new ServiceException(400,"错误:订单仓库编号获取为空");
  1157 + }
  1158 + return depotNum;
  1159 + }
  1160 +
1134 //如果前台传的手机号码为空,则重设 1161 //如果前台传的手机号码为空,则重设
1135 private void restMobileFromBuyer(BuyerOrderReq req,String orderCode){ 1162 private void restMobileFromBuyer(BuyerOrderReq req,String orderCode){
1136 LOGGER.info("restMobileFromBuyer enter req = {} ,orderCode = {} ",req,orderCode); 1163 LOGGER.info("restMobileFromBuyer enter req = {} ,orderCode = {} ",req,orderCode);