时间:2023-02-17 15:52:43 | 栏目:JAVA代码 | 点击:次
功能包括: 用户登录,设备管理,设备指派,贝附信息,信息公告, 信息维护,系统管理,图表统计等等功能。
环境配置: 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); } }