├── 报修服务.png ├── 用户登录.png ├── 网站首页.png ├── 后台住房管理.png ├── 后台抄表管理.png ├── 后台查看成员.png ├── 后台车位管理.png ├── README.md └── UserService.java /报修服务.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/报修服务.png -------------------------------------------------------------------------------- /用户登录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/用户登录.png -------------------------------------------------------------------------------- /网站首页.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/网站首页.png -------------------------------------------------------------------------------- /后台住房管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/后台住房管理.png -------------------------------------------------------------------------------- /后台抄表管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/后台抄表管理.png -------------------------------------------------------------------------------- /后台查看成员.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/后台查看成员.png -------------------------------------------------------------------------------- /后台车位管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzl0898/java-xiaoqu1/HEAD/后台车位管理.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # java-xiaoqu1 2 | 基于springboot的java小区物业管理系统,系统前端采用layui,后端采用SpringBoot,mybatis,管理端可手动选择显示的列,信息关联自动带入功能。用户功能:用户登录、报修服务、投诉服务、登录校验、信息介绍;管理功能:楼宇管理、住房管理、车位管理、物业管理等。系统页面设计良好、内容丰富、功能齐全,适合用做课设和毕设等学习。详细请点击仓库名称进入查看网站前后台图片,如需源码及数据库文件,请联系Q:2364821220 3 | # 网站截图 4 | ![image](https://github.com/hzl0898/java-xiaoqu1/blob/main/网站首页.png) 5 | ![image](https://github.com/hzl0898/java-xiaoqu1/blob/main/报修服务.png) 6 | ![image](https://github.com/hzl0898/java-xiaoqu1/blob/main/后台住房管理.png) 7 | -------------------------------------------------------------------------------- /UserService.java: -------------------------------------------------------------------------------- 1 | package com.project.property.service; 2 | 3 | import cn.hutool.core.util.IdcardUtil; 4 | import cn.hutool.core.util.StrUtil; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import com.project.property.dao.*; 8 | import com.project.property.entity.*; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | import javax.annotation.Resource; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @Author Mr.Wang 17 | * @Date 2020/10/26 18 | * @Description 下一位读我代码的人,有任何疑问请联系我,QQ:943701114 19 | */ 20 | @Service 21 | public class UserService{ 22 | 23 | @Resource 24 | private UserMapper userMapper; 25 | 26 | @Resource 27 | private UserUnitRelationMapper unitRelationMapper; 28 | 29 | @Resource 30 | private HouseInfoMapper houseInfoMapper; 31 | 32 | @Resource 33 | private CarParkMapper carParkMapper; 34 | 35 | @Resource 36 | private UserComplaintMapper userComplaintMapper; 37 | 38 | @Resource 39 | private UserRepairMapper userRepairMapper; 40 | 41 | @Resource 42 | private PropertyPayVisitMapper propertyPayVisitMapper; 43 | 44 | /** 45 | * 根据主键删除 46 | * @param ids 47 | * @return 48 | */ 49 | public int deleteByPrimaryKey(String ids) { 50 | // 查询改用户信息是否被 用户与住房信息绑定, 如果有绑定不可删除 51 | List relations = unitRelationMapper.selectInfoByIds(null, ids); 52 | if(relations != null && relations.size() > 0) { 53 | return -500; 54 | } 55 | return userMapper.deleteByPrimaryKey(ids); 56 | } 57 | 58 | /** 59 | * 全量插入 60 | * @param record 61 | * @return 62 | */ 63 | public int insert(User record) { 64 | // 判断如果身份证号不为空则查询身份证号信息 65 | if(!StrUtil.isBlank(record.getCardNum())) { 66 | // 使用Hutool工具类解析身份证 67 | // 户籍信息 68 | record.setRegisterAddress(IdcardUtil.getProvinceByIdCard(record.getCardNum())); 69 | // 性别 70 | record.setSex(IdcardUtil.getGenderByIdCard(record.getCardNum()) == 0 ? "女" : "男"); 71 | } 72 | return userMapper.insert(record); 73 | } 74 | 75 | /** 76 | * 选择性插入 77 | * @param record 78 | * @return 79 | */ 80 | public int insertSelective(User record) { 81 | // 判断如果身份证号不为空则查询身份证号信息 82 | if(!StrUtil.isBlank(record.getCardNum())) { 83 | // 使用Hutool工具类解析身份证 84 | // 户籍信息 85 | record.setRegisterAddress(IdcardUtil.getProvinceByIdCard(record.getCardNum())); 86 | // 性别 87 | record.setSex(IdcardUtil.getGenderByIdCard(record.getCardNum()) == 0 ? "女" : "男"); 88 | } 89 | return userMapper.insertSelective(record); 90 | } 91 | 92 | /** 93 | * 根据主键查询 94 | * @param id 95 | * @return 96 | */ 97 | public User selectByPrimaryKey(Integer id) { 98 | return userMapper.selectByPrimaryKey(id); 99 | } 100 | 101 | /** 102 | * 根据主键选择性更新 103 | * @param record 104 | * @return 105 | */ 106 | public int updateByPrimaryKeySelective(User record) { 107 | // 判断如果身份证号不为空则查询身份证号信息 108 | if(!StrUtil.isBlank(record.getCardNum())) { 109 | // 使用Hutool工具类解析身份证 110 | // 户籍信息 111 | record.setRegisterAddress(IdcardUtil.getProvinceByIdCard(record.getCardNum())); 112 | // 性别 113 | record.setSex(IdcardUtil.getGenderByIdCard(record.getCardNum()) == 0 ? "女" : "男"); 114 | } 115 | // 更新前将相关数据更新 116 | HouseInfo houseInfo = new HouseInfo(); 117 | houseInfo.setUserId(record.getId()); 118 | houseInfo.setOwnerName(record.getUserName()); 119 | houseInfo.setPhone(record.getPhone()); 120 | houseInfoMapper.updateInfoByUserId(houseInfo); 121 | List carPark = carParkMapper.selectInfoByUserName(record.getUserName()); 122 | if(carPark != null && carPark.size() > 0) { 123 | for (CarPark park : carPark) { 124 | park.setOwnerName(record.getUserName()); 125 | park.setPhone(record.getPhone()); 126 | // 调用更新方法 127 | carParkMapper.updateByPrimaryKeySelective(park); 128 | } 129 | } 130 | UserComplaint userComplaint = new UserComplaint(); 131 | userComplaint.setUserId(record.getId()); 132 | userComplaint.setUserName(record.getUserName()); 133 | userComplaint.setPhone(record.getPhone()); 134 | userComplaintMapper.updateInfoByUserId(userComplaint); 135 | UserRepair userRepair = new UserRepair(); 136 | userRepair.setUserId(record.getId()); 137 | userRepair.setUserName(record.getUserName()); 138 | userRepair.setPhone(record.getPhone()); 139 | userRepairMapper.updateInfoByUserId(userRepair); 140 | List propertyPayVisit = propertyPayVisitMapper.selectInfoByUserName(record.getUserName()); 141 | if(propertyPayVisit != null && propertyPayVisit.size() > 0) { 142 | for (PropertyPayVisit payVisit : propertyPayVisit) { 143 | payVisit.setClientName(record.getUserName()); 144 | propertyPayVisitMapper.updateByPrimaryKeySelective(payVisit); 145 | } 146 | } 147 | 148 | return userMapper.updateByPrimaryKeySelective(record); 149 | } 150 | 151 | /** 152 | * 根据主键更新信息 153 | * @param record 154 | * @return 155 | */ 156 | public int updateByPrimaryKey(User record) { 157 | // 判断如果身份证号不为空则查询身份证号信息 158 | if(!StrUtil.isBlank(record.getCardNum())) { 159 | // 使用Hutool工具类解析身份证 160 | // 户籍信息 161 | record.setRegisterAddress(IdcardUtil.getProvinceByIdCard(record.getCardNum())); 162 | // 性别 163 | record.setSex(IdcardUtil.getGenderByIdCard(record.getCardNum()) == 0 ? "女" : "男"); 164 | } 165 | return userMapper.updateByPrimaryKey(record); 166 | } 167 | 168 | /** 169 | * 分页查询数据 170 | * @param user 查询条件 171 | * @param page 当前页 172 | * @param limit 每页显示条数 173 | * @return 174 | */ 175 | public List selectDataByPage(User user, Integer page, Integer limit) { 176 | // 开启分页插件 177 | PageHelper.startPage(page, limit); 178 | // 使用分页工具查询 179 | PageInfo pageInfo = new PageInfo(userMapper.selectDataByParam(user)); 180 | // 返回数据 181 | return pageInfo.getList(); 182 | } 183 | 184 | /** 185 | * 查询数据总量 186 | * @param user 187 | * @return 188 | */ 189 | public Integer selectDataCount(User user) { 190 | return userMapper.selectDataCount(user); 191 | } 192 | 193 | /** 194 | * 根据条件查询 195 | * @param user 196 | * @return 197 | */ 198 | public List selectDataByParam(User user) { 199 | return userMapper.selectDataByParam(user); 200 | } 201 | 202 | /** 203 | * 前台登陆 204 | * @param user 205 | * @return 206 | */ 207 | public User selectLoginByParam(User user) { 208 | return userMapper.selectLoginByParam(user); 209 | } 210 | } 211 | --------------------------------------------------------------------------------