package com.www.controller;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLDecoder;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.www.bean.TaskReportBean;
import com.www.entity.Repairtask;
import com.www.service.RepairTaskService;
import com.www.util.DwrService;
import com.www.util.HttpUtil;
import com.www.util.Page;
import com.www.util.Pagination;
@Controller
@RequestMapping("/repairtask")
public class RepairTaskController {
@Resource
private RepairTaskService repairTaskService;
//供维修人员看到的全部维修任务
@RequestMapping(value = "/list")
protected ModelAndView list(HttpServletRequest request,
HttpServletResponse response) throws Exception {
System.out.println("进来了?。。。。。");
HttpUtil util = new HttpUtil(request, response);
int startRow = util.parseInt(Pagination.START_ROW);
Map<String, Object> map = new HashMap<String, Object>();
String name="";
String sql = "from Repairtask where 1=1 order by createtime desc";
List<Repairtask> l = new ArrayList<Repairtask>();
Page page = repairTaskService.findPageByHQL(sql, startRow, 9, null);
if (page != null && page.getList() != null) {
List lists = page.getList();
for (int i = 0; i < lists.size(); i++) {
Repairtask repairtask = (Repairtask) lists.get(i);
l.add(repairtask);
}
}
map.put("list", l);
map.put("page", page);
System.out.println("我到这里了。。。");
return new ModelAndView("repair/repairlist", map);
}
// 维修人员 ======我的维修任务
@RequestMapping(value = "/mylist")
protected ModelAndView mylist(HttpServletRequest request,
HttpServletResponse response) throws Exception {
HttpUtil util = new HttpUtil(request, response);
int startRow = util.parseInt(Pagination.START_ROW);
System.out.println("进来了?。。。。。");
String name = "";
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equals("username")) {
name = URLDecoder.decode(cookies[i].getValue(), "utf-8");
System.out.println("登录名" + name
+ "<<<<<<<<<<<======>>>>>>>>>");
}
}
}
Map<String, Object> map = new HashMap<String, Object>();
String reqBody = name;
System.out.println(reqBody + "req....................");
StringBuffer hql = new StringBuffer("from Repairtask where 1=1");
System.out.println(hql + "hql================");
List param = new ArrayList();
if (reqBody != null && !"".equals(reqBody)) {
hql.append(" and workpeople =?");
param.add(reqBody);
System.out.println(param + "param'''''''''''''333===");
}
hql.append(" order by grabtime desc");
List<Repairtask> l = new ArrayList<Repairtask>();
Page page = repairTaskService.findPageByHQL(hql.toString(), startRow,
9, param.toArray());
if (page != null && page.getList() != null) {
List lists = page.getList();
for (int i = 0; i < lists.size(); i++) {
Repairtask repairtask = (Repairtask) lists.get(i);
l.add(repairtask);
}
}
// List list = repairTaskService.findAll(hql.toString(),
// param.toArray());
map.put("list", l);
map.put("page", page);
System.out.println("我到这里了。。。");
return new ModelAndView("repair/myrepairlist", map);
}
// 业主 ======我的报修
@RequestMapping(value = "/ownerlist")
protected ModelAndView ownerlist(HttpServletRequest request,
HttpServletResponse response) throws Exception {
HttpUtil util = new HttpUtil(request, response);
int startRow = util.parseInt(Pagination.START_ROW);
System.out.println("进来了?。。。。。");
String name = "";
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equals("username")) {
name = URLDecoder.decode(cookies[i].getValue(), "utf-8");
System.out.println("登录名" + name
+ "<<<<<<<<<<<======>>>>>>>>>");
}
}
}
Map<String, Object> map = new HashMap<String, Object>();
String reqBody = name;
System.out.println(reqBody + "req....................");
StringBuffer hql = new StringBuffer("from Repairtask where 1=1");
System.out.println(hql + "hql================");
List param = new ArrayList();
if (reqBody != null && !"".equals(reqBody)) {
hql.append(" and repairpeople =?");
param.add(reqBody);
System.out.println(param + "param'''''''''''''333===");
}
hql.append(" order by createtime desc");
List<Repairtask> l = new ArrayList<Repairtask>();
Page page = repairTaskService.findPageByHQL(hql.toString(), startRow,
9, param.toArray());
if (page != null && page.getList() != null) {
List lists = page.getList();
for (int i = 0; i < lists.size(); i++) {
Repairtask repairtask = (Repairtask) lists.get(i);
l.add(repairtask);
}
}
// List list = repairTaskService.findAll(hql.toString(),
// param.toArray());
map.put("list", l);
map.put("page", page);
System.out.println("我到这里了。。。");
return new ModelAndView("owner/repairlist", map);
}
//管理员 ======我的报修
@RequestMapping(value = "/adminlist")
protected ModelAndView adminlist(HttpServletRequest request,
HttpServletResponse response) throws Exception {
HttpUtil util = new HttpUtil(request, response);
int startRow = util.parseInt(Pagination.START_ROW);
System.out.println("进来了?。。。。。");
Map<String, Object> map = new HashMap<String, Object>();
StringBuffer hql = new StringBuffer("from Repairtask where 1=1");
System.out.println(hql + "hql================");
List<Repairtask> l = new ArrayList<Repairtask>();
Page page = repairTaskService.findPageByHQL(hql.toString(), startRow,
9, null);
if (page != null && page.getList() != null) {
List lists = page.getList();
for (int i = 0; i < lists.size(); i++) {
Repairtask repairtask = (Repairtask) lists.get(i);
l.add(repairtask);
}
}
// List list = repairTaskService.findAll(hql.toString(),
// param.toArray());
map.put("list", l);
map.put("page", page);
System.out.println("我到这里了。。。");
return new ModelAndView("admin/repairlist", map);
}
@RequestMapping(value = "/listreport")
protected ModelAndView listreport(HttpServletRequest request,
HttpServletResponse response) throws Exception {
HttpUtil util = new HttpUtil(request, response);
Map<String, Object> map = new HashMap<String, Object>();
int startRow = util.parseInt(Pagination.START_ROW);
System.out.println("进来了?。。。。。");
String starttime=request.getParameter("startTime");
Str
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论

















收起资源包目录





































































































共 270 条
- 1
- 2
- 3
资源评论

- king-hero2019-06-03不能 运行?
- MMMMango2020-05-08资源还不错
- Alicebjt2020-05-12运行出来是物业管理之维修系统,我:???

xiaolajiao_jxl
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 软件测试基础教程:从入门到实践
- Linux开发入门到实战基础教程
- 移动开发入门:从零开始的移动应用开发基础教程
- 数据集处理与分析基础教程:从入门到实战
- 软件测试入门与实践基础教程
- Linux开发入门到实战基础教程
- 移动开发从入门到实践基础教程
- (源码)基于React和Redux的简书PC端模拟系统.zip
- (源码)基于C++语言的LoRa通信系统.zip
- (源码)基于Arduino的供暖与通风控制器系统.zip
- (源码)基于NodeMCU V3的电力计量表脉冲测量系统.zip
- (源码)基于C语言的MQTTSN传感器网络系统.zip
- (源码)基于Arduino的AudioSwitch音频切换系统.zip
- (源码)基于Linux系统的防火墙项目.zip
- (源码)基于Arduino和TouchDesigner的传感器数据可视化系统.zip
- (源码)基于C语言和Golang的CPU负荷模拟表系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
