{"id":1746,"date":"2025-02-09T14:51:54","date_gmt":"2025-02-09T06:51:54","guid":{"rendered":"https:\/\/note.ui11.cc\/?p=1746"},"modified":"2025-02-09T14:51:55","modified_gmt":"2025-02-09T06:51:55","slug":"%e4%bb%93%e5%ba%93%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/note.ui11.cc\/index.php\/2025\/02\/09\/%e4%bb%93%e5%ba%93%e7%b3%bb%e7%bb%9f\/","title":{"rendered":"\u4ed3\u5e93\u7cfb\u7edf"},"content":{"rendered":"\n<p>\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf &#8212; SpringBoot + Vue3\u524d\u540e\u7aef\u5206\u79bb\u7684\u9879\u76ee\uff1a<\/p>\n\n\n\n<p>\u4e00\u3001\u9879\u76ee\u4ecb\u7ecd:<br>1.\u9879\u76ee\u63cf\u8ff0 \u221a<br>\u4e3a\u6ee1\u8db3\u65e5\u76ca\u6269\u5927\u7684\u4ed3\u5e93\u7ba1\u7406\u9700\u6c42\uff0c\u5bf9\u4ed3\u5e93\u4e2d\u5546\u54c1\u8fdb\u9500\u5b58\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u800c\u5f00\u53d1\u4e86\u6b64\u7cfb\u7edf\u3002\u7cfb\u7edf\u4e3b\u8981\u5305\u542b\uff1a<br>RBAC:\u7528\u6237\u89d2\u8272\u6743\u9650\u63a7\u5236<br>1&gt;\u7528\u6237\u7ba1\u7406(\u67e5\u8be2\u7528\u6237\u3001\u6dfb\u52a0\u7528\u6237\u3001\u4fee\u6539\u7528\u6237\u3001\u5220\u9664\u7528\u6237\u3001\u5bfc\u51fa\u6570\u636e\u3001\u6279\u91cf\u5220\u9664\u3001\u7981\u7528\/\u542f\u7528\u7528\u6237\u3001\u91cd\u7f6e\u5bc6\u7801\u3001\u5206\u914d\u89d2\u8272\u3001\u66f4\u6539\u6743\u9650)<br>2&gt;\u89d2\u8272\u7ba1\u7406(\u67e5\u8be2\u89d2\u8272\u3001\u6dfb\u52a0\u89d2\u8272\u3001\u4fee\u6539\u89d2\u8272\u3001\u5220\u9664\u89d2\u8272\u3001\u5bfc\u51fa\u6570\u636e\u3001\u7981\u7528\/\u542f\u7528\u89d2\u8272\u3001\u66f4\u6539\u6743\u9650)<br>3&gt;\u6743\u9650\u7ba1\u7406(\u67e5\u8be2\u6743\u9650\u3001\u6dfb\u52a0\u6743\u9650\u3001\u4fee\u6539\u6743\u9650\u3001\u5220\u9664\u89d2\u8272\u3001\u7981\u7528\/\u542f\u7528\u6743\u9650)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>4&gt;\u5546\u54c1\u7ba1\u7406(\u67e5\u8be2\u5546\u54c1\u3001\u6dfb\u52a0\u5546\u54c1\u3001\u4fee\u6539\u5546\u54c1\u3001\u5546\u54c1\u5ba1\u6838\u7b49)\n5&gt;\u5546\u54c1\u5206\u7c7b\u7ba1\u7406(\u5546\u54c1\u5206\u7c7b\u7684\u6dfb\u52a0\u3001\u5546\u54c1\u5206\u7c7b\u7684\u67e5\u8be2\u3001\u5546\u54c1\u5206\u7c7b\u7684\u4fee\u6539\u3001\u5546\u54c1\u5206\u7c7b\u7684\u5220\u9664\u7b49)\n6&gt;\u91c7\u8d2d\u7ba1\u7406(\u6211\u7684\u91c7\u8d2d\u5355\u3001\u6dfb\u52a0\u91c7\u8d2d\u5355\u3001\u91c7\u8d2d\u5355\u7684\u5ba1\u6838\u7b49)\n7&gt;\u5165\u5e93\u7ba1\u7406(\u5165\u5e93\u5355\u3001\u4fdd\u5b58\u5165\u5e93\u5355\u3001\u786e\u8ba4\u5165\u5e93\u7b49)\n8&gt;\u51fa\u5e93\u7ba1\u7406(\u51fa\u5e93\u5355\u3001\u4fdd\u5b58\u51fa\u5e93\u5355\u3001\u5ba1\u6838\u51fa\u5e93\u5355\u7b49)\n9&gt;\u7edf\u8ba1\u7ba1\u7406(\u5404\u4e2a\u4ed3\u5e93\u5e93\u5b58\u4fe1\u606f\u3001\u4ed3\u5e93\u5360\u6709\u6bd4\u3001\u4ed3\u5e93\u5b58\u50a8\u8d70\u52bf\u3001\u51fa\u5165\u5e93\u4fe1\u606f\u7edf\u8ba1\u3001\u91c7\u8d2d\u91cf\u5360\u6bd4\u3001\u5b9e\u65f6\u6570\u636e\u76d1\u6d4b)\n10&gt;\u8c03\u8d27\u7ba1\u7406(\u8c03\u8d27\u5355\u67e5\u8be2\u3001\u786e\u8ba4\u8c03\u8d27)\n11&gt;\u4ed3\u5e93\u7ba1\u7406(\u67e5\u8be2\u4ed3\u5e93\u3001\u6dfb\u52a0\u4ed3\u5e93\u3001\u4fee\u6539\u4ed3\u5e93\u3001\u5220\u9664\u4ed3\u5e93\u3001\u5bfc\u51fa\u6570\u636e)\n12&gt;\u4f9b\u8d27\u5546\u7ba1\u7406(\u4f9b\u8d27\u5546\u6dfb\u52a0\u3001\u4f9b\u8d27\u5546\u4fee\u6539\u3001\u4f9b\u8d27\u5546\u7684\u67e5\u8be2\u7b49)\n13&gt;\u54c1\u724c\u7ba1\u7406(\u54c1\u724c\u6dfb\u52a0\u3001\u54c1\u724c\u4fee\u6539\u3001\u54c1\u724c\u7684\u67e5\u8be2\u7b49)\n14&gt;\u4ea7\u5730\u7ba1\u7406(\u4ea7\u5730\u6dfb\u52a0\u3001\u4ea7\u5730\u4fee\u6539\u3001\u4ea7\u5730\u7684\u67e5\u8be2\u7b49)\n15&gt;\u7ad9\u5185\u4fe1\u7ba1\u7406(\u6211\u7684\u7ad9\u5185\u4fe1\u3001\u672a\u8bfb\u6d88\u606f\u3001\u7ad9\u5185\u4fe1\u53d1\u9001\u3001\u7ad9\u5185\u4fe1\u67e5\u8be2\u7b49)<\/code><\/pre>\n\n\n\n<p>2.\u6280\u672f\u9009\u578b \u221a<br>SpringBoot + MyBatis + MySql + Redis + Vue3 + Axios + Element-Plus + Echarts\u7b49<\/p>\n\n\n\n<p>3.\u6a21\u5757\u5212\u5206<\/p>\n\n\n\n<p>4.\u4e2a\u4eba\u804c\u8d23 \u221a<\/p>\n\n\n\n<p>\u4e8c\u3001\u8fd8\u539f\u6570\u636e\u5e93:<\/p>\n\n\n\n<p>\u4e09\u3001\u642d\u5efa\u524d\u7aef\u9879\u76ee\u73af\u5883\u5e76\u542f\u52a8\u9879\u76ee:<br>1&gt;\u5b89\u88c5node:<br>node\u7684\u4ecb\u7ecd:<br>node\u662f\u4e00\u4e2a\u57fa\u4e8eChrome V8\u5f15\u64ce\u7684JavaScript\u8fd0\u884c\u73af\u5883,\u8ba9JavaScript\u8fd0\u884c\u5728\u670d\u52a1\u7aef\u7684\u5f00\u53d1\u5e73\u53f0\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> npm\u5305\u7ba1\u7406\u5668\u7684\u4ecb\u7ecd:\n node\u5b89\u88c5\u4e4b\u540e\u4e00\u822c\u90fd\u4f1a\u9ed8\u8ba4\u5b89\u88c5npm\u5305\u7ba1\u7406\u5668;\u7c7b\u4f3c\u4e8elinux\u7684yum\u5305\u7ba1\u7406\u5668,\u53ef\u4ee5\u7ed9Vue\u9879\u76ee\u4e0b\u8f7d\u76f8\u5173\u63d2\u4ef6\u3001\u4f9d\u8d56;\n\n 1)\u5c06\u5b89\u88c5\u538b\u7f29\u5305\u89e3\u538b\u5c31\u662f\u5b89\u88c5\n\n 2)\u914d\u7f6epath\u73af\u5883\u53d8\u91cf\n\n 3)\u6d4b\u8bd5\u5b89\u88c5\u662f\u5426\u6210\u529f:\n   node -v\uff1a\u67e5\u770bnode\u7248\u672c\n   npm -v\uff1a\u67e5\u770bnpm\u5305\u7ba1\u7406\u5668\u7684\u7248\u672c\n   \u5982\u679c\u51fa\u73b0\u8b66\u544a\u5c06node\u5b89\u88c5\u76ee\u5f55\u4e2d\u7684npm.cmd\u6587\u4ef6\u4e2d\u7684prefix -g\u6539\u4e3aprefix --location=global<\/code><\/pre>\n\n\n\n<p>2&gt;\u7ed9npm\u5305\u7ba1\u7406\u5668\u914d\u7f6e\u955c\u50cf\u52a0\u901f\u5668:<br>npm config set registry https:\/\/registry.npm.taobao.org<br>npm config get registry &#8212; \u8fd4\u56dehttps:\/\/registry.npm.taobao.org\uff0c\u8bf4\u660e\u914d\u7f6e\u6210\u529f<\/p>\n\n\n\n<p>3&gt;\u4f7f\u7528npm\u5305\u7ba1\u7406\u5668\u4e0b\u8f7d\u5b89\u88c5yarn\u5305\u7ba1\u7406\u5668,\u540c\u65f6\u914d\u7f6e\u955c\u50cf\u52a0\u901f\u5668:<br>yarn\u5305\u7ba1\u7406\u5668\u7684\u4ecb\u7ecd:<br>yarn\u5305\u7ba1\u7406\u5668\u8ddfnpm\u5305\u7ba1\u7406\u5668\u7684\u4f5c\u7528\u662f\u4e00\u6837\u7684,\u533a\u522b\u5c31\u662fnpm\u5305\u7ba1\u7406\u5668\u662fnode\u81ea\u5df1\u7684,\u800cyarn\u5305\u7ba1\u7406\u5668\u5c5e\u4e8e\u7b2c\u4e09\u65b9(facebook\u7684);<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> \u5b89\u88c5yarn\u5305\u7ba1\u7406\u5668:\n npm install -g yarn\n\n \u7ed9yarn\u5305\u7ba1\u7406\u5668\u914d\u7f6e\u955c\u50cf\u52a0\u901f\u5668:\n yarn config set registry https:\/\/registry.npm.taobao.org \n yarn config get registry  -- \u8fd4\u56dehttps:\/\/registry.npm.taobao.org\uff0c\u8bf4\u660e\u914d\u7f6e\u6210\u529f<\/code><\/pre>\n\n\n\n<p>4&gt;\u4f7f\u7528yarn\u5305\u7ba1\u7406\u5668\u4e3a\u524d\u7aefVue\u9879\u76ee\u4e0b\u8f7d\u5b89\u88c5\u6240\u9700\u63d2\u4ef6:<br>\u5728vue\u9879\u76ee\u76ee\u5f55\u4e0b\u6267\u884c\u547d\u4ee4\uff1ayarn<\/p>\n\n\n\n<p>5&gt;\u542f\u52a8\u524d\u7aefVue\u9879\u76ee:<br>\u5728vue\u9879\u76ee\u76ee\u5f55\u4e0b\u6267\u884c\u547d\u4ee4\uff1ayarn dev<\/p>\n\n\n\n<p>\u7ec6\u8282:<br>\u524d\u7aefvue\u9879\u76ee\u5bf9\u540e\u53f0\u9879\u76ee\u7684\u8bbf\u95ee\u8def\u5f84:<br>vue\u9879\u76ee\u76ee\u5f55\u4e0b\u7684.env\u6587\u4ef6:<br>VITE_WAREHOUSE_CONTEXT_PATH=http:\/\/localhost:9999\/warehouse<br>1)\u53ef\u4ee5\u5728.env\u6587\u4ef6\u4e2d\u901a\u8fc7VITE_WAREHOUSE_CONTEXT_PATH\u53d8\u91cf\u4fee\u6539\u8bbe\u7f6e\u524d\u7aefVue\u9879\u76ee\u8bbf\u95ee\u7684\u540e\u53f0\u9879\u76ee\u7684\u8bbf\u95ee\u8def\u5f84;<br>2)\u5982\u679c\u4e0d\u505a\u4fee\u6539\u8bbe\u7f6e\u90a3\u4e48\u5c31\u8981\u6c42\u6211\u4eec\u7684\u540e\u53f0\u9879\u76ee\u7684\u9879\u76ee\u8def\u5f84\u5fc5\u987b\u662f\/warehouse,\u8bbf\u95ee\u7aef\u53e3\u5fc5\u987b\u662f9999;<\/p>\n\n\n\n<p>\u56db\u3001\u642d\u5efa\u540e\u53f0\u9879\u76ee\u7684\u73af\u5883:<\/p>\n\n\n\n<p>1.\u521b\u5efa\u4e2aboot\u9879\u76ee &#8212; \u5212\u5206\u5305\u5c42\u6b21:<\/p>\n\n\n\n<p>2.\u5bfc\u5165\u4f9d\u8d56<\/p>\n\n\n\n<p>3.\u542f\u52a8\u7c7b\u914d\u7f6e<\/p>\n\n\n\n<p>4.\u914d\u7f6e\u6587\u4ef6\u7684\u914d\u7f6e<\/p>\n\n\n\n<p>\u4e94\u3001\u767b\u5f55\u76f8\u5173\u4e1a\u52a1:<\/p>\n\n\n\n<p>\u63a5\u53e3\uff1a<br>1.interface:\u8868\u793a\u5bf9\u5916\u66b4\u9732\u7684\u89c4\u5219,\u91cc\u9762\u5b9a\u4e49\u7684\u5168\u662f\u62bd\u8c61\u65b9\u6cd5\u548c\u5168\u5c40\u5e38\u91cf\u3002<br>2.api\u63a5\u53e3 url\u63a5\u53e3\uff1a\u8bf7\u6c42\u7684url\u5730\u5740\u3002<\/p>\n\n\n\n<p>1.\u751f\u6210\u9a8c\u8bc1\u7801\u56fe\u7247<br>http:\/\/localhost:9999\/warehouse<\/p>\n\n\n\n<p>\/captcha\/captchaImage &#8212; \u670d\u52a1\u5668\u540e\u53f0\u751f\u6210\u4e00\u5f20\u9a8c\u8bc1\u7801\u56fe\u7247,\u7136\u540e\u54cd\u5e94\u7ed9\u524d\u7aef,\u524d\u7aef\u4ee5img\u6807\u7b7e\u5c55\u793a\u3002<\/p>\n\n\n\n<p>2.\u767b\u5f55<br>http:\/\/localhost:3000\/ &#8212; \u662f\u524d\u7aefvue\u9879\u76ee\u7684\u8bbf\u95ee\u5730\u5740<\/p>\n\n\n\n<p>\u524d\u7aef\u9879\u76ee\u76ee\u5f55\u4e0b\u7684vite.config.js\u6587\u4ef6:<br>\/\/\u670d\u52a1\u7aef\u4ee3\u7406\u8bbe\u7f6e<br>proxy: {<br>\/\/\u5982\u679c\u8bbf\u95ee\u5730\u5740\u4ee5&#8221;\/api&#8221;\u5f00\u5934,\u5219\u81ea\u52a8\u4ee3\u7406\u5230\u53d8\u91cfVITE_WAREHOUSE_CONTEXT_PATH\u6240\u8868\u793a\u7684<br>\/\/\u670d\u52a1\u7aef\u5730\u5740http:\/\/localhost:9999\/warehouse<br>&#8216;\/api&#8217;: {<br>target: env.VITE_WAREHOUSE_CONTEXT_PATH,<br>changeOrigin: true,<br>rewrite: path =&gt; path.replace(\/^\\\/api\/, &#8221;)<br>}<br>}<\/p>\n\n\n\n<p>url\u63a5\u53e3\/api\u662f\u524d\u7aefvue\u9879\u76ee\u7684\u63a5\u53e3,\u662f\u4e2a\u4ee3\u7406\u63a5\u53e3,\u4ee3\u7406\u7684\u662f\u540e\u53f0\u9879\u76ee\u7684\u8bbf\u95ee\u8def\u5f84;<\/p>\n\n\n\n<p>\u6240\u4ee5\u53ea\u8981\u662f\u524d\u7aefvue\u9879\u76ee\u53d1\u51fa\u7684\u8bf7\u6c42\u7684\u5730\u5740\u662fhttp:\/\/localhost:3000\/api\/xxx\u90fd\u662f\u53d1\u7ed9\u540e\u53f0\u9879\u76ee\u7684,\u8bbf\u95ee\u7684\u540e\u53f0\u5411\u7684\u5177\u4f53\u7684url\u63a5\u53e3;<\/p>\n\n\n\n<p>http:\/\/localhost:3000\/api\/login &#8212; \u8bbf\u95ee\u7684\u662f\u540e\u53f0\u9879\u76ee\u7684\/login\u63a5\u53e3;<br>{<br>userCode:&#8221;admin&#8221;<br>userPwd:&#8221;123456&#8243;<br>verificationCode:&#8221;xax4&#8243;<br>}<\/p>\n\n\n\n<p>3.\u767b\u5f55\u9650\u5236<\/p>\n\n\n\n<p>4.\u83b7\u53d6\u767b\u5f55\u7528\u6237\u4fe1\u606f<\/p>\n\n\n\n<p>5.\u52a0\u8f7d\u6743\u9650\u83dc\u5355\u6811<\/p>\n\n\n\n<p>6.\u9000\u51fa\u767b\u5f55<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>token &#8212; \u4ee4\u724c &#8212; \u4f1a\u8bdd\u6280\u672f &#8212; \u767b\u5f55\u6210\u529f\u4e4b\u540e,\u5728\u4e00\u6bb5\u65f6\u95f4\u4e4b\u5185\u4e0d\u9700\u8981\u91cd\u590d\u767b\u5f55\u4fbf\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u7cfb\u7edf\u8d44\u6e90;<\/p>\n\n\n\n<p>\u5e38\u89c1\u7684\u4f1a\u8bdd\u6280\u672f:<br>session:<br>\u5f0a\u7aef\u662f\u53ea\u9002\u5408\u5355\u4f53\u5e94\u7528,\u4e0d\u9002\u7528\u4e8e\u5206\u5e03\u5f0f\u5fae\u670d\u52a1\u96c6\u7fa4\u7684\u9879\u76ee;<\/p>\n\n\n\n<p>token &#8212; \u4ee4\u724c &#8212; \u4e00\u6bb5\u5b57\u7b26\u4e32:<br>\u662f\u9002\u7528\u4e8e\u5206\u5e03\u5f0f\u5fae\u670d\u52a1\u96c6\u7fa4\u7684\u9879\u76ee\u7684\u4f1a\u8bdd\u6280\u672f;<\/p>\n\n\n\n<p>jwt token\uff1a<\/p>\n\n\n\n<p>\u5934\u90e8:<br>{<br>&#8220;alg&#8221;: &#8220;HS256&#8221;,<br>&#8220;typ&#8221;: &#8220;JWT&#8221;<br>}<br>\u8f7d\u4f53 &#8212; \u5b58\u653e\u6709\u7528\u6237\u4fe1\u606f:<br>{<br>&#8220;sub&#8221;: &#8220;1234567890&#8221;,<br>&#8220;name&#8221;: &#8220;John Doe&#8221;,<br>&#8220;admin&#8221;: true<br>}<br>\u7b7e\u540d:<br>HMACSHA256(<br>base64UrlEncode(header) + &#8220;.&#8221; +<br>base64UrlEncode(payload),<br>secret<br>)<\/p>\n\n\n\n<p>base64UrlEncode(header) . base64UrlEncode(payload) . HMACSHA256(base64UrlEncode(header)+&#8221;.&#8221;+base64UrlEncode(payload),secret))<\/p>\n\n\n\n<p>\u4e94\u3001\u767b\u5f55\u76f8\u5173\u4e1a\u52a1:<\/p>\n\n\n\n<p>3.\u767b\u5f55\u9650\u5236<br>\u5fc5\u987b\u767b\u5f55\u6210\u529f\u4e4b\u540e\u624d\u80fd\u8bbf\u95ee\u7cfb\u7edf\u8d44\u6e90\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u8fc7\u6ee4\u5668\u5b9e\u73b0:<br>\u5728\u540e\u53f0\u9879\u76ee\u4e2d\u914d\u7f6e\u4e00\u4e2a\u8fc7\u6ee4\u5668,\u4f1a\u62e6\u622a\u524d\u7aef\u53d1\u51fa\u7684\u6240\u6709\u8bf7\u6c42,\u62e6\u622a\u4e4b\u540e\u5224\u65ad\u7528\u6237\u662f\u5426\u5df2\u7ecf\u767b\u5f55<br>\u6765\u51b3\u5b9a\u662f\u5426\u5141\u8bb8\u8bbf\u95ee\u7cfb\u7edf\u8d44\u6e90(url\u63a5\u53e3);<\/p>\n\n\n\n<p>\u56de\u987eSpringBoot\u4e2d\u914d\u7f6e\u539f\u751fServlet\u4e2d\u7684\u8fc7\u6ee4\u5668:<br>1&gt;\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668 &#8212; \u5b9a\u4e49\u4e00\u4e2aFilter\u63a5\u53e3\u7684\u5b9e\u73b0\u7c7b\u5e76\u91cd\u5199doFilter()\u65b9\u6cd5,doFilter()\u65b9\u6cd5\u4e2d<br>\u5c31\u662f\u8fc7\u6ee4\u5668\u62e6\u622a\u5230\u8bf7\u6c42\u6267\u884c\u7684\u5185\u5bb9;<br>2&gt;\u5411IOC\u5bb9\u5668\u4e2d\u914d\u7f6eFilterRegistrationBean\u7684bean\u5bf9\u8c61,\u518d\u5c06\u6211\u4eec\u81ea\u5b9a\u4e49\u7684Servlet\u7684\u8fc7\u6ee4\u5668<br>\u6ce8\u518c\u7ed9FilterRegistrationBean\u7684bean\u5bf9\u8c61 &#8212; \u6ce8\u518c\u8fc7\u6ee4\u5668<\/p>\n\n\n\n<p>4.\u83b7\u53d6\u767b\u5f55\u7528\u6237\u4fe1\u606f<br>\/curr-user &#8212; \u62ff\u5230\u524d\u7aef\u5f52\u8fd8\u7684token,\u4f7f\u7528token\u5de5\u5177\u7c7b\u89e3\u6790token\u7684\u5c01\u88c5\u65b9\u6cd5\u62ff\u5230\u4ecetoken\u4e2d<br>\u89e3\u6790\u51fa\u7684\u7528\u6237\u4fe1\u606f\u5e76\u5c01\u88c5\u5230\u7684CurrentUser\u5bf9\u8c61;<\/p>\n\n\n\n<p>5.\u52a0\u8f7d\u6743\u9650\u83dc\u5355\u6811<br>\/user\/auth-list<\/p>\n\n\n\n<p>\u52a0\u8f7d\u7528\u6237\u6743\u9650\u83dc\u5355\u6811\u7684\u65b9\u5f0f:<br>1.\u540e\u53f0\u7cfb\u7edf\u4e2d\u662f\u67e5\u8be2\u51fa\u7528\u6237\u6743\u9650\u4e0b\u7684\u6240\u6709\u83dc\u5355List,\u7136\u540e\u5c06\u7528\u6237\u6240\u6709\u83dc\u5355\u7684List\u54cd\u5e94<br>\u7ed9\u524d\u7aef,\u524d\u7aef\u6846\u67b6\u5c31\u4f7f\u7528\u83dc\u5355\u6811\u7ec4\u4ef6\u901a\u8fc7\u7528\u6237\u6240\u6709\u83dc\u5355\u7684List\u4e2d\u6bcf\u4e2a\u83dc\u5355\u7684id\u548cpid\u7684\u5173\u7cfb<br>\u751f\u6210\u83dc\u5355\u6811; &#8212; \u83dc\u5355\u6811\u662f\u524d\u7aef\u751f\u6210\u7684;<\/p>\n\n\n\n<p>2.\u540e\u53f0\u7cfb\u7edf\u4e2d\u662f\u67e5\u8be2\u51fa\u7528\u6237\u6743\u9650\u4e0b\u7684\u6240\u6709\u83dc\u5355List,\u7136\u540e\u5c06\u7528\u6237\u6240\u6709\u83dc\u5355\u7684List\u8f6c\u6210<br>\u83dc\u5355\u6811List,\u6700\u540e\u5c06\u83dc\u5355\u6811List\u54cd\u5e94\u7ed9\u524d\u7aef,\u524d\u7aef\u53ea\u9700\u8981\u505a\u4e2a\u5faa\u73af\u8fed\u4ee3\u5c55\u793a\u83dc\u5355\u6811;<br>&#8212; \u83dc\u5355\u6811\u662f\u5728\u540e\u7aef\u751f\u6210\u7684; \u221a<\/p>\n\n\n\n<p>RBAC:\u7528\u6237\u89d2\u8272\u6743\u9650\u63a7\u5236<br>\u901a\u8fc7\u7ed9\u7528\u6237\u5206\u914d\u4e0d\u540c\u7684\u89d2\u8272,\u518d\u7ed9\u89d2\u8272\u5206\u914d\u4e0d\u540c\u7684\u83dc\u5355\u6743\u9650,\u8fdb\u800c\u5b9e\u73b0\u7ed9\u7528\u6237\u5206\u914d\u4e0d\u540c\u7684\u83dc\u5355\u6743\u9650;<br>\u5b9e\u73b0RBAC\u81f3\u5c11\u8bbe\u8ba1\u52305\u5f20\u8868:<br>1&gt;\u7528\u6237\u8868user_info\uff1a\u5b58\u653e\u7528\u6237\u4fe1\u606f userId userName\u2026<br>2&gt;\u89d2\u8272\u8868role\uff1a\u5b58\u653e\u89d2\u8272\u4fe1\u606f roleId roleName<br>3&gt;\u7528\u6237\u89d2\u8272\u4e2d\u95f4\u8868user_role\uff1a\u5b58\u653e\u7528\u6237\u89d2\u8272\u5173\u7cfb\u7684,\u4f53\u73b0\u4e86\u7ed9\u7528\u6237\u5206\u914d\u7684\u89d2\u8272,\u800c\u4e14\u7528\u6237\u548c\u89d2\u8272\u662f\u591a\u5bf9\u591a\u5173\u7cfb userId roleId<br>4&gt;\u83dc\u5355\u6743\u9650\u8868auth_info\uff1a\u5b58\u653e\u83dc\u5355\u4fe1\u606f authId pid authName<br>5&gt;\u89d2\u8272\u83dc\u5355\u6743\u9650\u4e2d\u95f4\u8868role_auth\uff1a\u5b58\u653e\u7684\u662f\u89d2\u8272\u83dc\u5355\u5173\u7cfb,\u4f53\u73b0\u4e86\u7ed9\u89d2\u8272\u5206\u914d\u7684\u83dc\u5355\u6743\u9650,\u800c\u4e14\u89d2\u8272\u548c\u83dc\u5355\u662f\u591a\u5bf9\u591a\u5173\u7cfb roleId menuId<\/p>\n\n\n\n<p>6.\u9000\u51fa\u767b\u5f55<br>\/logout &#8212; \u4eceredis\u4e2d\u5220\u9664\u5f53\u524d\u767b\u5f55\u7684\u7528\u6237\u7684token\u7684\u952e;<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u7528\u6237\u7ba1\u7406\u6a21\u5757:<\/p>\n\n\n\n<p>1.\u7528\u6237\u5217\u8868<br>\/user\/user-list?userCode=&amp;userType=&amp;userState=&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<\/p>\n\n\n\n<p>\/user\/user-list?userCode=a&amp;userType=&amp;userState=1&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<\/p>\n\n\n\n<p>pageNum\u662f\u9875\u7801 pageSize\u662f\u6bcf\u9875\u884c\u6570 &#8212; \u5206\u9875\u67e5\u8be2<\/p>\n\n\n\n<p>1)\u5982\u679c\u53c2\u6570userCode userType userState\u6ca1\u6709\u503c,\u662f\u67e5\u8be2\u6240\u6709\u7528\u6237\u5e76\u5206\u9875<br>select * from user_info limit \u8d77\u59cb\u884c,\u6bcf\u9875\u884c\u6570;<br>select count(*) from user_info;<\/p>\n\n\n\n<p>2)\u5982\u679c\u53c2\u6570userCode userType userState\u6709\u503c,\u6839\u636e\u8d26\u53f7 \u7528\u6237\u72b6\u6001 \u7528\u6237\u7c7b\u578b\u5206\u9875\u67e5\u8be2\u7528\u6237\u5e76\u5206\u9875<br>select * from user_info where user_code like ? and user_type = ? and user_state = 1 limit \u8d77\u59cb\u884c,\u6bcf\u9875\u884c\u6570;<br>select count(*) from user_info where user_code like ? and user_type = ? and user_state = 1<\/p>\n\n\n\n<p>\u63a5\u53c2\u95ee\u9898:<br>\u53c2\u6570userCode userType userState\u4f7f\u7528User\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5;<br>\u53c2\u6570pageNum\u9875\u7801 pageSize\u6bcf\u9875\u884c\u6570\u4f7f\u7528Page\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5;<\/p>\n\n\n\n<p>\u54cd\u5e94\u6570\u636e\u95ee\u9898:<br>\u7ed9\u524d\u7aef\u54cd\u5e94\u5c01\u88c5\u4e86\u6240\u6709\u5206\u9875\u4fe1\u606f\u7684Page\u5bf9\u8c61;<\/p>\n\n\n\n<p>2.\u6dfb\u52a0\u7528\u6237<br>\/user\/addUser<br>{<br>userCode:&#8221;zhangsan&#8221;<br>userName:&#8221;\u5f20\u4e09&#8221;<br>userPwd:&#8221;123456&#8243;<br>}<\/p>\n\n\n\n<p>3.\u542f\u7528\u548c\u7981\u7528\u7528\u6237<br>\/user\/updateState<br>{<br>createBy:1<br>createTime:&#8221;2023-06-17 16:38:30&#8243;<br>getCode:&#8221;admin&#8221;<br>isDelete:&#8221;0&#8243;<br>updateBy:0<br>updateTime:null<br>userCode: &#8220;zhangsan&#8221;<br>userId:34 \u221a<br>userName:&#8221;\u5f20\u4e09&#8221;<br>userPwd:&#8221;c431d451c81e75ffac75a640590ed0a1&#8243;<br>userState:&#8221;1&#8243; \u221a<br>userType:null<br>}<\/p>\n\n\n\n<p>4.\u7ed9\u7528\u6237\u5206\u914d\u89d2\u8272<br>\/role\/role-list &#8212; \u67e5\u8be2\u6240\u6709\u89d2\u8272(\u5c55\u793a\u89d2\u8272\u51fa\u6765)<\/p>\n\n\n\n<p>\/user\/user-role-list\/{userId} &#8212; \u67e5\u8be2\u7528\u6237\u5df2\u5206\u914d\u7684\u89d2\u8272(\u5982\u679c\u662f\u4fee\u6539\u89d2\u8272,\u9700\u8981\u56de\u663e\u7528\u6237\u5df2\u5206\u914d\u89d2\u8272)<\/p>\n\n\n\n<p>\/user\/assignRole &#8212; \u7ed9\u7528\u6237\u5206\u914d\u89d2\u8272<br>{<br>userId:34<br>roleCheckList:[&#8220;\u8c03\u8d27&#8221;, &#8220;\u91c7\u8d2d&#8221;, &#8220;\u5165\u5e93&#8221;]<br>}<\/p>\n\n\n\n<p>\u7528\u6237\u7ba1\u7406\u6a21\u5757:<\/p>\n\n\n\n<p>5.\u5220\u9664\u7528\u6237<br>\/user\/deleteUser\/{userId} &#8212; \u6839\u636e\u7528\u6237id\u5220\u9664\u7528\u6237<\/p>\n\n\n\n<p>\/user\/deleteUserList &#8212; \u6839\u636e\u7528\u6237ids\u6279\u91cf\u5220\u9664\u7528\u6237<br>[34, 33]<\/p>\n\n\n\n<p>update user_info set is_delete = 1 where user_id in(1,2,3\u2026)<\/p>\n\n\n\n<p>6.\u4fee\u6539\u7528\u6237<br>\/user\/updateUser &#8212; \u6839\u636e\u7528\u6237id\u4fee\u6539\u7528\u6237\u6635\u79f0<br>{<br>userCode:&#8221;zhangsan&#8221;<br>userId:34<br>userName:&#8221;\u5f20\u4e09\u4e09&#8221;<br>}<\/p>\n\n\n\n<p>7.\u91cd\u7f6e\u5bc6\u7801<br>\/user\/updatePwd\/{userId} &#8212; \u5c06\u7528\u6237\u5bc6\u7801\u6839\u636e\u7528\u6237id\u8fd8\u539f\u4e3a123456(\u52a0\u5bc6)<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u89d2\u8272\u7ba1\u7406\u6a21\u5757:<\/p>\n\n\n\n<p>1.\u89d2\u8272\u5217\u8868 &#8212; \u5206\u9875\u67e5\u8be2\u89d2\u8272<br>\/role\/role-page-list?roleName=&amp;roleCode=&amp;roleState=&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<br>\u67e5\u8be2\u6240\u6709\u89d2\u8272\u5e76\u5206\u9875<\/p>\n\n\n\n<p>role\/role-page-list?roleName=a&amp;roleCode=b&amp;roleState=1&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<br>\u6839\u636e\u89d2\u8272\u540d\u79f0\u3001\u89d2\u8272\u4ee3\u7801\u3001\u89d2\u8272\u72b6\u6001\u67e5\u8be2\u89d2\u8272\u5e76\u5206\u9875<\/p>\n\n\n\n<p>2.\u6dfb\u52a0\u89d2\u8272<br>\/role\/role-add<br>{<br>roleCode:&#8221;pandian&#8221;<br>roleDesc:&#8221;\u76d8\u70b9&#8221;<br>roleName:&#8221;\u76d8\u70b9&#8221;<br>}<\/p>\n\n\n\n<p>\u8fd8\u9700\u8981\u8003\u8651\u65b0\u589e\u7684\u89d2\u8272\u662f\u5426\u5df2\u7ecf\u5b58\u5728 &#8212; \u6839\u636e\u89d2\u8272\u540d\u79f0\u6216\u8005\u89d2\u8272\u4ee3\u7801\u67e5\u8be2\u662f\u5426\u5df2\u6709\u89d2\u8272;<\/p>\n\n\n\n<p>3.\u542f\u7528\u548c\u7981\u7528\u89d2\u8272<br>\/role\/role-state-update<br>{<br>createBy:1<br>createTime:&#8221;2023-06-19 10:46:44&#8243;<br>getCode:&#8221;admin&#8221;<br>roleCode:&#8221;kuaiji&#8221;<br>roleDesc:&#8221;\u4f1a\u8ba1&#8221;<br>roleId:18 \u221a<br>roleName:&#8221;\u4f1a\u8ba1&#8221;<br>roleState:&#8221;1&#8243; \u221a<br>}<\/p>\n\n\n\n<p>4.\u7ed9\u89d2\u8272\u5206\u914d\u6743\u9650<\/p>\n\n\n\n<p>\/auth\/auth-tree &#8212; \u67e5\u8be2\u6240\u6709\u7684\u6743\u9650\u83dc\u5355\u6811<\/p>\n\n\n\n<p>\/role\/role-auth?roleId=17 &#8212; \u6839\u636e\u89d2\u8272id\u67e5\u8be2\u89d2\u8272\u5df2\u5206\u914d\u7684\u6240\u6709\u6743\u9650<\/p>\n\n\n\n<p>\/role\/auth-grant<br>{<br>roleId:&#8221;17&#8243;<br>authIds:[61, 62, 63, 64]<br>}<\/p>\n\n\n\n<p>5.\u5220\u9664\u89d2\u8272<br>\/role\/role-delete\/{roleId} &#8212; \u6839\u636e\u89d2\u8272id\u5220\u9664\u89d2\u8272<\/p>\n\n\n\n<p>6.\u4fee\u6539\u89d2\u8272<br>\/role\/role-update<br>{<br>roleDesc:&#8221;\u76d8\u70b9\u5e93\u5b58&#8221;<br>roleId:17<br>}<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5546\u54c1\u7ba1\u7406\u6a21\u5757:<br>1.\u5546\u54c1\u5217\u8868:<br>1&gt;\u5206\u9875\u67e5\u8be2\u5546\u54c1<br>\/product\/store-list &#8212; \u67e5\u8be2\u6240\u6709\u4ed3\u5e93\u7684 &#8212; \u7ed9\u641c\u7d22\u5546\u54c1\u4ed3\u5e93\u4e0b\u62c9\u6846\u7ec4\u88c5\u6570\u636e\u7684<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> \/product\/brand-list -- \u67e5\u8be2\u6240\u6709\u54c1\u724c -- \u7ed9\u641c\u7d22\u5546\u54c1\u76ae\u724c\u4e0b\u62c9\u6846\u7ec4\u88c5\u6570\u636e\u7684\n\n \u5206\u9875\u67e5\u8be2\u5546\u54c1\uff1a\n \/product\/product-page-list?storeId=&amp;productName=&amp;brandName=&amp;typeName=&amp;supplyName=&amp;placeName=&amp;upDownState=&amp;isOverDate=\n &amp;pageSize=5&amp;pageNum=1&amp;totalNum=0\n \u67e5\u8be2\u6240\u6709\u5546\u54c1\u5e76\u5206\u9875\n\n \/product\/product-page-list?storeId=1&amp;productName=a&amp;brandName=\u7f8e\u7684&amp;typeName=b&amp;supplyName=c&amp;placeName=d&amp;upDownState=1&amp;isOverDate=0\n &amp;pageSize=5&amp;pageNum=1&amp;totalNum=0\n \u6839\u636e\u4ed3\u5e93 \u5546\u54c1\u540d\u79f0 \u54c1\u724c \u7c7b\u578b \u4f9b\u5e94\u5546 \u4ea7\u5730 \u4e0a\u4e0b\u67b6\u72b6\u6001 \u8fc7\u671f\u4e0e\u5426\u67e5\u8be2\u5546\u54c1\u5e76\u5206\u9875 \n\n \u8bf7\u6c42\u53c2\u6570\u7684\u5904\u7406:\n \u9875\u7801pageNum  \u6bcf\u9875\u884c\u6570pageSize -- Page\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5\n\n \u4ed3\u5e93id storeId\u3001\u5546\u54c1\u540d\u79f0productName\u3001\u54c1\u724c\u540d\u79f0brandName\u3001\u5546\u54c1\u5206\u7c7b\u540d\u79f0typeName\u3001\u4f9b\u5e94\u5546\u540d\u79f0supplyName\u3001\u4ea7\u5730\u540dplaceName\u3001 \n \u4e0a\u4e0b\u67b6\u72b6\u6001upDownState\u3001\u8fc7\u671f\u4e0e\u5426isOverDate -- Product\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5 -- \u8ffd\u52a0\u5c5e\u6027\u54c1\u724c\u540d\u79f0brandName\u3001\u5546\u54c1\u5206\u7c7b\u540d\u79f0typeName\u3001\n \u4f9b\u5e94\u5546\u540d\u79f0supplyName\u3001\u4ea7\u5730\u540dplaceName\u3001\u8fc7\u671f\u4e0e\u5426isOverDate\n\n \u5546\u54c1\u5217\u8868\u5c55\u793a\u7684\u4fe1\u606f\uff1a\n \u4ed3\u5e93\u540d\u79f0 -- Product\u5bf9\u8c61\u8fd8\u8981\u8ffd\u52a0\u5c5e\u6027 --- storeName\n \u5355\u4f4d -- Product\u5bf9\u8c61\u8fd8\u8981\u8ffd\u52a0\u5c5e\u6027 --- unitName<\/code><\/pre>\n\n\n\n<p>\u5546\u54c1\u7ba1\u7406\u6a21\u5757:<br>1.\u5546\u54c1\u5217\u8868:<\/p>\n\n\n\n<p>2&gt;\u6dfb\u52a0\u5546\u54c1<br>\/product\/category-tree &#8212; \u67e5\u8be2\u6240\u6709\u5206\u7c7b\u6811 &#8212; \u7ed9\u6dfb\u52a0\u5546\u54c1\u63d0\u4f9b\u7684<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> \/product\/supply-list -- \u67e5\u8be2\u6240\u6709\u4f9b\u5e94\u5546 -- \u7ed9\u6dfb\u52a0\u5546\u54c1\u63d0\u4f9b\u7684\n\n \/product\/place-list -- \u67e5\u8be2\u6240\u6709\u4ea7\u5730 -- \u7ed9\u6dfb\u52a0\u5546\u54c1\u63d0\u4f9b\u7684\n\n \/product\/unit-list -- \u67e5\u8be2\u6240\u6709\u5355\u4f4d -- \u7ed9\u6dfb\u52a0\u5546\u54c1\u63d0\u4f9b\u7684\n\n\n \/product\/img-upload -- \u4e0a\u4f20\u56fe\u7247\n file:\u4e0a\u4f20\u7684\u56fe\u7247\u7684\u5b57\u8282\u6570\u636e\n\n \/product\/product-add -- \u6dfb\u52a0\u5546\u54c1\n {\n   brandId:2\n   imgs:\"midea_ph.jpg\" --- \/img\/upload\/midea_ph.jpg\n   inPrice:\"2000\"\n   introduce:\"\u7f8e\u7684 \u53d8\u9891  \u4e2d\u592e\u7a7a\u8c03\"\n   memPrice:\"2400\"\n   placeId:5\n   productDate:\"2023-06-20\"\n   productInvent:50\n   productName:\"\u4e2d\u592e\u7a7a\u8c03\"\n   productNum:\"midea_ph_001\"\n   salePrice:\"2500\"\n   storeId:1\n   suppDate:\"2026-06-20\"\n   supplyId:5\n   typeId:7\n   typeName:\"\u7a7a\u8c03\"\n   unitId:6\n }<\/code><\/pre>\n\n\n\n<p>3&gt;\u4fee\u6539\u5546\u54c1\u4e0a\u4e0b\u67b6\u72b6\u6001<br>\/product\/state-change<br>{<br>productId:31<br>upDownState:1<br>}<\/p>\n\n\n\n<p>4&gt;\u5220\u9664\u5546\u54c1<br>\/product\/product-delete\/{productId} &#8212; \u6839\u636e\u5546\u54c1id\u5220\u9664\u5355\u4e2a\u5546\u54c1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/product\/product-list-delete --- \u6279\u91cf\u5220\u9664\u5546\u54c1\n&#91;31, 25]\n\ndelete from product where product_id in(1,2,3...)<\/code><\/pre>\n\n\n\n<p>5&gt;\u4fee\u6539\u5546\u54c1<br>\/product\/product-update<br>{<br>brandId:2<br>brandName:&#8221;\u7f8e\u7684&#8221;<br>createBy:1<br>createTime:&#8221;2023-06-20T10:07:02.000+00:00&#8243;<br>imgs:&#8221;\/img\/upload\/midea_ph.jpg&#8221; &#8220;midea_zh.jpg&#8221; &#8212; \u5982\u679c\u56fe\u7247\u6ca1\u6709\u88ab\u4fee\u6539\u5219\u8fd8\u662f\u5b8c\u6574\u7684\u8bbf\u95ee\u5730\u5740,\u5982\u679c\u88ab\u4fee\u6539\u4e86\u53ea\u6709\u56fe\u7247\u540d\u79f0<br>inPrice:2000<br>introduce:&#8221;\u7f8e\u7684 \u53d8\u9891 \u4e2d\u592e\u7a7a\u8c03 \u900f\u5fc3\u51c9&#8221;<br>isOverDate:null<br>memPrice:&#8221;2300&#8243;<br>placeId:5<br>placeName:&#8221;\u5c71\u4e1c&#8221;<br>productDate:&#8221;2023-06-20&#8243;<br>productId:31<br>productInvent:50<br>productName:&#8221;\u7a7a\u8c03&#8221;<br>productNum:&#8221;midea_ph_002&#8243;<br>salePrice:&#8221;2400&#8243;<br>storeId:1<br>storeName:&#8221;\u897f\u5b89\u4ed3\u5e93&#8221;<br>suppDate:&#8221;2026-06-20&#8243;<br>supplyId:5<br>supplyName:&#8221;\u7f8e\u7684\u96c6\u56e2\u80a1\u4efd\u6709\u9650\u516c\u53f8&#8221;<br>typeId:7<br>typeName:&#8221;\u7a7a\u8c03&#8221;<br>unitId:6<br>unitName:&#8221;\u53f0&#8221;<br>upDownState:&#8221;0&#8243;<br>}<\/p>\n\n\n\n<p>6&gt;\u6dfb\u52a0\u91c7\u8d2d\u5355<br>\u91c7\u8d2d\u6d41\u7a0b:<br>1)\u5728\u5546\u54c1\u5217\u8868\u9488\u5bf9\u5177\u4f53\u7684\u5546\u54c1\u6dfb\u52a0\u91c7\u8d2d\u5355 &#8212; \u5411\u91c7\u8d2d\u5355\u8868buy_list\u8868\u6dfb\u52a0\u8bb0\u5f55(\u72b6\u6001\u662f0\u672a\u5165\u5e93) &#8212; \u9884\u4e70\u5546\u54c1<br>2)\u5f53\u5546\u54c1\u91c7\u8d2d\u5230\u4e4b\u540e\u8fdb\u884c\u5165\u5e93 &#8212; \u5728\u91c7\u8d2d\u5355\u5217\u8868\u505a\u5165\u5e93\u64cd\u4f5c &#8212; \u5411\u5165\u5e93\u5355\u8868in_store\u8868\u6dfb\u52a0\u8bb0\u5f55(\u72b6\u6001\u662f0\u672a\u5165\u5e93),\u540c\u65f6\u4fee\u6539\u91c7\u8d2d\u5355\u8868buy_list\u8868<br>\u75310\u6539\u4e3a1\u5165\u5e93 &#8212; \u51c6\u5907\u5165\u5e93<br>3)\u5546\u54c1\u771f\u6b63\u7684\u5165\u5e93 &#8212; \u5728\u5165\u5e93\u5355\u5217\u8868\u505a\u786e\u8ba4\u5165\u5e93\u64cd\u4f5c &#8212; \u5c06\u5165\u5e93\u5355\u8868in_store\u8868\u7684\u5165\u5e93\u5355\u72b6\u6001\u75310\u6539\u4e3a1\u5165\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   \/purchase\/purchase-add\n   {\n     brandId: 3\n brandName: \"\u6d77\u5c14\"\n buyNum: \"50\" \u221a   -- fact_buy_num\u5b9e\u9645\u91c7\u8d2d\u6570\u91cf,\u521d\u503c\u8ddfbuyNum\u4e00\u81f4\n buyUser: \"\u5f20\u4e09\" \u221a\n createBy: 1\n createTime: \"2023-06-20T10:07:02.000+00:00\"\n imgs: \"\/img\/upload\/midea_zh.jpg\"\n inPrice: 2000\n introduce: \"\u6d77\u5c14 \u53d8\u9891 \u4e2d\u592e\u7a7a\u8c03 \u900f\u5fc3\u51c9\"\n isOverDate: null\n memPrice: 2300\n phone: \"13666666666\" \u221a\n placeId: 5 \u221a\n placeName: \"\u5c71\u4e1c\"\n productDate: \"2023-06-20\"\n productId: 31  \u221a\n productInvent: 50\n productName: \"\u7a7a\u8c03\"\n productNum: \"midea_ph_002\"\n salePrice: 2400\n storeId: 1 \u221a\n storeName: \"\u897f\u5b89\u4ed3\u5e93\"\n suppDate: \"2026-06-20\"\n supplyId: 4  \u221a\n supplyName: \"\u6d77\u5c14\u96c6\u56e2\"\n typeId: 7\n typeName: \"\u7a7a\u8c03\"\n unitId: 6\n unitName: \"\u53f0\"\n upDownState: \"0\"\n updateBy: 1\n updateTime: \"2023-06-20T11:46:43.000+00:00\"\n   }<\/code><\/pre>\n\n\n\n<p>7&gt;\u6dfb\u52a0\u51fa\u5e93\u5355<br>\u51fa\u5e93\u6d41\u7a0b:<br>1)\u5728\u5546\u54c1\u5217\u8868\u9488\u5bf9\u5177\u4f53\u7684\u5546\u54c1\u6dfb\u52a0\u51fa\u5e93\u5355 &#8212; \u5411\u51fa\u5e93\u5355\u8868out_store\u8868\u6dfb\u52a0\u51fa\u5e93\u5355(\u72b6\u6001\u662f0\u672a\u51fa\u5e93) &#8212; \u51c6\u5907\u51fa\u5e93<br>2)\u5546\u54c1\u771f\u6b63\u51fa\u5e93\u4e4b\u540e,\u5728\u51fa\u5e93\u5355\u5217\u8868\u505a\u786e\u8ba4\u51fa\u5e93\u64cd\u4f5c &#8212; \u5c06\u51fa\u5e93\u5355\u8868out_store\u8868\u7684\u51fa\u5e93\u72b6\u6001\u75310\u6539\u4e3a1\u5df2\u51fa\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/outstore\/outstore-add\n    {\n     brandId: 3\n brandName: \"\u6d77\u5c14\"\n createBy: 1\n createTime: \"2023-06-20T10:07:02.000+00:00\"\n imgs: \"\/img\/upload\/midea_zh.jpg\"\n inPrice: 2000\n introduce: \"\u6d77\u5c14 \u53d8\u9891 \u4e2d\u592e\u7a7a\u8c03 \u900f\u5fc3\u51c9\"\n isOverDate: null\n memPrice: 2300\n outNum: \"10\" \u221a \n placeId: 5\n placeName: \"\u5c71\u4e1c\"\n productDate: \"2023-06-20\"\n productId: 31 \u221a\n productInvent: 50\n productName: \"\u7a7a\u8c03\"\n productNum: \"midea_ph_002\"\n salePrice: 2400 -- out_price\u5b57\u6bb5\u51fa\u5e93\u4ef7\u683c\u7ed9salePrice\u5c5e\u6027\u7684\u503c\n storeId: 1  \u221a\n storeName: \"\u897f\u5b89\u4ed3\u5e93\"\n suppDate: \"2026-06-20\"\n supplyId: 4\n supplyName: \"\u6d77\u5c14\u96c6\u56e2\"\n typeId: 7\n typeName: \"\u7a7a\u8c03\"\n unitId: 6\n unitName: \"\u53f0\"\n upDownState: \"1\"\n updateBy: 1\n updateTime: \"2023-06-20T11:46:43.000+00:00\"\n    }<\/code><\/pre>\n\n\n\n<p>2.\u5546\u54c1\u5206\u7c7b:<br>1&gt;\u67e5\u8be2\u5546\u54c1\u5206\u7c7b\u6811<br>\/productCategory\/product-category-tree &#8212; \u5b9a\u4e49\u65b0\u7684url\u63a5\u53e3,\u8c03\u7528\u6dfb\u52a0\u5546\u54c1\u65f6\u7f16\u5199\u7684\u67e5\u8be2\u5546\u54c1\u5206\u7c7b\u7684\u4e1a\u52a1\u5373\u53ef;<\/p>\n\n\n\n<p>2&gt;\u6dfb\u52a0\u5546\u54c1\u5206\u7c7b<br>\/productCategory\/verify-type-code?typeCode=lingshi &#8212; \u6821\u9a8c\u5206\u7c7b\u7f16\u7801\u662f\u5426\u5df2\u5b58\u5728\u7684<br>select * from product_type where type_code = ? or type_name = ? &#8212; \u6839\u636e\u5206\u7c7b\u7f16\u7801\u6216\u8005\u5206\u7c7b\u540d\u79f0\u67e5\u8be2\u5546\u54c1\u5206\u7c7b,\u4ee5\u6b64\u5224\u65ad<br>\u5206\u7c7b\u7f16\u7801\u6216\u5206\u7c7b\u540d\u79f0\u662f\u5426\u5df2\u5b58\u5728<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>productCategory\/type-add\n{\n  parentId:0\n  typeCode: \"xiaomi\"\n  typeDesc:\"\u53d1\u70e7  \u6027\u4ef7\u6bd4\u9ad8\"\n  typeName:\"\u5c0f\u7c73\u624b\u673a\"\n}<\/code><\/pre>\n\n\n\n<p>3&gt;\u5220\u9664\u5546\u54c1\u5206\u7c7b<br>\/productCategory\/type-delete\/{typeId} &#8212; \u6839\u636e\u5206\u7c7bid\u6216\u7236\u7ea7\u5206\u7c7bid\u5220\u9664\u5206\u7c7b<\/p>\n\n\n\n<p>4&gt;\u4fee\u6539\u5546\u54c1\u5206\u7c7b<br>\/productCategory\/type-update<br>{<br>parentId:11<br>typeCode:&#8221;xiaomi&#8221;<br>typeDesc:&#8221;\u53d1\u70e7 \u6027\u4ef7\u6bd4\u9ad8 \u62cd\u7167\u9ad8\u6e05&#8221;<br>typeId:18<br>typeName:&#8221;\u7ea2\u7c73\u624b\u673a&#8221;<br>}<\/p>\n\n\n\n<p>\u91c7\u8d2d\u5355\u7ba1\u7406\u6a21\u5757:<\/p>\n\n\n\n<p>1.\u91c7\u8d2d\u5217\u8868<br>\/purchase\/store-list &#8212; \u67e5\u8be2\u6240\u6709\u4ed3\u5e93<\/p>\n\n\n\n<p>\/purchase\/purchase-page-list?storeId=1&amp;startTime=&amp;endTime=&amp;productName=&amp;buyUser=&amp;isIn=&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<br>\u67e5\u8be2\u6240\u6709\u91c7\u8d2d\u5355\u5e76\u5206\u9875 \u6216\u8005\u662f \u6839\u636e\u4ed3\u5e93id\u3001\u8d77\u6b62\u65f6\u95f4\u3001\u5546\u54c1\u540d\u79f0\u3001\u91c7\u8d2d\u5458\u3001\u662f\u5426\u5165\u5e93\u67e5\u8be2\u91c7\u8d2d\u5355\u5e76\u5206\u9875;<\/p>\n\n\n\n<p>\u8bf7\u6c42\u53c2\u6570\u5206\u6790:<br>\u9875\u7801pageNum \u6bcf\u9875\u884c\u6570pageSize &#8212; Page\u63a5\u6536\u5c01\u88c5<\/p>\n\n\n\n<p>storeId startTime endTime productName buyUser isIn &#8212; \u4f7f\u7528Purchase\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5,\u4f46\u662fPurchase\u7c7b\u4e2d\u6ca1\u6709\u5c5e\u6027startTime<br>endTime productName,\u9700\u8981\u8ffd\u52a0;<\/p>\n\n\n\n<p>\u91c7\u8d2d\u5355\u5217\u8868\u5c55\u793a\u7684\u6570\u636e\u5206\u6790:<br>\u989d\u5916\u9700\u8981\u4ed3\u5e93\u540d \u5546\u54c1\u540d &#8212; \u9700\u8981\u7ed9Purchase\u8ffd\u52a0\u5c5e\u6027storeName productName;<\/p>\n\n\n\n<p>statr &lt;= buyTime &lt;= end<\/p>\n\n\n\n<p>2.\u5220\u9664\u91c7\u8d2d\u5355<br>\/purchase\/purchase-delete\/{buyId} &#8212; \u6839\u636eid\u5220\u9664\u91c7\u8d2d\u5355<\/p>\n\n\n\n<p>3.\u4fee\u6539\u91c7\u8d2d\u5355<br>\/purchase\/purchase-update<br>{<br>buyId: 49 \u221a<br>buyNum: 50 \u221a<br>buyTime: &#8220;2023-06-21T09:59:39.000+00:00&#8221;<br>buyUser: &#8220;\u5f20\u4e09&#8221;<br>endTime: null<br>factBuyNum: &#8220;40&#8221; \u221a<br>isIn: &#8220;0&#8221;<br>phone: &#8220;13666666666&#8221;<br>placeId: 5<br>productId: 31<br>productName: &#8220;\u7a7a\u8c03&#8221;<br>startTime: null<br>storeId: 1<br>storeName: &#8220;\u897f\u5b89\u4ed3\u5e93&#8221;<br>supplyId: 4<br>}<\/p>\n\n\n\n<p>4.\u751f\u6210\u5165\u5e93\u5355<br>\/purchase\/in-warehouse-record-add<br>{<br>buyId: 49<br>buyNum: 50<br>buyTime: &#8220;2023-06-21T09:59:39.000+00:00&#8221;<br>buyUser: &#8220;\u5f20\u4e09&#8221;<br>endTime: null<br>factBuyNum: 40<br>isIn: &#8220;0&#8221;<br>phone: &#8220;13666666666&#8221;<br>placeId: 5<br>productId: 31<br>productName: &#8220;\u7a7a\u8c03&#8221;<br>startTime: null<br>storeId: 1<br>storeName: &#8220;\u897f\u5b89\u4ed3\u5e93&#8221;<br>supplyId: 4<br>}<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5165\u5e93\u5355\u7ba1\u7406\u6a21\u5757:<\/p>\n\n\n\n<p>1.\u5165\u5e93\u5355\u5217\u8868<br>\/instore\/store-list &#8212; \u67e5\u8be2\u6240\u6709\u4ed3\u5e93<\/p>\n\n\n\n<p>\/instore\/instore-page-list?storeId=&amp;productName=&amp;startTime=&amp;endTime=&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<br>\u67e5\u8be2\u6240\u6709\u5165\u5e93\u5355\u5e76\u5206\u9875 \u6216\u8005 \u6839\u636e\u4ed3\u5e93id\u3001\u5546\u54c1\u540d\u79f0\u3001\u8d77\u6b62\u65f6\u95f4\u67e5\u8be2\u5165\u5e93\u5355\u5e76\u5206\u9875<\/p>\n\n\n\n<p>\u8bf7\u6c42\u53c2\u6570\u5206\u6790:<br>\u9875\u7801pageNum \u6bcf\u9875\u884c\u6570pageSize &#8212; Page\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5<br>storeId productName startTime endTime &#8212; InStore\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5 &#8212; InStore\u8ffd\u52a0\u5c5e\u6027productName startTime endTime<\/p>\n\n\n\n<p>\u5165\u5e93\u5355\u5217\u8868\u5c55\u793a\u7684\u4fe1\u606f\u5206\u6790:<br>\u4ed3\u5e93\u540d\u79f0 \u5546\u54c1\u540d \u5165\u5e93\u4ef7\u683c \u521b\u5efa\u4eba &#8212; InStore\u8ffd\u52a0\u5c5e\u6027storeName productName inPrice userCode<\/p>\n\n\n\n<p>2.\u786e\u5b9a\u5165\u5e93<br>1&gt;\u5c06\u5165\u5e93\u5355\u72b6\u6001\u6539\u4e3a\u5df2\u5165\u5e93<br>2&gt;\u589e\u52a0\u5546\u54c1\u7684\u5e93\u5b58<br>\/instore\/instore-confirm<br>{<br>createBy: 1<br>createTime: &#8220;2022-04-20T17:30:25.000+00:00&#8221;<br>endTime: null<br>inNum: 50<br>inPrice: 2000<br>insId: 35<br>isIn: &#8220;0&#8221;<br>productId: 22<br>productName: &#8220;\u7a7a\u8c03&#8221;<br>startTime: null<br>storeId: 1<br>storeName: &#8220;\u897f\u5b89\u4ed3\u5e93&#8221;<br>userCode: &#8220;admin&#8221;<br>}<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u51fa\u5e93\u5355\u7ba1\u7406\u6a21\u5757:<\/p>\n\n\n\n<p>1.\u51fa\u5e93\u5217\u8868<br>\/outstore\/store-list &#8212; \u67e5\u8be2\u6240\u6709\u4ed3\u5e93<\/p>\n\n\n\n<p>\/outstore\/outstore-page-list?storeId=&amp;productName=&amp;startTime=&amp;endTime=&amp;isOut=&amp;pageSize=5&amp;pageNum=1&amp;totalNum=0<br>\u67e5\u8be2\u6240\u6709\u51fa\u5e93\u5355\u5e76\u5206\u9875 \u6216\u8005 \u6839\u636e\u4ed3\u5e93id \u5546\u54c1\u540d\u79f0 \u8d77\u6b62\u65f6\u95f4 \u662f\u5426\u51fa\u5e93\u67e5\u8be2\u51fa\u5e93\u5355\u5e76\u5206\u9875;<\/p>\n\n\n\n<p>\u8bf7\u6c42\u53c2\u6570\u7684\u5206\u6790:<br>\u9875\u7801pageNum \u6bcf\u9875\u884c\u6570pageSize &#8212; Page\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5<br>storeId productName startTime endTime isOut &#8212; OutStore\u5bf9\u8c61\u63a5\u6536\u5e76\u5c01\u88c5 &#8212; OutStore\u7c7b\u8ffd\u52a0\u5c5e\u6027productName startTime endTime<\/p>\n\n\n\n<p>\u51fa\u5e93\u5355\u5217\u8868\u5c55\u793a\u7684\u6570\u636e\u7684\u5206\u6790:<br>\u4ed3\u5e93\u540d\u79f0 \u5546\u54c1\u540d\u79f0 \u521b\u5efa\u4eba &#8212; OutStore\u7c7b\u8ffd\u52a0\u5c5e\u6027storeName productName userCode<\/p>\n\n\n\n<p>2.\u786e\u5b9a\u51fa\u5e93<br>1&gt;\u5c06\u51fa\u5e93\u5355\u72b6\u6001\u6539\u4e3a1\u5df2\u51fa\u5e93<br>2&gt;\u4fee\u6539\u5546\u54c1\u7684\u5e93\u5b58 &#8212; \u51cf\u5e93\u5b58<\/p>\n\n\n\n<p>\/outstore\/outstore-confirm<br>{<br>createBy: 1<br>createTime: &#8220;2023-06-20T16:06:11.000+00:00&#8221;<br>endTime: null<br>isOut: &#8220;0&#8221;<br>outNum: 10<br>outPrice: 2400<br>outsId: 14<br>productId: 31<br>productName: &#8220;\u7a7a\u8c03&#8221;<br>salePrice: null<br>startTime: null<br>storeId: 1<br>storeName: &#8220;\u897f\u5b89\u4ed3\u5e93&#8221;<br>tallyId: null<br>userCode: &#8220;admin&#8221;<br>}<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u7edf\u8ba1\u67e5\u8be2\uff1a<br>\u524d\u7aef\u4f7f\u7528echarts\u6846\u67b6,\u540e\u53f0\u8d1f\u8d23\u67e5\u8be2\u7ec4\u88c5\u6570\u636e,\u7136\u540e\u5c06\u540e\u53f0\u67e5\u8be2\u5230\u7684\u6570\u636e\u54cd\u5e94\u7ed9\u524d\u7aef,\u524d\u7aef\u518d\u4ee5<br>echarts\u6846\u67b6\u6240\u9700\u7684\u56fe\u5f62\u7ed3\u6784 \u683c\u5f0f\u586b\u5145\u5230\u56fe\u5f62\u4e2d\u3002<\/p>\n\n\n\n<p>\/statistics\/store-invent &#8212; \u67e5\u8be2\u6bcf\u4e2a\u4ed3\u5e93\u5b58\u50a8\u7684\u5546\u54c1\u7684\u6570\u91cf;<\/p>\n\n\n\n<p>select t1.store_id, t1_store_name, ifnull(sum(product_invent),0)<br>from store t1, product t2<br>where t1.store_id = t2.store_id<br>group by t1.store_id, t1_store_name<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf &#8212; SpringBoot + Vue3\u524d\u540e\u7aef\u5206\u79bb\u7684\u9879\u76ee\uff1a \u4e00\u3001\u9879\u76ee\u4ecb\u7ecd:1.\u9879\u76ee\u63cf\u8ff0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-1746","post","type-post","status-publish","format-standard","hentry","category-28"],"_links":{"self":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/comments?post=1746"}],"version-history":[{"count":2,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1746\/revisions"}],"predecessor-version":[{"id":1749,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1746\/revisions\/1749"}],"wp:attachment":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/media?parent=1746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/categories?post=1746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/tags?post=1746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}