Преглед на файлове

引江济太模块数据更新

dumingliang преди 18 часа
родител
ревизия
315d940e46

+ 16 - 4
gw-admin/src/main/java/com/goldenwater/web/controller/yjjt/YjjtFileController.java

@@ -1,5 +1,7 @@
-   package com.goldenwater.web.controller.yjjt;
+package com.goldenwater.web.controller.yjjt;
 
+import com.goldenwater.common.config.RuoYiConfig;
+import com.goldenwater.common.constant.Constants;
 import com.goldenwater.common.core.controller.BaseController;
 import com.goldenwater.common.core.domain.AjaxResult;
 import com.goldenwater.common.core.page.TableDataInfo;
@@ -78,13 +80,23 @@ public class YjjtFileController extends BaseController {
             return ResponseEntity.notFound().build();
         }
 
-        File filePath = new File(file.getFilePath());
-        if (!filePath.exists()) {
+        // fileSavename 存储的是 URL 路径(以 /profile 开头),需还原为磁盘绝对路径
+        String fileSavename = file.getFileSavename();
+        String absolutePath;
+        if (fileSavename != null && fileSavename.startsWith(Constants.RESOURCE_PREFIX)) {
+            absolutePath = RuoYiConfig.getProfile() + fileSavename.substring(Constants.RESOURCE_PREFIX.length());
+        } else {
+            // 兼容直接存储绝对路径的情况
+            absolutePath = fileSavename;
+        }
+
+        File targetFile = new File(absolutePath);
+        if (!targetFile.exists()) {
             return ResponseEntity.notFound().build();
         }
 
         try {
-            org.springframework.core.io.Resource resource = new FileSystemResource(filePath);
+            org.springframework.core.io.Resource resource = new FileSystemResource(targetFile);
             String encodedFilename = URLEncoder.encode(file.getFileViewname(), StandardCharsets.UTF_8)
                     .replace("+", "%20");
 

+ 33 - 6
gw-admin/src/main/java/com/goldenwater/web/controller/yjjt/YjjtSlDataController.java

@@ -1,11 +1,15 @@
 package com.goldenwater.web.controller.yjjt;
 
+import com.goldenwater.common.config.RuoYiConfig;
 import com.goldenwater.common.core.controller.BaseController;
 import com.goldenwater.common.core.domain.AjaxResult;
 import com.goldenwater.common.core.page.TableDataInfo;
+import com.goldenwater.common.utils.file.FileUploadUtils;
 import com.goldenwater.common.utils.poi.ExcelImportHelper;
 import com.goldenwater.common.utils.poi.ExcelUtil;
+import com.goldenwater.yjjt.domain.YjjtFile;
 import com.goldenwater.yjjt.domain.YjjtSlData;
+import com.goldenwater.yjjt.service.IYjjtFileService;
 import com.goldenwater.yjjt.service.IYjjtSlDataService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -16,7 +20,9 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import jakarta.annotation.Resource;
+
 import java.io.InputStream;
+import java.util.Date;
 import java.util.List;
 
 @RestController
@@ -27,6 +33,9 @@ public class YjjtSlDataController extends BaseController {
     @Resource
     private IYjjtSlDataService yjjtSlDataService;
 
+    @Resource
+    private IYjjtFileService yjjtFileService;
+
     @GetMapping("/list")
     @Operation(summary = "查询水量数据列表", description = "查询水量数据列表")
     @PreAuthorize("@ss.hasPermi('yjjtgl:sl:list')")
@@ -53,20 +62,38 @@ public class YjjtSlDataController extends BaseController {
     @PostMapping("/upload")
     @Operation(summary = "上传水量数据", description = "上传水量数据Excel文件,使用第三行作为列名")
     @PreAuthorize("@ss.hasPermi('yjjtgl:sl:upload')")
-    public AjaxResult upload(@Parameter(description = "Excel文件") @RequestParam("file") MultipartFile file,
-                            @Parameter(description = "业务类型(JS/SH/ZJ)") @RequestParam("bizType") String bizType) {
+    public AjaxResult upload(@Parameter(description = "Excel文件") @RequestParam("file") MultipartFile file) {
         try {
+            // 上传文件到服务器
+            String filePath = RuoYiConfig.getUploadPath();
+            String fileName = FileUploadUtils.upload(filePath, file);
+            // 获取文件的后缀名
+            String suffixName = fileName.substring(fileName.lastIndexOf(".") + 1);
             InputStream inputStream = file.getInputStream();
             // 使用ExcelImportHelper解析,第三行(索引2)作为列名
             List<YjjtSlData> dataList = ExcelImportHelper.importExcel(inputStream, YjjtSlData.class, 2);
-
-            String addvcd = bizType.toUpperCase();
             for (YjjtSlData data : dataList) {
-                data.setAddvcd(addvcd);
+                data.setId(new Date().getTime());
                 data.setCreateBy(getUsername());
+                data.setUpdateBy(getUsername());
             }
+            yjjtSlDataService.importSlData(dataList);
+
+            // 保存文件信息到 yjjt_file 表
+            YjjtFile yjjtFile = new YjjtFile();
+            yjjtFile.setId(new Date().getTime());
+            yjjtFile.setFileViewname(file.getOriginalFilename());
+            yjjtFile.setFileSavename(fileName);
+            yjjtFile.setFilePath(filePath);
+            yjjtFile.setFileSize(file.getSize());
+            yjjtFile.setFileType(suffixName);
+            yjjtFile.setBizType("SL");
+            yjjtFile.setUploadBy(getUsername());
+            yjjtFile.setUploadTime(new Date());
+            yjjtFile.setStatus("0");
+            yjjtFile.setCreateBy(getUsername());
+            yjjtFileService.insertYjjtFile(yjjtFile);
 
-            yjjtSlDataService.importSlData(dataList, bizType);
             return AjaxResult.success("上传成功,共导入" + dataList.size() + "条数据");
         } catch (Exception e) {
             logger.error("上传水量数据失败", e);

+ 26 - 1
gw-admin/src/main/java/com/goldenwater/web/controller/yjjt/YjjtSzDataController.java

@@ -1,11 +1,15 @@
 package com.goldenwater.web.controller.yjjt;
 
+import com.goldenwater.common.config.RuoYiConfig;
 import com.goldenwater.common.core.controller.BaseController;
 import com.goldenwater.common.core.domain.AjaxResult;
 import com.goldenwater.common.core.page.TableDataInfo;
+import com.goldenwater.common.utils.file.FileUploadUtils;
 import com.goldenwater.common.utils.poi.ExcelImportHelper;
 import com.goldenwater.common.utils.poi.ExcelUtil;
+import com.goldenwater.yjjt.domain.YjjtFile;
 import com.goldenwater.yjjt.domain.YjjtSzData;
+import com.goldenwater.yjjt.service.IYjjtFileService;
 import com.goldenwater.yjjt.service.IYjjtSzDataService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -18,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
 import jakarta.annotation.Resource;
 
 import java.io.InputStream;
+import java.util.Date;
 import java.util.List;
 
 @RestController
@@ -27,6 +32,8 @@ public class YjjtSzDataController extends BaseController {
 
     @Resource
     private IYjjtSzDataService yjjtSzDataService;
+    @Resource
+    private IYjjtFileService yjjtFileService;
 
     @GetMapping("/list")
     @Operation(summary = "查询水质数据列表", description = "查询水质数据列表")
@@ -56,15 +63,33 @@ public class YjjtSzDataController extends BaseController {
     @PreAuthorize("@ss.hasPermi('yjjtgl:sz:upload')")
     public AjaxResult upload(@Parameter(description = "Excel文件") @RequestParam("file") MultipartFile file) {
         try {
+            String filePath = RuoYiConfig.getUploadPath();
+            String fileName = FileUploadUtils.upload(filePath, file);
+            // 获取文件的后缀名
+            String suffixName = fileName.substring(fileName.lastIndexOf(".") + 1);
             InputStream inputStream = file.getInputStream();
             // 使用ExcelImportHelper解析,第三行(索引2)作为列名
             List<YjjtSzData> dataList = ExcelImportHelper.importExcel(inputStream, YjjtSzData.class, 2);
 
             for (YjjtSzData data : dataList) {
+                data.setId(new Date().getTime());
                 data.setCreateBy(getUsername());
             }
-
             yjjtSzDataService.importSzData(dataList);
+            // 保存文件信息到 yjjt_file 表
+            YjjtFile yjjtFile = new YjjtFile();
+            yjjtFile.setId(new Date().getTime());
+            yjjtFile.setFileViewname(file.getOriginalFilename());
+            yjjtFile.setFileSavename(fileName);
+            yjjtFile.setFilePath(filePath);
+            yjjtFile.setFileSize(file.getSize());
+            yjjtFile.setFileType(suffixName);
+            yjjtFile.setBizType("SZ");
+            yjjtFile.setUploadBy(getUsername());
+            yjjtFile.setUploadTime(new Date());
+            yjjtFile.setStatus("0");
+            yjjtFile.setCreateBy(getUsername());
+            yjjtFileService.insertYjjtFile(yjjtFile);
             return AjaxResult.success("上传成功,共导入" + dataList.size() + "条数据");
         } catch (Exception e) {
             logger.error("上传水质数据失败", e);

+ 5 - 5
gw-common/src/main/java/com/goldenwater/common/utils/poi/ExcelImportHelper.java

@@ -20,7 +20,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Excel动态导入工具类
+ * Excel动态解析工具类
  * 支持从Excel的指定行读取列名作为变量名,动态映射到实体类字段
  */
 public class ExcelImportHelper {
@@ -28,7 +28,7 @@ public class ExcelImportHelper {
     private static final Logger log = LoggerFactory.getLogger(ExcelImportHelper.class);
 
     /**
-     * 从Excel文件导入数据,使用指定行作为列名行
+     * 从Excel文件解析数据,使用指定行作为列名行
      *
      * @param is       输入流
      * @param clazz    目标实体类
@@ -94,10 +94,10 @@ public class ExcelImportHelper {
                 }
             }
 
-            log.info("Excel导入完成,共导入{}条数据", list.size());
+            log.info("Excel解析完成,共解析{}条数据", list.size());
         } catch (Exception e) {
-            log.error("Excel导入失败", e);
-            throw new RuntimeException("Excel导入失败: " + e.getMessage(), e);
+            log.error("Excel解析失败", e);
+            throw new RuntimeException("Excel解析失败: " + e.getMessage(), e);
         }
         return list;
     }

+ 1 - 1
gw-gx/src/main/java/com/goldenwater/yjjt/service/IYjjtSlDataService.java

@@ -18,5 +18,5 @@ public interface IYjjtSlDataService {
 
     int deleteYjjtSlDataByIds(Long[] ids);
 
-    void importSlData(List<YjjtSlData> dataList, String bizType);
+    void importSlData(List<YjjtSlData> dataList);
 }

+ 2 - 1
gw-gx/src/main/java/com/goldenwater/yjjt/service/impl/YjjtSlDataServiceImpl.java

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import jakarta.annotation.Resource;
+
 import java.text.SimpleDateFormat;
 import java.util.List;
 
@@ -57,7 +58,7 @@ public class YjjtSlDataServiceImpl implements IYjjtSlDataService {
 
     @Override
     @Transactional
-    public void importSlData(List<YjjtSlData> dataList, String bizType) {
+    public void importSlData(List<YjjtSlData> dataList) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         for (YjjtSlData data : dataList) {
             String sptStr = sdf.format(data.getSpt());

+ 3 - 1
gw-gx/src/main/resources/mapper/yjjt/YjjtFileMapper.xml

@@ -20,9 +20,10 @@
         <result property="updateTime"     column="update_time"     />
     </resultMap>
 
-    <insert id="insertYjjtFile" parameterType="com.goldenwater.yjjt.domain.YjjtFile" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertYjjtFile" parameterType="com.goldenwater.yjjt.domain.YjjtFile">
         insert into YJJT_FILE
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="fileViewname != null">file_viewname,</if>
             <if test="fileSavename != null">file_savename,</if>
             <if test="filePath != null">file_path,</if>
@@ -36,6 +37,7 @@
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="fileViewname != null">#{fileViewname},</if>
             <if test="fileSavename != null">#{fileSavename},</if>
             <if test="filePath != null">#{filePath},</if>

+ 8 - 2
gw-gx/src/main/resources/mapper/yjjt/YjjtSlDataMapper.xml

@@ -21,7 +21,11 @@
     </resultMap>
 
     <sql id="selectSlDataVo">
-        select id, stcd, stnm, rvnm, spt, z, z_j, q, liuxiang, nt, addvcd,
+        select id, stcd, stnm, rvnm, spt,
+               CAST(NULLIF(TRIM(z), '') AS DECIMAL(10,2)) as z,
+               CAST(NULLIF(TRIM(z_j), '') AS DECIMAL(10,2)) as z_j,
+               CAST(NULLIF(TRIM(q), '') AS DECIMAL(15,3)) as q,
+               liuxiang, nt, addvcd,
                create_by, create_time, update_by, update_time
         from YJJT_SL_DATA
     </sql>
@@ -96,9 +100,10 @@
         from dual
     </select>
 
-    <insert id="insertYjjtSlData" parameterType="com.goldenwater.yjjt.domain.YjjtSlData" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertYjjtSlData" parameterType="com.goldenwater.yjjt.domain.YjjtSlData">
         insert into YJJT_SL_DATA
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
             <if test="stcd != null and stcd != ''">stcd,</if>
             <if test="stnm != null">stnm,</if>
             <if test="rvnm != null">rvnm,</if>
@@ -113,6 +118,7 @@
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
             <if test="stcd != null and stcd != ''">#{stcd},</if>
             <if test="stnm != null">#{stnm},</if>
             <if test="rvnm != null">#{rvnm},</if>

+ 3 - 1
gw-gx/src/main/resources/mapper/yjjt/YjjtSzDataMapper.xml

@@ -131,9 +131,10 @@
         from dual
     </select>
 
-    <insert id="insertYjjtSzData" parameterType="com.goldenwater.yjjt.domain.YjjtSzData" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertYjjtSzData" parameterType="com.goldenwater.yjjt.domain.YjjtSzData">
         insert into YJJT_SZ_DATA
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
             <if test="stcd != null and stcd != ''">stcd,</if>
             <if test="stnm != null">stnm,</if>
             <if test="rvnm != null">rvnm,</if>
@@ -180,6 +181,7 @@
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
             <if test="stcd != null and stcd != ''">#{stcd},</if>
             <if test="stnm != null">#{stnm},</if>
             <if test="rvnm != null">#{rvnm},</if>

+ 1 - 4
gw-ui/src/api/gx/document.js

@@ -18,10 +18,7 @@ export function uploadFile(data) {
   return request({
     url: '/gx/file/upload',
     method: 'post',
-    data: data,
-    headers: {
-      'Content-Type': 'multipart/form-data'
-    }
+    data: data
   })
 }
 

+ 2 - 6
gw-ui/src/api/yjjt/sl.js

@@ -22,17 +22,13 @@ export function delYjjtSlData(id) {
     })
 }
 
-export function uploadSlData(file, bizType) {
+export function uploadSlData(file) {
     const formData = new FormData()
     formData.append('file', file)
-    formData.append('bizType', bizType)
     return request({
         url: '/yjjt/sl/upload',
         method: 'post',
-        data: formData,
-        headers: {
-            'Content-Type': 'multipart/form-data'
-        }
+        data: formData
     })
 }
 

+ 4 - 2
gw-ui/src/api/yjjt/station.js

@@ -65,11 +65,13 @@ export function exportStation(query) {
 }
 
 // 导入引江济太站点
-export function importStation(data) {
+export function importStation(file) {
+  const formData = new FormData()
+  formData.append('file', file)
   return request({
     url: '/yjjt/station/import',
     method: 'post',
-    data: data
+    data: formData
   })
 }
 

+ 2 - 6
gw-ui/src/api/yjjt/sz.js

@@ -22,17 +22,13 @@ export function delYjjtSzData(id) {
     })
 }
 
-export function uploadSzData(file, bizType) {
+export function uploadSzData(file) {
     const formData = new FormData()
     formData.append('file', file)
-    formData.append('bizType', bizType)
     return request({
         url: '/yjjt/sz/upload',
         method: 'post',
-        data: formData,
-        headers: {
-            'Content-Type': 'multipart/form-data'
-        }
+        data: formData
     })
 }
 

+ 4 - 0
gw-ui/src/utils/request.js

@@ -32,6 +32,10 @@ service.interceptors.request.use(config => {
   if (getToken() && !isToken) {
     config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
   }
+  // FormData 请求由 axios 自动设置 Content-Type(含 boundary),需移除全局默认的 application/json
+  if (config.data instanceof FormData) {
+    config.headers['Content-Type'] = 'multipart/form-data'
+  }
   // get请求映射params参数
   if (config.method === 'get' && config.params) {
     let url = config.url + '?' + tansParams(config.params)

+ 26 - 11
gw-ui/src/views/yjjtgl/sl/index.vue

@@ -103,7 +103,7 @@
           <el-upload
               class="upload-demo"
               drag
-              :action="uploadUrl"
+              :http-request="handleHttpRequest"
               :on-success="handleUploadSuccess"
               :on-error="handleUploadError"
               :file-list="fileList"
@@ -151,7 +151,15 @@ const showSearch = ref(true)
 const uploadVisible = ref(false)
 const fileList = ref([])
 const uploadRef = ref(null)
-
+// 获取当前日期和当月第一天
+const now = new Date()
+const firstDayOfMonth = new Date(now.getFullYear(), now.getMonth(), 1)
+const formatDateStr = (date) => {
+  const year = date.getFullYear()
+  const month = String(date.getMonth() + 1).padStart(2, '0')
+  const day = String(date.getDate()).padStart(2, '0')
+  return `${year}-${month}-${day}`
+}
 const queryParams = reactive({
   pageNum: 1,
   pageSize: 15,
@@ -159,14 +167,12 @@ const queryParams = reactive({
   stcd: '',
   addvcd: '',
   params: {
-    beginTime: '',
-    endTime: ''
+    beginTime: formatDateStr(firstDayOfMonth),
+    endTime: formatDateStr(now)
   }
 })
 
-const dateRange = ref([])
-
-const uploadUrl = import.meta.env.VITE_SERVICE_BASE_TITLE + '/yjjt/sl/upload'
+const dateRange = ref([formatDateStr(firstDayOfMonth), formatDateStr(now)])
 
 const getList = async () => {
   loading.value = true
@@ -190,9 +196,9 @@ const resetQuery = () => {
   queryParams.stnm = ''
   queryParams.stcd = ''
   queryParams.addvcd = ''
-  queryParams.params.beginTime = ''
-  queryParams.params.endTime = ''
-  dateRange.value = []
+  queryParams.params.beginTime = formatDateStr(firstDayOfMonth)
+  queryParams.params.endTime = formatDateStr(now)
+  dateRange.value = [formatDateStr(firstDayOfMonth), formatDateStr(now)]
   handleQuery()
 }
 
@@ -227,7 +233,16 @@ const submitUpload = () => {
   uploadRef.value.submit()
 }
 
-const handleUploadSuccess = async (response) => {
+const handleHttpRequest = (options) => {
+  const {file, onSuccess, onError} = options
+  uploadSlData(file).then(response => {
+    onSuccess(response, file)
+  }).catch(error => {
+    onError(error)
+  })
+}
+
+const handleUploadSuccess = (response) => {
   if (response.code === 200) {
     ElMessage.success(response.msg)
     uploadVisible.value = false

+ 31 - 12
gw-ui/src/views/yjjtgl/station/index.vue

@@ -40,6 +40,17 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+            type="primary"
+            plain
+            icon="Upload"
+            @click="handleImport"
+            size="mini"
+            v-hasPermi="['yjjtgl:station:upload']"
+        >上传数据
+        </el-button>
+      </el-col>
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList">
         <template #right>
           <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['yjjtgl:station:add']">新增站点
@@ -181,13 +192,12 @@
 
     <!-- 导入弹窗 -->
     <el-dialog title="站点数据导入" v-model="importVisible" width="500px" append-to-body>
-      <el-form :model="importForm" ref="importForm" label-width="100px">
+      <el-form ref="importForm" label-width="100px">
         <el-form-item label="上传文件">
           <el-upload
               class="upload-demo"
               drag
-              :action="uploadUrl"
-              :data="{ bizType: importForm.bizType }"
+              :http-request="handleHttpRequest"
               :on-success="handleUploadSuccess"
               :on-error="handleUploadError"
               :file-list="fileList"
@@ -277,13 +287,8 @@ const form = reactive({
   remark: ''
 })
 
-const importForm = reactive({
-  bizType: ''
-})
-
 const fileList = ref([])
 const uploadRef = ref(null)
-const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/yjjt/station/import'
 
 const getList = async () => {
   loading.value = true
@@ -419,10 +424,24 @@ const submitUpload = () => {
   uploadRef.value.submit()
 }
 
-const handleUploadSuccess = () => {
-  ElMessage.success('导入成功')
-  importVisible.value = false
-  getList()
+const handleHttpRequest = (options) => {
+  const { file, onSuccess, onError } = options
+  importStation(file).then(response => {
+    onSuccess(response, file)
+  }).catch(error => {
+    onError(error)
+  })
+}
+
+const handleUploadSuccess = (response) => {
+  if (response.code === 200) {
+    ElMessage.success(response.msg)
+    importVisible.value = false
+    fileList.value = []
+    getList()
+  } else {
+    ElMessage.error(response.msg)
+  }
 }
 
 const handleUploadError = () => {

+ 12 - 5
gw-ui/src/views/yjjtgl/sz/index.vue

@@ -152,7 +152,7 @@
           <el-upload
               class="upload-demo"
               drag
-              :action="uploadUrl"
+              :http-request="handleHttpRequest"
               :on-success="handleUploadSuccess"
               :on-error="handleUploadError"
               :file-list="fileList"
@@ -225,8 +225,6 @@ const queryParams = reactive({
 
 const dateRange = ref([formatDateStr(firstDayOfMonth), formatDateStr(now)])
 
-const uploadUrl = import.meta.env.VITE_SERVICE_BASE_TITLE + '/yjjt/sz/upload'
-
 const getList = async () => {
   loading.value = true
   try {
@@ -286,7 +284,16 @@ const submitUpload = () => {
   uploadRef.value.submit()
 }
 
-const handleUploadSuccess = async (response) => {
+const handleHttpRequest = (options) => {
+  const { file, onSuccess, onError } = options
+  uploadSzData(file).then(response => {
+    onSuccess(response, file)
+  }).catch(error => {
+    onError(error)
+  })
+}
+
+const handleUploadSuccess = (response) => {
   if (response.code === 200) {
     ElMessage.success(response.msg)
     uploadVisible.value = false
@@ -322,7 +329,7 @@ const handleExport = async () => {
 
 const downloadTemplate = async (type) => {
   const templateNames = {
-    sl: '引江济太水质数据上传模板.xlsx',
+    sz: '引江济太水质数据上传模板.xlsx',
   }
   try {
     const response = await request({