基于SpringBoot+Vue果蔬作物疾病防治系统的设计与实现

项目介绍: 

传统信息的管理大部分依赖于管理人员的手工登记与管理,然而,随着近些年信息技术的迅猛发展,让许多比较老套的信息管理模式进行了更新迭代,果蔬百科信息因为其管理内容繁杂,管理数量繁多导致手工进行处理不能满足广大用户的需求,因此就应运而生出相应的果蔬作物疾病防治系统。

本果蔬作物疾病防治系统分为管理员还有用户两个权限,管理员可以管理用户的基本信息内容,可以管理公告信息以及果蔬百科信息,能够与用户进行相互交流等操作,用户可以查看果蔬百科信息,可以查看公告以及查看管理员回复信息等操作。

该果蔬作物疾病防治系统采用的是WEB应用程序开发中最受欢迎的小程序结构模式,使用占用空间小但功能齐全的MySQL数据库进行数据的存储操作,系统开发技术使用到了Java技术。该果蔬作物疾病防治系统能够解决许多传统手工操作的难题,比如数据查询耽误时间长,数据管理步骤繁琐等问题。总的来说,果蔬作物疾病防治系统性能稳定,功能较全,投入运行使用性价比很高。

功能介绍: 

部分截图说明: 

首页

果蔬百科

预警

管理员登录界面

基础数据管理

果蔬百科列表页面

公告信息管理页面

部分代码: 

/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * 上传文件
	 */
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		File path = new File(ResourceUtils.getURL("classpath:static").getPath());
		if(!path.exists()) {
		    path = new File("");
		}
		File upload = new File(path.getAbsolutePath(),"/upload/");
		if(!upload.exists()) {
		    upload.mkdirs();
		}
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(upload.getAbsolutePath()+"/"+fileName);
		file.transferTo(dest);
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * 下载文件
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public ResponseEntity<byte[]> download(@RequestParam String fileName) {
		try {
			File path = new File(ResourceUtils.getURL("classpath:static").getPath());
			if(!path.exists()) {
			    path = new File("");
			}
			File upload = new File(path.getAbsolutePath(),"/upload/");
			if(!upload.exists()) {
			    upload.mkdirs();
			}
			File file = new File(upload.getAbsolutePath()+"/"+fileName);
			if(file.exists()){
				/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
					getResponse().sendError(403);
				}*/
				HttpHeaders headers = new HttpHeaders();
			    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
			    headers.setContentDispositionFormData("attachment", fileName);    
			    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

 

 此源码非开源,若需要此源码可扫码添加微信或者qq:2214904953进行咨询!

2600多套项目欢迎咨询

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-04 23:40:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-04 23:40:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-05-04 23:40:02       82 阅读
  4. Python语言-面向对象

    2024-05-04 23:40:02       91 阅读

热门阅读

  1. 数据存储-文件存储

    2024-05-04 23:40:02       34 阅读
  2. 如何删除.gitignore文件中指定的所有被忽略的文件

    2024-05-04 23:40:02       32 阅读
  3. Iterable和Iterator,你学会了吗?

    2024-05-04 23:40:02       35 阅读
  4. threejs学习之dat.gui,辅助调参工具

    2024-05-04 23:40:02       36 阅读
  5. 【微服务】 OpenFeign

    2024-05-04 23:40:02       36 阅读
  6. 数据结构===队列

    2024-05-04 23:40:02       33 阅读
  7. C# 常见的数据结构如何在CRUD时选择

    2024-05-04 23:40:02       35 阅读