亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Java?實戰(zhàn)項目之家政服務(wù)平臺系統(tǒng)的實現(xiàn)流程

 更新時間:2021年11月20日 16:26:18   作者:qq_1334611189  
讀萬卷書不如行萬里路,只學(xué)書上的理論是遠(yuǎn)遠(yuǎn)不夠的,只有在實戰(zhàn)中才能獲得能力的提升,本篇文章手把手帶你用java+SSM+jsp+mysql+maven實現(xiàn)家政服務(wù)平臺系統(tǒng),大家可以在過程中查缺補(bǔ)漏,提升水平

一、項目簡述

功能包括: 家政服務(wù)網(wǎng)站系統(tǒng),用戶注冊,登錄,分為家政人員,普 通用戶,以及最高管理員,包括家政分類查詢,展示,線 上預(yù)約服務(wù),家政申請,評論,留言溝通?,聯(lián)系家政服 務(wù),家政人員的認(rèn)證,職業(yè)認(rèn)證,以及后臺的維護(hù)等等功能。

二、項目運(yùn)行

環(huán)境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

項目技術(shù): JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + maven等等。

用戶信息控制層:

//定義為控制器
@Controller
// 設(shè)置路徑
@RequestMapping(value = "/users", produces = "text/plain;charset=utf-8")
public class UsersController extends BaseController {
	// 注入Service 由于標(biāo)簽的存在 所以不需要getter setter
	@Autowired
	@Resource
	private UsersService usersService;
 
	// 準(zhǔn)備添加數(shù)據(jù)
	@RequestMapping("/createUsers")
	public String createUsers() {
		return "admin/addusers";
	}
 
	// 添加數(shù)據(jù)
	@RequestMapping("/addUsers")
	public String addUsers(Users users) {
		this.usersService.insertUsers(users);
		return "redirect:/users/createUsers";
	}
 
	// 通過主鍵刪除數(shù)據(jù)
	@RequestMapping("/deleteUsers")
	public String deleteUsers(String id) {
		this.usersService.deleteUsers(id);
		return "redirect:/users/getAllUsers";
	}
 
	// 批量刪除數(shù)據(jù)
	@RequestMapping("/deleteUsersByIds")
	public String deleteUsersByIds() {
		String[] ids = this.getRequest().getParameterValues("usersid");
		for (String usersid : ids) {
			this.usersService.deleteUsers(usersid);
		}
		return "redirect:/users/getAllUsers";
	}
 
	// 更新數(shù)據(jù)
	@RequestMapping("/updateUsers")
	public String updateUsers(Users users) {
		this.usersService.updateUsers(users);
		return "redirect:/users/getAllUsers";
	}
 
	// 顯示全部數(shù)據(jù)
	@RequestMapping("/getAllUsers")
	public String getAllUsers(String number) {
		List<Users> usersList = this.usersService.getAllUsers();
		PageHelper.getPage(usersList, "users", null, null, 10, number, this.getRequest(), null);
		return "admin/listusers";
	}
 
	// 按條件查詢數(shù)據(jù) (模糊查詢)
	@RequestMapping("/queryUsersByCond")
	public String queryUsersByCond(String cond, String name, String number) {
		Users users = new Users();
		if (cond != null) {
			if ("username".equals(cond)) {
				users.setUsername(name);
			}
			if ("password".equals(cond)) {
				users.setPassword(name);
			}
			if ("realname".equals(cond)) {
				users.setRealname(name);
			}
			if ("sex".equals(cond)) {
				users.setSex(name);
			}
			if ("birthday".equals(cond)) {
				users.setBirthday(name);
			}
			if ("contact".equals(cond)) {
				users.setContact(name);
			}
			if ("regdate".equals(cond)) {
				users.setRegdate(name);
			}
		}
 
		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
		valueList.add(name);
		PageHelper.getPage(this.usersService.getUsersByLike(users), "users", nameList, valueList, 10, number, this.getRequest(), "query");
		name = null;
		cond = null;
		return "admin/queryusers";
	}
 
