一 后端

1:entity

package com.woniu.community.entity;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;@Data
@AllArgsConstructor
@NoArgsConstructor
public class PropertyInfo {private int  id;private int typeId;private Double money;private String startDate;private String endDate;private Integer status;private int houseId;private  String remarks;private String numbers;private String userName;private String typeName;}

2:PropertyInfoMapper

package com.woniu.community.mapper;import com.woniu.community.entity.PropertyInfo;import java.util.List;public interface PropertyInfoMapper {List<PropertyInfo> selectAll(int start,int size ,String numbers,Integer status);int  count(String numbers,Integer status);int  insertPropertyInfo(PropertyInfo propertyInfo);int  deletePropertyInfo(int id);int updatePropertyInfo(PropertyInfo propertyInfo);PropertyInfo getById(int id);
}

3:IPropertyInfoService

package com.woniu.community.service;import com.woniu.community.entity.HttpResult;
import com.woniu.community.entity.PropertyInfo;import java.util.List;public interface IPropertyInfoService {HttpResult selectAll(int pageIndex, int pageSize , String numbers, Integer status);HttpResult  insertPropertyInfo(PropertyInfo propertyInfo);HttpResult  deletePropertyInfo(int id);HttpResult updatePropertyInfo(PropertyInfo propertyInfo);HttpResult getById(int id);}

4:PropertyInfoServiceImpl

package com.woniu.community.service.impl;import com.woniu.community.entity.HttpResult;
import com.woniu.community.entity.PropertyInfo;
import com.woniu.community.mapper.PropertyInfoMapper;
import com.woniu.community.service.IPropertyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.List;@Service
public class PropertyInfoServiceImpl implements IPropertyInfoService {@Autowired(required=false)private PropertyInfoMapper propertyInfoMapper;@Overridepublic HttpResult selectAll(int pageIndex, int pageSize, String numbers, Integer status) {HttpResult  result=null;List<PropertyInfo> propertyInfos = propertyInfoMapper.selectAll((pageIndex - 1) * pageSize, pageSize, numbers, status);int count = propertyInfoMapper.count(numbers, status);if (propertyInfos!=null&&propertyInfos.size()>0){result=new HttpResult(propertyInfos,count,200,null);}else{result=new HttpResult(null,0,500,null);}return result;}@Overridepublic HttpResult insertPropertyInfo(PropertyInfo propertyInfo) {HttpResult  result=null;int count = propertyInfoMapper.insertPropertyInfo(propertyInfo);if (count>0){result=new HttpResult(null,0,200,"新增成功");}else{result=new HttpResult(null,0,500,"新增失败");}return result;}@Overridepublic HttpResult deletePropertyInfo(int id) {HttpResult  result=null;int count = propertyInfoMapper.deletePropertyInfo(id);if (count>0){result=new HttpResult(null,0,200,"删除成功");}else{result=new HttpResult(null,0,500,"删除失败");}return result;}@Overridepublic HttpResult updatePropertyInfo(PropertyInfo propertyInfo) {HttpResult  result=null;int count = propertyInfoMapper.updatePropertyInfo(propertyInfo);if (count>0){result=new HttpResult(null,0,200,"修改成功");}else{result=new HttpResult(null,0,500,"修改失败");}return result;}@Overridepublic HttpResult getById(int id) {HttpResult  result=null;PropertyInfo info = propertyInfoMapper.getById(id);if (info!=null){result=new HttpResult(info,0,200,null);}else{result=new HttpResult(null,0,500,"没有更多数据");}return result;}
}

5:PropertyInfoController

package com.woniu.community.controller;import com.woniu.community.entity.HttpResult;
import com.woniu.community.entity.PropertyInfo;
import com.woniu.community.service.IPropertyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping ("/property")
@CrossOrigin(origins = "*")
public class PropertyInfoController {@Autowiredprivate IPropertyInfoService  iPropertyInfoService;@RequestMapping("/list")HttpResult selectAll(int pageIndex, int pageSize , String numbers, Integer status){return iPropertyInfoService.selectAll(pageIndex,pageSize,numbers,status);}@RequestMapping("/add")HttpResult  insertPropertyInfo(PropertyInfo propertyInfo){return  iPropertyInfoService.insertPropertyInfo(propertyInfo);}@RequestMapping("/delete")HttpResult  deletePropertyInfo(int id){return iPropertyInfoService.deletePropertyInfo(id);}@RequestMapping("/update")HttpResult updatePropertyInfo(PropertyInfo propertyInfo){return  iPropertyInfoService.updatePropertyInfo(propertyInfo);}@RequestMapping("/info")HttpResult getById(int id){return iPropertyInfoService.getById(id);}
}

6:PropertyInfoMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.woniu.community.mapper.PropertyInfoMapper"><resultMap id="infoMap" type="PropertyInfo"><result column="id" property="id"/><result column="type_id" property="typeId"/><result column="money" property="money"/><result column="start_date" property="startDate"/><result column="end_date" property="endDate"/><result column="status" property="status"/><result column="house_id" property="houseId"/><result column="remarks" property="remarks"/><result column="remarks" property="remarks"/><result column="numbers" property="numbers"/><result column="name" property="typeName"/><result column="username" property="userName"/><result column="name" property="typeName"/></resultMap><select id="selectAll" resultMap="infoMap">select  o.username,h.numbers,c.name,p.* from  property_info pleft  join property_type c  onp.type_id=c.id left  join house h  onp.house_id=h.id  left  join   owner o ono.house_id=h.id<where><if test="numbers !=null  and numbers !='' and numbers!='null'">and  h.numbers=#{numbers}</if><if test="status!=null">and  p.status=#{status}</if></where>limit #{start},#{size}</select><select id="count" resultType="int">selectcount(p.id)fromproperty_info pleft  join property_type c  onp.type_id=c.id left  join house h  onp.house_id=h.id  left  join   owner o ono.house_id=h.id<where><if test="numbers !=null  and numbers !='' and numbers!='null'">and  h.numbers=#{numbers}</if><if test="status!=null">and  p.status=#{status}</if></where></select><insert id="insertPropertyInfo">insert  into property_info(house_id,type_id,start_date,end_date,money,status)values (#{houseId},#{typeId},#{startDate},#{endDate},#{money},#{status})</insert><delete id="deletePropertyInfo">delete  from property_info where id=#{id}</delete><update id="updatePropertyInfo">update property_info set money=#{money},status=#{status} where id=#{id}</update><select id="getById" resultMap="infoMap" >select  *  from property_info where id=#{id}</select>
</mapper>

二 前端代码


