実行環境:
JDK1.8、tomcat8、eclipse、mysql5.6、Navicat
関数実装:
ユーザー: ユーザー名、ログインパスワード、名前、性別、生年月日、利用者の写真、連絡先、メールアドレス、住所、登録時間
高齢者:高齢者番号、氏名、性別、年齢、高齢者の写真、高齢者の紹介、登録ユーザー、登録時刻
部屋タイプ: 部屋タイプID、部屋タイプ名
##部屋: 部屋番号、部屋タイプ、部屋名、部屋メイン写真、部屋料金、部屋詳細、部屋ステータス注文: 注文番号、チェックイン部屋、チェックイン高齢者、チェックイン日、チェックイン時間、注文合計金額、注文ステータス、注文料金詳細、注文時刻高齢者ケア:レコードID、情報カテゴリ、情報タイトル、情報内容、公開時刻 受付:受付レコードID、受付カテゴリ、受付テーマ、受付内容、受付日部門:部門番号、部署名、設立日、担当者 従業員: ユーザー名、ログインパスワード、部署、名前、性別、生年月日、従業員の写真、連絡先、自宅住所 給与: 給与 ID 、従業員、給与年、給与月、給与額、支払日、給与 備考//UserInfo管理控制层 @Controller @RequestMapping("/UserInfo") public class UserInfoController extends BaseController { /*业务层对象*/ @Resource UserInfoService userInfoService; @InitBinder("userInfo") public void initBinderUserInfo(WebDataBinder binder) { binder.setFieldDefaultPrefix("userInfo."); } /*跳转到添加UserInfo视图*/ @RequestMapping(value = "/add", method = RequestMethod.GET) public String add(Model model,HttpServletRequest request) throws Exception { model.addAttribute(new UserInfo()); return "UserInfo_add"; } /*客户端ajax方式提交添加用户信息*/ @RequestMapping(value = "/add", method = RequestMethod.POST) public void add(@Validated UserInfo userInfo, BindingResult br, Model model, HttpServletRequest request,HttpServletResponse response) throws Exception { String message = ""; boolean success = false; if (br.hasErrors()) { message = "输入信息不符合要求!"; writeJsonResponse(response, success, message); return ; } if(userInfoService.getUserInfo(userInfo.getUser_name()) != null) { message = "用户名已经存在!"; writeJsonResponse(response, success, message); return ; } try { userInfo.setUserPhoto(this.handlePhotoUpload(request, "userPhotoFile")); } catch(UserException ex) { message = "图片格式不正确!"; writeJsonResponse(response, success, message); return ; } userInfoService.addUserInfo(userInfo); message = "用户添加成功!"; success = true; writeJsonResponse(response, success, message); } /*ajax方式按照查询条件分页查询用户信息*/ @RequestMapping(value = { "/list" }, method = {RequestMethod.GET,RequestMethod.POST}) public void list(String user_name,String name,String birthDate,String telephone,Integer page,Integer rows, Model model, HttpServletRequest request,HttpServletResponse response) throws Exception { if (page==null || page == 0) page = 1; if (user_name == null) user_name = ""; if (name == null) name = ""; if (birthDate == null) birthDate = ""; if (telephone == null) telephone = ""; if(rows != 0)userInfoService.setRows(rows); List<UserInfo> userInfoList = userInfoService.queryUserInfo(user_name, name, birthDate, telephone, page); /*计算总的页数和总的记录数*/ userInfoService.queryTotalPageAndRecordNumber(user_name, name, birthDate, telephone); /*获取到总的页码数目*/ int totalPage = userInfoService.getTotalPage(); /*当前查询条件下总记录数*/ int recordNumber = userInfoService.getRecordNumber(); response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); //将要被返回到客户端的对象 JSONObject jsonObj=new JSONObject(); jsonObj.accumulate("total", recordNumber); JSONArray jsonArray = new JSONArray(); for(UserInfo userInfo:userInfoList) { JSONObject jsonUserInfo = userInfo.getJsonObject(); jsonArray.put(jsonUserInfo); } jsonObj.accumulate("rows", jsonArray); out.println(jsonObj.toString()); out.flush(); out.close(); } /*ajax方式按照查询条件分页查询用户信息*/ @RequestMapping(value = { "/listAll" }, method = {RequestMethod.GET,RequestMethod.POST}) public void listAll(HttpServletResponse response) throws Exception { List<UserInfo> userInfoList = userInfoService.queryAllUserInfo(); response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); JSONArray jsonArray = new JSONArray(); for(UserInfo userInfo:userInfoList) { JSONObject jsonUserInfo = new JSONObject(); jsonUserInfo.accumulate("user_name", userInfo.getUser_name()); jsonUserInfo.accumulate("name", userInfo.getName()); jsonArray.put(jsonUserInfo); } out.println(jsonArray.toString()); out.flush(); out.close(); } /*前台按照查询条件分页查询用户信息*/ @RequestMapping(value = { "/frontlist" }, method = {RequestMethod.GET,RequestMethod.POST}) public String frontlist(String user_name,String name,String birthDate,String telephone,Integer currentPage, Model model, HttpServletRequest request) throws Exception { if (currentPage==null || currentPage == 0) currentPage = 1; if (user_name == null) user_name = ""; if (name == null) name = ""; if (birthDate == null) birthDate = ""; if (telephone == null) telephone = ""; List<UserInfo> userInfoList = userInfoService.queryUserInfo(user_name, name, birthDate, telephone, currentPage); /*计算总的页数和总的记录数*/ userInfoService.queryTotalPageAndRecordNumber(user_name, name, birthDate, telephone); /*获取到总的页码数目*/ int totalPage = userInfoService.getTotalPage(); /*当前查询条件下总记录数*/ int recordNumber = userInfoService.getRecordNumber(); request.setAttribute("userInfoList", userInfoList); request.setAttribute("totalPage", totalPage); request.setAttribute("recordNumber", recordNumber); request.setAttribute("currentPage", currentPage); request.setAttribute("user_name", user_name); request.setAttribute("name", name); request.setAttribute("birthDate", birthDate); request.setAttribute("telephone", telephone); return "UserInfo/userInfo_frontquery_result"; } /*前台查询UserInfo信息*/ @RequestMapping(value="/{user_name}/frontshow",method=RequestMethod.GET) public String frontshow(@PathVariable String user_name,Model model,HttpServletRequest request) throws Exception { /*根据主键user_name获取UserInfo对象*/ UserInfo userInfo = userInfoService.getUserInfo(user_name); request.setAttribute("userInfo", userInfo); return "UserInfo/userInfo_frontshow"; } /*ajax方式显示用户修改jsp视图页*/ @RequestMapping(value="/{user_name}/update",method=RequestMethod.GET) public void update(@PathVariable String user_name,Model model,HttpServletRequest request,HttpServletResponse response) throws Exception { /*根据主键user_name获取UserInfo对象*/ UserInfo userInfo = userInfoService.getUserInfo(user_name); response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); //将要被返回到客户端的对象 JSONObject jsonUserInfo = userInfo.getJsonObject(); out.println(jsonUserInfo.toString()); out.flush(); out.close(); } /*ajax方式更新用户信息*/ @RequestMapping(value = "/{user_name}/update", method = RequestMethod.POST) public void update(@Validated UserInfo userInfo, BindingResult br, Model model, HttpServletRequest request,HttpServletResponse response) throws Exception { String message = ""; boolean success = false; if (br.hasErrors()) { message = "输入的信息有错误!"; writeJsonResponse(response, success, message); return; } String userPhotoFileName = this.handlePhotoUpload(request, "userPhotoFile"); if(!userPhotoFileName.equals("upload/NoImage.jpg"))userInfo.setUserPhoto(userPhotoFileName); try { userInfoService.updateUserInfo(userInfo); message = "用户更新成功!"; success = true; writeJsonResponse(response, success, message); } catch (Exception e) { e.printStackTrace(); message = "用户更新失败!"; writeJsonResponse(response, success, message); } } /*删除用户信息*/ @RequestMapping(value="/{user_name}/delete",method=RequestMethod.GET) public String delete(@PathVariable String user_name,HttpServletRequest request) throws UnsupportedEncodingException { try { userInfoService.deleteUserInfo(user_name); request.setAttribute("message", "用户删除成功!"); return "message"; } catch (Exception e) { e.printStackTrace(); request.setAttribute("error", "用户删除失败!"); return "error"; } } /*ajax方式删除多条用户记录*/ @RequestMapping(value="/deletes",method=RequestMethod.POST) public void delete(String user_names,HttpServletRequest request,HttpServletResponse response) throws IOException, JSONException { String message = ""; boolean success = false; try { int count = userInfoService.deleteUserInfos(user_names); success = true; message = count + "条记录删除成功"; writeJsonResponse(response, success, message); } catch (Exception e) { //e.printStackTrace(); message = "有记录存在外键约束,删除失败"; writeJsonResponse(response, success, message); } } /*按照查询条件导出用户信息到Excel*/ @RequestMapping(value = { "/OutToExcel" }, method = {RequestMethod.GET,RequestMethod.POST}) public void OutToExcel(String user_name,String name,String birthDate,String telephone, Model model, HttpServletRequest request,HttpServletResponse response) throws Exception { if(user_name == null) user_name = ""; if(name == null) name = ""; if(birthDate == null) birthDate = ""; if(telephone == null) telephone = ""; List<UserInfo> userInfoList = userInfoService.queryUserInfo(user_name,name,birthDate,telephone); ExportExcelUtil ex = new ExportExcelUtil(); String _title = "UserInfo信息记录"; String[] headers = { "用户名","姓名","性别","出生日期","用户照片","联系电话","邮箱","注册时间"}; List<String[]> dataset = new ArrayList<String[]>(); for(int i=0;i<userInfoList.size();i++) { UserInfo userInfo = userInfoList.get(i); dataset.add(new String[]{userInfo.getUser_name(),userInfo.getName(),userInfo.getGender(),userInfo.getBirthDate(),userInfo.getUserPhoto(),userInfo.getTelephone(),userInfo.getEmail(),userInfo.getRegTime()}); } /* OutputStream out = null; try { out = new FileOutputStream("C://output.xls"); ex.exportExcel(title,headers, dataset, out); out.close(); } catch (Exception e) { e.printStackTrace(); } */ OutputStream out = null;//创建一个输出流对象 try { out = response.getOutputStream();// response.setHeader("Content-disposition","attachment; filename="+"UserInfo.xls");//filename是下载的xls的名,建议最好用英文 response.setContentType("application/msexcel;charset=UTF-8");//设置类型 response.setHeader("Pragma","No-cache");//设置头 response.setHeader("Cache-Control","no-cache");//设置头 response.setDateHeader("Expires", 0);//设置日期头 String rootPath = request.getSession().getServletContext().getRealPath("/"); ex.exportExcel(rootPath,_title,headers, dataset, out); out.flush(); } catch (IOException e) { e.printStackTrace(); }finally{ try{ if(out!=null){ out.close(); } }catch(IOException e){ e.printStackTrace(); } } } }管理者管理制御層:
@Controller @SessionAttributes("username") public class SystemController { @Resource AdminService adminService; @Resource UserInfoService userInfoService; @RequestMapping(value="/login",method=RequestMethod.GET) public String login(Model model) { model.addAttribute(new Admin()); return "login"; } //前台用户登录 @RequestMapping(value="/frontLogin",method=RequestMethod.POST) public void frontLogin(@RequestParam("userName")String userName,@RequestParam("password")String password,HttpServletResponse response,HttpSession session) throws Exception { boolean success = true; String msg = ""; if (!userInfoService.checkLogin(userName, password)) { msg = userInfoService.getErrMessage(); success = false; } if(success) { session.setAttribute("user_name", userName); } response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); //将要被返回到客户端的对象 JSONObject json=new JSONObject(); json.accumulate("success", success); json.accumulate("msg", msg); out.println(json.toString()); out.flush(); out.close(); } @RequestMapping(value="/login",method=RequestMethod.POST) public void login(@Validated Admin admin,BindingResult br,Model model,HttpServletRequest request,HttpServletResponse response,HttpSession session) throws Exception { boolean success = true; String msg = ""; if(br.hasErrors()) { msg = br.getAllErrors().toString(); success = false; } if (!adminService.checkLogin(admin)) { msg = adminService.getErrMessage(); success = false; } if(success) { session.setAttribute("username", admin.getUsername()); } response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); //将要被返回到客户端的对象 JSONObject json=new JSONObject(); json.accumulate("success", success); json.accumulate("msg", msg); out.println(json.toString()); out.flush(); out.close(); } @RequestMapping("/logout") public String logout(Model model,HttpSession session) { model.asMap().remove("username"); session.invalidate(); return "redirect:/login"; } @RequestMapping(value="/changePassword",method=RequestMethod.POST) public String ChangePassword(String oldPassword,String newPassword,String newPassword2,HttpServletRequest request,HttpSession session) throws Exception { if(oldPassword.equals("")) throw new UserException("请输入旧密码!"); if(newPassword.equals("")) throw new UserException("请输入新密码!"); if(!newPassword.equals(newPassword2)) throw new UserException("两次新密码输入不一致"); String username = (String)session.getAttribute("username"); if(username == null) throw new UserException("session会话超时,请重新登录系统!"); Admin admin = adminService.findAdminByUserName(username); if(!admin.getPassword().equals(oldPassword)) throw new UserException("输入的旧密码不正确!"); try { adminService.changePassword(username,newPassword); request.setAttribute("message", java.net.URLEncoder.encode( "密码修改成功!", "GBK")); return "message"; } catch (Exception e) { e.printStackTrace(); request.setAttribute("error", java.net.URLEncoder .encode("密码修改失败!","GBK")); return "error"; } } }ルーム管理制御層:
リーリー
以上がJavaで老人ホーム管理システムを実装する方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

新しいテクノロジーは、両方の脅威をもたらし、Javaのプラットフォームの独立性を高めます。 1)Dockerなどのクラウドコンピューティングとコンテナ化テクノロジーは、Javaのプラットフォームの独立性を強化しますが、さまざまなクラウド環境に適応するために最適化する必要があります。 2)WebAssemblyは、Graalvmを介してJavaコードをコンパイルし、プラットフォームの独立性を拡張しますが、パフォーマンスのために他の言語と競合する必要があります。

