作者 shenhailong

excel 导入 主单模七校验 添加针对主单操作工具类

@@ -3,11 +3,13 @@ package com.agent.controller.agent; @@ -3,11 +3,13 @@ package com.agent.controller.agent;
3 import com.agent.controller.BasicController; 3 import com.agent.controller.BasicController;
4 import com.agent.entity.Constant; 4 import com.agent.entity.Constant;
5 import com.agent.entity.agent.*; 5 import com.agent.entity.agent.*;
  6 +import com.agent.entity.system.PermissionEntity;
6 import com.agent.entity.system.UserEntity; 7 import com.agent.entity.system.UserEntity;
7 import com.agent.service.agent.*; 8 import com.agent.service.agent.*;
8 import com.agent.service.system.*; 9 import com.agent.service.system.*;
9 import com.agent.util.ExcelUtil; 10 import com.agent.util.ExcelUtil;
10 import com.agent.util.HttpJsonMsg; 11 import com.agent.util.HttpJsonMsg;
  12 +import com.agent.util.WaybillUtils;
11 import com.agent.vo.ResponseModel; 13 import com.agent.vo.ResponseModel;
12 import com.agent.vo.agent.CommodityVo; 14 import com.agent.vo.agent.CommodityVo;
13 import com.agent.vo.agent.ManifestVo; 15 import com.agent.vo.agent.ManifestVo;
@@ -27,10 +29,10 @@ import com.plugin.easyui.DataGrid; @@ -27,10 +29,10 @@ import com.plugin.easyui.DataGrid;
27 import com.plugin.easyui.EasyPage; 29 import com.plugin.easyui.EasyPage;
28 import org.apache.commons.collections.CollectionUtils; 30 import org.apache.commons.collections.CollectionUtils;
29 import org.apache.commons.lang.StringUtils; 31 import org.apache.commons.lang.StringUtils;
  32 +import org.apache.poi.ss.formula.functions.T;