	// 按主鍵查詢數(shù)據(jù)
	@RequestMapping("/getUsersById")
	public String getUsersById(String id) {
		Users users = this.usersService.getUsersById(id);
		this.getRequest().setAttribute("users", users);
		return "admin/editusers";
	}
 
	public UsersService getUsersService() {
		return usersService;
	}
 
	public void setUsersService(UsersService usersService) {
		this.usersService = usersService;
	}
 
}

標(biāo)簽增刪改查:

//定義為控制器
@Controller
// 設(shè)置路徑
@RequestMapping(value = "/topic", produces = "text/plain;charset=utf-8")
public class TopicController extends BaseController {
	// 注入Service 由于標(biāo)簽的存在 所以不需要getter setter
	@Autowired
	@Resource
	private TopicService topicService;
	@Autowired
	@Resource
	private UsersService usersService;
	@Autowired
	@Resource
	private OrdersService ordersService;
	@Autowired
	@Resource
	private GoodsService goodsService;
 
	// 準(zhǔn)備添加數(shù)據(jù)
	@RequestMapping("/createTopic")
	public String createTopic() {
		List<Users> usersList = this.usersService.getAllUsers();
		this.getRequest().setAttribute("usersList", usersList);
		List<Orders> ordersList = this.ordersService.getAllOrders();
		this.getRequest().setAttribute("ordersList", ordersList);
		List<Goods> goodsList = this.goodsService.getAllGoods();
		this.getRequest().setAttribute("goodsList", goodsList);
		return "admin/addtopic";
	}
 
	// 添加數(shù)據(jù)
	@RequestMapping("/addTopic")
	public String addTopic(Topic topic) {
		topic.setUsersid("");
		topic.setOrdersid("");
		topic.setGoodsid("");
		topic.setNum("");
		topic.setAddtime(VeDate.getStringDateShort());
		topic.setStatus("");
		this.topicService.insertTopic(topic);
		return "redirect:/topic/createTopic";
	}
 
	// 通過主鍵刪除數(shù)據(jù)
	@RequestMapping("/deleteTopic")
	public String deleteTopic(String id) {
		this.topicService.deleteTopic(id);
		return "redirect:/topic/getAllTopic";
	}
 
	// 批量刪除數(shù)據(jù)
	@RequestMapping("/deleteTopicByIds")
	public String deleteTopicByIds() {
		String[] ids = this.getRequest().getParameterValues("topicid");
		for (String topicid : ids) {
			this.topicService.deleteTopic(topicid);
		}
		return "redirect:/topic/getAllTopic";
	}
 
	// 更新數(shù)據(jù)
	@RequestMapping("/updateTopic")
	public String updateTopic(Topic topic) {
		this.topicService.updateTopic(topic);
		return "redirect:/topic/getAllTopic";
	}
 
	// 顯示全部數(shù)據(jù)
	@RequestMapping("/getAllTopic")
	public String getAllTopic(String number) {
		List<Topic> topicList = this.topicService.getAllTopic();
		PageHelper.getPage(topicList, "topic", null, null, 10, number, this.getRequest(), null);
		return "admin/listtopic";
	}
 
	// 按條件查詢數(shù)據(jù) (模糊查詢)
	@RequestMapping("/queryTopicByCond")
	public String queryTopicByCond(String cond, String name, String number) {
		Topic topic = new Topic();
		if (cond != null) {
			if ("usersid".equals(cond)) {
				topic.setUsersid(name);
			}
			if ("ordersid".equals(cond)) {
				topic.setOrdersid(name);
			}
			if ("goodsid".equals(cond)) {
				topic.setGoodsid(name);
			}
			if ("num".equals(cond)) {
				topic.setNum(name);
			}
			if ("contents".equals(cond)) {
				topic.setContents(name);
			}
			if ("addtime".equals(cond)) {
				topic.setAddtime(name);
			}
			if ("status".equals(cond)) {
				topic.setStatus(name);
			}
			if ("reps".equals(cond)) {
				topic.setReps(name);
			}
		}
 
		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
		valueList.add(name);
		PageHelper.getPage(this.topicService.getTopicByLike(topic), "topic", nameList, valueList, 10, number, this.getRequest(), "query");
		name = null;
		cond = null;
		return "admin/querytopic";
	}
 
