SpringMVC+Vue项目公廉租房维保系统

末获取源码 

开发语言:Java

开发工具:IDEA /Eclipse

数据库:MYSQL5.7

应用服务:Tomcat7/Tomcat8

使用框架ssm+vue

JDK版本:jdk1.8

前言介绍 

本系统的内容是关于公廉租房维保系统的设计与实现,主要内容不仅包括了系统的分析和设计还对几个主要模块进行详细阐述与分析。此公廉租房维保系统分为管理员、业主和维修单位。业主的操作主要是可以对首页、个人中心、房屋信息管理、维修申报单管理、维修完成管理等进行操作;维修单位的操作主要是可以在对首页、个人中心、维修申报单管理、维修完成管理等进行操作。管理员的操作,管理员登录后台进行操作,后台管理主要是针对一些公廉租房维保信息的添加,更新公廉租房维保信息管理,给管理员权限对用户进行修改等。本文将从分析部分开始论述,用户需要什么样的网站,怎样的操作界面能保证系统的易用性,然后从功能分析开始思考需要怎样的数据逻辑结构,把数据逻辑结构建成数据实体,最后从几个主要模块部分论述如何实现这些功能。 

系统功能结构 

一、业主管理功能

该部分内容提供业主资料修改,包含首页、个人中心、房屋信息管理、维修申报单管理、维修完成管理等功能。

二、维修单位管理功能

该部分内容提供业主资料修改,包含首页、个人中心、维修申报单管理、维修完成管理等功能。

三、管理员管理功能

该部分内容包含了首页、个人中心、业主管理、维修单位管理、房屋信息管理、维修申报单管理、维修完成管理、房屋维护管理等功能。管理员可对所有的信息进行增、删、改、查,能对用户信息进行管理,更新最近的公廉租房维保信息。

为了方便更直观的理解,下图以图形形式给出关于整个网站的结构图。网站总体功能结构图 

 

系统的详细设计 

系统登录,管理员、业主和维修单位进入系统前在登录页面根据要求填写用户名和密码,选择角色等信息,点击登录进行登录操作,如图

  

管理员功能模块 

管理员登录系统后,可以对首页、个人中心、业主管理、维修单位管理、房屋信息管理、维修申报单管理、维修完成管理、房屋维护管理,如图 

 

业主管理

在业主管理页面可以对索引、业主号、业主姓名、性别、业主手机、身份证、楼房号、车牌号等内容进行详情、修改或删除等操作,如图 

 

维修单位管理

在维修单位管理页面可以对索引、维修工号、师傅姓名、性别、年龄、师傅手机等内容进行详情、修改或删除等操作,如图 

房屋信息管理

在房屋信息管理页面可以对索引、房屋编号、房屋名称、 房屋类型、房屋面积、业主号、业主手机、身份证、业主姓名、楼房号等内容进行详情、房屋维护、修改或删除等操作,如图 

维修申报单管理

在维修申报单管理页面可以对索引、报修编号、报修设备、报修日期、业主号、业主姓名、业主手机、楼房号、完成状态、审核回复、审核状态等内容进行详情、修改或删除等操作,如图 

 

维修完成管理

在维修完成管理页面可以对索引、报修设备、业主号、业主姓名、报修编号、楼房号、维修工号、师傅手机、完成时间、回执单等内容进行详情、修改或删除等操作,如图 

房屋维护管理

在房屋维护管理页面可以对索引、房屋编号、房屋名称、房屋类型、业主号、维护时间、维护人员等内容进行详情、修改或删除等操作,如图 

 

业主功能模块

业主登录进入系统可以对首页、个人中心、房屋信息管理、维修申报单管理、维修完成管理等功能进行详细操作,如图 

房屋信息管理

在房屋信息管理页面可以对、索引、房屋编号、房屋名称、 房屋类型、房屋面积、业主号、业主手机、身份证、业主姓名、楼房号等内容进行详情等操作,如图 

维修申报单管理

在维修申报单管理页面中可以对索引、报修设备、业主号、业主姓名、报修编号、楼房号、维修工号、师傅手机、完成时间、回执单等内容进行详情或删除等操作,如图 

维修单位功能模块 

维修单位登录进入系统可以对首页、个人中心、维修申报单管理、维修完成管理等功能进行详细操作,如图 

 

维修申报单管理

在维修申报单管理页面可以对索引、报修编号、报修设备、报修日期、业主号、业主姓名、业主手机、楼房号、完成状态、审核回复、审核状态、审核等内容进行详情或维修完成等操作,如图 

维修完成管理

在维修完成管理页面可以对索引、报修设备、业主号、业主姓名、报修编号、楼房号、维修工号、师傅手机、完成时间、回执单等内容进行详情、修改或删除等操作,如图 

 

部分核心代码 

/**
 * 维修单位
 * 后端接口
 * @author 
 * @email 
 * @date 2022-03-22 09:39:51
 */
