|
|
@@ -11,6 +11,7 @@ import com.taauav.common.bean.Response; |
|
|
|
import com.taauav.common.service.impl.BaseServiceImpl; |
|
|
|
import com.taauav.common.util.*; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.taauav.admin.mapper.TauvWaterTrendMapper; |
|
|
|
import com.taauav.admin.entity.TauvWaterTrend; |
|
|
@@ -18,6 +19,7 @@ import com.taauav.admin.service.ITauvWaterTrendService; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.List; |
|
|
@@ -36,6 +38,10 @@ public class TauvWaterTrendServiceImpl extends BaseServiceImpl<TauvWaterTrendMap |
|
|
|
private SysCityMapper cityMapper; |
|
|
|
@Autowired |
|
|
|
private TauvDriverMapper driverMapper; |
|
|
|
@Value("${file.uploadFolder}") |
|
|
|
private String uploadFolder; |
|
|
|
@Value("${server.UPLOAD_URL}") |
|
|
|
private String uploadUrl; |
|
|
|
|
|
|
|
/** |
|
|
|
* 导入Excel数据 |
|
|
@@ -185,4 +191,15 @@ public class TauvWaterTrendServiceImpl extends BaseServiceImpl<TauvWaterTrendMap |
|
|
|
List<TauvWaterTrend> list = baseMapper.selectList(wrapper); |
|
|
|
return response.success(list); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Response getTemplate() { |
|
|
|
String filename = "导入水环境趋势模拟数据模板.xlsx"; |
|
|
|
File filedir = new File(uploadFolder); |
|
|
|
if (!filedir.isDirectory()) { |
|
|
|
filedir.mkdirs(); |
|
|
|
} |
|
|
|
String path = uploadFolder + "/" + filename; |
|
|
|
return response.success(path.replace(uploadFolder, uploadUrl + "/upload/")); |
|
|
|
} |
|
|
|
} |