30 import org.apache.shiro.SecurityUtils; 33 import org.apache.shiro.SecurityUtils;
31 import org.slf4j.Logger; 34 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory; 35 import org.slf4j.LoggerFactory;
33 -import org.springframework.beans.factory.annotation.Autowired;  
34 import org.springframework.stereotype.Controller; 36 import org.springframework.stereotype.Controller;
35 import org.springframework.ui.Model; 37 import org.springframework.ui.Model;
36 import org.springframework.web.bind.annotation.RequestMapping; 38 import org.springframework.web.bind.annotation.RequestMapping;
@@ -44,7 +46,6 @@ import tools.Tools; @@ -44,7 +46,6 @@ import tools.Tools;
44 import tools.oclass.FemyList; 46 import tools.oclass.FemyList;
45 47
46 import javax.annotation.Resource; 48 import javax.annotation.Resource;
47 -import javax.jnlp.PersistenceService;  
48 import javax.servlet.http.HttpServletRequest; 49 import javax.servlet.http.HttpServletRequest;
49 import javax.servlet.http.HttpServletResponse; 50 import javax.servlet.http.HttpServletResponse;
50 import javax.servlet.http.HttpSession; 51 import javax.servlet.http.HttpSession;
@@ -53,7 +54,6 @@ import java.sql.Connection; @@ -53,7 +54,6 @@ import java.sql.Connection;
53 import java.sql.ResultSet; 54 import java.sql.ResultSet;
54 import java.sql.SQLException; 55 import java.sql.SQLException;
55 import java.sql.Statement; 56 import java.sql.Statement;
56 -import java.text.ParseException;  
57 import java.text.SimpleDateFormat; 57 import java.text.SimpleDateFormat;
58 import java.util.*; 58 import java.util.*;
59 59
@@ -2469,6 +2469,311 @@ public class ManifestController extends BasicController { @@ -2469,6 +2469,311 @@ public class ManifestController extends BasicController {
2469 * excel 导入 2469 * excel 导入
2470 * @return 2470 * @return
2471 */ 2471 */
  2472 +// @RequestMapping(value = "/excelView")
  2473 +// public String excelView(){
  2474 +// return "manifest/excel_upload";
  2475 +// }
  2476 +//
  2477 +// @RequestMapping(value = "/excelUpload")
  2478 +// @ResponseBody
  2479 +// public ResponseModel excelUpload(HttpServletRequest request,
  2480 +// HttpServletResponse response,
  2481 +// HttpSession session,
  2482 +// @RequestParam MultipartFile file) throws IOException {
  2483 +// ResponseModel model = new ResponseModel();
  2484 +//
  2485 +// //获取当前登录用户id
  2486 +// UserEntity user = (UserEntity) session.getAttribute("user");
  2487 +// Long userId = user.getId();
  2488 +//
  2489 +// List<ArrayList<String>> readResult = null;//总行记录
  2490 +// try {
  2491 +//
  2492 +// //判断文件是否为空
  2493 +// if (file.isEmpty()) {
  2494 +// model.setStatus(500);
  2495 +// model.setMsg("上传文件为空");
  2496 +// }
  2497 +// //判断文件大小
  2498 +// long size = file.getSize();
  2499 +// String name = file.getOriginalFilename();
  2500 +// if (StringUtils.isBlank(name) || size == 0) {
  2501 +// model.setStatus(500);
  2502 +// model.setMsg("上传文件为空");
  2503 +// }
  2504 +// String postfix = ExcelUtil.getPostfix(name);
  2505 +// //读取文件内容
  2506 +// if (StringUtils.equals("xlsx", postfix)) {
  2507 +// readResult = ExcelUtil.readXlsx(file);
  2508 +// } else if (StringUtils.equals("xls", postfix)) {
  2509 +// readResult = ExcelUtil.readXls(file);
  2510 +// } else {
  2511 +// model.setStatus(500);
  2512 +// model.setMsg("文件类型错误");
  2513 +// }
  2514 +//
  2515 +// if (readResult == null || readResult.size() == 0) {
  2516 +// model.setStatus(500);
  2517 +// model.setMsg("文件解析失败");
  2518 +// }
  2519 +//
  2520 +//
  2521 +// for (ArrayList<String> arr: readResult) {
  2522 +// String wbm = "";
  2523 +//
  2524 +// if (!StringUtils.isBlank(arr.get(1)) && arr.get(1).length()== 12) {
  2525 +//
  2526 +// if (arr.get(1).contains("-")) {
  2527 +// wbm = arr.get(1);
  2528 +// } else {
  2529 +// String s1 = arr.get(1);
  2530 +// String substring = s1.substring(0, 3);
  2531 +// String substring1 = s1.substring(3);
  2532 +// wbm = substring + "-" + substring1;
  2533 +// }
  2534 +// // 如果分单不为空
  2535 +// if (StringUtils.isBlank(arr.get(2))) {
  2536 +// // 查询主单号是否存在
  2537 +// ManifestEntity wbm1 = manifestService.findWbm(wbm);
  2538 +// if (wbm1 == null) {
  2539 +// ManifestEntity manifestEntity = new ManifestEntity();
  2540 +// manifestEntity.setUSER_ID(userId);
  2541 +// // 主单号
  2542 +// manifestEntity.setWaybillnomaster(wbm);
  2543 +// // 航班号
  2544 +// manifestEntity.setFlightno(arr.get(3).substring(2));
  2545 +// // 航班日期
  2546 +// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
  2547 +// String s = arr.get(4);
  2548 +// Date parse = simpleDateFormat.parse(s);
  2549 +// manifestEntity.setFlightdate(parse);
  2550 +// // 承运人代码
  2551 +// manifestEntity.setCarrier(arr.get(3).substring(0, 2));
  2552 +// // 运费支付方式
  2553 +// manifestEntity.setPaymode(arr.get(5));
  2554 +// // 装货地代码
  2555 +// manifestEntity.setOriginatingstation(arr.get(6));
  2556 +// // 卸货地代码
  2557 +// manifestEntity.setDestinationstation(arr.get(7));
  2558 +// // 货物装载运输时间
  2559 +// manifestEntity.setStowagedate(new Date());
  2560 +// // 海关关区代码
  2561 +// manifestEntity.setCustomscode(arr.get(9));
  2562 +// // 货物件数
  2563 +// manifestEntity.setTotalpiece(arr.get(10));
  2564 +// // 货物毛重
  2565 +// manifestEntity.setTotalweight(arr.get(11));
  2566 +// // 货物简要描述
  2567 +// manifestEntity.setProductname(arr.get(12));
  2568 +// // 发货人代码
  2569 +// manifestEntity.setShpcusid(arr.get(13));
  2570 +// // 发货人公司
  2571 +// manifestEntity.setCo_company(arr.get(14));
  2572 +// // 发货人地址
  2573 +// manifestEntity.setCo_address(arr.get(15));
  2574 +// // 发货人国家代码
  2575 +// manifestEntity.setSh_country(arr.get(16));
  2576 +// // 发货人传真
  2577 +// manifestEntity.setSh_fax(arr.get(17));
  2578 +// // 发货人联系号码
  2579 +// manifestEntity.setCo_telephone(arr.get(18));
  2580 +// // 收货人代码
  2581 +// manifestEntity.setCnecusid(arr.get(19));
  2582 +// // 收货人公司
  2583 +// manifestEntity.setSh_company(arr.get(20));
  2584 +// // 收货人地址
  2585 +// manifestEntity.setSh_address(arr.get(21));
  2586 +// // 收货人城市
  2587 +// manifestEntity.setSh_city(arr.get(22));
  2588 +// // 收货人国家代码
  2589 +// manifestEntity.setSh_country(arr.get(23));
  2590 +// // 收货人传真
  2591 +// manifestEntity.setSh_fax(arr.get(24));
  2592 +// // 收货人联系号码
  2593 +// manifestEntity.setSh_telephone(arr.get(25));
  2594 +//
  2595 +// // 货物海关状态代码
  2596 +// manifestEntity.setCustomsstatus(arr.get(26));
  2597 +//
  2598 +// // 安检申报
  2599 +//
  2600 +// if (StringUtils.isNotBlank(arr.get(27)) && StringUtils.isNotBlank(arr.get(28)) && StringUtils.isNotBlank(arr.get(29))
  2601 +// && StringUtils.isNotBlank(arr.get(32)) && StringUtils.isNotBlank(arr.get(33))){
  2602 +// SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
  2603 +// sd.setSd_waybill(wbm);
  2604 +// // 航空货物托运人名称
  2605 +// sd.setSd_cargo_shipper_name(arr.get(27));
  2606 +// // 航空货物销售代理人名称
  2607 +// sd.setSd_cargo_agent_name(arr.get(28));
  2608 +// // 航协资质编号
  2609 +// if (!StringUtils.isBlank(arr.get(29))) {
  2610 +// sd.setSd_iata_number(arr.get(29));
  2611 +// }
  2612 +//
  2613 +// sd.setSd_static("1");
  2614 +// // 发布时间
  2615 +// SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2616 +// String format = simpleDateFormat2.format(new Date());
  2617 +// sd.setOperation_time(format);
  2618 +//
  2619 +// // 运输条件鉴定书
  2620 +// if (!StringUtils.isBlank(arr.get(30))) {
  2621 +//
  2622 +// String certificate = arr.get(30);
  2623 +// if (certificate != null) {
  2624 +// String s2 = certificate.replaceAll(",", ",");
  2625 +// sd.setSd_transport_certificate(s2);
  2626 +// }
  2627 +// }
  2628 +//
  2629 +// // 航空公司同意运输证明
  2630 +// if (!StringUtils.isBlank(arr.get(31))) {
  2631 +//
  2632 +// String prove = arr.get(31);
  2633 +// if (prove != null) {
  2634 +// String s2 = prove.replaceAll(",", ",");
  2635 +// sd.setSd_transportation_prove(s2);
  2636 +// }
  2637 +// }
  2638 +//
  2639 +// // 用户ID
  2640 +// sd.setUSER_ID(userId);
  2641 +//
  2642 +// // 航空货物性质
  2643 +// SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
  2644 +// sdCargoTypeEntity.setSd_waybill(wbm);
  2645 +// sdCargoTypeEntity.setSd_cargo_type(arr.get(32));
  2646 +// sdCargoTypeService.save(sdCargoTypeEntity);
  2647 +//
  2648 +// // 航空货物品名
  2649 +// String replace = arr.get(33).replace(",", ",");
  2650 +//
  2651 +// String[] cargoName = replace.split(",");
  2652 +// for (int i = 0; i < cargoName.length; i++) {
  2653 +// SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
  2654 +// sdCargoNameEntity.setSd_waybill(wbm);
  2655 +// sdCargoNameEntity.setSd_cargo_name(cargoName[i]);
  2656 +// sdCargoNameService.save(sdCargoNameEntity);
  2657 +// }
  2658 +// securityDeclarationService.save(sd);
  2659 +// }
  2660 +//
  2661 +//
  2662 +// manifestService.save(manifestEntity);
  2663 +//
  2664 +// model.setStatus(200);
  2665 +//
  2666 +// }else {
  2667 +// model.setStatus(201);
  2668 +// model.setMsg(wbm1.getWaybillnomaster() + "单号已存在");
  2669 +// break;
  2670 +// }
  2671 +// }else {
  2672 +//
  2673 +// ManifestEntity wbm1 = manifestService.findWbm(wbm);
  2674 +// if(wbm1 == null){
  2675 +//
  2676 +// model.setStatus(202);
  2677 +// model.setMsg("请先添加主单号");
  2678 +// break;
  2679 +// }else {
  2680 +// String waybill = preparesecondaryServer.findWaybill(arr.get(2));
  2681 +//
  2682 +// if (waybill != arr.get(2)) {
  2683 +//
  2684 +// PreparesecondaryEntity seconday = new PreparesecondaryEntity();
  2685 +// seconday.setPreparemasterid(wbm1.getId());
  2686 +// // 主单号
  2687 +// seconday.setWaybillnomaster(wbm);
  2688 +// // 分单号
  2689 +// seconday.setWaybillnosecondary(arr.get(2));
  2690 +// // 航班号
  2691 +// seconday.setFlightno(arr.get(3).substring(2));
  2692 +// // 航班日期
  2693 +// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
  2694 +// String s = arr.get(4);
  2695 +// Date parse = simpleDateFormat.parse(s);
  2696 +// seconday.setFlightdate(parse);
  2697 +// // 承运人代码
  2698 +// seconday.setCarrier(arr.get(3).substring(0, 2));
  2699 +// // 运费支付方式
  2700 +// seconday.setPaymode(arr.get(5));
  2701 +// // 装货地代码
  2702 +// seconday.setOriginatingstation(arr.get(6));
  2703 +// // 卸货地代码
  2704 +// seconday.setDestinationstation(arr.get(7));
  2705 +// // 货物装载运输时间
  2706 +// SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");
  2707 +// seconday.setStowagedate(simpleDateFormat1.parse(arr.get(8)));
  2708 +// // 海关关区代码
  2709 +// seconday.setCustomscode(arr.get(9));
  2710 +// // 货物件数
  2711 +//// String s3 = arr.get(11);
  2712 +// seconday.setTotalpiece(arr.get(10));
  2713 +// // 货物毛重
  2714 +//// String s1 = arr.get(12);
  2715 +// seconday.setTotalweight(arr.get(11));
  2716 +// // 货物简要描述
  2717 +// seconday.setProductname(arr.get(12));
  2718 +// // 发货人代码
  2719 +// seconday.setShpcusid(arr.get(13));
  2720 +// // 发货人公司
  2721 +// seconday.setCo_company(arr.get(14));
  2722 +// // 发货人地址
  2723 +// seconday.setCo_address(arr.get(15));
  2724 +// // 发货人国家代码
  2725 +// seconday.setSh_country(arr.get(16));
  2726 +// // 发货人传真
  2727 +// seconday.setSh_fax(arr.get(17));
  2728 +// // 发货人联系号码
  2729 +// seconday.setCo_telephone(arr.get(18));
  2730 +// // 收货人代码
  2731 +// seconday.setCnecusid(arr.get(19));
  2732 +// // 收货人公司
  2733 +// seconday.setSh_company(arr.get(20));
  2734 +// // 收货人地址
  2735 +// seconday.setSh_address(arr.get(21));
  2736 +// // 收货人城市
  2737 +// seconday.setSh_city(arr.get(22));
  2738 +// // 收货人国家代码
  2739 +// seconday.setSh_country(arr.get(23));
  2740 +// // 收货人传真
  2741 +// seconday.setSh_fax(arr.get(24));
  2742 +// // 收货人联系号码
  2743 +// seconday.setSh_telephone(arr.get(25));
  2744 +//
  2745 +// // 货物海关状态代码
  2746 +// seconday.setCustomsstatus(arr.get(26));
  2747 +// seconday.setCreateDate(new Date());
  2748 +// preparesecondaryServer.save(seconday);
  2749 +// model.setStatus(200);
  2750 +// } else {
  2751 +// model.setStatus(201);
  2752 +// model.setMsg(waybill + "分单号已存在");
  2753 +// break;
  2754 +// }
  2755 +// }
  2756 +// }
  2757 +// }else {
  2758 +//
  2759 +// model.setStatus(300);
  2760 +// model.setMsg("主单号格式有误");
  2761 +// break;
  2762 +// }
  2763 +// }
  2764 +// return model;
  2765 +// } catch (Exception e) {
  2766 +// model.setStatus(500);
  2767 +// model.setMsg("格式有误");
  2768 +// e.printStackTrace();
  2769 +// }
  2770 +// return model;
  2771 +// }
  2772 +
  2773 + /**
  2774 + * excel 导入
  2775 + * @return
  2776 + */
2472 @RequestMapping(value = "/excelView") 2777 @RequestMapping(value = "/excelView")
2473 public String excelView(){ 2778 public String excelView(){
2474 return "manifest/excel_upload"; 2779 return "manifest/excel_upload";
@@ -2477,15 +2782,16 @@ public class ManifestController extends BasicController { @@ -2477,15 +2782,16 @@ public class ManifestController extends BasicController {
2477 @RequestMapping(value = "/excelUpload") 2782 @RequestMapping(value = "/excelUpload")
2478 @ResponseBody 2783 @ResponseBody
2479 public ResponseModel excelUpload(HttpServletRequest request, 2784 public ResponseModel excelUpload(HttpServletRequest request,
2480 - HttpServletResponse response,  
2481 - HttpSession session,  
2482 - @RequestParam MultipartFile file) throws IOException { 2785 + HttpServletResponse response,
  2786 + HttpSession session,
  2787 + @RequestParam MultipartFile file) throws IOException {
2483 ResponseModel model = new ResponseModel(); 2788 ResponseModel model = new ResponseModel();
  2789 +
2484 //获取当前登录用户id 2790 //获取当前登录用户id
2485 - UserEntity user = (UserEntity) session.getAttribute("user");  
2486 - Long userId = user.getId(); 2791 + UserEntity user = (UserEntity) session.getAttribute("user");
  2792 + Long userId = user.getId();
2487 2793
2488 - List<ArrayList<String>> readResult = null;//总行记录 2794 + List<ArrayList<String>> readResult = null;//总行记录
2489 try { 2795 try {
2490 2796
2491 //判断文件是否为空 2797 //判断文件是否为空
@@ -2500,270 +2806,247 @@ public class ManifestController extends BasicController { @@ -2500,270 +2806,247 @@ public class ManifestController extends BasicController {
2500 model.setStatus(500); 2806 model.setStatus(500);
2501 model.setMsg("上传文件为空"); 2807 model.setMsg("上传文件为空");
2502 } 2808 }
2503 - String postfix = ExcelUtil.getPostfix(name);  
2504 - //读取文件内容  
2505 - if (StringUtils.equals("xlsx", postfix)) {  
2506 - readResult = ExcelUtil.readXlsx(file);  
2507 - } else if (StringUtils.equals("xls", postfix)) {  
2508 - readResult = ExcelUtil.readXls(file);  
2509 - } else {  
2510 - model.setStatus(500);  
2511 - model.setMsg("文件类型错误");  
2512 - }  
2513 -  
2514 - if (readResult == null || readResult.size() == 0) {  
2515 - model.setStatus(500);  
2516 - model.setMsg("文件解析失败");  
2517 - }  
2518 -  
2519 -  
2520 - for (ArrayList<String> arr: readResult) { 2809 + String postfix = ExcelUtil.getPostfix(name);
  2810 + //读取文件内容
  2811 + if (StringUtils.equals("xlsx", postfix)) {
  2812 + readResult = ExcelUtil.readXlsx(file);
  2813 + } else if (StringUtils.equals("xls", postfix)) {
  2814 + readResult = ExcelUtil.readXls(file);
  2815 + } else {
  2816 + model.setStatus(500);
  2817 + model.setMsg("文件类型错误");
  2818 + }
  2819 + if (readResult == null || readResult.size() == 0) {
  2820 + model.setStatus(500);
  2821 + model.setMsg("文件解析失败");
  2822 + }
  2823 + for (ArrayList<String> arr: readResult) {
2521 String wbm = ""; 2824 String wbm = "";
2522 - if (!StringUtils.isBlank(arr.get(1))) {  
2523 -  
2524 - if (arr.get(1).contains("-")) {  
2525 - wbm = arr.get(1);  
2526 - } else {  
2527 - String s1 = arr.get(1);  
2528 - String substring = s1.substring(0, 3);  
2529 - String substring1 = s1.substring(3);  
2530 - wbm = substring + "-" + substring1;  
2531 - }  
2532 - // 如果分单不为空  
2533 - if (StringUtils.isBlank(arr.get(2))) {  
2534 - // 查询主单号是否存在  
2535 - ManifestEntity wbm1 = manifestService.findWbm(wbm);  
2536 - if (wbm1 == null) {  
2537 - ManifestEntity manifestEntity = new ManifestEntity();  
2538 - manifestEntity.setUSER_ID(userId);  
2539 - // 主单号  
2540 - manifestEntity.setWaybillnomaster(wbm);  
2541 - // 航班号  
2542 - manifestEntity.setFlightno(arr.get(3).substring(2));  
2543 - // 航班日期  
2544 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");  
2545 - String s = arr.get(4);  
2546 - Date parse = simpleDateFormat.parse(s);  
2547 - manifestEntity.setFlightdate(parse);  
2548 - // 承运人代码  
2549 - manifestEntity.setCarrier(arr.get(3).substring(0, 2));  
2550 - // 运费支付方式  
2551 - manifestEntity.setPaymode(arr.get(5));  
2552 - // 装货地代码  
2553 - manifestEntity.setOriginatingstation(arr.get(6));  
2554 - // 卸货地代码  
2555 - manifestEntity.setDestinationstation(arr.get(7));  
2556 - // 货物装载运输时间  
2557 - manifestEntity.setStowagedate(new Date());  
2558 - // 海关关区代码  
2559 - manifestEntity.setCustomscode(arr.get(9));  
2560 - // 货物件数  
2561 - manifestEntity.setTotalpiece(arr.get(10));  
2562 - // 货物毛重  
2563 - manifestEntity.setTotalweight(arr.get(11));  
2564 - // 货物简要描述  
2565 - manifestEntity.setProductname(arr.get(12));  
2566 - // 发货人代码  
2567 - manifestEntity.setShpcusid(arr.get(13));  
2568 - // 发货人公司  
2569 - manifestEntity.setCo_company(arr.get(14));  
2570 - // 发货人地址  
2571 - manifestEntity.setCo_address(arr.get(15));  
2572 - // 发货人国家代码  
2573 - manifestEntity.setSh_country(arr.get(16));  
2574 - // 发货人传真  
2575 - manifestEntity.setSh_fax(arr.get(17));  
2576 - // 发货人联系号码  
2577 - manifestEntity.setCo_telephone(arr.get(18));  
2578 - // 收货人代码  
2579 - manifestEntity.setCnecusid(arr.get(19));  
2580 - // 收货人公司  
2581 - manifestEntity.setSh_company(arr.get(20));  
2582 - // 收货人地址  
2583 - manifestEntity.setSh_address(arr.get(21));  
2584 - // 收货人城市  
2585 - manifestEntity.setSh_city(arr.get(22));  
2586 - // 收货人国家代码  
2587 - manifestEntity.setSh_country(arr.get(23));  
2588 - // 收货人传真  
2589 - manifestEntity.setSh_fax(arr.get(24));  
2590 - // 收货人联系号码  
2591 - manifestEntity.setSh_telephone(arr.get(25));  
2592 -  
2593 - // 货物海关状态代码  
2594 - manifestEntity.setCustomsstatus(arr.get(26));  
2595 -  
2596 - // 安检申报  
2597 -  
2598 - if (StringUtils.isNotBlank(arr.get(27)) && StringUtils.isNotBlank(arr.get(28)) && StringUtils.isNotBlank(arr.get(29))  
2599 - && StringUtils.isNotBlank(arr.get(32)) && StringUtils.isNotBlank(arr.get(33))){  
2600 - SecurityDeclarationEntity sd = new SecurityDeclarationEntity();  
2601 - sd.setSd_waybill(wbm);  
2602 - // 航空货物托运人名称  
2603 - sd.setSd_cargo_shipper_name(arr.get(27));  
2604 - // 航空货物销售代理人名称  
2605 - sd.setSd_cargo_agent_name(arr.get(28));  
2606 - // 航协资质编号  
2607 - if (!StringUtils.isBlank(arr.get(29))) {  
2608 - sd.setSd_iata_number(arr.get(29));  
2609 - }  
2610 -  
2611 - sd.setSd_static("1");  
2612 - // 发布时间  
2613 - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
2614 - String format = simpleDateFormat2.format(new Date());  
2615 - sd.setOperation_time(format);  
2616 -  
2617 - // 运输条件鉴定书  
2618 - if (!StringUtils.isBlank(arr.get(30))) {  
2619 -  
2620 - String certificate = arr.get(30);  
2621 - if (certificate != null) {  
2622 - String s2 = certificate.replaceAll(",", ",");  
2623 - sd.setSd_transport_certificate(s2);  
2624 - }  
2625 - }  
2626 -  
2627 - // 航空公司同意运输证明  
2628 - if (!StringUtils.isBlank(arr.get(31))) {  
2629 -  
2630 - String prove = arr.get(31);  
2631 - if (prove != null) {  
2632 - String s2 = prove.replaceAll(",", ",");  
2633 - sd.setSd_transportation_prove(s2);  
2634 - }  
2635 - }  
2636 -  
2637 - // 用户ID  
2638 - sd.setUSER_ID(userId);  
2639 -  
2640 - // 航空货物性质  
2641 - SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();  
2642 - sdCargoTypeEntity.setSd_waybill(wbm);  
2643 - sdCargoTypeEntity.setSd_cargo_type(arr.get(32));  
2644 - sdCargoTypeService.save(sdCargoTypeEntity);  
2645 -  
2646 - // 航空货物品名  
2647 - String replace = arr.get(33).replace(",", ",");  
2648 -  
2649 - String[] cargoName = replace.split(",");  
2650 - for (int i = 0; i < cargoName.length; i++) {  
2651 - SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();  
2652 - sdCargoNameEntity.setSd_waybill(wbm);  
2653 - sdCargoNameEntity.setSd_cargo_name(cargoName[i]);  
2654 - sdCargoNameService.save(sdCargoNameEntity);  
2655 - }  
2656 - securityDeclarationService.save(sd);  
2657 - }  
2658 -  
2659 -  
2660 - manifestService.save(manifestEntity);  
2661 -  
2662 - model.setStatus(200);  
2663 -  
2664 - }else {  
2665 - model.setStatus(201);  
2666 - model.setMsg(wbm1.getWaybillnomaster() + "单号已存在");  
2667 - break;  
2668 - }  
2669 - }else {  
2670 -  
2671 - ManifestEntity wbm1 = manifestService.findWbm(wbm);  
2672 - if(wbm1 == null){  
2673 -  
2674 - model.setStatus(202);  
2675 - model.setMsg("请先添加主单号");  
2676 - break;  
2677 - }else {  
2678 - String waybill = preparesecondaryServer.findWaybill(arr.get(2));  
2679 -  
2680 - if (waybill != arr.get(2)) {  
2681 -  
2682 - PreparesecondaryEntity seconday = new PreparesecondaryEntity();  
2683 - seconday.setPreparemasterid(wbm1.getId()); 2825 + // 判断非空 长度是否符合
  2826 + if (!StringUtils.isBlank(arr.get(1)) && arr.get(1).length()== 12) {
  2827 + WaybillUtils waybillUtils = new WaybillUtils();
  2828 + wbm = waybillUtils.awb(arr.get(1));
  2829 + // 是否符合摸七校验
  2830 + if (waybillUtils.checkout(wbm)){
  2831 + // 如果分单不为空
  2832 + if (StringUtils.isBlank(arr.get(2))) {
  2833 + // 查询主单号是否存在
  2834 + ManifestEntity wbm1 = manifestService.findWbm(wbm);
  2835 + if (wbm1 == null) {
  2836 + ManifestEntity manifestEntity = new ManifestEntity();
  2837 + manifestEntity.setUSER_ID(userId);
2684 // 主单号 2838 // 主单号
2685 - seconday.setWaybillnomaster(wbm);  
2686 - // 分单号  
2687 - seconday.setWaybillnosecondary(arr.get(2)); 2839 + manifestEntity.setWaybillnomaster(wbm);
2688 // 航班号 2840 // 航班号
2689 - seconday.setFlightno(arr.get(3).substring(2)); 2841 + manifestEntity.setFlightno(arr.get(3).substring(2));
2690 // 航班日期 2842 // 航班日期
2691 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); 2843 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
2692 String s = arr.get(4); 2844 String s = arr.get(4);
2693 Date parse = simpleDateFormat.parse(s); 2845 Date parse = simpleDateFormat.parse(s);
2694 - seconday.setFlightdate(parse); 2846 + manifestEntity.setFlightdate(parse);
2695 // 承运人代码 2847 // 承运人代码
2696 - seconday.setCarrier(arr.get(3).substring(0, 2)); 2848 + manifestEntity.setCarrier(arr.get(3).substring(0, 2));
2697 // 运费支付方式 2849 // 运费支付方式
2698 - seconday.setPaymode(arr.get(5)); 2850 + manifestEntity.setPaymode(arr.get(5));
2699 // 装货地代码 2851 // 装货地代码
2700 - seconday.setOriginatingstation(arr.get(6)); 2852 + manifestEntity.setOriginatingstation(arr.get(6));
2701 // 卸货地代码 2853 // 卸货地代码
2702 - seconday.setDestinationstation(arr.get(7)); 2854 + manifestEntity.setDestinationstation(arr.get(7));
2703 // 货物装载运输时间 2855 // 货物装载运输时间
2704 - SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");  
2705 - seconday.setStowagedate(simpleDateFormat1.parse(arr.get(8))); 2856 + manifestEntity.setStowagedate(new Date());
2706 // 海关关区代码 2857 // 海关关区代码
2707 - seconday.setCustomscode(arr.get(9)); 2858 + manifestEntity.setCustomscode(arr.get(9));
2708 // 货物件数 2859 // 货物件数
2709 -// String s3 = arr.get(11);  
2710 - seconday.setTotalpiece(arr.get(10)); 2860 + manifestEntity.setTotalpiece(arr.get(10));
2711 // 货物毛重 2861 // 货物毛重
2712 -// String s1 = arr.get(12);  
2713 - seconday.setTotalweight(arr.get(11)); 2862 + manifestEntity.setTotalweight(arr.get(11));
2714 // 货物简要描述 2863 // 货物简要描述
2715 - seconday.setProductname(arr.get(12)); 2864 + manifestEntity.setProductname(arr.get(12));
2716 // 发货人代码 2865 // 发货人代码
2717 - seconday.setShpcusid(arr.get(13)); 2866 + manifestEntity.setShpcusid(arr.get(13));
2718 // 发货人公司 2867 // 发货人公司
2719 - seconday.setCo_company(arr.get(14)); 2868 + manifestEntity.setCo_company(arr.get(14));
2720 // 发货人地址 2869 // 发货人地址
2721 - seconday.setCo_address(arr.get(15)); 2870 + manifestEntity.setCo_address(arr.get(15));
2722 // 发货人国家代码 2871 // 发货人国家代码
2723 - seconday.setSh_country(arr.get(16)); 2872 + manifestEntity.setSh_country(arr.get(16));
2724 // 发货人传真 2873 // 发货人传真
2725 - seconday.setSh_fax(arr.get(17)); 2874 + manifestEntity.setSh_fax(arr.get(17));
2726 // 发货人联系号码 2875 // 发货人联系号码
2727 - seconday.setCo_telephone(arr.get(18)); 2876 + manifestEntity.setCo_telephone(arr.get(18));
2728 // 收货人代码 2877 // 收货人代码
2729 - seconday.setCnecusid(arr.get(19)); 2878 + manifestEntity.setCnecusid(arr.get(19));
2730 // 收货人公司 2879 // 收货人公司
2731 - seconday.setSh_company(arr.get(20)); 2880 + manifestEntity.setSh_company(arr.get(20));
2732 // 收货人地址 2881 // 收货人地址
2733 - seconday.setSh_address(arr.get(21)); 2882 + manifestEntity.setSh_address(arr.get(21));
2734 // 收货人城市 2883 // 收货人城市
2735 - seconday.setSh_city(arr.get(22)); 2884 + manifestEntity.setSh_city(arr.get(22));
2736 // 收货人国家代码 2885 // 收货人国家代码
2737 - seconday.setSh_country(arr.get(23)); 2886 + manifestEntity.setSh_country(arr.get(23));
2738 // 收货人传真 2887 // 收货人传真
2739 - seconday.setSh_fax(arr.get(24)); 2888 + manifestEntity.setSh_fax(arr.get(24));
2740 // 收货人联系号码 2889 // 收货人联系号码
2741 - seconday.setSh_telephone(arr.get(25));  
2742 - 2890 + manifestEntity.setSh_telephone(arr.get(25));
2743 // 货物海关状态代码 2891 // 货物海关状态代码
2744 - seconday.setCustomsstatus(arr.get(26));  
2745 - seconday.setCreateDate(new Date());  
2746 - preparesecondaryServer.save(seconday);  
2747 - model.setStatus(200);  
2748 - } else { 2892 + manifestEntity.setCustomsstatus(arr.get(26));
  2893 + // 安检申报
  2894 + if (StringUtils.isNotBlank(arr.get(27)) && StringUtils.isNotBlank(arr.get(28)) && StringUtils.isNotBlank(arr.get(29))
  2895 + && StringUtils.isNotBlank(arr.get(32)) && StringUtils.isNotBlank(arr.get(33))){
  2896 + SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
  2897 + sd.setSd_waybill(wbm);
  2898 + // 航空货物托运人名称
  2899 + sd.setSd_cargo_shipper_name(arr.get(27));
  2900 + // 航空货物销售代理人名称
  2901 + sd.setSd_cargo_agent_name(arr.get(28));
  2902 + // 航协资质编号
  2903 + if (!StringUtils.isBlank(arr.get(29))) {
  2904 + sd.setSd_iata_number(arr.get(29));
  2905 + }
  2906 + sd.setSd_static("1");
  2907 + // 发布时间
  2908 + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2909 + String format = simpleDateFormat2.format(new Date());
  2910 + sd.setOperation_time(format);
  2911 + // 运输条件鉴定书
  2912 + if (!StringUtils.isBlank(arr.get(30))) {
  2913 + String certificate = arr.get(30);
  2914 + if (certificate != null) {
  2915 + String s2 = certificate.replaceAll(",", ",");
  2916 + sd.setSd_transport_certificate(s2);
  2917 + }
  2918 + }
  2919 + // 航空公司同意运输证明
  2920 + if (!StringUtils.isBlank(arr.get(31))) {
  2921 +
  2922 + String prove = arr.get(31);
  2923 + if (prove != null) {
  2924 + String s2 = prove.replaceAll(",", ",");
  2925 + sd.setSd_transportation_prove(s2);
  2926 + }
  2927 + }
  2928 + // 用户ID
  2929 + sd.setUSER_ID(userId);
  2930 + // 航空货物性质
  2931 + SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
  2932 + sdCargoTypeEntity.setSd_waybill(wbm);
  2933 + sdCargoTypeEntity.setSd_cargo_type(arr.get(32));
  2934 + sdCargoTypeService.save(sdCargoTypeEntity);
  2935 + // 航空货物品名
  2936 + String replace = arr.get(33).replace(",", ",");
  2937 +
  2938 + String[] cargoName = replace.split(",");
  2939 + for (int i = 0; i < cargoName.length; i++) {
  2940 + SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
  2941 + sdCargoNameEntity.setSd_waybill(wbm);
  2942 + sdCargoNameEntity.setSd_cargo_name(cargoName[i]);
  2943 + sdCargoNameService.save(sdCargoNameEntity);
  2944 + }
  2945 + securityDeclarationService.save(sd);
  2946 + }
  2947 + manifestService.save(manifestEntity);
  2948 + }else {
2749 model.setStatus(201); 2949 model.setStatus(201);
2750 - model.setMsg(waybill + "分单号已存在");  
2751 - break; 2950 + model.setMsg(wbm1.getWaybillnomaster() + "单号已存在");
  2951 + return model;
  2952 + }
  2953 + }else {
  2954 + ManifestEntity wbm1 = manifestService.findWbm(wbm);
  2955 + if(wbm1 == null){
  2956 + model.setStatus(202);
  2957 + model.setMsg(wbm+"请先添加主单号");
  2958 + return model;
  2959 + }else {
  2960 + if (preparesecondaryServer.findWaybill(arr.get(2))==0) {
  2961 + PreparesecondaryEntity seconday = new PreparesecondaryEntity();
  2962 + seconday.setPreparemasterid(wbm1.getId());
  2963 + // 主单号
  2964 + seconday.setWaybillnomaster(wbm);
  2965 + // 分单号
  2966 + seconday.setWaybillnosecondary(arr.get(2));
  2967 + // 航班号
  2968 + seconday.setFlightno(arr.get(3).substring(2));
  2969 + // 航班日期
  2970 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
  2971 + String s = arr.get(4);
  2972 + Date parse = simpleDateFormat.parse(s);
  2973 + seconday.setFlightdate(parse);
  2974 + // 承运人代码
  2975 + seconday.setCarrier(arr.get(3).substring(0, 2));
  2976 + // 运费支付方式
  2977 + seconday.setPaymode(arr.get(5));
  2978 + // 装货地代码
  2979 + seconday.setOriginatingstation(arr.get(6));
  2980 + // 卸货地代码
  2981 + seconday.setDestinationstation(arr.get(7));
  2982 + // 货物装载运输时间
  2983 + SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");
  2984 + seconday.setStowagedate(simpleDateFormat1.parse(arr.get(8)));
  2985 + // 海关关区代码
  2986 + seconday.setCustomscode(arr.get(9));
  2987 + // 货物件数
  2988 + seconday.setTotalpiece(arr.get(10));
  2989 + // 货物毛重
  2990 + seconday.setTotalweight(arr.get(11));
  2991 + // 货物简要描述
  2992 + seconday.setProductname(arr.get(12));
  2993 + // 发货人代码
  2994 + seconday.setShpcusid(arr.get(13));
  2995 + // 发货人公司
  2996 + seconday.setCo_company(arr.get(14));
  2997 + // 发货人地址
  2998 + seconday.setCo_address(arr.get(15));
  2999 + // 发货人国家代码
  3000 + seconday.setSh_country(arr.get(16));
  3001 + // 发货人传真
  3002 + seconday.setSh_fax(arr.get(17));
  3003 + // 发货人联系号码
  3004 + seconday.setCo_telephone(arr.get(18));
  3005 + // 收货人代码
  3006 + seconday.setCnecusid(arr.get(19));
  3007 + // 收货人公司
  3008 + seconday.setSh_company(arr.get(20));
  3009 + // 收货人地址
  3010 + seconday.setSh_address(arr.get(21));
  3011 + // 收货人城市
  3012 + seconday.setSh_city(arr.get(22));
  3013 + // 收货人国家代码
  3014 + seconday.setSh_country(arr.get(23));
  3015 + // 收货人传真
  3016 + seconday.setSh_fax(arr.get(24));
  3017 + // 收货人联系号码
  3018 + seconday.setSh_telephone(arr.get(25));
  3019 + // 货物海关状态代码
  3020 + seconday.setCustomsstatus(arr.get(26));
  3021 + seconday.setCreateDate(new Date());
  3022 + preparesecondaryServer.save(seconday);
  3023 + } else {
  3024 + model.setStatus(201);
  3025 + model.setMsg(arr.get(2) + "分单号已存在");
  3026 + return model;
  3027 + }
2752 } 3028 }
2753 } 3029 }
2754 - }  
2755 - }else {  
2756 - break;  
2757 - }  
2758 - } 3030 + }else {
  3031 + model.setStatus(301);
  3032 + model.setMsg(wbm+"不符合模七校验");
  3033 + return model;
  3034 + }
  3035 + }else {
  3036 +
  3037 + model.setStatus(300);
  3038 + model.setMsg("主单号格式有误");
  3039 + return model;
  3040 + }
  3041 + }
  3042 + model.setStatus(200);
2759 return model; 3043 return model;
2760 - } catch (Exception e) { 3044 + } catch (Exception e) {
2761 model.setStatus(500); 3045 model.setStatus(500);
2762 - model.setMsg("网络异常"); 3046 + model.setMsg(e.getMessage());
2763 e.printStackTrace(); 3047 e.printStackTrace();
2764 } 3048 }
2765 - return model; 3049 + return model;
2766 } 3050 }
2767 3051
2768 -  
2769 } 3052 }
@@ -44,8 +44,8 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{ @@ -44,8 +44,8 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{
44 @Query(value = "DELETE FROM PREPARESECONDARY WHERE PREPAREMASTERID = ?1", nativeQuery = true) 44 @Query(value = "DELETE FROM PREPARESECONDARY WHERE PREPAREMASTERID = ?1", nativeQuery = true)
45 void deleteSub(Long id); 45 void deleteSub(Long id);
46 46
47 - @Query(value = "SELECT WAYBILLNOSECONDARY FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1", nativeQuery = true)  
48 - String findWaybill(String wbm); 47 + @Query(value = "SELECT count(*) FROM PREPARESECONDARY WHERE WAYBILLNOSECONDARY = ?1", nativeQuery = true)
  48 + int findWaybill(String wbm);
49 49
50 @Query(value = "select count(id) from PREPARESECONDARY where WAYBILLNOMASTER = ?1 and WAYBILLNOSECONDARY=?2", nativeQuery = true) 50 @Query(value = "select count(id) from PREPARESECONDARY where WAYBILLNOMASTER = ?1 and WAYBILLNOSECONDARY=?2", nativeQuery = true)
51 int findAwbAwbH(String awb, String awbh); 51 int findAwbAwbH(String awb, String awbh);
@@ -7,6 +7,8 @@ import org.springframework.data.jpa.repository.Query; @@ -7,6 +7,8 @@ import org.springframework.data.jpa.repository.Query;
7 import org.springframework.data.repository.PagingAndSortingRepository; 7 import org.springframework.data.repository.PagingAndSortingRepository;
8 import org.springframework.transaction.annotation.Transactional; 8 import org.springframework.transaction.annotation.Transactional;
9 9
  10 +import java.util.List;
  11 +
10 /** 12 /**
11 * @Auther: shenhl 13 * @Auther: shenhl
12 * @Date: 2019/4/24 16:38 14 * @Date: 2019/4/24 16:38
@@ -25,6 +27,6 @@ public interface SecurityDeclarationRepository extends PagingAndSortingRepositor @@ -25,6 +27,6 @@ public interface SecurityDeclarationRepository extends PagingAndSortingRepositor
25 int findWaybill(String waybill); 27 int findWaybill(String waybill);
26 28
27 @Query(value = "select * from SECURITY_DECLARATION where SD_WAYBILL = ?1", nativeQuery = true) 29 @Query(value = "select * from SECURITY_DECLARATION where SD_WAYBILL = ?1", nativeQuery = true)
28 - SecurityDeclarationEntity waybill(String waybill); 30 + List<SecurityDeclarationEntity> waybill(String waybill);
29 31
30 } 32 }
@@ -225,9 +225,13 @@ public class ManifestService extends BasicService<ManifestEntity> { @@ -225,9 +225,13 @@ public class ManifestService extends BasicService<ManifestEntity> {
225 manifestEntity.setId(Long.valueOf(id)); 225 manifestEntity.setId(Long.valueOf(id));
226 manifestRepository.delete(manifestEntity); 226 manifestRepository.delete(manifestEntity);
227 //查看是否有安检申报 存在删除 227 //查看是否有安检申报 存在删除
228 - SecurityDeclarationEntity waybill1 = securityDeclarationRepository.waybill(waybillnomaster); 228 + List<SecurityDeclarationEntity> waybill1 = securityDeclarationRepository.waybill(waybillnomaster);
229 if (waybill1 != null){ 229 if (waybill1 != null){
230 - securityDeclarationRepository.delete(waybill1.getId()); 230 +
  231 + for (SecurityDeclarationEntity securityDeclarationEntity: waybill1){
  232 +
  233 + securityDeclarationRepository.delete(securityDeclarationEntity.getId());
  234 + }
231 } 235 }
232 236
233 sdCargoNameRepository.deletes(waybillnomaster); 237 sdCargoNameRepository.deletes(waybillnomaster);
@@ -96,9 +96,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity @@ -96,9 +96,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity
96 return preparesecondaryRepository.queryByUserId(user_id); 96 return preparesecondaryRepository.queryByUserId(user_id);
97 } 97 }
98 98
99 - public String findWaybill(String wbm){ 99 + public int findWaybill(String wbm){
  100 + int waybill = preparesecondaryRepository.findWaybill(wbm);
100 101
101 - return preparesecondaryRepository.findWaybill(wbm); 102 + return waybill;
102 } 103 }
103 104
104 105
  1 +package com.agent.util;
  2 +
  3 +public class WaybillUtils {
  4 +
  5 +
  6 + // 主单添加 - 符号
  7 + public String awb(String waybill){
  8 + String awb = "";
  9 + if (waybill.contains("-")) {
  10 + awb = waybill;
  11 + } else {
  12 + String s1 = waybill;
  13 + String substring = s1.substring(0, 3);
  14 + String substring1 = s1.substring(3);
  15 + awb = substring + "-" + substring1;
  16 + }
  17 + return awb;
  18 + }
  19 +
  20 + // 判断是否符合模七校验
  21 + public boolean checkout(String waybill){
  22 +
  23 + String[] split = waybill.split("-");
  24 +
  25 + int number = Integer.parseInt(split[1]);
  26 +
  27 + int start = number/10;
  28 +
  29 + int remainder = start % 7;
  30 +
  31 + int last = number % 10;
  32 +
  33 + if (remainder!=last){
  34 + return false;
  35 + }else {
  36 + return true;
  37 + }
  38 +
  39 + }
  40 +
  41 +}
@@ -86,8 +86,12 @@ @@ -86,8 +86,12 @@
86 alert(data.msg); 86 alert(data.msg);
87 }else if(data.status == 202){ 87 }else if(data.status == 202){
88 alert(data.msg); 88 alert(data.msg);
  89 + }else if (data.status == 300){
  90 + alert(data.msg);
  91 + }else if (data.status == 301){
  92 + alert(data.msg);
89 }else { 93 }else {
90 - alert("网络异常"); 94 + alert(data.msg);
91 } 95 }
92 } 96 }
93 }); 97 });
@@ -238,8 +238,8 @@ @@ -238,8 +238,8 @@
238 } 238 }
239 //主单撤销按钮 239 //主单撤销按钮
240 function operatorFormat(val, row, index){ 240 function operatorFormat(val, row, index){
241 - var html = "<a href='javascript:void(0)' onclick='backout("+row.id+")' style='text-decoration:none;color:blue;'><spring:message code='opt.backout'/></a>";  
242 - html+="<a href='javascript:void(0)' onclick='openReceipt(\""+row.waybillnomaster+"\")' style='text-decoration:none;color:blue;margin-left:20px;'><spring:message code='opt.open.receipt'/></a>"; 241 + <%--var html = "<a href='javascript:void(0)' onclick='backout("+row.id+")' style='text-decoration:none;color:blue;'><spring:message code='opt.backout'/></a>";--%>
  242 + var html ="<a href='javascript:void(0)' onclick='openReceipt(\""+row.waybillnomaster+"\")' style='text-decoration:none;color:blue;margin-left:20px;'><spring:message code='opt.open.receipt'/></a>";
243 html+="<a href='javascript:void(0)' onclick='security(\""+row.waybillnomaster+"\")' style='text-decoration:none;color:blue;margin-left:20px;'>添加安检申报</a>" 243 html+="<a href='javascript:void(0)' onclick='security(\""+row.waybillnomaster+"\")' style='text-decoration:none;color:blue;margin-left:20px;'>添加安检申报</a>"
244 return html; 244 return html;
245 } 245 }