作者 shenhailong

修改安检货物类型 修改excel分到不能导入情况

@@ -2529,7 +2529,7 @@ public class ManifestController extends BasicController { @@ -2529,7 +2529,7 @@ public class ManifestController extends BasicController {
2529 String substring1 = s1.substring(3); 2529 String substring1 = s1.substring(3);
2530 wbm = substring + "-" + substring1; 2530 wbm = substring + "-" + substring1;
2531 } 2531 }
2532 - //如果分单不给 2532 + // 如果分单不为空
2533 if (StringUtils.isBlank(arr.get(2))) { 2533 if (StringUtils.isBlank(arr.get(2))) {
2534 // 查询主单号是否存在 2534 // 查询主单号是否存在
2535 ManifestEntity wbm1 = manifestService.findWbm(wbm); 2535 ManifestEntity wbm1 = manifestService.findWbm(wbm);
@@ -2663,7 +2663,6 @@ public class ManifestController extends BasicController { @@ -2663,7 +2663,6 @@ public class ManifestController extends BasicController {
2663 manifestService.save(manifestEntity); 2663 manifestService.save(manifestEntity);
2664 2664
2665 model.setStatus(200); 2665 model.setStatus(200);
2666 - return model;  
2667 2666
2668 }else { 2667 }else {
2669 model.setStatus(201); 2668 model.setStatus(201);
@@ -2687,6 +2686,8 @@ public class ManifestController extends BasicController { @@ -2687,6 +2686,8 @@ public class ManifestController extends BasicController {
2687 seconday.setPreparemasterid(wbm1.getId()); 2686 seconday.setPreparemasterid(wbm1.getId());
2688 // 主单号 2687 // 主单号
2689 seconday.setWaybillnomaster(wbm); 2688 seconday.setWaybillnomaster(wbm);
  2689 + // 分单号
  2690 + seconday.setWaybillnosecondary(arr.get(2));
2690 // 航班号 2691 // 航班号
2691 seconday.setFlightno(arr.get(3).substring(2)); 2692 seconday.setFlightno(arr.get(3).substring(2));
2692 // 航班日期 2693 // 航班日期
@@ -2747,7 +2748,6 @@ public class ManifestController extends BasicController { @@ -2747,7 +2748,6 @@ public class ManifestController extends BasicController {
2747 seconday.setCreateDate(new Date()); 2748 seconday.setCreateDate(new Date());
2748 preparesecondaryServer.save(seconday); 2749 preparesecondaryServer.save(seconday);
2749 model.setStatus(200); 2750 model.setStatus(200);
2750 - return model;  
2751 } else { 2751 } else {
2752 model.setStatus(201); 2752 model.setStatus(201);
2753 model.setMsg(waybill + "分单号已存在"); 2753 model.setMsg(waybill + "分单号已存在");
@@ -2759,7 +2759,7 @@ public class ManifestController extends BasicController { @@ -2759,7 +2759,7 @@ public class ManifestController extends BasicController {
2759 break; 2759 break;
2760 } 2760 }
2761 } 2761 }
2762 - 2762 + return model;
2763 } catch (Exception e) { 2763 } catch (Exception e) {
2764 model.setStatus(500); 2764 model.setStatus(500);
2765 model.setMsg("网络异常"); 2765 model.setMsg("网络异常");
@@ -158,6 +158,9 @@ public class SecurityDeclarationController { @@ -158,6 +158,9 @@ public class SecurityDeclarationController {
158 String two = request.getParameter("two"); 158 String two = request.getParameter("two");
159 String three = request.getParameter("three"); 159 String three = request.getParameter("three");
160 String four = request.getParameter("four"); 160 String four = request.getParameter("four");
  161 +
  162 + String type = cargoType(one, two, three, four);
  163 +
161 //航空货物托运人名称 164 //航空货物托运人名称
162 String cargoShipperName = request.getParameter("sd_cargo_shipper_name"); 165 String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
163 //航空货运销售代理人名称 166 //航空货运销售代理人名称
@@ -176,35 +179,21 @@ public class SecurityDeclarationController { @@ -176,35 +179,21 @@ public class SecurityDeclarationController {
176 if (request.getParameter("sd_transportation_prove") != null){ 179 if (request.getParameter("sd_transportation_prove") != null){
177 transportationProve = request.getParameter("sd_transportation_prove"); 180 transportationProve = request.getParameter("sd_transportation_prove");
178 } 181 }
179 - //货物性质是否多选  
180 - List<String> list = new ArrayList();  
181 - if (!StringUtils.isBlank(one)){  
182 - list.add(one);  
183 - }  
184 - if (!StringUtils.isBlank(two)){  
185 - list.add(two);  
186 - }  
187 - if (!StringUtils.isBlank(three)){  
188 - list.add(three);  
189 - }  
190 - if (!StringUtils.isBlank(four)){  
191 - list.add(four);  
192 - } 182 +
  183 +
193 //查询是否存在 184 //查询是否存在
194 if (securityDeclarationService.findWaybill(waybill) == 0){ 185 if (securityDeclarationService.findWaybill(waybill) == 0){
195 //货物性质(类型)添加 186 //货物性质(类型)添加
196 - for (String type: list){  
197 - SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();  
198 - sdCargoTypeEntity.setSd_waybill(waybill);  
199 - sdCargoTypeEntity.setSd_cargo_type(type);  
200 - sdCargoTypeService.save(sdCargoTypeEntity);  
201 - } 187 + SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
  188 + sdCargoTypeEntity.setSd_waybill(waybill);
  189 + sdCargoTypeEntity.setSd_cargo_type(type);
  190 + sdCargoTypeService.save(sdCargoTypeEntity);
202 191
203 if(!StringUtils.isBlank(cargoName)){ 192 if(!StringUtils.isBlank(cargoName)){
204 //货物品名 193 //货物品名
205 String cName = cargoName.replaceAll(",", ","); 194 String cName = cargoName.replaceAll(",", ",");
206 String[] split = cName.split(","); 195 String[] split = cName.split(",");
207 - for (int i=0; i<split.length; i++){ 196 + for (int i = 0; i < split.length; i++){
208 if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){ 197 if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){
209 SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity(); 198 SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
210 sdCargoNameEntity.setSd_waybill(waybill); 199 sdCargoNameEntity.setSd_waybill(waybill);
@@ -249,11 +238,7 @@ public class SecurityDeclarationController { @@ -249,11 +238,7 @@ public class SecurityDeclarationController {
249 //品名 238 //品名
250 sdVo.setSd_cargo_name(cargoName); 239 sdVo.setSd_cargo_name(cargoName);
251 //货物类型 240 //货物类型
252 - String cargoType = "";  
253 - for (String s: list){  
254 - cargoType+=s+",";  
255 - }  
256 - sdVo.setSd_cargo_type(cargoType); 241 + sdVo.setSd_cargo_type(type);
257 242
258 //预配信息 243 //预配信息
259 ManifestEntity wbm = manifestService.findWbm(waybill); 244 ManifestEntity wbm = manifestService.findWbm(waybill);
@@ -322,6 +307,9 @@ public class SecurityDeclarationController { @@ -322,6 +307,9 @@ public class SecurityDeclarationController {
322 String two = request.getParameter("two"); 307 String two = request.getParameter("two");
323 String three = request.getParameter("three"); 308 String three = request.getParameter("three");
324 String four = request.getParameter("four"); 309 String four = request.getParameter("four");
  310 +
  311 + String type = cargoType(one, two, three, four);
  312 +
325 //航空货物托运人名称 313 //航空货物托运人名称
326 String cargoShipperName = request.getParameter("sd_cargo_shipper_name"); 314 String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
327 //航空货运销售代理人名称 315 //航空货运销售代理人名称
@@ -346,32 +334,15 @@ public class SecurityDeclarationController { @@ -346,32 +334,15 @@ public class SecurityDeclarationController {
346 } 334 }
347 335
348 336
349 - //货物性质是否多选  
350 - List<String> list = new ArrayList();  
351 - if (!StringUtils.isBlank(one)){  
352 - list.add(one);  
353 - }  
354 - if (!StringUtils.isBlank(two)){  
355 - list.add(two);  
356 - }  
357 - if (!StringUtils.isBlank(three)){  
358 - list.add(three);  
359 - }  
360 - if (!StringUtils.isBlank(four)){  
361 - list.add(four);  
362 - }  
363 -  
364 337
365 //查询是否存在 338 //查询是否存在
366 if (securityDeclarationService.findWaybill(waybill) == 0){ 339 if (securityDeclarationService.findWaybill(waybill) == 0){
367 if (manifestService.findWbm(waybill) == null){ 340 if (manifestService.findWbm(waybill) == null){
368 //货物性质(类型)添加 341 //货物性质(类型)添加
369 - for (String type: list){  
370 - SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();  
371 - sdCargoTypeEntity.setSd_waybill(waybill);  
372 - sdCargoTypeEntity.setSd_cargo_type(type);  
373 - sdCargoTypeService.save(sdCargoTypeEntity);  
374 - } 342 + SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
  343 + sdCargoTypeEntity.setSd_waybill(waybill);
  344 + sdCargoTypeEntity.setSd_cargo_type(type);
  345 + sdCargoTypeService.save(sdCargoTypeEntity);
375 346
376 //货物品名 347 //货物品名
377 String cName = cargoName.replaceAll(",", ","); 348 String cName = cargoName.replaceAll(",", ",");
@@ -423,11 +394,8 @@ public class SecurityDeclarationController { @@ -423,11 +394,8 @@ public class SecurityDeclarationController {
423 //品名 394 //品名
424 sdVo.setSd_cargo_name(cargoName); 395 sdVo.setSd_cargo_name(cargoName);
425 //货物类型 396 //货物类型
426 - String cargoType = "";  
427 - for (String s: list){  
428 - cargoType+=s+",";  
429 - }  
430 - sdVo.setSd_cargo_type(cargoType); 397 +
  398 + sdVo.setSd_cargo_type(type);
431 399
432 //添加预配信息 400 //添加预配信息
433 manifestEntity.setWaybillnomaster(waybill); 401 manifestEntity.setWaybillnomaster(waybill);
@@ -596,6 +564,9 @@ public class SecurityDeclarationController { @@ -596,6 +564,9 @@ public class SecurityDeclarationController {
596 String two = request.getParameter("two"); 564 String two = request.getParameter("two");
597 String three = request.getParameter("three"); 565 String three = request.getParameter("three");
598 String four = request.getParameter("four"); 566 String four = request.getParameter("four");
  567 +
  568 + String type = cargoType(one, two, three, four);
  569 +
599 //航空货物托运人名称 570 //航空货物托运人名称
600 String cargoShipperName = request.getParameter("sd_cargo_shipper_name"); 571 String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
601 //航空货运销售代理人名称 572 //航空货运销售代理人名称
@@ -620,29 +591,15 @@ public class SecurityDeclarationController { @@ -620,29 +591,15 @@ public class SecurityDeclarationController {
620 } 591 }
621 592
622 593
623 - List<String> list = new ArrayList();  
624 - if (!StringUtils.isBlank(one)){  
625 - list.add(one);  
626 - }  
627 - if (!StringUtils.isBlank(two)){  
628 - list.add(two);  
629 - }  
630 - if (!StringUtils.isBlank(three)){  
631 - list.add(three);  
632 - }  
633 - if (!StringUtils.isBlank(four)){  
634 - list.add(four);  
635 - } 594 +
636 595
637 //先删除货物性质(类型 596 //先删除货物性质(类型
638 if (sdCargoTypeService.deleteAlls(waybill)>0){ 597 if (sdCargoTypeService.deleteAlls(waybill)>0){
639 //货物性质(类型)添加 598 //货物性质(类型)添加
640 - for (String type: list){  
641 - SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();  
642 - sdCargoTypeEntity.setSd_waybill(waybill);  
643 - sdCargoTypeEntity.setSd_cargo_type(type);  
644 - sdCargoTypeService.save(sdCargoTypeEntity);  
645 - } 599 + SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
  600 + sdCargoTypeEntity.setSd_waybill(waybill);
  601 + sdCargoTypeEntity.setSd_cargo_type(type);
  602 + sdCargoTypeService.save(sdCargoTypeEntity);
646 } 603 }
647 604
648 if (sdCargoNameService.deleteAlls(waybill)>0){ 605 if (sdCargoNameService.deleteAlls(waybill)>0){
@@ -697,16 +654,10 @@ public class SecurityDeclarationController { @@ -697,16 +654,10 @@ public class SecurityDeclarationController {
697 //品名 654 //品名
698 sdVo.setSd_cargo_name(request.getParameter("sd_cargo_name").replaceAll(",", ",")); 655 sdVo.setSd_cargo_name(request.getParameter("sd_cargo_name").replaceAll(",", ","));
699 //货物类型 656 //货物类型
700 - String cargoType = "";  
701 - for (String s: list){  
702 - cargoType+=s+",";  
703 - }  
704 - sdVo.setSd_cargo_type(cargoType); 657 + sdVo.setSd_cargo_type(type);
705 658
706 -// ManifestEntity wbm = manifestService.findWbm(waybill);  
707 ManifestEntity manifestEntity = new ManifestEntity(); 659 ManifestEntity manifestEntity = new ManifestEntity();
708 //修改预配信息 660 //修改预配信息
709 -// manifestEntity.setId(wbm.getId());  
710 manifestEntity.setWaybillnomaster(waybill); 661 manifestEntity.setWaybillnomaster(waybill);
711 manifestEntity.setFlightdate(flightdate); 662 manifestEntity.setFlightdate(flightdate);
712 manifestEntity.setFlightno(flightno); 663 manifestEntity.setFlightno(flightno);
@@ -714,9 +665,6 @@ public class SecurityDeclarationController { @@ -714,9 +665,6 @@ public class SecurityDeclarationController {
714 manifestEntity.setTotalpiece(totalpiece); 665 manifestEntity.setTotalpiece(totalpiece);
715 manifestEntity.setTotalweight(totalweight); 666 manifestEntity.setTotalweight(totalweight);
716 manifestEntity.setDestinationstation(destinationstation); 667 manifestEntity.setDestinationstation(destinationstation);
717 -// if (manifestService.deleteOne(waybill)>0){  
718 -// manifestService.save(manifestEntity);  
719 -// }  
720 manifestService.update(manifestEntity); 668 manifestService.update(manifestEntity);
721 669
722 //预配信息 670 //预配信息
@@ -804,4 +752,26 @@ public class SecurityDeclarationController { @@ -804,4 +752,26 @@ public class SecurityDeclarationController {
804 752
805 return "declaration/print"; 753 return "declaration/print";
806 } 754 }
  755 +
  756 +
  757 + public String cargoType(String one, String two, String three, String four){
  758 +
  759 + String type = "";
  760 + //货物性质
  761 + if (!StringUtils.isBlank(one)){
  762 + type = one;
  763 + }
  764 + if (!StringUtils.isBlank(two)){
  765 + type = two;
  766 + }
  767 + if (!StringUtils.isBlank(three)){
  768 + type = three;
  769 + }
  770 + if (!StringUtils.isBlank(four)){
  771 + type = four;
  772 + }
  773 +
  774 + return type;
  775 + }
  776 +
807 } 777 }
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <!-- rememberMe管理器 --> 29 <!-- rememberMe管理器 -->
30 <bean id="rememberMeManager" class="org.apache.shiro.web.mgt.CookieRememberMeManager"> 30 <bean id="rememberMeManager" class="org.apache.shiro.web.mgt.CookieRememberMeManager">
31 <property name="cipherKey" 31 <property name="cipherKey"
32 - value="#{T(org.apache.shiro.codec.Base64).decode('4AvVhmFLUs0KTA3Kprsdag==')}" /> 32 + value="#{T(org.apache.shiro.codec.Base64).decode('MDBlZGQyMzhlM2ZjNDYxNDllNmY0ZGE2NTcxODhmYmI==')}" />
33 <property name="cookie" ref="rememberMeCookie" /> 33 <property name="cookie" ref="rememberMeCookie" />
34 </bean> 34 </bean>
35 35
@@ -268,23 +268,7 @@ @@ -268,23 +268,7 @@
268 } 268 }
269 269
270 } 270 }
271 - //发送交运报文  
272 - function sendDelivery(){  
273 - var id3 = $("#waybillnomaster").val($("#waybill").val());  
274 - var data = $("#form").serialize();  
275 - $.post("<%=basePath%>manifest/sendDelivery",data,function (data) {  
276 - if (data.status == 200) {  
277 -// layer.confirm("<spring:message code="opt.savesuccess"/>", {btn: ['<spring:message code="opt.confirm"/>', '<spring:message code="opt.cancel"/>']}, function () {  
278 -<%-- window.location.href = "<%=basePath %>manifest/list" ; --%>  
279 - $("#xmlContent").val(data.data);  
280 - $("#DialogShunt").window('open');  
281 - window.location.href = "<%=basePath%>manifest/list";  
282 -// })  
283 - } else {  
284 - layer.open({content: data.msg});  
285 - }  
286 - })  
287 - } 271 +
288 272
289 273
290 274