	// 按主鍵查詢數(shù)據(jù)
	@RequestMapping("/getTopicById")
	public String getTopicById(String id) {
		Topic topic = this.topicService.getTopicById(id);
		this.getRequest().setAttribute("topic", topic);
		List<Users> usersList = this.usersService.getAllUsers();
		this.getRequest().setAttribute("usersList", usersList);
		List<Orders> ordersList = this.ordersService.getAllOrders();
		this.getRequest().setAttribute("ordersList", ordersList);
		List<Goods> goodsList = this.goodsService.getAllGoods();
		this.getRequest().setAttribute("goodsList", goodsList);
		return "admin/edittopic";
	}
 
	public TopicService getTopicService() {
		return topicService;
	}
 
	public void setTopicService(TopicService topicService) {
		this.topicService = topicService;
	}
 
}

訂單控制層:

//定義為控制器
@Controller
// 設(shè)置路徑
@RequestMapping(value = "/orders", produces = "text/plain;charset=utf-8")
public class OrdersController extends BaseController {
	// 注入Service 由于標(biāo)簽的存在 所以不需要getter setter
	@Autowired
	@Resource
	private OrdersService ordersService;
	@Autowired
	@Resource
	private UsersService usersService;
 
	// 準(zhǔn)備添加數(shù)據(jù)
	@RequestMapping("/createOrders")
	public String createOrders() {
		List<Users> usersList = this.usersService.getAllUsers();
		this.getRequest().setAttribute("usersList", usersList);
		return "admin/addorders";
	}
 
	// 添加數(shù)據(jù)
	@RequestMapping("/addOrders")
	public String addOrders(Orders orders) {
		this.ordersService.insertOrders(orders);
		return "redirect:/orders/createOrders";
	}
 
	// 通過主鍵刪除數(shù)據(jù)
	@RequestMapping("/deleteOrders")
	public String deleteOrders(String id) {
		this.ordersService.deleteOrders(id);
		return "redirect:/orders/getAllOrders";
	}
 
	// 批量刪除數(shù)據(jù)
	@RequestMapping("/deleteOrdersByIds")
	public String deleteOrdersByIds() {
		String[] ids = this.getRequest().getParameterValues("ordersid");
		for (String ordersid : ids) {
			this.ordersService.deleteOrders(ordersid);
		}
		return "redirect:/orders/getAllOrders";
	}
 
	// 更新數(shù)據(jù)
	@RequestMapping("/updateOrders")
	public String updateOrders(Orders orders) {
		this.ordersService.updateOrders(orders);
		return "redirect:/orders/getAllOrders";
	}
 
	// 顯示全部數(shù)據(jù)
	@RequestMapping("/getAllOrders")
	public String getAllOrders(String number) {
		List<Orders> ordersList = this.ordersService.getAllOrders();
		PageHelper.getPage(ordersList, "orders", null, null, 10, number, this.getRequest(), null);
		return "admin/listorders";
	}
 
