作者 王勇

新舱单服务,简单改动

... ... @@ -2,6 +2,7 @@ package com.sunyo.wlpt.cgonms.provide.controller;
import com.sunyo.wlpt.cgonms.provide.domain.*;
import com.sunyo.wlpt.cgonms.provide.feign.GetCgoAsmFeign;
import com.sunyo.wlpt.cgonms.provide.feign.GetDataWareHouseFeign;
import com.sunyo.wlpt.cgonms.provide.feign.GetTransportFeign;
import com.sunyo.wlpt.cgonms.provide.service.*;
import org.springframework.web.bind.annotation.*;
... ... @@ -41,10 +42,14 @@ public class CgoNmsController {
@Resource
private GetTransportFeign getTransportFeign;
@Resource
GetDataWareHouseFeign getDataWareHouseFeign;
/**
* 根据航班日期获取出新舱单服务中的响应数据
* 根据航班日期、航班号,获取出出港业务统计数据
*
* @param flightDate 航班日期
* @param flightNo 航班号
* @return {@link ResultExitData}
*/
@GetMapping("/getInfo")
... ... @@ -117,11 +122,13 @@ public class CgoNmsController {
result.setAimStation(pm.get(0).getDestinationStation());
}
}
System.out.println("新舱单服务,获取完毕");
System.out.println("代理人服务,开始获取");
List<ResultExitData> asmInfo = getCgoAsmFeign.getInfo(resultList);
List<ResultExitData> asmInfo = getCgoAsmFeign.getInfo(resultList);
System.out.println("运输工具服务,开始获取");
List<ResultExitData> info = getTransportFeign.getInfo(asmInfo);
List<ResultExitData> transportInfo = getTransportFeign.getInfo(asmInfo);
System.out.println("数据仓库服务,开始获取");
List<ResultExitData> info = getDataWareHouseFeign.getInfo(transportInfo);
System.out.println("出港基本数据,获取完毕");
return info;
}
}
... ...
... ... @@ -6,6 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
... ... @@ -155,4 +156,14 @@ public class ResultExitData implements Serializable {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date flightPlanTime;
/**
* 27.计费重量
*/
private BigDecimal totalGrossWeightMeasure;
/**
* 28.体积
*/
private BigDecimal volumeMeasure;
}
... ...
package com.sunyo.wlpt.cgonms.provide.feign;
import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author 子诚
* Description:数据仓库的feign
* 时间:2020/5/25 14:47
*/
@Component
@FeignClient(value = "data-warehouse", fallback = GetDataWareHouseFeignHystrix.class)
public interface GetDataWareHouseFeign {
@PutMapping("/data/getInfo")
List<ResultExitData> getInfo(@RequestBody List<ResultExitData> resultList);
}
... ...
package com.sunyo.wlpt.cgonms.provide.feign;
import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author 子诚
* Description:数据仓库的feign的熔断器
* 时间:2020/5/25 14:48
*/
@Service
public class GetDataWareHouseFeignHystrix implements GetDataWareHouseFeign {
@Override
public List<ResultExitData> getInfo(List<ResultExitData> resultList) {
System.out.println("与 数据仓库 服务 断开连接,获取 数据仓库 服务信息失败");
return null;
}
}
... ...
package com.sunyo.wlpt.cgonms.provide.feign;
import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author 子诚
* Description:
* Description:运输工具feign的熔断器
* 时间:2020/5/22 14:32
*/
@Service
public class GetTransportFeignHystrix implements GetTransportFeign {
@Override
public List<ResultExitData> getInfo(List<ResultExitData> resultList) {
... ...