基于SSM的建筑装修图纸管理平台

末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SSM
前端:采用JSP技术开发
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统功能

三、系统项目截图

设计师管理

施工方管理

用户信息管理

图纸信息管理

已接订单管理

公告管理

四、核心代码

登录相关

文件上传

封装

五、系统测试

概念和意义

特性

重要性

测试方法

功能测试

可用性测试

性能测试

测试分析

测试结果分析


一、项目简介

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了建筑装修图纸管理平台的开发全过程。通过分析高校学生综合素质评价管理方面的不足,创建了一个计算机管理建筑装修图纸管理平台的方案。文章介绍了建筑装修图纸管理平台的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本建筑装修图纸管理平台管理员,用户,设计师,施工方。管理员功能有个人中心,管理员管理,设计师管理,施工方管理,用户管理,图纸信息管理,已接订单管理,基础数据管理,轮播图管理,公告管理。用户可以看到图纸,然后预定,施工方审核。因而具有一定的实用性。

本站是一个B/S模式系统,采用SSM框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得建筑装修图纸管理平台管理工作系统化、规范化。


二、系统功能

本系统是基于B/S架构的网站系统,设计的功能结构图如下图所示:



三、系统项目截图

设计师管理

建筑装修图纸管理平台的系统管理员可以对设计师信息添加修改删除以及查询操作。

施工方管理

系统管理员可以查看对施工方信息进行添加,修改,删除以及查询操作。

 

用户信息管理

系统管理员可以查看对用户信息进行添加,修改,删除以及查询操作。

图纸信息管理

系统管理员可以查看对图纸信息进行添加,修改,删除以及查询操作。

 

已接订单管理

系统管理员可以查看已接订单。

公告管理

系统管理员可以查看对公告信息进行添加,修改,删除以及查询操作。

 


四、核心代码

登录相关


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/**
	 * 登录
	 */
	@IgnoreAuth
	@PostMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null || !user.getPassword().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
	
	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/list")
    public R list( UserEntity user){
       	EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

文件上传

package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;

/**
 * 上传文件映射表
 */
@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);
		FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));
		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);
	}
	
}

封装

package com.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 返回数据
 */
public class R extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	
	public R() {
		put("code", 0);
	}
	
	public static R error() {
		return error(500, "未知异常,请联系管理员");
	}
	
	public static R error(String msg) {
		return error(500, msg);
	}
	
	public static R error(int code, String msg) {
		R r = new R();
		r.put("code", code);
		r.put("msg", msg);
		return r;
	}

	public static R ok(String msg) {
		R r = new R();
		r.put("msg", msg);
		return r;
	}
	
	public static R ok(Map<String, Object> map) {
		R r = new R();
		r.putAll(map);
		return r;
	}
	
	public static R ok() {
		return new R();
	}

	public R put(String key, Object value) {
		super.put(key, value);
		return this;
	}
}

五、系统测试

概念和意义

测试的定义:程序测试是为了发现错误而执行程序的过程。测试(Testing)的任务与目的可以描述为:

目的:发现程序的错误;

任务:通过在计算机上执行程序,暴露程序中潜在的错误。

另一个预测是相关的术语叫纠错(Debugging)。它的目的与任务可以规定为:

目的:定位和纠正错误;

任务:消除软件故障,保证程序的可靠运行。测试与纠错的关系,可以用图6-1的数据流图来说明。图中表明,每一次测试都要准备好若干必要的测试数据,与被测试程序一道送入计算机执行。通常把一次程序执行需要的测试数据,称为一个“测试用例(Test Case)。每一个测试用例产生一个相应的“测试结果”。如果它与“期望结果”不想符合,便说明程序中存在错误,需要用纠错来改正。

 

特性

(1)挑剔性

测试是为了证明程序有错,而不是证明程序无错。因此,对于被测程序就是要“纯毛求疵”,就是要“鸡蛋里挑骨头”。

(2)复杂性

测试仪程序则比较容易,这其实是一个误区。设计测试用力是一项需要细致和高度技巧的高能工作,稍有不慎就会顾此失彼,发生不应用得数楼。

(3)不彻底性

实际测试都是不彻底的,当然不能够保证测试后的程序不存在遗漏的错误。

