Merge remote-tracking branch 'origin/master'

master
夜笙歌 1 year ago
commit 46e00abbb0

@ -79,6 +79,7 @@ public class CommonController
{ {
// 上传文件路径 // 上传文件路径
String filePath = Global.getUploadPath(); String filePath = Global.getUploadPath();
System.out.println("上传文件大小"+file.getSize());
// 上传并返回新文件名称 // 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file); String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName; String url = serverConfig.getUrl() + fileName;

@ -88,14 +88,14 @@ body {
.winDiv .bg1 { .winDiv .bg1 {
position: absolute; position: absolute;
font-size: 0.8vw; font-size: 0.8vw;
left: 10%; left: 7%;
top: calc(15% + 1.5vw); top: calc(15% + 1.5vw);
color: #4888bf; color: #4888bf;
width: 80%; width: 87%;
height: 25%; height: 45%;
border-radius: 3px; border-radius: 3px;
border: 2px solid #3f65a1; border: 2px solid #3f65a1;
padding: 5%; padding: 1%;
overflow: auto; overflow: auto;
} }
@ -103,21 +103,21 @@ body {
position: absolute; position: absolute;
font-size: 1vw; font-size: 1vw;
left: 10%; left: 10%;
top: 45%; top: 67%;
color: #fff; color: #fff;
} }
.winDiv .bg2 { .winDiv .bg2 {
position: absolute; position: absolute;
font-size: 0.8vw; font-size: 0.8vw;
left: 10%; left: 7%;
top: calc(45% + 1.5vw); top: calc(67% + 1.5vw);
color: #4888bf; color: #4888bf;
width: 80%; width: 87%;
height: 28%; height: 26%;
border-radius: 3px; border-radius: 3px;
border: 2px solid #3f65a1; border: 2px solid #3f65a1;
padding: 5%; padding: 1%;
overflow: auto; overflow: auto;
} }

@ -23,7 +23,7 @@ public class FileUploadUtils
/** /**
* 50M * 50M
*/ */
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; public static final long DEFAULT_MAX_SIZE = 1000 * 1024 * 1024;
/** /**
* 100 * 100

@ -2,6 +2,7 @@ package com.haiwei.manage.mapper;
import java.util.List; import java.util.List;
import com.haiwei.manage.domain.BsaeFile; import com.haiwei.manage.domain.BsaeFile;
import org.springframework.stereotype.Repository;
/** /**
* Mapper * Mapper
@ -9,6 +10,7 @@ import com.haiwei.manage.domain.BsaeFile;
* @author wangh * @author wangh
* @date 2023-09-28 * @date 2023-09-28
*/ */
@Repository
public interface BsaeFileMapper public interface BsaeFileMapper
{ {
/** /**

@ -1,7 +1,13 @@
package com.haiwei.manage.service.impl; package com.haiwei.manage.service.impl;
import java.io.File;
import java.util.List; import java.util.List;
import com.haiwei.common.config.Global;
import com.haiwei.common.constant.Constants;
import com.haiwei.common.utils.DateUtils; import com.haiwei.common.utils.DateUtils;
import com.haiwei.common.utils.StringUtils;
import com.haiwei.common.utils.file.FileUtils;
import com.haiwei.framework.util.ShiroUtils; import com.haiwei.framework.util.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -83,7 +89,13 @@ public class BsaeFileServiceImpl implements IBsaeFileService
@Override @Override
public int deleteBsaeFileByIds(String ids) public int deleteBsaeFileByIds(String ids)
{ {
return bsaeFileMapper.deleteBsaeFileByIds(Convert.toStrArray(ids));
String[] objids = Convert.toStrArray(ids);
for (int i = 0; i <objids.length ; i++) {
delectFile(Long.valueOf(objids[i]));
}
return bsaeFileMapper.deleteBsaeFileByIds(objids);
} }
/** /**
@ -95,6 +107,24 @@ public class BsaeFileServiceImpl implements IBsaeFileService
@Override @Override
public int deleteBsaeFileById(Long objid) public int deleteBsaeFileById(Long objid)
{ {
return bsaeFileMapper.deleteBsaeFileById(objid); return bsaeFileMapper.deleteBsaeFileById(objid);
} }
private void delectFile(Long id){
try {
BsaeFile bsaeFile = bsaeFileMapper.selectBsaeFileById(id);
// 本地资源路径
String localPath = Global.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(bsaeFile.getFilePath(), Constants.RESOURCE_PREFIX);
System.out.println(downloadPath);
FileUtils.deleteFile(downloadPath);
}catch (Exception e){
}
}
} }

@ -274,11 +274,12 @@
} }
function removeRow(ids) { function removeRow(ids) {
console.log('删除的ID='+ids) console.log('删除的ID='+ids)
sub.editColumn();
$("#" + table.options.id).bootstrapTable('remove', { $("#" + table.options.id).bootstrapTable('remove', {
field: 'index', field: 'index',
values: ids values: ids
}) })
sub.editColumn();
} }
</script> </script>
</body> </body>

@ -124,7 +124,8 @@
align: 'center', align: 'center',
title: '采样时间', title: '采样时间',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='recordTestParamList[%s].recordTime' value='%s'>", index, value);
var html = $.common.sprintf("<input class='form-control' type='text' name='recordTestParamList[%s].recordTime' value='%s' style='width: 150px'>", index, value);
return html; return html;
} }
}, },

Loading…
Cancel
Save