Showing
10 changed files
with
236 additions
and
26 deletions
| ... | @@ -78,8 +78,8 @@ public class BasfDataInterface { | ... | @@ -78,8 +78,8 @@ public class BasfDataInterface { |
| 78 | 78 | ||
| 79 | 79 | ||
| 80 | //2、TODO 校验主单 | 80 | //2、TODO 校验主单 |
| 81 | - /* sw.start("checkMawb"); | 81 | + /*sw.start("checkMawb"); |
| 82 | - result=mawbService.checkMawb(mawb); | 82 | + result=basfService.checkBasfMawb(saveMawbBasfResult); |
| 83 | if(!result.getSuccess()){ | 83 | if(!result.getSuccess()){ |
| 84 | return result; | 84 | return result; |
| 85 | } | 85 | } | ... | ... |
| ... | @@ -153,7 +153,6 @@ public class BasfMawb implements Serializable { | ... | @@ -153,7 +153,6 @@ public class BasfMawb implements Serializable { |
| 153 | private String ownerCode; | 153 | private String ownerCode; |
| 154 | 154 | ||
| 155 | @ApiModelProperty(value = "消费使用/生产销售单位名称", name = "ownerName", example = "上海保险") | 155 | @ApiModelProperty(value = "消费使用/生产销售单位名称", name = "ownerName", example = "上海保险") |
| 156 | - @NotBlank(message="参数ownerName不能为空", groups = {MawbAdd.class}) | ||
| 157 | @Column(name = "OWNERNAME") | 156 | @Column(name = "OWNERNAME") |
| 158 | private String ownerName; | 157 | private String ownerName; |
| 159 | 158 | ||
| ... | @@ -240,8 +239,8 @@ public class BasfMawb implements Serializable { | ... | @@ -240,8 +239,8 @@ public class BasfMawb implements Serializable { |
| 240 | private String EANNo; | 239 | private String EANNo; |
| 241 | 240 | ||
| 242 | @Valid | 241 | @Valid |
| 243 | - @ApiModelProperty(value = "运单明细", name = "mawbDetailList", example = "") | 242 | + @ApiModelProperty(value = "运单明细", name = "BasfMawbDetail", example = "") |
| 244 | @OneToMany(cascade = CascadeType.PERSIST) | 243 | @OneToMany(cascade = CascadeType.PERSIST) |
| 245 | @JoinColumn(name = "mawbId") | 244 | @JoinColumn(name = "mawbId") |
| 246 | - private List<MawbDetail> mawbDetailList; | 245 | + private List<BasfMawbDetail> mawbDetailList; |
| 247 | } | 246 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api.request; | 1 | package com.erry.iclear.dateInterface.api.request; |
| 2 | 2 | ||
| 3 | -public class BasfMawbDetail { | 3 | +import io.swagger.annotations.ApiModel; |
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import javax.persistence.*; | ||
| 8 | +import javax.validation.constraints.NotBlank; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import java.io.Serializable; | ||
| 11 | +import java.math.BigDecimal; | ||
| 12 | + | ||
| 13 | +@ApiModel(value = "mawbDetail", description = "运单明细") | ||
| 14 | +@Entity | ||
| 15 | +@Table(name = "T_ICLEAR_API_MAWBDETAIL") | ||
| 16 | +@Data | ||
| 17 | +public class BasfMawbDetail implements Serializable { | ||
| 18 | + | ||
| 19 | + private static final long serialVersionUID = -6706944312498119267L; | ||
| 20 | + @Id | ||
| 21 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 22 | + @Column(name = "Id", insertable = false, nullable = false) | ||
| 23 | + private Long id; | ||
| 24 | + | ||
| 25 | + @Column(name = "MSGID") | ||
| 26 | + private Long msgId; | ||
| 27 | + | ||
| 28 | + @Column(name="MAWBID") | ||
| 29 | + private Long mawbId; | ||
| 30 | + | ||
| 31 | + @Column(name="DETAILID") | ||
| 32 | + private String detailId; | ||
| 33 | + | ||
| 34 | + @ApiModelProperty(value = "归类标志", example = "空值") | ||
| 35 | + @Column(name = "CLASSMARK") | ||
| 36 | + private String classMark; | ||
| 37 | + | ||
| 38 | + @ApiModelProperty(value = "商品编号") | ||
| 39 | + @Column(name = "CODETS") | ||
| 40 | + private String codeTS; | ||
| 41 | + | ||
| 42 | + @ApiModelProperty(value = "申报单价", example = "空值") | ||
| 43 | + @Column(name = "DECLPRICE") | ||
| 44 | + private BigDecimal declPrice; | ||
| 45 | + | ||
| 46 | + @ApiModelProperty(value = "申报总价") | ||
| 47 | + @Column(name = "DECLTOTAL") | ||
| 48 | + private BigDecimal declTotal; | ||
| 49 | + | ||
| 50 | + @ApiModelProperty(value = "征免方式") | ||
| 51 | + @Column(name = "DUTYMODE") | ||
| 52 | + private String dutyMode; | ||
| 53 | + | ||
| 54 | + @ApiModelProperty(value = "货号") | ||
| 55 | + @Column(name = "EXGNO") | ||
| 56 | + private String exgNo; | ||
| 57 | + | ||
| 58 | + @ApiModelProperty(value = "版本号") | ||
| 59 | + @Column(name = "EXGVERSION") | ||
| 60 | + private String exgVersion; | ||
| 61 | + | ||
| 62 | + @ApiModelProperty(value = "第一计量单位(法定单位)") | ||
| 63 | + @Column(name = "FIRSTUNIT") | ||
| 64 | + private String firstUnit; | ||
| 65 | + | ||
| 66 | + @ApiModelProperty(value = "第一法定数量") | ||
| 67 | + @NotNull(message="参数firstQty不能为空") | ||
| 68 | + @Column(name = "FIRSTQTY") | ||
| 69 | + private Integer firstQty; | ||
| 70 | + | ||
| 71 | + @ApiModelProperty(value = "成交计量单位") | ||
| 72 | + @Column(name = "GUNIT") | ||
| 73 | + private String gunit; | ||
| 74 | + | ||
| 75 | + @ApiModelProperty(value = "商品规格、型号") | ||
| 76 | + @Column(name = "GMODE") | ||
| 77 | + private String gmodel; | ||
| 78 | + | ||
| 79 | + @ApiModelProperty(value = "商品名称") | ||
| 80 | + @Column(name = "GNAME") | ||
| 81 | + private String gname; | ||
| 82 | + | ||
| 83 | + @ApiModelProperty(value = "商品序号") | ||
| 84 | + @Column(name = "GNO") | ||
| 85 | + private String gno; | ||
| 86 | + | ||
| 87 | + @ApiModelProperty(value = "成交数量") | ||
| 88 | + @Column(name = "GQTY") | ||
| 89 | + private BigDecimal gqty; | ||
| 90 | + | ||
| 91 | + @ApiModelProperty(value = "原产国") | ||
| 92 | + @Column(name = "ORIGINCURRENTY") | ||
| 93 | + private String originCountry; | ||
| 94 | + | ||
| 95 | + @ApiModelProperty(value = "第二计量单位") | ||
| 96 | + @Column(name = "SECONDUNIT") | ||
| 97 | + private String secondUnit; | ||
| 98 | + | ||
| 99 | + @ApiModelProperty(value = "第二法定数量") | ||
| 100 | + @Column(name = "SECONDQTY") | ||
| 101 | + private Integer secondQty; | ||
| 102 | + | ||
| 103 | + @ApiModelProperty(value = "成交币制") | ||
| 104 | + @Column(name = "TRADECURR") | ||
| 105 | + private String tradeCurr; | ||
| 106 | + | ||
| 107 | + @ApiModelProperty(value = "用途/生产厂家") | ||
| 108 | + @Column(name = "USETO") | ||
| 109 | + private String useTo; | ||
| 110 | + | ||
| 111 | + @ApiModelProperty(value = "工缴费") | ||
| 112 | + @Column(name = "WORKUSD") | ||
| 113 | + private BigDecimal workUsd; | ||
| 114 | + | ||
| 115 | + @ApiModelProperty(value = "检验检疫编") | ||
| 116 | + @Column(name = "CIQCODE") | ||
| 117 | + private String ciqCode; | ||
| 118 | + | ||
| 119 | + @ApiModelProperty(value = "最终目的国(地区)") | ||
| 120 | + @Column(name = "DESTINATIONCOUNTRY") | ||
| 121 | + private String destinationCountry; | ||
| 122 | + | ||
| 123 | + @ApiModelProperty(value = "申报货物英文名称") | ||
| 124 | + @Column(name = "DECLGOODSENAME") | ||
| 125 | + private String declGoodsEname; | ||
| 126 | + | ||
| 127 | + @ApiModelProperty(value = "目的地代码") | ||
| 128 | + @Column(name = "DESTCODE") | ||
| 129 | + private String destCode; | ||
| 130 | + | ||
| 131 | + @ApiModelProperty(value = "境内目的地/境内货源地") | ||
| 132 | + @Column(name = "DISTRICTCODE") | ||
| 133 | + private String districtCode; | ||
| 134 | + | ||
| 135 | + @ApiModelProperty(value = "申报重量") | ||
| 136 | + @Column(name = "DECLAREDWEIGHT") | ||
| 137 | + private BigDecimal declaredWeight; | ||
| 4 | } | 138 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | +import com.arronlong.httpclientutil.HttpClientUtil; | ||
| 4 | +import com.arronlong.httpclientutil.common.HttpConfig; | ||
| 5 | +import com.arronlong.httpclientutil.common.HttpHeader; | ||
| 3 | import com.erry.iclear.dateInterface.api.request.*; | 6 | import com.erry.iclear.dateInterface.api.request.*; |
| 7 | +import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; | ||
| 8 | +import com.erry.iclear.dateInterface.api.response.ResultRS; | ||
| 9 | +import com.erry.iclear.dateInterface.entity.ChmConsignment; | ||
| 10 | +import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | ||
| 4 | import com.erry.iclear.dateInterface.repository.BasfMawbRepository; | 11 | import com.erry.iclear.dateInterface.repository.BasfMawbRepository; |
| 12 | +import com.erry.iclear.dateInterface.repository.MawbRepository; | ||
| 13 | +import com.erry.iclear.dateInterface.util.JsonToJava; | ||
| 5 | import com.erry.iclear.dateInterface.util.NumberUtils; | 14 | import com.erry.iclear.dateInterface.util.NumberUtils; |
| 15 | +import com.google.gson.Gson; | ||
| 6 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
| 17 | +import org.apache.http.Header; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | +import org.springframework.beans.factory.annotation.Value; | ||
| 8 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 9 | 21 | ||
| 10 | import java.util.ArrayList; | 22 | import java.util.ArrayList; |
| 11 | import java.util.List; | 23 | import java.util.List; |
| 24 | +import java.util.Objects; | ||
| 12 | 25 | ||
| 13 | /** | 26 | /** |
| 14 | * @author Administrator | 27 | * @author Administrator |
| ... | @@ -16,6 +29,18 @@ import java.util.List; | ... | @@ -16,6 +29,18 @@ import java.util.List; |
| 16 | @Service | 29 | @Service |
| 17 | @Slf4j | 30 | @Slf4j |
| 18 | public class BasfService { | 31 | public class BasfService { |
| 32 | + | ||
| 33 | + private Gson gson = new Gson(); | ||
| 34 | + | ||
| 35 | + @Value("${api.address.iclear-check-url-c}") | ||
| 36 | + String iclearCheckUrl; | ||
| 37 | + | ||
| 38 | + @Autowired | ||
| 39 | + private ChmConsignmentService consignmentService; | ||
| 40 | + | ||
| 41 | + @Autowired | ||
| 42 | + private ChmConsignmentDetailService consignmentDetailService; | ||
| 43 | + | ||
| 19 | @Autowired | 44 | @Autowired |
| 20 | private BasfMawbRepository basfMawbRepository; | 45 | private BasfMawbRepository basfMawbRepository; |
| 21 | 46 | ||
| ... | @@ -51,10 +76,10 @@ public class BasfService { | ... | @@ -51,10 +76,10 @@ public class BasfService { |
| 51 | 76 | ||
| 52 | basfMawb.setEANNo(basfc.getEANNo()); | 77 | basfMawb.setEANNo(basfc.getEANNo()); |
| 53 | //明细 | 78 | //明细 |
| 54 | - List<MawbDetail> mawbDetailList = new ArrayList<>(); | 79 | + List<BasfMawbDetail> mawbDetailList = new ArrayList<>(); |
| 55 | if (basfc.getBasfcDetailList().size()>0){ | 80 | if (basfc.getBasfcDetailList().size()>0){ |
| 56 | for (BasfcDetail basfcDetail : basfc.getBasfcDetailList()){ | 81 | for (BasfcDetail basfcDetail : basfc.getBasfcDetailList()){ |
| 57 | - MawbDetail mawbDetail = new MawbDetail(); | 82 | + BasfMawbDetail mawbDetail = new BasfMawbDetail(); |
| 58 | mawbDetail.setDetailId(basfcDetail.getConsignmentDetailId()); | 83 | mawbDetail.setDetailId(basfcDetail.getConsignmentDetailId()); |
| 59 | mawbDetail.setGmodel(basfcDetail.getModel()); | 84 | mawbDetail.setGmodel(basfcDetail.getModel()); |
| 60 | mawbDetail.setCodeTS(basfcDetail.getSkuCode()); | 85 | mawbDetail.setCodeTS(basfcDetail.getSkuCode()); |
| ... | @@ -79,4 +104,50 @@ public class BasfService { | ... | @@ -79,4 +104,50 @@ public class BasfService { |
| 79 | } | 104 | } |
| 80 | return result; | 105 | return result; |
| 81 | } | 106 | } |
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * 校验主单 | ||
| 110 | + * @param basfMawb | ||
| 111 | + * @return | ||
| 112 | + */ | ||
| 113 | + public ResultRS checkBasfMawb(BasfMawb basfMawb){ | ||
| 114 | + ResultRS result = new ResultRS(Boolean.FALSE,null,null); | ||
| 115 | + try{ | ||
| 116 | + log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(basfMawb)); | ||
| 117 | + | ||
| 118 | + //1、将请求转换为运单 | ||
| 119 | + ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentBasf(basfMawb,null,"IDE-ICLEAR-API"); | ||
| 120 | + if(Objects.equals(chmConsignment,null)){ | ||
| 121 | + result.setCode("30001"); | ||
| 122 | + result.setMsg("数据格式不正确"); | ||
| 123 | + return result; | ||
| 124 | + } | ||
| 125 | + List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | ||
| 126 | + basfMawb.getMawbDetailList().forEach(detail ->{ | ||
| 127 | + chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetailBasf(detail,chmConsignment)); | ||
| 128 | + }); | ||
| 129 | + chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); | ||
| 130 | + | ||
| 131 | + //调用IClear接口进行运单数据校验 | ||
| 132 | + String objJson = JsonToJava.toJson(chmConsignment); | ||
| 133 | + Header[] headers = HttpHeader.custom() | ||
| 134 | + .other("Content-Type", "application/json") | ||
| 135 | + .build(); | ||
| 136 | + log.info("******************* : " + this.iclearCheckUrl); | ||
| 137 | + //推送海关回执数据 | ||
| 138 | + HttpConfig config = HttpConfig.custom() | ||
| 139 | + .headers(headers) | ||
| 140 | + .url(this.iclearCheckUrl) | ||
| 141 | + .encoding("utf-8") | ||
| 142 | + .json(objJson); | ||
| 143 | + String json = HttpClientUtil.post(config); | ||
| 144 | + IClearCheckResponseResult iclearCheckResponseResult = JsonToJava.parseJson(json, IClearCheckResponseResult.class); | ||
| 145 | + result.setSuccess(iclearCheckResponseResult.getSuccess()); | ||
| 146 | + result.setMsg(iclearCheckResponseResult.getMessage()); | ||
| 147 | + log.info("<<<<<<<< checkMawb start >>>>>>>>>> mawb:"+gson.toJson(basfMawb) +" result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); | ||
| 148 | + }catch (Exception e){ | ||
| 149 | + log.error("checkMawb() error:" + e.getMessage()); | ||
| 150 | + } | ||
| 151 | + return result; | ||
| 152 | + } | ||
| 82 | } | 153 | } | ... | ... |
| 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.MawbDetail; | 4 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 4 | import com.erry.iclear.dateInterface.common.Constant; | 5 | import com.erry.iclear.dateInterface.common.Constant; |
| 5 | import com.erry.iclear.dateInterface.entity.*; | 6 | import com.erry.iclear.dateInterface.entity.*; |
| ... | @@ -137,7 +138,7 @@ public class ChmConsignmentDetailService { | ... | @@ -137,7 +138,7 @@ public class ChmConsignmentDetailService { |
| 137 | * @param mawbDetail | 138 | * @param mawbDetail |
| 138 | * @return | 139 | * @return |
| 139 | */ | 140 | */ |
| 140 | - public ChmConsignmentDetail convertToChmConsignmentDetailBasf(MawbDetail mawbDetail,ChmConsignment chmConsignment){ | 141 | + public ChmConsignmentDetail convertToChmConsignmentDetailBasf(BasfMawbDetail mawbDetail, ChmConsignment chmConsignment){ |
| 141 | ChmConsignmentDetail result = new ChmConsignmentDetail(); | 142 | ChmConsignmentDetail result = new ChmConsignmentDetail(); |
| 142 | try{ | 143 | try{ |
| 143 | result.setChmConsignment(chmConsignment); | 144 | result.setChmConsignment(chmConsignment); | ... | ... |
| ... | @@ -15,8 +15,6 @@ import com.erry.iclear.dateInterface.util.DateUtils; | ... | @@ -15,8 +15,6 @@ import com.erry.iclear.dateInterface.util.DateUtils; |
| 15 | import com.erry.iclear.dateInterface.util.NumberUtils; | 15 | import com.erry.iclear.dateInterface.util.NumberUtils; |
| 16 | import com.erry.iclear.dateInterface.util.StringUtil; | 16 | import com.erry.iclear.dateInterface.util.StringUtil; |
| 17 | import lombok.extern.slf4j.Slf4j; | 17 | import lombok.extern.slf4j.Slf4j; |
| 18 | -import org.apache.commons.lang3.StringUtils; | ||
| 19 | -import org.springframework.beans.BeanUtils; | ||
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | import org.springframework.stereotype.Service; | 19 | import org.springframework.stereotype.Service; |
| 22 | 20 | ||
| ... | @@ -550,7 +548,7 @@ public class ChmConsignmentService { | ... | @@ -550,7 +548,7 @@ public class ChmConsignmentService { |
| 550 | 548 | ||
| 551 | /** | 549 | /** |
| 552 | * 保存或更新 iclear中的运单信息 | 550 | * 保存或更新 iclear中的运单信息 |
| 553 | - * @param mawb | 551 | + * @param basfMawb |
| 554 | * @param timeStamp | 552 | * @param timeStamp |
| 555 | */ | 553 | */ |
| 556 | public ResultRS processChmConsignmentBasf(BasfMawb basfMawb, String timeStamp, String creator) { | 554 | public ResultRS processChmConsignmentBasf(BasfMawb basfMawb, String timeStamp, String creator) { | ... | ... |
| ... | @@ -28,7 +28,7 @@ api: | ... | @@ -28,7 +28,7 @@ api: |
| 28 | #IClear校验运单地址 | 28 | #IClear校验运单地址 |
| 29 | iclear-check-url: http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD | 29 | iclear-check-url: http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD |
| 30 | #IClear校验C类运单地址 | 30 | #IClear校验C类运单地址 |
| 31 | - iclear-check-url-c: http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliC | 31 | + iclear-check-url-c: http://40.73.78.157:8080/chmConsignmentController/checkChmAndDetaliC |
| 32 | #获取token地址 | 32 | #获取token地址 |
| 33 | token-url: https://apiuat.iclrccd-fedex.com/login | 33 | token-url: https://apiuat.iclrccd-fedex.com/login |
| 34 | #刷新token地址 | 34 | #刷新token地址 | ... | ... |
| ... | @@ -26,6 +26,8 @@ api: | ... | @@ -26,6 +26,8 @@ api: |
| 26 | address: | 26 | address: |
| 27 | #IClear校验运单地址 | 27 | #IClear校验运单地址 |
| 28 | iclear-check-url: https://www.iclrccd-fedex.com/chmConsignmentController/checkChmAndDetaliD | 28 | iclear-check-url: https://www.iclrccd-fedex.com/chmConsignmentController/checkChmAndDetaliD |
| 29 | + #IClear校验C类运单地址 | ||
| 30 | + iclear-check-url-c: http://40.73.78.157:8080/chmConsignmentController/checkChmAndDetaliC | ||
| 29 | #获取token地址 | 31 | #获取token地址 |
| 30 | token-url: https://api.iclrccd-fedex.com/export/login | 32 | token-url: https://api.iclrccd-fedex.com/export/login |
| 31 | #刷新token地址 | 33 | #刷新token地址 | ... | ... |
| ... | @@ -26,6 +26,8 @@ api: | ... | @@ -26,6 +26,8 @@ api: |
| 26 | address: | 26 | address: |
| 27 | #IClear校验运单地址 | 27 | #IClear校验运单地址 |
| 28 | iclear-check-url: http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD | 28 | iclear-check-url: http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD |
| 29 | + #IClear校验C类运单地址 | ||
| 30 | + iclear-check-url-c: http://40.73.78.157:8080/chmConsignmentController/checkChmAndDetaliC | ||
| 29 | #获取token地址 | 31 | #获取token地址 |
| 30 | token-url: https://apiuat.iclrccd-fedex.com/login | 32 | token-url: https://apiuat.iclrccd-fedex.com/login |
| 31 | #刷新token地址 | 33 | #刷新token地址 | ... | ... |
| ... | @@ -3,13 +3,10 @@ package com.erry.iclear.dateInterface; | ... | @@ -3,13 +3,10 @@ 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.repository.MawbAdd; | ||
| 7 | import com.erry.iclear.dateInterface.service.BasfService; | 6 | import com.erry.iclear.dateInterface.service.BasfService; |
| 8 | import com.erry.iclear.dateInterface.service.ChmConsignmentService; | 7 | import com.erry.iclear.dateInterface.service.ChmConsignmentService; |
| 9 | -import com.erry.iclear.dateInterface.service.MawbService; | ||
| 10 | import org.junit.Test; | 8 | import org.junit.Test; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.validation.annotation.Validated; | ||
| 13 | 10 | ||
| 14 | import java.math.BigDecimal; | 11 | import java.math.BigDecimal; |
| 15 | import java.util.ArrayList; | 12 | import java.util.ArrayList; |
| ... | @@ -26,7 +23,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -26,7 +23,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 26 | private CustomsDataInterface customsDataInterface; | 23 | private CustomsDataInterface customsDataInterface; |
| 27 | 24 | ||
| 28 | @Autowired | 25 | @Autowired |
| 29 | - private BasfService mawbService; | 26 | + private BasfService basfService; |
| 30 | 27 | ||
| 31 | 28 | ||
| 32 | /*@Test | 29 | /*@Test |
| ... | @@ -44,24 +41,30 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -44,24 +41,30 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 44 | @Test | 41 | @Test |
| 45 | public void testProcessChmConsignment1(){ | 42 | public void testProcessChmConsignment1(){ |
| 46 | try{ | 43 | try{ |
| 44 | + ResultRS result = new ResultRS(Boolean.FALSE,"",""); | ||
| 47 | Basfc basfc = this.createNewBasf(); | 45 | Basfc basfc = this.createNewBasf(); |
| 48 | - BasfMawb mawb = mawbService.saveMawbBasf(basfc); | 46 | + BasfMawb mawb = basfService.saveMawbBasf(basfc); |
| 49 | //Basfc basfc = this.createNewBasf(); | 47 | //Basfc basfc = this.createNewBasf(); |
| 50 | String timeStamp = String.valueOf(new Date().getTime()); | 48 | String timeStamp = String.valueOf(new Date().getTime()); |
| 51 | ResultRS resultRS = chmConsignmentService.processChmConsignmentBasf(mawb, timeStamp, "BASF"); | 49 | ResultRS resultRS = chmConsignmentService.processChmConsignmentBasf(mawb, timeStamp, "BASF"); |
| 50 | + /*result=basfService.checkBasfMawb(mawb); | ||
| 51 | + if(!result.getSuccess()){ | ||
| 52 | + System.out.println(result.getMsg()); | ||
| 53 | + }*/ | ||
| 52 | System.out.println(resultRS.toString()); | 54 | System.out.println(resultRS.toString()); |
| 53 | }catch (Exception e){ | 55 | }catch (Exception e){ |
| 54 | e.printStackTrace(); | 56 | e.printStackTrace(); |
| 55 | } | 57 | } |
| 58 | + System.out.println("1"); | ||
| 56 | } | 59 | } |
| 57 | 60 | ||
| 58 | private Basfc createNewBasf(){ | 61 | private Basfc createNewBasf(){ |
| 59 | List<BasfcDetail> basfcDetailList = new ArrayList<>(); | 62 | List<BasfcDetail> basfcDetailList = new ArrayList<>(); |
| 60 | BasfcDetail basfcDetail = new BasfcDetail(); | 63 | BasfcDetail basfcDetail = new BasfcDetail(); |
| 61 | - basfcDetail.setConsignmentDetailId("111"); | 64 | + basfcDetail.setConsignmentDetailId("222"); |
| 62 | - basfcDetail.setSkuCode("123456789"); | 65 | + basfcDetail.setSkuCode("29262000"); |
| 63 | - basfcDetail.setSkuName("测试"); | 66 | + basfcDetail.setSkuName("210908001测试"); |
| 64 | - basfcDetail.setModel("0|0|1|||||||||"); | 67 | + basfcDetail.setModel("0|0|1|1||||||||"); |
| 65 | basfcDetail.setUnitLegalFirst("035"); | 68 | basfcDetail.setUnitLegalFirst("035"); |
| 66 | basfcDetail.setQtyLegalFirst(BigDecimal.valueOf(1)); | 69 | basfcDetail.setQtyLegalFirst(BigDecimal.valueOf(1)); |
| 67 | basfcDetail.setKnockdownUnit("035"); | 70 | basfcDetail.setKnockdownUnit("035"); |
| ... | @@ -74,13 +77,13 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -74,13 +77,13 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 74 | basfcDetailList.add(basfcDetail); | 77 | basfcDetailList.add(basfcDetail); |
| 75 | 78 | ||
| 76 | Basfc basfc = new Basfc(); | 79 | Basfc basfc = new Basfc(); |
| 77 | - basfc.setConsignmentCode("211015003"); | 80 | + basfc.setConsignmentCode("210908002"); |
| 78 | basfc.setConsignmentId(1L); | 81 | basfc.setConsignmentId(1L); |
| 79 | basfc.setConsType("C"); | 82 | basfc.setConsType("C"); |
| 80 | - basfc.setSender("发件人"); | 83 | + basfc.setSender("天津知行博创科技有限公司"); |
| 81 | - basfc.setShipperCustomsCode("1234567890"); | 84 | + basfc.setShipperCustomsCode("11119608L9"); |
| 82 | basfc.setShipperSCC("123456789012345678"); | 85 | basfc.setShipperSCC("123456789012345678"); |
| 83 | - basfc.setOperateUnitName(""); | 86 | + basfc.setOperateUnitName("天津丰铭佳业科贸有限公司"); |
| 84 | basfc.setOperateUnitCode(""); | 87 | basfc.setOperateUnitCode(""); |
| 85 | basfc.setOperateSCC(""); | 88 | basfc.setOperateSCC(""); |
| 86 | basfc.setEANNo(""); | 89 | basfc.setEANNo(""); | ... | ... |
-
Please register or login to post a comment