一、專案簡述
功能包括: 用戶登錄,設備管理,設備指派,貝附資訊,資訊公告, 資訊維護,系統管理,圖表統計等等功能,
二、專案運行
環境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
專案技術: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等,





基礎資訊操作:
基礎資訊操作:
@Controller
@RequestMapping("/baseInfos")
public class BaseInfoController {
@Autowired
private BaseInfoService baseInfoService;
@Autowired
private LogService logService;
/**
* 獲取所有設備型別資訊
* @param map
* @return
*/
@RequestMapping("/type/list")
public String listDeviceType(ModelMap map){
List<DeviceType> typeList = baseInfoService.listDeviceType();
map.put("typeList",typeList);
return "deviceTypes::table-refresh";
}
/**
* 添加設備型別
* @param deviceType
* @return
*/
@PostMapping("/type")
@ResponseBody
public int addtDeviceType(DeviceType deviceType){
return baseInfoService.addtDeviceType(deviceType);
}
/**
* 洗掉設備型別
* @param typeId
* @return
*/
@DeleteMapping("/type/{typeId}")
@ResponseBody
public int delteDeviceTypByid(@PathVariable("typeId") String typeId){
return baseInfoService.deleteDeviceTypeById(typeId);
}
/**
* 修改設備型別
* @param deviceType
* @return
*/
@PutMapping("/type")
@ResponseBody
public int updateDeviceType(DeviceType deviceType){
return baseInfoService.updateDeviceType(deviceType);
}
/**
* 獲取所有設備品牌資訊
* @param map
* @return
*/
@RequestMapping("/brand/list")
public String listDeviceBrand(ModelMap map){
List<DeviceBrand> brandList = baseInfoService.listDeviceBrand();
map.put("brandList",brandList);
return "deviceBrands::table-refresh";
}
/**
* 添加設備品牌
* @param deviceBrand
* @return
*/
@PostMapping("/brand")
@ResponseBody
public int addtDeviceBrand(DeviceBrand deviceBrand){
return baseInfoService.addtDeviceBrand(deviceBrand);
}
/**
* 洗掉設備品牌
* @param brandId
* @return
*/
@DeleteMapping("/brand/{brandId}")
@ResponseBody
public int delteDeviceBrandByid(@PathVariable("brandId") String brandId){
return baseInfoService.deleteDeviceBrandById(brandId);
}
/**
* 修改品牌
* @param deviceBrand
* @return
*/
@PutMapping("/brand")
@ResponseBody
public int updateDeviceBrand(DeviceBrand deviceBrand){
return baseInfoService.updateDeviceBrand(deviceBrand);
}
/**
* 獲取系統日志
* @param map
* @return
*/
@RequestMapping("/log")
public String listLog(ModelMap map, HttpServletRequest request){
String startTime = request.getParameter("startTime");
String endTime = request.getParameter("endTime");
List<SystemLog> logs = logService.listLogsByDate(startTime,endTime);
map.put("logList",logs);
return "system::logList-refresh";
}
}
資訊公告控制器代碼:
/**
* 資訊公告控制器
* */
@Controller
@RequestMapping("/notice")
public class NoticeController {
@Autowired
NoticeService noticeService;
/**
* 查看公告詳情
* @param id
* @param map
* @return
*/
@GetMapping("/{id}")
public String readContent(@PathVariable("id") String id,ModelMap map){
Notice notice = noticeService.getNoticeById(id);
map.put("notice",notice);
return "noticeContent";
}
/**
* 查詢所有公告
* @param map
* @return
/*/
@GetMapping("/list")
public String listAllNotice(ModelMap map){
List<Notice> noticeList = noticeService.listAll();
map.addAttribute("noticeList",noticeList);
return "notice::table-refresh";
}
/**
* 新增公告
* @param notice
* @return
*/
@PostMapping
public String addNotice(Notice notice){
noticeService.addNotice(notice);
return "notice";
}
/**
* 按id洗掉公告
* @param id
* @return
*/
@DeleteMapping("/{id}")
@ResponseBody
public int deleteNotice(@PathVariable("id")String id){
return noticeService.deleteNoticeById(id);
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/354664.html
標籤:其他
