源码获取:博客首页 "资源" 里下载!
本系统功能包括: 实现了资源管理、收费管理、支出管理、三表管理、投诉 建议、装修管理、车位管理、招商管理、物料管理、设备 管理、人事考勤、安保消防、报事报修、绿化管理、保洁 管理、权限管理等一些功能,还有一些细节功能没有实现需 要大家一起完善,提供给大家学习参考使用。
环境配置: Jdk1.8 + Tomcat8.5 + Mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +SpringBoot + MyBatis + Json+ Css + JavaScript + JQuery + Ajax + PageHelper+ Maven等等。
/**
* @category 装修控制器
*
*/
@Controller
public class AdornController {
@Autowired
AdornService adornService;
/**
* 查找所有
*/
@RequestMapping("/adornall")
public String adornAll(Model model) {
List list = adornService.findAll();
model.addAttribute("adornlist", list);
return "adorn";
}
/**
* 按类型删除
*/
@RequestMapping("/findbystate")
public String findByState(Model model, String state) {
List list = adornService.findByState(state);
model.addAttribute("adornlist", list);
return "adorn";
}
}
/**
* @category 商铺控制器
*
*/
@Controller
public class BiddingController {
@Autowired
BiddingService biddingService;
@Autowired
TenderService tenderService;
@RequestMapping("/savestorebid")
public String addOne(Model model, Bidding bidding, double price) {
double price1 = bidding.getArea() * price;
Timestamp d = new Timestamp(System.currentTimeMillis());
bidding.setPrice(price1);
bidding.setDate(d);
bidding.setState("正在竞标");
biddingService.addOne(bidding);
return "redirect:biddinging.action";
}
@RequestMapping("/")
public String zhuye() {
return "redirect:jingbiao.action";
}
@RequestMapping("/biddingshow")
public String biddingShow(Model model) {
List list = biddingService.findAll();
model.addAttribute("biddinglist", list);
return "bidding";
}
@RequestMapping("/deletebiddingone")
public String deleteOne(int bid) {
return null;
}
@RequestMapping("/biddinging")
public String biddingIng(Model model) {
List list = tenderService.findAll();
model.addAttribute("adornShowList", list);
return "audit";
}
@RequestMapping("/mybidding")
public String mybidding(Model model, HttpSession session) {
String tel = (String) session.getAttribute("userTel");
List list = tenderService.findByTel(tel);
for (TenderVo t : list) {
System.out.println(t.getTid());
}
model.addAttribute("mylist", list);
return "myjingbiao";
}
@RequestMapping("/savejingbianman")
public String savejingbianman(int bid, Tender tender, Model model, HttpSession session) {
biddingService.updateOne(bid);
try {
Thread.sleep(1000);
tenderService.addOne(tender);
} catch (InterruptedException e) {
e.printStackTrace();
}
session.setAttribute("userTel", tender.getTel());
return "redirect:jingbiao.action";
}
@RequestMapping("/jingbiao")
public String jingbiao(Model model) {
List list = biddingService.findAll();
model.addAttribute("biddinglist", list);
return "jingbiao";
}
@RequestMapping("/deletemyjingbiao")
public String deletemyjingbiao(int tid) {
System.out.println("deletemyjingbiao:" + tid);
tenderService.deleteTenderOne(tid);
return "redirect:jingbiao.action";
}
/**
* 通过audit字段查找list
*/
@RequestMapping("/auditingbyaudit")
public String auditingbyaudit(Model model, String audit) {
List list = tenderService.findByAudit(audit);
model.addAttribute("adornShowList", list);
return "audit";
}
@RequestMapping("/auditingbyliftstate")
public String auditingbyliftstate(Model model, int liftstate) {
List list = tenderService.findByLiftstate(liftstate);
model.addAttribute("adornShowList", list);
return "audit";
}
/**
* 拒绝竞标控制
*/
@RequestMapping("/refuse")
public String refuse(int tid, String remaker) {
System.out.println("refuse:" + remaker);
tenderService.refuse(tid, remaker);
return "redirect:biddinging.action";
}
/**
* 竞标通过
*/
@RequestMapping("/yespass")
public String yespass(int tid) {
biddingService.yesPass(tid);
return "redirect:biddinging.action";
}
/**
* 搜索展示
*/
@RequestMapping("/searchjb")
public String searchjb(String searchtext,Model model) {
List list = new ArrayList();
list = biddingService.selectLike(searchtext);
if(list.size()==0) {
String[] str = searchtext.split("");
for (int i = 0; i < str.length; i++) {
list = biddingService.selectLike(str[i]);
if(list.size()>0) break;
if(biddingService.selectLike(str[str.length-1]).size()<=0) {
list = biddingService.selectLike("");
}
}
}
model.addAttribute("biddinglist", list);
return "jingbiao";
}
}
/**
* @category 未缴费账单控制器
*
*/
@Controller
public class BillController {
@Autowired
private BillService billService;
@Autowired
private BillitemsService bitemService;
@Autowired
private OwnerService oService;
private SimpleDateFormat cx = new SimpleDateFormat("yyyy-MM-dd");
/**
* @category 跳转至业主未缴费展示页面
* @param model
* @return
*/
@RequestMapping("/unpay")
public String unpay(Model model) {
// SimpleDateFormat cx = new SimpleDateFormat("yyyy-MM-dd");
String start = "2010-01-01";
String stop = cx.format(new Date());
List list = billService.findByOwner();
model.addAttribute("list", list);
model.addAttribute("start", start);
model.addAttribute("stop", stop);
model.addAttribute("inputname", "请输入姓名");
return "unpay";
}
/**
* @category 通过给定时间范围展示和业主模糊姓名联合查询缴费信息
* @param model
* @param request
* @return
* @throws ParseException
*/
@RequestMapping("/unpaytime")
public String unpayByTime(Model model, HttpServletRequest request, HttpSession session) throws ParseException {
// 获取分页参数设置每页展示的个数
int pageSize = (int) session.getAttribute("pageSize");
// 获取分页参数设置传进来的页码是多少
int pageNum = (int) session.getAttribute("pageNum");
// 将字符串转换为日期对象
Date start = cx.parse(request.getParameter("start"));
Date stop = cx.parse(request.getParameter("stop"));
// System.out.println(request.getParameter("start"));
String name = request.getParameter("username");
// System.out.println(name);
// 账单的时间用于和stop和start比较
Date billdate;
// 开始时间戳
long startTime = start.getTime();
// 结束时间戳
long stopTime = stop.getTime();
long billtime;
// 用该list给owner对象的billlist设值
List billlist = new ArrayList<>();
// 查找所有
List list1 = billService.findByOwner();
List list = new ArrayList<>();
// 生成要返回的list
for (int i = 0; i < list1.size(); i++) {
double total = 0;
// 循环遍历得到的所有owner对象
for (int j = 0; j < list1.get(i).getBill().size(); j++) {
//获得owner单个订单的时间戳
billdate = cx.parse(list1.get(i).getBill().get(j).getBilltime());
billtime = billdate.getTime();
//判断订单的时间戳是否在指定的范围内,并且该owner的姓名要包含指定的字符串
try {
if (billtime >= startTime && billtime <= stopTime && list1.get(i).getOname().contains(name)) {
// 如果满足上述条件,则将该条订单信息添加到billlist中
billlist.add(list1.get(i).getBill().get(j));
// 计算总价
total += list1.get(i).getBill().get(j).getBillitem().getBillitemmoney();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// 如果该业主有未缴纳的账单,给该业主对象设置未缴纳账单,并将该对象放入要传给前端的list中
if (billlist.size() > 0) {
list1.get(i).setTotal(total);
list1.get(i).setBill(billlist);
list.add(list1.get(i));
}
// 这里不能使用clear() 用list.clear()方法清空list;用此方法,其它引用该list的值也会变成空。
billlist = new ArrayList<>();
}
if (list.size() < 1) {
model.addAttribute("nolist", "没有查到相关信息呦,请您重新输入查询条件");
}
// 计算查询总数
double listnum = list.size();
int totalnum = (int) Math.ceil(listnum / pageSize);
List list2 = FyResult.getOwnerList(pageSize, pageNum, list, "f");
// System.out.println(list.size());
session.setAttribute("start", request.getParameter("start"));
session.setAttribute("stop", request.getParameter("stop"));
model.addAttribute("list", list2);
model.addAttribute("name", name);
model.addAttribute("totalnum", totalnum);
session.setAttribute("pageSize", pageSize);
session.setAttribute("pageNum", pageNum);
session.setAttribute("findList", list);
return "unpay";
}
/**
* @category 收费项目管理界面
* @param model
* @return
*/
@RequestMapping("/sfmanage")
public String shoufeiguanli(Model model) {
BillitemsExample example = new BillitemsExample();
List list = bitemService.selectByExample(example);
model.addAttribute("list", list);
return "sfmanage";
}
/**
* @category 添加新的收费项目
* @param model
* @param billitem
* @return
*/
@RequestMapping("/addbillitem")
public String addbillitem(Model model, Billitems billitem) {
// 判断添加的收费项目是否为一次性收费
if (billitem.getBillitemtype().equals("一次性")) {
Date d = new Date();
// 生成一次性收费的时间
// SimpleDateFormat itemtime = new SimpleDateFormat("yyyy-MM-dd");
String time = cx.format(d);
billitem.setBillitemtime(time);
// 添加到数据库
bitemService.insert(billitem);
// 从数据库查刚刚添加的收费项目
Billitems item = bitemService.selectByNameAndTime(billitem.getBillitemname(), time);
// 给所有的业主添加这个费用收费
List olist = oService.selectByExample();
int[] all = new int[olist.size()];
// 给数组all赋值业主的id
for (int i = 0; i < all.length; i++) {
all[i] = olist.get(i).getOid();
}
Bill bill = new Bill();
bill.setBillitemid(item.getBillitemid());
bill.setPaystatus("未缴纳");
bill.setBilltime(time);
for (int i = 0; i < all.length; i++) {
bill.setUid(all[i]);
billService.addBill(bill);
}
return "redirect:sfmanage.action";
}
bitemService.insert(billitem);
return "redirect:sfmanage.action";
}
/**
* @category 搜索后展示缴费
* @param model
* @param request
* @return
*/
@RequestMapping("/showbyname")
public String showbyname(Model model, HttpServletRequest request, HttpSession session) {
int pageSize = (int) session.getAttribute("pageSize");
int pageNum = (int) session.getAttribute("pageNum");
String name = request.getParameter("username");
// System.out.println(name);
List list1 = billService.findByOwner();
List list2 = FyResult.getOwnerList(pageSize, pageNum, list1, "f");
// System.out.println(list1.size());
List list = new ArrayList<>();
for (int i = 0; i < list2.size(); i++) {
// System.out.println(list1.get(i).getOname());
if (list1.get(i).getOname().contains(name)) {
list.add(list1.get(i));
}
}
double listnum = list1.size();
int totalnum = (int) Math.ceil(listnum / pageSize);
session.setAttribute("findList", list);
session.setAttribute("pageSize", pageSize);
session.setAttribute("pageNum", pageNum);
model.addAttribute("list", list);
model.addAttribute("inputname", name);
model.addAttribute("totalnum", totalnum);
return "unpay";
}
/**
* @category ajax搜索
* @param name
* @return
*/
@RequestMapping("/showname")
public @ResponseBody List showname(String name) {
System.out.println("进来了");
List list1 = oService.selectByExample();
List list = new ArrayList<>();
for (int i = 0; i < list1.size(); i++) {
if (list1.get(i).getOname().contains(name)) {
list.add(list1.get(i));
}
}
return list;
}
@SuppressWarnings("unchecked")
@RequestMapping("/unpayfy")
public String unpayfy(Model model, HttpSession session, int pageSize, int pageNum, String type,
HttpServletRequest request) {
System.out.println(pageNum);
String stop;
String start;
// SimpleDateFormat cx = new SimpleDateFormat("yyyy-MM-dd");
if (session.getAttribute("stop") != null) {
stop = (String) session.getAttribute("stop");
} else {
stop = cx.format(new Date());
}
if (session.getAttribute("start") != null) {
start = (String) session.getAttribute("start");
} else {
start = "2010-01-01";
}
List list1 = new ArrayList<>();
if (session.getAttribute("findList") != null) {
list1 = (List) session.getAttribute("findList");
} else {
list1 = billService.findByOwner();
}
double listnum = list1.size();
int totalnum = (int) Math.ceil(listnum / pageSize);
List list = FyResult.getOwnerList(pageSize, pageNum, list1, type);
if (type.equals("z")) {
++pageNum;
if (pageNum > totalnum) {
pageNum = totalnum;
}
}
if (type.equals("j")) {
--pageNum;
if (pageNum < 1) {
pageNum = 1;
}
}
if(type.equals("f")) {
if(pageNum<1) {
pageNum=1;
}
if(pageNum>totalnum) {
pageNum = totalnum;
}
}
model.addAttribute("list", list);
session.setAttribute("stop", stop);
session.setAttribute("start", start);
session.setAttribute("pageSize", pageSize);
session.setAttribute("pageNum", pageNum);
model.addAttribute("totalnum", totalnum);
return "unpay";
}
}
/**
* @category 房间处理器
*
*/
@Controller
public class HouseController {
@Autowired
private HouseNumberService hService;
/**
* @category 通过传入参数展示相应的房屋信息
* @param type
* @param model
* @return
*/
@RequestMapping("/showhouse")
public String showhouse(@RequestParam ("type") String type,Model model) {
System.out.println(type);
HousenumberExample example=new HousenumberExample();
List list=hService.selectByExample(example);
List list1=new ArrayList();
if(type.equals("a")) {
model.addAttribute("list", list);
model.addAttribute("can", "a");
return "house";
}
else if(type.equals("x")) {
for (int i = 0; i < list.size(); i++) {
if(list.get(i).getStatus().equals("闲置")) {
list1.add(list.get(i));
}
}
model.addAttribute("can", "x");
model.addAttribute("list", list1);
return "house";
}
else if(type.equals("y")) {
for (int i = 0; i < list.size(); i++) {
if(list.get(i).getStatus().equals("已出售")) {
list1.add(list.get(i));
}
}
model.addAttribute("can", "y");
model.addAttribute("list", list1);
return "house";
}
return "mian";
}
/**
* @category 跳转到更新房屋信息页面
* @param model
* @param homeid
* @return
*/
@RequestMapping("/updatehouse")
public String updatehouse(Model model,@RequestParam ("homeid") int homeid) {
Housenumber house=hService.selectByPrimaryKey(homeid);
model.addAttribute("house", house);
return "updatehouse";
}
/**
* @category 跟新房屋信息
* @param model
* @param house
* @return
*/
@RequestMapping("/updatehouse1")
public String updatehouse1(Model model, Housenumber house) {
String type=house.getStatus();
if(type.equals("闲置")) {
type="x";
}else if(type.equals("已出售")) {
type="y";
}
System.out.println(house.getStatus());
hService.updateByPrimaryKeySelective(house);
model.addAttribute("house", house);
return "redirect:showhouse.action?type="+type;
}
/**
* @category 添加新的闲置房屋
* @param model
* @param house
* @return
*/
@RequestMapping("/addhouse")
public String addhouse(Model model,Housenumber house) {
house.setSaleprice(0);
hService.insert(house);
return "redirect:showhouse.action?type=a";
}
}
源码获取:博客首页 "资源" 里下载!