Merge remote-tracking branch 'origin/API-2023-07-30-bug' into API-2023-07-30-bug
Showing
10 changed files
with
128 additions
and
16 deletions
| 1 | package com.erry.iclear.dateInterface.api; | 1 | package com.erry.iclear.dateInterface.api; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.api.request.MawbDetail; | ||
| 4 | -import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | ||
| 5 | import com.erry.iclear.dateInterface.api.request.Mawb; | 3 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 6 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 4 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 7 | import com.erry.iclear.dateInterface.entity.IClearApiLog; | 5 | import com.erry.iclear.dateInterface.entity.IClearApiLog; |
| 6 | +import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | ||
| 8 | import com.erry.iclear.dateInterface.repository.MawbAdd; | 7 | import com.erry.iclear.dateInterface.repository.MawbAdd; |
| 9 | import com.erry.iclear.dateInterface.service.*; | 8 | import com.erry.iclear.dateInterface.service.*; |
| 10 | import com.erry.iclear.dateInterface.util.StringUtil; | 9 | import com.erry.iclear.dateInterface.util.StringUtil; |
| ... | @@ -17,7 +16,9 @@ import org.springframework.validation.annotation.Validated; | ... | @@ -17,7 +16,9 @@ import org.springframework.validation.annotation.Validated; |
| 17 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
| 18 | 17 | ||
| 19 | import javax.servlet.http.HttpServletRequest; | 18 | import javax.servlet.http.HttpServletRequest; |
| 20 | -import java.util.*; | 19 | +import java.util.Date; |
| 20 | +import java.util.Map; | ||
| 21 | +import java.util.Objects; | ||
| 21 | 22 | ||
| 22 | /** | 23 | /** |
| 23 | * @author Administrator | 24 | * @author Administrator |
| ... | @@ -118,7 +119,7 @@ public class CustomsDataInterface { | ... | @@ -118,7 +119,7 @@ public class CustomsDataInterface { |
| 118 | 119 | ||
| 119 | //2、TODO 校验主单 | 120 | //2、TODO 校验主单 |
| 120 | sw.start("checkMawb"); | 121 | sw.start("checkMawb"); |
| 121 | - result=mawbService.checkMawb(mawb); | 122 | + result=mawbService.checkMawb(mawb,appId); |
| 122 | if(!result.getSuccess()){ | 123 | if(!result.getSuccess()){ |
| 123 | return result; | 124 | return result; |
| 124 | } | 125 | } | ... | ... |
| ... | @@ -110,7 +110,7 @@ public class FedexDataInterface { | ... | @@ -110,7 +110,7 @@ public class FedexDataInterface { |
| 110 | sw.stop(); | 110 | sw.stop(); |
| 111 | 111 | ||
| 112 | sw.start("checkFedexMawb"); | 112 | sw.start("checkFedexMawb"); |
| 113 | - ResultRS iclearCheckRs = fedexService.checkFedexMawb(saveMawbFedexResult,appInfo); | 113 | + ResultRS iclearCheckRs = fedexService.checkFedexMawb(saveMawbFedexResult,appInfo,appId); |
| 114 | //返回结果 | 114 | //返回结果 |
| 115 | ResultRS result = new ResultRS(Boolean.TRUE,ErrorCodeEnum.SUCCESS.getCode(),null,null); | 115 | ResultRS result = new ResultRS(Boolean.TRUE,ErrorCodeEnum.SUCCESS.getCode(),null,null); |
| 116 | if(nonEmptyCheck.getSuccess() && iclearCheckRs.getSuccess()){ | 116 | if(nonEmptyCheck.getSuccess() && iclearCheckRs.getSuccess()){ |
| ... | @@ -195,7 +195,7 @@ public class FedexDataInterface { | ... | @@ -195,7 +195,7 @@ public class FedexDataInterface { |
| 195 | 195 | ||
| 196 | //2、TODO 校验主单 | 196 | //2、TODO 校验主单 |
| 197 | sw.start("checkFedexMawb"); | 197 | sw.start("checkFedexMawb"); |
| 198 | - result=fedexService.checkFedexMawb(saveMawbFedexResult,null); | 198 | + result=fedexService.checkFedexMawb(saveMawbFedexResult,null,appId); |
| 199 | if(!result.getSuccess()){ | 199 | if(!result.getSuccess()){ |
| 200 | return result; | 200 | return result; |
| 201 | } | 201 | } |
| ... | @@ -216,6 +216,7 @@ public class FedexDataInterface { | ... | @@ -216,6 +216,7 @@ public class FedexDataInterface { |
| 216 | return result; | 216 | return result; |
| 217 | } | 217 | } |
| 218 | sw.stop(); | 218 | sw.stop(); |
| 219 | + log.info("saveIClearApiLogResult.getCreateTime():"+saveIClearApiLogResult.getCreateTime()); | ||
| 219 | ChmConsignment chmGetId = chmConsignmentRepository.findChmConsignmentByConsignmentCode(saveIClearApiLogResult.getBillNo(), saveIClearApiLogResult.getCreateTime()); | 220 | ChmConsignment chmGetId = chmConsignmentRepository.findChmConsignmentByConsignmentCode(saveIClearApiLogResult.getBillNo(), saveIClearApiLogResult.getCreateTime()); |
| 220 | //调用IClear接口进行运单推送EXP002 | 221 | //调用IClear接口进行运单推送EXP002 |
| 221 | String objJson = JsonToJava.toJson(chmGetId.getId()); | 222 | String objJson = JsonToJava.toJson(chmGetId.getId()); | ... | ... |
| ... | @@ -100,4 +100,21 @@ public class Constant { | ... | @@ -100,4 +100,21 @@ public class Constant { |
| 100 | * 监管条件 | 100 | * 监管条件 |
| 101 | */ | 101 | */ |
| 102 | public static final String supervise_condition = "superviseRestrict"; | 102 | public static final String supervise_condition = "superviseRestrict"; |
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * DM004接收取件信息 | ||
| 106 | + */ | ||
| 107 | + public static final String FILE_TYPE_GET_PICK_INFORMATION = "fileType_5"; | ||
| 108 | + | ||
| 109 | + //OSPR状态 | ||
| 110 | + /** | ||
| 111 | + * 未完成 | ||
| 112 | + */ | ||
| 113 | + public static final String OSPR_STATUS_INCOMPLETED = "OSPRStatus_1"; | ||
| 114 | + | ||
| 115 | + //扫描代码 | ||
| 116 | + /** | ||
| 117 | + * C类已取件 | ||
| 118 | + */ | ||
| 119 | + public static final String SCAN_CODE_TAKEN_PART= "scanCode_1"; | ||
| 103 | } | 120 | } | ... | ... |
| ... | @@ -3,7 +3,6 @@ package com.erry.iclear.dateInterface.entity; | ... | @@ -3,7 +3,6 @@ package com.erry.iclear.dateInterface.entity; |
| 3 | 3 | ||
| 4 | import com.fasterxml.jackson.annotation.JsonIgnore; | 4 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 7 | 6 | ||
| 8 | import javax.persistence.*; | 7 | import javax.persistence.*; |
| 9 | import java.io.Serializable; | 8 | import java.io.Serializable; |
| ... | @@ -413,6 +412,62 @@ public class ChmConsignment implements Serializable { | ... | @@ -413,6 +412,62 @@ public class ChmConsignment implements Serializable { |
| 413 | @Column(name = "EANNO") | 412 | @Column(name = "EANNO") |
| 414 | private String eanNo; | 413 | private String eanNo; |
| 415 | 414 | ||
| 415 | + /** | ||
| 416 | + * 扫描代码ID | ||
| 417 | + */ | ||
| 418 | + @JsonIgnore | ||
| 419 | + @ManyToOne(targetEntity = DictionaryEntries.class) | ||
| 420 | + @JoinColumn(name = "SCAN_CODE_ID") | ||
| 421 | + private DictionaryEntries scanCodeDic; | ||
| 422 | + | ||
| 423 | + /** | ||
| 424 | + * 扫描代码 | ||
| 425 | + */ | ||
| 426 | + @Column(name = "SCAN_CODE") | ||
| 427 | + private String scanCode; | ||
| 428 | + | ||
| 429 | + /** | ||
| 430 | + * 扫描状态日期 | ||
| 431 | + */ | ||
| 432 | + @Column(name = "SCAN_STATUS_TIME") | ||
| 433 | + private Date scanStatusTime; | ||
| 434 | + | ||
| 435 | + /** | ||
| 436 | + * 运单类型ID | ||
| 437 | + */ | ||
| 438 | +// @JsonIgnore | ||
| 439 | +// @ManyToOne(targetEntity = DictionaryEntries.class) | ||
| 440 | +// @JoinColumn(name = "CONS_TYPE_ID") | ||
| 441 | +// private DictionaryEntries consTypeDic; | ||
| 442 | + | ||
| 443 | + /** | ||
| 444 | + * OSPR状态ID | ||
| 445 | + */ | ||
| 446 | + @JsonIgnore | ||
| 447 | + @ManyToOne(targetEntity = DictionaryEntries.class) | ||
| 448 | + @JoinColumn(name = "OSPR_STATUS_ID") | ||
| 449 | + private DictionaryEntries osprStatusDic; | ||
| 450 | + | ||
| 451 | + /** | ||
| 452 | + * 站点 | ||
| 453 | + */ | ||
| 454 | + @JsonIgnore | ||
| 455 | + @ManyToOne(targetEntity = Organization.class) | ||
| 456 | + @JoinColumn(name = "STATION_ID") | ||
| 457 | + private Organization station; | ||
| 458 | + | ||
| 459 | + /** | ||
| 460 | + * 站点名称 | ||
| 461 | + */ | ||
| 462 | + @Column(name = "STATION_NAME") | ||
| 463 | + private String stationName; | ||
| 464 | + | ||
| 465 | + /** | ||
| 466 | + * 取件日期 | ||
| 467 | + */ | ||
| 468 | + @Column(name = "PICK_UP_DATE") | ||
| 469 | + private Date pickUpDate; | ||
| 470 | + | ||
| 416 | @OneToMany(mappedBy = "chmConsignment", cascade = CascadeType.ALL) | 471 | @OneToMany(mappedBy = "chmConsignment", cascade = CascadeType.ALL) |
| 417 | private List<ChmConsignmentDetail> chmConsignmentDetailList; | 472 | private List<ChmConsignmentDetail> chmConsignmentDetailList; |
| 418 | 473 | ... | ... |
| ... | @@ -4,7 +4,6 @@ import com.erry.iclear.dateInterface.entity.ChmConsignment; | ... | @@ -4,7 +4,6 @@ import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 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.data.jpa.repository.Query; | 6 | import org.springframework.data.jpa.repository.Query; |
| 7 | -import org.springframework.data.repository.query.Param; | ||
| 8 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; |
| 9 | 8 | ||
| 10 | import java.util.Date; | 9 | import java.util.Date; |
| ... | @@ -33,6 +32,15 @@ public interface ChmConsignmentRepository extends JpaSpecificationExecutor<ChmCo | ... | @@ -33,6 +32,15 @@ public interface ChmConsignmentRepository extends JpaSpecificationExecutor<ChmCo |
| 33 | public ChmConsignment findChmConsignmentByConsignmentCode(String consignmentCode,Date startDate); | 32 | public ChmConsignment findChmConsignmentByConsignmentCode(String consignmentCode,Date startDate); |
| 34 | 33 | ||
| 35 | /** | 34 | /** |
| 35 | + * 根据运单号查找多条数据 | ||
| 36 | + * @param consignmentCode | ||
| 37 | + * @param startDate | ||
| 38 | + * @return | ||
| 39 | + */ | ||
| 40 | + @Query( nativeQuery = true,value ="select * from T_CHM_CONSIGNMENT where CONSIGNMENT_CODE = ?1 and CREATE_TIME>= ?2 and CREATOR = ?3" ) | ||
| 41 | + public List<ChmConsignment> findChmConsignmentByConsignmentCodes(String consignmentCode,Date startDate,String creator); | ||
| 42 | + | ||
| 43 | + /** | ||
| 36 | * 根据运单ID查运单 | 44 | * 根据运单ID查运单 |
| 37 | * @param id | 45 | * @param id |
| 38 | * @return | 46 | * @return | ... | ... |
| 1 | +package com.erry.iclear.dateInterface.repository; | ||
| 2 | + | ||
| 3 | +import com.erry.iclear.dateInterface.entity.Organization; | ||
| 4 | +import org.springframework.data.jpa.repository.JpaRepository; | ||
| 5 | +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
| 6 | +import org.springframework.data.jpa.repository.Query; | ||
| 7 | +import org.springframework.data.repository.query.Param; | ||
| 8 | +import org.springframework.stereotype.Repository; | ||
| 9 | + | ||
| 10 | +@Repository | ||
| 11 | +public interface OrganizationRepository extends JpaSpecificationExecutor<Organization>, JpaRepository<Organization, Long> { | ||
| 12 | + @Query(nativeQuery = true, value = "select top 1 * from T_AU_ORGANIZATION o where o.NAME = :name ") | ||
| 13 | + public Organization findOrganizationByName(@Param("name") String name); | ||
| 14 | +} |
| 1 | +package com.erry.iclear.dateInterface.repository; | ||
| 2 | + | ||
| 3 | +import com.erry.iclear.dateInterface.entity.TaskInfo; | ||
| 4 | +import org.springframework.data.jpa.repository.JpaRepository; | ||
| 5 | +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
| 6 | +import org.springframework.data.jpa.repository.Query; | ||
| 7 | +import org.springframework.data.repository.query.Param; | ||
| 8 | +import org.springframework.stereotype.Repository; | ||
| 9 | + | ||
| 10 | +@Repository | ||
| 11 | +public interface TaskInfoRepository extends JpaSpecificationExecutor<TaskInfo>, JpaRepository<TaskInfo, Long> { | ||
| 12 | + | ||
| 13 | + @Query(nativeQuery = true, value = "select top 1 * from T_TASK_INFO info where info.FILE_TYPE_ID = :fileTypeId and " + | ||
| 14 | + "info.AWB_NUMBER = :consignmentCode order by CREATE_TIME DESC") | ||
| 15 | + public TaskInfo findTaskInfoByConsignment(@Param("fileTypeId") Long taskStatusId,@Param("consignmentCode") String consignmentCode); | ||
| 16 | + | ||
| 17 | +} |
This diff is collapsed. Click to expand it.
| ... | @@ -113,13 +113,13 @@ public class FedexService { | ... | @@ -113,13 +113,13 @@ public class FedexService { |
| 113 | * @param fedexMawb | 113 | * @param fedexMawb |
| 114 | * @return | 114 | * @return |
| 115 | */ | 115 | */ |
| 116 | - public ResultRS checkFedexMawb(FedexMawb fedexMawb,AppInfo appInfo){ | 116 | + public ResultRS checkFedexMawb(FedexMawb fedexMawb,AppInfo appInfo,String appId){ |
| 117 | ResultRS result = new ResultRS(Boolean.FALSE,null,null,null); | 117 | ResultRS result = new ResultRS(Boolean.FALSE,null,null,null); |
| 118 | try{ | 118 | try{ |
| 119 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(fedexMawb)); | 119 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(fedexMawb)); |
| 120 | 120 | ||
| 121 | //1、将请求转换为运单 | 121 | //1、将请求转换为运单 |
| 122 | - ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,"IDE-ICLEAR-API",appInfo); | 122 | + ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,appId,appInfo); |
| 123 | if(Objects.equals(chmConsignment,null)){ | 123 | if(Objects.equals(chmConsignment,null)){ |
| 124 | result.setCode(ErrorCodeEnum.ERROR_7.getCode()); | 124 | result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 125 | result.setMsg(ErrorCodeEnum.ERROR_7.getName()); | 125 | result.setMsg(ErrorCodeEnum.ERROR_7.getName()); | ... | ... |
| ... | @@ -2,15 +2,15 @@ package com.erry.iclear.dateInterface.service; | ... | @@ -2,15 +2,15 @@ package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | import com.erry.iclear.dateInterface.api.request.FedexMawb; | 3 | import com.erry.iclear.dateInterface.api.request.FedexMawb; |
| 4 | import com.erry.iclear.dateInterface.api.request.FedexMawbDetail; | 4 | import com.erry.iclear.dateInterface.api.request.FedexMawbDetail; |
| 5 | -import com.erry.iclear.dateInterface.common.Constant; | ||
| 6 | -import com.erry.iclear.dateInterface.entity.DictionaryEntries; | ||
| 7 | -import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | ||
| 8 | import com.erry.iclear.dateInterface.api.request.Mawb; | 5 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 9 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 6 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 10 | import com.erry.iclear.dateInterface.api.response.IClearCheckResult; | 7 | import com.erry.iclear.dateInterface.api.response.IClearCheckResult; |
| 11 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 8 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 9 | +import com.erry.iclear.dateInterface.common.Constant; | ||
| 12 | import com.erry.iclear.dateInterface.entity.ChmConsignment; | 10 | import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 13 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 11 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 12 | +import com.erry.iclear.dateInterface.entity.DictionaryEntries; | ||
| 13 | +import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | ||
| 14 | import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository; | 14 | import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository; |
| 15 | import com.erry.iclear.dateInterface.repository.MawbRepository; | 15 | import com.erry.iclear.dateInterface.repository.MawbRepository; |
| 16 | import com.erry.iclear.dateInterface.util.HttpUtils; | 16 | import com.erry.iclear.dateInterface.util.HttpUtils; |
| ... | @@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 23 | import org.springframework.beans.factory.annotation.Value; | 23 | import org.springframework.beans.factory.annotation.Value; |
| 24 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
| 25 | 25 | ||
| 26 | -import javax.validation.Valid; | ||
| 27 | import java.util.*; | 26 | import java.util.*; |
| 28 | 27 | ||
| 29 | /** | 28 | /** |
| ... | @@ -301,12 +300,12 @@ public class MawbService { | ... | @@ -301,12 +300,12 @@ public class MawbService { |
| 301 | * @param mawb | 300 | * @param mawb |
| 302 | * @return | 301 | * @return |
| 303 | */ | 302 | */ |
| 304 | - public ResultRS checkMawb(Mawb mawb){ | 303 | + public ResultRS checkMawb(Mawb mawb,String appId){ |
| 305 | ResultRS result = new ResultRS(Boolean.FALSE,null,null,null); | 304 | ResultRS result = new ResultRS(Boolean.FALSE,null,null,null); |
| 306 | try{ | 305 | try{ |
| 307 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)); | 306 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)); |
| 308 | //1、将请求转换为运单 | 307 | //1、将请求转换为运单 |
| 309 | - ChmConsignment chmConsignment=consignmentService.convertToChmConsignment(mawb,null,"IDE-ICLEAR-API"); | 308 | + ChmConsignment chmConsignment=consignmentService.convertToChmConsignment(mawb,null,appId); |
| 310 | if(Objects.equals(chmConsignment,null)){ | 309 | if(Objects.equals(chmConsignment,null)){ |
| 311 | result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); | 310 | result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 312 | result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); | 311 | result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); | ... | ... |
-
Please register or login to post a comment