Showing
12 changed files
with
268 additions
and
57 deletions
| 1 | package com.erry.iclear.dateInterface; | 1 | package com.erry.iclear.dateInterface; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.service.SimpleJpaRepositoryImpl; | ||
| 3 | import lombok.extern.slf4j.Slf4j; | 4 | import lombok.extern.slf4j.Slf4j; |
| 4 | import org.springframework.boot.SpringApplication; | 5 | import org.springframework.boot.SpringApplication; |
| 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 7 | +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
| 6 | import org.springframework.scheduling.annotation.EnableScheduling; | 8 | import org.springframework.scheduling.annotation.EnableScheduling; |
| 7 | 9 | ||
| 8 | 10 | ||
| ... | @@ -13,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; | ... | @@ -13,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; |
| 13 | @Slf4j | 15 | @Slf4j |
| 14 | @SpringBootApplication | 16 | @SpringBootApplication |
| 15 | @EnableScheduling | 17 | @EnableScheduling |
| 18 | +//@EnableJpaRepositories(value = "com.erry.iclear.dateInterface.repository", repositoryBaseClass = SimpleJpaRepositoryImpl.class) | ||
| 16 | public class IClearApiApplication { | 19 | public class IClearApiApplication { |
| 17 | 20 | ||
| 18 | public static void main(String[] args) { | 21 | public static void main(String[] args) { | ... | ... |
| ... | @@ -108,9 +108,9 @@ public class CustomsDataInterface { | ... | @@ -108,9 +108,9 @@ public class CustomsDataInterface { |
| 108 | 108 | ||
| 109 | 109 | ||
| 110 | //4、保存运单到iclear中 | 110 | //4、保存运单到iclear中 |
| 111 | - | 111 | + sw.start("processChmConsignment"); |
| 112 | - sw.start("saveToIClear"); | 112 | + //if(result.getSuccess()){ |
| 113 | - if(result.getSuccess()){ | 113 | + if(true){ |
| 114 | chmConsignmentService.processChmConsignment(mawb, timeStamp); | 114 | chmConsignmentService.processChmConsignment(mawb, timeStamp); |
| 115 | } | 115 | } |
| 116 | sw.stop(); | 116 | sw.stop(); | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api.request; | 1 | package com.erry.iclear.dateInterface.api.request; |
| 2 | 2 | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonProperty; | ||
| 3 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 5 | import io.swagger.annotations.ApiModelProperty; |
| 5 | import lombok.Data; | 6 | import lombok.Data; |
| ... | @@ -32,102 +33,127 @@ public class MawbDetail implements Serializable { | ... | @@ -32,102 +33,127 @@ public class MawbDetail implements Serializable { |
| 32 | 33 | ||
| 33 | @ApiModelProperty(value = "商品编号", example = "空值") | 34 | @ApiModelProperty(value = "商品编号", example = "空值") |
| 34 | @Column(name = "CLASSMARK") | 35 | @Column(name = "CLASSMARK") |
| 36 | + //JsonProperty("ClassMark") | ||
| 35 | private String classMark; | 37 | private String classMark; |
| 36 | 38 | ||
| 37 | @ApiModelProperty(value = "商品编号") | 39 | @ApiModelProperty(value = "商品编号") |
| 38 | @Column(name = "CODETS") | 40 | @Column(name = "CODETS") |
| 41 | + //@JsonProperty("CodeTS") | ||
| 39 | private String codeTS; | 42 | private String codeTS; |
| 40 | 43 | ||
| 41 | @ApiModelProperty(value = "申报单价", example = "空值") | 44 | @ApiModelProperty(value = "申报单价", example = "空值") |
| 42 | @Column(name = "DECLPRICE") | 45 | @Column(name = "DECLPRICE") |
| 46 | + //@JsonProperty("DeclPrice") | ||
| 43 | private BigDecimal declPrice; | 47 | private BigDecimal declPrice; |
| 44 | 48 | ||
| 45 | @ApiModelProperty(value = "申报总价") | 49 | @ApiModelProperty(value = "申报总价") |
| 46 | @Column(name = "DECLTOTAL") | 50 | @Column(name = "DECLTOTAL") |
| 51 | + //@JsonProperty("DeclTotal") | ||
| 47 | private BigDecimal declTotal; | 52 | private BigDecimal declTotal; |
| 48 | 53 | ||
| 49 | @ApiModelProperty(value = "征免方式") | 54 | @ApiModelProperty(value = "征免方式") |
| 50 | @Column(name = "DUTYMODE") | 55 | @Column(name = "DUTYMODE") |
| 56 | + //@JsonProperty("DutyMode") | ||
| 51 | private String dutyMode; | 57 | private String dutyMode; |
| 52 | 58 | ||
| 53 | @ApiModelProperty(value = "货号") | 59 | @ApiModelProperty(value = "货号") |
| 54 | @Column(name = "EXGNO") | 60 | @Column(name = "EXGNO") |
| 61 | + //@JsonProperty("ExgNo") | ||
| 55 | private String exgNo; | 62 | private String exgNo; |
| 56 | 63 | ||
| 57 | @ApiModelProperty(value = "货号") | 64 | @ApiModelProperty(value = "货号") |
| 58 | @Column(name = "EXGVERSION") | 65 | @Column(name = "EXGVERSION") |
| 66 | + //@JsonProperty("ExgVersion") | ||
| 59 | private String exgVersion; | 67 | private String exgVersion; |
| 60 | 68 | ||
| 61 | @ApiModelProperty(value = "第一计量单位(法定单位)") | 69 | @ApiModelProperty(value = "第一计量单位(法定单位)") |
| 62 | @Column(name = "FIRSTUNIT") | 70 | @Column(name = "FIRSTUNIT") |
| 71 | + //@JsonProperty("FirstUnit") | ||
| 63 | private String firstUnit; | 72 | private String firstUnit; |
| 64 | 73 | ||
| 65 | @ApiModelProperty(value = "第一法定数量") | 74 | @ApiModelProperty(value = "第一法定数量") |
| 66 | @Column(name = "FIRSTQTY") | 75 | @Column(name = "FIRSTQTY") |
| 76 | + //@JsonProperty("FirstQty") | ||
| 67 | private Integer firstQty; | 77 | private Integer firstQty; |
| 68 | 78 | ||
| 69 | @ApiModelProperty(value = "成交计量单位") | 79 | @ApiModelProperty(value = "成交计量单位") |
| 70 | @Column(name = "GUNIT") | 80 | @Column(name = "GUNIT") |
| 71 | - private String GUnit; | 81 | + //@JsonProperty("GUNIT") |
| 82 | + private String gunit; | ||
| 72 | 83 | ||
| 73 | @ApiModelProperty(value = "商品规格、型号") | 84 | @ApiModelProperty(value = "商品规格、型号") |
| 74 | @Column(name = "GMODE") | 85 | @Column(name = "GMODE") |
| 75 | - private String GModel; | 86 | + //@JsonProperty("GModel") |
| 87 | + private String gmodel; | ||
| 76 | 88 | ||
| 77 | @ApiModelProperty(value = "商品名称") | 89 | @ApiModelProperty(value = "商品名称") |
| 78 | @Column(name = "GNAME") | 90 | @Column(name = "GNAME") |
| 79 | - private String GName; | 91 | + //@JsonProperty("GName") |
| 92 | + private String gname; | ||
| 80 | 93 | ||
| 81 | @ApiModelProperty(value = "商品序号") | 94 | @ApiModelProperty(value = "商品序号") |
| 82 | @Column(name = "GNO") | 95 | @Column(name = "GNO") |
| 83 | - private String GNo; | 96 | + //@JsonProperty("GNo") |
| 97 | + private String gno; | ||
| 84 | 98 | ||
| 85 | @ApiModelProperty(value = "成交数量") | 99 | @ApiModelProperty(value = "成交数量") |
| 86 | @Column(name = "GQTY") | 100 | @Column(name = "GQTY") |
| 87 | - private Integer GQty; | 101 | + //@JsonProperty("GQty") |
| 102 | + private BigDecimal gqty; | ||
| 88 | 103 | ||
| 89 | @ApiModelProperty(value = "原产国") | 104 | @ApiModelProperty(value = "原产国") |
| 90 | @Column(name = "ORIGINCURRENTY") | 105 | @Column(name = "ORIGINCURRENTY") |
| 106 | + //@JsonProperty("OriginCountry") | ||
| 91 | private String originCountry; | 107 | private String originCountry; |
| 92 | 108 | ||
| 93 | @ApiModelProperty(value = "第二计量单位") | 109 | @ApiModelProperty(value = "第二计量单位") |
| 94 | @Column(name = "SECONDUNIT") | 110 | @Column(name = "SECONDUNIT") |
| 111 | + //@JsonProperty("SecondUnit") | ||
| 95 | private String secondUnit; | 112 | private String secondUnit; |
| 96 | 113 | ||
| 97 | @ApiModelProperty(value = "第二法定数量") | 114 | @ApiModelProperty(value = "第二法定数量") |
| 98 | @Column(name = "SECONDQTY") | 115 | @Column(name = "SECONDQTY") |
| 116 | + //@JsonProperty("SecondQty") | ||
| 99 | private Integer secondQty; | 117 | private Integer secondQty; |
| 100 | 118 | ||
| 101 | @ApiModelProperty(value = "成交币制") | 119 | @ApiModelProperty(value = "成交币制") |
| 102 | @Column(name = "TRADECURR") | 120 | @Column(name = "TRADECURR") |
| 121 | + //@JsonProperty("TradeCurr") | ||
| 103 | private String tradeCurr; | 122 | private String tradeCurr; |
| 104 | 123 | ||
| 105 | @ApiModelProperty(value = "用途/生产厂家") | 124 | @ApiModelProperty(value = "用途/生产厂家") |
| 106 | @Column(name = "USETO") | 125 | @Column(name = "USETO") |
| 126 | + //@JsonProperty("UseTo") | ||
| 107 | private String useTo; | 127 | private String useTo; |
| 108 | 128 | ||
| 109 | @ApiModelProperty(value = "工缴费") | 129 | @ApiModelProperty(value = "工缴费") |
| 110 | @Column(name = "WORKUSD") | 130 | @Column(name = "WORKUSD") |
| 131 | + //@JsonProperty("WorkUsd") | ||
| 111 | private BigDecimal workUsd; | 132 | private BigDecimal workUsd; |
| 112 | 133 | ||
| 113 | @ApiModelProperty(value = "检验检疫编") | 134 | @ApiModelProperty(value = "检验检疫编") |
| 114 | @Column(name = "CIQCODE") | 135 | @Column(name = "CIQCODE") |
| 136 | + //@JsonProperty("CiqCode") | ||
| 115 | private String ciqCode; | 137 | private String ciqCode; |
| 116 | 138 | ||
| 117 | @ApiModelProperty(value = "最终目的国(地区)") | 139 | @ApiModelProperty(value = "最终目的国(地区)") |
| 118 | @Column(name = "DESTINATIONCOUNTRY") | 140 | @Column(name = "DESTINATIONCOUNTRY") |
| 141 | + //@JsonProperty("DestinationCountry") | ||
| 119 | private String destinationCountry; | 142 | private String destinationCountry; |
| 120 | 143 | ||
| 121 | @ApiModelProperty(value = "申报货物英文名称") | 144 | @ApiModelProperty(value = "申报货物英文名称") |
| 122 | @Column(name = "DECLGOODSENAME") | 145 | @Column(name = "DECLGOODSENAME") |
| 146 | + //@JsonProperty("DeclGoodsEname") | ||
| 123 | private String declGoodsEname; | 147 | private String declGoodsEname; |
| 124 | 148 | ||
| 125 | @ApiModelProperty(value = "目的地代码") | 149 | @ApiModelProperty(value = "目的地代码") |
| 126 | @Column(name = "DESTCODE") | 150 | @Column(name = "DESTCODE") |
| 151 | + //@JsonProperty("DestCode") | ||
| 127 | private String destCode; | 152 | private String destCode; |
| 128 | 153 | ||
| 129 | @ApiModelProperty(value = "境内目的地/境内货源地") | 154 | @ApiModelProperty(value = "境内目的地/境内货源地") |
| 130 | @Column(name = "DISTRICTCODE") | 155 | @Column(name = "DISTRICTCODE") |
| 156 | + //@JsonProperty("DistrictCode") | ||
| 131 | private String districtCode; | 157 | private String districtCode; |
| 132 | 158 | ||
| 133 | 159 | ... | ... |
| ... | @@ -33,7 +33,7 @@ public class Constant { | ... | @@ -33,7 +33,7 @@ public class Constant { |
| 33 | 33 | ||
| 34 | public static String MSG_TYPE_D="D"; | 34 | public static String MSG_TYPE_D="D"; |
| 35 | 35 | ||
| 36 | - //public static String LEVY_TYPE="levyType_"; | 36 | + public static String LEVY_TYPE="levyType_"; |
| 37 | 37 | ||
| 38 | public static String TRANSACTION_UNIT="transactionUnit_"; | 38 | public static String TRANSACTION_UNIT="transactionUnit_"; |
| 39 | 39 | ... | ... |
| ... | @@ -39,6 +39,14 @@ public class ChmConsignment implements Serializable { | ... | @@ -39,6 +39,14 @@ public class ChmConsignment implements Serializable { |
| 39 | @JoinColumn(name = "DECLARED_DOC_TYPE_ID") | 39 | @JoinColumn(name = "DECLARED_DOC_TYPE_ID") |
| 40 | private DictionaryEntries declaredDocTypeDic; | 40 | private DictionaryEntries declaredDocTypeDic; |
| 41 | 41 | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 乐观锁 | ||
| 45 | + */ | ||
| 46 | +// @Version | ||
| 47 | +// @Column(name = "VERSION", columnDefinition = "INTEGER", length = 8) | ||
| 48 | +// private Integer version; | ||
| 49 | + | ||
| 42 | /** | 50 | /** |
| 43 | * 报关单类型 | 51 | * 报关单类型 |
| 44 | */ | 52 | */ |
| ... | @@ -973,8 +981,9 @@ public class ChmConsignment implements Serializable { | ... | @@ -973,8 +981,9 @@ public class ChmConsignment implements Serializable { |
| 973 | private String isBatchimport; | 981 | private String isBatchimport; |
| 974 | 982 | ||
| 975 | 983 | ||
| 976 | - @OneToMany(cascade = CascadeType.PERSIST) | 984 | + |
| 977 | - @JoinColumn(name = "CONSIGNMENT_ID") | 985 | + |
| 986 | + @OneToMany(mappedBy = "chmConsignment",cascade = CascadeType.ALL) | ||
| 978 | private List<ChmConsignmentDetail> chmConsignmentDetailList; | 987 | private List<ChmConsignmentDetail> chmConsignmentDetailList; |
| 979 | 988 | ||
| 980 | 989 | ... | ... |
| ... | @@ -30,13 +30,14 @@ public class ChmConsignmentDetail implements Serializable { | ... | @@ -30,13 +30,14 @@ public class ChmConsignmentDetail implements Serializable { |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * 运单 | 32 | * 运单 |
| 33 | + */ | ||
| 33 | @ManyToOne(targetEntity = ChmConsignment.class) | 34 | @ManyToOne(targetEntity = ChmConsignment.class) |
| 34 | - @JoinColumn(name = "CONSIGNMENT_ID") | 35 | + @JoinColumn(name = "CONSIGNMENT_ID",updatable = false) |
| 35 | private ChmConsignment chmConsignment; | 36 | private ChmConsignment chmConsignment; |
| 36 | - */ | ||
| 37 | 37 | ||
| 38 | - @Column(name = "CONSIGNMENT_ID") | 38 | + |
| 39 | - private Integer consignmentId; | 39 | +// @Column(name = "CONSIGNMENT_ID") |
| 40 | +// private Long consignmentId; | ||
| 40 | 41 | ||
| 41 | /** | 42 | /** |
| 42 | * 商品编号CodeTS | 43 | * 商品编号CodeTS |
| ... | @@ -254,7 +255,7 @@ public class ChmConsignmentDetail implements Serializable { | ... | @@ -254,7 +255,7 @@ public class ChmConsignmentDetail implements Serializable { |
| 254 | public String toString() { | 255 | public String toString() { |
| 255 | return "ChmConsignmentDetail{" + | 256 | return "ChmConsignmentDetail{" + |
| 256 | "id=" + id + | 257 | "id=" + id + |
| 257 | - ", consignmentId=" + consignmentId + | 258 | + ", consignmentId=" + chmConsignment.getId() + |
| 258 | ", skuCode='" + skuCode + '\'' + | 259 | ", skuCode='" + skuCode + '\'' + |
| 259 | ", skuName='" + skuName + '\'' + | 260 | ", skuName='" + skuName + '\'' + |
| 260 | ", model='" + model + '\'' + | 261 | ", model='" + model + '\'' + | ... | ... |
| ... | @@ -3,11 +3,16 @@ package com.erry.iclear.dateInterface.service; | ... | @@ -3,11 +3,16 @@ package com.erry.iclear.dateInterface.service; |
| 3 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 3 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 4 | import com.erry.iclear.dateInterface.common.Constant; | 4 | import com.erry.iclear.dateInterface.common.Constant; |
| 5 | import com.erry.iclear.dateInterface.entity.*; | 5 | import com.erry.iclear.dateInterface.entity.*; |
| 6 | +import com.erry.iclear.dateInterface.repository.ChmConsignmentDetailRepository; | ||
| 7 | +import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; | ||
| 6 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
| 7 | import org.apache.commons.lang3.StringUtils; | 9 | import org.apache.commons.lang3.StringUtils; |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 9 | 12 | ||
| 10 | import java.math.BigDecimal; | 13 | import java.math.BigDecimal; |
| 14 | +import java.util.ArrayList; | ||
| 15 | +import java.util.List; | ||
| 11 | import java.util.Objects; | 16 | import java.util.Objects; |
| 12 | 17 | ||
| 13 | /** | 18 | /** |
| ... | @@ -18,14 +23,20 @@ import java.util.Objects; | ... | @@ -18,14 +23,20 @@ import java.util.Objects; |
| 18 | public class ChmConsignmentDetailService { | 23 | public class ChmConsignmentDetailService { |
| 19 | 24 | ||
| 20 | 25 | ||
| 26 | + @Autowired | ||
| 27 | + private ChmConsignmentDetailRepository chmConsignmentDetailRepository; | ||
| 28 | + | ||
| 29 | + | ||
| 21 | /** | 30 | /** |
| 22 | * 转换运单明细 | 31 | * 转换运单明细 |
| 23 | * @param mawbDetail | 32 | * @param mawbDetail |
| 24 | * @return | 33 | * @return |
| 25 | */ | 34 | */ |
| 26 | - public ChmConsignmentDetail convertToChmConsignmentDetail(MawbDetail mawbDetail){ | 35 | + public ChmConsignmentDetail convertToChmConsignmentDetail(MawbDetail mawbDetail,ChmConsignment chmConsignment){ |
| 27 | ChmConsignmentDetail result = new ChmConsignmentDetail(); | 36 | ChmConsignmentDetail result = new ChmConsignmentDetail(); |
| 28 | try{ | 37 | try{ |
| 38 | + result.setChmConsignment(chmConsignment); | ||
| 39 | + | ||
| 29 | //归类标志 | 40 | //归类标志 |
| 30 | 41 | ||
| 31 | //商品编号 | 42 | //商品编号 |
| ... | @@ -35,7 +46,7 @@ public class ChmConsignmentDetailService { | ... | @@ -35,7 +46,7 @@ public class ChmConsignmentDetailService { |
| 35 | //申报总价 | 46 | //申报总价 |
| 36 | result.setAmount(mawbDetail.getDeclTotal()); | 47 | result.setAmount(mawbDetail.getDeclTotal()); |
| 37 | //征免方式 | 48 | //征免方式 |
| 38 | - DictionaryEntries levyTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NATURE_EXEMPTION+mawbDetail.getDutyMode()); | 49 | + DictionaryEntries levyTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.LEVY_TYPE+mawbDetail.getDutyMode()); |
| 39 | result.setLevyTypeDic(levyTypeDictionaryEntries); | 50 | result.setLevyTypeDic(levyTypeDictionaryEntries); |
| 40 | result.setLevyType(levyTypeDictionaryEntries.getChineseName()); | 51 | result.setLevyType(levyTypeDictionaryEntries.getChineseName()); |
| 41 | //货号 | 52 | //货号 |
| ... | @@ -52,12 +63,12 @@ public class ChmConsignmentDetailService { | ... | @@ -52,12 +63,12 @@ public class ChmConsignmentDetailService { |
| 52 | result.setKnockdownUnitDic(knockdownUnitEntries); | 63 | result.setKnockdownUnitDic(knockdownUnitEntries); |
| 53 | result.setKnockdownUnit(knockdownUnitEntries.getChineseName()); | 64 | result.setKnockdownUnit(knockdownUnitEntries.getChineseName()); |
| 54 | //商品规格、型号 | 65 | //商品规格、型号 |
| 55 | - result.setModel(mawbDetail.getGModel()); | 66 | + result.setModel(mawbDetail.getGmodel()); |
| 56 | //商品名称 | 67 | //商品名称 |
| 57 | - result.setSkuName(mawbDetail.getGName()); | 68 | + result.setSkuName(mawbDetail.getGname()); |
| 58 | //商品序号 | 69 | //商品序号 |
| 59 | //成交数量 | 70 | //成交数量 |
| 60 | - result.setKnockdownNumber(BigDecimal.valueOf(mawbDetail.getGQty().doubleValue())); | 71 | + result.setKnockdownNumber(BigDecimal.valueOf(mawbDetail.getGqty().doubleValue())); |
| 61 | //原产国 | 72 | //原产国 |
| 62 | DictionaryEntries habitatDictonaryEntries = Constant.dictionaryEntriesCache.get(Constant.COUNTRY+ mawbDetail.getOriginCountry()); | 73 | DictionaryEntries habitatDictonaryEntries = Constant.dictionaryEntriesCache.get(Constant.COUNTRY+ mawbDetail.getOriginCountry()); |
| 63 | result.setHabitatDic(habitatDictonaryEntries); | 74 | result.setHabitatDic(habitatDictonaryEntries); |
| ... | @@ -106,4 +117,37 @@ public class ChmConsignmentDetailService { | ... | @@ -106,4 +117,37 @@ public class ChmConsignmentDetailService { |
| 106 | 117 | ||
| 107 | return result; | 118 | return result; |
| 108 | } | 119 | } |
| 120 | + | ||
| 121 | + | ||
| 122 | + | ||
| 123 | + | ||
| 124 | + public List<ChmConsignmentDetail> findChmConsignmentDetailListByConsignmentCode(Long consignmentId){ | ||
| 125 | + List<ChmConsignmentDetail> result = new ArrayList<>(); | ||
| 126 | + try{ | ||
| 127 | + result= chmConsignmentDetailRepository.findChmConsignmentDetailByConsignmentCode(consignmentId); | ||
| 128 | + }catch (Exception e){ | ||
| 129 | + log.error("findChmConsignmentDetailListByConsignmentCode() error:"+e.getMessage()); | ||
| 130 | + } | ||
| 131 | + return result; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + | ||
| 135 | + | ||
| 136 | + | ||
| 137 | + | ||
| 138 | + public void saveDetailList(List<ChmConsignmentDetail> chmConsignmentDetailList){ | ||
| 139 | + chmConsignmentDetailRepository.saveAll(chmConsignmentDetailList); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + public void saveChmConsignmentDetail(ChmConsignmentDetail consignmentDetail){ | ||
| 144 | + chmConsignmentDetailRepository.save(consignmentDetail); | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + | ||
| 148 | + public void deleteChmConsignmentDetail(Long id){ | ||
| 149 | + chmConsignmentDetailRepository.deleteById(id); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + | ||
| 109 | } | 153 | } | ... | ... |
| ... | @@ -10,6 +10,7 @@ import com.erry.iclear.dateInterface.entity.DictionaryEntries; | ... | @@ -10,6 +10,7 @@ import com.erry.iclear.dateInterface.entity.DictionaryEntries; |
| 10 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; | 10 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; |
| 11 | import com.erry.iclear.dateInterface.util.DateUtils; | 11 | import com.erry.iclear.dateInterface.util.DateUtils; |
| 12 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | +import org.springframework.beans.BeanUtils; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
| 15 | 16 | ||
| ... | @@ -176,6 +177,8 @@ public class ChmConsignmentService { | ... | @@ -176,6 +177,8 @@ public class ChmConsignmentService { |
| 176 | result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); | 177 | result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); |
| 177 | //推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据 | 178 | //推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据 |
| 178 | result.setCreateTime(pushTime); | 179 | result.setCreateTime(pushTime); |
| 180 | + result.setUpdateTime(pushTime); | ||
| 181 | + | ||
| 179 | 182 | ||
| 180 | }catch (Exception e){ | 183 | }catch (Exception e){ |
| 181 | e.printStackTrace(); | 184 | e.printStackTrace(); |
| ... | @@ -201,6 +204,28 @@ public class ChmConsignmentService { | ... | @@ -201,6 +204,28 @@ public class ChmConsignmentService { |
| 201 | 204 | ||
| 202 | 205 | ||
| 203 | /** | 206 | /** |
| 207 | + * 保存主单 | ||
| 208 | + * @param chmConsignment | ||
| 209 | + * @return | ||
| 210 | + */ | ||
| 211 | + public ChmConsignment updateChmConsignment(ChmConsignment chmConsignment){ | ||
| 212 | + try{ | ||
| 213 | + return chmConsignmentRepository.save(chmConsignment); | ||
| 214 | + }catch (Exception e){ | ||
| 215 | + log.error("updateChmConsignment() error:"+e.getMessage()); | ||
| 216 | + } | ||
| 217 | + return null; | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + | ||
| 221 | + | ||
| 222 | + | ||
| 223 | + | ||
| 224 | + | ||
| 225 | + | ||
| 226 | + | ||
| 227 | + | ||
| 228 | + /** | ||
| 204 | * 根据运单号查找数据 | 229 | * 根据运单号查找数据 |
| 205 | * @param consignmentCode | 230 | * @param consignmentCode |
| 206 | * @return | 231 | * @return |
| ... | @@ -227,7 +252,7 @@ public class ChmConsignmentService { | ... | @@ -227,7 +252,7 @@ public class ChmConsignmentService { |
| 227 | ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime); | 252 | ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime); |
| 228 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 253 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| 229 | mawb.getMawbDetailList().forEach(detail ->{ | 254 | mawb.getMawbDetailList().forEach(detail ->{ |
| 230 | - chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetail(detail)); | 255 | + chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment)); |
| 231 | }); | 256 | }); |
| 232 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); | 257 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); |
| 233 | 258 | ||
| ... | @@ -246,13 +271,33 @@ public class ChmConsignmentService { | ... | @@ -246,13 +271,33 @@ public class ChmConsignmentService { |
| 246 | //更新: | 271 | //更新: |
| 247 | //如果有数据并且满足条件后才能更新数据 | 272 | //如果有数据并且满足条件后才能更新数据 |
| 248 | //条件1、状态为 待申报海关 | 273 | //条件1、状态为 待申报海关 |
| 249 | - //条件2、推送时间小于 上次推送的时间 | 274 | + //条件2、本次推送时间 > 上次推送的时间 |
| 250 | }else if(!Objects.equals(chmConsignmentDB,null) | 275 | }else if(!Objects.equals(chmConsignmentDB,null) |
| 251 | && Objects.equals(chmConsignmentDB.getConsStatusDic().getCode(),"transferWaybillStatus_5") | 276 | && Objects.equals(chmConsignmentDB.getConsStatusDic().getCode(),"transferWaybillStatus_5") |
| 252 | - && pushTime.getTime()<chmConsignmentDB.getCreateTime().getTime()){ | 277 | + //TODO 提交时需要打开 |
| 278 | + && pushTime.getTime()>chmConsignmentDB.getUpdateTime().getTime() | ||
| 279 | + ){ | ||
| 253 | //TODO 更新数据 | 280 | //TODO 更新数据 |
| 254 | log.info("更新主单"+ mawb.getBillNo()); | 281 | log.info("更新主单"+ mawb.getBillNo()); |
| 255 | 282 | ||
| 283 | + for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){ | ||
| 284 | + for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){ | ||
| 285 | + if(Objects.equals(newDetail.getSkuCode(),oldDetail.getSkuCode())){ | ||
| 286 | + //newDetail.setChmConsignment(chmConsignmentDB); | ||
| 287 | + newDetail.setId(oldDetail.getId()); | ||
| 288 | + } | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + chmConsignment.setId(chmConsignmentDB.getId()); | ||
| 293 | + chmConsignment.setUpdateTime(pushTime); | ||
| 294 | + ChmConsignment updateResult = this.saveChmConsignment(chmConsignment); | ||
| 295 | + if(!Objects.equals(updateResult,null)){ | ||
| 296 | + log.info("主单"+ mawb.getBillNo()+" 保存成功,chmConsignmentId:"+updateResult.getId()); | ||
| 297 | + }else{ | ||
| 298 | + log.info("主单"+ mawb.getBillNo()+" 保存失败"); | ||
| 299 | + } | ||
| 300 | + | ||
| 256 | } | 301 | } |
| 257 | }catch (Exception e){ | 302 | }catch (Exception e){ |
| 258 | log.error(""+e.getMessage()); | 303 | log.error(""+e.getMessage()); | ... | ... |
| 1 | +package com.erry.iclear.dateInterface.service; | ||
| 2 | + | ||
| 3 | +import org.springframework.beans.BeanUtils; | ||
| 4 | +import org.springframework.beans.BeanWrapper; | ||
| 5 | +import org.springframework.beans.BeanWrapperImpl; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.data.jpa.repository.support.JpaEntityInformation; | ||
| 8 | +import org.springframework.data.jpa.repository.support.SimpleJpaRepository; | ||
| 9 | +import org.springframework.transaction.annotation.Transactional; | ||
| 10 | +import org.springframework.util.StringUtils; | ||
| 11 | + | ||
| 12 | +import javax.persistence.EntityManager; | ||
| 13 | +import java.beans.PropertyDescriptor; | ||
| 14 | +import java.util.HashSet; | ||
| 15 | +import java.util.Optional; | ||
| 16 | +import java.util.Set; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * @author Administrator | ||
| 20 | + */ | ||
| 21 | +public class SimpleJpaRepositoryImpl<T, ID> extends SimpleJpaRepository<T, ID> { | ||
| 22 | + | ||
| 23 | + private final JpaEntityInformation<T, ?> entityInformation; | ||
| 24 | + private final EntityManager em; | ||
| 25 | + | ||
| 26 | + @Autowired | ||
| 27 | + public SimpleJpaRepositoryImpl(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) { | ||
| 28 | + super(entityInformation, entityManager); | ||
| 29 | + this.entityInformation = entityInformation; | ||
| 30 | + this.em = entityManager; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 通用save方法 :新增/选择性更新 | ||
| 35 | + */ | ||
| 36 | + @Override | ||
| 37 | + @Transactional(rollbackFor = Exception.class) | ||
| 38 | + public <S extends T> S save(S entity) { | ||
| 39 | + //获取ID | ||
| 40 | + ID entityId = (ID) entityInformation.getId(entity); | ||
| 41 | + Optional<T> optionalT; | ||
| 42 | + if (StringUtils.isEmpty(entityId)) { | ||
| 43 | + optionalT = Optional.empty(); | ||
| 44 | + } else { | ||
| 45 | + optionalT = findById(entityId); | ||
| 46 | + } | ||
| 47 | + //获取空属性并处理成null | ||
| 48 | + String[] nullProperties = getNullProperties(entity); | ||
| 49 | + //若根据ID查询结果为空 | ||
| 50 | + if (!optionalT.isPresent()) { | ||
| 51 | + //新增 | ||
| 52 | + em.persist(entity); | ||
| 53 | + return entity; | ||
| 54 | + } else { | ||
| 55 | + //1.获取最新对象 | ||
| 56 | + T target = optionalT.get(); | ||
| 57 | + //2.将非空属性覆盖到最新对象 | ||
| 58 | + BeanUtils.copyProperties(entity, target, nullProperties); | ||
| 59 | + //3.更新非空属性 | ||
| 60 | + em.merge(target); | ||
| 61 | + return entity; | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 获取对象的空属性 | ||
| 67 | + */ | ||
| 68 | + private static String[] getNullProperties(Object src) { | ||
| 69 | + //1.获取Bean | ||
| 70 | + BeanWrapper srcBean = new BeanWrapperImpl(src); | ||
| 71 | + //2.获取Bean的属性描述 | ||
| 72 | + PropertyDescriptor[] pds = srcBean.getPropertyDescriptors(); | ||
| 73 | + //3.获取Bean的空属性 | ||
| 74 | + Set<String> properties = new HashSet<>(); | ||
| 75 | + for (PropertyDescriptor propertyDescriptor : pds) { | ||
| 76 | + String propertyName = propertyDescriptor.getName(); | ||
| 77 | + Object propertyValue = srcBean.getPropertyValue(propertyName); | ||
| 78 | + if (StringUtils.isEmpty(propertyValue)) { | ||
| 79 | + srcBean.setPropertyValue(propertyName, null); | ||
| 80 | + properties.add(propertyName); | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + return properties.toArray(new String[0]); | ||
| 84 | + } | ||
| 85 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -13,7 +13,7 @@ public class ApiTest { | ... | @@ -13,7 +13,7 @@ public class ApiTest { |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | public static void main(String[] args) { | 15 | public static void main(String[] args) { |
| 16 | - //{"IEFlag":"E","type":"EX","agentCode":"1111980005","agentName":"联邦快递(中国)有限公司","billNo":"202105210784","contrNo":"NO.565733","customMaster":"0101","cutMode":"101","declTrnRel":"0","distinatePort":"ASM000","ediId":"001","entryId":"25512456","feeCurr":"USD","feeMark":"3","feeRate":100.58,"grossWet":500,"IEPort":"0101","inputerName":"","insurCurr":"MOP","insurMark":"3","insurRate":23.44,"manualNo":"备案号","netWt":80,"otherCurr":"USD","otherRate":10,"otherMark":"","ownerCode":"Z321654987","ownerName":"上海保险","packNo":1,"preEntryId":"","tradeCountry":"US","tradeMode":"110","tradeCode":"Z321654987","trafMode":"1","tradeName":"上海铢怡国际货物运输代理有限公司","transMode":"3","wrapType":"22","tradeCodeScc":"A74125896321456987","ownerCodeScc":"A74125896321456987","tradeAreaCode":"US","markNo":"N/M","entyPortCode":"310302","goodsPlace":"","declareName":"张安","overseasConsignorCode":"Z785421","overseasConsigneeCode":"Z785421","overseasConsigneeEname":"出口时必填收件人公司名(原)","mawbDetailList":[{"classMark":"","codeTS":"69125472","declPrice":111.123,"declTotal":788,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"","firstQty":11,"GUnit":"007","GModel":"商品规格、型号","GName":"餐桌","GNo":"1","GQty":1,"originCountry":"USA","secondUnit":"007","secondQty":2,"tradeCurr":"USA","useTo":"","ciqCode":"","destinationCountry":"CHN","declGoodsEname":"","destCode":"","districtCode":"4408W"},{"classMark":"","codeTS":"69125472","declPrice":45.72,"declTotal":33,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"","firstQty":11,"GUnit":"007","GModel":"商品规格、型号","GName":"餐桌","GNo":"2","GQty":22,"originCountry":"USA","secondUnit":"007","secondQty":3,"tradeCurr":"USA","useTo":"","ciqCode":"","destinationCountry":"CHN","declGoodsEname":"","destCode":"","districtCode":"4408W"}]} | 16 | + //{"IEFlag":"E","type":"EX","agentCode":"1111980005","agentName":"联邦快递(中国)有限公司","billNo":"202105210784","contrNo":"NO.565733","customMaster":"0101","cutMode":"101","declTrnRel":"0","distinatePort":"ASM000","ediId":"001","entryId":"25512456","feeCurr":"USD","feeMark":"3","feeRate":100.58,"grossWet":500,"IEPort":"0101","inputerName":"","insurCurr":"MOP","insurMark":"3","insurRate":23.44,"manualNo":"备案号","netWt":80,"otherCurr":"USD","otherRate":10,"otherMark":"","ownerCode":"Z321654987","ownerName":"上海保险","packNo":1,"preEntryId":"","tradeCountry":"US","tradeMode":"110","tradeCode":"Z321654987","trafMode":"1","tradeName":"上海铢怡国际货物运输代理有限公司","transMode":"3","wrapType":"22","tradeCodeScc":"A74125896321456987","ownerCodeScc":"A74125896321456987","tradeAreaCode":"US","markNo":"N/M","entyPortCode":"310302","goodsPlace":"","declareName":"张安","overseasConsignorCode":"Z785421","overseasConsigneeCode":"Z785421","overseasConsigneeEname":"出口时必填收件人公司名(原)","mawbDetailList":[{"classMark":"","codeTS":"69125472","declPrice":111.123,"declTotal":788,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"035","firstQty":11,"gunit":"007","gmodel":"商品规格、型号","gname":"餐桌","gno":"1","gqty":1.88,"originCountry":"US","secondUnit":"007","secondQty":2,"tradeCurr":"USD","useTo":"","ciqCode":"","destinationCountry":"CN","declGoodsEname":"","destCode":"","districtCode":"4408W"},{"classMark":"","codeTS":"69125472","declPrice":45.72,"declTotal":33,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"035","firstQty":11,"gunit":"007","gmodel":"商品规格、型号","gname":"餐桌","gno":"2","gqty":22.88,"originCountry":"US","secondUnit":"007","secondQty":3,"tradeCurr":"USD","useTo":"","ciqCode":"","destinationCountry":"CN","declGoodsEname":"","destCode":"","districtCode":"4408W"}]} |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | MawbDetail d1 = new MawbDetail(); | 19 | MawbDetail d1 = new MawbDetail(); |
| ... | @@ -24,20 +24,20 @@ public class ApiTest { | ... | @@ -24,20 +24,20 @@ public class ApiTest { |
| 24 | d1.setDutyMode("1"); | 24 | d1.setDutyMode("1"); |
| 25 | d1.setExgNo(""); | 25 | d1.setExgNo(""); |
| 26 | d1.setExgVersion(""); | 26 | d1.setExgVersion(""); |
| 27 | - d1.setFirstUnit(""); | 27 | + d1.setFirstUnit("035"); |
| 28 | d1.setFirstQty(11); | 28 | d1.setFirstQty(11); |
| 29 | - d1.setGUnit("007"); | 29 | + d1.setGunit("007"); |
| 30 | - d1.setGModel("商品规格、型号"); | 30 | + d1.setGmodel("商品规格、型号"); |
| 31 | - d1.setGName("餐桌"); | 31 | + d1.setGname("餐桌"); |
| 32 | - d1.setGNo("1"); | 32 | + d1.setGno("1"); |
| 33 | - d1.setGQty(1); | 33 | + d1.setGqty(BigDecimal.valueOf(1.88)); |
| 34 | - d1.setOriginCountry("USA"); | 34 | + d1.setOriginCountry("US"); |
| 35 | d1.setSecondUnit("007"); | 35 | d1.setSecondUnit("007"); |
| 36 | d1.setSecondQty(2); | 36 | d1.setSecondQty(2); |
| 37 | - d1.setTradeCurr("USA"); | 37 | + d1.setTradeCurr("USD"); |
| 38 | d1.setUseTo(""); | 38 | d1.setUseTo(""); |
| 39 | d1.setWorkUsd(null); | 39 | d1.setWorkUsd(null); |
| 40 | - d1.setDestinationCountry("CHN"); | 40 | + d1.setDestinationCountry("CN"); |
| 41 | d1.setCiqCode(""); | 41 | d1.setCiqCode(""); |
| 42 | d1.setDeclGoodsEname(""); | 42 | d1.setDeclGoodsEname(""); |
| 43 | d1.setDestCode(""); | 43 | d1.setDestCode(""); |
| ... | @@ -52,20 +52,20 @@ public class ApiTest { | ... | @@ -52,20 +52,20 @@ public class ApiTest { |
| 52 | d2.setDutyMode("1"); | 52 | d2.setDutyMode("1"); |
| 53 | d2.setExgNo(""); | 53 | d2.setExgNo(""); |
| 54 | d2.setExgVersion(""); | 54 | d2.setExgVersion(""); |
| 55 | - d2.setFirstUnit(""); | 55 | + d2.setFirstUnit("035"); |
| 56 | d2.setFirstQty(11); | 56 | d2.setFirstQty(11); |
| 57 | - d2.setGUnit("007"); | 57 | + d2.setGunit("007"); |
| 58 | - d2.setGModel("商品规格、型号"); | 58 | + d2.setGmodel("商品规格、型号"); |
| 59 | - d2.setGName("餐桌"); | 59 | + d2.setGname("餐桌"); |
| 60 | - d2.setGNo("2"); | 60 | + d2.setGno("2"); |
| 61 | - d2.setGQty(22); | 61 | + d2.setGqty(BigDecimal.valueOf(22.88)); |
| 62 | - d2.setOriginCountry("USA"); | 62 | + d2.setOriginCountry("US"); |
| 63 | d2.setSecondUnit("007"); | 63 | d2.setSecondUnit("007"); |
| 64 | d2.setSecondQty(3); | 64 | d2.setSecondQty(3); |
| 65 | - d2.setTradeCurr("USA"); | 65 | + d2.setTradeCurr("USD"); |
| 66 | d2.setUseTo(""); | 66 | d2.setUseTo(""); |
| 67 | d2.setWorkUsd(null); | 67 | d2.setWorkUsd(null); |
| 68 | - d2.setDestinationCountry("CHN"); | 68 | + d2.setDestinationCountry("CN"); |
| 69 | d2.setCiqCode(""); | 69 | d2.setCiqCode(""); |
| 70 | d2.setDeclGoodsEname(""); | 70 | d2.setDeclGoodsEname(""); |
| 71 | d2.setDestCode(""); | 71 | d2.setDestCode(""); | ... | ... |
| ... | @@ -41,11 +41,11 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -41,11 +41,11 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 41 | d1.setExgVersion(""); | 41 | d1.setExgVersion(""); |
| 42 | d1.setFirstUnit("001"); | 42 | d1.setFirstUnit("001"); |
| 43 | d1.setFirstQty(11); | 43 | d1.setFirstQty(11); |
| 44 | - d1.setGUnit("007"); | 44 | + d1.setGunit("007"); |
| 45 | - d1.setGModel("商品规格、型号"); | 45 | + d1.setGmodel("商品规格、型号"); |
| 46 | - d1.setGName("餐桌"); | 46 | + d1.setGname("餐桌"); |
| 47 | - d1.setGNo("1"); | 47 | + d1.setGno("1"); |
| 48 | - d1.setGQty(1); | 48 | + d1.setGqty(BigDecimal.valueOf(1.88)); |
| 49 | d1.setOriginCountry("US"); | 49 | d1.setOriginCountry("US"); |
| 50 | d1.setSecondUnit("007"); | 50 | d1.setSecondUnit("007"); |
| 51 | d1.setSecondQty(2); | 51 | d1.setSecondQty(2); |
| ... | @@ -69,11 +69,11 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -69,11 +69,11 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 69 | d2.setExgVersion(""); | 69 | d2.setExgVersion(""); |
| 70 | d2.setFirstUnit("001"); | 70 | d2.setFirstUnit("001"); |
| 71 | d2.setFirstQty(11); | 71 | d2.setFirstQty(11); |
| 72 | - d2.setGUnit("007"); | 72 | + d2.setGunit("007"); |
| 73 | - d2.setGModel("商品规格、型号"); | 73 | + d2.setGmodel("商品规格、型号"); |
| 74 | - d2.setGName("餐桌"); | 74 | + d2.setGname("餐桌"); |
| 75 | - d2.setGNo("2"); | 75 | + d2.setGno("2"); |
| 76 | - d2.setGQty(22); | 76 | + d2.setGqty(BigDecimal.valueOf(22.88)); |
| 77 | d2.setOriginCountry("US"); | 77 | d2.setOriginCountry("US"); |
| 78 | d2.setSecondUnit("007"); | 78 | d2.setSecondUnit("007"); |
| 79 | d2.setSecondQty(3); | 79 | d2.setSecondQty(3); | ... | ... |
| ... | @@ -11,10 +11,8 @@ public class SHA256Test { | ... | @@ -11,10 +11,8 @@ public class SHA256Test { |
| 11 | public static void main(String[] args) { | 11 | public static void main(String[] args) { |
| 12 | // long time =System.currentTimeMillis(); | 12 | // long time =System.currentTimeMillis(); |
| 13 | // System.out.println(time); | 13 | // System.out.println(time); |
| 14 | -// String str = "CTM"+"iClearExport"+"b92131f03f19a348"+time; | 14 | + String str = "CTM"+"iClearExport"+"b92131f03f19a348"+1623920478192L; |
| 15 | -// | 15 | + System.out.println(SHA256Util.getSHA256String(str)); |
| 16 | -// | ||
| 17 | -// System.out.println(SHA256Util.getSHA256String(str)); | ||
| 18 | 16 | ||
| 19 | // | 17 | // |
| 20 | // 1623920478192 | 18 | // 1623920478192 | ... | ... |
-
Please register or login to post a comment