Showing
29 changed files
with
195 additions
and
230 deletions
No preview for this file type
No preview for this file type
No preview for this file type
| 1 | package com.erry.iclear.dateInterface.api; | 1 | package com.erry.iclear.dateInterface.api; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.Basfc; | ||
| 4 | import com.erry.iclear.dateInterface.api.request.Mawb; | 3 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 4 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 6 | -import com.erry.iclear.dateInterface.common.Constant; | ||
| 7 | import com.erry.iclear.dateInterface.entity.IClearApiLog; | 5 | import com.erry.iclear.dateInterface.entity.IClearApiLog; |
| 8 | import com.erry.iclear.dateInterface.repository.MawbAdd; | 6 | import com.erry.iclear.dateInterface.repository.MawbAdd; |
| 9 | import com.erry.iclear.dateInterface.service.*; | 7 | import com.erry.iclear.dateInterface.service.*; |
| 10 | -import com.erry.iclear.dateInterface.util.DateUtils; | ||
| 11 | -import com.erry.iclear.dateInterface.util.SHA256Util; | ||
| 12 | import com.google.gson.Gson; | 8 | import com.google.gson.Gson; |
| 13 | import io.swagger.annotations.ApiOperation; | 9 | import io.swagger.annotations.ApiOperation; |
| 14 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| 15 | -import org.apache.commons.lang3.StringUtils; | ||
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.util.StopWatch; | 12 | import org.springframework.util.StopWatch; |
| 18 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -6,7 +6,7 @@ import java.util.List; | ... | @@ -6,7 +6,7 @@ import java.util.List; |
| 6 | /** | 6 | /** |
| 7 | * BASF申报数据构造 2021年11月9日 xjq | 7 | * BASF申报数据构造 2021年11月9日 xjq |
| 8 | */ | 8 | */ |
| 9 | -public class BasfConsignment implements Serializable { | 9 | +public class FedexConsignment implements Serializable { |
| 10 | /** | 10 | /** |
| 11 | * 运单号 | 11 | * 运单号 |
| 12 | */ | 12 | */ | ... | ... |
| ... | @@ -10,11 +10,11 @@ import javax.validation.constraints.NotNull; | ... | @@ -10,11 +10,11 @@ import javax.validation.constraints.NotNull; |
| 10 | import java.math.BigDecimal; | 10 | import java.math.BigDecimal; |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -@ApiModel(value = "basfcDetail", description = "运单明细") | 13 | +@ApiModel(value = "fedexcDetail", description = "运单明细") |
| 14 | @Entity | 14 | @Entity |
| 15 | @Table(name = "T_ICLEAR_API_BASFCDETAIL") | 15 | @Table(name = "T_ICLEAR_API_BASFCDETAIL") |
| 16 | @Data | 16 | @Data |
| 17 | -public class BasfcDetail { | 17 | +public class FedexDetail { |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | private static final long serialVersionUID = -6706944312498119267L; | 20 | private static final long serialVersionUID = -6706944312498119267L; | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api.request; | 1 | package com.erry.iclear.dateInterface.api.request; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.repository.MawbAdd; | ||
| 4 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 5 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| ... | @@ -9,8 +8,6 @@ import org.hibernate.annotations.DynamicUpdate; | ... | @@ -9,8 +8,6 @@ import org.hibernate.annotations.DynamicUpdate; |
| 9 | 8 | ||
| 10 | import javax.persistence.*; | 9 | import javax.persistence.*; |
| 11 | import javax.validation.Valid; | 10 | import javax.validation.Valid; |
| 12 | -import javax.validation.constraints.NotBlank; | ||
| 13 | -import javax.validation.constraints.NotNull; | ||
| 14 | import java.io.Serializable; | 11 | import java.io.Serializable; |
| 15 | import java.math.BigDecimal; | 12 | import java.math.BigDecimal; |
| 16 | import java.util.List; | 13 | import java.util.List; |
| ... | @@ -25,7 +22,7 @@ import java.util.List; | ... | @@ -25,7 +22,7 @@ import java.util.List; |
| 25 | @DynamicInsert | 22 | @DynamicInsert |
| 26 | @DynamicUpdate | 23 | @DynamicUpdate |
| 27 | @Data | 24 | @Data |
| 28 | -public class BasfMawb implements Serializable { | 25 | +public class FedexMawb implements Serializable { |
| 29 | 26 | ||
| 30 | private static final long serialVersionUID = -7092144710653831972L; | 27 | private static final long serialVersionUID = -7092144710653831972L; |
| 31 | @Id | 28 | @Id |
| ... | @@ -242,5 +239,5 @@ public class BasfMawb implements Serializable { | ... | @@ -242,5 +239,5 @@ public class BasfMawb implements Serializable { |
| 242 | @ApiModelProperty(value = "运单明细", name = "BasfMawbDetail", example = "") | 239 | @ApiModelProperty(value = "运单明细", name = "BasfMawbDetail", example = "") |
| 243 | @OneToMany(cascade = CascadeType.PERSIST) | 240 | @OneToMany(cascade = CascadeType.PERSIST) |
| 244 | @JoinColumn(name = "mawbId") | 241 | @JoinColumn(name = "mawbId") |
| 245 | - private List<BasfMawbDetail> mawbDetailList; | 242 | + private List<FedexMawbDetail> mawbDetailList; |
| 246 | } | 243 | } | ... | ... |
| ... | @@ -14,7 +14,7 @@ import java.math.BigDecimal; | ... | @@ -14,7 +14,7 @@ import java.math.BigDecimal; |
| 14 | @Entity | 14 | @Entity |
| 15 | @Table(name = "T_ICLEAR_API_MAWBDETAIL") | 15 | @Table(name = "T_ICLEAR_API_MAWBDETAIL") |
| 16 | @Data | 16 | @Data |
| 17 | -public class BasfMawbDetail implements Serializable { | 17 | +public class FedexMawbDetail implements Serializable { |
| 18 | 18 | ||
| 19 | private static final long serialVersionUID = -6706944312498119267L; | 19 | private static final long serialVersionUID = -6706944312498119267L; |
| 20 | @Id | 20 | @Id | ... | ... |
| ... | @@ -11,7 +11,7 @@ import java.util.Date; | ... | @@ -11,7 +11,7 @@ import java.util.Date; |
| 11 | /** | 11 | /** |
| 12 | * BASF回执数据构造 xjq 2021年11月16日 | 12 | * BASF回执数据构造 xjq 2021年11月16日 |
| 13 | */ | 13 | */ |
| 14 | -public class BasfcReceipt implements Serializable { | 14 | +public class FedexReceipt implements Serializable { |
| 15 | 15 | ||
| 16 | @Autowired | 16 | @Autowired |
| 17 | private DictionaryEntriesRepository dictionaryEntriesRepository; | 17 | private DictionaryEntriesRepository dictionaryEntriesRepository; | ... | ... |
| ... | @@ -2,7 +2,6 @@ package com.erry.iclear.dateInterface.api.request; | ... | @@ -2,7 +2,6 @@ package com.erry.iclear.dateInterface.api.request; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 5 | -import io.swagger.annotations.ApiOperation; | ||
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import org.hibernate.annotations.DynamicInsert; | 6 | import org.hibernate.annotations.DynamicInsert; |
| 8 | import org.hibernate.annotations.DynamicUpdate; | 7 | import org.hibernate.annotations.DynamicUpdate; |
| ... | @@ -14,13 +13,13 @@ import javax.validation.constraints.NotNull; | ... | @@ -14,13 +13,13 @@ import javax.validation.constraints.NotNull; |
| 14 | import java.io.Serializable; | 13 | import java.io.Serializable; |
| 15 | import java.util.List; | 14 | import java.util.List; |
| 16 | 15 | ||
| 17 | -@ApiModel(value = "basfc", description = "主运单") | 16 | +@ApiModel(value = "fedexc", description = "主运单") |
| 18 | @Entity | 17 | @Entity |
| 19 | @Table(name = "T_ICLEAR_API_MAWB") | 18 | @Table(name = "T_ICLEAR_API_MAWB") |
| 20 | @DynamicInsert | 19 | @DynamicInsert |
| 21 | @DynamicUpdate | 20 | @DynamicUpdate |
| 22 | @Data | 21 | @Data |
| 23 | -public class Basfc implements Serializable { | 22 | +public class Fedexc implements Serializable { |
| 24 | 23 | ||
| 25 | 24 | ||
| 26 | private static final long serialVersionUID = -7092144710653831972L; | 25 | private static final long serialVersionUID = -7092144710653831972L; |
| ... | @@ -94,5 +93,5 @@ public class Basfc implements Serializable { | ... | @@ -94,5 +93,5 @@ public class Basfc implements Serializable { |
| 94 | @ApiModelProperty(value = "运单明细", name = "consignmentList", example = "") | 93 | @ApiModelProperty(value = "运单明细", name = "consignmentList", example = "") |
| 95 | @OneToMany(cascade = CascadeType.PERSIST) | 94 | @OneToMany(cascade = CascadeType.PERSIST) |
| 96 | @JoinColumn(name = "BASFCID") | 95 | @JoinColumn(name = "BASFCID") |
| 97 | - private List<BasfcDetail> consignmentList; | 96 | + private List<FedexDetail> consignmentList; |
| 98 | } | 97 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api.response; | 1 | package com.erry.iclear.dateInterface.api.response; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import com.erry.iclear.dateInterface.api.request.BasfConsignment; | 4 | +import com.erry.iclear.dateInterface.api.request.FedexConsignment; |
| 5 | import lombok.AllArgsConstructor; | 5 | import lombok.AllArgsConstructor; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | 7 | ||
| ... | @@ -13,7 +13,7 @@ import java.util.List; | ... | @@ -13,7 +13,7 @@ import java.util.List; |
| 13 | */ | 13 | */ |
| 14 | @Data | 14 | @Data |
| 15 | @AllArgsConstructor | 15 | @AllArgsConstructor |
| 16 | -public class BasfResultChmRS implements Serializable { | 16 | +public class FedexResultChmRS implements Serializable { |
| 17 | 17 | ||
| 18 | //成功标识 | 18 | //成功标识 |
| 19 | private Boolean success = true; | 19 | private Boolean success = true; |
| ... | @@ -22,6 +22,6 @@ public class BasfResultChmRS implements Serializable { | ... | @@ -22,6 +22,6 @@ public class BasfResultChmRS implements Serializable { |
| 22 | //错误信息 | 22 | //错误信息 |
| 23 | private String msg; | 23 | private String msg; |
| 24 | //Object data; | 24 | //Object data; |
| 25 | - private List<BasfConsignment> consignmentList; | 25 | + private List<FedexConsignment> consignmentList; |
| 26 | 26 | ||
| 27 | } | 27 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api.response; | 1 | package com.erry.iclear.dateInterface.api.response; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.BasfConsignment; | 3 | +import com.erry.iclear.dateInterface.api.request.FedexReceipt; |
| 4 | -import com.erry.iclear.dateInterface.api.request.BasfcReceipt; | ||
| 5 | import lombok.AllArgsConstructor; | 4 | import lombok.AllArgsConstructor; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | 6 | ||
| ... | @@ -13,7 +12,7 @@ import java.util.List; | ... | @@ -13,7 +12,7 @@ import java.util.List; |
| 13 | */ | 12 | */ |
| 14 | @Data | 13 | @Data |
| 15 | @AllArgsConstructor | 14 | @AllArgsConstructor |
| 16 | -public class BasfResultRS implements Serializable { | 15 | +public class FedexResultRS implements Serializable { |
| 17 | 16 | ||
| 18 | //成功标识 | 17 | //成功标识 |
| 19 | private Boolean success = true; | 18 | private Boolean success = true; |
| ... | @@ -22,6 +21,6 @@ public class BasfResultRS implements Serializable { | ... | @@ -22,6 +21,6 @@ public class BasfResultRS implements Serializable { |
| 22 | //错误信息 | 21 | //错误信息 |
| 23 | private String msg; | 22 | private String msg; |
| 24 | //Object data; | 23 | //Object data; |
| 25 | - private List<BasfcReceipt> consignmentList; | 24 | + private List<FedexReceipt> consignmentList; |
| 26 | 25 | ||
| 27 | } | 26 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api.response; | 1 | package com.erry.iclear.dateInterface.api.response; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import com.erry.iclear.dateInterface.api.request.BasfcReceipt; | ||
| 5 | import com.erry.iclear.dateInterface.entity.HsCode; | 4 | import com.erry.iclear.dateInterface.entity.HsCode; |
| 6 | import lombok.AllArgsConstructor; | 5 | import lombok.AllArgsConstructor; |
| 7 | import lombok.Data; | 6 | import lombok.Data; | ... | ... |
| ... | @@ -15,7 +15,7 @@ public class InterceptorConfig implements WebMvcConfigurer { | ... | @@ -15,7 +15,7 @@ public class InterceptorConfig implements WebMvcConfigurer { |
| 15 | @Override | 15 | @Override |
| 16 | public void addInterceptors(InterceptorRegistry registry) { | 16 | public void addInterceptors(InterceptorRegistry registry) { |
| 17 | registry.addInterceptor(new SignInterceptor()).addPathPatterns("/customs/*"); | 17 | registry.addInterceptor(new SignInterceptor()).addPathPatterns("/customs/*"); |
| 18 | - registry.addInterceptor(new SignInterceptor()).addPathPatterns("/basf/*"); | 18 | + registry.addInterceptor(new SignInterceptor()).addPathPatterns("/fedex/*"); |
| 19 | registry.addInterceptor(new HsCodeInterceptor()).addPathPatterns("/hscode/*"); | 19 | registry.addInterceptor(new HsCodeInterceptor()).addPathPatterns("/hscode/*"); |
| 20 | } | 20 | } |
| 21 | } | 21 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.repository; | 1 | package com.erry.iclear.dateInterface.repository; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.BasfMawb; | 3 | +import com.erry.iclear.dateInterface.api.request.FedexMawb; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | import org.springframework.stereotype.Repository; | 6 | import org.springframework.stereotype.Repository; |
| ... | @@ -11,5 +11,5 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -11,5 +11,5 @@ import org.springframework.transaction.annotation.Transactional; |
| 11 | */ | 11 | */ |
| 12 | @Repository | 12 | @Repository |
| 13 | @Transactional(rollbackFor = Exception.class) | 13 | @Transactional(rollbackFor = Exception.class) |
| 14 | -public interface BasfMawbRepository extends JpaRepository<BasfMawb, Integer>, JpaSpecificationExecutor<BasfMawb> { | 14 | +public interface FedexMawbRepository extends JpaRepository<FedexMawb, Integer>, JpaSpecificationExecutor<FedexMawb> { |
| 15 | } | 15 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.BasfMawbDetail; | 3 | +import com.erry.iclear.dateInterface.api.request.FedexMawbDetail; |
| 4 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 4 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 5 | import com.erry.iclear.dateInterface.common.Constant; | 5 | import com.erry.iclear.dateInterface.common.Constant; |
| 6 | import com.erry.iclear.dateInterface.entity.*; | 6 | import com.erry.iclear.dateInterface.entity.*; |
| 7 | import com.erry.iclear.dateInterface.repository.ChmConsignmentDetailRepository; | 7 | import com.erry.iclear.dateInterface.repository.ChmConsignmentDetailRepository; |
| 8 | -import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; | ||
| 9 | import com.erry.iclear.dateInterface.util.NumberUtils; | 8 | import com.erry.iclear.dateInterface.util.NumberUtils; |
| 10 | import com.erry.iclear.dateInterface.util.StringUtil; | 9 | import com.erry.iclear.dateInterface.util.StringUtil; |
| 11 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| ... | @@ -138,7 +137,7 @@ public class ChmConsignmentDetailService { | ... | @@ -138,7 +137,7 @@ public class ChmConsignmentDetailService { |
| 138 | * @param mawbDetail | 137 | * @param mawbDetail |
| 139 | * @return | 138 | * @return |
| 140 | */ | 139 | */ |
| 141 | - public ChmConsignmentDetail convertToChmConsignmentDetailBasf(BasfMawbDetail mawbDetail, ChmConsignment chmConsignment){ | 140 | + public ChmConsignmentDetail convertToChmConsignmentDetailFedex(FedexMawbDetail mawbDetail, ChmConsignment chmConsignment){ |
| 142 | ChmConsignmentDetail result = new ChmConsignmentDetail(); | 141 | ChmConsignmentDetail result = new ChmConsignmentDetail(); |
| 143 | try{ | 142 | try{ |
| 144 | result.setChmConsignment(chmConsignment); | 143 | result.setChmConsignment(chmConsignment); |
| ... | @@ -185,7 +184,7 @@ public class ChmConsignmentDetailService { | ... | @@ -185,7 +184,7 @@ public class ChmConsignmentDetailService { |
| 185 | result.setDeclaredWeight(bigDecimalFormat(mawbDetail.getDeclaredWeight())); | 184 | result.setDeclaredWeight(bigDecimalFormat(mawbDetail.getDeclaredWeight())); |
| 186 | result.setDetailId(mawbDetail.getDetailId()); | 185 | result.setDetailId(mawbDetail.getDetailId()); |
| 187 | }catch (Exception e){ | 186 | }catch (Exception e){ |
| 188 | - log.error("convertToChmConsignmentDetailBasf() error:"+e.getMessage()); | 187 | + log.error("convertToChmConsignmentDetailFedex() error:"+e.getMessage()); |
| 189 | } | 188 | } |
| 190 | return result; | 189 | return result; |
| 191 | } | 190 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | //import cn.hutool.core.date.DateUtil; | 3 | //import cn.hutool.core.date.DateUtil; |
| 4 | -import com.erry.iclear.dateInterface.api.request.BasfMawb; | 4 | +import com.erry.iclear.dateInterface.api.request.FedexMawb; |
| 5 | -import com.erry.iclear.dateInterface.api.request.BasfcReceipt; | 5 | +import com.erry.iclear.dateInterface.api.request.FedexReceipt; |
| 6 | import com.erry.iclear.dateInterface.api.request.Mawb; | 6 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 7 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 7 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 8 | import com.erry.iclear.dateInterface.common.Constant; | 8 | import com.erry.iclear.dateInterface.common.Constant; |
| ... | @@ -18,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -18,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 18 | import org.springframework.stereotype.Service; | 18 | import org.springframework.stereotype.Service; |
| 19 | 19 | ||
| 20 | import javax.transaction.Transactional; | 20 | import javax.transaction.Transactional; |
| 21 | -import java.math.BigDecimal; | ||
| 22 | import java.text.ParseException; | 21 | import java.text.ParseException; |
| 23 | import java.text.SimpleDateFormat; | 22 | import java.text.SimpleDateFormat; |
| 24 | import java.util.ArrayList; | 23 | import java.util.ArrayList; |
| ... | @@ -241,7 +240,7 @@ public class ChmConsignmentService { | ... | @@ -241,7 +240,7 @@ public class ChmConsignmentService { |
| 241 | return result; | 240 | return result; |
| 242 | } | 241 | } |
| 243 | 242 | ||
| 244 | - public ChmConsignment convertToChmConsignmentBasf(BasfMawb mawb,Date pushTime,String creator){ | 243 | + public ChmConsignment convertToChmConsignmentFedex(FedexMawb mawb, Date pushTime, String creator){ |
| 245 | ChmConsignment result = new ChmConsignment(); | 244 | ChmConsignment result = new ChmConsignment(); |
| 246 | try{ | 245 | try{ |
| 247 | //运单号 | 246 | //运单号 |
| ... | @@ -294,7 +293,7 @@ public class ChmConsignmentService { | ... | @@ -294,7 +293,7 @@ public class ChmConsignmentService { |
| 294 | }catch (Exception e){ | 293 | }catch (Exception e){ |
| 295 | result=null; | 294 | result=null; |
| 296 | e.printStackTrace(); | 295 | e.printStackTrace(); |
| 297 | - log.error("convertToChmConsignmentBasf() error:"+e.getMessage()); | 296 | + log.error("convertToChmConsignmentFedex() error:"+e.getMessage()); |
| 298 | } | 297 | } |
| 299 | return result; | 298 | return result; |
| 300 | } | 299 | } |
| ... | @@ -560,14 +559,14 @@ public class ChmConsignmentService { | ... | @@ -560,14 +559,14 @@ public class ChmConsignmentService { |
| 560 | 559 | ||
| 561 | /** | 560 | /** |
| 562 | * 保存或更新 iclear中的运单信息 | 561 | * 保存或更新 iclear中的运单信息 |
| 563 | - * @param basfMawb | 562 | + * @param fedexMawb |
| 564 | * @param timeStamp | 563 | * @param timeStamp |
| 565 | */ | 564 | */ |
| 566 | - public ResultRS processChmConsignmentBasf(BasfMawb basfMawb, String timeStamp, String creator) { | 565 | + public ResultRS processChmConsignmentFedex(FedexMawb fedexMawb, String timeStamp, String creator) { |
| 567 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 566 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 568 | try { | 567 | try { |
| 569 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); | 568 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); |
| 570 | - ChmConsignment chmConsignment = this.convertToChmConsignmentBasf(basfMawb,pushTime,creator); | 569 | + ChmConsignment chmConsignment = this.convertToChmConsignmentFedex(fedexMawb,pushTime,creator); |
| 571 | if(Objects.equals(chmConsignment,null)){ | 570 | if(Objects.equals(chmConsignment,null)){ |
| 572 | result.setCode("30001"); | 571 | result.setCode("30001"); |
| 573 | result.setMsg("数据格式不正确"); | 572 | result.setMsg("数据格式不正确"); |
| ... | @@ -575,8 +574,8 @@ public class ChmConsignmentService { | ... | @@ -575,8 +574,8 @@ public class ChmConsignmentService { |
| 575 | } | 574 | } |
| 576 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 575 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| 577 | 576 | ||
| 578 | - basfMawb.getMawbDetailList().forEach(detail ->{ | 577 | + fedexMawb.getMawbDetailList().forEach(detail ->{ |
| 579 | - chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetailBasf(detail, chmConsignment)); | 578 | + chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetailFedex(detail, chmConsignment)); |
| 580 | }); | 579 | }); |
| 581 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); | 580 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); |
| 582 | 581 | ||
| ... | @@ -586,14 +585,14 @@ public class ChmConsignmentService { | ... | @@ -586,14 +585,14 @@ public class ChmConsignmentService { |
| 586 | //3、新增或更新 | 585 | //3、新增或更新 |
| 587 | //新增:如果没有就插入 | 586 | //新增:如果没有就插入 |
| 588 | if (Objects.equals(chmConsignmentDB,null)){ | 587 | if (Objects.equals(chmConsignmentDB,null)){ |
| 589 | - log.info("新增主单"+ basfMawb.getBillNo()); | 588 | + log.info("新增主单"+ fedexMawb.getBillNo()); |
| 590 | ChmConsignment chmConsignmentSaveResult = this.saveChmConsignment(chmConsignment); | 589 | ChmConsignment chmConsignmentSaveResult = this.saveChmConsignment(chmConsignment); |
| 591 | if(!Objects.equals(chmConsignmentSaveResult,null)){ | 590 | if(!Objects.equals(chmConsignmentSaveResult,null)){ |
| 592 | - log.info("主单"+ basfMawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); | 591 | + log.info("主单"+ fedexMawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); |
| 593 | }else{ | 592 | }else{ |
| 594 | - log.info("主单"+ basfMawb.getBillNo()+" 保存失败"); | 593 | + log.info("主单"+ fedexMawb.getBillNo()+" 保存失败"); |
| 595 | result.setCode("30002"); | 594 | result.setCode("30002"); |
| 596 | - result.setMsg("主单"+ basfMawb.getBillNo()+" 保存失败"); | 595 | + result.setMsg("主单"+ fedexMawb.getBillNo()+" 保存失败"); |
| 597 | return result; | 596 | return result; |
| 598 | } | 597 | } |
| 599 | //更新: | 598 | //更新: |
| ... | @@ -606,7 +605,7 @@ public class ChmConsignmentService { | ... | @@ -606,7 +605,7 @@ public class ChmConsignmentService { |
| 606 | && pushTime.getTime()>chmConsignmentDB.getUpdateTime().getTime() | 605 | && pushTime.getTime()>chmConsignmentDB.getUpdateTime().getTime() |
| 607 | ){ | 606 | ){ |
| 608 | //更新数据 | 607 | //更新数据 |
| 609 | - log.info("更新主单"+ basfMawb.getBillNo()); | 608 | + log.info("更新主单"+ fedexMawb.getBillNo()); |
| 610 | 609 | ||
| 611 | for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){ | 610 | for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){ |
| 612 | for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){ | 611 | for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){ |
| ... | @@ -622,11 +621,11 @@ public class ChmConsignmentService { | ... | @@ -622,11 +621,11 @@ public class ChmConsignmentService { |
| 622 | chmConsignment.setUpdateTime(pushTime); | 621 | chmConsignment.setUpdateTime(pushTime); |
| 623 | ChmConsignment updateResult = this.saveChmConsignment(chmConsignment); | 622 | ChmConsignment updateResult = this.saveChmConsignment(chmConsignment); |
| 624 | if(!Objects.equals(updateResult,null)){ | 623 | if(!Objects.equals(updateResult,null)){ |
| 625 | - log.info("主单"+ basfMawb.getBillNo()+" 更新成功,chmConsignmentId:"+updateResult.getId()); | 624 | + log.info("主单"+ fedexMawb.getBillNo()+" 更新成功,chmConsignmentId:"+updateResult.getId()); |
| 626 | }else{ | 625 | }else{ |
| 627 | - log.info("主单"+ basfMawb.getBillNo()+" 更新失败"); | 626 | + log.info("主单"+ fedexMawb.getBillNo()+" 更新失败"); |
| 628 | result.setCode("30003"); | 627 | result.setCode("30003"); |
| 629 | - result.setMsg("主单"+ basfMawb.getBillNo()+" 更新失败"); | 628 | + result.setMsg("主单"+ fedexMawb.getBillNo()+" 更新失败"); |
| 630 | return result; | 629 | return result; |
| 631 | } | 630 | } |
| 632 | } | 631 | } |
| ... | @@ -637,28 +636,28 @@ public class ChmConsignmentService { | ... | @@ -637,28 +636,28 @@ public class ChmConsignmentService { |
| 637 | return result; | 636 | return result; |
| 638 | } | 637 | } |
| 639 | 638 | ||
| 640 | - public List<BasfcReceipt> getConsignmentCode(String[] consignmentCode,String creator) throws ParseException { | 639 | + public List<FedexReceipt> getConsignmentCode(String[] consignmentCode, String creator) throws ParseException { |
| 641 | DictionaryEntries consTypeC = dictionaryEntriesRepository.findDictionaryEntriesByCode(Constant.consType_C); | 640 | DictionaryEntries consTypeC = dictionaryEntriesRepository.findDictionaryEntriesByCode(Constant.consType_C); |
| 642 | SysUser sysUser = sysUserRepository.findUserByLoginName(creator); | 641 | SysUser sysUser = sysUserRepository.findUserByLoginName(creator); |
| 643 | List<String> stringList = declaredInfoService.stringList(consignmentCode); | 642 | List<String> stringList = declaredInfoService.stringList(consignmentCode); |
| 644 | List<Object[]> chmByConsignmentCode = chmConsignmentRepository.findChmByConsignmentCode(stringList, consTypeC.getId(),sysUser.getId()); | 643 | List<Object[]> chmByConsignmentCode = chmConsignmentRepository.findChmByConsignmentCode(stringList, consTypeC.getId(),sysUser.getId()); |
| 645 | - List<BasfcReceipt> basfcReceiptList = new ArrayList<>(); | 644 | + List<FedexReceipt> fedexcReceiptList = new ArrayList<>(); |
| 646 | if(chmByConsignmentCode.size()>0){ | 645 | if(chmByConsignmentCode.size()>0){ |
| 647 | for (int i = 0; i < chmByConsignmentCode.size(); i++) { | 646 | for (int i = 0; i < chmByConsignmentCode.size(); i++) { |
| 648 | Object[] objs = chmByConsignmentCode.get(i); | 647 | Object[] objs = chmByConsignmentCode.get(i); |
| 649 | - BasfcReceipt basfcReceipt = new BasfcReceipt(); | 648 | + FedexReceipt fedexcReceipt = new FedexReceipt(); |
| 650 | - basfcReceipt.setConsignmentId(Long.valueOf(objs[0].toString())); | 649 | + fedexcReceipt.setConsignmentId(Long.valueOf(objs[0].toString())); |
| 651 | - basfcReceipt.setConsignmentCode(objs[1].toString()); | 650 | + fedexcReceipt.setConsignmentCode(objs[1].toString()); |
| 652 | - basfcReceipt.setConsignmentType("C"); | 651 | + fedexcReceipt.setConsignmentType("C"); |
| 653 | - basfcReceipt.setCustomsReceiptStatus(objs[2].toString()); | 652 | + fedexcReceipt.setCustomsReceiptStatus(objs[2].toString()); |
| 654 | SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); | 653 | SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); |
| 655 | String str = objs[4].toString(); | 654 | String str = objs[4].toString(); |
| 656 | System.out.println(str); | 655 | System.out.println(str); |
| 657 | Date date = sdf.parse(objs[4].toString()); | 656 | Date date = sdf.parse(objs[4].toString()); |
| 658 | - basfcReceipt.setCustomsReceiptTime(date); | 657 | + fedexcReceipt.setCustomsReceiptTime(date); |
| 659 | - basfcReceiptList.add(basfcReceipt); | 658 | + fedexcReceiptList.add(fedexcReceipt); |
| 660 | } | 659 | } |
| 661 | } | 660 | } |
| 662 | - return basfcReceiptList; | 661 | + return fedexcReceiptList; |
| 663 | } | 662 | } |
| 664 | } | 663 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.BasfConsignment; | 3 | +import com.erry.iclear.dateInterface.api.request.FedexConsignment; |
| 4 | -import com.erry.iclear.dateInterface.api.request.BasfcReceipt; | 4 | +import com.erry.iclear.dateInterface.api.request.FedexReceipt; |
| 5 | -import com.erry.iclear.dateInterface.common.BaseModel; | ||
| 6 | -import com.erry.iclear.dateInterface.entity.ChmConsignment; | ||
| 7 | import com.erry.iclear.dateInterface.entity.DeclearTask; | 5 | import com.erry.iclear.dateInterface.entity.DeclearTask; |
| 8 | import com.erry.iclear.dateInterface.repository.DeclearTaskRepository; | 6 | import com.erry.iclear.dateInterface.repository.DeclearTaskRepository; |
| 9 | -import com.erry.iclear.dateInterface.util.StringUtil; | ||
| 10 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| ... | @@ -28,14 +25,14 @@ public class DeclearTaskService{ | ... | @@ -28,14 +25,14 @@ public class DeclearTaskService{ |
| 28 | @Autowired | 25 | @Autowired |
| 29 | private DeclearTaskRepository declareTaskRepository; | 26 | private DeclearTaskRepository declareTaskRepository; |
| 30 | 27 | ||
| 31 | - public void insertDeclareTask(List<BasfConsignment> basfConsignments, Long logId) throws Exception { | 28 | + public void insertDeclareTask(List<FedexConsignment> fedexConsignments, Long logId) throws Exception { |
| 32 | List<DeclearTask> declareTaskList = new ArrayList<>(); | 29 | List<DeclearTask> declareTaskList = new ArrayList<>(); |
| 33 | try{ | 30 | try{ |
| 34 | - if (basfConsignments.size()>0){ | 31 | + if (fedexConsignments.size()>0){ |
| 35 | - for (BasfConsignment basfConsignment : basfConsignments) { | 32 | + for (FedexConsignment fedexConsignment : fedexConsignments) { |
| 36 | DeclearTask declareTask = new DeclearTask(); | 33 | DeclearTask declareTask = new DeclearTask(); |
| 37 | - declareTask.setChmsignmentId(BigDecimal.valueOf(basfConsignment.getConsignmentId())); | 34 | + declareTask.setChmsignmentId(BigDecimal.valueOf(fedexConsignment.getConsignmentId())); |
| 38 | - declareTask.setChmsignmentCode(basfConsignment.getConsignmentCode()); | 35 | + declareTask.setChmsignmentCode(fedexConsignment.getConsignmentCode()); |
| 39 | declareTask.setOperationTime(new Date()); | 36 | declareTask.setOperationTime(new Date()); |
| 40 | declareTask.setFileType("1"); | 37 | declareTask.setFileType("1"); |
| 41 | declareTask.setOperationName("root"); | 38 | declareTask.setOperationName("root"); |
| ... | @@ -53,14 +50,14 @@ public class DeclearTaskService{ | ... | @@ -53,14 +50,14 @@ public class DeclearTaskService{ |
| 53 | 50 | ||
| 54 | } | 51 | } |
| 55 | 52 | ||
| 56 | - public void insertChmTask(List<BasfcReceipt> basfConsignments, Long logId) throws Exception { | 53 | + public void insertChmTask(List<FedexReceipt> fedexConsignments, Long logId) throws Exception { |
| 57 | List<DeclearTask> declareTaskList = new ArrayList<>(); | 54 | List<DeclearTask> declareTaskList = new ArrayList<>(); |
| 58 | try{ | 55 | try{ |
| 59 | - if (basfConsignments.size()>0){ | 56 | + if (fedexConsignments.size()>0){ |
| 60 | - for (BasfcReceipt basfConsignment : basfConsignments) { | 57 | + for (FedexReceipt fedexConsignment : fedexConsignments) { |
| 61 | DeclearTask declareTask = new DeclearTask(); | 58 | DeclearTask declareTask = new DeclearTask(); |
| 62 | - declareTask.setChmsignmentId(BigDecimal.valueOf(basfConsignment.getConsignmentId())); | 59 | + declareTask.setChmsignmentId(BigDecimal.valueOf(fedexConsignment.getConsignmentId())); |
| 63 | - declareTask.setChmsignmentCode(basfConsignment.getConsignmentCode()); | 60 | + declareTask.setChmsignmentCode(fedexConsignment.getConsignmentCode()); |
| 64 | declareTask.setOperationTime(new Date()); | 61 | declareTask.setOperationTime(new Date()); |
| 65 | declareTask.setFileType("2"); | 62 | declareTask.setFileType("2"); |
| 66 | declareTask.setOperationName("root"); | 63 | declareTask.setOperationName("root"); | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.BasfConsignment; | 3 | +import com.erry.iclear.dateInterface.api.request.FedexConsignment; |
| 4 | import com.erry.iclear.dateInterface.api.request.ConsignmentDetail; | 4 | import com.erry.iclear.dateInterface.api.request.ConsignmentDetail; |
| 5 | import com.erry.iclear.dateInterface.entity.DeclaredInfo; | 5 | import com.erry.iclear.dateInterface.entity.DeclaredInfo; |
| 6 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
| ... | @@ -9,34 +9,34 @@ import java.util.ArrayList; | ... | @@ -9,34 +9,34 @@ import java.util.ArrayList; |
| 9 | import java.util.List; | 9 | import java.util.List; |
| 10 | 10 | ||
| 11 | @Service | 11 | @Service |
| 12 | -public class BasfConsignmentService { | 12 | +public class FedexConsignmentService { |
| 13 | 13 | ||
| 14 | - public List<BasfConsignment> basfConsignmentList(List<DeclaredInfo> consignment){ | 14 | + public List<FedexConsignment> fedexConsignmentList(List<DeclaredInfo> consignment){ |
| 15 | - List<BasfConsignment> basfConsignmentList = new ArrayList<>(); | 15 | + List<FedexConsignment> fedexConsignmentList = new ArrayList<>(); |
| 16 | try{ | 16 | try{ |
| 17 | if(consignment.size()>0){ | 17 | if(consignment.size()>0){ |
| 18 | String consignmentCode = null; | 18 | String consignmentCode = null; |
| 19 | 19 | ||
| 20 | List<ConsignmentDetail> consignmentDetails = new ArrayList<>(); | 20 | List<ConsignmentDetail> consignmentDetails = new ArrayList<>(); |
| 21 | - BasfConsignment basfConsignment = new BasfConsignment(); | 21 | + FedexConsignment fedexConsignment = new FedexConsignment(); |
| 22 | for (DeclaredInfo declaredInfo : consignment){ | 22 | for (DeclaredInfo declaredInfo : consignment){ |
| 23 | if(!declaredInfo.getConsignmentCode().equals(consignmentCode)) { | 23 | if(!declaredInfo.getConsignmentCode().equals(consignmentCode)) { |
| 24 | if(consignmentCode != null){ | 24 | if(consignmentCode != null){ |
| 25 | - basfConsignment.setConsignmentList(consignmentDetails); | 25 | + fedexConsignment.setConsignmentList(consignmentDetails); |
| 26 | consignmentDetails = new ArrayList<>(); | 26 | consignmentDetails = new ArrayList<>(); |
| 27 | - basfConsignmentList.add(basfConsignment); | 27 | + fedexConsignmentList.add(fedexConsignment); |
| 28 | - basfConsignment = new BasfConsignment(); | 28 | + fedexConsignment = new FedexConsignment(); |
| 29 | } | 29 | } |
| 30 | consignmentCode = declaredInfo.getConsignmentCode(); | 30 | consignmentCode = declaredInfo.getConsignmentCode(); |
| 31 | - basfConsignment.setConsignmentCode(declaredInfo.getConsignmentCode()); | 31 | + fedexConsignment.setConsignmentCode(declaredInfo.getConsignmentCode()); |
| 32 | - basfConsignment.setConsignmentId(declaredInfo.getConsignmentId()); | 32 | + fedexConsignment.setConsignmentId(declaredInfo.getConsignmentId()); |
| 33 | - basfConsignment.setConsType(declaredInfo.getConsType()); | 33 | + fedexConsignment.setConsType(declaredInfo.getConsType()); |
| 34 | - basfConsignment.setOperateUnitName(declaredInfo.getOperateUnitName()); | 34 | + fedexConsignment.setOperateUnitName(declaredInfo.getOperateUnitName()); |
| 35 | - basfConsignment.setOperateUnitCode(declaredInfo.getOperateUnitCode()); | 35 | + fedexConsignment.setOperateUnitCode(declaredInfo.getOperateUnitCode()); |
| 36 | - basfConsignment.setOperateSCC(declaredInfo.getTradeCoSCC()); | 36 | + fedexConsignment.setOperateSCC(declaredInfo.getTradeCoSCC()); |
| 37 | - basfConsignment.setSender(declaredInfo.getSender()); | 37 | + fedexConsignment.setSender(declaredInfo.getSender()); |
| 38 | - basfConsignment.setShipperCustomsCode(declaredInfo.getOwnerCode()); | 38 | + fedexConsignment.setShipperCustomsCode(declaredInfo.getOwnerCode()); |
| 39 | - basfConsignment.setShipperSCC(declaredInfo.getOwnerCodeScc()); | 39 | + fedexConsignment.setShipperSCC(declaredInfo.getOwnerCodeScc()); |
| 40 | } | 40 | } |
| 41 | ConsignmentDetail consignmentDetail = new ConsignmentDetail(); | 41 | ConsignmentDetail consignmentDetail = new ConsignmentDetail(); |
| 42 | consignmentDetail.setSkuCode(declaredInfo.getSkuCode()); | 42 | consignmentDetail.setSkuCode(declaredInfo.getSkuCode()); |
| ... | @@ -58,12 +58,12 @@ public class BasfConsignmentService { | ... | @@ -58,12 +58,12 @@ public class BasfConsignmentService { |
| 58 | consignmentDetail.setDeclaredWeight(declaredInfo.getDeclaredWeight()); | 58 | consignmentDetail.setDeclaredWeight(declaredInfo.getDeclaredWeight()); |
| 59 | consignmentDetails.add(consignmentDetail); | 59 | consignmentDetails.add(consignmentDetail); |
| 60 | } | 60 | } |
| 61 | - basfConsignment.setConsignmentList(consignmentDetails); | 61 | + fedexConsignment.setConsignmentList(consignmentDetails); |
| 62 | - basfConsignmentList.add(basfConsignment); | 62 | + fedexConsignmentList.add(fedexConsignment); |
| 63 | } | 63 | } |
| 64 | }catch (Exception e){ | 64 | }catch (Exception e){ |
| 65 | e.printStackTrace(); | 65 | e.printStackTrace(); |
| 66 | } | 66 | } |
| 67 | - return basfConsignmentList; | 67 | + return fedexConsignmentList; |
| 68 | } | 68 | } |
| 69 | } | 69 | } | ... | ... |
| ... | @@ -8,10 +8,8 @@ import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; | ... | @@ -8,10 +8,8 @@ import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; |
| 8 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 8 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 9 | import com.erry.iclear.dateInterface.entity.ChmConsignment; | 9 | import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 10 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 10 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 11 | -import com.erry.iclear.dateInterface.repository.BasfMawbRepository; | 11 | +import com.erry.iclear.dateInterface.repository.FedexMawbRepository; |
| 12 | -import com.erry.iclear.dateInterface.repository.MawbRepository; | ||
| 13 | import com.erry.iclear.dateInterface.util.JsonToJava; | 12 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 14 | -import com.erry.iclear.dateInterface.util.NumberUtils; | ||
| 15 | import com.google.gson.Gson; | 13 | import com.google.gson.Gson; |
| 16 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
| 17 | import org.apache.http.Header; | 15 | import org.apache.http.Header; |
| ... | @@ -28,7 +26,7 @@ import java.util.Objects; | ... | @@ -28,7 +26,7 @@ import java.util.Objects; |
| 28 | */ | 26 | */ |
| 29 | @Service | 27 | @Service |
| 30 | @Slf4j | 28 | @Slf4j |
| 31 | -public class BasfService { | 29 | +public class FedexService { |
| 32 | 30 | ||
| 33 | private Gson gson = new Gson(); | 31 | private Gson gson = new Gson(); |
| 34 | 32 | ||
| ... | @@ -42,62 +40,62 @@ public class BasfService { | ... | @@ -42,62 +40,62 @@ public class BasfService { |
| 42 | private ChmConsignmentDetailService consignmentDetailService; | 40 | private ChmConsignmentDetailService consignmentDetailService; |
| 43 | 41 | ||
| 44 | @Autowired | 42 | @Autowired |
| 45 | - private BasfMawbRepository basfMawbRepository; | 43 | + private FedexMawbRepository fedexMawbRepository; |
| 46 | 44 | ||
| 47 | /** | 45 | /** |
| 48 | - * 保存主单Request --basfc | 46 | + * 保存主单Request --fedexc |
| 49 | - * @param basfc | 47 | + * @param fedexc |
| 50 | */ | 48 | */ |
| 51 | - public BasfMawb saveMawbBasf(Basfc basfc){ | 49 | + public FedexMawb saveMawbFedex(Fedexc fedexc){ |
| 52 | - BasfMawb result=null; | 50 | + FedexMawb result=null; |
| 53 | try{ | 51 | try{ |
| 54 | log.info("saveMawb start>>>>>>>>>>>"); | 52 | log.info("saveMawb start>>>>>>>>>>>"); |
| 55 | //运单头部信息 | 53 | //运单头部信息 |
| 56 | - BasfMawb basfMawb = new BasfMawb(); | 54 | + FedexMawb fedexMawb = new FedexMawb(); |
| 57 | - basfMawb.setAppId(basfc.getAppId()); | 55 | + fedexMawb.setAppId(fedexc.getAppId()); |
| 58 | - basfMawb.setMsgId(basfc.getMsgId()); | 56 | + fedexMawb.setMsgId(fedexc.getMsgId()); |
| 59 | - basfMawb.setConsignmentCodeId(basfc.getConsignmentId()); | 57 | + fedexMawb.setConsignmentCodeId(fedexc.getConsignmentId()); |
| 60 | - basfMawb.setType(basfc.getConsType()); | 58 | + fedexMawb.setType(fedexc.getConsType()); |
| 61 | //TODO 记录时为同一张表,用 '-->' 记录具体存放字段(方便查看,以免误解) | 59 | //TODO 记录时为同一张表,用 '-->' 记录具体存放字段(方便查看,以免误解) |
| 62 | //运单号-->提单号 | 60 | //运单号-->提单号 |
| 63 | - basfMawb.setBillNo(basfc.getConsignmentCode()); | 61 | + fedexMawb.setBillNo(fedexc.getConsignmentCode()); |
| 64 | //经营单位 --> 消费使用/生产销售单位名称 | 62 | //经营单位 --> 消费使用/生产销售单位名称 |
| 65 | - basfMawb.setOwnerName(basfc.getOperateUnitName()); | 63 | + fedexMawb.setOwnerName(fedexc.getOperateUnitName()); |
| 66 | //经营单位海关编码 --> 消费使用/生产销售单位代码 | 64 | //经营单位海关编码 --> 消费使用/生产销售单位代码 |
| 67 | - basfMawb.setOwnerCode(basfc.getOperateUnitCode()); | 65 | + fedexMawb.setOwnerCode(fedexc.getOperateUnitCode()); |
| 68 | //经营单位社会信用证代码 --> 消费使用/生产销售单位单位统一编码 | 66 | //经营单位社会信用证代码 --> 消费使用/生产销售单位单位统一编码 |
| 69 | - basfMawb.setOwnerCodeScc(basfc.getOperateSCC()); | 67 | + fedexMawb.setOwnerCodeScc(fedexc.getOperateSCC()); |
| 70 | //发件人 --> 境内收发货人名称 | 68 | //发件人 --> 境内收发货人名称 |
| 71 | - basfMawb.setTradeName(basfc.getSender()); | 69 | + fedexMawb.setTradeName(fedexc.getSender()); |
| 72 | //发件人海关编码 --> 境内收发货人编号 | 70 | //发件人海关编码 --> 境内收发货人编号 |
| 73 | - basfMawb.setTradeCode(basfc.getShipperCustomsCode()); | 71 | + fedexMawb.setTradeCode(fedexc.getShipperCustomsCode()); |
| 74 | //发件人社会信用证代码 --> 生产核销单位统一信用代码---报关形式类型 | 72 | //发件人社会信用证代码 --> 生产核销单位统一信用代码---报关形式类型 |
| 75 | - basfMawb.setTradeCodeScc(basfc.getShipperSCC()); | 73 | + fedexMawb.setTradeCodeScc(fedexc.getShipperSCC()); |
| 76 | 74 | ||
| 77 | - basfMawb.setEanNo(basfc.getEanNo()); | 75 | + fedexMawb.setEanNo(fedexc.getEanNo()); |
| 78 | //明细 | 76 | //明细 |
| 79 | - List<BasfMawbDetail> mawbDetailList = new ArrayList<>(); | 77 | + List<FedexMawbDetail> mawbDetailList = new ArrayList<>(); |
| 80 | - if (basfc.getConsignmentList().size()>0){ | 78 | + if (fedexc.getConsignmentList().size()>0){ |
| 81 | - for (BasfcDetail basfcDetail : basfc.getConsignmentList()){ | 79 | + for (FedexDetail fedexcDetail : fedexc.getConsignmentList()){ |
| 82 | - BasfMawbDetail mawbDetail = new BasfMawbDetail(); | 80 | + FedexMawbDetail mawbDetail = new FedexMawbDetail(); |
| 83 | - mawbDetail.setDetailId(String.valueOf(basfcDetail.getConsignmentDetailId())); | 81 | + mawbDetail.setDetailId(String.valueOf(fedexcDetail.getConsignmentDetailId())); |
| 84 | - mawbDetail.setGmodel(basfcDetail.getModel()); | 82 | + mawbDetail.setGmodel(fedexcDetail.getModel()); |
| 85 | - mawbDetail.setCodeTS(basfcDetail.getSkuCode()); | 83 | + mawbDetail.setCodeTS(fedexcDetail.getSkuCode()); |
| 86 | - mawbDetail.setGname(basfcDetail.getSkuName()); | 84 | + mawbDetail.setGname(fedexcDetail.getSkuName()); |
| 87 | - mawbDetail.setGqty(basfcDetail.getKnockdownNumber()); | 85 | + mawbDetail.setGqty(fedexcDetail.getKnockdownNumber()); |
| 88 | - mawbDetail.setGunit(basfcDetail.getKnockdownUnit()); | 86 | + mawbDetail.setGunit(fedexcDetail.getKnockdownUnit()); |
| 89 | - mawbDetail.setFirstUnit(basfcDetail.getUnitLegalFirst()); | 87 | + mawbDetail.setFirstUnit(fedexcDetail.getUnitLegalFirst()); |
| 90 | - mawbDetail.setFirstQty(basfcDetail.getQtyLegalFirst()); | 88 | + mawbDetail.setFirstQty(fedexcDetail.getQtyLegalFirst()); |
| 91 | - mawbDetail.setSecondQty(basfcDetail.getQtyLegalSecond()); | 89 | + mawbDetail.setSecondQty(fedexcDetail.getQtyLegalSecond()); |
| 92 | - mawbDetail.setSecondUnit(basfcDetail.getUnitLegalSecond()); | 90 | + mawbDetail.setSecondUnit(fedexcDetail.getUnitLegalSecond()); |
| 93 | - mawbDetail.setDeclTotal(basfcDetail.getDeclaredAmount()); | 91 | + mawbDetail.setDeclTotal(fedexcDetail.getDeclaredAmount()); |
| 94 | - mawbDetail.setTradeCurr(basfcDetail.getCurrency()); | 92 | + mawbDetail.setTradeCurr(fedexcDetail.getCurrency()); |
| 95 | - mawbDetail.setDeclaredWeight(basfcDetail.getDeclaredWeight()); | 93 | + mawbDetail.setDeclaredWeight(fedexcDetail.getDeclaredWeight()); |
| 96 | mawbDetailList.add(mawbDetail); | 94 | mawbDetailList.add(mawbDetail); |
| 97 | } | 95 | } |
| 98 | } | 96 | } |
| 99 | - basfMawb.setMawbDetailList(mawbDetailList); | 97 | + fedexMawb.setMawbDetailList(mawbDetailList); |
| 100 | - result = basfMawbRepository.save(basfMawb); | 98 | + result = fedexMawbRepository.save(fedexMawb); |
| 101 | log.info("saveMawb end>>>>>>>>>>>"); | 99 | log.info("saveMawb end>>>>>>>>>>>"); |
| 102 | }catch (Exception e){ | 100 | }catch (Exception e){ |
| 103 | log.error("saveMawb() error:"+e.getMessage()); | 101 | log.error("saveMawb() error:"+e.getMessage()); |
| ... | @@ -107,24 +105,24 @@ public class BasfService { | ... | @@ -107,24 +105,24 @@ public class BasfService { |
| 107 | 105 | ||
| 108 | /** | 106 | /** |
| 109 | * 校验主单 | 107 | * 校验主单 |
| 110 | - * @param basfMawb | 108 | + * @param fedexMawb |
| 111 | * @return | 109 | * @return |
| 112 | */ | 110 | */ |
| 113 | - public ResultRS checkBasfMawb(BasfMawb basfMawb){ | 111 | + public ResultRS checkFedexMawb(FedexMawb fedexMawb){ |
| 114 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 112 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 115 | try{ | 113 | try{ |
| 116 | - log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(basfMawb)); | 114 | + log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(fedexMawb)); |
| 117 | 115 | ||
| 118 | //1、将请求转换为运单 | 116 | //1、将请求转换为运单 |
| 119 | - ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentBasf(basfMawb,null,"IDE-ICLEAR-API"); | 117 | + ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,"IDE-ICLEAR-API"); |
| 120 | if(Objects.equals(chmConsignment,null)){ | 118 | if(Objects.equals(chmConsignment,null)){ |
| 121 | result.setCode("30001"); | 119 | result.setCode("30001"); |
| 122 | result.setMsg("数据格式不正确"); | 120 | result.setMsg("数据格式不正确"); |
| 123 | return result; | 121 | return result; |
| 124 | } | 122 | } |
| 125 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 123 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| 126 | - basfMawb.getMawbDetailList().forEach(detail ->{ | 124 | + fedexMawb.getMawbDetailList().forEach(detail ->{ |
| 127 | - chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetailBasf(detail,chmConsignment)); | 125 | + chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetailFedex(detail,chmConsignment)); |
| 128 | }); | 126 | }); |
| 129 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); | 127 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); |
| 130 | 128 | ||
| ... | @@ -145,7 +143,7 @@ public class BasfService { | ... | @@ -145,7 +143,7 @@ public class BasfService { |
| 145 | result.setSuccess(iclearCheckResponseResult.getSuccess()); | 143 | result.setSuccess(iclearCheckResponseResult.getSuccess()); |
| 146 | result.setCode(iclearCheckResponseResult.getCode()); | 144 | result.setCode(iclearCheckResponseResult.getCode()); |
| 147 | result.setMsg(iclearCheckResponseResult.getMessage()); | 145 | result.setMsg(iclearCheckResponseResult.getMessage()); |
| 148 | - log.info("<<<<<<<< checkMawb start >>>>>>>>>> mawb:"+gson.toJson(basfMawb) +" result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); | 146 | + log.info("<<<<<<<< checkMawb start >>>>>>>>>> mawb:"+gson.toJson(fedexMawb) +" result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); |
| 149 | }catch (Exception e){ | 147 | }catch (Exception e){ |
| 150 | log.error("checkMawb() error:" + e.getMessage()); | 148 | log.error("checkMawb() error:" + e.getMessage()); |
| 151 | } | 149 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.Basfc; | ||
| 4 | -import com.erry.iclear.dateInterface.api.request.Mawb; | ||
| 5 | -import com.erry.iclear.dateInterface.common.Constant; | ||
| 6 | import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; | 3 | import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; |
| 7 | -import com.erry.iclear.dateInterface.entity.IClearApiLog; | ||
| 8 | import com.erry.iclear.dateInterface.repository.IClearApiHsCodeLogRepository; | 4 | import com.erry.iclear.dateInterface.repository.IClearApiHsCodeLogRepository; |
| 9 | -import com.erry.iclear.dateInterface.repository.IClearApiLogRepository; | ||
| 10 | import com.erry.iclear.dateInterface.util.DateUtils; | 5 | import com.erry.iclear.dateInterface.util.DateUtils; |
| 11 | import lombok.extern.slf4j.Slf4j; | 6 | import lombok.extern.slf4j.Slf4j; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 14 | 9 | ||
| 15 | -import java.util.Date; | ||
| 16 | - | ||
| 17 | /** | 10 | /** |
| 18 | * | 11 | * |
| 19 | * hscode请求日志 | 12 | * hscode请求日志 | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.Basfc; | 3 | +import com.erry.iclear.dateInterface.api.request.Fedexc; |
| 4 | import com.erry.iclear.dateInterface.api.request.Mawb; | 4 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 5 | import com.erry.iclear.dateInterface.common.Constant; | 5 | import com.erry.iclear.dateInterface.common.Constant; |
| 6 | import com.erry.iclear.dateInterface.entity.IClearApiLog; | 6 | import com.erry.iclear.dateInterface.entity.IClearApiLog; |
| ... | @@ -63,7 +63,7 @@ public class IClearApiLogService { | ... | @@ -63,7 +63,7 @@ public class IClearApiLogService { |
| 63 | * 创建日志 | 63 | * 创建日志 |
| 64 | * @return | 64 | * @return |
| 65 | */ | 65 | */ |
| 66 | - public IClearApiLog convertToIClearApiLogC(Basfc basfc, String appId, String appKey, Date pushTime){ | 66 | + public IClearApiLog convertToIClearApiLogC(Fedexc fedexc, String appId, String appKey, Date pushTime){ |
| 67 | IClearApiLog result = new IClearApiLog(); | 67 | IClearApiLog result = new IClearApiLog(); |
| 68 | try{ | 68 | try{ |
| 69 | result.setMsgType(Constant.MSG_TYPE_C); | 69 | result.setMsgType(Constant.MSG_TYPE_C); |
| ... | @@ -75,7 +75,7 @@ public class IClearApiLogService { | ... | @@ -75,7 +75,7 @@ public class IClearApiLogService { |
| 75 | result.setResponseTime(null); | 75 | result.setResponseTime(null); |
| 76 | result.setSpendTime(null); | 76 | result.setSpendTime(null); |
| 77 | result.setSendTimes(1); | 77 | result.setSendTimes(1); |
| 78 | - result.setBillNo(basfc.getConsignmentCode()); | 78 | + result.setBillNo(fedexc.getConsignmentCode()); |
| 79 | //result.setContrNo(mawb.getContrNo()); | 79 | //result.setContrNo(mawb.getContrNo()); |
| 80 | }catch (Exception e){ | 80 | }catch (Exception e){ |
| 81 | log.error("convertToIClearApiLog() error:"+e.getMessage()); | 81 | log.error("convertToIClearApiLog() error:"+e.getMessage()); |
| ... | @@ -87,7 +87,7 @@ public class IClearApiLogService { | ... | @@ -87,7 +87,7 @@ public class IClearApiLogService { |
| 87 | * BASF请求申报/回执数据-添加日志 2021年11月3日 xjq | 87 | * BASF请求申报/回执数据-添加日志 2021年11月3日 xjq |
| 88 | * @return | 88 | * @return |
| 89 | */ | 89 | */ |
| 90 | - public IClearApiLog convertToIClearApiLogCselect(String basfc, String appId, String appKey, Date pushTime){ | 90 | + public IClearApiLog convertToIClearApiLogCselect(String fedexc, String appId, String appKey, Date pushTime){ |
| 91 | IClearApiLog result = new IClearApiLog(); | 91 | IClearApiLog result = new IClearApiLog(); |
| 92 | try{ | 92 | try{ |
| 93 | result.setMsgType(Constant.MSG_TYPE_C); | 93 | result.setMsgType(Constant.MSG_TYPE_C); |
| ... | @@ -99,7 +99,7 @@ public class IClearApiLogService { | ... | @@ -99,7 +99,7 @@ public class IClearApiLogService { |
| 99 | result.setResponseTime(null); | 99 | result.setResponseTime(null); |
| 100 | result.setSpendTime(null); | 100 | result.setSpendTime(null); |
| 101 | result.setSendTimes(1); | 101 | result.setSendTimes(1); |
| 102 | - result.setBillNo(basfc); | 102 | + result.setBillNo(fedexc); |
| 103 | }catch (Exception e){ | 103 | }catch (Exception e){ |
| 104 | log.error("convertToIClearApiLog() error:"+e.getMessage()); | 104 | log.error("convertToIClearApiLog() error:"+e.getMessage()); |
| 105 | } | 105 | } | ... | ... |
| ... | @@ -3,25 +3,19 @@ package com.erry.iclear.dateInterface.service; | ... | @@ -3,25 +3,19 @@ package com.erry.iclear.dateInterface.service; |
| 3 | import com.arronlong.httpclientutil.HttpClientUtil; | 3 | import com.arronlong.httpclientutil.HttpClientUtil; |
| 4 | import com.arronlong.httpclientutil.common.HttpConfig; | 4 | import com.arronlong.httpclientutil.common.HttpConfig; |
| 5 | import com.arronlong.httpclientutil.common.HttpHeader; | 5 | import com.arronlong.httpclientutil.common.HttpHeader; |
| 6 | -import com.erry.iclear.dateInterface.api.request.Basfc; | ||
| 7 | -import com.erry.iclear.dateInterface.api.request.BasfcDetail; | ||
| 8 | import com.erry.iclear.dateInterface.api.request.Mawb; | 6 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 9 | -import com.erry.iclear.dateInterface.api.request.MawbDetail; | ||
| 10 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; | 7 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; |
| 11 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 8 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 12 | import com.erry.iclear.dateInterface.entity.ChmConsignment; | 9 | import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 13 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 10 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 14 | -import com.erry.iclear.dateInterface.repository.MawbAdd; | ||
| 15 | import com.erry.iclear.dateInterface.repository.MawbRepository; | 11 | import com.erry.iclear.dateInterface.repository.MawbRepository; |
| 16 | import com.erry.iclear.dateInterface.util.JsonToJava; | 12 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 17 | -import com.erry.iclear.dateInterface.util.NumberUtils; | ||
| 18 | import com.google.gson.Gson; | 13 | import com.google.gson.Gson; |
| 19 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
| 20 | import org.apache.http.Header; | 15 | import org.apache.http.Header; |
| 21 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 22 | import org.springframework.beans.factory.annotation.Value; | 17 | import org.springframework.beans.factory.annotation.Value; |
| 23 | import org.springframework.stereotype.Service; | 18 | import org.springframework.stereotype.Service; |
| 24 | -import org.springframework.validation.annotation.Validated; | ||
| 25 | 19 | ||
| 26 | import java.util.*; | 20 | import java.util.*; |
| 27 | 21 | ... | ... |
| ... | @@ -16,11 +16,11 @@ public class ApiTest { | ... | @@ -16,11 +16,11 @@ public class ApiTest { |
| 16 | //D类申报的数据落地接口 | 16 | //D类申报的数据落地接口 |
| 17 | public static String sendMawb = "/customs/sendMawb"; | 17 | public static String sendMawb = "/customs/sendMawb"; |
| 18 | //C类申报的数据落地接口 | 18 | //C类申报的数据落地接口 |
| 19 | - public static String sendMawbBasf = "/basf/sendMawbBasf"; | 19 | + public static String sendMawbBasf = "/fedex/sendMawbBasf"; |
| 20 | //C类EDI数据接口 | 20 | //C类EDI数据接口 |
| 21 | - public static String selectDecListBasf = "/basf/selectDecListBasf"; | 21 | + public static String selectDecListBasf = "/fedex/selectDecListBasf"; |
| 22 | //C类回执数据接口 | 22 | //C类回执数据接口 |
| 23 | - public static String selectChmListBasf = "basf/selectChmListBasf"; | 23 | + public static String selectChmListBasf = "fedex/selectChmListBasf"; |
| 24 | //获取HSCODE接口地址 | 24 | //获取HSCODE接口地址 |
| 25 | public static String hscodeRequest = "hscode/hscodeRequest"; | 25 | public static String hscodeRequest = "hscode/hscodeRequest"; |
| 26 | 26 | ... | ... |
| ... | @@ -3,7 +3,7 @@ package com.erry.iclear.dateInterface; | ... | @@ -3,7 +3,7 @@ package com.erry.iclear.dateInterface; |
| 3 | import com.erry.iclear.dateInterface.api.CustomsDataInterface; | 3 | import com.erry.iclear.dateInterface.api.CustomsDataInterface; |
| 4 | import com.erry.iclear.dateInterface.api.request.*; | 4 | import com.erry.iclear.dateInterface.api.request.*; |
| 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 6 | -import com.erry.iclear.dateInterface.service.BasfService; | 6 | +import com.erry.iclear.dateInterface.service.FedexService; |
| 7 | import com.erry.iclear.dateInterface.service.ChmConsignmentService; | 7 | import com.erry.iclear.dateInterface.service.ChmConsignmentService; |
| 8 | import org.junit.Test; | 8 | import org.junit.Test; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -23,7 +23,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -23,7 +23,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 23 | private CustomsDataInterface customsDataInterface; | 23 | private CustomsDataInterface customsDataInterface; |
| 24 | 24 | ||
| 25 | @Autowired | 25 | @Autowired |
| 26 | - private BasfService basfService; | 26 | + private FedexService fedexService; |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | /*@Test | 29 | /*@Test |
| ... | @@ -42,12 +42,12 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -42,12 +42,12 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 42 | public void testProcessChmConsignment1(){ | 42 | public void testProcessChmConsignment1(){ |
| 43 | try{ | 43 | try{ |
| 44 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 44 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); |
| 45 | - Basfc basfc = this.createNewBasf(); | 45 | + Fedexc fedexc = this.createNewFedex(); |
| 46 | - BasfMawb mawb = basfService.saveMawbBasf(basfc); | 46 | + FedexMawb mawb = fedexService.saveMawbFedex(fedexc); |
| 47 | - //Basfc basfc = this.createNewBasf(); | 47 | + //Basfc fedexc = this.createNewBasf(); |
| 48 | String timeStamp = String.valueOf(new Date().getTime()); | 48 | String timeStamp = String.valueOf(new Date().getTime()); |
| 49 | - ResultRS resultRS = chmConsignmentService.processChmConsignmentBasf(mawb, timeStamp, "BASF"); | 49 | + ResultRS resultRS = chmConsignmentService.processChmConsignmentFedex(mawb, timeStamp, "BASF"); |
| 50 | - /*result=basfService.checkBasfMawb(mawb); | 50 | + /*result=fedexService.checkBasfMawb(mawb); |
| 51 | if(!result.getSuccess()){ | 51 | if(!result.getSuccess()){ |
| 52 | System.out.println(result.getMsg()); | 52 | System.out.println(result.getMsg()); |
| 53 | }*/ | 53 | }*/ |
| ... | @@ -58,37 +58,37 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -58,37 +58,37 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 58 | System.out.println("1"); | 58 | System.out.println("1"); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | - private Basfc createNewBasf(){ | 61 | + private Fedexc createNewFedex(){ |
| 62 | - List<BasfcDetail> basfcDetailList = new ArrayList<>(); | 62 | + List<FedexDetail> fedexcDetailList = new ArrayList<>(); |
| 63 | - BasfcDetail basfcDetail = new BasfcDetail(); | 63 | + FedexDetail fedexcDetail = new FedexDetail(); |
| 64 | - basfcDetail.setConsignmentDetailId(222L); | 64 | + fedexcDetail.setConsignmentDetailId(222L); |
| 65 | - basfcDetail.setSkuCode("29262000"); | 65 | + fedexcDetail.setSkuCode("29262000"); |
| 66 | - basfcDetail.setSkuName("210908001测试"); | 66 | + fedexcDetail.setSkuName("210908001测试"); |
| 67 | - basfcDetail.setModel("0|0|1|1||||||||"); | 67 | + fedexcDetail.setModel("0|0|1|1||||||||"); |
| 68 | - basfcDetail.setUnitLegalFirst("035"); | 68 | + fedexcDetail.setUnitLegalFirst("035"); |
| 69 | - basfcDetail.setQtyLegalFirst(BigDecimal.valueOf(1)); | 69 | + fedexcDetail.setQtyLegalFirst(BigDecimal.valueOf(1)); |
| 70 | - basfcDetail.setKnockdownUnit("035"); | 70 | + fedexcDetail.setKnockdownUnit("035"); |
| 71 | - basfcDetail.setKnockdownNumber(BigDecimal.valueOf(1)); | 71 | + fedexcDetail.setKnockdownNumber(BigDecimal.valueOf(1)); |
| 72 | - basfcDetail.setUnitLegalSecond("007"); | 72 | + fedexcDetail.setUnitLegalSecond("007"); |
| 73 | - basfcDetail.setQtyLegalSecond(BigDecimal.valueOf(1)); | 73 | + fedexcDetail.setQtyLegalSecond(BigDecimal.valueOf(1)); |
| 74 | - basfcDetail.setDeclaredAmount(BigDecimal.valueOf(1)); | 74 | + fedexcDetail.setDeclaredAmount(BigDecimal.valueOf(1)); |
| 75 | - basfcDetail.setCurrency("USD"); | 75 | + fedexcDetail.setCurrency("USD"); |
| 76 | - basfcDetail.setDeclaredWeight(BigDecimal.valueOf(1)); | 76 | + fedexcDetail.setDeclaredWeight(BigDecimal.valueOf(1)); |
| 77 | - basfcDetailList.add(basfcDetail); | 77 | + fedexcDetailList.add(fedexcDetail); |
| 78 | - | 78 | + |
| 79 | - Basfc basfc = new Basfc(); | 79 | + Fedexc fedexc = new Fedexc(); |
| 80 | - basfc.setConsignmentCode("210908002"); | 80 | + fedexc.setConsignmentCode("210908002"); |
| 81 | - basfc.setConsignmentId(1L); | 81 | + fedexc.setConsignmentId(1L); |
| 82 | - basfc.setConsType("C"); | 82 | + fedexc.setConsType("C"); |
| 83 | - basfc.setSender("天津知行博创科技有限公司"); | 83 | + fedexc.setSender("天津知行博创科技有限公司"); |
| 84 | - basfc.setShipperCustomsCode("11119608L9"); | 84 | + fedexc.setShipperCustomsCode("11119608L9"); |
| 85 | - basfc.setShipperSCC("123456789012345678"); | 85 | + fedexc.setShipperSCC("123456789012345678"); |
| 86 | - basfc.setOperateUnitName("天津丰铭佳业科贸有限公司"); | 86 | + fedexc.setOperateUnitName("天津丰铭佳业科贸有限公司"); |
| 87 | - basfc.setOperateUnitCode(""); | 87 | + fedexc.setOperateUnitCode(""); |
| 88 | - basfc.setOperateSCC(""); | 88 | + fedexc.setOperateSCC(""); |
| 89 | -// basfc.setEANNo(""); | 89 | +// fedexc.setEANNo(""); |
| 90 | -// basfc.setBasfcDetailList(basfcDetailList); | 90 | +// fedexc.setBasfcDetailList(fedexcDetailList); |
| 91 | - return basfc; | 91 | + return fedexc; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | private Mawb createNewMawb(){ | 94 | private Mawb createNewMawb(){ | ... | ... |
| ... | @@ -8,17 +8,15 @@ import com.arronlong.httpclientutil.common.SSLs; | ... | @@ -8,17 +8,15 @@ import com.arronlong.httpclientutil.common.SSLs; |
| 8 | import com.erry.iclear.dateInterface.util.SHA256Util; | 8 | import com.erry.iclear.dateInterface.util.SHA256Util; |
| 9 | import org.apache.http.Header; | 9 | import org.apache.http.Header; |
| 10 | 10 | ||
| 11 | -import java.util.Date; | ||
| 12 | - | ||
| 13 | /** | 11 | /** |
| 14 | * C类EDI数据接口 | 12 | * C类EDI数据接口 |
| 15 | * fedex | 13 | * fedex |
| 16 | * 2022年4月14日17:55:55 | 14 | * 2022年4月14日17:55:55 |
| 17 | */ | 15 | */ |
| 18 | -public class SelectDecListBasf { | 16 | +public class SelectChmListFedex { |
| 19 | - public static String url = "https://40.73.78.157:8780"; | 17 | + public static String url = "https://localhost:8780"; |
| 20 | //C类EDI数据接口 | 18 | //C类EDI数据接口 |
| 21 | - public static String path = "/basf/selectDecListBasf"; | 19 | + public static String path = "/fedex/selectChmListFedex"; |
| 22 | //时间戳 | 20 | //时间戳 |
| 23 | public static String timeStamp = "1649839249891"; | 21 | public static String timeStamp = "1649839249891"; |
| 24 | //APPID | 22 | //APPID |
| ... | @@ -39,14 +37,14 @@ public class SelectDecListBasf { | ... | @@ -39,14 +37,14 @@ public class SelectDecListBasf { |
| 39 | //consignmentCode 运单号需要修改 | 37 | //consignmentCode 运单号需要修改 |
| 40 | String json ="{\"consignmentCode\":\"289050515424\"}"; | 38 | String json ="{\"consignmentCode\":\"289050515424\"}"; |
| 41 | 39 | ||
| 42 | - String token = SHA256Util.getSHA256String(SelectDecListBasf.appId + SelectDecListBasf.appKey + SelectDecListBasf.security + SelectDecListBasf.timeStamp); | 40 | + String token = SHA256Util.getSHA256String(SelectChmListFedex.appId + SelectChmListFedex.appKey + SelectChmListFedex.security + SelectChmListFedex.timeStamp); |
| 43 | System.out.println(token); | 41 | System.out.println(token); |
| 44 | //消息头 | 42 | //消息头 |
| 45 | Header[] headers = HttpHeader.custom() | 43 | Header[] headers = HttpHeader.custom() |
| 46 | .other("Content-Type", "application/json") | 44 | .other("Content-Type", "application/json") |
| 47 | - .other("Appid", SelectDecListBasf.appId) | 45 | + .other("Appid", SelectChmListFedex.appId) |
| 48 | - .other("appKey", SelectDecListBasf.appKey) | 46 | + .other("appKey", SelectChmListFedex.appKey) |
| 49 | - .other("TimeStamp", SelectDecListBasf.timeStamp) | 47 | + .other("TimeStamp", SelectChmListFedex.timeStamp) |
| 50 | .other("token", token) | 48 | .other("token", token) |
| 51 | .build(); | 49 | .build(); |
| 52 | //客户端配置 | 50 | //客户端配置 |
| ... | @@ -57,7 +55,7 @@ public class SelectDecListBasf { | ... | @@ -57,7 +55,7 @@ public class SelectDecListBasf { |
| 57 | .ssl() | 55 | .ssl() |
| 58 | .retry(3); | 56 | .retry(3); |
| 59 | //URL | 57 | //URL |
| 60 | - String url = SelectDecListBasf.url + SelectDecListBasf.path; | 58 | + String url = SelectChmListFedex.url + SelectChmListFedex.path; |
| 61 | //HTTP请求 | 59 | //HTTP请求 |
| 62 | HttpConfig config = HttpConfig.custom() | 60 | HttpConfig config = HttpConfig.custom() |
| 63 | .headers(headers) | 61 | .headers(headers) | ... | ... |
| ... | @@ -13,10 +13,10 @@ import org.apache.http.Header; | ... | @@ -13,10 +13,10 @@ import org.apache.http.Header; |
| 13 | * fedex | 13 | * fedex |
| 14 | * 2022年4月14日17:55:55 | 14 | * 2022年4月14日17:55:55 |
| 15 | */ | 15 | */ |
| 16 | -public class SelectChmListBasf { | 16 | +public class SelectDecListFedex { |
| 17 | public static String url = "https://40.73.78.157:8780"; | 17 | public static String url = "https://40.73.78.157:8780"; |
| 18 | //C类EDI数据接口 | 18 | //C类EDI数据接口 |
| 19 | - public static String path = "/basf/selectChmListBasf"; | 19 | + public static String path = "/fedex/selectDecListFedex"; |
| 20 | //时间戳 | 20 | //时间戳 |
| 21 | public static String timeStamp = "1649839249891"; | 21 | public static String timeStamp = "1649839249891"; |
| 22 | //APPID | 22 | //APPID |
| ... | @@ -37,14 +37,14 @@ public class SelectChmListBasf { | ... | @@ -37,14 +37,14 @@ public class SelectChmListBasf { |
| 37 | //consignmentCode 运单号需要修改 | 37 | //consignmentCode 运单号需要修改 |
| 38 | String json ="{\"consignmentCode\":\"289050515424\"}"; | 38 | String json ="{\"consignmentCode\":\"289050515424\"}"; |
| 39 | 39 | ||
| 40 | - String token = SHA256Util.getSHA256String(SelectChmListBasf.appId + SelectChmListBasf.appKey + SelectChmListBasf.security + SelectChmListBasf.timeStamp); | 40 | + String token = SHA256Util.getSHA256String(SelectDecListFedex.appId + SelectDecListFedex.appKey + SelectDecListFedex.security + SelectDecListFedex.timeStamp); |
| 41 | System.out.println(token); | 41 | System.out.println(token); |
| 42 | //消息头 | 42 | //消息头 |
| 43 | Header[] headers = HttpHeader.custom() | 43 | Header[] headers = HttpHeader.custom() |
| 44 | .other("Content-Type", "application/json") | 44 | .other("Content-Type", "application/json") |
| 45 | - .other("Appid", SelectChmListBasf.appId) | 45 | + .other("Appid", SelectDecListFedex.appId) |
| 46 | - .other("appKey", SelectChmListBasf.appKey) | 46 | + .other("appKey", SelectDecListFedex.appKey) |
| 47 | - .other("TimeStamp", SelectChmListBasf.timeStamp) | 47 | + .other("TimeStamp", SelectDecListFedex.timeStamp) |
| 48 | .other("token", token) | 48 | .other("token", token) |
| 49 | .build(); | 49 | .build(); |
| 50 | //客户端配置 | 50 | //客户端配置 |
| ... | @@ -55,7 +55,7 @@ public class SelectChmListBasf { | ... | @@ -55,7 +55,7 @@ public class SelectChmListBasf { |
| 55 | .ssl() | 55 | .ssl() |
| 56 | .retry(3); | 56 | .retry(3); |
| 57 | //URL | 57 | //URL |
| 58 | - String url = SelectChmListBasf.url + SelectChmListBasf.path; | 58 | + String url = SelectDecListFedex.url + SelectDecListFedex.path; |
| 59 | //HTTP请求 | 59 | //HTTP请求 |
| 60 | HttpConfig config = HttpConfig.custom() | 60 | HttpConfig config = HttpConfig.custom() |
| 61 | .headers(headers) | 61 | .headers(headers) | ... | ... |
| ... | @@ -8,17 +8,15 @@ import com.arronlong.httpclientutil.common.SSLs; | ... | @@ -8,17 +8,15 @@ import com.arronlong.httpclientutil.common.SSLs; |
| 8 | import com.erry.iclear.dateInterface.util.SHA256Util; | 8 | import com.erry.iclear.dateInterface.util.SHA256Util; |
| 9 | import org.apache.http.Header; | 9 | import org.apache.http.Header; |
| 10 | 10 | ||
| 11 | -import java.util.Date; | ||
| 12 | - | ||
| 13 | /** | 11 | /** |
| 14 | * C类申报数据落地接口 | 12 | * C类申报数据落地接口 |
| 15 | * fedex | 13 | * fedex |
| 16 | * 2022年4月14日17:55:55 | 14 | * 2022年4月14日17:55:55 |
| 17 | */ | 15 | */ |
| 18 | -public class SendMawbBasf { | 16 | +public class SendMawbFedex { |
| 19 | public static String url = "https://40.73.78.157:8780"; | 17 | public static String url = "https://40.73.78.157:8780"; |
| 20 | //C类申报数据落地接口 | 18 | //C类申报数据落地接口 |
| 21 | - public static String path = "/basf/sendMawbBasf"; | 19 | + public static String path = "/fedex/sendMawbFedex"; |
| 22 | //时间戳 | 20 | //时间戳 |
| 23 | public static String timeStamp = "1649839249891"; | 21 | public static String timeStamp = "1649839249891"; |
| 24 | //APPID | 22 | //APPID |
| ... | @@ -39,14 +37,14 @@ public class SendMawbBasf { | ... | @@ -39,14 +37,14 @@ public class SendMawbBasf { |
| 39 | //申报数据:consignmentCode 运单号需要修改 | 37 | //申报数据:consignmentCode 运单号需要修改 |
| 40 | String json ="{\"consignmentCode\":\"271002102051\",\"consignmentId\":164535620,\"consType\":\"C\",\"sender\":\"巴斯夫护理化学品(上海)有限公司\",\"shipperCustomsCode\":\"3119920047\",\"shipperSCC\":\"91310000607239894U\",\"operateUnitName\":\"巴斯夫护理化学品(上海)有限公司\",\"operateUnitCode\":\"3119920047\",\"operateSCC\":\"91310000607239894U\",\"consignmentList\":[{\"consignmentDetailId\":83010676,\"skuCode\":\"2917341090\",\"skuName\":\"邻苯二甲酸二丁酯\",\"model\":\"品名:邻苯二甲酸二丁酯 |品牌类型:0|出口享惠情况:0|成分含量:100% 邻苯二甲酸二丁酯|用途:化学分析用试剂,实验用途|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"knockdownNumber\":1,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":1,\"unitLegalFirst\":\"035\",\"qtyLegalSecond\":\"1.0000\",\"unitLegalSecond\":\"\",\"declaredAmount\":10,\"currency\":\"USD\",\"declaredWeight\":1}]}"; | 38 | String json ="{\"consignmentCode\":\"271002102051\",\"consignmentId\":164535620,\"consType\":\"C\",\"sender\":\"巴斯夫护理化学品(上海)有限公司\",\"shipperCustomsCode\":\"3119920047\",\"shipperSCC\":\"91310000607239894U\",\"operateUnitName\":\"巴斯夫护理化学品(上海)有限公司\",\"operateUnitCode\":\"3119920047\",\"operateSCC\":\"91310000607239894U\",\"consignmentList\":[{\"consignmentDetailId\":83010676,\"skuCode\":\"2917341090\",\"skuName\":\"邻苯二甲酸二丁酯\",\"model\":\"品名:邻苯二甲酸二丁酯 |品牌类型:0|出口享惠情况:0|成分含量:100% 邻苯二甲酸二丁酯|用途:化学分析用试剂,实验用途|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"knockdownNumber\":1,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":1,\"unitLegalFirst\":\"035\",\"qtyLegalSecond\":\"1.0000\",\"unitLegalSecond\":\"\",\"declaredAmount\":10,\"currency\":\"USD\",\"declaredWeight\":1}]}"; |
| 41 | 39 | ||
| 42 | - String token = SHA256Util.getSHA256String(SendMawbBasf.appId + SendMawbBasf.appKey + SendMawbBasf.security + SendMawbBasf.timeStamp); | 40 | + String token = SHA256Util.getSHA256String(SendMawbFedex.appId + SendMawbFedex.appKey + SendMawbFedex.security + SendMawbFedex.timeStamp); |
| 43 | System.out.println(token); | 41 | System.out.println(token); |
| 44 | //消息头 | 42 | //消息头 |
| 45 | Header[] headers = HttpHeader.custom() | 43 | Header[] headers = HttpHeader.custom() |
| 46 | .other("Content-Type", "application/json") | 44 | .other("Content-Type", "application/json") |
| 47 | - .other("Appid", SendMawbBasf.appId) | 45 | + .other("Appid", SendMawbFedex.appId) |
| 48 | - .other("appKey", SendMawbBasf.appKey) | 46 | + .other("appKey", SendMawbFedex.appKey) |
| 49 | - .other("TimeStamp", SendMawbBasf.timeStamp) | 47 | + .other("TimeStamp", SendMawbFedex.timeStamp) |
| 50 | .other("token", token) | 48 | .other("token", token) |
| 51 | .build(); | 49 | .build(); |
| 52 | //客户端配置 | 50 | //客户端配置 |
| ... | @@ -57,7 +55,7 @@ public class SendMawbBasf { | ... | @@ -57,7 +55,7 @@ public class SendMawbBasf { |
| 57 | .ssl() | 55 | .ssl() |
| 58 | .retry(3); | 56 | .retry(3); |
| 59 | //URL | 57 | //URL |
| 60 | - String url = SendMawbBasf.url + SendMawbBasf.path; | 58 | + String url = SendMawbFedex.url + SendMawbFedex.path; |
| 61 | //HTTP请求 | 59 | //HTTP请求 |
| 62 | HttpConfig config = HttpConfig.custom() | 60 | HttpConfig config = HttpConfig.custom() |
| 63 | .headers(headers) | 61 | .headers(headers) | ... | ... |
-
Please register or login to post a comment