JVMの実装が異なると、プラットフォームの独立性が得られますが、パフォーマンスはわずかに異なります。 1。OracleHotspotとOpenJDKJVMは、プラットフォームの独立性で同様に機能しますが、OpenJDKは追加の構成が必要になる場合があります。 2。IBMJ9JVMは、特定のオペレーティングシステムで最適化を実行します。 3. Graalvmは複数の言語をサポートし、追加の構成が必要です。 4。AzulzingJVMには、特定のプラットフォーム調整が必要です。

プラットフォームの独立性により、開発コストが削減され、複数のオペレーティングシステムで同じコードセットを実行することで開発時間を短縮します。具体的には、次のように表示されます。1。開発時間を短縮すると、1セットのコードのみが必要です。 2。メンテナンスコストを削減し、テストプロセスを統合します。 3.展開プロセスを簡素化するための迅速な反復とチームコラボレーション。

java'splatformentedencefacilitatesecodereusebyAllowingbyTeCodeCodeCodeCodeTorunonAnyPlatformm.1)DevelopersConcodeCodeOnceOnceOnconconsentEntentEntEntEntEntEntentPlatforms.2)維持化されたアスカデドは、NoeedReadedoesではありません

Javaアプリケーションのプラットフォーム固有の問題を解決するには、次の手順を実行できます。1。Javaのシステムクラスを使用して、システムプロパティを表示して実行中の環境を理解します。 2。ファイルクラスまたはjava.nio.fileパッケージを使用して、ファイルパスを処理します。 3。オペレーティングシステムの条件に応じてローカルライブラリをロードします。 4. VisualVMまたはJProfilerを使用して、クロスプラットフォームのパフォーマンスを最適化します。 5.テスト環境が、Dockerコンテナ化を通じて生産環境と一致していることを確認してください。 6. githubactionsを使用して、複数のプラットフォームで自動テストを実行します。これらの方法は、Javaアプリケーションでプラットフォーム固有の問題を効果的に解決するのに役立ちます。

