Showing
4 changed files
with
23 additions
and
27 deletions
| 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; |
| 7 | 6 | ||
| 8 | import javax.persistence.*; | 7 | import javax.persistence.*; |
| 9 | -import javax.validation.constraints.NotBlank; | ||
| 10 | import javax.validation.constraints.NotNull; | 8 | import javax.validation.constraints.NotNull; |
| 11 | import java.io.Serializable; | 9 | import java.io.Serializable; |
| 12 | import java.math.BigDecimal; | 10 | import java.math.BigDecimal; |
| ... | @@ -77,7 +75,7 @@ public class MawbDetail implements Serializable{ | ... | @@ -77,7 +75,7 @@ public class MawbDetail implements Serializable{ |
| 77 | @ApiModelProperty(value = "第一法定数量") | 75 | @ApiModelProperty(value = "第一法定数量") |
| 78 | @NotNull(message="参数firstQty不能为空") | 76 | @NotNull(message="参数firstQty不能为空") |
| 79 | @Column(name = "FIRSTQTY") | 77 | @Column(name = "FIRSTQTY") |
| 80 | - private Integer firstQty; | 78 | + private BigDecimal firstQty; |
| 81 | 79 | ||
| 82 | @ApiModelProperty(value = "成交计量单位") | 80 | @ApiModelProperty(value = "成交计量单位") |
| 83 | //@NotBlank(message="参数gunit不能为空") | 81 | //@NotBlank(message="参数gunit不能为空") |
| ... | @@ -116,7 +114,7 @@ public class MawbDetail implements Serializable{ | ... | @@ -116,7 +114,7 @@ public class MawbDetail implements Serializable{ |
| 116 | @ApiModelProperty(value = "第二法定数量") | 114 | @ApiModelProperty(value = "第二法定数量") |
| 117 | @NotNull(message="参数secondQty不能为空") | 115 | @NotNull(message="参数secondQty不能为空") |
| 118 | @Column(name = "SECONDQTY") | 116 | @Column(name = "SECONDQTY") |
| 119 | - private Integer secondQty; | 117 | + private BigDecimal secondQty; |
| 120 | 118 | ||
| 121 | @ApiModelProperty(value = "成交币制") | 119 | @ApiModelProperty(value = "成交币制") |
| 122 | //@NotBlank(message="参数tradeCurr不能为空") | 120 | //@NotBlank(message="参数tradeCurr不能为空") | ... | ... |
| ... | @@ -14,8 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -14,8 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 15 | 15 | ||
| 16 | import java.math.BigDecimal; | 16 | import java.math.BigDecimal; |
| 17 | -import java.util.ArrayList; | ||
| 18 | -import java.util.List; | ||
| 19 | import java.util.Objects; | 17 | import java.util.Objects; |
| 20 | 18 | ||
| 21 | /** | 19 | /** |
| ... | @@ -63,7 +61,7 @@ public class ChmConsignmentDetailService { | ... | @@ -63,7 +61,7 @@ public class ChmConsignmentDetailService { |
| 63 | result.setUnitLegalFirst(firstUnitDictionaryEntries.getChineseName()); | 61 | result.setUnitLegalFirst(firstUnitDictionaryEntries.getChineseName()); |
| 64 | } | 62 | } |
| 65 | //第一法定数量 | 63 | //第一法定数量 |
| 66 | - result.setQtyLegalFirst(BigDecimal.valueOf(mawbDetail.getFirstQty().doubleValue())); | 64 | + result.setQtyLegalFirst(mawbDetail.getFirstQty()); |
| 67 | //成交计量单位 | 65 | //成交计量单位 |
| 68 | //2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq | 66 | //2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq |
| 69 | DictionaryEntries knockdownUnitEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getGunit()); | 67 | DictionaryEntries knockdownUnitEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getGunit()); |
| ... | @@ -98,7 +96,7 @@ public class ChmConsignmentDetailService { | ... | @@ -98,7 +96,7 @@ public class ChmConsignmentDetailService { |
| 98 | result.setUnitLegalSecond(secondUnitDictionaryEntries.getChineseName()); | 96 | result.setUnitLegalSecond(secondUnitDictionaryEntries.getChineseName()); |
| 99 | } | 97 | } |
| 100 | //第二法定数量 | 98 | //第二法定数量 |
| 101 | - result.setQtyLegalSecond(BigDecimal.valueOf(mawbDetail.getSecondQty().doubleValue())); | 99 | + result.setQtyLegalSecond(mawbDetail.getSecondQty()); |
| 102 | //成交币制 | 100 | //成交币制 |
| 103 | DictionaryEntries currencyDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+ mawbDetail.getTradeCurr()); | 101 | DictionaryEntries currencyDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+ mawbDetail.getTradeCurr()); |
| 104 | if(!Objects.equals(currencyDictionaryEntries,null)){ | 102 | if(!Objects.equals(currencyDictionaryEntries,null)){ |
| ... | @@ -160,7 +158,7 @@ public class ChmConsignmentDetailService { | ... | @@ -160,7 +158,7 @@ public class ChmConsignmentDetailService { |
| 160 | result.setUnitLegalFirst(firstUnitDictionaryEntries.getChineseName()); | 158 | result.setUnitLegalFirst(firstUnitDictionaryEntries.getChineseName()); |
| 161 | } | 159 | } |
| 162 | //第一法定数量 | 160 | //第一法定数量 |
| 163 | - result.setQtyLegalFirst(bigDecimalFormat(BigDecimal.valueOf(mawbDetail.getFirstQty().doubleValue()))); | 161 | + result.setQtyLegalFirst(bigDecimalFormat(mawbDetail.getFirstQty())); |
| 164 | //成交计量单位 | 162 | //成交计量单位 |
| 165 | //2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq | 163 | //2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq |
| 166 | DictionaryEntries knockdownUnitEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getGunit()); | 164 | DictionaryEntries knockdownUnitEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getGunit()); |
| ... | @@ -237,7 +235,7 @@ public class ChmConsignmentDetailService { | ... | @@ -237,7 +235,7 @@ public class ChmConsignmentDetailService { |
| 237 | result.setFirstUnit(detail.getUnitLegalFirstId().getExt2()); | 235 | result.setFirstUnit(detail.getUnitLegalFirstId().getExt2()); |
| 238 | } | 236 | } |
| 239 | //第一法定数量 | 237 | //第一法定数量 |
| 240 | - result.setFirstQty(NumberUtils.bigDecimalToIntger(bigDecimalFormatD(detail.getQtyLegalFirst()))); | 238 | + result.setFirstQty((bigDecimalFormatD(detail.getQtyLegalFirst()))); |
| 241 | //成交计量单位 数字三字码 | 239 | //成交计量单位 数字三字码 |
| 242 | if(!Objects.equals(detail.getKnockdownUnitDic(),null)){ | 240 | if(!Objects.equals(detail.getKnockdownUnitDic(),null)){ |
| 243 | result.setGunit(detail.getKnockdownUnitDic().getExt2()); | 241 | result.setGunit(detail.getKnockdownUnitDic().getExt2()); |
| ... | @@ -259,7 +257,7 @@ public class ChmConsignmentDetailService { | ... | @@ -259,7 +257,7 @@ public class ChmConsignmentDetailService { |
| 259 | result.setSecondUnit(detail.getUnitLegalSecondId().getExt2()); | 257 | result.setSecondUnit(detail.getUnitLegalSecondId().getExt2()); |
| 260 | } | 258 | } |
| 261 | //第二法定数量 | 259 | //第二法定数量 |
| 262 | - result.setSecondQty(NumberUtils.bigDecimalToIntger(bigDecimalFormatD(detail.getQtyLegalSecond()))); | 260 | + result.setSecondQty(bigDecimalFormatD(detail.getQtyLegalSecond())); |
| 263 | //成交币制 英文三字码 | 261 | //成交币制 英文三字码 |
| 264 | if(!Objects.equals(detail.getCurrencyDic(),null)){ | 262 | if(!Objects.equals(detail.getCurrencyDic(),null)){ |
| 265 | result.setTradeCurr(detail.getCurrencyDic().getExt2()); | 263 | result.setTradeCurr(detail.getCurrencyDic().getExt2()); | ... | ... |
| 1 | package com.erry.iclear.dateInterface; | 1 | package com.erry.iclear.dateInterface; |
| 2 | 2 | ||
| 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.FedexDetail; |
| 5 | -import com.erry.iclear.dateInterface.api.response.ResultRS; | 5 | +import com.erry.iclear.dateInterface.api.request.Fedexc; |
| 6 | -import com.erry.iclear.dateInterface.service.FedexService; | 6 | +import com.erry.iclear.dateInterface.api.request.Mawb; |
| 7 | +import com.erry.iclear.dateInterface.api.request.MawbDetail; | ||
| 7 | import com.erry.iclear.dateInterface.service.ChmConsignmentService; | 8 | import com.erry.iclear.dateInterface.service.ChmConsignmentService; |
| 9 | +import com.erry.iclear.dateInterface.service.FedexService; | ||
| 8 | import org.junit.Test; | 10 | import org.junit.Test; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 12 | ||
| 11 | import java.math.BigDecimal; | 13 | import java.math.BigDecimal; |
| 12 | import java.util.ArrayList; | 14 | import java.util.ArrayList; |
| 13 | -import java.util.Date; | ||
| 14 | import java.util.List; | 15 | import java.util.List; |
| 15 | 16 | ||
| 16 | public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | 17 | public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| ... | @@ -101,7 +102,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -101,7 +102,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 101 | d1.setExgNo(""); | 102 | d1.setExgNo(""); |
| 102 | d1.setExgVersion(""); | 103 | d1.setExgVersion(""); |
| 103 | d1.setFirstUnit("001"); | 104 | d1.setFirstUnit("001"); |
| 104 | - d1.setFirstQty(11); | 105 | +// d1.setFirstQty(11); |
| 105 | d1.setGunit("007"); | 106 | d1.setGunit("007"); |
| 106 | d1.setGmodel("商品规格、型号"); | 107 | d1.setGmodel("商品规格、型号"); |
| 107 | d1.setGname("餐桌"); | 108 | d1.setGname("餐桌"); |
| ... | @@ -109,7 +110,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -109,7 +110,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 109 | d1.setGqty(BigDecimal.valueOf(1.88)); | 110 | d1.setGqty(BigDecimal.valueOf(1.88)); |
| 110 | d1.setOriginCountry("US"); | 111 | d1.setOriginCountry("US"); |
| 111 | d1.setSecondUnit("007"); | 112 | d1.setSecondUnit("007"); |
| 112 | - d1.setSecondQty(2); | 113 | +// d1.setSecondQty(2); |
| 113 | d1.setTradeCurr("USD"); | 114 | d1.setTradeCurr("USD"); |
| 114 | d1.setUseTo(""); | 115 | d1.setUseTo(""); |
| 115 | d1.setWorkUsd(null); | 116 | d1.setWorkUsd(null); |
| ... | @@ -129,7 +130,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -129,7 +130,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 129 | d2.setExgNo(""); | 130 | d2.setExgNo(""); |
| 130 | d2.setExgVersion(""); | 131 | d2.setExgVersion(""); |
| 131 | d2.setFirstUnit("001"); | 132 | d2.setFirstUnit("001"); |
| 132 | - d2.setFirstQty(11); | 133 | +// d2.setFirstQty(11); |
| 133 | d2.setGunit("007"); | 134 | d2.setGunit("007"); |
| 134 | d2.setGmodel("商品规格、型号"); | 135 | d2.setGmodel("商品规格、型号"); |
| 135 | d2.setGname("餐桌"); | 136 | d2.setGname("餐桌"); |
| ... | @@ -137,7 +138,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -137,7 +138,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 137 | d2.setGqty(BigDecimal.valueOf(22.88)); | 138 | d2.setGqty(BigDecimal.valueOf(22.88)); |
| 138 | d2.setOriginCountry("US"); | 139 | d2.setOriginCountry("US"); |
| 139 | d2.setSecondUnit("007"); | 140 | d2.setSecondUnit("007"); |
| 140 | - d2.setSecondQty(3); | 141 | +// d2.setSecondQty(3); |
| 141 | d2.setTradeCurr("USD"); | 142 | d2.setTradeCurr("USD"); |
| 142 | d2.setUseTo(""); | 143 | d2.setUseTo(""); |
| 143 | d2.setWorkUsd(null); | 144 | d2.setWorkUsd(null); | ... | ... |
| ... | @@ -4,19 +4,18 @@ import com.arronlong.httpclientutil.HttpClientUtil; | ... | @@ -4,19 +4,18 @@ import com.arronlong.httpclientutil.HttpClientUtil; |
| 4 | import com.arronlong.httpclientutil.builder.HCB; | 4 | import com.arronlong.httpclientutil.builder.HCB; |
| 5 | import com.arronlong.httpclientutil.common.HttpConfig; | 5 | import com.arronlong.httpclientutil.common.HttpConfig; |
| 6 | import com.arronlong.httpclientutil.common.HttpHeader; | 6 | import com.arronlong.httpclientutil.common.HttpHeader; |
| 7 | -import com.arronlong.httpclientutil.common.HttpResult; | ||
| 8 | import com.arronlong.httpclientutil.common.SSLs; | 7 | import com.arronlong.httpclientutil.common.SSLs; |
| 9 | import com.arronlong.httpclientutil.exception.HttpProcessException; | 8 | import com.arronlong.httpclientutil.exception.HttpProcessException; |
| 10 | import com.erry.iclear.dateInterface.api.request.Mawb; | 9 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 11 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 10 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 12 | import com.erry.iclear.dateInterface.util.SHA256Util; | 11 | import com.erry.iclear.dateInterface.util.SHA256Util; |
| 13 | -import com.google.gson.Gson; | ||
| 14 | -import org.apache.http.client.HttpClient; | ||
| 15 | import org.apache.http.Header; | 12 | import org.apache.http.Header; |
| 16 | 13 | ||
| 17 | import java.io.FileNotFoundException; | 14 | import java.io.FileNotFoundException; |
| 18 | import java.math.BigDecimal; | 15 | import java.math.BigDecimal; |
| 19 | -import java.util.*; | 16 | +import java.util.ArrayList; |
| 17 | +import java.util.Date; | ||
| 18 | +import java.util.List; | ||
| 20 | 19 | ||
| 21 | public class HttpClientTest { | 20 | public class HttpClientTest { |
| 22 | public static void main(String[] args) throws HttpProcessException, FileNotFoundException { | 21 | public static void main(String[] args) throws HttpProcessException, FileNotFoundException { |
| ... | @@ -76,7 +75,7 @@ public class HttpClientTest { | ... | @@ -76,7 +75,7 @@ public class HttpClientTest { |
| 76 | d1.setExgNo(""); | 75 | d1.setExgNo(""); |
| 77 | d1.setExgVersion(""); | 76 | d1.setExgVersion(""); |
| 78 | d1.setFirstUnit("035"); | 77 | d1.setFirstUnit("035"); |
| 79 | - d1.setFirstQty(11); | 78 | +// d1.setFirstQty(11); |
| 80 | d1.setGunit("007"); | 79 | d1.setGunit("007"); |
| 81 | d1.setGmodel("商品规格、型号"); | 80 | d1.setGmodel("商品规格、型号"); |
| 82 | d1.setGname("餐桌"); | 81 | d1.setGname("餐桌"); |
| ... | @@ -84,7 +83,7 @@ public class HttpClientTest { | ... | @@ -84,7 +83,7 @@ public class HttpClientTest { |
| 84 | d1.setGqty(BigDecimal.valueOf(1.88)); | 83 | d1.setGqty(BigDecimal.valueOf(1.88)); |
| 85 | d1.setOriginCountry("US"); | 84 | d1.setOriginCountry("US"); |
| 86 | d1.setSecondUnit("007"); | 85 | d1.setSecondUnit("007"); |
| 87 | - d1.setSecondQty(2); | 86 | +// d1.setSecondQty(2); |
| 88 | d1.setTradeCurr("USD"); | 87 | d1.setTradeCurr("USD"); |
| 89 | d1.setUseTo(""); | 88 | d1.setUseTo(""); |
| 90 | d1.setWorkUsd(null); | 89 | d1.setWorkUsd(null); |
| ... | @@ -105,7 +104,7 @@ public class HttpClientTest { | ... | @@ -105,7 +104,7 @@ public class HttpClientTest { |
| 105 | d2.setExgNo(""); | 104 | d2.setExgNo(""); |
| 106 | d2.setExgVersion(""); | 105 | d2.setExgVersion(""); |
| 107 | d2.setFirstUnit("035"); | 106 | d2.setFirstUnit("035"); |
| 108 | - d2.setFirstQty(11); | 107 | +// d2.setFirstQty(11); |
| 109 | d2.setGunit("007"); | 108 | d2.setGunit("007"); |
| 110 | d2.setGmodel("商品规格、型号"); | 109 | d2.setGmodel("商品规格、型号"); |
| 111 | d2.setGname("餐桌"); | 110 | d2.setGname("餐桌"); |
| ... | @@ -113,7 +112,7 @@ public class HttpClientTest { | ... | @@ -113,7 +112,7 @@ public class HttpClientTest { |
| 113 | d2.setGqty(BigDecimal.valueOf(22.88)); | 112 | d2.setGqty(BigDecimal.valueOf(22.88)); |
| 114 | d2.setOriginCountry("US"); | 113 | d2.setOriginCountry("US"); |
| 115 | d2.setSecondUnit("007"); | 114 | d2.setSecondUnit("007"); |
| 116 | - d2.setSecondQty(3); | 115 | +// d2.setSecondQty(3); |
| 117 | d2.setTradeCurr("USD"); | 116 | d2.setTradeCurr("USD"); |
| 118 | d2.setUseTo(""); | 117 | d2.setUseTo(""); |
| 119 | d2.setWorkUsd(null); | 118 | d2.setWorkUsd(null); | ... | ... |
-
Please register or login to post a comment