	// 按條件查詢數(shù)據(jù) (模糊查詢)
	@RequestMapping("/queryOrdersByCond")
	public String queryOrdersByCond(String cond, String name, String number) {
		Orders orders = new Orders();
		if (cond != null) {
			if ("ordercode".equals(cond)) {
				orders.setOrdercode(name);
			}
			if ("usersid".equals(cond)) {
				orders.setUsersid(name);
			}
			if ("total".equals(cond)) {
				orders.setTotal(name);
			}
			if ("addtime".equals(cond)) {
				orders.setAddtime(name);
			}
			if ("status".equals(cond)) {
				orders.setStatus(name);
			}
			if ("address".equals(cond)) {
				orders.setAddress(name);
			}
			if ("contact".equals(cond)) {
				orders.setContact(name);
			}
			if ("workdate".equals(cond)) {
				orders.setWorkdate(name);
			}
			if ("worktime".equals(cond)) {
				orders.setWorktime(name);
			}
		}
 
		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
		valueList.add(name);
		PageHelper.getPage(this.ordersService.getOrdersByLike(orders), "orders", nameList, valueList, 10, number, this.getRequest(), "query");
		name = null;
		cond = null;
		return "admin/queryorders";
	}
 
	// 按主鍵查詢數(shù)據(jù)
	@RequestMapping("/getOrdersById")
	public String getOrdersById(String id) {
		Orders orders = this.ordersService.getOrdersById(id);
		this.getRequest().setAttribute("orders", orders);
		List<Users> usersList = this.usersService.getAllUsers();
		this.getRequest().setAttribute("usersList", usersList);
		return "admin/editorders";
	}
 
	public OrdersService getOrdersService() {
		return ordersService;
	}
 
	public void setOrdersService(OrdersService ordersService) {
		this.ordersService = ordersService;
	}
 
}

數(shù)據(jù)圖表控制層:

//定義為控制器
@Controller
// 設(shè)置路徑
@RequestMapping(value = "/chart", produces = "text/plain;charset=utf-8")
public class ChartController extends BaseController {
	@Autowired
	@Resource
	private OrdersService ordersService;
	@Autowired
	@Resource
	private CateService cateService;
	@Autowired
	@Resource
	private GoodsService goodsService;
	@Autowired
	@Resource
	private TopicService topicService;
 
	@RequestMapping("/chartline")
	@ResponseBody
	public String chartline() throws JSONException {
		String start = this.getRequest().getParameter("start");
		String end = this.getRequest().getParameter("end");
		long days = VeDate.getDays(end, start) + 1;
		JSONArray count = new JSONArray();
		JSONArray day = new JSONArray(); // 存放名稱
		for (int i = 0; i < days; i++) {
			String nxtDay = VeDate.getNextDay(start, "" + i);
			double total = 0;
			Orders orders = new Orders();
			orders.setAddtime(nxtDay);
			List<Orders> list = this.ordersService.getOrdersByCond(orders);
			for (Orders b : list) {
				total += Double.parseDouble(b.getTotal());
			}
			count.put(total);
			day.put(nxtDay);
		}
		JSONObject json = new JSONObject();
		json.put("count", count.toString());
		json.put("days", day.toString().replaceAll("\"", ""));
		return json.toString();
	}
 
	@RequestMapping("/chartpie")
	@ResponseBody
	public String chartpie() throws JSONException {
		JSONArray count = new JSONArray();
		JSONArray name = new JSONArray(); // 存放名稱
		List<Goods> goodsList = this.goodsService.getAllGoods();
		for (Goods goods : goodsList) {
			name.put(goods.getGoodsname());
			count.put(Integer.parseInt(goods.getSellnum()));
		}
		JSONObject json = new JSONObject();
		json.put("count", count.toString());
		json.put("names", name.toString().replaceAll("\"", ""));
		return json.toString();
	}
 
