Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

Administrator 4 yıl önce
ebeveyn
işleme
75c9a57cd9
27 değiştirilmiş dosya ile 580 ekleme ve 1 silme
  1. 14 0
      mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/controller/TResStationfireController.java
  2. 3 0
      mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/domain/TResStationfire.java
  3. 9 0
      mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/service/ITResStationfireService.java
  4. 53 0
      mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/service/impl/TResStationfireServiceImpl.java
  5. 13 0
      mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/controller/TResStationforestController.java
  6. 3 0
      mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/domain/TResStationforest.java
  7. 9 0
      mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/service/ITResStationforestService.java
  8. 55 0
      mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/service/impl/TResStationforestServiceImpl.java
  9. 13 0
      mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/controller/TResStationlandController.java
  10. 3 0
      mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/domain/TResStationland.java
  11. 10 0
      mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/service/ITResStationlandService.java
  12. 53 0
      mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/service/impl/TResStationlandServiceImpl.java
  13. 13 0
      mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/controller/TResStationteamController.java
  14. 3 0
      mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/domain/TResStationteam.java
  15. 9 0
      mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/service/ITResStationteamService.java
  16. 53 0
      mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/service/impl/TResStationteamServiceImpl.java
  17. 13 0
      mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/controller/TResStationweatherController.java
  18. 3 0
      mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/domain/TResStationweather.java
  19. 9 0
      mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/service/ITResStationweatherService.java
  20. 53 0
      mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/service/impl/TResStationweatherServiceImpl.java
  21. 10 0
      mybusiness/src/main/resources/templates/business/manager/forestdevicemanager/index.html
  22. 35 0
      mybusiness/src/main/resources/templates/business/manager/stationfiremanager/index.html
  23. 1 1
      mybusiness/src/main/resources/templates/business/manager/stationforestmanager/edit.html
  24. 35 0
      mybusiness/src/main/resources/templates/business/manager/stationforestmanager/index.html
  25. 35 0
      mybusiness/src/main/resources/templates/business/manager/stationlandmanager/index.html
  26. 35 0
      mybusiness/src/main/resources/templates/business/manager/stationteammanager/index.html
  27. 35 0
      mybusiness/src/main/resources/templates/business/manager/stationweathermanager/index.html

+ 14 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/controller/TResStationfireController.java

@@ -3,6 +3,7 @@ package com.business.slfh.manager.stationfiremanager.controller;
 import java.util.List;
 import java.util.List;
 
 
 import com.business.slfh.manager.carmanager.domain.TResCar;
 import com.business.slfh.manager.carmanager.domain.TResCar;
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationfiremanager.service.ITResStationfireService;
 import com.business.slfh.manager.stationfiremanager.service.ITResStationfireService;
 import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UUID_Tools;
