|
@@ -0,0 +1,406 @@
|
|
|
|
+package info.aspirecn.cloud.yysj.service.impl;
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
+import com.fasterxml.jackson.databind.JavaType;
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
+import info.aspirecn.cloud.yysj.entity.*;
|
|
|
|
+import info.aspirecn.cloud.yysj.service.WaybillSercice;
|
|
|
|
+import info.aspirecn.cloud.yysj.utils.Constant;
|
|
|
|
+import info.aspirecn.cloud.yysj.utils.DateUtil;
|
|
|
|
+import info.aspirecn.cloud.yysj.utils.ElasticSearchUitls;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.elasticsearch.action.search.SearchRequest;
|
|
|
|
+import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
|
+import org.elasticsearch.index.query.QueryBuilders;
|
|
|
|
+import org.elasticsearch.search.SearchHit;
|
|
|
|
+import org.elasticsearch.search.SearchHits;
|
|
|
|
+import org.elasticsearch.search.builder.SearchSourceBuilder;
|
|
|
|
+import org.elasticsearch.search.sort.SortOrder;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
+
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Email:lixinxu@aspirecn.com
|
|
|
|
+ * Descrption:
|
|
|
|
+ */
|
|
|
|
+@Slf4j
|
|
|
|
+@Service
|
|
|
|
+public class WaybillSerciceImpl implements WaybillSercice {
|
|
|
|
+
|
|
|
|
+ /** 主订单索引 */
|
|
|
|
+ @Value("${elasticsearch.firstIndex}")
|
|
|
|
+ private String firstIndex;
|
|
|
|
+
|
|
|
|
+ @Value("${clry.productId}")
|
|
|
|
+ private String clryProductId;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ ElasticSearchUitls elasticSearchUitls;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ObjectMapper objectMapper;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询运单列表
|
|
|
|
+ *
|
|
|
|
+ * @param waybillQueryParam
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> queryWaybillList(WaybillQueryParam waybillQueryParam) {
|
|
|
|
+
|
|
|
|
+ //数据深度不能大于1000条
|
|
|
|
+ if((waybillQueryParam.getPageNum() * waybillQueryParam.getPageSize()) > 1000){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ // 创建 Bool 查询构建器
|
|
|
|
+ BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
|
|
|
+ // 构建查询条件
|
|
|
|
+ if(waybillQueryParam.getUserId() != null && !"".equals(waybillQueryParam.getUserId())){
|
|
|
|
+ boolQueryBuilder.must(QueryBuilders.termsQuery("MG-UserId.keyword",waybillQueryParam.getUserId()));
|
|
|
|
+ }
|
|
|
|
+ if(waybillQueryParam.getCarNum() != null && !"".equals(waybillQueryParam.getCarNum())){
|
|
|
|
+ boolQueryBuilder.must(QueryBuilders.wildcardQuery("RequestInfo.VehicleInfo.VehicleNumber.keyword","*"+waybillQueryParam.getCarNum()+"*"));
|
|
|
|
+ }
|
|
|
|
+ if(waybillQueryParam.getWaybillNum() != null && !"".equals(waybillQueryParam.getWaybillNum())){
|
|
|
|
+ boolQueryBuilder.must(QueryBuilders.wildcardQuery("RequestInfo.ShippingNoteNumber.keyword", "*"+waybillQueryParam.getWaybillNum()+"*"));
|
|
|
|
+ }
|
|
|
|
+ boolQueryBuilder.must(QueryBuilders.termsQuery("URI.keyword","/info_check/waybill.do"));
|
|
|
|
+ boolQueryBuilder.must(QueryBuilders.existsQuery("RequestInfo.ShippingNoteNumber"));
|
|
|
|
+ boolQueryBuilder.filter().add(QueryBuilders.rangeQuery("DateTime")
|
|
|
|
+ .gte(waybillQueryParam.getBeginTime()).lte(waybillQueryParam.getEndTime()));
|
|
|
|
+ // 构建查询源构建器
|
|
|
|
+ SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
|
+ searchSourceBuilder.query(boolQueryBuilder);
|
|
|
|
+ searchSourceBuilder.sort("DateTime", SortOrder.DESC);
|
|
|
|
+ searchSourceBuilder.size(waybillQueryParam.getPageSize());
|
|
|
|
+ searchSourceBuilder.from((waybillQueryParam.getPageNum()-1) * waybillQueryParam.getPageSize());
|
|
|
|
+
|
|
|
|
+ //设置源字段过虑,第一个参数结果集包括哪些字段,第二个参数表示结果集不包括哪些字段
|
|
|
|
+ searchSourceBuilder.fetchSource(new String[]{"RequestInfo.ShippingNoteNumber", "RequestInfo.VehicleInfo.VehicleNumber",
|
|
|
|
+ "RequestInfo.VehicleInfo.PlaceOfLoading", "RequestInfo.VehicleInfo.GoodsReceiptPlace",
|
|
|
|
+ "RequestInfo.VehicleInfo.GoodsInfo", "RequestInfo.VehicleInfo.GoodsInfo",
|
|
|
|
+ "RequestInfo.VehicleInfo.Driver.DriverName", "MG-Consistent", "DateTime"}, null);
|
|
|
|
+
|
|
|
|
+ // 创建查询请求对象,将查询对象配置到其中
|
|
|
|
+ SearchRequest searchRequest = new SearchRequest(firstIndex);
|
|
|
|
+ searchRequest.source(searchSourceBuilder);
|
|
|
|
+ log.info("searchSourceBuilder:{}",searchSourceBuilder.toString());
|
|
|
|
+ // 返回集合
|
|
|
|
+ Map<String, Object> resultMap = new HashMap<String, Object>();
|
|
|
|
+ List<Waybill> waybillList = new ArrayList<Waybill>();
|
|
|
|
+
|
|
|
|
+ //获取数据
|
|
|
|
+ SearchHits hits = elasticSearchUitls.getResultHits(searchRequest);
|
|
|
|
+
|
|
|
|
+ log.info("hits:{}",hits);
|
|
|
|
+ if(hits == null){
|
|
|
|
+ resultMap.put(Constant.DATA_LIST, waybillList);
|
|
|
|
+ resultMap.put(Constant.TOTAL, 0L);
|
|
|
|
+ return resultMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ long total = hits.getTotalHits();
|
|
|
|
+
|
|
|
|
+ //遍历封装数据
|
|
|
|
+ for (SearchHit hit : hits) {
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ String json = hit.getSourceAsString();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(json);
|
|
|
|
+ JSONObject requestInfoJsonObject = jsonObject.getJSONObject("RequestInfo");
|
|
|
|
+ Object vehicleInfoObject = requestInfoJsonObject.get("VehicleInfo");
|
|
|
|
+ Waybill waybill = new Waybill();
|
|
|
|
+ waybill.setId(hit.getId());
|
|
|
|
+ waybill.setWaybillNum(requestInfoJsonObject.getString("ShippingNoteNumber"));
|
|
|
|
+ waybill.setDriver("");
|
|
|
|
+ waybill.setGoodsName("");
|
|
|
|
+ waybill.setGoodsWeight("");
|
|
|
|
+ if(vehicleInfoObject instanceof JSONObject){
|
|
|
|
+ JSONObject vehicleInfoJsonObject = (JSONObject)vehicleInfoObject;
|
|
|
|
+ Object driverObject = vehicleInfoJsonObject.get("Driver");
|
|
|
|
+ if(driverObject instanceof JSONArray){
|
|
|
|
+ JSONArray driverJsonObjectArr = (JSONArray) driverObject;
|
|
|
|
+ //获取驾驶员姓名
|
|
|
|
+ String driverName = "";
|
|
|
|
+ for (int i=0; i < driverJsonObjectArr.size(); i++){
|
|
|
|
+ Object driverArrObject = driverJsonObjectArr.get(i);
|
|
|
|
+ if(driverArrObject instanceof JSONObject){
|
|
|
|
+ JSONObject driverJsonObject=(JSONObject)driverArrObject;
|
|
|
|
+ String driverNameStr = driverJsonObject.getString("DriverName");
|
|
|
|
+ if(!StringUtils.isEmpty(driverNameStr)) {
|
|
|
|
+ driverName += driverJsonObject.getString("DriverName");
|
|
|
|
+ if(i < driverJsonObjectArr.size() - 1){
|
|
|
|
+ driverName += "、";
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ log.error("DriverName is empty:{}",driverNameStr);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ log.error("Driver[i] is not JSON Object");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ waybill.setDriver(driverName);
|
|
|
|
+ }else{
|
|
|
|
+ log.error("Driver is not JSON ARRY,driverObject:{}",driverObject);
|
|
|
|
+ }
|
|
|
|
+ Object GoodsObject = vehicleInfoJsonObject.get("GoodsInfo");
|
|
|
|
+
|
|
|
|
+ if(GoodsObject instanceof JSONArray){
|
|
|
|
+ JSONArray goodsInfoJsonObjectArr = (JSONArray) GoodsObject;
|
|
|
|
+ String goodsName = "";
|
|
|
|
+ Double goodsTotalWeight = 0.000;
|
|
|
|
+ for (int i=0; i < goodsInfoJsonObjectArr.size(); i++){
|
|
|
|
+ Object goodsArrObject = goodsInfoJsonObjectArr.get(i);
|
|
|
|
+ if(goodsArrObject instanceof JSONObject){
|
|
|
|
+ JSONObject goodsInfoJsonObject = (JSONObject) goodsArrObject;
|
|
|
|
+ String goodsNameStr = goodsInfoJsonObject.getString("DescriptionOfGoods");
|
|
|
|
+ if(!StringUtils.isEmpty(goodsNameStr)) {
|
|
|
|
+ goodsName += goodsNameStr;
|
|
|
|
+ if(i < goodsInfoJsonObjectArr.size() - 1){
|
|
|
|
+ goodsName += "、";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Object goodsItemObject = goodsInfoJsonObject.get("GoodsItemGrossWeight");
|
|
|
|
+ if(goodsItemObject instanceof Double){
|
|
|
|
+ Double goodsWeight = (Double) goodsItemObject;
|
|
|
|
+ goodsTotalWeight += goodsWeight;
|
|
|
|
+ }else{
|
|
|
|
+ log.error("GoodsItemGrossWeight is not Double");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ log.error("GoodsInfo[i] is not JSON Object");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //重量处理成字符串 保留3位小时
|
|
|
|
+ String goodsTotalWeightStr = goodsTotalWeight.toString();
|
|
|
|
+ if(goodsTotalWeightStr.indexOf(".")!=-1){
|
|
|
|
+ String goodsTotalWeightStrI = goodsTotalWeightStr.substring(0, goodsTotalWeightStr.indexOf("."));
|
|
|
|
+ String goodsTotalWeightStrD = goodsTotalWeightStr.substring(goodsTotalWeightStr.indexOf(".")+1, goodsTotalWeightStr.length());
|
|
|
|
+ if (goodsTotalWeightStrD.length() > 3){
|
|
|
|
+ goodsTotalWeightStrD = goodsTotalWeightStrD.substring(0, 3);
|
|
|
|
+ } else if(goodsTotalWeightStrD.length() == 2){
|
|
|
|
+ goodsTotalWeightStrD += "0";
|
|
|
|
+ } else if(goodsTotalWeightStrD.length() == 1){
|
|
|
|
+ goodsTotalWeightStrD += "00";
|
|
|
|
+ }
|
|
|
|
+ goodsTotalWeightStr = goodsTotalWeightStrI + "." + goodsTotalWeightStrD;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ waybill.setGoodsName(goodsName);
|
|
|
|
+ waybill.setGoodsWeight(goodsTotalWeightStr);
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ log.error("GoodsInfo is not JSON ARRY");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ waybill.setCheckTotalRes(jsonObject.getString("MG-Consistent"));
|
|
|
|
+ waybill.setRequestTime(DateUtil.esTime2MySQLTime(jsonObject.getString("DateTime")));
|
|
|
|
+
|
|
|
|
+ waybillList.add(waybill);
|
|
|
|
+
|
|
|
|
+ log.info("运单 {}", waybill);
|
|
|
|
+ } catch (Exception e){
|
|
|
|
+ total=total-1;
|
|
|
|
+ log.info("运单数据不完整, Exception: {}",e);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ resultMap.put(Constant.DATA_LIST, waybillList);
|
|
|
|
+ resultMap.put(Constant.TOTAL, total);
|
|
|
|
+ return resultMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询运单详情
|
|
|
|
+ *
|
|
|
|
+ * @param waybillId
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public WaybillInfo querywaybillinfo(String waybillId) {
|
|
|
|
+
|
|
|
|
+ SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
|
+ //搜索方式 根据id查询
|
|
|
|
+ searchSourceBuilder.query(QueryBuilders.termsQuery("_id",waybillId));
|
|
|
|
+ //设置源字段过虑,第一个参数结果集包括哪些字段,第二个参数表示结果集不包括哪些字段
|
|
|
|
+ searchSourceBuilder.fetchSource(new String[]{"RequestInfo.ShippingNoteNumber", "RequestInfo.OriginalDocumentNumber",
|
|
|
|
+ "RequestInfo.Carrier", "RequestInfo.UnifiedSocialCreditIdentifier",
|
|
|
|
+ "RequestInfo.PermitNumber", "RequestInfo.ConsignorInfo",
|
|
|
|
+ "RequestInfo.ConsigneeInfo", "RequestInfo.VehicleInfo.VehicleNumber",
|
|
|
|
+ "RequestInfo.VehicleInfo.VehiclePlateColorCode",
|
|
|
|
+ "RequestInfo.VehicleInfo.Driver.DriverName",
|
|
|
|
+ "RequestInfo.VehicleInfo.Driver.DriverLicenseNumber",
|
|
|
|
+ "RequestInfo.ActualCarrierInfo","Check-Reuslt"}, null);
|
|
|
|
+ searchSourceBuilder.size(1);
|
|
|
|
+ //创建查询请求对象,将查询对象配置到其中
|
|
|
|
+ SearchRequest searchRequest = new SearchRequest(firstIndex);
|
|
|
|
+ searchRequest.source(searchSourceBuilder);
|
|
|
|
+
|
|
|
|
+ //获取数据
|
|
|
|
+ WaybillInfo waybillInfo = new WaybillInfo();
|
|
|
|
+ SearchHits hits = elasticSearchUitls.getResultHits(searchRequest);
|
|
|
|
+ if(hits == null){
|
|
|
|
+ return waybillInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //遍历数据, 加上核验结果条件, 计算总数, 分页
|
|
|
|
+ for (SearchHit hit : hits) {
|
|
|
|
+ String json = hit.getSourceAsString();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(json);
|
|
|
|
+ String result = jsonObject.getString("Check-Reuslt");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //请求信息json对象
|
|
|
|
+ JSONObject requestInfoJsonObject = jsonObject.getJSONObject("RequestInfo");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //车辆信息.驾驶信息 json对象
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //设置运单号、原始单号
|
|
|
|
+ waybillInfo.setWaybillNum(requestInfoJsonObject.getString("ShippingNoteNumber"));
|
|
|
|
+ waybillInfo.setWaybillNumOriginal(requestInfoJsonObject.getString("OriginalDocumentNumber"));
|
|
|
|
+
|
|
|
|
+ //设置企业信息
|
|
|
|
+ EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
|
|
|
+ enterpriseInfo.setCarrierName(requestInfoJsonObject.getString("Carrier"));
|
|
|
|
+ enterpriseInfo.setUnifiedSocialCreditIdentifier(requestInfoJsonObject.getString("UnifiedSocialCreditIdentifier"));
|
|
|
|
+ enterpriseInfo.setPermitNumber(requestInfoJsonObject.getString("PermitNumber"));
|
|
|
|
+ waybillInfo.setEnterpriseInfo(enterpriseInfo);
|
|
|
|
+
|
|
|
|
+ //设置托运人信息
|
|
|
|
+ ConsignorInfo consignorInfo = new ConsignorInfo();
|
|
|
|
+ try {
|
|
|
|
+ //托运人信息json对象
|
|
|
|
+ Object consignorObject = requestInfoJsonObject.get("ConsignorInfo");
|
|
|
|
+ if(consignorObject instanceof JSONObject){
|
|
|
|
+ JSONObject consignorInfoJsonObject = (JSONObject)consignorObject;
|
|
|
|
+ consignorInfo = objectMapper.readValue(consignorInfoJsonObject.toString(), ConsignorInfo.class);
|
|
|
|
+ }else{
|
|
|
|
+ log.error("ConsignorInfo 不是json object 格式");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("解析ConsignorInfo异常:{}",e);
|
|
|
|
+ }
|
|
|
|
+ waybillInfo.setConsignorInfo(consignorInfo);
|
|
|
|
+
|
|
|
|
+ //设置收货方信息
|
|
|
|
+ ConsigneeInfo consigneeInfo = new ConsigneeInfo();
|
|
|
|
+ try {
|
|
|
|
+ //收货方信息接送json对象
|
|
|
|
+ Object consigneeObject = requestInfoJsonObject.get("ConsigneeInfo");
|
|
|
|
+ if(consigneeObject instanceof JSONObject){
|
|
|
|
+ JSONObject consigneeInfoJsonObject = (JSONObject) consigneeObject;
|
|
|
|
+ consigneeInfo = objectMapper.readValue(consigneeInfoJsonObject.toString(), ConsigneeInfo.class);
|
|
|
|
+ }else{
|
|
|
|
+ log.error("ConsigneeInfo 不是json object 格式");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
|
+ log.error("解析ConsigneeInfo异常:{}",e);
|
|
|
|
+ }
|
|
|
|
+ waybillInfo.setConsigneeInfo(consigneeInfo);
|
|
|
|
+
|
|
|
|
+ //设置车辆信息
|
|
|
|
+ VehicleInfo vehicleInfo = new VehicleInfo();
|
|
|
|
+ String driverName = "";
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ JavaType javaType = objectMapper.getTypeFactory().constructParametricType(ArrayList.class, CheckDetailLogObject.class);
|
|
|
|
+ List<CheckDetailLogObject> checks = (List<CheckDetailLogObject>)objectMapper.readValue(result, javaType);
|
|
|
|
+ for(CheckDetailLogObject logObject : checks){
|
|
|
|
+ if(clryProductId.equals(logObject.getProductId())){
|
|
|
|
+ vehicleInfo.setDrivingAccess(logObject.getResult());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("CheckDetailLogObject exception:{}",e);
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ Object vehicleObject = requestInfoJsonObject.get("VehicleInfo");
|
|
|
|
+ if(vehicleObject instanceof JSONObject){
|
|
|
|
+ JSONObject vehicleInfoJsonObject =(JSONObject)vehicleObject;
|
|
|
|
+ vehicleInfo.setCarNum(vehicleInfoJsonObject.getString("VehicleNumber"));
|
|
|
|
+ vehicleInfo.setCarNumColor(vehicleInfoJsonObject.getString("VehiclePlateColorCode"));
|
|
|
|
+ Object driverObject = vehicleInfoJsonObject.get("Driver");
|
|
|
|
+ if(driverObject instanceof JSONArray ){
|
|
|
|
+ JSONArray driverJsonObjectArr = (JSONArray) driverObject;
|
|
|
|
+ for (int i=0; i < driverJsonObjectArr.size(); i++){
|
|
|
|
+ Object arrObject = driverJsonObjectArr.get(i);
|
|
|
|
+ if(arrObject instanceof JSONObject){
|
|
|
|
+ JSONObject driverJsonObject = (JSONObject)arrObject;
|
|
|
|
+ driverName += driverJsonObject.getString("DriverName");
|
|
|
|
+ if(i < driverJsonObjectArr.size() - 1){
|
|
|
|
+ driverName += "、";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ log.error("Driver 不是json Array 格式");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ log.error("VehicleInfo 不是json object 格式");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("VehicleInfo exception:{}",e);
|
|
|
|
+ }
|
|
|
|
+ vehicleInfo.setDrivingLicenseNum("");
|
|
|
|
+ waybillInfo.setVehicleInfo(vehicleInfo);
|
|
|
|
+ //获取驾驶员姓名
|
|
|
|
+ vehicleInfo.setDriverName(driverName);
|
|
|
|
+
|
|
|
|
+ //设置实际承运人信息
|
|
|
|
+ ActualCarrierInfo actualCarrierInfo = new ActualCarrierInfo();
|
|
|
|
+ try {
|
|
|
|
+ //实际承运人信息json对象
|
|
|
|
+ Object actualCarrierObject = requestInfoJsonObject.get("ActualCarrierInfo");
|
|
|
|
+ if(actualCarrierObject instanceof JSONObject ){
|
|
|
|
+ JSONObject actualCarrierInfoJsonObject =(JSONObject) actualCarrierObject;
|
|
|
|
+ actualCarrierInfo = objectMapper.readValue(actualCarrierInfoJsonObject.toString(), ActualCarrierInfo.class);
|
|
|
|
+ }else{
|
|
|
|
+ log.error("ActualCarrierInfo 不是json object 格式");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("ActualCarrierInfo exception:{}",e);
|
|
|
|
+ }
|
|
|
|
+ waybillInfo.setActualCarrierInfo(actualCarrierInfo);
|
|
|
|
+
|
|
|
|
+ log.debug("运单详情 {}", waybillInfo);
|
|
|
|
+
|
|
|
|
+ return waybillInfo;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return waybillInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|