李俊

内网迁移环境代码调整

...@@ -5,6 +5,7 @@ import com.erry.iclear.dateInterface.api.response.ResultRS; ...@@ -5,6 +5,7 @@ import com.erry.iclear.dateInterface.api.response.ResultRS;
5 import com.erry.iclear.dateInterface.entity.IClearApiLog; 5 import com.erry.iclear.dateInterface.entity.IClearApiLog;
6 import com.erry.iclear.dateInterface.repository.MawbAdd; 6 import com.erry.iclear.dateInterface.repository.MawbAdd;
7 import com.erry.iclear.dateInterface.service.*; 7 import com.erry.iclear.dateInterface.service.*;
8 +import com.erry.iclear.dateInterface.util.StringUtil;
8 import com.google.gson.Gson; 9 import com.google.gson.Gson;
9 import io.swagger.annotations.ApiOperation; 10 import io.swagger.annotations.ApiOperation;
10 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
...@@ -55,6 +56,15 @@ public class CustomsDataInterface { ...@@ -55,6 +56,15 @@ public class CustomsDataInterface {
55 result.setMsg("请求信息不能为空"); 56 result.setMsg("请求信息不能为空");
56 return result; 57 return result;
57 } 58 }
59 +
60 + String checkrs = mawbService.checkMawbBaseInfo(mawb);
61 + if(StringUtil.isNotEmpty(checkrs)){
62 + result.setCode("-7");
63 + result.setMsg(checkrs);
64 + return result;
65 + }
66 +
67 +
58 //1、保存请求信息,保存到iClear的 SQLServer 68 //1、保存请求信息,保存到iClear的 SQLServer
59 69
60 StopWatch sw = new StopWatch("receice mawb"); 70 StopWatch sw = new StopWatch("receice mawb");
...@@ -66,6 +76,8 @@ public class CustomsDataInterface { ...@@ -66,6 +76,8 @@ public class CustomsDataInterface {
66 IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLog(mawb,appId,appKey,new Date(Long.valueOf(timeStamp)))); 76 IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLog(mawb,appId,appKey,new Date(Long.valueOf(timeStamp))));
67 77
68 78
79 +
80 +
69 mawb.setAppId(appId); 81 mawb.setAppId(appId);
70 if(!Objects.equals(saveIClearApiLogResult,null)){ 82 if(!Objects.equals(saveIClearApiLogResult,null)){
71 log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId()); 83 log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId());
......
...@@ -8,6 +8,7 @@ import org.hibernate.annotations.DynamicUpdate; ...@@ -8,6 +8,7 @@ import org.hibernate.annotations.DynamicUpdate;
8 8
9 import javax.persistence.*; 9 import javax.persistence.*;
10 import javax.validation.Valid; 10 import javax.validation.Valid;
11 +import javax.validation.constraints.NotBlank;
11 import java.io.Serializable; 12 import java.io.Serializable;
12 import java.math.BigDecimal; 13 import java.math.BigDecimal;
13 import java.util.List; 14 import java.util.List;
......
...@@ -50,12 +50,12 @@ public class Mawb implements Serializable { ...@@ -50,12 +50,12 @@ public class Mawb implements Serializable {
50 private String type; 50 private String type;
51 51
52 @ApiModelProperty(value = "申报单位代码", name = "agentCode", example = "固定值:1111980005") 52 @ApiModelProperty(value = "申报单位代码", name = "agentCode", example = "固定值:1111980005")
53 - ////@NotBlank(message="参数agentCode不能为空") 53 + //@NotBlank(message="参数agentCode不能为空")
54 @Column(name = "AGENTCODE") 54 @Column(name = "AGENTCODE")
55 private String agentCode; 55 private String agentCode;
56 56
57 @ApiModelProperty(value = "申报单位名称", name = "agentName", example = "固定值:联邦快递(中国)有限公司") 57 @ApiModelProperty(value = "申报单位名称", name = "agentName", example = "固定值:联邦快递(中国)有限公司")
58 - ////@NotBlank(message="参数agentName不能为空") 58 + //@NotBlank(message="参数agentName不能为空")
59 @Column(name = "AGENTNAME") 59 @Column(name = "AGENTNAME")
60 private String agentName; 60 private String agentName;
61 61
...@@ -79,7 +79,7 @@ public class Mawb implements Serializable { ...@@ -79,7 +79,7 @@ public class Mawb implements Serializable {
79 private String cutMode; 79 private String cutMode;
80 80
81 @ApiModelProperty(value = "报关/转关关系标志", name = "declTrnRel", example = "固定值:0") 81 @ApiModelProperty(value = "报关/转关关系标志", name = "declTrnRel", example = "固定值:0")
82 - ////@NotBlank(message="参数declTrnRel不能为空") 82 + //@NotBlank(message="参数declTrnRel不能为空")
83 @Column(name = "DECLTRNREL") 83 @Column(name = "DECLTRNREL")
84 private String declTrnRel; 84 private String declTrnRel;
85 85
...@@ -89,7 +89,7 @@ public class Mawb implements Serializable { ...@@ -89,7 +89,7 @@ public class Mawb implements Serializable {
89 private String distinatePort; 89 private String distinatePort;
90 90
91 @ApiModelProperty(value = "报关标志", name = "EdiId", example = "001") 91 @ApiModelProperty(value = "报关标志", name = "EdiId", example = "001")
92 - ////@NotBlank(message="参数ediId不能为空") 92 + //@NotBlank(message="参数ediId不能为空")
93 @Column(name = "EDIID") 93 @Column(name = "EDIID")
94 private String ediId; 94 private String ediId;
95 95
...@@ -98,12 +98,12 @@ public class Mawb implements Serializable { ...@@ -98,12 +98,12 @@ public class Mawb implements Serializable {
98 private String entryId; 98 private String entryId;
99 99
100 @ApiModelProperty(value = "运费币制", name = "feeCurr", example = "固定值:3") 100 @ApiModelProperty(value = "运费币制", name = "feeCurr", example = "固定值:3")
101 -// //@NotBlank(message="参数feeCurr不能为空") 101 +//@NotBlank(message="参数feeCurr不能为空")
102 @Column(name = "FEECURR") 102 @Column(name = "FEECURR")
103 private String feeCurr; 103 private String feeCurr;
104 104
105 @ApiModelProperty(value = "运费标记", name = "feeMark", example = "99.22") 105 @ApiModelProperty(value = "运费标记", name = "feeMark", example = "99.22")
106 -// //@NotBlank(message="参数feeMark不能为空") 106 +//@NotBlank(message="参数feeMark不能为空")
107 @Column(name = "FEEMARK") 107 @Column(name = "FEEMARK")
108 private String feeMark; 108 private String feeMark;
109 109
...@@ -127,7 +127,7 @@ public class Mawb implements Serializable { ...@@ -127,7 +127,7 @@ public class Mawb implements Serializable {
127 private String inputerName; 127 private String inputerName;
128 128
129 @ApiModelProperty(value = "保险费币制", name = "insurCurr", example = "MOP") 129 @ApiModelProperty(value = "保险费币制", name = "insurCurr", example = "MOP")
130 -// //@NotBlank(message="参数insurCurr不能为空") 130 +//@NotBlank(message="参数insurCurr不能为空")
131 @Column(name = "INSURCURR") 131 @Column(name = "INSURCURR")
132 private String insurCurr; 132 private String insurCurr;
133 133
...@@ -228,7 +228,7 @@ public class Mawb implements Serializable { ...@@ -228,7 +228,7 @@ public class Mawb implements Serializable {
228 private String markNo; 228 private String markNo;
229 229
230 @ApiModelProperty(value = "入境口岸代码", name = "entyPortCode", example = "固定值:110101") 230 @ApiModelProperty(value = "入境口岸代码", name = "entyPortCode", example = "固定值:110101")
231 - ////@NotBlank(message="参数entyPortCode不能为空") 231 + //@NotBlank(message="参数entyPortCode不能为空")
232 @Column(name = "ENTYPORTCODE") 232 @Column(name = "ENTYPORTCODE")
233 private String entyPortCode; 233 private String entyPortCode;
234 234
......
...@@ -2,14 +2,20 @@ package com.erry.iclear.dateInterface.service; ...@@ -2,14 +2,20 @@ package com.erry.iclear.dateInterface.service;
2 2
3 import com.erry.iclear.dateInterface.api.request.Fedexc; 3 import com.erry.iclear.dateInterface.api.request.Fedexc;
4 import com.erry.iclear.dateInterface.api.request.Mawb; 4 import com.erry.iclear.dateInterface.api.request.Mawb;
5 +import com.erry.iclear.dateInterface.api.request.MawbDetail;
5 import com.erry.iclear.dateInterface.common.Constant; 6 import com.erry.iclear.dateInterface.common.Constant;
6 import com.erry.iclear.dateInterface.entity.IClearApiLog; 7 import com.erry.iclear.dateInterface.entity.IClearApiLog;
7 import com.erry.iclear.dateInterface.repository.IClearApiLogRepository; 8 import com.erry.iclear.dateInterface.repository.IClearApiLogRepository;
9 +import com.erry.iclear.dateInterface.util.StringUtil;
8 import lombok.extern.slf4j.Slf4j; 10 import lombok.extern.slf4j.Slf4j;
9 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
11 13
14 +import javax.validation.Valid;
15 +import javax.validation.constraints.NotBlank;
12 import java.util.Date; 16 import java.util.Date;
17 +import java.util.List;
18 +import java.util.Objects;
13 19
14 /** 20 /**
15 * @author Administrator 21 * @author Administrator
......
...@@ -4,6 +4,7 @@ import com.arronlong.httpclientutil.HttpClientUtil; ...@@ -4,6 +4,7 @@ import com.arronlong.httpclientutil.HttpClientUtil;
4 import com.arronlong.httpclientutil.common.HttpConfig; 4 import com.arronlong.httpclientutil.common.HttpConfig;
5 import com.arronlong.httpclientutil.common.HttpHeader; 5 import com.arronlong.httpclientutil.common.HttpHeader;
6 import com.erry.iclear.dateInterface.api.request.Mawb; 6 import com.erry.iclear.dateInterface.api.request.Mawb;
7 +import com.erry.iclear.dateInterface.api.request.MawbDetail;
7 import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; 8 import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult;
8 import com.erry.iclear.dateInterface.api.response.ResultRS; 9 import com.erry.iclear.dateInterface.api.response.ResultRS;
9 import com.erry.iclear.dateInterface.entity.ChmConsignment; 10 import com.erry.iclear.dateInterface.entity.ChmConsignment;
...@@ -63,6 +64,113 @@ public class MawbService { ...@@ -63,6 +64,113 @@ public class MawbService {
63 } 64 }
64 65
65 66
67 + public String checkMawbBaseInfo(Mawb mawb){
68 +
69 + if(StringUtil.isEmpty(mawb.getOverseasConsigneeEname())){
70 + return "参数overseasConsigneeEname不能为空";
71 + }
72 + if(StringUtil.isEmpty(mawb.getEntyPortCode())){
73 + return "参数entyPortCode不能为空";
74 + }
75 + if(StringUtil.isEmpty(mawb.getOwnerCodeScc())){
76 + return "参数ownerCodeScc不能为空";
77 + }
78 + if(StringUtil.isEmpty(mawb.getTradeCodeScc())){
79 + return "参数tradeCodeScc不能为空";
80 + }
81 + if(StringUtil.isEmpty(mawb.getTransMode())){
82 + return "参数transMode不能为空";
83 + }
84 + if(StringUtil.isEmpty(mawb.getWrapType())){
85 + return "参数wrapType不能为空";
86 + }
87 + if(StringUtil.isEmpty(mawb.getTradeName())){
88 + return "参数tradeName不能为空";
89 + }
90 + if(StringUtil.isEmpty(mawb.getInsurCurr())){
91 + return "参数insurCurr不能为空";
92 + }
93 + if(StringUtil.isEmpty(mawb.getIePort())){
94 + return "参数iePort不能为空";
95 + }
96 + if(StringUtil.isEmpty(mawb.getFeeMark())){
97 + return "参数feeMark不能为空";
98 + }
99 + if(StringUtil.isEmpty(mawb.getFeeCurr())){
100 + return "参数feeCurr不能为空";
101 + }
102 + if(StringUtil.isEmpty(mawb.getEdiId())){
103 + return "参数ediId不能为空";
104 + }
105 + if(StringUtil.isEmpty(mawb.getDistinatePort())){
106 + return "参数distinatePort不能为空";
107 + }
108 + if(StringUtil.isEmpty(mawb.getDeclTrnRel())){
109 + return "参数declTrnRel不能为空";
110 + }
111 + if(StringUtil.isEmpty(mawb.getCutMode())){
112 + return "参数cutMode不能为空";
113 + }
114 + if(StringUtil.isEmpty(mawb.getCustomMaster())){
115 + return "参数customMaster不能为空";
116 + }
117 + if(StringUtil.isEmpty(mawb.getBillNo())){
118 + return "参数billNo不能为空";
119 + }
120 + if(StringUtil.isEmpty(mawb.getAgentName())){
121 + return "参数agentName不能为空";
122 + }
123 + if(StringUtil.isEmpty(mawb.getAgentCode())){
124 + return "参数agentCode不能为空";
125 + }
126 +
127 + List<MawbDetail> mawbDetailList = mawb.getMawbDetailList();
128 + if(Objects.nonNull(mawbDetailList)){
129 + for (int i = 0, maxi = mawbDetailList.size(); i < maxi; i++) {
130 + MawbDetail mawbDetail = mawbDetailList.get(i);
131 + if(StringUtil.isEmpty(mawbDetail.getDetailId())){
132 + return "参数detailId不能为空";
133 + }
134 + if(StringUtil.isEmpty(mawbDetail.getCodeTS())){
135 + return "参数codeTS不能为空";
136 + }
137 + if(StringUtil.isEmpty(mawbDetail.getDutyMode())){
138 + return "参数dutyMode不能为空";
139 + }
140 + if(StringUtil.isEmpty(mawbDetail.getFirstUnit())){
141 + return "参数firstUnit不能为空";
142 + }
143 + if(StringUtil.isEmpty(mawbDetail.getGunit())){
144 + return "参数gunit不能为空";
145 + }
146 + if(StringUtil.isEmpty(mawbDetail.getGmodel())){
147 + return "参数gmodel不能为空";
148 + }
149 + if(StringUtil.isEmpty(mawbDetail.getGname())){
150 + return "参数gname不能为空";
151 + }
152 + if(StringUtil.isEmpty(mawbDetail.getGno())){
153 + return "参数gno不能为空";
154 + }
155 + if(StringUtil.isEmpty(mawbDetail.getOriginCountry())){
156 + return "参数originCountry不能为空";
157 + }
158 + if(StringUtil.isEmpty(mawbDetail.getTradeCurr())){
159 + return "参数tradeCurr不能为空";
160 + }
161 + if(StringUtil.isEmpty(mawbDetail.getDestinationCountry())){
162 + return "参数destinationCountry不能为空";
163 + }
164 + if(StringUtil.isEmpty(mawbDetail.getDistrictCode())){
165 + return "参数districtCode不能为空";
166 + }
167 + }
168 + }
169 +
170 + return "";
171 + }
172 +
173 +
66 /** 174 /**
67 * 校验主单 175 * 校验主单
68 * @param mawb 176 * @param mawb
......
...@@ -13,13 +13,13 @@ spring: ...@@ -13,13 +13,13 @@ spring:
13 13
14 task: 14 task:
15 #推送海关回执 15 #推送海关回执
16 - pushCustomsTask: 0 0/1 * * * ? 16 + pushCustomsTask: 0 0/1 * 1 * ?
17 #推送完整报文 17 #推送完整报文
18 - pushMawbTask: 0 0/1 * * * ? 18 + pushMawbTask: 0 0/1 * 1 * ?
19 #推送失败的回执数据 19 #推送失败的回执数据
20 - pushErrorReturnDate: 0 0/3 * * * ? 20 + pushErrorReturnDate: 0 0/3 * 1 * ?
21 #推送失败的申报数据 21 #推送失败的申报数据
22 - pushErrorDeclareDate: 0 0/3 * * * ? 22 + pushErrorDeclareDate: 0 0/3 * 1 * ?
23 23
24 #推送地址 24 #推送地址
25 api: 25 api:
......
...@@ -6,9 +6,8 @@ ...@@ -6,9 +6,8 @@
6 <!-- 访问路径 --> 6 <!-- 访问路径 -->
7 <wls:context-root>API</wls:context-root> 7 <wls:context-root>API</wls:context-root>
8 <!-- 优先加载WEB-INF下lib中的jar包 --> 8 <!-- 优先加载WEB-INF下lib中的jar包 -->
9 - <wls:container-descriptor> 9 +<!-- <wls:container-descriptor>-->
10 - <wls:prefer-application-packages> 10 +<!-- <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>-->
11 - <wls:package-name>org.slf4j</wls:package-name> 11 +<!-- </wls:container-descriptor>-->
12 - </wls:prefer-application-packages> 12 +
13 - </wls:container-descriptor>
14 </wls:weblogic-web-app> 13 </wls:weblogic-web-app>
......