(4)经济性

通场这种测试称为“选择测试(Selective Testing)”。为了降低测试成本,选择测试用力是应注意遵守“经济性”的原则。

重要性

软件测试在软件生命周期中占据重要的地位,在传统的瀑布模型中,软件测试学仅处于运行维护阶段之前,是软件产品交付用户使用之前保证软件质量的重要手段。近来,软件工程界趋向于一种新的观点,即认为软件生命周期每一阶段中都应包含测试,从而检验本阶段的成果是否接近预期的目标,尽可能早的发现错误并加以修正,如果不在早期阶段进行测试,错误的延时扩散常常会导致最后成品测试的巨大困难。

测试方法

首先我们来说界面测试,界面测试是为了使程序在不同的的操作平台上能够运行界面,并且能够保持原来的风格。我把完整程序拷贝到Windows 7环境下,似的程序运行正常,运行界面上的字体图片等设置都能够保持得非常好。不出现字体变形等情况!

其次进行功能测试。该系统测试采用的是单元测试,集成测试,完善性测试等多种方式进行测试。

经过测试,所有功能都能得以实现,没有任何变形。至此,在功能的测试上也已经比较圆满的完成了。

由于经验不足,写代码时出现了一些考虑不周的系统缺陷,写代码的时候会出现与设想不一致,比如说代码不规范导致接口与接口之间出现问题,功能与客户的要求不符合,这样导致产品不能过关,无法交付。所以产品在上线前必须反复测试,经过反复测试,修改,再测试,再修改,产品才能够不断完善。在整个系统测试中,根据需求文档和设计文档,逐一对功能进行检测并写好测试用例,有效避免残片缺陷,因为产品出现缺陷不仅影响功能,而且可以导致数据的不准确,导致产品质量的降低,经过测试,才能使得产品的稳定性和成熟度得到极大的提升,产品质量也才有保证。

功能测试

功能测试主要包括五项内容:适用性、准确性、可操作性、依从性、安全性。

本系统功能测试如表所示:

 系统功能测试

测试内容

测试结果

适用性

准确性

可操作性

依从性

安全性

可用性测试

可用性测试用于检测系统的可操作性、可理解性、可学习性等方面内容。具体测试方面如表所示。

系统可用性测试

测试项

测试人员的评价

窗口移动、大小改变、关闭等操作是否正常

操作模块是否友好

模块、提示内容等文字描述是否正确

模块布局是否协调、合理

模块的状态是否正确(对选中项能否发生对应切换)

鼠标、键盘操作是否支持

所需数据项是否正确显示

操作流程是否合理

是否提供帮助信息

性能测试

性能测试主要通过模拟系统运行环境,测试系统性能是否符合客户需求。性能测试的重要技术指标就是:系统运行速度、网络响应时间和支持并发节点数。

1)系统运行速度:通过在不同计算机上试运行本系统,没有发现有任何迟滞、停顿现象。

2)网络响应时间:网络响应时间主要包括网络最小响应时间、平均响应时间、最大响应时间三个参数。经过测试,在网络运营良好状态下,NBA局域网内响应时间三参数为:1/2/6s,NBA外网响应时间三参数为3/7/12s,符合客户需求,属于用户心理可承受范围。

3)支持并发节点数:经过模拟环境测试,本系统在并发节点达46个时,网络运营速度会发生较大波动,延迟时间10秒左右,符合客户需求。

测试分析

本网站设计时借鉴了国内外优秀网站的优点,从界面到系统设计都保证了用户能够方便操作。系统的主要特点和优点归纳如下:

(1)本系统用的移置性和针对性都比较高,因为针对性高可以提供更好的服务而移置性可以在多个系统上运行,更给客户带来了极大的方便。

(2)该完整内容全面,管理方便可以及时的全面的处理各种错误,异常,这样避免了很多因用户的马虎操作而出现的失误,其操作方便,用户界面友好,能够上网的人都可以很好的进行操作。

测试结果分析

经过对上述测试结果分析,本系统符合用户需求。所有基本功能点实现,操作简单,操作流程简单合理,产品运行性能良好,是一款值得推广的建筑装修图纸管理平台。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值