	@RequestMapping("/chartBar")
	@ResponseBody
	public String chartBar() throws JSONException {
		JSONArray name = new JSONArray();
		JSONArray count = new JSONArray();
		List<Cate> cateList = this.cateService.getAllCate();
		for (Cate cate : cateList) {
			name.put(cate.getCatename());
			int sum1 = 0;
			int sum2 = 0;
			int sum3 = 0;
			int sum4 = 0;
			int sum5 = 0;
			Topic t = new Topic();
			t.setCateid(cate.getCateid());
			List<Topic> list = this.topicService.getTopicBar(t);
			for (Topic x : list) {
				if (Integer.parseInt(x.getNum()) == 1) {
					sum1++;
				}
				if (Integer.parseInt(x.getNum()) == 2) {
					sum2++;
				}
				if (Integer.parseInt(x.getNum()) == 3) {
					sum3++;
				}
				if (Integer.parseInt(x.getNum()) == 4) {
					sum4++;
				}
				if (Integer.parseInt(x.getNum()) == 5) {
					sum5++;
				}
			}
			String sum = "" + sum1 + ";" + sum2 + ";" + sum3 + ";" + sum4 + ";" + sum5;
			System.out.println(sum);
			count.put(sum);
		}
		JSONObject json = new JSONObject();
		json.put("count", count.toString().replaceAll("\"", ""));
		json.put("names", name.toString().replaceAll("\"", ""));
		return json.toString();
	}
}

到此這篇關(guān)于Java 實戰(zhàn)項目之家政服務(wù)平臺系統(tǒng)的實現(xiàn)流程的文章就介紹到這了,更多相關(guān)Java 家政服務(wù)平臺系統(tǒng)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 淺談SpringMVC中Interceptor和Filter區(qū)別

    淺談SpringMVC中Interceptor和Filter區(qū)別

    這篇文章主要介紹了淺談SpringMVC中Interceptor和Filter區(qū)別,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-04-04
  • springboot支持https請求的實現(xiàn)

    springboot支持https請求的實現(xiàn)

    本文主要介紹了springboot支持https請求的實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-01-01
  • springboot項目打包鏡像方式以及區(qū)分環(huán)境打包的方法

    springboot項目打包鏡像方式以及區(qū)分環(huán)境打包的方法

    本文主要介紹了springboot項目打包鏡像方式以及區(qū)分環(huán)境打包的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-03-03
  • Java8中Optional操作的實際應(yīng)用

    Java8中Optional操作的實際應(yīng)用

    Optional類是一個可以為null的容器對象,如果值存在則isPresent()方法會返回true,調(diào)用get()方法會返回該對象,下面這篇文章主要給大家介紹了關(guān)于Java8中Optional操作實際應(yīng)用的相關(guān)資料,需要的朋友可以參考下
    2022-02-02
  • Sprigmvc項目轉(zhuǎn)為springboot的方法

    Sprigmvc項目轉(zhuǎn)為springboot的方法

    本篇文章主要介紹了Sprigmvc項目轉(zhuǎn)為springboot的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-02-02
  • Assert.assertEquals的使用方法及注意事項說明

    Assert.assertEquals的使用方法及注意事項說明

    這篇文章主要介紹了Assert.assertEquals的使用方法及注意事項說明,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-05-05
  • Java 單例模式詳細(xì)解釋

    Java 單例模式詳細(xì)解釋

    這篇文章主要給大家介紹了關(guān)于Java中四種單例模式的相關(guān)資料,其中包括餓漢式、懶漢式、懶漢式(雙重鎖)及內(nèi)部類等四種,分別給出了詳細(xì)的示例代碼和介紹,需要的朋友們下面來一起看看吧。
    2021-11-11
  • Hibernatede 一對多映射配置方法(分享)

    Hibernatede 一對多映射配置方法(分享)

    下面小編就為大家?guī)硪黄狧ibernatede 一對多映射配置方法(分享)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-09-09
  • Java中的構(gòu)造方法this、super的用法詳解

    Java中的構(gòu)造方法this、super的用法詳解

    這篇文章較詳細(xì)的給大家介紹了Java中的構(gòu)造方法this、super的用法,非常不錯,具有一定的參考借鑒價值,需要的朋友參考下吧
    2018-07-07
  • 老生常談Eclipse中的BuildPath(必看篇)

    老生常談Eclipse中的BuildPath(必看篇)

    下面小編就為大家?guī)硪黄仙U凟clipse中的BuildPath(必看篇)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-06-06

最新評論