@@ -35,6 +36,7 @@ import javax.annotation.Resource;
 @RequestMapping("/business/manager/stationfiremanager")
 @RequestMapping("/business/manager/stationfiremanager")
 public class TResStationfireController extends BaseController
 public class TResStationfireController extends BaseController
 {
 {
+
     private String prefix = "business/manager/stationfiremanager";
     private String prefix = "business/manager/stationfiremanager";
 
 
     @Resource
     @Resource
@@ -65,6 +67,18 @@ public class TResStationfireController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】列表
+     */
+    //@RequiresPermissions("system:stationfire:export")
+    //@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/importExcel")
+    @ResponseBody
+    public AjaxResult importExcel(TResStationfire tResStationfire)
+    {
+        return tResStationfireService.importExcel(tResStationfire);
+    }
+
+    /**
      * 导出【请填写功能名称】列表
      * 导出【请填写功能名称】列表
      */
      */
     //@RequiresPermissions("system:stationfire:export")
     //@RequiresPermissions("system:stationfire:export")

+ 3 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/domain/TResStationfire.java

@@ -21,6 +21,9 @@ public class TResStationfire extends BaseEntity
 {
 {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    //导入功能参数字段
+    private String filename;
+
     /** $column.columnComment */
     /** $column.columnComment */
     private String id;
     private String id;
 
 

+ 9 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/service/ITResStationfireService.java

@@ -1,6 +1,7 @@
 package com.business.slfh.manager.stationfiremanager.service;
 package com.business.slfh.manager.stationfiremanager.service;
 
 
 import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
+import com.sooka.common.core.domain.AjaxResult;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -37,6 +38,14 @@ public interface ITResStationfireService
     public int insertTResStationfire(TResStationfire tResStationfire);
     public int insertTResStationfire(TResStationfire tResStationfire);
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationfire 【请填写功能名称】
+     * @return 结果
+     */
+    public AjaxResult importExcel(TResStationfire tResStationfire);
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationfire 【请填写功能名称】
      * @param tResStationfire 【请填写功能名称】

+ 53 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/service/impl/TResStationfireServiceImpl.java

@@ -2,11 +2,15 @@ package com.business.slfh.manager.stationfiremanager.service.impl;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationfiremanager.mapper.TResStationfireMapper;
 import com.business.slfh.manager.stationfiremanager.mapper.TResStationfireMapper;
 import com.business.slfh.manager.stationfiremanager.service.ITResStationfireService;
 import com.business.slfh.manager.stationfiremanager.service.ITResStationfireService;
+import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
+import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UserInfoUtil;
 import com.business.slfh.tools.UserInfoUtil;
 import com.sooka.common.annotation.DataScope;
 import com.sooka.common.annotation.DataScope;
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.system.domain.SysUser;
 import com.sooka.system.domain.SysUser;
@@ -72,6 +76,55 @@ public class TResStationfireServiceImpl implements ITResStationfireService
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationfire 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public AjaxResult importExcel(TResStationfire tResStationfire)
+    {
+        int lsSize;//导入数据条数
+        int breakLine = 0;//此处数不完整
+        try{
+            System.out.println("importExcel Controller");
+            System.out.println(tResStationfire.getFilename()+"=filename");
+            List<String[]> ls = com.business.slfh.tools.ExcelUtil.readExcel(tResStationfire.getFilename(),"Sheet1");//filename,sheetname
+            final int num = 6;
+            boolean isLengthLegal = true;
+            for (int i = 0; i < ls.size(); i++) {//检查每行数据长度一致性
+                String[] row = ls.get(i);
+                if(num != row.length){
+                    isLengthLegal = false;
+                    breakLine = i + 1;//此行数据不完整 行数按照数据所在行号计算
+                    break;
+                }
+            }
+            if(isLengthLegal){
+                lsSize = ls.size();
+                for (int i = 1; i < ls.size(); i++) {
+                    String[] row = ls.get(i);
+                    TResStationfire tResStationfireInsert = new TResStationfire();
+                    tResStationfireInsert.setId(UUID_Tools.getUUID());
+                    tResStationfireInsert.setName(row[0]);//名称
+                    tResStationfireInsert.setLongitude(row[1]);//经度
+                    tResStationfireInsert.setLatitude(row[2]);//纬度
+                    tResStationfireInsert.setAddress(row[3]);//地址
+                    tResStationfireInsert.setContactUser(row[4]);//联系人
+                    tResStationfireInsert.setContactPhone(row[5]);//电话
+                    tResStationfireMapper.insertTResStationfire(tResStationfireInsert);
+                }
+                return AjaxResult.success(lsSize+"条数据导入成功!");
+            }else {
+                return AjaxResult.error("请检查,第"+breakLine+"行数据不完整!");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return AjaxResult.error("导入失败,请稍后尝试!");
+        }
+    }
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationfire 【请填写功能名称】
      * @param tResStationfire 【请填写功能名称】

+ 13 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/controller/TResStationforestController.java

@@ -2,6 +2,7 @@ package com.business.slfh.manager.stationforestmanager.controller;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationforestmanager.domain.TResStationforest;
 import com.business.slfh.manager.stationforestmanager.domain.TResStationforest;
 import com.business.slfh.manager.stationforestmanager.service.ITResStationforestService;
 import com.business.slfh.manager.stationforestmanager.service.ITResStationforestService;
 import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UUID_Tools;
@@ -57,6 +58,18 @@ public class TResStationforestController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】列表
+     */
+    //@RequiresPermissions("system:stationforest:export")
+    //@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/importExcel")
+    @ResponseBody
+    public AjaxResult importExcel(TResStationforest tResStationforest)
+    {
+        return tResStationforestService.importExcel(tResStationforest);
+    }
+
+    /**
      * 导出【请填写功能名称】列表
      * 导出【请填写功能名称】列表
      */
      */
     //@RequiresPermissions("system:stationforest:export")
     //@RequiresPermissions("system:stationforest:export")

+ 3 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/domain/TResStationforest.java

@@ -22,6 +22,9 @@ public class TResStationforest extends BaseEntity
 {
 {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    //导入功能参数字段
+    private String filename;
+
     private String forestType;//森林类型(1林业局 2林场)
     private String forestType;//森林类型(1林业局 2林场)
 
 
     /** $column.columnComment */
     /** $column.columnComment */

+ 9 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/service/ITResStationforestService.java

@@ -1,6 +1,7 @@
 package com.business.slfh.manager.stationforestmanager.service;
 package com.business.slfh.manager.stationforestmanager.service;
 
 
 import com.business.slfh.manager.stationforestmanager.domain.TResStationforest;
 import com.business.slfh.manager.stationforestmanager.domain.TResStationforest;
+import com.sooka.common.core.domain.AjaxResult;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -37,6 +38,14 @@ public interface ITResStationforestService
     public int insertTResStationforest(TResStationforest tResStationforest);
     public int insertTResStationforest(TResStationforest tResStationforest);
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationforest 【请填写功能名称】
+     * @return 结果
+     */
+    public AjaxResult importExcel(TResStationforest tResStationforest);
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationforest 【请填写功能名称】
      * @param tResStationforest 【请填写功能名称】

+ 55 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationforestmanager/service/impl/TResStationforestServiceImpl.java

@@ -2,10 +2,14 @@ package com.business.slfh.manager.stationforestmanager.service.impl;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
+import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationforestmanager.domain.TResStationforest;
 import com.business.slfh.manager.stationforestmanager.domain.TResStationforest;
 import com.business.slfh.manager.stationforestmanager.mapper.TResStationforestMapper;
 import com.business.slfh.manager.stationforestmanager.mapper.TResStationforestMapper;
+import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UserInfoUtil;
 import com.business.slfh.tools.UserInfoUtil;
 import com.sooka.common.annotation.DataScope;
 import com.sooka.common.annotation.DataScope;
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.system.domain.SysUser;
 import com.sooka.system.domain.SysUser;
@@ -72,6 +76,57 @@ public class TResStationforestServiceImpl implements ITResStationforestService
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationforest 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public AjaxResult importExcel(TResStationforest tResStationforest)
+    {
+        int lsSize;//导入数据条数
+        int breakLine = 0;//此处数不完整
+        try{
+            System.out.println("importExcel Controller");
+            System.out.println(tResStationforest.getFilename()+"=filename");
+            List<String[]> ls = com.business.slfh.tools.ExcelUtil.readExcel(tResStationforest.getFilename(),"Sheet1");//filename,sheetname
+            final int num = 7;
+            boolean isLengthLegal = true;
+            for (int i = 0; i < ls.size(); i++) {//检查每行数据长度一致性
+                String[] row = ls.get(i);
+                if(num != row.length){
+                    isLengthLegal = false;
+                    breakLine = i + 1;//此行数据不完整 行数按照数据所在行号计算
+                    break;
+                }
+            }
+            if(isLengthLegal){
+                lsSize = ls.size();
+                for (int i = 1; i < ls.size(); i++) {
+                    String[] row = ls.get(i);
+                    TResStationforest tResStationforestInsert = new TResStationforest();
+                    tResStationforestInsert.setId(UUID_Tools.getUUID());
+                    tResStationforestInsert.setName(row[0]);//名称
+                    String forestType = row[1].equals("1")?"林业局":row[1].equals("2")?"林场":"";
+                    tResStationforestInsert.setForestType(forestType);//森林类型 //1林业局 2林场
+                    tResStationforestInsert.setLongitude(row[2]);//经度
+                    tResStationforestInsert.setLatitude(row[3]);//纬度
+                    tResStationforestInsert.setAddress(row[4]);//地址
+                    tResStationforestInsert.setContactUser(row[5]);//联系人
+                    tResStationforestInsert.setContactPhone(row[6]);//电话
+                    tResStationforestMapper.insertTResStationforest(tResStationforestInsert);
+                }
+                return AjaxResult.success(lsSize+"条数据导入成功!");
+            }else {
+                return AjaxResult.error("请检查,第"+breakLine+"行数据不完整!");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return AjaxResult.error("导入失败,请稍后尝试!");
+        }
+    }
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationforest 【请填写功能名称】
      * @param tResStationforest 【请填写功能名称】

+ 13 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/controller/TResStationlandController.java

@@ -2,6 +2,7 @@ package com.business.slfh.manager.stationlandmanager.controller;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
 import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
 import com.business.slfh.manager.stationlandmanager.service.ITResStationlandService;
 import com.business.slfh.manager.stationlandmanager.service.ITResStationlandService;
 import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UUID_Tools;
@@ -57,6 +58,18 @@ public class TResStationlandController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】列表
+     */
+    //@RequiresPermissions("system:stationland:export")
+    //@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/importExcel")
+    @ResponseBody
+    public AjaxResult importExcel(TResStationland tResStationland)
+    {
+        return tResStationlandService.importExcel(tResStationland);
+    }
+
+    /**
      * 导出【请填写功能名称】列表
      * 导出【请填写功能名称】列表
      */
      */
     //@RequiresPermissions("system:stationland:export")
     //@RequiresPermissions("system:stationland:export")

+ 3 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/domain/TResStationland.java

@@ -21,6 +21,9 @@ public class TResStationland extends BaseEntity
 {
 {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    //导入功能参数字段
+    private String filename;
+
     /** $column.columnComment */
     /** $column.columnComment */
     private String id;
     private String id;
 
 

+ 10 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/service/ITResStationlandService.java

@@ -1,6 +1,8 @@
 package com.business.slfh.manager.stationlandmanager.service;
 package com.business.slfh.manager.stationlandmanager.service;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
 import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
+import com.sooka.common.core.domain.AjaxResult;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -29,6 +31,14 @@ public interface ITResStationlandService
     public List<TResStationland> selectTResStationlandList(TResStationland tResStationland);
     public List<TResStationland> selectTResStationlandList(TResStationland tResStationland);
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationland 【请填写功能名称】
+     * @return 结果
+     */
+    public AjaxResult importExcel(TResStationland tResStationland);
+
+    /**
      * 新增【请填写功能名称】
      * 新增【请填写功能名称】
      * 
      * 
      * @param tResStationland 【请填写功能名称】
      * @param tResStationland 【请填写功能名称】

+ 53 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationlandmanager/service/impl/TResStationlandServiceImpl.java

@@ -1,12 +1,16 @@
 package com.business.slfh.manager.stationlandmanager.service.impl;
 package com.business.slfh.manager.stationlandmanager.service.impl;
 
 
+import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
 import com.business.slfh.manager.stationlandmanager.domain.TResStationland;
 import com.business.slfh.manager.stationlandmanager.mapper.TResStationlandMapper;
 import com.business.slfh.manager.stationlandmanager.mapper.TResStationlandMapper;
 import com.business.slfh.manager.stationlandmanager.service.ITResStationlandService;
 import com.business.slfh.manager.stationlandmanager.service.ITResStationlandService;
+import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UserInfoUtil;
 import com.business.slfh.tools.UserInfoUtil;
 import com.sooka.common.annotation.DataScope;
 import com.sooka.common.annotation.DataScope;
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.system.domain.SysUser;
 import com.sooka.system.domain.SysUser;
@@ -72,6 +76,55 @@ public class TResStationlandServiceImpl implements ITResStationlandService
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationland 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public AjaxResult importExcel(TResStationland tResStationland)
+    {
+        int lsSize;//导入数据条数
+        int breakLine = 0;//此处数不完整
+        try{
+            System.out.println("importExcel Controller");
+            System.out.println(tResStationland.getFilename()+"=filename");
+            List<String[]> ls = com.business.slfh.tools.ExcelUtil.readExcel(tResStationland.getFilename(),"Sheet1");//filename,sheetname
+            final int num = 6;
+            boolean isLengthLegal = true;
+            for (int i = 0; i < ls.size(); i++) {//检查每行数据长度一致性
+                String[] row = ls.get(i);
+                if(num != row.length){
+                    isLengthLegal = false;
+                    breakLine = i + 1;//此行数据不完整 行数按照数据所在行号计算
+                    break;
+                }
+            }
+            if(isLengthLegal){
+                lsSize = ls.size();
+                for (int i = 1; i < ls.size(); i++) {
+                    String[] row = ls.get(i);
+                    TResStationland tResStationlandInsert = new TResStationland();
+                    tResStationlandInsert.setId(UUID_Tools.getUUID());
+                    tResStationlandInsert.setName(row[0]);//名称
+                    tResStationlandInsert.setLongitude(row[1]);//经度
+                    tResStationlandInsert.setLatitude(row[2]);//纬度
+                    tResStationlandInsert.setAddress(row[3]);//地址
+                    tResStationlandInsert.setContactUser(row[4]);//联系人
+                    tResStationlandInsert.setContactPhone(row[5]);//电话
+                    tResStationlandMapper.insertTResStationland(tResStationlandInsert);
+                }
+                return AjaxResult.success(lsSize+"条数据导入成功!");
+            }else {
+                return AjaxResult.error("请检查,第"+breakLine+"行数据不完整!");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return AjaxResult.error("导入失败,请稍后尝试!");
+        }
+    }
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationland 【请填写功能名称】
      * @param tResStationland 【请填写功能名称】

+ 13 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/controller/TResStationteamController.java

@@ -2,6 +2,7 @@ package com.business.slfh.manager.stationteammanager.controller;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
 import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
 import com.business.slfh.manager.stationteammanager.service.ITResStationteamService;
 import com.business.slfh.manager.stationteammanager.service.ITResStationteamService;
 import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UUID_Tools;
@@ -57,6 +58,18 @@ public class TResStationteamController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】列表
+     */
+    //@RequiresPermissions("system:stationteam:export")
+    //@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/importExcel")
+    @ResponseBody
+    public AjaxResult importExcel(TResStationteam tResStationteam)
+    {
+        return tResStationteamService.importExcel(tResStationteam);
+    }
+
+    /**
      * 导出【请填写功能名称】列表
      * 导出【请填写功能名称】列表
      */
      */
     //@RequiresPermissions("system:stationteam:export")
     //@RequiresPermissions("system:stationteam:export")

+ 3 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/domain/TResStationteam.java

@@ -21,6 +21,9 @@ public class TResStationteam extends BaseEntity
 {
 {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    //导入功能参数字段
+    private String filename;
+
     /** $column.columnComment */
     /** $column.columnComment */
     private String id;
     private String id;
 
 

+ 9 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/service/ITResStationteamService.java

@@ -1,6 +1,7 @@
 package com.business.slfh.manager.stationteammanager.service;
 package com.business.slfh.manager.stationteammanager.service;
 
 
 import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
 import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
+import com.sooka.common.core.domain.AjaxResult;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -37,6 +38,14 @@ public interface ITResStationteamService
     public int insertTResStationteam(TResStationteam tResStationteam);
     public int insertTResStationteam(TResStationteam tResStationteam);
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationteam 【请填写功能名称】
+     * @return 结果
+     */
+    public AjaxResult importExcel(TResStationteam tResStationteam);
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationteam 【请填写功能名称】
      * @param tResStationteam 【请填写功能名称】

+ 53 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationteammanager/service/impl/TResStationteamServiceImpl.java

@@ -2,10 +2,14 @@ package com.business.slfh.manager.stationteammanager.service.impl;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
+import com.business.slfh.manager.stationfiremanager.domain.TResStationfire;
 import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
 import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
 import com.business.slfh.manager.stationteammanager.mapper.TResStationteamMapper;
 import com.business.slfh.manager.stationteammanager.mapper.TResStationteamMapper;
+import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UserInfoUtil;
 import com.business.slfh.tools.UserInfoUtil;
 import com.sooka.common.annotation.DataScope;
 import com.sooka.common.annotation.DataScope;
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.system.domain.SysUser;
 import com.sooka.system.domain.SysUser;
@@ -72,6 +76,55 @@ public class TResStationteamServiceImpl implements ITResStationteamService
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationteam 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public AjaxResult importExcel(TResStationteam tResStationteam)
+    {
+        int lsSize;//导入数据条数
+        int breakLine = 0;//此处数不完整
+        try{
+            System.out.println("importExcel Controller");
+            System.out.println(tResStationteam.getFilename()+"=filename");
+            List<String[]> ls = com.business.slfh.tools.ExcelUtil.readExcel(tResStationteam.getFilename(),"Sheet1");//filename,sheetname
+            final int num = 6;
+            boolean isLengthLegal = true;
+            for (int i = 0; i < ls.size(); i++) {//检查每行数据长度一致性
+                String[] row = ls.get(i);
+                if(num != row.length){
+                    isLengthLegal = false;
+                    breakLine = i + 1;//此行数据不完整 行数按照数据所在行号计算
+                    break;
+                }
+            }
+            if(isLengthLegal){
+                lsSize = ls.size();
+                for (int i = 1; i < ls.size(); i++) {
+                    String[] row = ls.get(i);
+                    TResStationteam tResStationteamInsert = new TResStationteam();
+                    tResStationteamInsert.setId(UUID_Tools.getUUID());
+                    tResStationteamInsert.setName(row[0]);//名称
+                    tResStationteamInsert.setLongitude(row[1]);//经度
+                    tResStationteamInsert.setLatitude(row[2]);//纬度
+                    tResStationteamInsert.setAddress(row[3]);//地址
+                    tResStationteamInsert.setContactUser(row[4]);//联系人
+                    tResStationteamInsert.setContactPhone(row[5]);//电话
+                    tResStationteamMapper.insertTResStationteam(tResStationteamInsert);
+                }
+                return AjaxResult.success(lsSize+"条数据导入成功!");
+            }else {
+                return AjaxResult.error("请检查,第"+breakLine+"行数据不完整!");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return AjaxResult.error("导入失败,请稍后尝试!");
+        }
+    }
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationteam 【请填写功能名称】
      * @param tResStationteam 【请填写功能名称】

+ 13 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/controller/TResStationweatherController.java

@@ -2,6 +2,7 @@ package com.business.slfh.manager.stationweathermanager.controller;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
 import com.business.slfh.manager.stationweathermanager.domain.TResStationweather;
 import com.business.slfh.manager.stationweathermanager.domain.TResStationweather;
 import com.business.slfh.manager.stationweathermanager.service.ITResStationweatherService;
 import com.business.slfh.manager.stationweathermanager.service.ITResStationweatherService;
 import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UUID_Tools;
@@ -57,6 +58,18 @@ public class TResStationweatherController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】列表
+     */
+    //@RequiresPermissions("system:stationweather:export")
+    //@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/importExcel")
+    @ResponseBody
+    public AjaxResult importExcel(TResStationweather tResStationweather)
+    {
+        return tResStationweatherService.importExcel(tResStationweather);
+    }
+
+    /**
      * 导出【请填写功能名称】列表
      * 导出【请填写功能名称】列表
      */
      */
     //@RequiresPermissions("system:stationweather:export")
     //@RequiresPermissions("system:stationweather:export")

+ 3 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/domain/TResStationweather.java

@@ -21,6 +21,9 @@ public class TResStationweather extends BaseEntity
 {
 {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    //导入功能参数字段
+    private String filename;
+
     /** $column.columnComment */
     /** $column.columnComment */
     private String id;
     private String id;
 
 

+ 9 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/service/ITResStationweatherService.java

@@ -1,6 +1,7 @@
 package com.business.slfh.manager.stationweathermanager.service;
 package com.business.slfh.manager.stationweathermanager.service;
 
 
 import com.business.slfh.manager.stationweathermanager.domain.TResStationweather;
 import com.business.slfh.manager.stationweathermanager.domain.TResStationweather;
+import com.sooka.common.core.domain.AjaxResult;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -37,6 +38,14 @@ public interface ITResStationweatherService
     public int insertTResStationweather(TResStationweather tResStationweather);
     public int insertTResStationweather(TResStationweather tResStationweather);
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationweather 【请填写功能名称】
+     * @return 结果
+     */
+    public AjaxResult importExcel(TResStationweather tResStationweather);
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationweather 【请填写功能名称】
      * @param tResStationweather 【请填写功能名称】

+ 53 - 0
mybusiness/src/main/java/com/business/slfh/manager/stationweathermanager/service/impl/TResStationweatherServiceImpl.java

@@ -2,11 +2,15 @@ package com.business.slfh.manager.stationweathermanager.service.impl;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
+import com.business.slfh.manager.stationteammanager.domain.TResStationteam;
 import com.business.slfh.manager.stationweathermanager.domain.TResStationweather;
 import com.business.slfh.manager.stationweathermanager.domain.TResStationweather;
 import com.business.slfh.manager.stationweathermanager.mapper.TResStationweatherMapper;
 import com.business.slfh.manager.stationweathermanager.mapper.TResStationweatherMapper;
 import com.business.slfh.manager.stationweathermanager.service.ITResStationweatherService;
 import com.business.slfh.manager.stationweathermanager.service.ITResStationweatherService;
+import com.business.slfh.tools.UUID_Tools;
 import com.business.slfh.tools.UserInfoUtil;
 import com.business.slfh.tools.UserInfoUtil;
 import com.sooka.common.annotation.DataScope;
 import com.sooka.common.annotation.DataScope;
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.system.domain.SysUser;
 import com.sooka.system.domain.SysUser;
@@ -72,6 +76,55 @@ public class TResStationweatherServiceImpl implements ITResStationweatherService
     }
     }
 
 
     /**
     /**
+     * 导入【请填写功能名称】
+     *
+     * @param tResStationweather 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public AjaxResult importExcel(TResStationweather tResStationweather)
+    {
+        int lsSize;//导入数据条数
+        int breakLine = 0;//此处数不完整
+        try{
+            System.out.println("importExcel Controller");
+            System.out.println(tResStationweather.getFilename()+"=filename");
+            List<String[]> ls = com.business.slfh.tools.ExcelUtil.readExcel(tResStationweather.getFilename(),"Sheet1");//filename,sheetname
+            final int num = 6;
+            boolean isLengthLegal = true;
+            for (int i = 0; i < ls.size(); i++) {//检查每行数据长度一致性
+                String[] row = ls.get(i);
+                if(num != row.length){
+                    isLengthLegal = false;
+                    breakLine = i + 1;//此行数据不完整 行数按照数据所在行号计算
+                    break;
+                }
+            }
+            if(isLengthLegal){
+                lsSize = ls.size();
+                for (int i = 1; i < ls.size(); i++) {
+                    String[] row = ls.get(i);
+                    TResStationweather tResStationweatherInsert = new TResStationweather();
+                    tResStationweatherInsert.setId(UUID_Tools.getUUID());
+                    tResStationweatherInsert.setName(row[0]);//名称
+                    tResStationweatherInsert.setLongitude(row[1]);//经度
+                    tResStationweatherInsert.setLatitude(row[2]);//纬度
+                    tResStationweatherInsert.setAddress(row[3]);//地址
+                    tResStationweatherInsert.setContactUser(row[4]);//联系人
+                    tResStationweatherInsert.setContactPhone(row[5]);//电话
+                    tResStationweatherMapper.insertTResStationweather(tResStationweatherInsert);
+                }
+                return AjaxResult.success(lsSize+"条数据导入成功!");
+            }else {
+                return AjaxResult.error("请检查,第"+breakLine+"行数据不完整!");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return AjaxResult.error("导入失败,请稍后尝试!");
+        }
+    }
+
+    /**
      * 修改【请填写功能名称】
      * 修改【请填写功能名称】
      * 
      * 
      * @param tResStationweather 【请填写功能名称】
      * @param tResStationweather 【请填写功能名称】

+ 10 - 0
mybusiness/src/main/resources/templates/business/manager/forestdevicemanager/index.html

@@ -234,6 +234,15 @@
         }
         }
 
 
         function importExcel(filename) {
         function importExcel(filename) {
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+            if(!filename.endWith(".xls")){
+                $.modal.alert("请上传.xls文件!")
+                setTimeout("window.location.reload()",1000);
+                return;
+            }
             //alert(filename)
             //alert(filename)
             var obj = new Object();
             var obj = new Object();
             obj.filename = filename
             obj.filename = filename
@@ -249,6 +258,7 @@
                         setTimeout("window.location.reload()",1000);
                         setTimeout("window.location.reload()",1000);
                     }else {
                     }else {
                         $.modal.alert(e.msg)
                         $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
                     }
                     }
                 }
                 }
             });
             });

+ 35 - 0
mybusiness/src/main/resources/templates/business/manager/stationfiremanager/index.html

@@ -45,6 +45,10 @@
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationfire:remove">
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationfire:remove">
                     <i class="fa fa-remove"></i> 删除
                     <i class="fa fa-remove"></i> 删除
                 </a>
                 </a>
+                <input style="display: none" type="file" name="file" id="fileField" onchange="importExcel(document.getElementById('fileField').value)">
+                <a class="btn btn-warning" shiro:hasPermission="system:forestdevice:export" onclick="fileField.click()">
+                    <i class="fa fa-download"></i> 导入
+                </a>
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationfire:export">
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationfire:export">
                     <i class="fa fa-download"></i> 导出
                     <i class="fa fa-download"></i> 导出
                 </a>-->
                 </a>-->
@@ -120,6 +124,37 @@
             console.log($.modal)
             console.log($.modal)
             $.modal.open("查看【防火检查站管理】详情", url);
             $.modal.open("查看【防火检查站管理】详情", url);
         }
         }
+
+        function importExcel(filename) {
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+            if(!filename.endWith(".xls")){
+                $.modal.alert("请上传.xls文件!")
+                setTimeout("window.location.reload()",1000);
+                return;
+            }
+            //alert(filename)
+            var obj = new Object();
+            obj.filename = filename
+            $.ajax({
+                url : prefix + "/importExcel",
+                method : 'post',
+                data : obj,
+                success : function (e) {
+                    //console.log(e,"=e")
+                    if(e.code == 0){
+                        //alert("success")
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }else {
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }
+                }
+            });
+        }
     </script>
     </script>
 </body>
 </body>
 </html>
 </html>

+ 1 - 1
mybusiness/src/main/resources/templates/business/manager/stationforestmanager/edit.html

@@ -17,7 +17,7 @@
                 <label class="col-sm-3 control-label">森类类型:</label>
                 <label class="col-sm-3 control-label">森类类型:</label>
                 <div class="col-sm-8">
                 <div class="col-sm-8">
                     <select name="forestType" class="form-control m-b" th:field="*{forestType}">
                     <select name="forestType" class="form-control m-b" th:field="*{forestType}">
-                        <option value="">所有</option>
+                        <!--<option value="">所有</option>-->
                         <option value="1">林业局</option>
                         <option value="1">林业局</option>
                         <option value="2">林场</option>
                         <option value="2">林场</option>
                     </select>
                     </select>

+ 35 - 0
mybusiness/src/main/resources/templates/business/manager/stationforestmanager/index.html

@@ -53,6 +53,10 @@
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationforest:remove">
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationforest:remove">
                     <i class="fa fa-remove"></i> 删除
                     <i class="fa fa-remove"></i> 删除
                 </a>
                 </a>
+                <input style="display: none" type="file" name="file" id="fileField" onchange="importExcel(document.getElementById('fileField').value)">
+                <a class="btn btn-warning" shiro:hasPermission="system:forestdevice:export" onclick="fileField.click()">
+                    <i class="fa fa-download"></i> 导入
+                </a>
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationforest:export">
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationforest:export">
                     <i class="fa fa-download"></i> 导出
                     <i class="fa fa-download"></i> 导出
                 </a>-->
                 </a>-->
@@ -127,6 +131,37 @@
             };
             };
             $.table.init(options);
             $.table.init(options);
         });
         });
+
+        function importExcel(filename) {
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+            if(!filename.endWith(".xls")){
+                $.modal.alert("请上传.xls文件!")
+                setTimeout("window.location.reload()",1000);
+                return;
+            }
+            //alert(filename)
+            var obj = new Object();
+            obj.filename = filename
+            $.ajax({
+                url : prefix + "/importExcel",
+                method : 'post',
+                data : obj,
+                success : function (e) {
+                    //console.log(e,"=e")
+                    if(e.code == 0){
+                        //alert("success")
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }else {
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }
+                }
+            });
+        }
     </script>
     </script>
 </body>
 </body>
 </html>
 </html>

+ 35 - 0
mybusiness/src/main/resources/templates/business/manager/stationlandmanager/index.html

@@ -45,6 +45,10 @@
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationland:remove">
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationland:remove">
                     <i class="fa fa-remove"></i> 删除
                     <i class="fa fa-remove"></i> 删除
                 </a>
                 </a>
+                <input style="display: none" type="file" name="file" id="fileField" onchange="importExcel(document.getElementById('fileField').value)">
+                <a class="btn btn-warning" shiro:hasPermission="system:forestdevice:export" onclick="fileField.click()">
+                    <i class="fa fa-download"></i> 导入
+                </a>
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationland:export">
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationland:export">
                     <i class="fa fa-download"></i> 导出
                     <i class="fa fa-download"></i> 导出
                 </a>-->
                 </a>-->
@@ -113,6 +117,37 @@
             };
             };
             $.table.init(options);
             $.table.init(options);
         });
         });
+
+        function importExcel(filename) {
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+            if(!filename.endWith(".xls")){
+                $.modal.alert("请上传.xls文件!")
+                setTimeout("window.location.reload()",1000);
+                return;
+            }
+            //alert(filename)
+            var obj = new Object();
+            obj.filename = filename
+            $.ajax({
+                url : prefix + "/importExcel",
+                method : 'post',
+                data : obj,
+                success : function (e) {
+                    //console.log(e,"=e")
+                    if(e.code == 0){
+                        //alert("success")
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }else {
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }
+                }
+            });
+        }
     </script>
     </script>
 </body>
 </body>
 </html>
 </html>

+ 35 - 0
mybusiness/src/main/resources/templates/business/manager/stationteammanager/index.html

@@ -45,6 +45,10 @@
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationteam:remove">
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationteam:remove">
                     <i class="fa fa-remove"></i> 删除
                     <i class="fa fa-remove"></i> 删除
                 </a>
                 </a>
+                <input style="display: none" type="file" name="file" id="fileField" onchange="importExcel(document.getElementById('fileField').value)">
+                <a class="btn btn-warning" shiro:hasPermission="system:forestdevice:export" onclick="fileField.click()">
+                    <i class="fa fa-download"></i> 导入
+                </a>
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationteam:export">
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationteam:export">
                     <i class="fa fa-download"></i> 导出
                     <i class="fa fa-download"></i> 导出
                 </a>-->
                 </a>-->
@@ -113,6 +117,37 @@
             };
             };
             $.table.init(options);
             $.table.init(options);
         });
         });
+
+        function importExcel(filename) {
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+            if(!filename.endWith(".xls")){
+                $.modal.alert("请上传.xls文件!")
+                setTimeout("window.location.reload()",1000);
+                return;
+            }
+            //alert(filename)
+            var obj = new Object();
+            obj.filename = filename
+            $.ajax({
+                url : prefix + "/importExcel",
+                method : 'post',
+                data : obj,
+                success : function (e) {
+                    //console.log(e,"=e")
+                    if(e.code == 0){
+                        //alert("success")
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }else {
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }
+                }
+            });
+        }
     </script>
     </script>
 </body>
 </body>
 </html>
 </html>

+ 35 - 0
mybusiness/src/main/resources/templates/business/manager/stationweathermanager/index.html

@@ -45,6 +45,10 @@
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationweather:remove">
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:stationweather:remove">
                     <i class="fa fa-remove"></i> 删除
                     <i class="fa fa-remove"></i> 删除
                 </a>
                 </a>
+                <input style="display: none" type="file" name="file" id="fileField" onchange="importExcel(document.getElementById('fileField').value)">
+                <a class="btn btn-warning" shiro:hasPermission="system:forestdevice:export" onclick="fileField.click()">
+                    <i class="fa fa-download"></i> 导入
+                </a>
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationweather:export">
                 <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:stationweather:export">
                     <i class="fa fa-download"></i> 导出
                     <i class="fa fa-download"></i> 导出
                 </a>-->
                 </a>-->
@@ -113,6 +117,37 @@
             };
             };
             $.table.init(options);
             $.table.init(options);
         });
         });
+
+        function importExcel(filename) {
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+            if(!filename.endWith(".xls")){
+                $.modal.alert("请上传.xls文件!")
+                setTimeout("window.location.reload()",1000);
+                return;
+            }
+            //alert(filename)
+            var obj = new Object();
+            obj.filename = filename
+            $.ajax({
+                url : prefix + "/importExcel",
+                method : 'post',
+                data : obj,
+                success : function (e) {
+                    //console.log(e,"=e")
+                    if(e.code == 0){
+                        //alert("success")
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }else {
+                        $.modal.alert(e.msg)
+                        setTimeout("window.location.reload()",1000);
+                    }
+                }
+            });
+        }
     </script>
     </script>
 </body>
 </body>
 </html>
 </html>