作者 shenhailong

修改预配远程调用 接口名称 接口添加 参数是否为空 判断 安检添加 后台校验 货物品名是否为空

@@ -1253,67 +1253,87 @@ public class ManifestController extends BasicController { @@ -1253,67 +1253,87 @@ public class ManifestController extends BasicController {
1253 * @param manifest 1253 * @param manifest
1254 * @return 1254 * @return
1255 */ 1255 */
1256 - @RequestMapping(value = "/savesenManifest", method = { RequestMethod.POST }) 1256 + @RequestMapping(value = "/f5f5669bbdecefd3dacfaba194647c35", method = { RequestMethod.POST })
1257 @ResponseBody 1257 @ResponseBody
1258 public ResponseModel savesenManifest(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) { 1258 public ResponseModel savesenManifest(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
1259 1259
1260 ResponseModel model = new ResponseModel(); 1260 ResponseModel model = new ResponseModel();
1261 - if ("dcdf38d9a5d6411985e49155481882f5".equals(manifest.getDe_size())){ 1261 + try {
  1262 + if ("dcdf38d9a5d6411985e49155481882f5".equals(manifest.getDe_size())) {
  1263 +
  1264 + if (StringUtils.isBlank(manifest.getWaybillnomaster()) || StringUtils.isBlank(manifest.getDe_type())
  1265 + || StringUtils.isBlank(manifest.getDelivery_station()) || StringUtils.isBlank(manifest.getFlightno())
  1266 + || manifest.getFlightdate() == null || StringUtils.isBlank(manifest.getOriginatingstation())
  1267 + || StringUtils.isBlank(manifest.getDestinationstation()) || StringUtils.isBlank(manifest.getTotalpiece())
  1268 + || StringUtils.isBlank(manifest.getTotalweight()) || StringUtils.isBlank(manifest.getPaymode())
  1269 + || StringUtils.isBlank(manifest.getCustomsstatus()) || StringUtils.isBlank(manifest.getCustomscode())
  1270 + || StringUtils.isBlank(manifest.getName_ofgoods()) || StringUtils.isBlank(manifest.getCo_company())
  1271 + || StringUtils.isBlank(manifest.getCo_address()) || StringUtils.isBlank(manifest.getShpcusid())
  1272 + || StringUtils.isBlank(manifest.getCo_country()) || StringUtils.isBlank(manifest.getSh_company())
  1273 + || StringUtils.isBlank(manifest.getSh_address()) || StringUtils.isBlank(manifest.getCnecusid())
  1274 + || StringUtils.isBlank(manifest.getSh_country()) || StringUtils.isBlank(manifest.getSh_city())
  1275 + || StringUtils.isBlank(manifest.getReach_station()) || manifest.getUSER_ID() == null){
  1276 +
  1277 + model.setStatus(203);
  1278 + model.setMsg("缺少参数");
1262 1279
1263 - if(manifest.getWaybillnomaster().contains("-")){ 1280 + }else {
  1281 + if (manifest.getWaybillnomaster().contains("-")) {
1264 1282
1265 - }else {  
1266 - StringBuilder stringBuilder = new StringBuilder(manifest.getWaybillnomaster()); 1283 + } else {
  1284 + StringBuilder stringBuilder = new StringBuilder(manifest.getWaybillnomaster());
1267 1285
1268 - StringBuilder waybill = stringBuilder.insert(3, "-"); 1286 + StringBuilder waybill = stringBuilder.insert(3, "-");
1269 1287
1270 - manifest.setWaybillnomaster(waybill.toString()); 1288 + manifest.setWaybillnomaster(waybill.toString());
1271 1289
1272 - } 1290 + }
1273 1291
1274 - manifest.setDe_size(""); 1292 + manifest.setDe_size("");
1275 1293
1276 - String flightno = manifest.getFlightno();  
1277 - String carrier = "";  
1278 - if (StringUtils.isNotBlank(flightno) && flightno.length() > 2) {  
1279 - carrier = flightno.substring(0, 2);  
1280 - flightno = flightno.replace(carrier, "");  
1281 - }  
1282 - manifest.setCarrier(carrier);  
1283 - manifest.setFlightno(flightno); 1294 + String flightno = manifest.getFlightno();
  1295 + String carrier = "";
  1296 + if (StringUtils.isNotBlank(flightno) && flightno.length() > 2) {
  1297 + carrier = flightno.substring(0, 2);
  1298 + flightno = flightno.replace(carrier, "");
  1299 + }
  1300 + manifest.setCarrier(carrier);
  1301 + manifest.setFlightno(flightno);
1284 1302
1285 1303
1286 - try {  
1287 -// manifest.setUSER_ID(Tools.getUserId());  
1288 - ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());  
1289 - if (wbm != null) {  
1290 - model.setStatus(201);  
1291 - model.setMsg("该订单号已存在!");  
1292 - } else {  
1293 - WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;  
1294 -  
1295 - String stowagedate = request.getParameter("stowagedate");  
1296 - manifest.setStowagedate(ManifestEntity.getStowagedate(stowagedate));  
1297 - // 保存  
1298 - manifest.setIsdelete(1);  
1299 - manifest.setResponse_code(String.valueOf(type.getValue()));  
1300 - manifest.setResponse_text(type.getName());  
1301 - manifest.setSave_time(System.currentTimeMillis());  
1302 -  
1303 - manifestService.save(manifest);  
1304 -  
1305 - model.setData(manifest);  
1306 - model.setStatus(200);  
1307 - model.setMsg(HttpJsonMsg.SUCCESS); 1304 + // manifest.setUSER_ID(Tools.getUserId());
  1305 + ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
  1306 + if (wbm != null) {
  1307 + model.setStatus(201);
  1308 + model.setMsg("该订单号已存在!");
  1309 + } else {
  1310 + WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;
  1311 +
  1312 + String stowagedate = request.getParameter("stowagedate");
  1313 + manifest.setStowagedate(ManifestEntity.getStowagedate(stowagedate));
  1314 + // 保存
  1315 + manifest.setIsdelete(1);
  1316 + manifest.setResponse_code(String.valueOf(type.getValue()));
  1317 + manifest.setResponse_text(type.getName());
  1318 + manifest.setSave_time(System.currentTimeMillis());
  1319 +
  1320 + manifestService.save(manifest);
  1321 +
  1322 + model.setData(manifest);
  1323 + model.setStatus(200);
  1324 + model.setMsg(HttpJsonMsg.SUCCESS);
  1325 +
  1326 +
  1327 + }
1308 } 1328 }
1309 - } catch (Exception e) {  
1310 - model.setStatus(500);  
1311 - model.setMsg(HttpJsonMsg.ERROR);  
1312 - logger.error("系统异常 >>", e); 1329 + }else{
  1330 + model.setStatus(202);
  1331 + model.setMsg("缺少验证密码");
1313 } 1332 }
1314 - }else {  
1315 - model.setStatus(202);  
1316 - model.setMsg("缺少验证密码"); 1333 + } catch (Exception e) {
  1334 + model.setStatus(500);
  1335 + model.setMsg(HttpJsonMsg.ERROR);
  1336 + logger.error("系统异常 >>", e);
1317 } 1337 }
1318 return model; 1338 return model;
1319 } 1339 }
@@ -200,7 +200,7 @@ public class SecurityDeclarationController { @@ -200,7 +200,7 @@ public class SecurityDeclarationController {
200 sdCargoTypeService.save(sdCargoTypeEntity); 200 sdCargoTypeService.save(sdCargoTypeEntity);
201 } 201 }
202 202
203 - if(StringUtils.isBlank(cargoName)){ 203 + if(!StringUtils.isBlank(cargoName)){
204 //货物品名 204 //货物品名
205 String cName = cargoName.replaceAll(",", ","); 205 String cName = cargoName.replaceAll(",", ",");
206 String[] split = cName.split(","); 206 String[] split = cName.split(",");
@@ -29,7 +29,7 @@ public class MyShiroController implements Filter { @@ -29,7 +29,7 @@ public class MyShiroController implements Filter {
29 } 29 }
30 30
31 private String publicAction[] = { "/login", "/doLogin", "/manifest/app/send", 31 private String publicAction[] = { "/login", "/doLogin", "/manifest/app/send",
32 - "/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114", "/manifest/savesenManifest" }; 32 + "/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114", "/manifest/f5f5669bbdecefd3dacfaba194647c35" };
33 private String crossDomain[] = { "/cross/", "tracking/detail" }; 33 private String crossDomain[] = { "/cross/", "tracking/detail" };
34 34
35 // manifest/cross/grid.json 35 // manifest/cross/grid.json
@@ -70,16 +70,14 @@ @@ -70,16 +70,14 @@
70 <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> 70 <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
71 <property name="securityManager" ref="securityManager" /> 71 <property name="securityManager" ref="securityManager" />
72 <property name="loginUrl" value="/login" /> 72 <property name="loginUrl" value="/login" />
73 - <property name="unauthorizedUrl" value="/unauthorized" /> 73 + <!--<property name="unauthorizedUrl" value="/manifest/savesendMainfest" />-->
74 <property name="filterChainDefinitions"> 74 <property name="filterChainDefinitions">
75 75
76 <value> 76 <value>
77 /receipt/a0608c4054662dd902e1314f7e450e3eaa81c114 = anon 77 /receipt/a0608c4054662dd902e1314f7e450e3eaa81c114 = anon
78 /login = anon 78 /login = anon
79 <!--开放预配添加接口--> 79 <!--开放预配添加接口-->
80 - /manifest/savesend = anon  
81 -  
82 - 80 + <!--/manifest/savesenManifest = anon-->
83 /druid/** = anon 81 /druid/** = anon
84 /unauthorized = anon 82 /unauthorized = anon
85 /resource/** = anon 83 /resource/** = anon
@@ -89,10 +87,8 @@ @@ -89,10 +87,8 @@
89 /change/passwd= anon 87 /change/passwd= anon
90 /captcha/** = anon 88 /captcha/** = anon
91 /fileDownload/** = anon 89 /fileDownload/** = anon
92 -  
93 /**/cross/** = anon 90 /**/cross/** = anon
94 /tracking/detail/** = anon 91 /tracking/detail/** = anon
95 -  
96 /manifest/save = anon 92 /manifest/save = anon
97 /logout = logout 93 /logout = logout
98 /** = anon 94 /** = anon
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans" 2 <beans xmlns="http://www.springframework.org/schema/beans"
3 - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"  
4 - xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"  
5 - xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task"  
6 - xsi:schemaLocation="http://www.springframework.org/schema/beans 3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xmlns:context="http://www.springframework.org/schema/context"
  5 + xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
  6 + xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task"
  7 + xmlns:jawxs="http://cxf.apache.org/jaxws"
  8 + xsi:schemaLocation="http://www.springframework.org/schema/beans
7 http://www.springframework.org/schema/beans/spring-beans.xsd 9 http://www.springframework.org/schema/beans/spring-beans.xsd
8 http://www.springframework.org/schema/context 10 http://www.springframework.org/schema/context
9 http://www.springframework.org/schema/context/spring-context.xsd 11 http://www.springframework.org/schema/context/spring-context.xsd
@@ -12,7 +14,7 @@ @@ -12,7 +14,7 @@
12 http://www.springframework.org/schema/aop 14 http://www.springframework.org/schema/aop
13 http://www.springframework.org/schema/aop/spring-aop.xsd 15 http://www.springframework.org/schema/aop/spring-aop.xsd
14 http://www.springframework.org/schema/task 16 http://www.springframework.org/schema/task
15 - http://www.springframework.org/schema/task/spring-task-4.0.xsd"> 17 + http://www.springframework.org/schema/task/spring-task-4.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
16 18
17 <mvc:cors> 19 <mvc:cors>
18 <mvc:mapping path="/api/**" allowed-origins="http://d.demo.com:8080" 20 <mvc:mapping path="/api/**" allowed-origins="http://d.demo.com:8080"
@@ -122,5 +124,4 @@ @@ -122,5 +124,4 @@
122 124
123 <!-- <context:component-scan base-package="com.agent.billcheck"/> 125 <!-- <context:component-scan base-package="com.agent.billcheck"/>
124 <task:annotation-driven/> --> 126 <task:annotation-driven/> -->
125 -  
126 </beans> 127 </beans>