クラスローダーは、統一されたクラスファイル形式、動的読み込み、親代表団モデル、プラットフォーム非依存バイトコードを通じて、さまざまなプラットフォーム上のJavaプログラムの一貫性と互換性を保証し、プラットフォームの独立性を実現します。

Javaコンパイラによって生成されたコードはプラットフォームに依存しませんが、最終的に実行されるコードはプラットフォーム固有です。 1。Javaソースコードは、プラットフォームに依存しないバイトコードにコンパイルされます。 2。JVMは、特定のプラットフォームのバイトコードをマシンコードに変換し、クロスプラットフォーム操作を保証しますが、パフォーマンスは異なる場合があります。

マルチスレッドは、プログラムの応答性とリソースの利用を改善し、複雑な同時タスクを処理できるため、最新のプログラミングで重要です。 JVMは、スレッドマッピング、スケジューリングメカニズム、同期ロックメカニズムを介して、異なるオペレーティングシステム上のマルチスレッドの一貫性と効率を保証します。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

mPDF
mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

DVWA
Damn Vulnerable Web App (DVWA) は、非常に脆弱な PHP/MySQL Web アプリケーションです。その主な目的は、セキュリティ専門家が法的環境でスキルとツールをテストするのに役立ち、Web 開発者が Web アプリケーションを保護するプロセスをより深く理解できるようにし、教師/生徒が教室環境で Web アプリケーションを教え/学習できるようにすることです。安全。 DVWA の目標は、シンプルでわかりやすいインターフェイスを通じて、さまざまな難易度で最も一般的な Web 脆弱性のいくつかを実践することです。このソフトウェアは、

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境