<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title><link href="assets/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"><link href="assets/css/right.css" rel="stylesheet"><script src="assets/jquery-3.5.1.min.js"></script><script src="assets/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script><script src="assets/vue.min-v2.5.16.js"></script><script src="assets/vue-router.min-2.7.0.js"></script><script src="assets/axios.min.js"></script>
</head>
<body>
<div id="app" class="container"><div class="row"><div class="col-md-12" style="height: 80px; line-height: 20px;"><div class="row"><div class="col-md-3" style="height: 20px;margin-bottom: 15px">房间号:<input type="text" v-model="numbers"></div><div class="col-md-3" style="height: 20px;margin-bottom: 15px;">缴费状态:<select style="width: 150px;" v-model="status"><option value="1">已缴费</option><option value="0">未缴费</option></select></div><div class="col-md-3" style="height: 20px;margin-bottom: 15px"><button class="btn btn-primary" @click="doQuery">搜索</button></div></div><button class="btn btn-info" @click="doAdd">新增</button></div></div><div class="row"><div class="col-md-12"><table class="table table-striped"><caption>物业收费</caption><thead><tr><th>房间号</th><th>房东</th><th>费用类型</th><th>开始时间</th><th>结束时间</th><th>金额</th><th>状态</th><th>操作</th></tr></thead><tbody><tr v-for="p  in proInfo"><td>{{p.numbers}}</td><td>{{p.userName}}</td><td>{{p.typeName}}</td><td>{{p.startDate}}</td><td>{{p.endDate}}</td><td>{{p.money}}</td><td>{{p.status==1?"已缴费":"未缴费"}}</td><td v-if="p.status==1"><button class="btn btn-danger" @click="doDelete(p.id)">删除</button></td><td v-else="p.status==0"><button class="btn btn-info" @click="doUpdate(p.id)">缴费</button><button class="btn btn-danger" @click="doDelete(p.id)">删除</button></td></tr></tbody></table><ul class="pagination" v-for="p in pageNum"><li v-if="p==pageIndex" class="active"><a @click="doGO(p)">{{p}}</a></li><li v-else="p==pageIndex"><a @click="doGO(p)">{{p}}</a></li></ul></div></div>
</div>
<script>new Vue({el: '#app',data: {proInfo:null,pageIndex:1,pageSize:5,pageTotal:0,pageNum:0,numbers:'',status:'',},methods: {requestCarList(url){axios.get(url).then(response=>{this.proInfo=response.data.data;this.pageTotal=response.data.pageTotal;//总条数this.pageNum=Math.ceil(this.pageTotal / this.pageSize);})},doQuery(){this.doGO(1);},doGO(p){this.pageIndex=p;var  url="http://localhost:8080/property/list?pageIndex="+p+"&pageSize="+this.pageSize+"&numbers="+this.numbers+"&status="+this.status;console.log(url);this.requestCarList(url);},doAdd(){window.parent.main_right.location.href = "proInfo_add_update.html";},doDelete(id){var url="http://localhost:8080/property/delete?id="+id;axios.get(url).then(response=>{if (response.data.code==200){var  url="http://localhost:8080/property/list?pageIndex="+this.pageIndex+"&pageSize="+this.pageSize;this.requestCarList(url);}else{alert(response.data.msg)}})},doUpdate(id){window.parent.main_right.location.href = "proInfo_add_update.html?id="+id;},},created: function () {var  url="http://localhost:8080/property/list?pageIndex="+this.pageIndex+"&pageSize="+this.pageSize;this.requestCarList(url);}});
</script>
</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title><link href="assets/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"><link href="assets/css/right.css" rel="stylesheet"><script src="assets/jquery-3.5.1.min.js"></script><script src="assets/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script><script src="assets/vue.min-v2.5.16.js"></script><script src="assets/vue-router.min-2.7.0.js"></script><script src="assets/axios.min.js"></script><script src="assets/date_picker.js"></script>
</head>
<body>
<div id="app" class="container"><div class="row"><div class="col-md-8 col-md-offset-2"><div class="row"><div class="col-md-12" style="text-align: center; font-weight: bold; font-size: 18px; height: 80px; line-height: 80px;">{{title}}</div></div><div class="row"><div class="col-md-6 col-md-offset-3" style="height: 240px;">房间号:<select v-model="houseId"><option v-for="h in houseList":value="h.id">{{h.numbers}}</option></select><br>费用类型:<select v-model="typeId"><option value="2">水费</option><option value="3">电费</option><option value="1">物业费</option><option value="4">停车费</option></select><br><label>开始时间:</label><input type="date" class="form-control" v-model="startDate"/><label>结束时间:</label><input type="date" class="form-control" v-model="endDate"/><lable>金额</lable><input type="text" v-model="money"><br>状态:<select v-model="status"><option value="1">缴费</option><option value="0">未缴费</option></select></div></div><div class="row"><div class="col-md-6 col-md-offset-3" style="height: 80px;"><button class="btn btn-primary" @click="doSave">保存</button><button class="btn btn-default" @click="doNot">取消</button></div></div></div></div>
</div>
<script>new Vue({el: '#app',data: {title: null,houseId:null,houseList:null,ownerId:null,ownerList:null,startDate:null,endDate:null,money:null,status:null,typeId:null,proInfoId:null,userName:null,},methods: {requestParkingList(){var url="http://localhost:8080/house/list?pageIndex=1&pageSize=100";axios.get(url).then(response=>{this.houseList=response.data.data;})},// requestOwnerList(){//     var url="http://localhost:8080/owner/list?pageIndex=1&pageSize=100";//     axios.get(url).then(response=>{//         this.ownerList=response.data.data;//     })// },getById(){var url="http://localhost:8080/property/info?id="+this.proInfoId;console.log(url);axios.get(url).then(response=>{this.houseId=response.data.data.houseId;this.ownerId=response.data.data.ownerId;this.typeId=response.data.data.typeId;this.startDate=response.data.data.payDate;this.endDate=response.data.data.endDate;this.money=response.data.data.money;this.status=response.data.data.status;})},doSave(){if (this.proInfoId==null){this.title="添加信息"var  url="http://localhost:8080/property/add?houseId="+this.houseId+"&typeId="+this.typeId+"&startDate="+this.startDate+"&endDate="+this.endDate+"&money="+this.money+"&status="+this.status;console.log(url)axios.get(url).then(response=>{if (response.data.code==200){window.parent.main_right.location.href = "proInfo_list.html";}else{alert(response.data.msg)}})}else{this.title="缴费"var   url="http://localhost:8080/property/update?money="+this.money+"&status="+this.status+"&id="+this.proInfoId;console.log(url)axios.get(url).then(response=>{if (response.data.code==200){window.parent.main_right.location.href = "proInfo_list.html";}else{alert(response.data.msg)}})}},doNot(){history.go(-1);}},created: function () {this.requestParkingList();// this.requestOwnerList();var  url=window.location.href;if (url.indexOf("id")!=-1){this.proInfoId=url.substring(url.indexOf("=")+1);}if (this.proInfoId==null){this.title="添加信息"}else{this.title="缴费"this.getById();}}});
</script>
</body>
</html>

三 运行结果



# 智慧社区管理系统-核心信息管理-02物业收费管理相关推荐

  1. # 智慧社区管理系统-基础信息管理-06抄表管理

    一后端 1:entity package com.woniu.community.entity;import lombok.AllArgsConstructor; import lombok.Data ...

  2. # 智慧社区管理系统-基础信息管理-05车位管理

    一后端 1:entuty package com.woniu.community.entity;import lombok.AllArgsConstructor; import lombok.Data ...

  3. 【计算机毕业设计】智慧社区管理系统

    一.系统截图(需要演示视频可以私聊) 摘 要 随着科学技术的飞速发展,社会的方方面面.各行各业都在努力与现代的先进技术接轨,通过科技手段来提高自身的优势,智慧社区管理系统当然也不能排除在外.智慧社区管 ...

  4. 智慧社区管理系统11(物业收费管理列表和功能实现)

    目录 后端代码 实体类 Mapper层 Mapper sql文件 Service层 接口 实现类 Controller层 前端部分 列表显示 增加和修改 后端代码 实体类 package com.wo ...

  5. 智慧社区管理系统常见功能有哪些

    智慧社区管理系统可实现线上管理功能,如业主信息管理.物业缴费.线上报修等基本功能,同时支持多元化完善社区服务,社区便民服务.社区新闻资讯.社区生活商圈等,方案直接提升了物业与业主的办事效率. 智能停车 ...

  6. 家谱管理系统性能要求_华北工控 | 嵌入式计算机在智慧社区管理系统中的大范畴应用...

    随着"智能+"时代的到来,国家大力倡导老旧小区基础设施升级改造,物联网.互联网.大数据等新一代信息技术为小区传统物业向智慧社区现代物管转型提供了强有力的技术支撑,智慧社区建设备受市 ...

  7. 快鲸智慧社区系统是如何助力物业公司降本增收的?

    随着移动互联网技术的兴起,传统的物业管理行业也正在向智慧物业悄然转型.智慧物业即是使用现代互联网信息技术,在物业行政管理部门,物业服务公司.业主.商家等主体间建立高集成度的数字化管理平台,统筹整理各类 ...

  8. 智慧社区管理系统助力实现社区数字化管理

    社区是人们生活的重要场所,传统社区的运营及管理方式已经无法满足人们日益增长的物质和文化生活需要.社区的通讯.安全和社区居民信息的收集.处理及共享等问题都成为阻碍社区服务进一步发展的瓶颈. 智慧社区是利 ...

  9. 智慧社区解决方案核心要点有哪些 智慧社区解决方案

    智慧社区解决方案核心要点有哪些 智慧社区解决方案 城市的发展意味着生产与消费的集中化与规模化,这些改变带来了生产效率的提高.而智慧社区解决方案核心要点有哪些呢?下面跟着小编一起去了解下! 智慧社区解决 ...

最新文章

  1. boost::hana::just用法的测试程序
  2. keybd_event跟SendMessage,PostMessage模拟键盘消息的区别 z
  3. go---字符串截取
  4. Equipment download scenario2
  5. 如何在ORACLE CLOUD中创建和访问容器集群丨内附官方文档链接
  6. 【.NET Core项目实战-统一认证平台】第十二章 授权篇-深入理解JWT生成及验证流程...
  7. 技术员例会记要(一)
  8. 液晶屏和计算机组成,液晶显示屏结构是什么 液晶显示屏结构介绍【图文】
  9. 3-51单片机ESP8266学习-AT指令(学会刷固件)
  10. apache的虚拟目录配置
  11. 计算机科学导论有关论文,计算机科学导论论文
  12. 北京交通大学《机器学习》课程总结
  13. 各大媒体优劣对比_各种媒体的优缺点分析()
  14. 第13课:构建神经网络模型的实用建议
  15. android恶意积分墙代码,传统积分墙的忧虑:微信积分墙刷榜优化分析
  16. matlab获取基金数据,读取WIND数据(行情、基金净值等)的SAS程序
  17. 2022天梯L1-L2题解
  18. 粒子系统(二):绘制精美几何图案
  19. bzoj3875 [Ahoi2014Jsoi2014]骑士游戏
  20. android(安卓系统)系统下优秀的笔记软件,小筑笔记app下载 小筑笔记(手机笔记本软件) for Android v1.31 安卓手机版 下载-脚本之家...

热门文章

  1. 自制文件传输助手,实现数据安全备忘与跨平台传输(优化)
  2. RGP游戏的非主流应用——虚拟地图
  3. 免费网络短信Android,5G消息?国产安卓现在就能体验免费RCS增强短信
  4. jsp物流信息发布管理平台
  5. 静态网站(博客)生成器Static Site Generators(SSGs)大集合
  6. 01-如何选购CPU散热器?小白装机通俗易懂的水冷/风冷CPU散热器知识
  7. Jquery找父元素,祖先,子元素,子孙,兄弟节点
  8. java lambdamart库,LambdaMART简介——基于Ranklib源码(一 lambda计算)
  9. 全球与中国圆顶隔膜阀市场发展动态及投资趋向建议报告2021年版
  10. 小白福音——VBA编程常用——命令三百例