Bladeren bron

凯和公司端上传修改

lazhaoqian 4 jaren geleden
bovenliggende
commit
6ab0650322

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TCntrnoController.java

@@ -217,7 +217,7 @@ public class TCntrnoController extends BaseController
      * 导入【箱信息】Excel
      */
     @PreAuthorize("@ss.hasPermi('shipping:cntrno:import')")
-    @Log(title = "导入集装箱动态", businessType = BusinessType.IMPORT)
+    //@Log(title = "导入集装箱动态", businessType = BusinessType.IMPORT)
     @PostMapping(value = "/importCreate")
     public AjaxResult importCreateCompanyMsg(@RequestParam("file") MultipartFile file)throws Exception
     {

+ 17 - 7
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java

@@ -329,13 +329,17 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                 TCntrnoExcel companyMsg = new TCntrnoExcel();
                 for (int a = 0; a < rows.getPhysicalNumberOfCells(); a++) {
                     Cell cell = rows.getCell(a);
+                    if (cell == null){
+                        continue;
+                    }
                     String value = filter(sheet.getRow(0), CellReference.convertNumToColString(cell.getColumnIndex()));
                     switch (value) {
                         case "箱号":
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱号");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱号");*/
+                                break;
                             }
                             companyMsg.setfNo(cell.getStringCellValue());
                             break;
@@ -343,7 +347,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "箱类型");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "箱类型");*/
+                                break;
                             }
                             companyMsg.setTypeidName(cell.getStringCellValue());
                             if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
@@ -355,7 +360,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少最新地点");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少最新地点");*/
+                                break;
                             }
                             companyMsg.setAddressName((cell.getStringCellValue()));
                             break;
@@ -363,7 +369,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少货名");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少货名");*/
+                                break;
                             }
                             companyMsg.setOwnerName(cell.getStringCellValue());
                             if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
@@ -377,7 +384,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱状态");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱状态");*/
+                                break;
                             }
                             companyMsg.setCntrstatusName(cell.getStringCellValue());
                             if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
@@ -391,7 +399,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱型");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少箱型");*/
+                                break;
                             }
                             companyMsg.setUpdateEFName(cell.getStringCellValue());
                             if (StringUtils.isNotEmpty(cell.getStringCellValue())) {
@@ -405,7 +414,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
-                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少地点类型");
+                                /*return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少地点类型");*/
+                                break;
                             }
                             companyMsg.setAddressType(cell.getStringCellValue());
                             if (StringUtils.isNotEmpty(cell.getStringCellValue())) {