package com.example.waterdeliverysystem.controller;
import com.example.waterdeliverysystem.model.History;
import com.example.waterdeliverysystem.model.Worker;
import com.example.waterdeliverysystem.service.HistoryServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Controller
public class HistoryWeb {
@Autowired
HistoryServiceImpl historyService;
@GetMapping("/toHistoryList")
public String toWorkerList(Model model){
List<History> workerList = historyService.getHistoryList();
model.addAttribute("list",workerList);
return "historyList";
}
//toUpdateHistory
@GetMapping("/toUpdateHistory/{id}")
public String toUpdateHistory(@PathVariable int id , Model model){
History historyById = historyService.getHistoryById(id);
model.addAttribute("history",historyById);
return "updateHistory";
}
//handleUpdateHistory
@PostMapping("/handleUpdateHistory")
public String handleUpdateWorker(History history){
historyService.updateHistory(history);
return "redirect:/toHistoryList";
}
//toAddHistory
@GetMapping("/toAddHistory")
public String toAddHistory(){
return "addHistory";
}
//deleteHistory
@GetMapping("/deleteHistory/{id}")
public String deleteHistory(@PathVariable int id){
historyService.deleteHistoryById(id);
return "redirect:/toHistoryList";
}
@GetMapping("/deleteMultiple")
public String deleteMultiple(String ids[]){
for(String id:ids){
historyService.deleteHistoryById(Integer.parseInt(id));
}
return "redirect:/toHistoryList";
}
// handleAddHistory
@PostMapping("/handleAddHistory")
public String handleAddWorker(History history){
historyService.addHistory(history);
return "redirect:/toHistoryList";
}
//queryHistory
@GetMapping("/queryHistory")
public String queryHistory(Date workerTime, Model model){
List<History> getHistoryListByWorkerTime =new ArrayList<History>();
if( workerTime==null|| workerTime.equals("")){
getHistoryListByWorkerTime =historyService.getHistoryList();
}else {
getHistoryListByWorkerTime= historyService.getHistoryListByWorkerTime(workerTime);
}
model.addAttribute("list",getHistoryListByWorkerTime);
return "historyList";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
使用Springboot框架编写的供水系统 (211个子文件)
UserWeb.class 4KB
HistoryWeb.class 4KB
CustomerWeb.class 3KB
WorkerWeb.class 3KB
SalaryWeb.class 3KB
CustomerServiceImpl.class 3KB
WorkerServiceImpl.class 3KB
HistoryServiceImpl.class 3KB
StatisticsServiceImpl.class 2KB
SalaryServiceImpl.class 2KB
StatisticsWeb.class 2KB
Salary.class 2KB
History.class 2KB
Customer.class 2KB
CustomerMapper.class 2KB
UserServiceImpl.class 2KB
HistoryMapper.class 2KB
WorkerMapper.class 1KB
User.class 1KB
Worker.class 1KB
Statistics.class 1KB
UserMapper.class 1KB
SalaryMapper.class 1KB
StatisticsMapper.class 983B
CustomerService.class 952B
HistoryService.class 929B
WorkerService.class 918B
WaterDeliverySystemApplication.class 808B
SalaryService.class 696B
StatisticsService.class 683B
UserService.class 623B
mvnw.cmd 7KB
bootstrap.css 195KB
bootstrap.css 195KB
bootstrap.min.css 158KB
bootstrap.min.css 158KB
crlf.css 1KB
crlf.css 1KB
login.css 1KB
login.css 1KB
Skye.css 1010B
Skye.css 1010B
form.css 593B
form.css 593B
01.gif 3.37MB
01.gif 3.37MB
.gitignore 395B
.gitignore 184B
historyList.html 2KB
historyList.html 2KB
updateHistory.html 2KB
updateHistory.html 2KB
updateCustomer.html 2KB
updateCustomer.html 2KB
customerList.html 2KB
customerList.html 2KB
workerList.html 1KB
workerList.html 1KB
addHistory.html 1KB
addHistory.html 1KB
updateWorker.html 1KB
updateWorker.html 1KB
salaryList.html 1KB
salaryList.html 1KB
addCustomer.html 1KB
addCustomer.html 1KB
updateUserPassword.html 1KB
updateUserPassword.html 1KB
addWorker.html 1KB
addWorker.html 1KB
statisticsList.html 1KB
statisticsList.html 1KB
index.html 1KB
index.html 1KB
login.html 1KB
login.html 1KB
register.html 1KB
register.html 1KB
loginFail.html 597B
loginFail.html 597B
updateFail.html 573B
updateFail.html 573B
error.html 214B
error.html 214B
waterdeliverysystem.iml 10KB
maven-wrapper.jar 57KB
HistoryWeb.java 3KB
UserWeb.java 3KB
CustomerWeb.java 2KB
WorkerWeb.java 2KB
SalaryWeb.java 2KB
CustomerServiceImpl.java 2KB
HistoryServiceImpl.java 2KB
WorkerServiceImpl.java 2KB
Salary.java 1KB
StatisticsWeb.java 1KB
History.java 1KB
Customer.java 1KB
StatisticsServiceImpl.java 1KB
CustomerMapper.java 1KB
共 211 条
- 1
- 2
- 3
PatioF4
- 粉丝: 211
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0