@RestController
@RequestMapping("/weixiudanwei")
public class WeixiudanweiController {
    @Autowired
    private WeixiudanweiService weixiudanweiService;



    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		WeixiudanweiEntity user = weixiudanweiService.selectOne(new EntityWrapper<WeixiudanweiEntity>().eq("weixiugonghao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"weixiudanwei",  "维修单位" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody WeixiudanweiEntity weixiudanwei){
    	//ValidatorUtils.validateEntity(weixiudanwei);
    	WeixiudanweiEntity user = weixiudanweiService.selectOne(new EntityWrapper<WeixiudanweiEntity>().eq("weixiugonghao", weixiudanwei.getWeixiugonghao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		weixiudanwei.setId(uId);
        weixiudanweiService.insert(weixiudanwei);
        return R.ok();
    }

	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        WeixiudanweiEntity user = weixiudanweiService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	WeixiudanweiEntity user = weixiudanweiService.selectOne(new EntityWrapper<WeixiudanweiEntity>().eq("weixiugonghao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setMima("123456");
        weixiudanweiService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,WeixiudanweiEntity weixiudanwei, 
		HttpServletRequest request){

        EntityWrapper<WeixiudanweiEntity> ew = new EntityWrapper<WeixiudanweiEntity>();
		PageUtils page = weixiudanweiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiudanwei), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,WeixiudanweiEntity weixiudanwei, 
		HttpServletRequest request){
        EntityWrapper<WeixiudanweiEntity> ew = new EntityWrapper<WeixiudanweiEntity>();
		PageUtils page = weixiudanweiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiudanwei), params), params));
        return R.ok().put("data", page);
    }

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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(WeixiudanweiEntity weixiudanwei){
        EntityWrapper< WeixiudanweiEntity> ew = new EntityWrapper< WeixiudanweiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( weixiudanwei, "weixiudanwei")); 
		WeixiudanweiView weixiudanweiView =  weixiudanweiService.selectView(ew);
		return R.ok("查询维修单位成功").put("data", weixiudanweiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        WeixiudanweiEntity weixiudanwei = weixiudanweiService.selectById(id);
        return R.ok().put("data", weixiudanwei);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        WeixiudanweiEntity weixiudanwei = weixiudanweiService.selectById(id);
        return R.ok().put("data", weixiudanwei);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody WeixiudanweiEntity weixiudanwei, HttpServletRequest request){
    	weixiudanwei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(weixiudanwei);
    	WeixiudanweiEntity user = weixiudanweiService.selectOne(new EntityWrapper<WeixiudanweiEntity>().eq("weixiugonghao", weixiudanwei.getWeixiugonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		weixiudanwei.setId(new Date().getTime());
        weixiudanweiService.insert(weixiudanwei);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody WeixiudanweiEntity weixiudanwei, HttpServletRequest request){
    	weixiudanwei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(weixiudanwei);
    	WeixiudanweiEntity user = weixiudanweiService.selectOne(new EntityWrapper<WeixiudanweiEntity>().eq("weixiugonghao", weixiudanwei.getWeixiugonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		weixiudanwei.setId(new Date().getTime());
        weixiudanweiService.insert(weixiudanwei);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody WeixiudanweiEntity weixiudanwei, HttpServletRequest request){
        //ValidatorUtils.validateEntity(weixiudanwei);
        weixiudanweiService.updateById(weixiudanwei);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        weixiudanweiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<WeixiudanweiEntity> wrapper = new EntityWrapper<WeixiudanweiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = weixiudanweiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	






    @RequestMapping("/importExcel")
    public R importExcel(@RequestParam("file") MultipartFile file){
        try {
            //获取输入流
            InputStream inputStream = file.getInputStream();
            //创建读取工作簿
            Workbook workbook = WorkbookFactory.create(inputStream);
            //获取工作表
            Sheet sheet = workbook.getSheetAt(0);
            //获取总行
            int rows=sheet.getPhysicalNumberOfRows();
            if(rows>1){
                //获取单元格
                for (int i = 1; i < rows; i++) {
                    Row row = sheet.getRow(i);
                    WeixiudanweiEntity weixiudanweiEntity =new WeixiudanweiEntity();
                    weixiudanweiEntity.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
                    String weixiugonghao = CommonUtil.getCellValue(row.getCell(0));
                    weixiudanweiEntity.setWeixiugonghao(weixiugonghao);
                    String mima = CommonUtil.getCellValue(row.getCell(1));
                    weixiudanweiEntity.setMima(mima);
                    String shifuxingming = CommonUtil.getCellValue(row.getCell(2));
                    weixiudanweiEntity.setShifuxingming(shifuxingming);
                    String xingbie = CommonUtil.getCellValue(row.getCell(3));
                    weixiudanweiEntity.setXingbie(xingbie);
                    String nianling = CommonUtil.getCellValue(row.getCell(4));
                    weixiudanweiEntity.setNianling(nianling);
                    String shifushouji = CommonUtil.getCellValue(row.getCell(5));
                    weixiudanweiEntity.setShifushouji(shifushouji);
                     
                    //想数据库中添加新对象
                    weixiudanweiService.insert(weixiudanweiEntity);//方法
                }
            }
            inputStream.close();
        } catch (InvalidFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return R.ok("导入成功");
    }

}

猜你喜欢

转载自blog.csdn.net/m0_49113107/article/details/125918567