|
|
@@ -44,11 +44,15 @@ import com.fs.his.param.*;
|
|
|
import com.fs.his.service.*;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.vo.*;
|
|
|
+import com.fs.jd.dto.SoQueryRequestDTO;
|
|
|
+import com.fs.jd.dto.SoQueryResponseDTO;
|
|
|
+import com.fs.jd.http.IJdHttpService;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.mapper.SysConfigMapper;
|
|
|
import com.fs.system.service.ISysRoleService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
@@ -126,6 +130,9 @@ public class FsStoreOrderController extends BaseController
|
|
|
|
|
|
@Autowired
|
|
|
private IFsStoreOrderLogsService fsStoreOrderLogsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IJdHttpService jdHttpService;
|
|
|
/**
|
|
|
* 查询订单列表
|
|
|
*/
|
|
|
@@ -787,14 +794,41 @@ public class FsStoreOrderController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('his:storeOrder:getEroOrder')")
|
|
|
@GetMapping("/getEroOrder/{extendOrderId}")
|
|
|
public R getEroOrder(@PathVariable("extendOrderId") String extendOrderId) {
|
|
|
- ErpOrderQueryRequert request = new ErpOrderQueryRequert();
|
|
|
- request.setCode(extendOrderId);
|
|
|
- IErpOrderService erpOrderService = getErpService();
|
|
|
+ FsStoreOrder fsStoreOrder = fsStoreOrderService.selectFsStoreOrderByExtNo(extendOrderId);
|
|
|
ErpOrderQueryResponse response = new ErpOrderQueryResponse();
|
|
|
- if (erpOrderService!=null){
|
|
|
- response = erpOrderService.getOrder(request);
|
|
|
+ if (fsStoreOrder != null) {
|
|
|
+ if (fsStoreOrder.getErpType() == null || fsStoreOrder.getErpType() == 1 || fsStoreOrder.getErpType() == 2) {
|
|
|
+ ErpOrderQueryRequert request = new ErpOrderQueryRequert();
|
|
|
+ request.setCode(extendOrderId);
|
|
|
+ IErpOrderService erpOrderService = getErpService();
|
|
|
+
|
|
|
+ if (erpOrderService!=null){
|
|
|
+ response = erpOrderService.getOrder(request);
|
|
|
+ }
|
|
|
+ } else if (fsStoreOrder.getErpType() == 3) {
|
|
|
+ List<ErpOrderQuery> list = Lists.newArrayList();
|
|
|
+
|
|
|
+ SoQueryRequestDTO dto = new SoQueryRequestDTO();
|
|
|
+ dto.setErpDeliveryNo(fsStoreOrder.getOrderCode());
|
|
|
+ dto.setDeliveryNo(fsStoreOrder.getExtendOrderId());
|
|
|
+ //开放平台事业部编码(货主编码)
|
|
|
+ dto.setOwnerNo("EBU4418057579814");
|
|
|
+ //京东pin
|
|
|
+ dto.setPin("YSY2026");
|
|
|
+ SoQueryResponseDTO soQueryResponseDTO = jdHttpService.queryDelivery(dto);
|
|
|
+ ErpOrderQuery query = new ErpOrderQuery();
|
|
|
+ query.setCode(fsStoreOrder.getOrderCode());
|
|
|
+ query.setExpress_code(soQueryResponseDTO.getCarrierInfo().getExpectDate());
|
|
|
+ query.setExpress_name(soQueryResponseDTO.getCarrierInfo().getCarrierName());
|
|
|
+ query.setCod(false);
|
|
|
+ query.setReceiver_address(soQueryResponseDTO.getReceiverInfo().getDetailAddress());
|
|
|
+ query.setReceiver_mobile(soQueryResponseDTO.getReceiverInfo().getMobile());
|
|
|
+ query.setReceiver_phone(soQueryResponseDTO.getReceiverInfo().getPhone());
|
|
|
+ query.setReceiver_name(soQueryResponseDTO.getReceiverInfo().getName());
|
|
|
+ list.add(query);
|
|
|
+ response.setOrders(list);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
return R.ok().put("data",response);
|
|
|
}
|
|
|
|