commit f92cb9799942c3a5fcaf1f62fadda4bda569e4b1 Author: wxc <191104855@qq.com> Date: Tue Oct 8 17:26:15 2024 +0800 v1.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..8f96f52 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip diff --git a/demo.json b/demo.json new file mode 100644 index 0000000..c95e6e1 --- /dev/null +++ b/demo.json @@ -0,0 +1,1978 @@ +{ + "id": "workbook", + "sheetOrder": [ + "sheet1" + ], + "appVersion": "0.2.5", + "locale": "zhCN", + "styles": { + "xGBbcX": { + "ff": "宋体", + "fs": 11, + "it": 0, + "bl": 1, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "ht": 2, + "vt": 2, + "tb": 1, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "l": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "r": { + "cl": { + "rgb": "black" + }, + "s": 1 + }, + "t": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + }, + "F-Ls2N": { + "ff": "宋体", + "fs": 11, + "it": 0, + "bl": 1, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "bg": { + "rgb": "rgb(255,255,0)" + }, + "ht": 2, + "vt": 2, + "tb": 3, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "r": { + "cl": { + "rgb": "black" + }, + "s": 1 + }, + "t": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + }, + "llzccW": { + "ff": "宋体", + "fs": 11, + "it": 0, + "bl": 1, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "bg": { + "rgb": "rgb(255,255,0)" + }, + "ht": 2, + "vt": 2, + "tb": 3, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "t": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + }, + "57w9Hq": { + "ff": "宋体", + "fs": 11, + "it": 0, + "bl": 1, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "bg": { + "rgb": "rgb(255,255,0)" + }, + "ht": 2, + "vt": 2, + "tb": 3, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "l": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "r": { + "cl": { + "rgb": "black" + }, + "s": 1 + }, + "t": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + }, + "jFn5AD": { + "ff": "黑体, monospace", + "fs": 11, + "it": 0, + "bl": 0, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "bg": { + "rgb": "rgb(181,198,234)" + }, + "ht": 2, + "vt": 2, + "tb": 1, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "l": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "r": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + }, + "qKi9hm": { + "ff": "黑体, monospace", + "fs": 11, + "it": 0, + "bl": 0, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "bg": { + "rgb": "rgb(181,198,234)" + }, + "ht": 2, + "vt": 2, + "tb": 1, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "r": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + }, + "_i-Ps5": { + "ff": "黑体, monospace", + "fs": 11, + "it": 0, + "bl": 0, + "ul": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "st": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "ol": { + "s": 0, + "cl": { + "rgb": "rgb(0,0,0)" + } + }, + "tr": { + "a": 0, + "v": 0 + }, + "td": 0, + "cl": { + "rgb": "rgb(0,0,0)" + }, + "bg": { + "rgb": "rgb(255,255,0)" + }, + "ht": 2, + "vt": 2, + "tb": 3, + "pd": { + "t": 0, + "b": 1, + "l": 2, + "r": 2 + }, + "bd": { + "r": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + }, + "b": { + "cl": { + "rgb": "windowtext" + }, + "s": 1 + } + } + } + }, + "sheets": { + "sheet1": { + "name": "信访投诉台账", + "id": "sheet1", + "cellData": { + "0": { + "0": { + "v": "信访基本信息", + "t": 1, + "s": "xGBbcX" + }, + "1": { + "s": "xGBbcX" + }, + "2": { + "s": "xGBbcX" + }, + "3": { + "s": "xGBbcX" + }, + "4": { + "s": "xGBbcX" + }, + "5": { + "s": "xGBbcX" + }, + "6": { + "s": "xGBbcX" + }, + "7": { + "s": "xGBbcX" + }, + "8": { + "s": "xGBbcX" + }, + "9": { + "s": "xGBbcX" + }, + "10": { + "s": "xGBbcX" + }, + "11": { + "s": "xGBbcX" + }, + "12": { + "s": "xGBbcX" + }, + "13": { + "s": "xGBbcX" + }, + "14": { + "v": "数字督察(单位责任信息)", + "t": 1, + "s": "F-Ls2N" + }, + "15": { + "s": "F-Ls2N" + }, + "16": { + "s": "F-Ls2N" + }, + "17": { + "v": "数字督察(涉及人员信息)", + "t": 1, + "s": "llzccW" + }, + "18": { + "s": "llzccW" + }, + "19": { + "s": "llzccW" + }, + "20": { + "s": "llzccW" + }, + "21": { + "s": "llzccW" + }, + "22": { + "s": "llzccW" + }, + "23": { + "s": "llzccW" + }, + "24": { + "s": "llzccW" + }, + "25": { + "s": "llzccW" + }, + "26": { + "s": "llzccW" + }, + "27": { + "s": "llzccW" + }, + "28": { + "v": "数字督察(涉及领导信息)", + "t": 1, + "s": "57w9Hq" + }, + "29": { + "s": "57w9Hq" + }, + "30": { + "s": "57w9Hq" + }, + "31": { + "s": "57w9Hq" + }, + "32": { + "s": "57w9Hq" + }, + "33": { + "s": "57w9Hq" + } + }, + "1": { + "0": { + "v": "投诉渠道", + "t": 1, + "s": "jFn5AD" + }, + "1": { + "v": "信件编号", + "t": 1, + "s": "qKi9hm" + }, + "2": { + "v": "受理层级", + "t": 1, + "s": "qKi9hm" + }, + "3": { + "v": "登记时间", + "t": 1, + "s": "qKi9hm" + }, + "4": { + "v": "投诉人", + "t": 1, + "s": "qKi9hm" + }, + "5": { + "v": "投诉人电话", + "t": 1, + "s": "qKi9hm" + }, + "6": { + "v": "初重信访", + "t": 1, + "s": "qKi9hm" + }, + "7": { + "v": "缠访闹访", + "t": 1, + "s": "qKi9hm" + }, + "8": { + "v": "群众集访", + "t": 1, + "s": "qKi9hm" + }, + "9": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": 72.41804504394531, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 1 + } + }, + "body": { + "dataStream": "涉嫌问题*\r\n", + "textRuns": [ + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "涉嫌问题*", + "t": 1, + "s": "qKi9hm" + }, + "10": { + "v": "业务类别", + "t": 1, + "s": "qKi9hm" + }, + "11": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": 72.41804504394531, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 1 + } + }, + "body": { + "dataStream": "涉及警种*\r\n", + "textRuns": [ + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "涉及警种*", + "t": 1, + "s": "qKi9hm" + }, + "12": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": 87.07803344726562, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 1 + } + }, + "body": { + "dataStream": "被投诉机构*\r\n", + "textRuns": [ + { + "st": 5, + "ed": 6, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 6, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "被投诉机构*", + "t": 1, + "s": "qKi9hm" + }, + "13": { + "v": "具体内容", + "t": 1, + "s": "qKi9hm" + }, + "14": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": 88, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "涉及单位*\r\n", + "textRuns": [ + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "涉及单位*", + "t": 1, + "s": "_i-Ps5" + }, + "15": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": 88, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "是否 单位责任*\r\n", + "textRuns": [ + { + "st": 10, + "ed": 11, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 11, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "是否 单位责任*", + "t": 1, + "s": "_i-Ps5" + }, + "16": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": 88, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "单位 处理结果\r\n", + "textRuns": [], + "paragraphs": [ + { + "startIndex": 10, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "单位 处理结果", + "t": 1, + "s": "_i-Ps5" + }, + "17": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "涉及人姓名*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 5, + "ed": 6, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 6, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "涉及人姓名*", + "t": 1, + "s": "_i-Ps5" + }, + "18": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "身份证号码*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 5, + "ed": 6, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 6, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "身份证号码*", + "t": 1, + "s": "_i-Ps5" + }, + "19": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "人员属性*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "人员属性*", + "t": 1, + "s": "_i-Ps5" + }, + "20": { + "v": "督察措施", + "t": 1, + "s": "_i-Ps5" + }, + "21": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "问题类型*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "问题类型*", + "t": 1, + "s": "_i-Ps5" + }, + "22": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "主观方面*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "主观方面*", + "t": 1, + "s": "_i-Ps5" + }, + "23": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "责任类别*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "责任类别*", + "t": 1, + "s": "_i-Ps5" + }, + "24": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "处理结果*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "处理结果*", + "t": 1, + "s": "_i-Ps5" + }, + "25": { + "v": "维权容错", + "t": 1, + "s": "_i-Ps5" + }, + "26": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "帮扶情况*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "帮扶情况*", + "t": 1, + "s": "_i-Ps5" + }, + "27": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "帮扶 开始结束时间*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 2, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 2, + "ed": 12, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 12, + "ed": 13, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 13, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "帮扶 开始结束时间*", + "t": 1, + "s": "_i-Ps5" + }, + "28": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "涉及领导姓名*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 6, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 6, + "ed": 7, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 7, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "涉及领导姓名*", + "t": 1, + "s": "_i-Ps5" + }, + "29": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "身份证号码*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 5, + "ed": 6, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 6, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "身份证号码*", + "t": 1, + "s": "_i-Ps5" + }, + "30": { + "v": "督察措施", + "t": 1, + "s": "_i-Ps5" + }, + "31": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "责任类别*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "责任类别*", + "t": 1, + "s": "_i-Ps5" + }, + "32": { + "p": { + "id": "d", + "documentStyle": { + "pageSize": { + "width": null, + "height": null + }, + "marginTop": 0, + "marginBottom": 1, + "marginRight": 2, + "marginLeft": 2, + "renderConfig": { + "horizontalAlign": 2, + "verticalAlign": 2, + "centerAngle": 0, + "vertexAngle": 0, + "wrapStrategy": 3 + } + }, + "body": { + "dataStream": "处理结果*\r\n", + "textRuns": [ + { + "st": 0, + "ed": 4, + "ts": { + "cl": { + "rgb": "rgb(0,0,0)" + }, + "fs": 11, + "ff": "黑体, monospace" + } + }, + { + "st": 4, + "ed": 5, + "ts": { + "cl": { + "rgb": "rgb(255,0,0)" + }, + "fs": 11, + "bl": 1, + "ff": "黑体, monospace" + } + } + ], + "paragraphs": [ + { + "startIndex": 5, + "paragraphStyle": { + "horizontalAlign": 2 + } + } + ] + }, + "drawings": {}, + "drawingsOrder": [] + }, + "v": "处理结果*", + "t": 1, + "s": "_i-Ps5" + }, + "33": { + "v": "维权容错", + "t": 1, + "s": "_i-Ps5" + } + } + }, + "mergeData": [ + { + "startRow": 0, + "endRow": 0, + "startColumn": 0, + "endColumn": 13 + }, + { + "startRow": 0, + "endRow": 0, + "startColumn": 14, + "endColumn": 16 + }, + { + "startRow": 0, + "endRow": 0, + "startColumn": 17, + "endColumn": 27 + }, + { + "startRow": 0, + "endRow": 0, + "startColumn": 42, + "endColumn": 47 + } + ], + "tabColor": "", + "hidden": 0, + "rowCount": 1000, + "columnCount": 34, + "zoomRatio": 1, + "freeze": { + "xSplit": 0, + "ySplit": 0, + "startRow": -1, + "startColumn": -1 + }, + "scrollTop": 0, + "scrollLeft": 0, + "defaultColumnWidth": 88, + "defaultRowHeight": 24, + "rowData": { + "0": { + "hd": 0, + "h": 40 + }, + "1": { + "hd": 0, + "h": 41.266666666666666 + } + }, + "columnData": { + "0": { + "w": 136, + "hd": 0 + }, + "1": { + "w": 146, + "hd": 0 + }, + "2": { + "w": 113, + "hd": 0 + }, + "3": { + "w": 146, + "hd": 0 + }, + "4": { + "w": 115, + "hd": 0 + }, + "5": { + "w": 146, + "hd": 0 + }, + "6": { + "w": 111, + "hd": 0 + }, + "7": { + "w": 98, + "hd": 0 + }, + "8": { + "w": 112, + "hd": 0 + }, + "9": { + "w": 98, + "hd": 0 + }, + "10": { + "w": 99, + "hd": 0 + }, + "11": { + "w": 94, + "hd": 0 + }, + "12": { + "w": 72, + "hd": 0 + }, + "13": { + "w": 88, + "hd": 0 + }, + "14": { + "w": 88, + "hd": 0 + }, + "15": { + "w": 88, + "hd": 0 + }, + "16": { + "w": 88, + "hd": 0 + }, + "17": { + "w": 88, + "hd": 0 + }, + "18": { + "w": 88, + "hd": 0 + }, + "19": { + "w": 88, + "hd": 0 + }, + "20": { + "w": 88, + "hd": 0 + }, + "21": { + "w": 96, + "hd": 0 + }, + "22": { + "w": 83, + "hd": 0 + }, + "23": { + "w": 90, + "hd": 0 + }, + "24": { + "w": 72, + "hd": 0 + }, + "25": { + "w": 91, + "hd": 0 + }, + "26": { + "w": 130, + "hd": 0 + }, + "27": { + "w": 124, + "hd": 0 + }, + "28": { + "w": 98, + "hd": 0 + }, + "29": { + "w": 107, + "hd": 0 + }, + "30": { + "w": 100, + "hd": 0 + }, + "31": { + "w": 102, + "hd": 0 + }, + "32": { + "w": 100, + "hd": 0 + }, + "33": { + "w": 88, + "hd": 0 + } + }, + "showGridlines": 1, + "rowHeader": { + "width": 46, + "hidden": 0 + }, + "columnHeader": { + "height": 20, + "hidden": 0 + }, + "selections": [ + "A1" + ], + "rightToLeft": 0 + } + }, + "resources": [] +} \ No newline at end of file diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..d7c358e --- /dev/null +++ b/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..6f779cf --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c38d8cf --- /dev/null +++ b/pom.xml @@ -0,0 +1,184 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.2 + + + com.biutag + supervision + 0.0.1-SNAPSHOT + supervision + 长沙公安数据督察 + + + + + + + + + + + + + + + 17 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-validation + + + + org.springframework.boot + spring-boot-starter-data-redis-reactive + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + com.mysql + mysql-connector-j + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + + com.baomidou + mybatis-plus-spring-boot3-starter + 3.5.7 + + + + com.alibaba + easyexcel + 4.0.1 + + + + cn.hutool + hutool-core + 5.8.29 + + + cn.hutool + hutool-http + 5.8.29 + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + 4.3.1 + + + + org.freemarker + freemarker + 2.3.32 + test + + + + org.springframework.security + spring-security-crypto + + + + com.github.tobato + fastdfs-client + 1.27.2 + + + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + 4.1.0 + + + + + + + + src/main/resources + false + + + src/main/resources + + application.yml + + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + supervision + + + + + dev + + + dev + + + + + true + + + + prod + + prod + + + + + \ No newline at end of file diff --git a/sql/0911.sql b/sql/0911.sql new file mode 100644 index 0000000..f10ad05 --- /dev/null +++ b/sql/0911.sql @@ -0,0 +1,2 @@ +ALTER TABLE `negative`.`negative` + ADD COLUMN `case_number` varchar(255) NULL COMMENT '涉及案件/警情编号' AFTER `handle_three_depart_name`; \ No newline at end of file diff --git a/sql/data.sql b/sql/data.sql new file mode 100644 index 0000000..8cb954c --- /dev/null +++ b/sql/data.sql @@ -0,0 +1,83 @@ +CREATE TABLE data_case_verification ( + origin_id varchar(255) NOT NULL COMMENT '样本源头编号(案件编号)', + discovery_time datetime NULL COMMENT '问题发现时间(受理时间)', + happen_time datetime NULL COMMENT '问题发生时间', + problem_sources varchar(255) NULL COMMENT '问题来源', + complainant varchar(255) NULL COMMENT '投诉反映人(投诉人)', + complainant_phone varchar(255) NULL COMMENT '联系电话(投诉人电话)', + business_type_name varchar(255) NULL COMMENT '业务类别', + involve_problem varchar(255) NULL COMMENT '涉嫌问题(问题类别)', + police_type varchar(255) NULL COMMENT '涉及警种', + police_type_name varchar(255) NULL COMMENT '涉及警种名称', + involve_depart_id varchar(40) NULL COMMENT '涉及单位(被投诉单位)', + thing_desc text NULL COMMENT '事情简述(投诉具体内容)', + check_status_name varchar(255) NULL COMMENT '核查情况(审定结果)', + check_status_desc varchar(255) NULL COMMENT '核查处理结果(处理情况简要描述)', + involved_name varchar(255) NULL COMMENT '涉及人姓名', + involved_id_code varchar(40) NULL COMMENT '身份证号码', + personnel_attr varchar(255) NULL COMMENT '人员属性', + inspection_measures varchar(255) NULL COMMENT '督察措施', + problem_type varchar(255) NULL COMMENT '问题类型', + problem_category varchar(255) NULL COMMENT '问题类别', + subjective_aspect varchar(255) NULL COMMENT '主观方面', + responsibility_category varchar(255) NULL COMMENT '责任类别', + processing_results varchar(255) NULL COMMENT '处理结果', + involved_rights_protection_fault_tolerance varchar(255) NULL COMMENT '维权容错', + assistance_situation varchar(255) NULL COMMENT '帮扶情况', + assistance_start_time datetime NULL COMMENT '帮扶开始时间', + assistance_end_time datetime NULL COMMENT '帮扶结束时间', + involved_leader_name varchar(255) NULL COMMENT '涉及领导姓名', + involved_leader_id_code varchar(40) NULL COMMENT '涉及领导-身份证号码', + involved_leader_inspection_measures varchar(255) NULL COMMENT '涉及领导-督察措施', + involved_leader_responsibility_category varchar(255) NULL COMMENT '涉及领导-责任类别', + involved_leader_processing_results varchar(255) NULL COMMENT '涉及领导-处理结果', + involved_leader_rights_protection_fault_tolerance varchar(255) NULL COMMENT '涉及领导-维权容错', + crt_time datetime NULL DEFAULT now(), + upd_time datetime NULL DEFAULT now(), + PRIMARY KEY (`origin_id`) +) COMMENT='案件核查台账'; + + +CREATE TABLE data_petition_complaint ( + letter_id varchar(255) COMMENT '信件编号', + channel_for_filing_complaints varchar(255) COMMENT '投诉渠道', + acceptance_level varchar(255) COMMENT '受理层级', + registration_time datetime COMMENT '登记时间', + complainant varchar(255) COMMENT '投诉人', + complainant_phone varchar(255) COMMENT '投诉人电话', + initial_petition varchar(255) COMMENT '初重信访', + entanglement_disturbance_during_visits varchar(255) COMMENT '缠访闹访', + mass_visits varchar(255) COMMENT '群众集访', + involve_problem varchar(255) COMMENT '涉嫌问题', + business_type_name varchar(255) COMMENT '业务类别', + police_type varchar(255) NULL COMMENT '涉及警种', + police_type_name varchar(255) NULL COMMENT '涉及警种名称', + complained_depart_id varchar(255) COMMENT '被投诉机构ID', + complained_depart_name varchar(255) COMMENT '被投诉机构', + thing_desc text COMMENT '具体内容', + involve_depart_id varchar(255) COMMENT '涉及单位', + involve_depart_name varchar(255) COMMENT '涉及单位', + is_unit_responsible int COMMENT '是否单位责任', + depart_processing_results varchar(255) COMMENT '单位处理结果', + involved_name varchar(255) COMMENT '涉及人姓名', + involved_id_code varchar(40) COMMENT '身份证号码', + personnel_attributes varchar(255) COMMENT '人员属性', + inspection_measures varchar(255) COMMENT '督察措施', + problem_type varchar(255) COMMENT '问题类型', + subjective_aspect varchar(255) COMMENT '主观方面', + responsibility_category varchar(255) COMMENT '责任类别', + processing_results varchar(255) COMMENT '处理结果', + rights_protection_fault_tolerance varchar(255) COMMENT '维权容错', + assistance_situation varchar(255) COMMENT '帮扶情况', + assistance_start_time datetime NULL COMMENT '帮扶开始时间', + assistance_end_time datetime NULL COMMENT '帮扶结束时间', + involved_leader_name varchar(255) COMMENT '涉及领导姓名', + involved_leader_id_code varchar(255) COMMENT '身份证号码', + involved_leader_inspection_measures varchar(255) COMMENT '督察措施', + involved_leader_responsibility_category varchar(255) COMMENT '责任类别', + involved_leader_processing_results varchar(255) COMMENT '处理结果', + involved_leader_rights_protection_fault_tolerance varchar(255) COMMENT '维权容错', + crt_time datetime NULL DEFAULT now(), + upd_time datetime NULL DEFAULT now(), + PRIMARY KEY (`letter_id`) +) COMMENT='信访投诉台账'; diff --git a/sql/dict.sql b/sql/dict.sql new file mode 100644 index 0000000..d20e725 --- /dev/null +++ b/sql/dict.sql @@ -0,0 +1,25 @@ +INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (17, '主办层级', 'hostLevel', '0', '', '2024-08-13 16:21:32', '', '2024-08-13 16:21:32', ''); +INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (18, '办理时限', 'timeLimit', '0', '', '2024-08-13 16:42:50', '', '2024-08-13 16:42:50', ''); +INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (19, '审批流程', 'approvalFlow', '0', '', '2024-08-13 16:54:26', '', '2024-08-13 16:54:26', ''); +INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (20, '追责对象', 'accountabilityTarget', '0', '', '2024-08-16 10:23:19', '', '2024-08-16 10:23:19', ''); +INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (21, '办理状态', 'processingStatus', '0', '', '2024-08-19 15:37:24', '', '2024-08-19 15:37:24', ''); + + +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (220, 0, '市局主办', '1', 'hostLevel', '', '', '0', '0', '', '2024-08-13 16:34:23', '', '2024-08-13 16:34:23', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (222, 0, '二级机构主办', '2', 'hostLevel', '', '', '0', '0', '', '2024-08-13 16:39:09', '', '2024-08-13 16:39:09', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (223, 0, '三级机构主办', '3', 'hostLevel', '', '', '0', '0', '', '2024-08-13 16:39:44', '', '2024-08-13 16:39:44', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (224, 0, '137工作制', '3+7', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:44:13', '', '2024-08-13 16:44:13', '1个工作日签收,3个工作日办结,延期不超过7天'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (225, 0, '10+10工作制', '10+10', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:45:49', '', '2024-08-13 16:45:49', '1个工作日签收,10个工作日办结,延期不超过10天'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (226, 0, '14+7工作制', '14+7', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:46:56', '', '2024-08-13 16:46:56', '1个工作日签收,14个工作日办结,延期不超过7天'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (227, 0, '其他', 'other', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:49:33', '', '2024-08-13 16:49:33', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (228, 0, '三级审批', '3', 'approvalFlow', '', '', '0', '0', '', '2024-08-13 16:55:14', '', '2024-08-13 16:55:14', '所队一>二級机构一>市局'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (229, 0, '二级审批', '2', 'approvalFlow', '', '', '0', '0', '', '2024-08-13 16:55:29', '', '2024-08-13 16:55:29', '所队一>二级机构'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (230, 0, '涉及个人', '1', 'accountabilityTarget', '', '', '0', '0', '', '2024-08-16 10:24:48', '', '2024-08-16 10:24:48', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (231, 0, '涉及单位', '2', 'accountabilityTarget', '', '', '0', '0', '', '2024-08-16 10:25:02', '', '2024-08-16 10:25:02', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (232, 0, '涉及个人及单位', '3', 'accountabilityTarget', '', '', '0', '0', '', '2024-08-16 10:25:16', '', '2024-08-16 10:25:16', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (233, 0, '签收中', 'signing', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:38:20', '', '2024-08-19 15:38:20', '问题签收'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (234, 0, '办理中', 'processing', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:39:01', '', '2024-08-19 15:39:01', '核查办理'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (235, 0, '审批中', 'approval', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:40:34', '', '2024-08-19 15:40:34', '办结审批'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (236, 0, '已办结', 'completed', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:41:07', '', '2024-08-19 15:41:07', '认定办结'); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (237, 2, '分局通报批评', '1-2', 'handleResult', '', '', '0', '0', '', '2024-09-04 18:45:08', '', '2024-09-04 18:45:08', ''); +INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (238, 3, '市局通报批评', '1-1', 'handleResult', '', '', '0', '0', '', '2024-09-04 18:45:47', '', '2024-09-04 18:45:47', ''); diff --git a/sql/file_class.sql b/sql/file_class.sql new file mode 100644 index 0000000..65fd887 --- /dev/null +++ b/sql/file_class.sql @@ -0,0 +1,8 @@ +CREATE TABLE file_class ( + id int NOT NULL AUTO_INCREMENT, + class_name varchar(255) not null, + class_remarks varchar(255), + problem_sources_code varchar(40) not null COMMENT '问题来源', + sort int, + PRIMARY KEY (`id`) +) COMMENT='文件分类'; \ No newline at end of file diff --git a/sql/negative_0904.sql b/sql/negative_0904.sql new file mode 100644 index 0000000..5b73f3a --- /dev/null +++ b/sql/negative_0904.sql @@ -0,0 +1,548 @@ +ALTER TABLE `negative`.`negative` + ADD COLUMN `host_level` varchar(255) NULL COMMENT '主办层级' AFTER `distribute_flow`, + ADD COLUMN `time_limit` varchar(255) NULL COMMENT '办理时限' AFTER `host_level`, + ADD COLUMN `approval_flow` varchar(255) NULL COMMENT '审批流程' AFTER `time_limit`, + ADD COLUMN `flow_key` varchar(255) NULL COMMENT '流程节点key' AFTER `flow_key`, + ADD COLUMN `check_status_desc` text NULL COMMENT '问题核查情况' AFTER `flow_key`, + ADD COLUMN `rectify_desc` text NULL COMMENT '问题整改情况' AFTER `check_status_desc`, + ADD COLUMN `rectify_restriction_days` int NULL COMMENT '整改限制天数' AFTER `rectify_desc`, + ADD COLUMN `accountability_target` varchar(255) NULL COMMENT '追责对象' AFTER `rectify_restriction_days`, + ADD COLUMN `processing_status` varchar(255) NULL COMMENT '办理状态' AFTER `accountability_target`, + ADD COLUMN `negative_extension_apply_id` int NULL COMMENT '延期申请ID' AFTER `processing_status`, + ADD COLUMN `extension_apply_flag` tinyint NULL DEFAULT 1 COMMENT '是否能申请延期' AFTER `negative_extension_apply_id`, + ADD COLUMN `extension_days` int NULL COMMENT '延期天数' AFTER `extension_apply_flag`, + ADD COLUMN `first_distribute_time` datetime NULL COMMENT '市局下发时间' AFTER `extension_days`, + ADD COLUMN `is_second_handle` tinyint NULL DEFAULT 0 COMMENT '是否是二级机构办理 true=是 false=否' AFTER `first_distribute_time`, + ADD COLUMN `handle_second_depart_id` varchar(255) NULL COMMENT '二级办理单位' AFTER `is_second_handle`, + ADD COLUMN `handle_second_depart_name` varchar(255) NULL COMMENT '二级办理单位' AFTER `handle_second_depart_id`, + ADD COLUMN `handle_three_depart_id` varchar(255) NULL COMMENT '三级办理单位' AFTER `handle_second_depart_name`, + ADD COLUMN `handle_three_depart_name` varchar(255) NULL COMMENT '三级办理单位' AFTER `handle_three_depart_id`; + +CREATE TABLE `flow_action` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `action_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `flow_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `next_flow_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '下一流程节点key', + `button_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '动作名称', + `button_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '按钮类型', + `plain` tinyint(1) NULL DEFAULT NULL COMMENT '是否是简单按钮', + `sort` int(0) NULL DEFAULT NULL COMMENT '排序', + `action_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `validate_form` tinyint(0) NULL DEFAULT NULL COMMENT '是否需要校验表单', + `do_close` tinyint(0) NULL DEFAULT NULL COMMENT '完成后是否需要关闭', + `open_dialog` tinyint(0) NULL DEFAULT NULL COMMENT '是否需要启动对话框', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点动作' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of flow_action +-- ---------------------------- +INSERT INTO `flow_action` VALUES (1, 'apply_completion', 'verify', 'second_approve', '提交审批', 'primary', 0, 4, '提交审批', 1, 1, 1); +INSERT INTO `flow_action` VALUES (2, 'apply_extension', 'verify', 'second_extension_approve', '申请延期', 'primary', 1, 3, '申请延期', 0, 0, 1); +INSERT INTO `flow_action` VALUES (3, 'first_approve', 'first_approve', 'completed', '审批通过', 'primary', 0, 2, '已审批', NULL, 1, 1); +INSERT INTO `flow_action` VALUES (4, 'first_approve_return', 'first_approve', 'second_approve', '退回整改', 'danger', 1, 1, '已退回', NULL, NULL, NULL); +INSERT INTO `flow_action` VALUES (5, 'first_distribute', 'first_distribute', 'second_sign', '下发问题', 'primary', 0, 1, '已下发', 1, 1, NULL); +INSERT INTO `flow_action` VALUES (6, 'save', 'verify', 'verify', '保存信息', 'primary', 1, 1, NULL, 1, 0, NULL); +INSERT INTO `flow_action` VALUES (7, 'second_approve', 'second_approve', 'first_approve', '审批通过', 'primary', 0, 2, '已审批', NULL, NULL, 1); +INSERT INTO `flow_action` VALUES (8, 'second_approve_return', 'second_approve', 'verify', '退回整改', 'danger', 1, 1, '退回整改', NULL, 1, 1); +INSERT INTO `flow_action` VALUES (9, 'second_distribute', 'second_distribute', 'three_sign', '下发问题', 'primary', 0, 3, '已下发', 1, 1, NULL); +INSERT INTO `flow_action` VALUES (10, 'second_sign', 'second_sign', 'second_distribute', '确认签收', 'primary', 0, 3, '已签收', 0, 0, NULL); +INSERT INTO `flow_action` VALUES (11, 'second_sign_return', 'second_sign', 'first_distribute', '问题退回', 'danger', 1, 1, '已退回', 0, 0, NULL); +INSERT INTO `flow_action` VALUES (12, 'three_sign', 'three_sign', 'verify', '确认签收', 'primary', 0, 2, '已签收', 0, 0, NULL); +INSERT INTO `flow_action` VALUES (13, 'three_sign_return', 'verify', 'second_distribute', '问题退回', 'danger', 0, 2, '已退回', NULL, 1, 1); +INSERT INTO `flow_action` VALUES (14, 'second_sign_return', 'second_distribute', 'first_distribute', '问题退回', 'danger', 1, 1, '已退回', 0, 1, 1); +INSERT INTO `flow_action` VALUES (15, 'second_extension_approve', 'second_extension_approve', 'first_extension_approve', '审批通过', 'primary', 0, 2, '延期申请已审批', 0, 1, 1); +INSERT INTO `flow_action` VALUES (16, 'second_extension_return', 'second_extension_approve', NULL, '审批驳回', 'danger', 0, 1, '延期申请已驳回', 0, 1, 1); +INSERT INTO `flow_action` VALUES (17, 'first_extension_approve', 'first_extension_approve', '', '审批通过', 'primary', 0, 2, '延期申请已审批', 0, 1, 1); +INSERT INTO `flow_action` VALUES (18, 'first_extension_return', 'first_extension_approve', NULL, '审批驳回', 'danger', 0, 1, '延期申请已驳回', 0, 1, 1); +INSERT INTO `flow_action` VALUES (19, 'second_local_processing', 'second_distribute', 'verify', '本级处理', 'primary', 1, 2, '本级处理', 0, 0, 0); +INSERT INTO `flow_action` VALUES (20, 'three_sign_return', 'three_sign', 'second_distribute', '问题退回', 'danger', 0, 1, '已退回', NULL, 1, 1); + + +CREATE TABLE `flow_node` ( + `flow_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `flow_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程节点名称', + `flow_sort` int(0) NULL DEFAULT NULL COMMENT '排序', + PRIMARY KEY (`flow_key`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of flow_node +-- ---------------------------- +INSERT INTO `flow_node` VALUES ('completed', '已办结', 10); +INSERT INTO `flow_node` VALUES ('first_approve', '市局审批', 7); +INSERT INTO `flow_node` VALUES ('first_distribute', '市局下发', 1); +INSERT INTO `flow_node` VALUES ('first_extension_approve', '市局延期审批', 9); +INSERT INTO `flow_node` VALUES ('second_approve', '二级机构审批', 6); +INSERT INTO `flow_node` VALUES ('second_distribute', '二级机构下发', 3); +INSERT INTO `flow_node` VALUES ('second_extension_approve', '二级机构延期审批', 8); +INSERT INTO `flow_node` VALUES ('second_sign', '二级机构签收', 2); +INSERT INTO `flow_node` VALUES ('three_sign', '三级机构签收', 4); +INSERT INTO `flow_node` VALUES ('verify', '核查办理', 5); + +CREATE TABLE holiday ( + id int NOT NULL AUTO_INCREMENT, + date varchar(255) NOT NULL COMMENT '日期', + flag tinyint NOT NULL COMMENT '是否是节假日', + holiday_name varchar(255) COMMENT '节假日名称', + year int NOT NULL COMMENT '年', + PRIMARY KEY (`id`) +) COMMENT='节假日'; + +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-01', 1, '元旦', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-03', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-06', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-07', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-13', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-14', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-20', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-21', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-27', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-28', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-31', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-03', 1, '劳动节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-04', 1, '劳动节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-05', 1, '劳动节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-07', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-11', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-12', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-14', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-18', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-19', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-25', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-26', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-31', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-01', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-01', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-03', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-07', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-08', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-14', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-15', 1, '中秋节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-16', 1, '中秋节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-17', 1, '中秋节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-21', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-22', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-28', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-29', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-01', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-02', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-03', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-04', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-07', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-10', 1, '初一', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-11', 1, '初二', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-12', 1, '初三', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-13', 1, '初四', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-14', 1, '初五', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-15', 1, '初六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-16', 1, '初七', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-17', 1, '初八', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-18', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-24', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-25', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-01', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-02', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-03', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-07', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-09', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-10', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-14', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-16', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-17', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-23', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-24', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-30', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-31', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-01', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-03', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-04', 1, '清明节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-05', 1, '清明节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-06', 1, '清明节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-07', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-13', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-14', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-20', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-21', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-27', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-28', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-01', 1, '劳动节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-02', 1, '劳动节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-02', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-03', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-07', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-08', 1, '端午节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-09', 1, '端午节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-10', 1, '端午节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-14', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-15', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-16', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-22', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-23', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-29', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-30', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-01', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-03', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-06', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-07', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-13', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-14', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-20', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-21', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-27', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-28', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-31', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-01', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-03', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-04', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-07', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-10', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-11', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-14', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-17', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-18', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-24', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-25', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-31', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-01', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-03', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-04', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-05', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-06', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-07', 1, '国庆节', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-12', 0, '正常上班', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-13', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-14', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-19', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-20', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-26', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-27', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-31', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-01', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-02', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-03', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-07', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-08', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-09', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-10', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-14', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-15', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-16', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-17', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-21', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-22', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-23', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-24', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-28', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-29', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-30', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-01', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-02', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-03', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-04', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-05', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-06', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-07', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-08', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-09', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-10', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-11', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-12', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-13', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-14', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-15', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-16', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-17', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-18', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-19', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-20', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-21', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-22', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-23', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-24', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-25', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-26', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-27', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-28', 1, '周六', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-29', 1, '周日', 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-30', 0, NULL, 2024); +INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-31', 0, NULL, 2024); + +CREATE TABLE negative_approve ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40) not null, + state varchar(40) not null, + handler_depart_id varchar(40), + handler_depart_name varchar(255), + handler_user_name varchar(255), + handler_name varchar(255), + comments text COMMENT '审批意见', + action_key varchar(255), + create_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题审批'; + +CREATE TABLE negative_extension_apply ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40) not null, + handler_depart_id varchar(40), + handler_depart_name varchar(255), + handler_user_name varchar(255), + handler_name varchar(255), + comments text COMMENT '延期理由', + extension_days int COMMENT '延期天数', + create_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题申请延期'; + +CREATE TABLE negative_extension_approve ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40) not null, + negative_extension_apply_id int not null, + handler_depart_id varchar(40), + handler_depart_name varchar(255), + handler_user_name varchar(255), + handler_name varchar(255), + comments text COMMENT '审批意见/驳回理由', + state varchar(40) not null, + action_key varchar(255), + create_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题申请延期'; + +CREATE TABLE negative_fav ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40) not null, + user_id varchar(40) not null, + create_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题收藏'; + +CREATE TABLE negative_sign_return ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40) not null, + handler_depart_id varchar(40), + handler_depart_name varchar(255), + handler_user_name varchar(255), + handler_name varchar(255), + comments text COMMENT '退回原因', + action_key varchar(255), + create_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题签收退回'; + +CREATE TABLE negative_thing_file ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40) not null, + file_name varchar(255) not null COMMENT '文件名称', + file_path varchar(255) not null COMMENT '文件路径', + type varchar(255), + create_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题事件附件'; + + +CREATE TABLE negative_work ( + id int NOT NULL AUTO_INCREMENT, + negative_id varchar(40), + depart_id varchar(40), + role_code varchar(255), + problem_sources_code varchar(255), + flow_key varchar(255), + status varchar(255) default 'todo', + create_time datetime DEFAULT now(), + update_time datetime DEFAULT now(), + PRIMARY KEY (`id`) +) COMMENT='问题工作记录表'; + + +ALTER TABLE `negative`.`negative_file` + ADD COLUMN `file_class_id` int NULL AFTER `status`; \ No newline at end of file diff --git a/sql/negative_mark.sql b/sql/negative_mark.sql new file mode 100644 index 0000000..e6f68bc --- /dev/null +++ b/sql/negative_mark.sql @@ -0,0 +1,8 @@ +CREATE TABLE negative_mark ( + negative_id varchar(40), + involve_second_depart_id varchar(40) COMMENT '涉及二级单位', + involve_second_depart_name varchar(255) COMMENT '涉及二级单位名称', + involve_three_depart_id varchar(40) COMMENT '涉及三级单位', + involve_three_depart_name varchar(255) COMMENT '涉及三级单位名称', + PRIMARY KEY (`negative_id`) +) COMMENT='问题统计表'; \ No newline at end of file diff --git a/sql/open-platform_0904.sql b/sql/open-platform_0904.sql new file mode 100644 index 0000000..f416e64 --- /dev/null +++ b/sql/open-platform_0904.sql @@ -0,0 +1,89 @@ +-- ---------------------------- +-- Table structure for menu +-- ---------------------------- + +CREATE TABLE `menu` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `pid` int(0) NULL DEFAULT NULL, + `menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单类型', + `menu_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单名称', + `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单图标', + `menu_sort` int(0) NULL DEFAULT NULL COMMENT '排序', + `perms` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `paths` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路径', + `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组件', + `is_cache` int(0) NOT NULL DEFAULT 0 COMMENT '是否缓存', + `is_show` int(0) NOT NULL DEFAULT 1, + `is_disable` int(0) NOT NULL DEFAULT 0, + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0), + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0), + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of menu +-- ---------------------------- +INSERT INTO `menu` VALUES (1, 0, 'C', '首页', 'el-icon-House', 1, NULL, '/', 'Home', 1, 1, 0, '2024-08-06 17:13:17', '2024-08-07 15:49:38'); +INSERT INTO `menu` VALUES (2, 0, 'C', '一体化大屏', 'el-icon-PieChart', 1, NULL, '/bigscreen', NULL, 1, 1, 0, '2024-08-06 17:20:08', '2024-08-07 15:50:25'); +INSERT INTO `menu` VALUES (3, 0, 'M', '我的工作', 'el-icon-Box', 1, NULL, '/work', NULL, 1, 1, 0, '2024-08-06 17:20:42', '2024-08-07 15:51:05'); +INSERT INTO `menu` VALUES (4, 0, 'M', '系统管理', 'el-icon-Setting', NULL, NULL, '/system', NULL, 1, 1, 0, '2024-08-06 17:23:12', '2024-08-26 15:47:58'); +INSERT INTO `menu` VALUES (5, 3, 'C', '我的待办', NULL, 10, NULL, '/work/todo', '/work/Todo', 1, 1, 0, '2024-08-06 17:26:38', '2024-08-07 16:55:48'); +INSERT INTO `menu` VALUES (6, 3, 'C', '我的已办', NULL, 9, NULL, '/work/done', '/work/Done', 1, 1, 0, '2024-08-06 17:26:59', '2024-08-07 16:56:10'); +INSERT INTO `menu` VALUES (7, 4, 'C', '用户管理', NULL, 10, NULL, '/system/user', '/system/User', 1, 1, 0, '2024-08-06 17:28:19', '2024-08-09 14:19:48'); +INSERT INTO `menu` VALUES (8, 4, 'C', '警员中心', NULL, 9, NULL, '/system/police', '/system/Police', 1, 1, 0, '2024-08-06 17:28:26', '2024-08-07 15:47:53'); +INSERT INTO `menu` VALUES (9, 4, 'C', '菜单管理', NULL, 8, NULL, '/system/menu', '/system/Menu', 1, 1, 0, '2024-08-06 17:28:40', '2024-08-07 15:48:30'); +INSERT INTO `menu` VALUES (10, 4, 'C', '角色管理', NULL, 7, NULL, '/system/role', '/system/Role', 1, 1, 0, '2024-08-07 16:54:20', '2024-08-07 16:54:20'); +INSERT INTO `menu` VALUES (11, 4, 'C', '部门管理', NULL, 6, NULL, '/system/depart', '/system/Depart', 1, 1, 0, '2024-08-08 16:44:16', '2024-08-08 16:44:16'); +INSERT INTO `menu` VALUES (12, 4, 'C', '数据字典', NULL, 5, NULL, '/system/dict', '/system/Dict', 1, 1, 0, '2024-08-08 16:44:59', '2024-08-08 16:44:59'); +INSERT INTO `menu` VALUES (13, 4, 'C', '问题类型', NULL, NULL, NULL, '/system/dictContent', '/system/DictContent', 1, 1, 0, '2024-08-16 14:40:53', '2024-08-16 14:40:53'); +INSERT INTO `menu` VALUES (14, 3, 'C', '我的收藏', NULL, NULL, NULL, '/work/myFav', '/work/Fav', 1, 1, 0, '2024-08-16 18:52:26', '2024-08-16 18:52:26'); +INSERT INTO `menu` VALUES (15, 3, 'C', '综合查询', NULL, NULL, NULL, '/query', '/work/Query', 1, 1, 0, '2024-08-27 10:09:25', '2024-08-27 10:09:25'); +INSERT INTO `menu` VALUES (16, 8, 'A', '新增警员', NULL, NULL, 'police:add', '', NULL, 0, 1, 0, '2024-09-03 18:38:46', '2024-09-03 18:38:46'); +INSERT INTO `menu` VALUES (17, 8, 'A', '权限设置', NULL, NULL, 'police:auth', NULL, NULL, 0, 1, 0, '2024-09-03 18:45:04', '2024-09-03 18:45:04'); +INSERT INTO `menu` VALUES (18, 5, 'A', '问题录入', NULL, NULL, 'negative:add', NULL, NULL, 0, 1, 0, '2024-09-04 11:29:54', '2024-09-04 11:29:54'); + +-- ---------------------------- +-- Table structure for role_menu +-- ---------------------------- + +CREATE TABLE `role_menu` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `role_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `menu_id` int(0) NULL DEFAULT NULL, + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0), + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 103 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色菜单权限表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of role_menu +-- ---------------------------- +INSERT INTO `role_menu` VALUES (43, 'admin_1_1_1_2', 1, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (44, 'admin_1_1_1_2', 3, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (45, 'admin_1_1_1_2', 5, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (46, 'admin_1_1_1_2', 6, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (47, 'admin_1_1_1_2', 14, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (48, 'admin_1_1_1_2', 15, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (49, 'admin_1_1_1_2', 4, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (50, 'admin_1_1_1_2', 8, '2024-09-03 18:42:22'); +INSERT INTO `role_menu` VALUES (70, 'admin_1_1_1_3', 3, '2024-09-03 20:48:31'); +INSERT INTO `role_menu` VALUES (71, 'admin_1_1_1_3', 5, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (72, 'admin_1_1_1_3', 6, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (73, 'admin_1_1_1_3', 14, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (74, 'admin_1_1_1_3', 15, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (75, 'admin_1_1_1_3', 1, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (76, 'admin_1_1_1_3', 4, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (77, 'admin_1_1_1_3', 8, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (78, 'admin_1_1_1_3', 16, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (79, 'admin_1_1_1_3', 17, '2024-09-03 20:48:32'); +INSERT INTO `role_menu` VALUES (91, 'admin_1', 3, '2024-09-04 11:30:26'); +INSERT INTO `role_menu` VALUES (92, 'admin_1', 5, '2024-09-04 11:30:26'); +INSERT INTO `role_menu` VALUES (93, 'admin_1', 18, '2024-09-04 11:30:26'); +INSERT INTO `role_menu` VALUES (94, 'admin_1', 6, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (95, 'admin_1', 14, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (96, 'admin_1', 15, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (97, 'admin_1', 1, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (98, 'admin_1', 4, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (99, 'admin_1', 7, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (100, 'admin_1', 8, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (101, 'admin_1', 16, '2024-09-04 11:30:27'); +INSERT INTO `role_menu` VALUES (102, 'admin_1', 11, '2024-09-04 11:30:27'); \ No newline at end of file diff --git a/sql/truncate.sql b/sql/truncate.sql new file mode 100644 index 0000000..a9f8e01 --- /dev/null +++ b/sql/truncate.sql @@ -0,0 +1,4 @@ +truncate negative_work; +truncate negative_history; +truncate negative_fav; +truncate negative_fav; \ No newline at end of file diff --git a/sql/update-data.sql b/sql/update-data.sql new file mode 100644 index 0000000..61f2684 --- /dev/null +++ b/sql/update-data.sql @@ -0,0 +1 @@ +UPDATE `negative`.`negative` set flow_key = 'completed', processing_status = 'completed'; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/SupervisionApplication.java b/src/main/java/com/biutag/supervision/SupervisionApplication.java new file mode 100644 index 0000000..6095661 --- /dev/null +++ b/src/main/java/com/biutag/supervision/SupervisionApplication.java @@ -0,0 +1,15 @@ +package com.biutag.supervision; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +@EnableScheduling +@SpringBootApplication +public class SupervisionApplication { + + public static void main(String[] args) { + SpringApplication.run(SupervisionApplication.class, args); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/common/UserContextHolder.java b/src/main/java/com/biutag/supervision/common/UserContextHolder.java new file mode 100644 index 0000000..ac449fa --- /dev/null +++ b/src/main/java/com/biutag/supervision/common/UserContextHolder.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.common; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.Header; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.util.SpringUtil; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +public class UserContextHolder { + + public static String getCurrentToken() { + HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + return request.getHeader(Header.AUTHORIZATION.getValue()); + } + + public static UserAuth getCurrentUser() { + String authorization = getCurrentToken(); + if (StrUtil.isBlank(authorization)) { + throw new AuthException(); + } + UserAuth userAuth = (UserAuth) SpringUtil.getBean("redisTemplate", RedisTemplate.class).opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)); + return userAuth; + } + + public static String getCurrentUserId() { + return getCurrentUser().getUserId(); + } + +} diff --git a/src/main/java/com/biutag/supervision/config/FastDFSConfig.java b/src/main/java/com/biutag/supervision/config/FastDFSConfig.java new file mode 100644 index 0000000..d3aedd2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/FastDFSConfig.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.config; + +import com.github.tobato.fastdfs.domain.conn.TrackerConnectionManager; +import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@ComponentScan("com.github.tobato.fastdfs") +@Configuration +public class FastDFSConfig { + + @Autowired + private TrackerConnectionManager trackerConnectionManager; + + @PostConstruct + public void init() { + trackerConnectionManager.initTracker(); + } +} diff --git a/src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java b/src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java new file mode 100644 index 0000000..80a63e5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.config; + +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.Result; +import jakarta.validation.ValidationException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.dao.DataAccessException; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +import java.util.stream.Collectors; + +@Slf4j +@ControllerAdvice +public class GlobalExceptionHandler { + + @ResponseStatus(HttpStatus.OK) + @ExceptionHandler(Exception.class) + @ResponseBody + public Result handleException(Exception e) { + log.error("系统异常: {}", e.getMessage(), e); + return Result.failed(e.getMessage()); + } + + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ExceptionHandler(DataAccessException.class) + @ResponseBody + public Result handleDataAccessException(DataAccessException e) { + log.error("数据库异常: {}", e.getMessage(), e); + return Result.failed(String.format("数据库异常:%s", e.getMessage())); + } + + @ResponseStatus(HttpStatus.UNAUTHORIZED) + @ExceptionHandler(AuthException.class) + @ResponseBody + public Result handleAuthException(AuthException e) { + log.error("未授权", e); + return Result.failed(HttpStatus.UNAUTHORIZED.value(), HttpStatus.UNAUTHORIZED.getReasonPhrase()); + } + + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseBody + public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { + String message = e.getBindingResult().getFieldErrors().stream().map(item -> item.getField() + " : " + item.getDefaultMessage()).collect(Collectors.joining("; ")); + log.error("参数错误: {}", message, e); + return Result.failed(HttpStatus.BAD_REQUEST.value(), String.format("参数错误:%s", message)); + } + + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ExceptionHandler(ValidationException.class) + @ResponseBody + public Result handleValidationException(ValidationException e) { + log.error("参数错误", e); + return Result.failed(HttpStatus.BAD_REQUEST.value(), e.getMessage()); + } + +} diff --git a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java new file mode 100644 index 0000000..fb50b33 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -0,0 +1,68 @@ +package com.biutag.supervision.config; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.Header; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.util.SpringUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; +import java.util.Objects; + +/** + * @author wxc + * @date 2024/1/8 + */ +@Slf4j +@Configuration +public class InterceptorConfig implements WebMvcConfigurer { + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new DefaultInterceptor()) + .addPathPatterns("/**") + .excludePathPatterns("/api/**") + .excludePathPatterns("/login") + .excludePathPatterns("/auth/self") + .excludePathPatterns("/file/stream/**", "/templates/**") + .excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**")); + + registry.addInterceptor(new ApiInterceptor()) + .addPathPatterns("/api/jwdc/**"); + } + + static class DefaultInterceptor implements HandlerInterceptor { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + log.info("请求地址:{}", request.getRequestURI()); + String authorization = request.getHeader(Header.AUTHORIZATION.getValue()); + RedisTemplate redisTemplate = SpringUtil.getBean("redisTemplate", RedisTemplate.class); + if (StrUtil.isBlank(authorization) || Objects.isNull(redisTemplate.opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)))) { + throw new AuthException(); + } + return true; + } + } + + static class ApiInterceptor implements HandlerInterceptor { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + log.info("请求地址【API】:{}", request.getRequestURI()); + String authorization = request.getHeader("Authorization"); + if (!"565318a8ea367e03904e1c241048dd6c".equals(authorization)) { + throw new AuthException(); + } + return true; + } + } + +} diff --git a/src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java b/src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java new file mode 100644 index 0000000..ef5b671 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@MapperScan("com.biutag.supervision.mapper") +public class MybatisPlusConfig { + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加 + // 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType + return interceptor; + } + +} diff --git a/src/main/java/com/biutag/supervision/config/SwaggerConfig.java b/src/main/java/com/biutag/supervision/config/SwaggerConfig.java new file mode 100644 index 0000000..356c611 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/SwaggerConfig.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.config; + +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import org.springdoc.core.models.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +public class SwaggerConfig { + + @Bean + public OpenAPI springShopOpenAPI() { + return new OpenAPI() + .info(new Info().title("长沙公安数字督察一体化平台接口文档") + .contact(new Contact()) + .description("长沙公安数字督察一体化平台接口文档") + .version("v1") + .license(new License().name("长沙市公安局").url(""))) + .externalDocs(new ExternalDocumentation() + .description("接口文档")); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/constants/AppConstants.java b/src/main/java/com/biutag/supervision/constants/AppConstants.java new file mode 100644 index 0000000..45b3c59 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/AppConstants.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.constants; + +public class AppConstants { + + public static final int MENU_ROOT_ID = 0; + + // 部门 + public static final String DICT_CONTENT_ROOT_PARENT_CODE = "-1"; + + // 管理员类型类型(超级管理员) + public static final String USER_TYPE_SUPER = "super"; + + + // 部门 + public static final String DEPART_ROOT_PID = "0"; + + + // 部门跟节点ID(长沙市公安局) + public static final String ROOT_DEPART_ID = "12630"; + + public static final String ROOT_DEPART_NAME = "长沙市公安局"; + + // + public static final String SIGN_RETURN_ACTION_NAME = "已退回"; + +} diff --git a/src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java b/src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java new file mode 100644 index 0000000..c1bfe10 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java @@ -0,0 +1,6 @@ +package com.biutag.supervision.constants; + +public class RedisKeyConstants { + + public final static String LOGIN_USERINFO_KEY = "login:userinfo:%s"; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java new file mode 100644 index 0000000..3278397 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ApprovalFlowEnum { + + // 二级审批 所队一>二级机构 + SECOND_APPROVAL("2"), + // 三级审批 所队一>二級机构一>市局 + THREE_APPROVAL("3"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java new file mode 100644 index 0000000..030ba88 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.constants.enums; + +public enum ApproveStateEnum { + + approved, + rejected; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java new file mode 100644 index 0000000..b1f39cd --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum BusinessTypeEnum { + + JCJ_110("110接处警", "1", "110"), + JCJ_122("122接处警", "2", "122"), + RJCKFW("人境窗口服务", "3", "RJ"), + CJGFF("车驾管服务", "4", "CJG"), + JJCF("交警执法", "5", "JJ"), + ZFBA("执法办案", "6", "CF"), + ZXGZ("专项工作", "7", "ZX"), + ABWW("安保维稳", "8", "AB"), + JAFK("治安防控", "9", "ZA"), + XZGL("行政管理", "10", "XZ"); + + private String label; + + private String value; + + private String key; + + public static BusinessTypeEnum get(String value) { + for (BusinessTypeEnum businessTypeEnum : values()) { + if (businessTypeEnum.value.equals(value)) { + return businessTypeEnum; + } + } + throw new RuntimeException("无此业务类型"); + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java new file mode 100644 index 0000000..0fe4902 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum DepartLevelEnum { + + SECOND_CATEGORY(1), + SECOND(2), + THREE(3); + + private int value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java b/src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java new file mode 100644 index 0000000..f8af85c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum FlowActionEnum { + + FIRST_DISTRIBUTE("first_distribute", "已下发"), + SECOND_APPROVE("second_approve", "已审批"), + FIRST_APPROVE("first_approve", "已审批"); + + @Getter + private String key; + + @Getter + private String name; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java new file mode 100644 index 0000000..3ca8ecf --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.List; + +@AllArgsConstructor +@Getter +public enum FlowNodeEnum { + + FIRST_DISTRIBUTE("first_distribute"), + SECOND_SIGN("second_sign"), + SECOND_DISTRIBUTE("second_distribute"), + THREE_SIGN("three_sign"), + VERIFY("verify"), + SECOND_APPROVE("first_approve"), + FIRST_APPROVE("first_approve"), + SECOND_EXTENSION_APPROVE("first_approve"), + FIRST_EXTENSION_APPROVE("first_approve"), + COMPLETED("completed"); + + private String key; + + public static List getSignFlowKeys() { + return List.of(FIRST_DISTRIBUTE.getKey(), SECOND_SIGN.getKey(), SECOND_DISTRIBUTE.getKey(), THREE_SIGN.getKey()); + } + + public static boolean isSignFlow(String flowKey) { + return getSignFlowKeys().contains(flowKey); + } + + /** + * 办结审批 + * @return + */ + public static List getApproveFlowKeys() { + return List.of(FIRST_DISTRIBUTE.getKey(), SECOND_SIGN.getKey(), SECOND_DISTRIBUTE.getKey(), THREE_SIGN.getKey()); + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java b/src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java new file mode 100644 index 0000000..f04942c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum HostLevelEnums { + + FIRST("1"), + SECOND("2"), + THREE("3"); + + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java b/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java new file mode 100644 index 0000000..9a20161 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.constants.enums; + +import cn.hutool.core.util.StrUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum InspectCaseEnum { + + // 属实 + TRUE("1"), + // 部分属实 + PARTIALLY_TRUE("2"), + // 不属实 + FALSE("3"), + + NOT_VERIFIED("4"), + + OTHER("5"); + + private String value; + + public static boolean isItTure(String value) { + return StrUtil.isNotBlank(value) && !OTHER.getValue().equals(value); + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java b/src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java new file mode 100644 index 0000000..1397490 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +// 是否整改 +@AllArgsConstructor +@Getter +public enum IsRectifyEnum { + + NOT("0"), + YES("1"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java b/src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java new file mode 100644 index 0000000..acee071 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum MenuEnum { + + CATALOGUE("M"), + MENU("C"), + BUTTON("A"); + + private String value; + + public String value() { + return value; + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java new file mode 100644 index 0000000..d4327fe --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ProblemSourcesEnum { + XFTS("信访投诉", "1"), + JWDC("警务调查", "2"), + JYDC("警意调查", "3"), + CFJD("持法监督", "4"), + WSPC("360度网上测评", "5"), + DDKQ("钉钉考勤", "6"), + JDGL("监督管理", "7"), + JCKH("检查考核", "8"), + OTHER("其他", "9"), + WJWG("违纪违规", "10"); + + private String label; + + private String value; + + + public static ProblemSourcesEnum get(String value) { + for (ProblemSourcesEnum problemSourcesEnum : values()) { + if (problemSourcesEnum.value.equals(value)) { + return problemSourcesEnum; + } + } + throw new RuntimeException("无此问题来源"); + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java new file mode 100644 index 0000000..d194e8c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.constants.enums; + +public enum ProcessingStatusEnum { + + signing, + processing, + approval, + completed; + + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java new file mode 100644 index 0000000..a75a2d9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum RoleCodeEnum { + + ADMIN("admin"), + FIRST_ADMIN("admin_1"), + SECOND_ADMIN("admin_1_1_1_2"), + THREE_ADMIN("admin_1_1_1_3"); + + private String code; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java new file mode 100644 index 0000000..a3a847e --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum StatusEnum { + + ENABLE("1"), + DISABLE("0"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java new file mode 100644 index 0000000..905e5bc --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +// 办理时限 +@Getter +@AllArgsConstructor +public enum TimeLimitEnum { + + WORK_137("137工作制", "3+7", 1, 3, 7), + WORK_10_10("10+10工作制", "10+10", 1, 10, 10), + WORK_14_7("14+7工作制", "14+7", 1, 14, 7), + OTHER("其他", "other", null, null, null); + + private String label; + + private String value; + + // 签收时长(天) + private Integer maxSignDuration; + + // 办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + public static TimeLimitEnum get(String value) { + for (TimeLimitEnum timeLimitEnum : values()) { + if (timeLimitEnum.getValue().equals(value)) { + return timeLimitEnum; + } + } + throw new RuntimeException(String.format("办理时限字典[%s]未找到", value)); + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java new file mode 100644 index 0000000..eb3103b --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.constants.enums; + +public enum WorkStateEnum { + + todo, + done; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java new file mode 100644 index 0000000..f71d10c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.constants.enums; + +public enum WorkStatusEnum { + + todo, + done; +} diff --git a/src/main/java/com/biutag/supervision/controller/AuthController.java b/src/main/java/com/biutag/supervision/controller/AuthController.java new file mode 100644 index 0000000..55b570b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/AuthController.java @@ -0,0 +1,76 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.Self; +import com.biutag.supervision.pojo.entity.Menu; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.vo.MenuTree; +import com.biutag.supervision.service.MenuService; +import com.biutag.supervision.service.UserLoginService; +import com.biutag.supervision.util.JSON; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +@Slf4j +@RequiredArgsConstructor +@RequestMapping("auth") +@RestController +public class AuthController { + + private final MenuService menuService; + + private final UserLoginService userLoginService; + + private final RedisTemplate redisTemplate; + + @Value("${spring.profiles.active}") + private String profilesActive; + + @Value("${negative.v1-user-url:''}") + private String v1UserUrl; + + @GetMapping("self") + public Result self() { + String authorization = UserContextHolder.getCurrentToken(); + if (StrUtil.isBlank(authorization)) { + throw new AuthException(); + } + UserAuth user = UserContextHolder.getCurrentUser(); + if ("prod".equals(profilesActive)) { + if (Objects.isNull(user)) { + HttpResponse httpResponse = HttpUtil + .createGet(v1UserUrl) + .bearerAuth(authorization) + .execute(); + log.info("获取用户信息:{}", httpResponse.body()); + JsonNode jsonNode = JSON.readTree(httpResponse.body()); + String account = jsonNode.get("data") + .get("username").asText(); + user = userLoginService.buildUserAuth(account); + redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), user, 24, TimeUnit.HOURS); + } + } + boolean superFlag = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); + List menus = superFlag ? menuService.listAll() : menuService.listMenuByCurrentUser(); + List perms = superFlag ? List.of("*") : menuService.listPermsByCurrentUser(); + return Result.success(new Self().setUser(user).setMenus(MenuTree.buildTree(menus)).setPerms(perms)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/FileController.java b/src/main/java/com/biutag/supervision/controller/FileController.java new file mode 100644 index 0000000..c5ffea4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/FileController.java @@ -0,0 +1,56 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.vo.FileVo; +import com.github.tobato.fastdfs.domain.fdfs.StorePath; +import com.github.tobato.fastdfs.service.FastFileStorageClient; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; + +@Slf4j +@RequiredArgsConstructor +@RequestMapping("file") +@Controller +public class FileController { + + private final FastFileStorageClient fastFileStorageClient; + + @Value("${fdfs.preview-url}") + private String FDFS_PREVIEW_URL; + + @ResponseBody + @PostMapping("upload") + public Result upload(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件上传 upload------------------------------"); + StorePath storePath = fastFileStorageClient.uploadFile("group1", file.getInputStream(), file.getSize(), FileUtil.extName(file.getOriginalFilename())); + return Result.success(new FileVo() + .setFileName(file.getOriginalFilename()) + .setFilePath("/" + storePath.getFullPath())); + } + + @GetMapping("stream/**") + public void download(HttpServletRequest request, HttpServletResponse response) throws IOException { + String filePath = request.getRequestURI().substring(12); + HttpResponse httpResponse = HttpUtil.createGet(FDFS_PREVIEW_URL + filePath) + .execute(); + if (filePath.toLowerCase().endsWith(".pdf")) { + response.setContentType("application/pdf"); + } else { + response.setContentType("application/octet-stream"); + } + IoUtil.copy(httpResponse.bodyStream(), response.getOutputStream()); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/LoginController.java b/src/main/java/com/biutag/supervision/controller/LoginController.java new file mode 100644 index 0000000..eacac18 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/LoginController.java @@ -0,0 +1,64 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.util.IdUtil; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.AccountDto; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.vo.TokenVo; +import com.biutag.supervision.service.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.security.crypto.bcrypt.BCrypt; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +@Tag(name = "登录接口") +@Slf4j +@RequiredArgsConstructor +@RestController +public class LoginController { + + private final BaseAccountService accountService; + + private final UserLoginService userLoginService; + + private final RedisTemplate redisTemplate; + + @Operation(summary = "登录") + @PostMapping("login") + public Result login(@RequestBody AccountDto account) { + BaseAccount baseAccount = accountService.getByAccount(account.getAccount()); + try { + if (Objects.isNull(baseAccount) || !BCrypt.checkpw(account.getPassword(), baseAccount.getPassword())) { + throw new RuntimeException("用户名或密码有误,请重新输入"); + } + } catch (RuntimeException e) { + log.error(e.getMessage(), e); + throw new RuntimeException("用户名或密码有误,请重新输入"); + } + UserAuth userAuth = userLoginService.buildUserAuth(baseAccount.getAccount()); + String token = IdUtil.fastSimpleUUID(); + redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, 24, TimeUnit.HOURS); + return Result.success(new TokenVo().setToken(token)); + } + + @PostMapping("logout") + public Result logout() { + redisTemplate.opsForValue(); + redisTemplate.delete(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, UserContextHolder.getCurrentToken())); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/StatisticsController.java b/src/main/java/com/biutag/supervision/controller/StatisticsController.java new file mode 100644 index 0000000..a9d5a1d --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/StatisticsController.java @@ -0,0 +1,157 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.FlowNodeEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeService; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; + +@RequiredArgsConstructor +@RequestMapping("statistics") +@RestController +public class StatisticsController { + + private final NegativeService negativeService; + + + @GetMapping("flowNumberAndTodayNumber") + public Result> flowNumber() { + UserAuth user = UserContextHolder.getCurrentUser(); + boolean authEmpty = (user.getAuthSources().isEmpty() || user.getAuthDepartIds().isEmpty()) && !AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); + if (authEmpty) { + Map data = new HashMap<>(); + data.put("flowNumber", List.of(new FlowNumber("问题待签收", "sign", 0L), + new FlowNumber("核查办理", "verify", 0L), + new FlowNumber("申请延期", "delay", 0L), + new FlowNumber("办结审批", "completedApprove", 0L)) + ); + data.put("todayNumber", List.of(new TodayNumber("今日办结", 0L), + new TodayNumber("今日办结", 0L), + new TodayNumber("累计问题", 0L), + new TodayNumber("累计办结", 0L)) + ); + return Result.success(data); + } + boolean nonAdminAuth = !AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); + long signCount = negativeService.count(new LambdaUpdateWrapper() + .in(Negative::getFlowKey, FlowNodeEnum.getSignFlowKeys()) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + long verifyCount = negativeService.count(new LambdaUpdateWrapper() + .eq(Negative::getFlowKey, FlowNodeEnum.VERIFY.getKey()) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + long delayCount = negativeService.count(new LambdaUpdateWrapper() + .eq(Negative::getExtensionApplyFlag, false) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + long completedApproveCount = negativeService.count(new LambdaUpdateWrapper() + .eq(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + + Date now = new Date(); + DateTime beginOfDay = DateUtil.beginOfDay(now); + DateTime endOfDay = DateUtil.endOfDay(now); + long todayNumber = negativeService.count(new LambdaUpdateWrapper() + .between(Negative::getCrtTime, beginOfDay, endOfDay) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + long todayCompleted = negativeService.count(new LambdaUpdateWrapper() + .between(Negative::getCompleteDate, beginOfDay, endOfDay) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + long totalNumber = negativeService.count(new LambdaUpdateWrapper() + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + long totalCompleted = negativeService.count(new LambdaUpdateWrapper() + .eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) + .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) + .and(nonAdminAuth, query -> { + query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() + .in(Negative::getThingDesc, user.getAuthDepartIds()); + }) + ); + + Map data = new HashMap<>(); + data.put("flowNumber", List.of(new FlowNumber("问题待签收", "sign", signCount), + new FlowNumber("核查办理", "verify", verifyCount), + new FlowNumber("申请延期", "delay", delayCount), + new FlowNumber("办结审批", "completedApprove", completedApproveCount)) + ); + data.put("todayNumber", List.of(new TodayNumber("今日办结", todayNumber), + new TodayNumber("今日办结", todayCompleted), + new TodayNumber("累计问题", totalNumber), + new TodayNumber("累计办结", totalCompleted)) + ); + return Result.success(data); + } + + @Setter + @Getter + public class FlowNumber { + private String name; + private String icon; + private Long total; + public FlowNumber(String name, String icon, Long total) { + this.name = name; + this.icon = icon; + this.total = total; + } + } + + @Setter + @Getter + public class TodayNumber { + private String name; + private Long total; + public TodayNumber(String name, Long total) { + this.name = name; + this.total = total; + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/controller/api/jwdc/NegativeApiController.java b/src/main/java/com/biutag/supervision/controller/api/jwdc/NegativeApiController.java new file mode 100644 index 0000000..8079b74 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/api/jwdc/NegativeApiController.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.controller.api.jwdc; + +import com.biutag.supervision.pojo.domain.Blame; +import com.biutag.supervision.pojo.dto.jwdc.NegativeApiDto; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.service.NegativeBlameService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.util.JSON; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@Slf4j +@Validated +@RequiredArgsConstructor +@RequestMapping("api/jwdc/negative") +@RestController +public class NegativeApiController { + + private final NegativeService negativeService; + + private final NegativeBlameService negativeBlameService; + + @PostMapping + public String addAll(@RequestBody @Valid List list) { + log.info("问题数据导入: {}", JSON.toJSONString(list)); + negativeService.saveByJwdc(list); + return "success"; + } + + @GetMapping("responsible") + public List responsible(@RequestParam @Valid @NotBlank(message = "来源ID不能为空") String originId) { + log.info("警务调查责任民警查询,来源ID: {}", originId); + Negative negative = negativeService.getByOriginId(originId); + if (Objects.isNull(negative)) { + return new ArrayList<>(); + } + List list = negativeBlameService.list(negative.getId()); + log.info("警务调查责任民警查询,返回结果: {}", JSON.toJSONString(list)); + return list; + } +} diff --git a/src/main/java/com/biutag/supervision/controller/api/plugin/PetitionComplainApiController.java b/src/main/java/com/biutag/supervision/controller/api/plugin/PetitionComplainApiController.java new file mode 100644 index 0000000..369db97 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/api/plugin/PetitionComplainApiController.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.controller.api.plugin; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DataPetitionComplaintDto; +import com.biutag.supervision.service.DataPetitionComplaintService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "信访投诉(插件)") +@RequiredArgsConstructor +@RequestMapping("plugin/petitionComplain") +@RestController +public class PetitionComplainApiController { + + private final DataPetitionComplaintService dataPetitionComplaintService; + + @Operation(summary = "推送信访投诉数据") + @PostMapping + public Result add(@RequestBody @Validated DataPetitionComplaintDto body) { + return Result.success(dataPetitionComplaintService.save(body)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/data/DataController.java b/src/main/java/com/biutag/supervision/controller/data/DataController.java new file mode 100644 index 0000000..8723f96 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/data/DataController.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.controller.data; + +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RestController; + +@RequiredArgsConstructor +@RestController +public class DataController { + +} diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClassController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClassController.java new file mode 100644 index 0000000..512ff13 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClassController.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.ModelClass; +import com.biutag.supervision.service.ModelClassService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RequestMapping("modelClass") +@RequiredArgsConstructor +@RestController +public class ModelClassController { + + private final ModelClassService modelClassService; + + @GetMapping + public Result> list() { + return Result.success(modelClassService.list(new LambdaQueryWrapper().orderByAsc(ModelClass::getSort))); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java new file mode 100644 index 0000000..7f8bec4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java @@ -0,0 +1,47 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Model; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.ModelQueryParam; +import com.biutag.supervision.service.ModelService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.Objects; + +@RequestMapping("model") +@RequiredArgsConstructor +@RestController +public class ModelController { + + private final ModelService modelService; + + @GetMapping + public Result> list(ModelQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper + .like(StrUtil.isNotBlank(queryParam.getModelName()), Model::getModelName, queryParam.getModelName()) + .eq(StrUtil.isNotBlank(queryParam.getDistributionMethod()), Model::getDistributionMethod, queryParam.getDistributionMethod()) + .eq(Objects.nonNull(queryParam.getClassId()), Model::getClassId, queryParam.getClassId()) + .orderByDesc(Model::getCreateTime); + return Result.success(modelService.page(new Page<>(queryParam.getCurrent(), queryParam.getSize()), queryWrapper)); + } + + @PostMapping + public Result add(@RequestBody Model model) { + model.setCreateTime(LocalDateTime.now()); + model.setUpdateTime(LocalDateTime.now()); + UserAuth user = UserContextHolder.getCurrentUser(); + model.setCreateDepartId(user.getDepartId()); + model.setCreateDepartName(user.getDepartName()); + modelService.save(model); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartController.java b/src/main/java/com/biutag/supervision/controller/system/DepartController.java new file mode 100644 index 0000000..eeb81b6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -0,0 +1,82 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.NumberUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.param.DepartTreeListParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import com.biutag.supervision.service.SupDepartService; +import jakarta.validation.ValidationException; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; + +@RequestMapping("depart") +@RequiredArgsConstructor +@RestController +public class DepartController { + + private final SupDepartService departService; + + @GetMapping + public Result> treeList(DepartTreeListParam departTreeListParam) { + return Result.success(departService.buildTreeByParam(departTreeListParam)); + } + + @PostMapping + public Result add(@RequestBody SupDepart supDepart) { + if (departService.existsByName(supDepart.getName())) { + throw new ValidationException("部门全称已存在"); + } + if (departService.existsByCode(supDepart.getCode())) { + throw new ValidationException("部门编码已存在"); + } + SupDepart parent = departService.getById(supDepart.getPid()); + supDepart.setId(String.valueOf(NumberUtil.nullToZero(departService.getMaxId()) + 1)); + supDepart.setLevel(parent.getLevel() + 1); + supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + return Result.success(departService.save(supDepart)); + } + + @PutMapping + public Result update(@RequestBody SupDepart supDepart) { + if (departService.exists(new LambdaQueryWrapper().eq(SupDepart::getName, supDepart.getName()).ne(SupDepart::getId, supDepart.getId()))) { + throw new ValidationException("部门全程已存在"); + } + if (departService.exists(new LambdaQueryWrapper().eq(SupDepart::getCode, supDepart.getCode()).ne(SupDepart::getId, supDepart.getId()))) { + throw new ValidationException("部门编码已存在"); + } + SupDepart parent = departService.getById(supDepart.getPid()); + supDepart.setLevel(parent.getLevel() + 1); + supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + return Result.success(departService.updateById(supDepart)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(departService.removeById(id)); + } + + @GetMapping("tree") + public Result> tree() { + return Result.success(departService.buildTree()); + } + + @GetMapping("second") + public Result> list() { + List supDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND_CATEGORY.getValue(), DepartLevelEnum.SECOND.getValue())); + return Result.success(departService.buildTree(supDeparts)); + } + + @GetMapping("{departId}/children") + public Result> children(@PathVariable String departId) { + return Result.success(departService.list(new LambdaQueryWrapper().eq(SupDepart::getPid, departId).orderByAsc(SupDepart::getOrderNo))); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DictContentController.java b/src/main/java/com/biutag/supervision/controller/system/DictContentController.java new file mode 100644 index 0000000..3f68534 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DictContentController.java @@ -0,0 +1,52 @@ +package com.biutag.supervision.controller.system; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDictContent; +import com.biutag.supervision.pojo.vo.DictContentTree; +import com.biutag.supervision.service.SupDictContentService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("dict/content") +@RestController +public class DictContentController { + + private final SupDictContentService dictContentService; + + @GetMapping("tree") + public Result> list() { + return Result.success(dictContentService.buildTree()); + } + + @PostMapping + public Result add(@RequestBody SupDictContent dictContent) { + dictContent.setUpdTime(LocalDateTime.now()); + dictContent.setCrtTime(LocalDateTime.now()); + dictContent.setStatus("0"); + dictContentService.save(dictContent); + dictContentService.update(new LambdaUpdateWrapper().eq(SupDictContent::getId, dictContent.getId()).set(SupDictContent::getCode, dictContent.getId())); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDictContent dictContent) { + dictContent.setUpdTime(LocalDateTime.now()); + dictContentService.updateById(dictContent); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result update(@PathVariable Integer id) { + if (dictContentService.exists(new LambdaQueryWrapper().eq(SupDictContent::getParentCode, id))) { + throw new RuntimeException("该节点下还存在子节点,无法删除"); + } + dictContentService.removeById(id); + return Result.success(); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DictController.java b/src/main/java/com/biutag/supervision/controller/system/DictController.java new file mode 100644 index 0000000..e1b117b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DictController.java @@ -0,0 +1,74 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DictDataDto; +import com.biutag.supervision.pojo.dto.DictTypeDto; +import com.biutag.supervision.pojo.entity.SupDictData; +import com.biutag.supervision.pojo.entity.SupDictType; +import com.biutag.supervision.pojo.vo.DictContentTree; +import com.biutag.supervision.service.SupDictContentService; +import com.biutag.supervision.service.SupDictDataService; +import com.biutag.supervision.service.SupDictTypeService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("dict") +@RestController +public class DictController { + + private final SupDictTypeService dictTypeService; + + private final SupDictDataService dictDataService; + + @GetMapping + public Result> page(Page page, String dictName) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(dictName), SupDictType::getDictName, dictName) + .orderByDesc(SupDictType::getUpdateTime); + return Result.success(dictTypeService.page(page, queryWrapper)); + } + + @PostMapping + public Result add(@RequestBody DictTypeDto dictType) { + return Result.success(dictTypeService.save(dictType)); + } + + @GetMapping("{dictType}/dictData") + public Result> list(Page page, @PathVariable String dictType) { + return Result.success(dictDataService.page(page, new LambdaQueryWrapper() + .eq(SupDictData::getDictType, dictType) + .orderByAsc(SupDictData::getDictSort))); + } + + @PostMapping("{dictType}/dictData") + public Result add(@RequestBody DictDataDto dictData) { + return Result.success(dictDataService.save(dictData)); + } + + @PutMapping("{dictType}/dictData") + public Result update(@RequestBody DictDataDto dictData) { + SupDictData supDictData = new SupDictData(); + BeanUtil.copyProperties(dictData, supDictData); + return Result.success(dictDataService.updateById(supDictData)); + } + + @DeleteMapping("{dictType}/dictData/{dictCode}") + public Result del(@PathVariable Integer dictCode) { + return Result.success(dictDataService.removeById(dictCode)); + } + + @GetMapping("data/{dictType}") + public Result> list(@PathVariable String dictType) { + return Result.success(dictDataService.list(new LambdaQueryWrapper() + .eq(SupDictData::getDictType, dictType) + .orderByAsc(SupDictData::getDictSort))); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/MenuController.java b/src/main/java/com/biutag/supervision/controller/system/MenuController.java new file mode 100644 index 0000000..43d80c0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/MenuController.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.controller.system; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.MenuDto; +import com.biutag.supervision.pojo.entity.Menu; +import com.biutag.supervision.pojo.vo.MenuTree; +import com.biutag.supervision.service.MenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("menu") +@RestController +public class MenuController { + + private final MenuService menuService; + + @GetMapping + public Result> list() { + List menus = menuService.list(new LambdaQueryWrapper().orderByAsc(Menu::getMenuSort)); + return Result.success(MenuTree.buildTree(menus)); + } + + @PostMapping + public Result add(@RequestBody MenuDto menuDto) { + Menu menu = new Menu(); + BeanUtils.copyProperties(menuDto, menu); + menuService.save(menu); + return Result.success(); + } + + @PutMapping + public Result> update(@RequestBody MenuDto menuDto) { + Menu menu = new Menu(); + BeanUtils.copyProperties(menuDto, menu); + menu.setUpdateTime(LocalDateTime.now()); + menuService.updateById(menu); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java new file mode 100644 index 0000000..1fd457b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java @@ -0,0 +1,70 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.PoliceAuth; +import com.biutag.supervision.pojo.entity.NegDepartAuthority; +import com.biutag.supervision.pojo.entity.NegSourceAuthority; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.PoliceModel; +import com.biutag.supervision.pojo.param.PoliceQueryParam; +import com.biutag.supervision.service.NegDepartAuthorityService; +import com.biutag.supervision.service.NegSourceAuthorityService; +import com.biutag.supervision.service.SupPoliceService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; + +@RequestMapping("police") +@RequiredArgsConstructor +@RestController +public class PoliceController { + + private final SupPoliceService policeService; + + private final NegDepartAuthorityService negDepartAuthorityService; + + private final NegSourceAuthorityService negSourceAuthorityService; + + @GetMapping + public Result> list(PoliceQueryParam param) { + return Result.success(policeService.page(param)); + } + + @PostMapping + public Result add(@RequestBody SupPolice police) { + police.setId(IdUtil.getSnowflakeNextIdStr()); + police.setUpdatedAt(String.valueOf(new Date().getTime())); + police.setCreatedAt(String.valueOf(new Date().getTime())); + return Result.success(policeService.save(police)); + } + + @PutMapping + public Result update(@RequestBody SupPolice police) { + police.setUpdatedAt(String.valueOf(new Date().getTime())); + return Result.success(policeService.updateById(police)); + } + + @GetMapping("{departId}/all") + public Result> all(@PathVariable String departId) { + return Result.success(policeService.listAllByDepartId(departId)); + } + + @GetMapping("auth/{idCode}") + public Result auth(@PathVariable String idCode) { + PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList()) + .setSources(negSourceAuthorityService.list(idCode).stream().map(NegSourceAuthority::getSource).toList()); + return Result.success(policeAuth); + } + + @PostMapping("auth/{idCode}") + public Result auth(@PathVariable String idCode, @RequestBody PoliceAuth policeAuth) { + negDepartAuthorityService.save(idCode, policeAuth.getDeparts()); + negSourceAuthorityService.save(idCode, policeAuth.getSources()); + return Result.success(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/controller/system/RoleController.java b/src/main/java/com/biutag/supervision/controller/system/RoleController.java new file mode 100644 index 0000000..e7866d1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/RoleController.java @@ -0,0 +1,60 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.IdUtil; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.pojo.entity.RoleMenu; +import com.biutag.supervision.pojo.param.RoleQueryParam; +import com.biutag.supervision.service.BaseRoleService; +import com.biutag.supervision.service.RoleMenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("role") +@RestController +public class RoleController { + + private final BaseRoleService baseRoleService; + + private final RoleMenuService roleMenuService; + + @GetMapping + public Result> list(RoleQueryParam roleQueryParam) { + List roles = baseRoleService.list(roleQueryParam); + return Result.success(roles); + } + + @PostMapping + public Result add(@RequestBody BaseRole role) { + role.setRoleId(String.valueOf(IdUtil.getSnowflakeNextId())); + role.setCreateTime(LocalDateTime.now()); + role.setUpdateTime(LocalDateTime.now()); + return Result.success(baseRoleService.save(role)); + } + + @PutMapping + public Result update(@RequestBody BaseRole role) { + role.setUpdateTime(LocalDateTime.now()); + return Result.success(baseRoleService.updateById(role)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(baseRoleService.removeById(id)); + } + + @GetMapping("{roleCode}/menu") + public Result> add(@PathVariable String roleCode) { + return Result.success(roleMenuService.list(roleCode).stream().map(RoleMenu::getMenuId).toList()); + } + + @PostMapping("{roleCode}/menu") + public Result add(@PathVariable String roleCode, @RequestBody List menuIds) { + return Result.success(roleMenuService.update(roleCode, menuIds)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/UserController.java b/src/main/java/com/biutag/supervision/controller/system/UserController.java new file mode 100644 index 0000000..5b8d4bc --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/UserController.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.controller.system; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.UserDto; +import com.biutag.supervision.pojo.model.UserModel; +import com.biutag.supervision.pojo.param.UserQueryParam; +import com.biutag.supervision.service.BaseUserService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +@RequiredArgsConstructor +@RequestMapping("user") +@RestController +public class UserController { + + private final BaseUserService baseUserService; + + @GetMapping + public Result> list(UserQueryParam queryParam) { + Page baseUserPage = baseUserService.page(queryParam); + return Result.success(baseUserPage); + } + + @PostMapping + public Result update(@RequestBody UserDto userDto) { + return Result.success(baseUserService.update(userDto)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/work/FlowNodeController.java b/src/main/java/com/biutag/supervision/controller/work/FlowNodeController.java new file mode 100644 index 0000000..b1f1e78 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/FlowNodeController.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.controller.work; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.FlowNode; +import com.biutag.supervision.service.FlowNodeService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RequestMapping("negative/flowNode") +@RequiredArgsConstructor +@RestController +public class FlowNodeController { + + private final FlowNodeService flowNodeService; + + @GetMapping + public Result> list() { + return Result.success(flowNodeService.listAll()); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java new file mode 100644 index 0000000..3d078b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.controller.work; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.flow.FlowService; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.NegativeDetail; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.NegativeDto; +import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.pojo.vo.NegativeQueryVo; +import com.biutag.supervision.service.NegativeQueryService; +import com.biutag.supervision.service.NegativeService; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +@RequiredArgsConstructor +@RequestMapping("negative") +@RestController +public class NegativeController { + + private final NegativeService negativeService; + + private final FlowService flowService; + + private final NegativeQueryService negativeQueryService; + + @GetMapping + public Result> list(NegativeQueryParam queryParam) { + return Result.success(negativeQueryService.page(queryParam)); + } + + @GetMapping("{id}") + public Result get(@PathVariable String id, Integer workId) { + return Result.success(negativeService.get(id, workId)); + } + + @PostMapping + public Result add(@Valid @RequestBody NegativeDto negativeDto) { + return Result.success(negativeService.save(negativeDto)); + } + + @PostMapping("{id}/execute") + public Result execute(@PathVariable String id, @RequestBody ActionDto action) { + action.setNegativeId(id); + return Result.success(flowService.execute(action)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeFavController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeFavController.java new file mode 100644 index 0000000..c028faf --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeFavController.java @@ -0,0 +1,43 @@ +package com.biutag.supervision.controller.work; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.NegativeFav; +import com.biutag.supervision.pojo.model.NegativeFavModel; +import com.biutag.supervision.pojo.param.WorkParam; +import com.biutag.supervision.service.NegativeFavService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +@RequestMapping("negative/fav") +@RequiredArgsConstructor +@RestController +public class NegativeFavController { + + private final NegativeFavService favService; + + @GetMapping + public Result> list(WorkParam workParam) { + return Result.success(favService.page(workParam)); + } + + @PostMapping + public Result add(@RequestBody NegativeFav fav) { + fav.setCreateTime(LocalDateTime.now()); + fav.setUserId(UserContextHolder.getCurrentUserId()); + fav.setCreateTime(LocalDateTime.now()); + return Result.success(favService.save(fav)); + } + + @DeleteMapping("{negativeId}") + public Result del(@PathVariable String negativeId) { + return Result.success(favService.remove(new LambdaQueryWrapper() + .eq(NegativeFav::getNegativeId, negativeId) + .eq(NegativeFav::getUserId, UserContextHolder.getCurrentUserId()))); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/controller/work/WorkController.java b/src/main/java/com/biutag/supervision/controller/work/WorkController.java new file mode 100644 index 0000000..99210fc --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/WorkController.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.controller.work; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.model.NegativeWorkModel; +import com.biutag.supervision.pojo.param.WorkParam; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RequiredArgsConstructor +@RequestMapping("work") +@RestController +public class WorkController { + + private final NegativeWorkService negativeWorkService; + + @GetMapping("todo") + public Result> todo(WorkParam workParam) { + return Result.success(negativeWorkService.page(workParam, WorkStatusEnum.todo.name())); + } + + @GetMapping("done") + public Result> done(WorkParam workParam) { + return Result.success(negativeWorkService.page(workParam, WorkStatusEnum.done.name())); + } + +} diff --git a/src/main/java/com/biutag/supervision/exception/AuthException.java b/src/main/java/com/biutag/supervision/exception/AuthException.java new file mode 100644 index 0000000..29389a5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/exception/AuthException.java @@ -0,0 +1,4 @@ +package com.biutag.supervision.exception; + +public class AuthException extends RuntimeException { +} diff --git a/src/main/java/com/biutag/supervision/flow/FlowService.java b/src/main/java/com/biutag/supervision/flow/FlowService.java new file mode 100644 index 0000000..a7f5da8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/FlowService.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.flow; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.flow.action.Action; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.entity.NegativeHistory; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeHistoryService; +import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.JSON; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@Service +public class FlowService { + + private final List actions; + + private final NegativeHistoryService negativeHistoryService; + + private final NegativeWorkService workService; + + @Transactional(rollbackFor = Exception.class) + public Boolean execute(ActionDto actionDto) { + Action action = actions + .stream() + .filter(item -> item.getClass().getName().contains(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey())))) + .findFirst() + .orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员")); + action.next(actionDto); + NegativeWork work = workService.getById(actionDto.getWorkId()); + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeHistory history = new NegativeHistory().setHistoryId(IdUtil.fastSimpleUUID()) + .setNegativeId(actionDto.getNegativeId()) + .setActionName(actionDto.getActionName()) + .setDepartName(work.getDepartName()) + .setCrtUser(user.getUserId()) + .setCrtUserName(user.getUserName()) + .setCrtName(user.getNickName()) + .setCrtTime(LocalDateTime.now()) + .setDataJson(JSON.toJSONString(actionDto)); + return negativeHistoryService.save(history); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/Action.java b/src/main/java/com/biutag/supervision/flow/action/Action.java new file mode 100644 index 0000000..e5777e2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/Action.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.flow.action; + +import com.biutag.supervision.pojo.dto.ActionDto; + +public interface Action { + + void next(ActionDto actionDto); + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java new file mode 100644 index 0000000..d5eb7cd --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -0,0 +1,177 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.VerifyData; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.vo.FileVo; +import com.biutag.supervision.service.*; +import jakarta.validation.Validator; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 申请办结 + */ +@RequiredArgsConstructor +@Component +public class ApplyCompletionAction implements Action { + + private final NegativeService negativeService; + + private final NegativeBlameService negativeBlameService; + + private final NegativeProblemRelationService negativeProblemRelationService; + + private final NegativeFileService fileService; + + private final NegativeApproveService aproveService; + + private final NegativeWorkService workService; + + private final SupDepartService departService; + + private final Validator validator; + + @Override + public void next(ActionDto actionDto) { + VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); + validator.validate(verifyData); + // 新增审批数据 + Negative negative = negativeService.getById(actionDto.getNegativeId()); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData, negative); + doneWork(actionDto.getWorkId()); + if (!ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow()) || !negative.getIsSecondHandle()) { + addWork(actionDto.getNegativeId(), actionDto.getWorkId(), + // 是否是本级办理 + negative.getIsSecondHandle() ? RoleCodeEnum.FIRST_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(), + negative); + } + } + + public void updateNegative(String negativeId, String nextFlowKey, VerifyData verifyData, Negative negative) { + LocalDateTime now = LocalDateTime.now(); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, now) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) + .eq(Negative::getId, negativeId); + updateWrapper.set(Negative::getCheckStatus, verifyData.getCheckStatus()) + .set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc()) + .set(Negative::getCheckStatusName, verifyData.getCheckStatusName()) + .set(Negative::getIsRectifyCode, verifyData.getIsRectifyCode()) + .set(Negative::getIsRectifyName, verifyData.getIsRectifyName()) + .set(Negative::getAccountabilityTarget, verifyData.getAccountabilityTarget()); + // 未整改 + if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) { + updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays()); + } + negativeService.update(updateWrapper); + + if (!verifyData.getBlames().isEmpty()) { + List problemRelations = new ArrayList<>(); + List negativeBlames = verifyData.getBlames().stream().map(item -> { + NegativeBlame negativeBlame = new NegativeBlame(); + BeanUtil.copyProperties(item, negativeBlame); + negativeBlame + .setBlameId(IdUtil.fastSimpleUUID()) + .setNegativeId(negativeId) + .setCrtTime(now) + .setUpdTime(now); + if (Objects.nonNull(item.getAssistTime()) && item.getAssistTime().size() >= 2) { + negativeBlame.setAssistStartTime(item.getAssistTime().get(0)) + .setAssistEndTime(item.getAssistTime().get(1)); + } + problemRelations.addAll(item.getProblems().stream().map(problem -> { + NegativeProblemRelation problemRelation = new NegativeProblemRelation(); + BeanUtil.copyProperties(problem, problemRelation); + problemRelation.setId(IdUtil.fastSimpleUUID()); + problemRelation.setBlameId(negativeBlame.getBlameId()); + problemRelation.setNegativeId(negativeId); + return problemRelation; + }).toList()); + return negativeBlame; + }).toList(); + // 先删除 + negativeBlameService.remove(negativeId); + // 新增涉及人员 + negativeBlameService.saveBatch(negativeBlames); + // 新增涉及人员问题类型 + if (!problemRelations.isEmpty()) { + // 先删除 + negativeProblemRelationService.remove(negativeId); + // 新增 + negativeProblemRelationService.saveBatch(problemRelations); + } + } + if (!verifyData.getFiles().isEmpty()) { + List files = verifyData.getFiles().stream().map(item -> { + NegativeFile file = new NegativeFile(); + BeanUtil.copyProperties(item, file); + file.setNegtiveId(negativeId); + return file; + }).toList(); + // 先删除 + fileService.remove(negativeId); + // 新增 + fileService.saveBatch(files); + } + aproveService.remove(negativeId); + + // 不是二级机构本级办理 + if (!negative.getIsSecondHandle()) { + NegativeApprove approve1 = new NegativeApprove() + .setNegativeId(negativeId) + .setActionKey(FlowActionEnum.SECOND_APPROVE.getKey()) + .setCreateTime(now); + aproveService.save(approve1); + } + // 三级审批 所队一>二級机构一>市局 + if (!ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { + NegativeApprove approve2 = new NegativeApprove() + .setNegativeId(negativeId) + .setActionKey(FlowActionEnum.FIRST_APPROVE.getKey()) + .setCreateTime(now); + aproveService.save(approve2); + } + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, Integer workId, String roleCode, Negative negative) { + NegativeWork currentWork = workService.getById(workId); + SupDepart depart = departService.getById(currentWork.getDepartId()); + SupDepart parentDepart = departService.getById(depart.getPid()); + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, parentDepart.getId())); + + NegativeWork work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(parentDepart.getId()) + .setDepartName(parentDepart.getName()) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java new file mode 100644 index 0000000..3556062 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java @@ -0,0 +1,95 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ExtensionApplyData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeExtensionApply; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeExtensionApplyService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.service.SupDepartService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 申请延期 + */ +@RequiredArgsConstructor +@Component +public class ApplyExtensionAction implements Action { + + private final NegativeService negativeService; + + private final NegativeExtensionApplyService extensionApplyService; + + private final NegativeWorkService workService; + + private final SupDepartService departService; + + @Override + public void next(ActionDto actionDto) { + ExtensionApplyData extensionApplyData = BeanUtil.toBean(actionDto.getData(), ExtensionApplyData.class); + NegativeExtensionApply extensionApply = addExtensionApply(actionDto, extensionApplyData); + updateNegative(actionDto.getNegativeId(), extensionApply.getId()); + addWork(actionDto, RoleCodeEnum.SECOND_ADMIN.getCode()); + } + + public NegativeExtensionApply addExtensionApply(ActionDto actionDto, ExtensionApplyData applyExtensionData) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeExtensionApply extensionApply = new NegativeExtensionApply() + .setNegativeId(actionDto.getNegativeId()) + .setComments(applyExtensionData.getComments()) + .setExtensionDays(applyExtensionData.getExtensionDays()) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setCreateTime(LocalDateTime.now()); + extensionApplyService.save(extensionApply); + return extensionApply; + } + + public void updateNegative(String negativeId, Integer negativeExtensionApplyId) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getNegativeExtensionApplyId, negativeExtensionApplyId) + .set(Negative::getExtensionApplyFlag, false) + .eq(Negative::getId, negativeId)); + } + + public void addWork(ActionDto actionDto, String roleCode) { + NegativeWork currentWork = workService.getById(actionDto.getWorkId()); + SupDepart depart = departService.getById(currentWork.getDepartId()); + SupDepart parentDepart = departService.getById(depart.getPid()); + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, actionDto.getNegativeId()) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, parentDepart.getId())); + Negative negative = negativeService.getById(actionDto.getNegativeId()); + NegativeWork work = new NegativeWork() + .setNegativeId(actionDto.getNegativeId()) + .setRoleCode(roleCode) + .setDepartId(parentDepart.getId()) + .setDepartName(parentDepart.getName()) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setFlowKey(actionDto.getNextFlowKey()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstApproveAction.java new file mode 100644 index 0000000..cbef37c --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveAction.java @@ -0,0 +1,77 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.ApproveStateEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 市局审批通过 + */ +@RequiredArgsConstructor +@Component +public class FirstApproveAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final NegativeApproveService approveService; + + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + updateApprove(actionDto.getNegativeId(), actionDto.getActionKey(), actionDto.getWorkId(), approveData.getComments()); + doneWork(actionDto.getWorkId()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) + .set(Negative::getCompleteDate, LocalDateTime.now()) + .set(Negative::getUpdTime, LocalDateTime.now()) + .eq(Negative::getId, negativeId)); + } + + public void updateApprove(String negativeId, String actionKey, Integer workId, String comments) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(workId); + approveService.update(new LambdaUpdateWrapper() + .set(NegativeApprove::getState, ApproveStateEnum.approved.name()) + .set(NegativeApprove::getComments, comments) + .set(NegativeApprove::getHandlerDepartId, work.getDepartId()) + .set(NegativeApprove::getHandlerDepartName, work.getDepartName()) + .set(NegativeApprove::getHandlerUserName, user.getUserName()) + .set(NegativeApprove::getHandlerName, user.getNickName()) + .set(NegativeApprove::getUpdateTime, LocalDateTime.now()) + .eq(NegativeApprove::getNegativeId, negativeId) + .eq(NegativeApprove::getActionKey, actionKey)); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .eq(NegativeWork::getId, workId)); + } + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java new file mode 100644 index 0000000..deef65e --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -0,0 +1,81 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 市局 退回整改 + */ +@RequiredArgsConstructor +@Component +public class FirstApproveReturnAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final NegativeApproveService approveService; + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + addApprove(actionDto.getNegativeId(), approveData.getComments(), actionDto.getWorkId()); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), RoleCodeEnum.SECOND_ADMIN.getCode()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .eq(Negative::getId, negativeId)); + } + + public void addApprove(String negativeId, String comments, Integer workId) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(workId); + approveService.update(new LambdaUpdateWrapper() + .set(NegativeApprove::getState, ApproveStateEnum.rejected.name()) + .set(NegativeApprove::getComments, comments) + .set(NegativeApprove::getHandlerDepartId, work.getDepartId()) + .set(NegativeApprove::getHandlerDepartName, work.getDepartName()) + .set(NegativeApprove::getHandlerUserName, user.getUserName()) + .set(NegativeApprove::getHandlerName, user.getNickName()) + .set(NegativeApprove::getUpdateTime, LocalDateTime.now()) + .eq(NegativeApprove::getNegativeId, negativeId) + .eq(NegativeApprove::getActionKey, FlowActionEnum.FIRST_APPROVE.getKey())); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode) { + NegativeWork work = workService.getOne(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode)); + work.setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(work); + } +} diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java new file mode 100644 index 0000000..3de4afb --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java @@ -0,0 +1,109 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.FirstDistributeData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.service.SupDepartService; +import jakarta.validation.Validator; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import org.springframework.validation.annotation.Validated; + +import java.time.LocalDateTime; + +/** + * 市局下发 + */ +@Validated +@RequiredArgsConstructor +@Component +public class FirstDistributeAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final SupDepartService departService; + + private final Validator validator; + + @Override + public void next(ActionDto actionDto) { + FirstDistributeData firstDistributeData = BeanUtil.toBean(actionDto.getData(), FirstDistributeData.class); + validator.validate(firstDistributeData); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), firstDistributeData); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), + HostLevelEnums.THREE.getValue().equals(firstDistributeData.getHostLevel()) ? RoleCodeEnum.THREE_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(), + firstDistributeData.getDepartId(), firstDistributeData.getDepartName()); + } + + public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData) { + LocalDateTime now = LocalDateTime.now(); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + + .set(Negative::getHostLevel, distributeData.getHostLevel()) + .set(Negative::getTimeLimit, distributeData.getTimeLimit()) + .set(Negative::getApprovalFlow, distributeData.getApprovalFlow()) + .set(Negative::getFirstDistributeTime, now) + .set(Negative::getUpdTime, now) + .eq(Negative::getId, negativeId); + if (TimeLimitEnum.OTHER.getValue().equals(distributeData.getTimeLimit())) { + updateWrapper.set(Negative::getMaxSignDuration, distributeData.getMaxSignDuration()) + .set(Negative::getMaxHandleDuration, distributeData.getMaxHandleDuration()) + .set(Negative::getMaxExtensionDuration, distributeData.getMaxExtensionDuration()); + } else { + TimeLimitEnum timeLimitEnum = TimeLimitEnum.get(distributeData.getTimeLimit()); + updateWrapper.set(Negative::getMaxSignDuration, timeLimitEnum.getMaxSignDuration()) + .set(Negative::getMaxHandleDuration, timeLimitEnum.getMaxHandleDuration()) + .set(Negative::getMaxExtensionDuration, timeLimitEnum.getMaxExtensionDuration()); + } + if (HostLevelEnums.THREE.getValue().equals(distributeData.getHostLevel())) { + SupDepart parentDepart = departService.getParentDepart(distributeData.getDepartId()); + updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.THREE_SIGN.getKey()) + .set(Negative::getHandleSecondDepartId, parentDepart.getId()) + .set(Negative::getHandleSecondDepartName, parentDepart.getShortName()) + .set(Negative::getHandleThreeDepartId, distributeData.getDepartId()) + .set(Negative::getHandleThreeDepartName, distributeData.getDepartName()); + } else { + updateWrapper.set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getHandleSecondDepartId, distributeData.getDepartId()) + .set(Negative::getHandleSecondDepartName, distributeData.getDepartName()); + } + negativeService.update(updateWrapper); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode, String departId, String departName) { + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, departId)); + Negative negative = negativeService.getById(negativeId); + NegativeWork work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(departId) + .setDepartName(departName) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstExtensionApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionApproveAction.java new file mode 100644 index 0000000..7a432e4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionApproveAction.java @@ -0,0 +1,81 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.NumberUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.ApproveStateEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeExtensionApply; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeExtensionApplyService; +import com.biutag.supervision.service.NegativeExtensionApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 市局申请延期审批通过 + */ +@RequiredArgsConstructor +@Component +public class FirstExtensionApproveAction implements Action { + + private final NegativeService negativeService; + + private final NegativeExtensionApplyService extensionApplyService; + + private final NegativeExtensionApproveService extensionApproveService; + + private final NegativeWorkService workService; + + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + Negative negative = negativeService.getById(actionDto.getNegativeId()); + addExtensionApprove(actionDto, approveData.getComments(), negative.getNegativeExtensionApplyId()); + doneWork(actionDto.getWorkId()); + } + + public void updateNegative(Negative negative) { + NegativeExtensionApply extensionApply = extensionApplyService.getById(negative.getNegativeExtensionApplyId()); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getExtensionApplyFlag, true) + // 延期天数 + .set(Negative::getExtensionDays, NumberUtil.nullToZero(negative.getExtensionDays()) + extensionApply.getExtensionDays()) + .eq(Negative::getId, negative.getId())); + } + + public void addExtensionApprove(ActionDto actionDto, String comments, Integer negativeExtensionApplyId) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() + .setNegativeId(actionDto.getNegativeId()) + .setNegativeExtensionApplyId(negativeExtensionApplyId) + .setComments(comments) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setState(ApproveStateEnum.approved.name()) + .setCreateTime(LocalDateTime.now()); + extensionApproveService.save(extensionApprove); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper().set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getFlowKey, null) + .eq(NegativeWork::getId, workId)); + } + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java new file mode 100644 index 0000000..0ecbce5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java @@ -0,0 +1,70 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.ApproveStateEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeExtensionApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 市局申请延期审批驳回 + */ +@RequiredArgsConstructor +@Component +public class FirstExtensionReturnAction implements Action { + + private final NegativeService negativeService; + + private final NegativeExtensionApproveService extensionApproveService; + + private final NegativeWorkService workService; + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + updateNegative(actionDto.getNegativeId()); + addExtensionApprove(actionDto, approveData.getComments()); + doneWork(actionDto.getWorkId()); + } + + public void updateNegative(String negativeId) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getExtensionApplyFlag, true) + .eq(Negative::getId, negativeId)); + } + + public void addExtensionApprove(ActionDto actionDto, String comments) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() + .setNegativeId(actionDto.getNegativeId()) + .setComments(comments) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setState(ApproveStateEnum.rejected.name()) + .setCreateTime(LocalDateTime.now()); + extensionApproveService.save(extensionApprove); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper().set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getFlowKey, null) + .eq(NegativeWork::getId, workId)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java new file mode 100644 index 0000000..aae0e83 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java @@ -0,0 +1,91 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.InspectCaseEnum; +import com.biutag.supervision.constants.enums.IsRectifyEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.VerifyData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeBlame; +import com.biutag.supervision.pojo.entity.NegativeProblemRelation; +import com.biutag.supervision.service.NegativeBlameService; +import com.biutag.supervision.service.NegativeProblemRelationService; +import com.biutag.supervision.service.NegativeService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * 核查办理-保存 + */ +@RequiredArgsConstructor +@Component +public class SaveAction implements Action { + private final NegativeService negativeService; + + private final NegativeBlameService negativeBlameService; + + private final NegativeProblemRelationService negativeProblemRelationService; + + @Override + public void next(ActionDto actionDto) { + VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData); + } + + public void updateNegative(String negativeId, String nextFlowKey, VerifyData verifyData) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) + .eq(Negative::getId, negativeId); + updateWrapper.set(Negative::getCheckStatus, verifyData.getCheckStatus()) + .set(Negative::getCheckStatusName, verifyData.getCheckStatusName()); + // 核查情况是否属实 + if (InspectCaseEnum.isItTure(verifyData.getCheckStatus())) { + updateWrapper.set(Negative::getIsRectifyCode, verifyData.getIsRectifyCode()) + .set(Negative::getIsRectifyName, verifyData.getIsRectifyName()) + .set(Negative::getAccountabilityTarget, verifyData.getAccountabilityTarget()); + // 未整改 + if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) { + updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays()); + } + } + negativeService.update(updateWrapper); + + if (!verifyData.getBlames().isEmpty()) { + negativeBlameService.remove(negativeId); + List problemRelations = new ArrayList<>(); + List negativeBlames = verifyData.getBlames().stream().map(item -> { + NegativeBlame negativeBlame = new NegativeBlame(); + BeanUtil.copyProperties(item, negativeBlame); + negativeBlame.setNegativeId(negativeId) + .setBlameId(IdUtil.fastSimpleUUID()) + .setCrtTime(LocalDateTime.now()) + .setUpdTime(LocalDateTime.now()); + problemRelations.addAll(item.getProblems().stream().map(problem -> { + NegativeProblemRelation problemRelation = new NegativeProblemRelation(); + BeanUtil.copyProperties(problem, problemRelation); + problemRelation.setId(IdUtil.fastSimpleUUID()); + problemRelation.setBlameId(negativeBlame.getBlameId()); + problemRelation.setNegativeId(negativeId); + return problemRelation; + }).toList()); + return negativeBlame; + }).toList(); + // 新增涉及人员 + negativeBlameService.saveBatch(negativeBlames); + // 新增涉及人员问题类型 + if (!problemRelations.isEmpty()) { + negativeProblemRelationService.remove(negativeId); + negativeProblemRelationService.saveBatch(problemRelations); + } + } + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java new file mode 100644 index 0000000..67fb040 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -0,0 +1,103 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构审批通过 + */ +@RequiredArgsConstructor +@Component +public class SecondApproveAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final NegativeApproveService approveService; + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + updateApprove(actionDto.getNegativeId(), actionDto.getActionKey(), approveData.getComments(), actionDto.getWorkId()); + doneWork(actionDto.getWorkId()); + Negative negative = negativeService.getById(actionDto.getNegativeId()); + if (ApprovalFlowEnum.THREE_APPROVAL.getValue().equals(negative.getApprovalFlow())) { + addWork(actionDto.getNegativeId(), RoleCodeEnum.FIRST_ADMIN.getCode()); + } + } + + public void updateNegative(String negativeId, String nextFlowKey) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .eq(Negative::getId, negativeId); + Negative negative = negativeService.getById(negativeId); + if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { + updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) + .set(Negative::getCompleteDate, LocalDateTime.now()); + } else { + updateWrapper.set(Negative::getFlowKey, nextFlowKey); + } + negativeService.update(updateWrapper); + } + + public void updateApprove(String negativeId, String actionKey, String comments, Integer workId) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(workId); + approveService.update(new LambdaUpdateWrapper() + .set(NegativeApprove::getState, ApproveStateEnum.approved.name()) + .set(NegativeApprove::getComments, comments) + .set(NegativeApprove::getHandlerDepartId, work.getDepartId()) + .set(NegativeApprove::getHandlerDepartName, work.getDepartName()) + .set(NegativeApprove::getHandlerUserName, user.getUserName()) + .set(NegativeApprove::getHandlerName, user.getNickName()) + .set(NegativeApprove::getUpdateTime, LocalDateTime.now()) + .eq(NegativeApprove::getNegativeId, negativeId) + .eq(NegativeApprove::getActionKey, actionKey)); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode) { + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, AppConstants.ROOT_DEPART_ID)); + Negative negative = negativeService.getById(negativeId); + NegativeWork work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(AppConstants.ROOT_DEPART_ID) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java new file mode 100644 index 0000000..cd09efe --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -0,0 +1,82 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.FlowAction; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构 退回整改 + */ +@RequiredArgsConstructor +@Component +public class SecondApproveReturnAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final NegativeApproveService approveService; + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + updateApprove(actionDto.getNegativeId(), approveData.getComments(), actionDto.getWorkId()); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), RoleCodeEnum.THREE_ADMIN.getCode()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) + .eq(Negative::getId, negativeId)); + } + + public void updateApprove(String negativeId, String comments, Integer workId) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(workId); + approveService.update(new LambdaUpdateWrapper() + .set(NegativeApprove::getState, ApproveStateEnum.rejected.name()) + .set(NegativeApprove::getComments, comments) + .set(NegativeApprove::getHandlerDepartId, work.getDepartId()) + .set(NegativeApprove::getHandlerDepartName, work.getDepartName()) + .set(NegativeApprove::getHandlerUserName, user.getUserName()) + .set(NegativeApprove::getHandlerName, user.getNickName()) + .set(NegativeApprove::getUpdateTime, LocalDateTime.now()) + .eq(NegativeApprove::getNegativeId, negativeId) + .eq(NegativeApprove::getActionKey, FlowActionEnum.SECOND_APPROVE.getKey())); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode) { + NegativeWork work = workService.getOne(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, negativeId).eq(NegativeWork::getRoleCode, roleCode)); + work.setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java new file mode 100644 index 0000000..9fb5862 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java @@ -0,0 +1,74 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.FirstDistributeData; +import com.biutag.supervision.pojo.dto.flow.SecondDistributeData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构下发 + */ +@RequiredArgsConstructor +@Component +public class SecondDistributeAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + @Override + public void next(ActionDto actionDto) { + SecondDistributeData secondDistributeData = BeanUtil.toBean(actionDto.getData(), SecondDistributeData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), secondDistributeData); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), RoleCodeEnum.THREE_ADMIN.getCode(), secondDistributeData.getDepartId(), secondDistributeData.getDepartName()); + } + + public void updateNegative(String negativeId, String nextFlowKey, SecondDistributeData secondDistributeData) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getHandleThreeDepartId, secondDistributeData.getDepartId()) + .set(Negative::getHandleThreeDepartName, secondDistributeData.getDepartName()) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getUpdTime, LocalDateTime.now()) + .eq(Negative::getId, negativeId)); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode, String departId, String departName) { + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, departId)); + Negative negative = negativeService.getById(negativeId); + NegativeWork work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(departId) + .setDepartName(departName) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java new file mode 100644 index 0000000..3405931 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java @@ -0,0 +1,88 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.ApproveStateEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeExtensionApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构申请延期审批通过 + */ +@RequiredArgsConstructor +@Component +public class SecondExtensionApproveAction implements Action { + + private final NegativeService negativeService; + + private final NegativeExtensionApproveService extensionApproveService; + + private final NegativeWorkService workService; + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + addExtensionApprove(actionDto, approveData.getComments()); + doneWork(actionDto.getWorkId()); + addWork(actionDto, RoleCodeEnum.FIRST_ADMIN.getCode(), actionDto.getNextFlowKey()); + } + + public void addExtensionApprove(ActionDto actionDto, String comments) { + Negative negative = negativeService.getById(actionDto.getNegativeId()); + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() + .setNegativeId(actionDto.getNegativeId()) + .setNegativeExtensionApplyId(negative.getNegativeExtensionApplyId()) + .setComments(comments) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setState(ApproveStateEnum.approved.name()) + .setCreateTime(LocalDateTime.now()); + extensionApproveService.save(extensionApprove); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper().set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getFlowKey, null) + .eq(NegativeWork::getId, workId)); + } + public void addWork(ActionDto actionDto, String roleCode, String nextFlowKey) { + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, actionDto.getNegativeId()) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, AppConstants.ROOT_DEPART_ID)); + Negative negative = negativeService.getById(actionDto.getNegativeId()); + NegativeWork work = new NegativeWork() + .setNegativeId(actionDto.getNegativeId()) + .setRoleCode(roleCode) + .setFlowKey(actionDto.getNextFlowKey()) + .setDepartId(AppConstants.ROOT_DEPART_ID) + .setDepartName(AppConstants.ROOT_DEPART_NAME) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setFlowKey(nextFlowKey) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java new file mode 100644 index 0000000..8f32dae --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java @@ -0,0 +1,70 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.ApproveStateEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApproveData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeExtensionApproveService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构申请延期审批驳回 + */ +@RequiredArgsConstructor +@Component +public class SecondExtensionReturnAction implements Action { + + private final NegativeService negativeService; + + private final NegativeExtensionApproveService extensionApproveService; + + private final NegativeWorkService workService; + + @Override + public void next(ActionDto actionDto) { + ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); + updateNegative(actionDto.getNegativeId()); + addExtensionApprove(actionDto, approveData.getComments()); + doneWork(actionDto.getWorkId()); + } + + public void updateNegative(String negativeId) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getExtensionApplyFlag, true) + .eq(Negative::getId, negativeId)); + } + + public void addExtensionApprove(ActionDto actionDto, String comments) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() + .setNegativeId(actionDto.getNegativeId()) + .setComments(comments) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setState(ApproveStateEnum.rejected.name()) + .setCreateTime(LocalDateTime.now()); + extensionApproveService.save(extensionApprove); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper().set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getFlowKey, null) + .eq(NegativeWork::getId, workId)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondLocalProcessingAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondLocalProcessingAction.java new file mode 100644 index 0000000..6ecb619 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondLocalProcessingAction.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.flow.action; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.service.NegativeService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +@RequiredArgsConstructor +@Component +public class SecondLocalProcessingAction implements Action { + + private final NegativeService negativeService; + + @Override + public void next(ActionDto actionDto) { + updateNegative(actionDto); + } + + public void updateNegative(ActionDto actionDto) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, actionDto.getNextFlowKey()) + .set(Negative::getIsSecondHandle, true) + .set(Negative::getUpdTime, LocalDateTime.now()) + .eq(Negative::getId, actionDto.getNegativeId())); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java new file mode 100644 index 0000000..0468684 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.flow.action; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构签收 + */ +@RequiredArgsConstructor +@Component +public class SecondSignAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + @Override + public void next(ActionDto actionDto) { + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + updateWork(actionDto.getWorkId()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + + .eq(Negative::getId, negativeId)); + } + + public void updateWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondSignReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondSignReturnAction.java new file mode 100644 index 0000000..4e93941 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondSignReturnAction.java @@ -0,0 +1,81 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.SignReturnData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeSignReturn; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeSignReturnService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 二级机构问题退回 + */ +@RequiredArgsConstructor +@Component +public class SecondSignReturnAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final NegativeSignReturnService signReturnService; + + @Override + public void next(ActionDto actionDto) { + SignReturnData signReturnData = BeanUtil.toBean(actionDto.getData(), SignReturnData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + addSignReturn(actionDto, signReturnData.getComments()); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), RoleCodeEnum.FIRST_ADMIN.getCode()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .eq(Negative::getId, negativeId)); + } + + public void addSignReturn(ActionDto actionDto, String comments) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeSignReturn signReturn = new NegativeSignReturn() + .setNegativeId(actionDto.getNegativeId()) + .setActionKey(actionDto.getActionKey()) + .setComments(comments) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setCreateTime(LocalDateTime.now()); + signReturnService.save(signReturn); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode) { + NegativeWork work = workService.getOne(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, negativeId).eq(NegativeWork::getRoleCode, roleCode)); + work.setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/ThreeSignAction.java b/src/main/java/com/biutag/supervision/flow/action/ThreeSignAction.java new file mode 100644 index 0000000..13f095c --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ThreeSignAction.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.flow.action; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 三级机构签收 + */ +@RequiredArgsConstructor +@Component +public class ThreeSignAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + @Override + public void next(ActionDto actionDto) { + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + updateWork(actionDto.getWorkId()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) + .eq(Negative::getId, negativeId)); + } + + public void updateWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java new file mode 100644 index 0000000..575905c --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java @@ -0,0 +1,96 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.SignReturnData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeSignReturn; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.*; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 三级机构问题退回 + */ +@RequiredArgsConstructor +@Component +public class ThreeSignReturnAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final NegativeSignReturnService signReturnService; + + private final NegativeBlameService blameService; + + private final NegativeProblemRelationService problemRelationService; + + @Override + public void next(ActionDto actionDto) { + SignReturnData signReturnData = BeanUtil.toBean(actionDto.getData(), SignReturnData.class); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); + addSignReturn(actionDto, signReturnData.getComments()); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), RoleCodeEnum.SECOND_ADMIN.getCode()); + } + + public void updateNegative(String negativeId, String nextFlowKey) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.signing.name()) + //----------------------------------------------------------------------------- + .set(Negative::getCheckStatus, null) + .set(Negative::getCheckStatusName, null) + .set(Negative::getIsRectifyCode, null) + .set(Negative::getIsRectifyName, null) + .set(Negative::getAccountabilityTarget, null) + .set(Negative::getRectifyRestrictionDays, null) + .eq(Negative::getId, negativeId)); + // 删除涉及人员 + blameService.remove(negativeId); + // 删除涉及人员问题类型 + problemRelationService.remove(negativeId); + } + + public void addSignReturn(ActionDto actionDto, String comments) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeWork work = workService.getById(actionDto.getWorkId()); + NegativeSignReturn signReturn = new NegativeSignReturn() + .setNegativeId(actionDto.getNegativeId()) + .setActionKey(actionDto.getActionKey()) + .setComments(comments) + .setHandlerDepartId(work.getDepartId()) + .setHandlerDepartName(work.getDepartName()) + .setHandlerUserName(user.getUserName()) + .setHandlerName(user.getNickName()) + .setCreateTime(LocalDateTime.now()); + signReturnService.save(signReturn); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode) { + NegativeWork work = workService.getOne(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, negativeId).eq(NegativeWork::getRoleCode, roleCode)); + work.setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java new file mode 100644 index 0000000..40fdc59 --- /dev/null +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -0,0 +1,72 @@ +package com.biutag.supervision.job; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.util.TimeUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; + +@RequiredArgsConstructor +@Component +public class Job { + + private final NegativeService negativeService; + + private final SupDepartService departService; + + // 10分钟 + // 更新流程状态 + @Scheduled(fixedRate = 600000) + public void updateNegativeProcessingStatus() { + List list = negativeService.list(new LambdaQueryWrapper().isNull(Negative::getProcessingStatus).isNotNull(Negative::getCheckStatus)); + list.forEach(item -> { + negativeService.update(new LambdaUpdateWrapper().set(Negative::getProcessingStatus, ProcessingStatusEnum.completed).eq(Negative::getId, item.getId())); + }); + } + + // 更新办理单位 + @Scheduled(fixedRate = 600000) + public void updateHandleDepart() { + List list = negativeService.list(new LambdaQueryWrapper() + .isNotNull(Negative::getInvolveDepartId) + .isNull(Negative::getHandleThreeDepartId) + .isNull(Negative::getFlowKey)); + list.forEach(item -> { + SupDepart depart = departService.getById(item.getInvolveDepartId()); + if (depart.getLevel() == 3) { + SupDepart parent = departService.getById(depart.getPid()); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getHandleThreeDepartId, depart.getId()) + .set(Negative::getHandleThreeDepartName, depart.getShortName()) + .set(Negative::getHandleSecondDepartId, parent.getId()) + .set(Negative::getHandleSecondDepartName, parent.getShortName()) + .eq(Negative::getId, item.getId())); + } + }); + } + + // 更新办理超时 + @Scheduled(fixedRate = 600000) + public void updateHandleTimeout() { + List list = negativeService.list(new LambdaQueryWrapper() + .isNotNull(Negative::getCompleteDate) + .isNotNull(Negative::getCrtTime) + .isNull(Negative::getFlowKey)); + list.forEach(item -> { + long remainingDuration = TimeUtil.getRemainingDuration(item.getCrtTime(), item.getCompleteDate(), 3 * 24 * 60 * 60L); + if (remainingDuration < 0) { + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getHandleTimeout, -remainingDuration) + .eq(Negative::getId, item.getId())); + } + }); + } +} diff --git a/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java new file mode 100644 index 0000000..b108d96 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseAccount; + +@DS("slave") +public interface BaseAccountMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/BaseRoleMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseRoleMapper.java new file mode 100644 index 0000000..5cfc9e1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseRoleMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseRole; + +@DS("slave") +public interface BaseRoleMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/BaseRoleUserMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseRoleUserMapper.java new file mode 100644 index 0000000..5b47d94 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseRoleUserMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseRoleUser; + +@DS("slave") +public interface BaseRoleUserMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/BaseUserMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseUserMapper.java new file mode 100644 index 0000000..d10cc13 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseUserMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseUser; + +@DS("slave") +public interface BaseUserMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java new file mode 100644 index 0000000..c90c93f --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; + +public interface DataPetitionComplaintMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/FlowActionMapper.java b/src/main/java/com/biutag/supervision/mapper/FlowActionMapper.java new file mode 100644 index 0000000..5e98c0d --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/FlowActionMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.FlowAction; + +public interface FlowActionMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/FlowNodeMapper.java b/src/main/java/com/biutag/supervision/mapper/FlowNodeMapper.java new file mode 100644 index 0000000..6e8c663 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/FlowNodeMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.FlowNode; + +public interface FlowNodeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/HolidayMapper.java b/src/main/java/com/biutag/supervision/mapper/HolidayMapper.java new file mode 100644 index 0000000..e785112 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/HolidayMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Holiday; + +public interface HolidayMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/MenuMapper.java b/src/main/java/com/biutag/supervision/mapper/MenuMapper.java new file mode 100644 index 0000000..e796e8f --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/MenuMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Menu; + +@DS("slave") +public interface MenuMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClassMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClassMapper.java new file mode 100644 index 0000000..8db59f1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClassMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.ModelClass; + +public interface ModelClassMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/ModelMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelMapper.java new file mode 100644 index 0000000..62ca945 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Model; + +public interface ModelMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegDepartAuthorityMapper.java b/src/main/java/com/biutag/supervision/mapper/NegDepartAuthorityMapper.java new file mode 100644 index 0000000..f77f880 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegDepartAuthorityMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegDepartAuthority; + +public interface NegDepartAuthorityMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegSourceAuthorityMapper.java b/src/main/java/com/biutag/supervision/mapper/NegSourceAuthorityMapper.java new file mode 100644 index 0000000..d816996 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegSourceAuthorityMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegSourceAuthority; + +public interface NegSourceAuthorityMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeApproveMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeApproveMapper.java new file mode 100644 index 0000000..7a872b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeApproveMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeApprove; + +public interface NegativeApproveMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java new file mode 100644 index 0000000..7a60f0b --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeBlame; + +public interface NegativeBlameMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeExtensionApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeExtensionApplyMapper.java new file mode 100644 index 0000000..40ba213 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeExtensionApplyMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeExtensionApply; + +public interface NegativeExtensionApplyMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeExtensionApproveMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeExtensionApproveMapper.java new file mode 100644 index 0000000..a6f3543 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeExtensionApproveMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; + +public interface NegativeExtensionApproveMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeFavMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeFavMapper.java new file mode 100644 index 0000000..21814da --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeFavMapper.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.NegativeFav; +import com.biutag.supervision.pojo.model.NegativeFavModel; +import com.biutag.supervision.pojo.model.NegativeWorkModel; +import org.apache.ibatis.annotations.Param; + +public interface NegativeFavMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java new file mode 100644 index 0000000..47d9c46 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeFile; + +public interface NegativeFileMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeHistoryMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeHistoryMapper.java new file mode 100644 index 0000000..cb377b0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeHistoryMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeHistory; + +public interface NegativeHistoryMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java new file mode 100644 index 0000000..1d000aa --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Negative; + +public interface NegativeMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java new file mode 100644 index 0000000..4b33425 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeProblemRelation; + +public interface NegativeProblemRelationMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeSignReturnMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeSignReturnMapper.java new file mode 100644 index 0000000..b70badf --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeSignReturnMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeSignReturn; + +public interface NegativeSignReturnMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeThingFileMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeThingFileMapper.java new file mode 100644 index 0000000..62dd4ce --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeThingFileMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeThingFile; + +public interface NegativeThingFileMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeWorkMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeWorkMapper.java new file mode 100644 index 0000000..bb879ee --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeWorkMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.NegativeWorkModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface NegativeWorkMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/RoleMenuMapper.java b/src/main/java/com/biutag/supervision/mapper/RoleMenuMapper.java new file mode 100644 index 0000000..7938dc3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RoleMenuMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RoleMenu; + + +public interface RoleMenuMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java new file mode 100644 index 0000000..dc2c005 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDepart; +import org.apache.ibatis.annotations.Select; + +public interface SupDepartMapper extends BaseMapper { + + @Select("select d.* from sup_depart d left join sup_depart_jwpy t on d.code = t.depart_code where t.code = #{departCode}") + SupDepart selectByJwpyCode(String departCode); + + @Select("select max(id) from sup_depart") + Integer getMaxId(); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictContentMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictContentMapper.java new file mode 100644 index 0000000..a5e151e --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictContentMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictContent; + +public interface SupDictContentMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictDataMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictDataMapper.java new file mode 100644 index 0000000..c0af7b1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictDataMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictData; + +public interface SupDictDataMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictTypeMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictTypeMapper.java new file mode 100644 index 0000000..189ee81 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictTypeMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictType; + +public interface SupDictTypeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java new file mode 100644 index 0000000..780dec6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.PoliceModel; +import org.apache.ibatis.annotations.Param; + +public interface SupPoliceMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/UserMapper.java b/src/main/java/com/biutag/supervision/mapper/UserMapper.java new file mode 100644 index 0000000..401b933 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/UserMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.User; + +public interface UserMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/Result.java b/src/main/java/com/biutag/supervision/pojo/Result.java new file mode 100644 index 0000000..f9f1ba4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/Result.java @@ -0,0 +1,48 @@ +package com.biutag.supervision.pojo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; +import org.springframework.http.HttpStatus; + +@Accessors(chain = true) +@Setter +@Getter +public class Result { + + @Schema(description = "状态码") + private int code; + + @Schema(description = "消息") + private String message; + + @Schema(description = "数据") + private T data; + + public Result(int code) { + this.code = code; + } + + public Result(int code, String message) { + this.code = code; + this.message = message; + } + + public static Result success() { + return new Result<>(HttpStatus.OK.value()); + } + + public static Result success(T data) { + return new Result(HttpStatus.OK.value()).setData(data); + } + + public static Result failed(String message) { + return new Result<>(HttpStatus.INTERNAL_SERVER_ERROR.value(), message); + } + + public static Result failed(int code, String message) { + return new Result<>(code, message); + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/Blame.java b/src/main/java/com/biutag/supervision/pojo/domain/Blame.java new file mode 100644 index 0000000..ebc208d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/Blame.java @@ -0,0 +1,176 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.entity.NegativeProblemRelation; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class Blame { + + private String blameId; + + private String negativeId; + + // 核实人员 + private String blameFlag; + + // 涉及人员 + private String involveFlag; + + // 涉及姓名 + private String blameName; + + // 涉及身份证 + private String blameIdCode; + + // 涉及警号 + private String blameEmpNo; + + // 涉及部门 + private String blameDepartId; + + // 涉及人部门名称 + private String blameDepartName; + + // 人员属性 + private String ivPersonType; + + // 人员属性 + private String ivPersonTypeCode; + + // 二级机构 + private String twoLevelDapartId; + + // 二级机构 + private String twoLevelDapartName; + + // 三级机构 + private String threeLevelDapartName; + + // 三级机构 + private String threeLevelDapart; + + // 警种 + private String policeTypeName; + + // 警种 + private String policeTypeCode; + + // 核查情况code + private String inspectCaseCode; + + // 核查情况 + private String inspectCaseName; + + // 督察措施 + private String superviseMeasuresCode; + + // 督察措施 + private String superviseMeasuresName; + + // 主观方面 + private String subjectiveAspectCode; + + // 主观方面 + private String subjectiveAspectName; + + // 责任类别 + private String responsibilityTypeCode; + + // 责任类别 + private String responsibilityTypeName; + + // 处理结果 + private String handleResultCode; + + // 处理结果 + private String handleResultName; + + // 维权容错 + private String protectRightsCode; + + // 维权容错 + private String protectRightsName; + + // 帮扶对象 + private String assistCaseCode; + + // 帮扶对象 + private String assistCaseName; + + // 帮扶结束时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + private LocalDateTime assistEndTime; + + // 帮扶开始时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + private LocalDateTime assistStartTime; + + // 责任领导 + private String leadName; + + // 责任领导身份证 + private String leadIdCode; + + // 责任领导部门 + private String leadDepartName; + + // 责任领导部门id + private String leadDepartId; + + // 二级机构 + private String leadTwoDepartId; + + // 二级机构 + private String leadTwoDepartName; + + // 三级机构 + private String leadThreeDepartId; + + // 三级机构 + private String leadThreeDepartName; + + // 领导督察措施 + private String leadMeasuresName; + + // 领导督察措施 + private String leadMeasuresCode; + + // 领导责任类别 + private String leadResponsibilityTypeName; + + // 领导责任类别 + private String leadResponsibilityTypeCode; + + // 领导处理结果 + private String leadHandleResultCode; + + // 领导处理结果 + private String leadHandleResultName; + + // 领导维权容错 + private String leadProtectRightsName; + + // 领导维权容错 + private String leadProtectRightsCode; + + // 统计人员类型 1 民警 2 其他 + private String statisticsPersonType; + + private LocalDateTime crtTime; + + private LocalDateTime updTime; + + private String status; + + // 涉及类型 + private String type; + + private List problems = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java b/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java new file mode 100644 index 0000000..f4e7d93 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class ExtensionApply { + + private Integer id; + + private String negativeId; + + private String handlerDepartId; + + private String handlerDepartName; + + private String handlerUserName; + + private String handlerName; + + private String comments; + + private Integer extensionDays; + + private LocalDateTime createTime; + + private List approves = new ArrayList<>(); + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java new file mode 100644 index 0000000..285fe50 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java @@ -0,0 +1,44 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.entity.*; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeDetail { + + private NegativeVo negative; + + // 操作历史 + private List actionHistory = new ArrayList<>(); + + // 流程节点 + private FlowNode flowNode; + + // 流程操作 + private List flowActions = new ArrayList<>(); + + // 签收退回 + private List signReturns = new ArrayList<>(); + + private List approves = new ArrayList<>(); + + // 延期申请 + private ExtensionApply extensionApply; + + // 是否收藏 + private Boolean isFav; + + // 办理剩余时长 + private Long remainingDuration; + + // 最大限时 + private Long maxDuration; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java new file mode 100644 index 0000000..1666a09 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java @@ -0,0 +1,182 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.entity.NegativeFile; +import com.biutag.supervision.pojo.entity.NegativeThingFile; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class NegativeVo { + + private String id; + + // 样本来源编号 + private String originId; + + // 编号 + private String serialNumber; + + // 问题发生时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源code + private String problemSourcesCode; + + // 问题来源 + private String problemSources; + + // 联系电话 + private String contactPhone; + + // 涉及人姓名 + private String responderName; + + // 反映人部门id + private String responderDepartId; + + // 反映人部门名称 + private String responderDepartName; + + // 涉及人身份证 + private String responderIdCard; + + // 业务类型 + private String businessTypeCode; + + // 业务类别名称 + private String businessTypeName; + + // 涉嫌问题JSON + private String involveProblemLables; + + // 涉及警种名称 + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉及单位名称 + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + // 简要描述 + private String thingDesc; + + // 填写人姓名 + private String fillName; + + // 填写人部门id + private String fillDepartId; + + // 填写人部门名称 + private String fillDeaprtName; + + // 审核人姓名 + private String checkName; + + // 审核人身份证 + private String checkIdCode; + + private LocalDateTime crtTime; + + + // 0 正常 1 禁用 + private String status; + + private String remark; + + // 预留 + private String reserve; + + // 核查情况 + private String checkStatus; + + // 核查情况 + private String checkStatusName; + + // 完善状态 0 -- 待完善 1 -- 已完善 + private String completeStatus; + + + private String supervisionSubjectCode; + + private String supervisionSubjectName; + + // 是否整改 + private String isRectifyCode; + + // 是否整改 + private String isRectifyName; + + // 办结时间 + private LocalDateTime completeDate; + + //--------------------------------------------- + + private String flowKey; + + // 主办层级 + private String hostLevel; + + // 办理时限 + private String timeLimit; + + // 审批流程 + private String approvalFlow; + + // 问题核查情况 + private String checkStatusDesc; + + // 问题整改情况 + private String rectifyDesc; + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + private String accountabilityTarget; + + // 办理状态 + private String processingStatus; + + // 是否能申请延期 + private Boolean extensionApplyFlag; + + // 延期天数 + private Integer extensionDays; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + private String handleSecondDepartId; + + private String handleSecondDepartName; + + private String handleThreeDepartId; + + private String handleThreeDepartName; + + private String caseNumber; + + // 涉及人员 + private List blames = new ArrayList<>(); + + // 办结佐证材料 + private List files = new ArrayList<>(); + + private List thingFiles = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java new file mode 100644 index 0000000..0357303 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.domain; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class PoliceAuth { + + private List departs; + + private List sources; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/Self.java b/src/main/java/com/biutag/supervision/pojo/domain/Self.java new file mode 100644 index 0000000..f8b605f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/Self.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.vo.MenuTree; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class Self { + + private UserAuth user; + + private List menus; + + private List perms; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/AccountDto.java b/src/main/java/com/biutag/supervision/pojo/dto/AccountDto.java new file mode 100644 index 0000000..c61f4a9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/AccountDto.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.pojo.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class AccountDto { + + @Schema(description = "用户名") + @NotBlank(message = "请您输入用户名") + private String account; + + @Schema(description = "密码") + @NotBlank(message = "请您输入密码") + private String password; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ActionDto.java b/src/main/java/com/biutag/supervision/pojo/dto/ActionDto.java new file mode 100644 index 0000000..938e2da --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ActionDto.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class ActionDto { + + private String negativeId; + + private Integer workId; + + private String actionKey; + + private String nextFlowKey; + + private String actionName; + + private Object data; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintDto.java new file mode 100644 index 0000000..6b53e95 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintDto.java @@ -0,0 +1,93 @@ +package com.biutag.supervision.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Schema(description = "信访投诉") +@Setter +@Getter +public class DataPetitionComplaintDto { + + // 信件编号 + @Schema(description = "信件编号") + @NotBlank + private String letterId; + + // 投诉渠道 + @Schema(description = "投诉渠道") + private String channelForFilingComplaints; + + // 受理层级 + @Schema(description = "受理层级") + @NotBlank + private String acceptanceLevel; + + // 登记时间 + @Schema(description = "登记时间(问题发现时间) 示例:2024-08-28 11:00:00") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + @NotNull + private LocalDateTime discovery_time; + + // 投诉人 + @Schema(description = "投诉人") + @NotBlank + private String responderName; + + // 投诉人电话 + @Schema(description = "投诉人电话") + @NotBlank + private String responderPhone; + + // 初重信访 + @Schema(description = "初重信访") + @NotBlank + private String initialPetition; + + // 缠访闹访 + @Schema(description = "缠访闹访") + @NotBlank + private String entanglementVisits; + + // 群众集访 + @Schema(description = "群众集访") + @NotBlank + private String massVisits; + + // 涉嫌问题 + @Schema(description = "涉嫌问题") + @NotBlank + private String involveProblem; + + // 业务类别 + @Schema(description = "业务类别") + @NotBlank + private String businessTypeName; + + // 涉及警种 + @Schema(description = "涉及警种") + @NotBlank + private String policeTypeName; + + // 被投诉机构 + @Schema(description = "被投诉机构") + @NotBlank + private String complainedDepartName; + + // 具体内容 + @Schema(description = "具体内容") + @NotBlank + private String thingDesc; + + @Schema(description = "办结时间 示例:2024-08-28 11:00:00") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private LocalDateTime completedTime; + + @Schema(description = "办结状态") + private String completedState; +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DictDataDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DictDataDto.java new file mode 100644 index 0000000..1983ba3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DictDataDto.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DictDataDto { + + private Long dictCode; + + // 字典标签 + private String dictLabel; + + // 字典键值 + private String dictValue; + + // 字典类型 + private String dictType; + + // 样式属性(其他样式扩展) + private String cssClass; + + // 表格回显样式 + private String listClass; + + // 是否默认(1是 0否) + private String isDefault; + + + // 字典排序 + private Integer dictSort; + + // 状态(0正常 1停用) + private String status; + + + // 备注 + private String remark; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DictTypeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DictTypeDto.java new file mode 100644 index 0000000..2769b05 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DictTypeDto.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DictTypeDto { + + private Long dictId; + + // 字典名称 + private String dictName; + + // 字典类型 + private String dictType; + + // 状态(0正常 1停用) + private String status; + + private String remark; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/MenuDto.java b/src/main/java/com/biutag/supervision/pojo/dto/MenuDto.java new file mode 100644 index 0000000..af87396 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/MenuDto.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class MenuDto { + + private Integer id; + + private Integer pid; + + // 菜单类型 + private String menuType; + + // 菜单名称 + private String menuName; + + // 菜单图标 + private String icon; + + // 路径 + private String paths; + + private String component; + + // 排序 + private Integer menuSort; + + private String perms; + + private Integer isCache; + + private Integer isShow; + + private Integer isDisable; + + // 是否打开新页面 默认为false + private Boolean openNewPage; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java new file mode 100644 index 0000000..8dceeb5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java @@ -0,0 +1,97 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.vo.FileVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Setter +@Getter +public class NegativeDto { + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @NotNull + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + @NotBlank + private String problemSourcesCode; + + // 问题来源 + @NotBlank + private String problemSources; + + // 业务类别 + @NotBlank + private String businessTypeCode; + + // 业务类别名称 + @NotBlank + private String businessTypeName; + + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉嫌问题JSON + private List> involveProblem; + + // 反映人姓名 + private String responderName; + + // 联系电话 + private String contactPhone; + + // 简要描述 + @NotBlank + private String thingDesc; + + private List thingFiles = new ArrayList<>(); + + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + @NotBlank + private String hostLevel; + + // 办理时限 + @NotBlank + private String timeLimit; + + // 审批流程 + @NotBlank + private String approvalFlow; + + @NotBlank + private String departId; + + @NotBlank + private String departName; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 涉及案件/警情编号 + private String caseNumber; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/UserDto.java b/src/main/java/com/biutag/supervision/pojo/dto/UserDto.java new file mode 100644 index 0000000..deb34c6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/UserDto.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class UserDto { + + private String userId; + + // 登陆账号 + private String userName; + + // 昵称 + private String nickName; + + // 邮箱 + private String email; + + // 手机号 + private String mobile; + + // 用户类型:super-超级管理员 normal-普通管理员 + private String userType; + + // 描述 + private String userDesc; + + // 状态:0-禁用 1-正常 2-锁定 + private Integer status; + + private List roleIds; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ApproveData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApproveData.java new file mode 100644 index 0000000..8895de5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApproveData.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ApproveData { + + private String comments; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ExtensionApplyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ExtensionApplyData.java new file mode 100644 index 0000000..18a167d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ExtensionApplyData.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ExtensionApplyData { + + // 延期天数 + private Integer extensionDays; + + // 延期理由 + private String comments; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java new file mode 100644 index 0000000..cd1ca8f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.dto.flow; + +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class FirstDistributeData { + + @NotBlank + private String hostLevel; + + // 办理时限 + @NotBlank + private String timeLimit; + + // 审批流程 + @NotBlank + private String approvalFlow; + + @NotBlank + private String departId; + + @NotBlank + private String departName; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/SecondDistributeData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/SecondDistributeData.java new file mode 100644 index 0000000..553b6dc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/SecondDistributeData.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class SecondDistributeData { + + private String departId; + + private String departName; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/SignReturnData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/SignReturnData.java new file mode 100644 index 0000000..1adc1be --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/SignReturnData.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class SignReturnData { + + private String comments; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java new file mode 100644 index 0000000..9a0d024 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java @@ -0,0 +1,201 @@ +package com.biutag.supervision.pojo.dto.flow; + +import com.biutag.supervision.pojo.vo.FileVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Setter +@Getter +public class VerifyData { + + // 核查情况 + @NotBlank + private String checkStatus; + + // 核查情况 + @NotBlank + private String checkStatusName; + + // 是否整改 + @NotBlank + private String isRectifyCode; + + // 是否整改 + @NotBlank + private String isRectifyName; + + // 问题核查情况 + @NotBlank + private String checkStatusDesc; + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + @NotBlank + private String accountabilityTarget; + + private List blames = new ArrayList<>(); + + private List files = new ArrayList<>(); + + @Setter + @Getter + public static class Blame { + + // 涉及姓名 + @NotBlank + private String blameName; + + // 涉及身份证 + @NotBlank + private String blameIdCode; + + // 涉及警号 + @NotBlank + private String blameEmpNo; + + // 警种 + @NotBlank + private String policeTypeName; + + // 警种 + @NotBlank + private String policeTypeCode; + + // 核查情况code + @NotBlank + private String inspectCaseCode; + + // 核查情况 + @NotBlank + private String inspectCaseName; + + // 督察措施 + @NotBlank + private String superviseMeasuresCode; + + // 督察措施 + @NotBlank + private String superviseMeasuresName; + + // 主观方面 + @NotBlank + private String subjectiveAspectCode; + + // 主观方面 + @NotBlank + private String subjectiveAspectName; + + // 责任类别 + @NotBlank + private String responsibilityTypeCode; + + // 责任类别 + @NotBlank + private String responsibilityTypeName; + + // 处理结果 + @NotBlank + private String handleResultCode; + + // 处理结果 + @NotBlank + private String handleResultName; + + // 维权容错 + @NotBlank + private String protectRightsCode; + + // 维权容错 + @NotBlank + private String protectRightsName; + + // 帮扶对象 + @NotBlank + private String assistCaseCode; + + // 帮扶对象 + @NotBlank + private String assistCaseName; + + // 帮扶时间 (开始时间、结束时间) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private List assistTime = new ArrayList<>(); + + // 责任领导 + @NotBlank + private String leadName; + + // 责任领导身份证 + @NotBlank + private String leadIdCode; + + // 三级机构 + @NotBlank + private String leadThreeDepartName; + + // 领导督察措施 + @NotBlank + private String leadMeasuresName; + + // 领导督察措施 + @NotBlank + private String leadMeasuresCode; + + // 领导责任类别 + @NotBlank + private String leadResponsibilityTypeName; + + // 领导责任类别 + @NotBlank + private String leadResponsibilityTypeCode; + + // 领导处理结果 + @NotBlank + private String leadHandleResultCode; + + // 领导处理结果 + @NotBlank + private String leadHandleResultName; + + // 领导维权容错 + @NotBlank + private String leadProtectRightsName; + + // 领导维权容错 + @NotBlank + private String leadProtectRightsCode; + + // 问题类型 + private List problems; + + private String type; + + } + + @Setter + @Getter + public static class Problem { + @NotBlank + private String oneLevelCode; + + @NotBlank + private String twoLevelCode; + + @NotBlank + private String oneLevelContent; + + @NotBlank + private String twoLevelContent; + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/jwdc/NegativeApiDto.java b/src/main/java/com/biutag/supervision/pojo/dto/jwdc/NegativeApiDto.java new file mode 100644 index 0000000..56071b8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/jwdc/NegativeApiDto.java @@ -0,0 +1,111 @@ +package com.biutag.supervision.pojo.dto.jwdc; + +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.ValidationException; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import org.springframework.beans.BeanUtils; + +import java.util.Date; + +@Setter +@Getter +public class NegativeApiDto { + + // 来源ID + @NotBlank + private String originId; + + // 反映人姓名 + @NotBlank + private String responderName; + + // 联系电话 + @NotBlank + private String contactPhone; + + // 发生时间 + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date happenTime; + + // 发现时间 + @NotNull + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date discoveryTime; + + // 业务类型名称 + @NotBlank + private String businessTypeName; + + // 涉及单位名称 + @NotBlank + private String departName; + + @NotBlank + private String departCode; + + // 简要描述 + @NotBlank + private String thingDesc; + + public NegativeApiDto toEntity() { + NegativeApiDto negative = new NegativeApiDto(); + BeanUtils.copyProperties(this, negative); + return negative; + } + + @AllArgsConstructor + public enum BusinessType { + // 业务类型 + JCJ_110("1", "110接处警", "警令", "1"), // 警令 + JCJ_122("2", "122接处警", "交警", "11"), // 交警 + RJCKFW("3", "人境窗口服务", "人境", "18"), // 人境 + CJGFF("4", "车驾管服务", "交警", "11"), // 交警 + //JJCF(5, "交警执法"), + ZFBA("6", "执法办案", "法制", "21") // 法制 +// , ZXGZ(7, "专项工作"), +// ABWW(8, "安保维稳"), +// ZAFK(9, "治安防控"), +// XZGL(10, "行政管理"), +// FWJC(11, "服务基层"), +// DWGL(12, "队伍管理"), +// OTHER(13, "其他") + ; + + @Getter + private String code; + private String name; + private String policeTypeName; + private String policeType; + + public static String getCode(String name) { + for (BusinessType businessType : values()) { + if (businessType.name.equals(name)) { + return businessType.code; + } + } + throw new ValidationException("没有该业务类型"); + } + + public static String getPoliceTypeName(String name) { + for (BusinessType businessType : values()) { + if (businessType.name.equals(name)) { + return businessType.policeTypeName; + } + } + throw new ValidationException("没有该业务类型"); + } + public static String getPoliceType(String name) { + for (BusinessType businessType : values()) { + if (businessType.name.equals(name)) { + return businessType.policeType; + } + } + throw new ValidationException("没有该业务类型"); + } + + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseAccount.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseAccount.java new file mode 100644 index 0000000..33b7e0e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseAccount.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseAccount implements Serializable { + + // + @TableId + private String accountId; + + // 用户Id + @TableField("user_id") + private String userId; + + // 标识:手机号、邮箱、 用户名、或第三方应用的唯一标识 + @TableField("account") + private String account; + + // 密码凭证:站内的保存密码、站外的不保存或保存token) + @TableField("password") + private String password; + + // 登录类型:password-密码、mobile-手机号、email-邮箱 + @TableField("account_type") + private String accountType; + + // 账户域:@admin.com,@developer.com + @TableField("domain") + private String domain; + + // 注册IP + @TableField("register_ip") + private String registerIp; + + // 注册时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 状态:0-禁用 1-启用 2-锁定 + @TableField("status") + private Integer status; + + // 更新时间 + @TableField("update_time") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseRole.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseRole.java new file mode 100644 index 0000000..1f00474 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseRole.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseRole { + + // 角色ID + @TableId + private String roleId; + + // 角色编码 + @TableField("role_code") + private String roleCode; + + // 角色名称 + @TableField("role_name") + private String roleName; + + // 状态:0-无效 1-有效 + @TableField("status") + private String status; + + // 角色描述 + @TableField("role_desc") + private String roleDesc; + + @TableField("create_time") + private LocalDateTime createTime; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 保留数据0-否 1-是 不允许删除 + @TableField("is_persist") + private Integer isPersist; + + // 级别 1:市局管理员层级,2:二级管理员层级,3:三级管理员层级 + @TableField("level") + private Integer level; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseRoleUser.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseRoleUser.java new file mode 100644 index 0000000..786b249 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseRoleUser.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseRoleUser { + + // 用户ID + @TableField("user_id") + private String userId; + + // 角色ID + @TableField("role_id") + private String roleId; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 修改时间 + @TableField("update_time") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseUser.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseUser.java new file mode 100644 index 0000000..02fee4f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseUser.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseUser { + + // 用户ID + @TableId + private String userId; + + // 登陆账号 + @TableField("user_name") + private String userName; + + // 昵称 + @TableField("nick_name") + private String nickName; + + // 头像 + @TableField("avatar") + private String avatar; + + // 邮箱 + @TableField("email") + private String email; + + // 手机号 + @TableField("mobile") + private String mobile; + + // 用户类型:super-超级管理员 admin-普通管理员 + @TableField("user_type") + private String userType; + + // 企业ID + @TableField("company_id") + private String companyId; + + // 描述 + @TableField("user_desc") + private String userDesc; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新时间 + @TableField("update_time") + private LocalDateTime updateTime; + + // 状态:0-禁用 1-正常 2-锁定 + @TableField("status") + private Integer status; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java b/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java new file mode 100644 index 0000000..f5e7150 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java @@ -0,0 +1,181 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * 信访投诉 + */ +@Setter +@Getter +public class DataPetitionComplaint { + + // 信件编号 + @TableId + private Integer letterId; + + // 投诉渠道 + @TableField("channel_for_filing_complaints") + private String channelForFilingComplaints; + + // 受理层级 + @TableField("acceptance_level") + private String acceptanceLevel; + + // 登记时间 + private LocalDateTime discovery_time; + + // 投诉人 + @TableField("responder_name") + private String responderName; + + // 投诉人电话 + @TableField("responder_phone") + private String responderPhone; + + // 初重信访 + @TableField("initial_petition") + private String initialPetition; + + // 缠访闹访 + @TableField("entanglement_visits") + private String entanglementVisits; + + // 群众集访 + @TableField("mass_visits") + private String massVisits; + + // 涉嫌问题 + @TableField("involve_problem") + private String involveProblem; + + // 业务类别 + @TableField("business_type_name") + private String businessTypeName; + + // 涉及警种名称 + @TableField("police_type_name") + private String policeTypeName; + + // 被投诉机构ID + @TableField("complained_depart_id") + private String complainedDepartId; + + // 被投诉机构 + @TableField("complained_depart_name") + private String complainedDepartName; + + // 具体内容 + @TableField("thing_desc") + private String thingDesc; + + // 办结时间 + private String completedTime; + + // 办结状态 + private String completedState; + + //--------------------- + + // 涉及单位 + @TableField("involve_depart_id") + private String involveDepartId; + + // 涉及单位 + @TableField("involve_depart_name") + private String involveDepartName; + + // 是否单位责任 + @TableField("is_unit_responsible") + private Integer isUnitResponsible; + + // 单位处理结果 + @TableField("depart_processing_results") + private String departProcessingResults; + + // 涉及人姓名 + @TableField("involved_name") + private String involvedName; + + // 身份证号码 + @TableField("involved_id_code") + private String involvedIdCode; + + // 人员属性 + @TableField("personnel_attributes") + private String personnelAttributes; + + // 督察措施 + @TableField("inspection_measures") + private String inspectionMeasures; + + // 问题类型 + @TableField("problem_type") + private String problemType; + + // 主观方面 + @TableField("subjective_aspect") + private String subjectiveAspect; + + // 责任类别 + @TableField("responsibility_category") + private String responsibilityCategory; + + // 处理结果 + @TableField("processing_results") + private String processingResults; + + // 维权容错 + @TableField("rights_protection_fault_tolerance") + private String rightsProtectionFaultTolerance; + + // 帮扶情况 + @TableField("assistance_situation") + private String assistanceSituation; + + // 帮扶开始时间 + @TableField("assistance_start_time") + private LocalDateTime assistanceStartTime; + + // 帮扶结束时间 + @TableField("assistance_end_time") + private LocalDateTime assistanceEndTime; + + // 涉及领导姓名 + @TableField("involved_leader_name") + private String involvedLeaderName; + + // 身份证号码 + @TableField("involved_leader_id_code") + private String involvedLeaderIdCode; + + // 督察措施 + @TableField("involved_leader_inspection_measures") + private String involvedLeaderInspectionMeasures; + + // 责任类别 + @TableField("involved_leader_responsibility_category") + private String involvedLeaderResponsibilityCategory; + + // 处理结果 + @TableField("involved_leader_processing_results") + private String involvedLeaderProcessingResults; + + // 维权容错 + @TableField("involved_leader_rights_protection_fault_tolerance") + private String involvedLeaderRightsProtectionFaultTolerance; + + // + @TableField("crt_time") + private LocalDateTime crtTime; + + // + @TableField("upd_time") + private LocalDateTime updTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/FlowAction.java b/src/main/java/com/biutag/supervision/pojo/entity/FlowAction.java new file mode 100644 index 0000000..8ee2c35 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/FlowAction.java @@ -0,0 +1,56 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class FlowAction { + + @TableId(type = IdType.AUTO) + private Integer id; + + + private String actionKey; + + // + @TableField("flow_key") + private String flowKey; + + // 下一流程节点key + @TableField("next_flow_key") + private String nextFlowKey; + + // 按钮名称 + @TableField("button_label") + private String buttonLabel; + + // 按钮类型 + @TableField("button_type") + private String buttonType; + + // 是否是简单按钮 + @TableField("plain") + private Boolean plain; + + // 排序 + @TableField("sort") + private Integer sort; + + // 动作名称 + @TableField("action_name") + private String actionName; + + // 是否需要校验表单 + private Boolean validateForm; + + // 完成后是否需要关闭 + private Boolean doClose; + + // 是否需要启动对话框 + private Boolean openDialog; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/FlowNode.java b/src/main/java/com/biutag/supervision/pojo/entity/FlowNode.java new file mode 100644 index 0000000..ca1b062 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/FlowNode.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class FlowNode { + + // + @TableId + private String flowKey; + + // 流程节点名称 + @TableField("flow_name") + private String flowName; + + // 排序 + @TableField("flow_sort") + private Integer flowSort; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Holiday.java b/src/main/java/com/biutag/supervision/pojo/entity/Holiday.java new file mode 100644 index 0000000..6bca422 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Holiday.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class Holiday { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 日期 + @TableField("date") + private String date; + + // 是否是节假日 + @TableField("flag") + private Boolean flag; + + // 节假日名称 + @TableField("holiday_name") + private String holidayName; + + // 年 + @TableField("year") + private Integer year; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Menu.java b/src/main/java/com/biutag/supervision/pojo/entity/Menu.java new file mode 100644 index 0000000..d75eda2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Menu.java @@ -0,0 +1,74 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class Menu { + + // + @TableId(type = IdType.AUTO) + private Integer id; + + // + @TableField("pid") + private Integer pid; + + // 菜单类型 + @TableField("menu_type") + private String menuType; + + // 菜单名称 + @TableField("menu_name") + private String menuName; + + // 菜单图标 + @TableField("icon") + private String icon; + + // 排序 + @TableField("menu_sort") + private Integer menuSort; + + // + @TableField("perms") + private String perms; + + // 路径 + @TableField("paths") + private String paths; + + // 组件 + @TableField("component") + private String component; + + // 是否缓存 + @TableField("is_cache") + private Integer isCache; + + // + @TableField("is_show") + private Integer isShow; + + // + @TableField("is_disable") + private Integer isDisable; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + private LocalDateTime updateTime; + + // 是否打开新页面 默认为false + private Boolean openNewPage; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Model.java b/src/main/java/com/biutag/supervision/pojo/entity/Model.java new file mode 100644 index 0000000..5caefa4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Model.java @@ -0,0 +1,78 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class Model { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("model_name") + private String modelName; + + private Integer classId; + + // + @TableField("icon") + private String icon; + + // + @TableField("remarks") + private String remarks; + + // 分发方式 + @TableField("distribution_method") + private String distributionMethod; + + // + @TableField("distribution_cycle") + private String distributionCycle; + + // + @TableField("time_limit") + private String timeLimit; + + // + @TableField("max_sign_duration") + private Integer maxSignDuration; + + // + @TableField("max_handle_duration") + private Integer maxHandleDuration; + + // + @TableField("max_extension_duration") + private Integer maxExtensionDuration; + + // + @TableField("distribution_flow") + private String distributionFlow; + + // + @TableField("approval_flow") + private String approvalFlow; + + // + @TableField("create_time") + private LocalDateTime createTime; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + @TableField("update_time") + private LocalDateTime updateTime; + + private String createDepartId; + + private String createDepartName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClass.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClass.java new file mode 100644 index 0000000..ddcab72 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClass.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class ModelClass { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("name") + private String name; + + // + @TableField("sort") + private Integer sort; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegDepartAuthority.java b/src/main/java/com/biutag/supervision/pojo/entity/NegDepartAuthority.java new file mode 100644 index 0000000..1294186 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegDepartAuthority.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegDepartAuthority { + + // 身份证号 + @TableField("idCode") + private String idCode; + + // 可查看的部门 + @TableField("departId") + private String departId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java b/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java new file mode 100644 index 0000000..7440624 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegSourceAuthority { + + // 身份证号 + @TableField("idCode") + private String idCode; + + // 可查看的来源 + private String source; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java new file mode 100644 index 0000000..b53edbe --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -0,0 +1,251 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class Negative { + + // + @TableId + private String id; + + // 样本来源编号 + @TableField("originId") + private String originId; + + // 编号 + @TableField("serialNumber") + private String serialNumber; + + // 问题发生时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + @TableField("happenTime") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + @TableField("discoveryTime") + private LocalDateTime discoveryTime; + + // 问题来源code + @TableField("problemSourcesCode") + private String problemSourcesCode; + + // 问题来源 + @TableField("problemSources") + private String problemSources; + + // 联系电话 + @TableField("contactPhone") + private String contactPhone; + + // 反映人姓名 + @TableField("responderName") + private String responderName; + + // 反映人部门id + @TableField("responderDepartId") + private String responderDepartId; + + // 反映人部门名称 + @TableField("responderDepartName") + private String responderDepartName; + + // 涉及人身份证 + @TableField("responderIdCard") + private String responderIdCard; + + // 业务类型 + @TableField("businessTypeCode") + private String businessTypeCode; + + // 业务类别名称 + @TableField("businessTypeName") + private String businessTypeName; + + // 涉嫌问题JSON + @TableField("involveProblem") + private String involveProblem; + + // 涉及警种名称 + @TableField("policeTypeName") + private String policeTypeName; + + // 涉及警种 + @TableField("policeType") + private String policeType; + + // 涉及单位名称 + @TableField("involveDepartName") + private String involveDepartName; + + // 涉及单位 + @TableField("involveDepartId") + private String involveDepartId; + + // 简要描述 + @TableField("thingDesc") + private String thingDesc; + + // 填写人姓名 + @TableField("fillName") + private String fillName; + + // 填写人部门id + @TableField("fillDepartId") + private String fillDepartId; + + // 填写人部门名称 + @TableField("fillDeaprtName") + private String fillDeaprtName; + + // 审核人姓名 + @TableField("checkName") + private String checkName; + + // 审核人身份证 + @TableField("checkIdCode") + private String checkIdCode; + + // + @TableField("crtTime") + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime crtTime; + + // + @TableField("updName") + private String updName; + + // + @TableField("updUser") + private String updUser; + + // + @TableField("updTime") + private LocalDateTime updTime; + + // 0 正常 1 禁用 + @TableField("status") + private String status; + + // + @TableField("remark") + private String remark; + + // 预留 + @TableField("reserve") + private String reserve; + + // 核查情况 + @TableField("checkStatus") + private String checkStatus; + + // 核查情况 + @TableField("checkStatusName") + private String checkStatusName; + + // 完善状态 0 -- 待完善 1 -- 已完善 + @TableField("completeStatus") + private String completeStatus; + + // 最后编辑人员 + @TableField("lastEditName") + private String lastEditName; + + // + @TableField("taskId") + private String taskId; + + // + @TableField("supervisionSubjectCode") + private String supervisionSubjectCode; + + // + @TableField("supervisionSubjectName") + private String supervisionSubjectName; + + // 是否整改 + @TableField("isRectifyCode") + private String isRectifyCode; + + // 是否整改 + @TableField("isRectifyName") + private String isRectifyName; + + // 办结时间 + @TableField("completeDate") + private LocalDateTime completeDate; + + //--------------------------------------------- + + private String flowKey; + + // 主办层级 + private String hostLevel; + + // 办理时限 + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + private String approvalFlow; + + // 问题核查情况 + private String checkStatusDesc; + + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + private String accountabilityTarget; + + // 办理状态 + private String processingStatus; + + // 延期申请ID + private Integer negativeExtensionApplyId; + + // 是否能申请延期 true = 能 false = 不能 + private Boolean extensionApplyFlag; + + // 延期天数 + private Integer extensionDays; + + // 市局下发时间 + private LocalDateTime firstDistributeTime; + + // 是否是二级机构办理 true=是 false=否 + private Boolean isSecondHandle; + + private String handleSecondDepartId; + + private String handleSecondDepartName; + + private String handleThreeDepartId; + + private String handleThreeDepartName; + + private String caseNumber; + + // 办理超时(秒) + private Long handleTimeout; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeApprove.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeApprove.java new file mode 100644 index 0000000..e92d62f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeApprove.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeApprove { + + // + @TableId(type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("state") + private String state; + + private String handlerDepartId; + + // + @TableField("handler_depart_name") + private String handlerDepartName; + + private String handlerUserName; + + // + @TableField("handler_name") + private String handlerName; + + // 审批意见 + @TableField("comments") + private String comments; + + // + @TableField("create_time") + private LocalDateTime createTime; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + private String actionKey; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java new file mode 100644 index 0000000..421115d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java @@ -0,0 +1,240 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeBlame { + + // + @TableId("blameId") + private String blameId; + + // + @TableField("negativeId") + private String negativeId; + + // 核实人员 + @TableField("blameFlag") + private String blameFlag; + + // 涉及人员 + @TableField("involveFlag") + private String involveFlag; + + // 涉及姓名 + @TableField("blameName") + private String blameName; + + // 涉及身份证 + @TableField("blameIdCode") + private String blameIdCode; + + // 涉及警号 + @TableField("blameEmpNo") + private String blameEmpNo; + + // 涉及部门 + @TableField("blameDepartId") + private String blameDepartId; + + // 涉及人部门名称 + @TableField("blameDepartName") + private String blameDepartName; + + // 人员属性 + @TableField("ivPersonType") + private String ivPersonType; + + // 人员属性 + @TableField("ivPersonTypeCode") + private String ivPersonTypeCode; + + // 二级机构 + @TableField("twoLevelDapartId") + private String twoLevelDapartId; + + // 二级机构 + @TableField("twoLevelDapartName") + private String twoLevelDapartName; + + // 三级机构 + @TableField("threeLevelDapartName") + private String threeLevelDapartName; + + // 三级机构 + @TableField("threeLevelDapart") + private String threeLevelDapart; + + // 警种 + @TableField("policeTypeName") + private String policeTypeName; + + // 警种 + @TableField("policeTypeCode") + private String policeTypeCode; + + // 核查情况code + @TableField("inspectCaseCode") + private String inspectCaseCode; + + // 核查情况 + @TableField("inspectCaseName") + private String inspectCaseName; + + // 督察措施 + @TableField("superviseMeasuresCode") + private String superviseMeasuresCode; + + // 督察措施 + @TableField("superviseMeasuresName") + private String superviseMeasuresName; + + // 主观方面 + @TableField("subjectiveAspectCode") + private String subjectiveAspectCode; + + // 主观方面 + @TableField("subjectiveAspectName") + private String subjectiveAspectName; + + // 责任类别 + @TableField("responsibilityTypeCode") + private String responsibilityTypeCode; + + // 责任类别 + @TableField("responsibilityTypeName") + private String responsibilityTypeName; + + // 处理结果 + @TableField("handleResultCode") + private String handleResultCode; + + // 处理结果 + @TableField("handleResultName") + private String handleResultName; + + // 维权容错 + @TableField("protectRightsCode") + private String protectRightsCode; + + // 维权容错 + @TableField("protectRightsName") + private String protectRightsName; + + // 帮扶对象 + @TableField("assistCaseCode") + private String assistCaseCode; + + // 帮扶对象 + @TableField("assistCaseName") + private String assistCaseName; + + // 帮扶结束时间 + @TableField("assistEndTime") + private LocalDateTime assistEndTime; + + // 帮扶开始时间 + @TableField("assistStartTime") + private LocalDateTime assistStartTime; + + // 责任领导 + @TableField("leadName") + private String leadName; + + // 责任领导身份证 + @TableField("leadIdCode") + private String leadIdCode; + + // 责任领导部门 + @TableField("leadDepartName") + private String leadDepartName; + + // 责任领导部门id + @TableField("leadDepartId") + private String leadDepartId; + + // 二级机构 + @TableField("leadTwoDepartId") + private String leadTwoDepartId; + + // 二级机构 + @TableField("leadTwoDepartName") + private String leadTwoDepartName; + + // 三级机构 + @TableField("leadThreeDepartId") + private String leadThreeDepartId; + + // 三级机构 + @TableField("leadThreeDepartName") + private String leadThreeDepartName; + + // 领导督察措施 + @TableField("leadMeasuresName") + private String leadMeasuresName; + + // 领导督察措施 + @TableField("leadMeasuresCode") + private String leadMeasuresCode; + + // 领导责任类别 + @TableField("leadResponsibilityTypeName") + private String leadResponsibilityTypeName; + + // 领导责任类别 + @TableField("leadResponsibilityTypeCode") + private String leadResponsibilityTypeCode; + + // 领导处理结果 + @TableField("leadHandleResultCode") + private String leadHandleResultCode; + + // 领导处理结果 + @TableField("leadHandleResultName") + private String leadHandleResultName; + + // 领导维权容错 + @TableField("leadProtectRightsName") + private String leadProtectRightsName; + + // 领导维权容错 + @TableField("leadProtectRightsCode") + private String leadProtectRightsCode; + + // 统计人员类型 1 民警 2 其他 + @TableField("statisticsPersonType") + private String statisticsPersonType; + + // + @TableField("crtTime") + private LocalDateTime crtTime; + + // + @TableField("updTime") + private LocalDateTime updTime; + + // + @TableField("status") + private String status; + + // + @TableField("crtUser") + private String crtUser; + + // + @TableField("updUser") + private String updUser; + + // 涉及类型 + private String type; + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeExtensionApply.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeExtensionApply.java new file mode 100644 index 0000000..3e1ca9c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeExtensionApply.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeExtensionApply { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("handler_depart_id") + private String handlerDepartId; + + // + @TableField("handler_depart_name") + private String handlerDepartName; + + // + @TableField("handler_user_name") + private String handlerUserName; + + // + @TableField("handler_name") + private String handlerName; + + // 延期理由 + @TableField("comments") + private String comments; + + // 延期天数 + @TableField("extension_days") + private Integer extensionDays; + + // + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeExtensionApprove.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeExtensionApprove.java new file mode 100644 index 0000000..358c283 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeExtensionApprove.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeExtensionApprove { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("negative_extension_apply_id") + private Integer negativeExtensionApplyId; + + // + @TableField("handler_depart_id") + private String handlerDepartId; + + // + @TableField("handler_depart_name") + private String handlerDepartName; + + // + @TableField("handler_user_name") + private String handlerUserName; + + // + @TableField("handler_name") + private String handlerName; + + // 审批意见/驳回理由 + @TableField("comments") + private String comments; + + // + @TableField("state") + private String state; + + // + @TableField("action_key") + private String actionKey; + + // + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeFav.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeFav.java new file mode 100644 index 0000000..b26ffbf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeFav.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeFav { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("user_id") + private String userId; + + // + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeFile.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeFile.java new file mode 100644 index 0000000..8dd298e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeFile.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeFile { + + // + @TableId(value = "id") + private String id; + + // + @TableField("fileId") + private String fileId; + + // + @TableField("filePath") + private String filePath; + + // + @TableField("negtiveId") + private String negtiveId; + + // + @TableField("type") + private String type; + + // + @TableField("crtTime") + private LocalDateTime crtTime; + + // + @TableField("crtUser") + private String crtUser; + + // + @TableField("fileName") + private String fileName; + + // + @TableField("status") + private String status; + + private Integer fileClassId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java new file mode 100644 index 0000000..8d9d49c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeHistory { + + // + @TableId("historyId") + private String historyId; + + // 组名 + @TableField("dataJson") + private String dataJson; + + // 类型 + @TableField("negativeId") + private String negativeId; + + // 创建时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + @TableField("crtTime") + private LocalDateTime crtTime; + + // 创建人 + @TableField("crtUser") + private String crtUser; + + // + @TableField("crtUserName") + private String crtUserName; + + // + @TableField("crtName") + private String crtName; + + private String actionName; + + private String departName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java new file mode 100644 index 0000000..2ede19e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeProblemRelation { + + // + @TableId + private String id; + + // 清单id + @TableField("negativeId") + private String negativeId; + + // 关联涉及人 + @TableField("blameId") + private String blameId; + + // + @TableField("oneLevelCode") + private String oneLevelCode; + + // + @TableField("twoLevelCode") + private String twoLevelCode; + + // + @TableField("oneLevelContent") + private String oneLevelContent; + + // + @TableField("twoLevelContent") + private String twoLevelContent; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java new file mode 100644 index 0000000..a2f7447 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java @@ -0,0 +1,52 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeSignReturn { + + // + @TableId + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("handler_depart_id") + private String handlerDepartId; + + // + @TableField("handler_depart_name") + private String handlerDepartName; + + // + @TableField("handler_user_name") + private String handlerUserName; + + // + @TableField("handler_name") + private String handlerName; + + // 审批意见 + @TableField("comments") + private String comments; + + // + @TableField("action_key") + private String actionKey; + + // + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeThingFile.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeThingFile.java new file mode 100644 index 0000000..33f5966 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeThingFile.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeThingFile { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // 文件名称 + @TableField("file_name") + private String fileName; + + // 文件路径 + @TableField("file_path") + private String filePath; + + // + @TableField("type") + private String type; + + // + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeWork.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeWork.java new file mode 100644 index 0000000..6ac4124 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeWork.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeWork { + + // + @TableId(type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("depart_id") + private String departId; + + private String departName; + + // 角色编码 + @TableField("role_code") + private String roleCode; + + // 问题来源 + private String problemSourcesCode; + + private String status; + + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + private LocalDateTime updateTime; + + private String flowKey; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RoleMenu.java b/src/main/java/com/biutag/supervision/pojo/entity/RoleMenu.java new file mode 100644 index 0000000..86df6a5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RoleMenu.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class RoleMenu { + + @TableId(type = IdType.AUTO) + private Integer id; + + private String roleCode; + + private Integer menuId; + + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java new file mode 100644 index 0000000..f99f899 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java @@ -0,0 +1,82 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDepart { + + // + @TableId + private String id; + + // + @TableField("type") + private String type; + + // + @TableField("category") + private String category; + + // + @TableField("code") + private String code; + + // + @TableField("name") + private String name; + + // + @TableField("short_name") + private String shortName; + + // + @TableField("domain_name") + private String domainName; + + // + @TableField("pid") + private String pid; + + // + @TableField("level") + private Integer level; + + // + @TableField("path_trace") + private String pathTrace; + + // + @TableField("is_hide") + private String isHide; + + // + @TableField("status") + private String status; + + // + @TableField("order_no") + private Integer orderNo; + + // + @TableField("version") + private String version; + + // + @TableField("status_updated_at") + private String statusUpdatedAt; + + // + @TableField("created_at") + private String createdAt; + + // + @TableField("updated_at") + private String updatedAt; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictContent.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictContent.java new file mode 100644 index 0000000..e263e88 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictContent.java @@ -0,0 +1,86 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictContent { + + @TableId(type = IdType.AUTO) + private Integer id; + + // 类型名称 + @TableField("name") + private String name; + + // 类型编码 + @TableField("code") + private String code; + + // 父级code + @TableField("parent_code") + private String parentCode; + + // 状态 + @TableField("status") + private String status; + + // 备注 + @TableField("remark") + private String remark; + + // 祖级列表 + @TableField("ancestors") + private String ancestors; + + // + @TableField("level") + private Integer level; + + // 排序 + @TableField("sort") + private Integer sort; + + @TableField("crt_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private LocalDateTime crtTime; + + @TableField("crt_user") + private String crtUser; + + // 创建单位 + @TableField("crt_depart_id") + private String crtDepartId; + + @TableField("crt_name") + private String crtName; + + @TableField("crt_host") + private String crtHost; + + // + @TableField("upd_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private LocalDateTime updTime; + + // + @TableField("upd_user") + private String updUser; + + // + @TableField("upd_name") + private String updName; + + // + @TableField("upd_host") + private String updHost; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictData.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictData.java new file mode 100644 index 0000000..69aa063 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictData.java @@ -0,0 +1,73 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictData { + + // 字典编码 + @TableId(type = IdType.AUTO) + private Integer dictCode; + + // 字典排序 + @TableField("dict_sort") + private Integer dictSort; + + // 字典标签 + @TableField("dict_label") + private String dictLabel; + + // 字典键值 + @TableField("dict_value") + private String dictValue; + + // 字典类型 + @TableField("dict_type") + private String dictType; + + // 样式属性(其他样式扩展) + @TableField("css_class") + private String cssClass; + + // 表格回显样式 + @TableField("list_class") + private String listClass; + + // 是否默认(1是 0否) + @TableField("is_default") + private String isDefault; + + // 状态(0正常 1停用) + @TableField("status") + private String status; + + // 创建者 + @TableField("create_by") + private String createBy; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新者 + @TableField("update_by") + private String updateBy; + + // 更新时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 备注 + @TableField("remark") + private String remark; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictType.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictType.java new file mode 100644 index 0000000..033e2a8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictType.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictType { + + // 字典主键 + @TableId(type = IdType.AUTO) + private Long dictId; + + // 字典名称 + @TableField("dict_name") + private String dictName; + + // 字典类型 + @TableField("dict_type") + private String dictType; + + // 状态(0正常 1停用) + @TableField("status") + private String status; + + // 创建者 + @TableField("create_by") + private String createBy; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新者 + @TableField("update_by") + private String updateBy; + + // 更新时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 备注 + @TableField("remark") + private String remark; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java new file mode 100644 index 0000000..5b21b83 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java @@ -0,0 +1,123 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupPolice { + + + // + @TableId + private String id; + + // 账号id + @TableField("account_id") + private String accountId; + + // + @TableField("district_id") + private String districtId; + + // 组织机构id + @TableField("org_id") + private String orgId; + + // 警号 + @TableField("emp_no") + private String empNo; + + // + @TableField("job") + private String job; + + // 职位类型 + @TableField("job_type") + private String jobType; + + // + @TableField("manager_id") + private String managerId; + + // 电话 + @TableField("phone") + private String phone; + + // + @TableField("fax_no") + private String faxNo; + + // + @TableField("post_title") + private String postTitle; + + // 工作地址 + @TableField("work_address") + private String workAddress; + + // 账号 + @TableField("account") + private String account; + + // 手机号 + @TableField("mobile") + private String mobile; + + // + @TableField("email") + private String email; + + // 身份证 + @TableField("id_code") + private String idCode; + + // 名称 + @TableField("display_name") + private String displayName; + + // 姓名 + @TableField("name") + private String name; + + // + @TableField("gender") + private String gender; + + // + @TableField("birthday") + private String birthday; + + // + @TableField("avatar_url") + private String avatarUrl; + + // + @TableField("status") + private String status; + + // + @TableField("hired_at") + private String hiredAt; + + // + @TableField("created_at") + private String createdAt; + + // + @TableField("updated_at") + private String updatedAt; + + // 类型 0 原始数据 1 协警 2 文员 3 临时工 + @TableField("type") + private String type; + + // + @TableField("person_status") + private String personStatus; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/User.java b/src/main/java/com/biutag/supervision/pojo/entity/User.java new file mode 100644 index 0000000..e1e2269 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/User.java @@ -0,0 +1,59 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class User { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("certificate_num") + private String certificateNum; + + // + @TableField("cert_eff_date") + private String certEffDate; + + // + @TableField("cert_exp_date") + private String certExpDate; + + // + @TableField("certificate_type") + private String certificateType; + + // + @TableField("name") + private String name; + + // + @TableField("phone") + private String phone; + + // + @TableField("real_lvl") + private String realLvl; + + // + @TableField("sex") + private String sex; + + // + @TableField("user_type") + private String userType; + + // + @TableField("yxd_id") + private String yxdId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeFavModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeFavModel.java new file mode 100644 index 0000000..00537e7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeFavModel.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeFavModel { + + private String negativeId; + + private String originId; + + // 问题发生时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + private String problemSources; + + // 问题内容 + private String thingDesc; + + // 联系电话 + private String contactPhone; + + // 业务类型 + private String businessTypeCode; + + // 业务类别名称 + private String businessTypeName; + + // 涉及警种名称 + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉及单位名称 + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + // 部门ID(工作表) + private String workDepartId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java new file mode 100644 index 0000000..8764bf9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java @@ -0,0 +1,87 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeWorkModel { + + private Integer id; + + private String negativeId; + + private String originId; + + // 问题发生时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + private String problemSources; + + // 问题内容 + private String thingDesc; + + // 联系电话 + private String contactPhone; + + private String responderName; + + // 业务类型 + private String businessTypeCode; + + // 业务类别名称 + private String businessTypeName; + + // 涉及警种名称 + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉及单位名称 + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + // 部门ID(工作表) + private String workDepartId; + + // 办理状态 + private String processingStatus; + + private String flowKey; + + // 市局下发时间 + private LocalDateTime firstDistributeTime; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 延期天数 + private Integer extensionDays; + + // 办理剩余时长 + private Long remainingDuration; + + private String handleSecondDepartId; + + private String handleSecondDepartName; + + private String handleThreeDepartId; + + private String handleThreeDepartName; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java new file mode 100644 index 0000000..855afbc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java @@ -0,0 +1,78 @@ +package com.biutag.supervision.pojo.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class PoliceModel { + + private String id; + + // 账号id + private String accountId; + + private String districtId; + + // 组织机构id + private String orgId; + + // 警号 + private String empNo; + + private String job; + + // 职位类型 + private String jobType; + + private String managerId; + + // 电话 + private String phone; + + private String faxNo; + + private String postTitle; + + // 工作地址 + private String workAddress; + + // 账号 + private String account; + + // 手机号 + private String mobile; + + // + private String email; + + // 身份证 + private String idCode; + + // 名称 + private String displayName; + + // 姓名 + @TableField("name") + private String name; + + private String gender; + + private String birthday; + + private String avatarUrl; + + private String status; + + // 类型 0 原始数据 1 协警 2 文员 3 临时工 + private String type; + + private String personStatus; + + // 组织机构名称 + private String departName; + + private String departShortName; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java new file mode 100644 index 0000000..14a828c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class UserAuth implements Serializable { + + private String userId; + + private String userName; + + private String userType; + + private String nickName; + + private String departId; + + private String departName; + + // 角色编号 + private List roleCodes; + + // 权限(问题来源) + private List authSources; + + private List authDepartIds; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/UserModel.java b/src/main/java/com/biutag/supervision/pojo/model/UserModel.java new file mode 100644 index 0000000..a29c3c7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/UserModel.java @@ -0,0 +1,48 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.List; + +@Setter +@Getter +public class UserModel { + + private String userId; + + // 登陆账号 + private String userName; + + // 昵称 + private String nickName; + + // 头像 + private String avatar; + + // 邮箱 + private String email; + + // 手机号 + private String mobile; + + // 用户类型:super-超级管理员 normal-普通管理员 + private String userType; + + // 描述 + private String userDesc; + + // 更新时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + // 状态:0-禁用 1-正常 2-锁定 + private Integer status; + + private List roleIds; + + private List roleNames; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java new file mode 100644 index 0000000..0547381 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DepartTreeListParam { + + private String pid; + + private String shortName; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/ModelQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ModelQueryParam.java new file mode 100644 index 0000000..a4651ac --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ModelQueryParam.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ModelQueryParam { + + private Long current = 1L; + + private Long size = 9L; + + private String modelName; + + private String distributionMethod; + + private Integer classId; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java new file mode 100644 index 0000000..9b5c797 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Setter +@Getter +public class NegativeQueryParam { + + private long current = 1; + private long size = 10; + private String originId; + + // 问题发生时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List happenTime = new ArrayList<>(); + + // 问题发现时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List discoveryTime = new ArrayList<>(); + + private String responderKey; + + private String responderValue; + + private String flowKey; + + // 办理状态 + private List processingStatus = new ArrayList<>(); + + private String thingDesc; + + private String problemSourcesCode; + + private String businessTypeCode; + + private String checkStatus; + + private String isRectifyCode; + + // 是否超时 + private Boolean timeoutFlag; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java new file mode 100644 index 0000000..65d8acd --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class PoliceQueryParam { + + private long current = 1; + private long size = 10; + private String name; + private String empNo; + private String idCode; + private String phone; + private String departId; + // 当前单位及其所有子单位 + private Boolean departBranch; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/RoleQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RoleQueryParam.java new file mode 100644 index 0000000..c897e44 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/RoleQueryParam.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class RoleQueryParam { + + private String roleName; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java new file mode 100644 index 0000000..79340a1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class UserQueryParam { + + private long current = 1; + private long size = 10; + private String userName; + private String nickName; + private List roleId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java b/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java new file mode 100644 index 0000000..946acb2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Setter +@Getter +public class WorkParam { + + private long current = 1; + private long size = 10; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List happenTime = new ArrayList<>(); + private String problemSourcesCode; + private String businessTypeCode; + private String involveProblem; + private String thingDesc; + private String involveDepartId; + private String handleThreeDepartId; + private String processingStatus; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java new file mode 100644 index 0000000..1b28c47 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DepartTree { + + private String id; + + private String pid; + + private String type; + + private String category; + + private String code; + + private String name; + + private String shortName; + + private Integer level; + + private String status; + + private Integer orderNo; + + private List children = new ArrayList<>(); + + private boolean hasChildren = false; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java new file mode 100644 index 0000000..e844c28 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java @@ -0,0 +1,43 @@ +package com.biutag.supervision.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DictContentTree { + + private Integer id; + + // 类型名称 + private String name; + + // 类型编码 + private String code; + + // 父级code + private String parentCode; + + // 状态 + private String status; + + // 备注 + private String remark; + + + // + private Integer level; + + // 排序 + private Integer sort; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + private LocalDateTime updTime; + + private List children = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java b/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java new file mode 100644 index 0000000..10b8576 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class FileVo { + + private String filePath; + + private String fileName; + + private Integer fileClassId; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/MenuTree.java b/src/main/java/com/biutag/supervision/pojo/vo/MenuTree.java new file mode 100644 index 0000000..0350ebd --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/MenuTree.java @@ -0,0 +1,67 @@ +package com.biutag.supervision.pojo.vo; + +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.pojo.entity.Menu; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.beans.BeanUtils; + +import java.time.LocalDateTime; +import java.util.List; + +@Setter +@Getter +public class MenuTree { + + private Integer id; + + private Integer pid; + + // 菜单类型 + private String menuType; + + // 菜单名称 + private String menuName; + + // 菜单图标 + private String icon; + + // 路径 + private String paths; + + private String component; + + // 排序 + private Integer menuSort; + + private String perms; + + private Integer isCache; + + private Integer isShow; + + private Integer isDisable; + + // 是否打开新页面 默认为false + private Boolean openNewPage; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + private List children; + + public static List buildTree(List list) { + return buildTree(list, AppConstants.MENU_ROOT_ID); + } + + public static List buildTree(List list, Integer pid) { + return list.stream().filter(item -> pid.equals(item.getPid())).map(item -> { + MenuTree menuTree = new MenuTree(); + BeanUtils.copyProperties(item, menuTree); + menuTree.setChildren(buildTree(list, item.getId())); + return menuTree; + }).toList(); + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java b/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java new file mode 100644 index 0000000..1f48a52 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java @@ -0,0 +1,182 @@ +package com.biutag.supervision.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeQueryVo { + + private String id; + + // 样本来源编号 + private String originId; + + // 编号 + private String serialNumber; + + // 问题发生时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源code + private String problemSourcesCode; + + // 问题来源 + private String problemSources; + + // 联系电话 + private String contactPhone; + + // 反映人姓名 + private String responderName; + + // 反映人部门id + private String responderDepartId; + + // 反映人部门名称 + private String responderDepartName; + + // 涉及人身份证 + private String responderIdCard; + + // 业务类型 + private String businessTypeCode; + + // 业务类别名称 + private String businessTypeName; + + // 涉嫌问题JSON + private String involveProblem; + + // 涉及警种名称 + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉及单位名称 + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + // 简要描述 + private String thingDesc; + + + // 审核人姓名 + private String checkName; + + // 审核人身份证 + private String checkIdCode; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime crtTime; + + + private LocalDateTime updTime; + + // 0 正常 1 禁用 + private String status; + + private String remark; + + + // 核查情况 + private String checkStatus; + + // 核查情况 + private String checkStatusName; + + // 完善状态 0 -- 待完善 1 -- 已完善 + private String completeStatus; + + + private String supervisionSubjectCode; + + private String supervisionSubjectName; + + // 是否整改 + private String isRectifyCode; + + // 是否整改 + private String isRectifyName; + + // 办结时间 + private LocalDateTime completeDate; + + //--------------------------------------------- + + private String flowKey; + + // 主办层级 + private String hostLevel; + + // 办理时限 + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + private String approvalFlow; + + // 问题核查情况 + private String checkStatusDesc; + + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + private String accountabilityTarget; + + // 办理状态 + private String processingStatus; + + // 延期申请ID + private Integer negativeExtensionApplyId; + + // 是否能申请延期 true = 能 false = 不能 + private Boolean extensionApplyFlag; + + // 延期天数 + private Integer extensionDays; + + // 市局下发时间 + private LocalDateTime firstDistributeTime; + + // 是否是二级机构办理 true=是 false=否 + private Boolean isSecondHandle; + + private String handleSecondDepartId; + + private String handleSecondDepartName; + + private String handleThreeDepartId; + + private String handleThreeDepartName; + + private String caseNumber; + + // 办理剩余时长 + private Long remainingDuration; + + // 办理超时(秒) + private Long handleTimeout; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/Route.java b/src/main/java/com/biutag/supervision/pojo/vo/Route.java new file mode 100644 index 0000000..2eec120 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/Route.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class Route { + + private String path; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TokenVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TokenVo.java new file mode 100644 index 0000000..d8cc323 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/TokenVo.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.pojo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class TokenVo { + + private String token; +} diff --git a/src/main/java/com/biutag/supervision/service/BaseAccountService.java b/src/main/java/com/biutag/supervision/service/BaseAccountService.java new file mode 100644 index 0000000..2a9af0b --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseAccountService.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BaseAccount; +import com.biutag.supervision.mapper.BaseAccountMapper; +import org.springframework.stereotype.Service; + +@Service +public class BaseAccountService extends ServiceImpl { + + public BaseAccount getByAccount(String account) { + return getOne(new LambdaQueryWrapper().eq(BaseAccount::getAccount, account)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/BaseRoleService.java b/src/main/java/com/biutag/supervision/service/BaseRoleService.java new file mode 100644 index 0000000..3ea8d9d --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseRoleService.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.mapper.BaseRoleMapper; +import com.biutag.supervision.pojo.entity.BaseRoleUser; +import com.biutag.supervision.pojo.param.RoleQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class BaseRoleService extends ServiceImpl { + + private final BaseRoleUserService roleUserService; + + public List listByUserId(String userId) { + List baseRoleUsers = roleUserService.listByUserId(userId); + return listByIds(baseRoleUsers.stream().map(BaseRoleUser::getRoleId).toList()); + } + + public List list(RoleQueryParam roleQueryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(roleQueryParam.getRoleName()), BaseRole::getRoleName, roleQueryParam.getRoleName()); + return list(queryWrapper); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/BaseRoleUserService.java b/src/main/java/com/biutag/supervision/service/BaseRoleUserService.java new file mode 100644 index 0000000..11e48f2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseRoleUserService.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.pojo.entity.BaseRoleUser; +import com.biutag.supervision.mapper.BaseRoleUserMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class BaseRoleUserService extends ServiceImpl { + + public List listByUserId(String userId) { + return list(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + } + + public boolean remove(String userId) { + return remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/BaseUserService.java b/src/main/java/com/biutag/supervision/service/BaseUserService.java new file mode 100644 index 0000000..6593f88 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseUserService.java @@ -0,0 +1,85 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.UserDto; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.pojo.entity.BaseRoleUser; +import com.biutag.supervision.pojo.entity.BaseUser; +import com.biutag.supervision.mapper.BaseUserMapper; +import com.biutag.supervision.pojo.model.UserModel; +import com.biutag.supervision.pojo.param.UserQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class BaseUserService extends ServiceImpl { + + private final BaseRoleUserService roleUserService; + + private final BaseRoleService roleService; + + public Page page(UserQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(queryParam.getUserName()), BaseUser::getUserName, queryParam.getUserName()) + .like(StrUtil.isNotBlank(queryParam.getNickName()), BaseUser::getNickName, queryParam.getNickName()); + Page baseUserPage = page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + if (baseUserPage.getRecords().isEmpty()) { + return new Page().setRecords(new ArrayList<>()).setTotal(0); + } + List roleUsers = roleUserService.list(new LambdaQueryWrapper() + .in(BaseRoleUser::getUserId, baseUserPage.getRecords().stream().map(BaseUser::getUserId).toList())); + List roleList; + if (!roleUsers.isEmpty()) { + roleList = roleService.listByIds(roleUsers.stream().map(BaseRoleUser::getRoleId).collect(Collectors.toSet())); + } else { + roleList = new ArrayList<>(); + } + List records = baseUserPage.getRecords().stream().map(item -> { + UserModel userModel = new UserModel(); + BeanUtils.copyProperties(item, userModel); + List roleIds = roleUsers.stream().filter(roleUser -> item.getUserId().equals(roleUser.getUserId())).map(BaseRoleUser::getRoleId).toList(); + userModel.setRoleIds(roleIds); + List roleNames = roleList.stream().filter(role -> roleIds.contains(role.getRoleId())).map(BaseRole::getRoleName).toList(); + userModel.setRoleNames(roleNames); + return userModel; + }).toList(); + return new Page().setRecords(records).setTotal(baseUserPage.getTotal()); + } + + public BaseUser getByUserName(String userName) { + return getOne(new LambdaQueryWrapper().eq(BaseUser::getUserName, userName)); + } + + @DS("slave") + public boolean update(UserDto userDto) { + BaseUser baseUser = new BaseUser(); + BeanUtils.copyProperties(userDto, baseUser); + baseUser.setUpdateTime(LocalDateTime.now()); + if (!userDto.getRoleIds().isEmpty()) { + roleUserService.remove(userDto.getUserId()); + roleUserService.saveBatch(userDto.getRoleIds().stream().map(roleId -> { + BaseRoleUser baseRoleUser = new BaseRoleUser(); + baseRoleUser.setUserId(userDto.getUserId()); + baseRoleUser.setRoleId(roleId); + baseRoleUser.setCreateTime(LocalDateTime.now()); + baseRoleUser.setUpdateTime(LocalDateTime.now()); + return baseRoleUser; + }).toList()); + } + return updateById(baseUser); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java b/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java new file mode 100644 index 0000000..08cb2db --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.dto.DataPetitionComplaintDto; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.mapper.DataPetitionComplaintMapper; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class DataPetitionComplaintService extends ServiceImpl { + + public boolean save(DataPetitionComplaintDto dto) { + DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); + BeanUtil.copyProperties(dto, dataPetitionComplaint); + dataPetitionComplaint.setCrtTime(LocalDateTime.now()); + dataPetitionComplaint.setUpdTime(LocalDateTime.now()); + return save(dataPetitionComplaint); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/FlowActionService.java b/src/main/java/com/biutag/supervision/service/FlowActionService.java new file mode 100644 index 0000000..61177c4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FlowActionService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.FlowAction; +import com.biutag.supervision.mapper.FlowActionMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FlowActionService extends ServiceImpl { + + public List list(String flowKey) { + return list(new LambdaQueryWrapper().eq(FlowAction::getFlowKey, flowKey).orderByAsc(FlowAction::getSort)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/FlowNodeService.java b/src/main/java/com/biutag/supervision/service/FlowNodeService.java new file mode 100644 index 0000000..7f20d88 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FlowNodeService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.FlowNode; +import com.biutag.supervision.mapper.FlowNodeMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FlowNodeService extends ServiceImpl { + + public List listAll() { + return list(new LambdaUpdateWrapper().orderByAsc(FlowNode::getFlowSort)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/HolidayService.java b/src/main/java/com/biutag/supervision/service/HolidayService.java new file mode 100644 index 0000000..2dfb0e6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/HolidayService.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.HolidayMapper; +import com.biutag.supervision.pojo.entity.Holiday; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +@Slf4j +@RequiredArgsConstructor +@Service +public class HolidayService extends ServiceImpl { + + private final RedisTemplate redisTemplate; + + public boolean isHoliday(String date) { + long l = System.currentTimeMillis(); + Boolean result = (Boolean) redisTemplate.opsForValue().get(String.format("holiday:%s", date)); + if (Objects.nonNull(result)) { + System.out.println(String.format("查询节假日耗时:%sms", System.currentTimeMillis() - l)); + return result; + } + Holiday holiday = getOne(new LambdaUpdateWrapper().eq(Holiday::getDate, date)); + if (Objects.isNull(holiday)) { + log.error("节假日 {} 数据未找到"); + return false; + } + redisTemplate.opsForValue().set(String.format("holiday:%s", date), holiday.getFlag()); + System.out.println(String.format("查询节假日耗时(sql):%sms", System.currentTimeMillis() - l)); + return holiday.getFlag(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/MenuService.java b/src/main/java/com/biutag/supervision/service/MenuService.java new file mode 100644 index 0000000..5c30bd5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/MenuService.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.MenuEnum; +import com.biutag.supervision.pojo.entity.Menu; +import com.biutag.supervision.mapper.MenuMapper; +import com.biutag.supervision.pojo.entity.RoleMenu; +import com.biutag.supervision.pojo.model.UserAuth; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class MenuService extends ServiceImpl { + + private final RoleMenuService roleMenuService; + + public List listAll() { + return list(new LambdaQueryWrapper() + .in(Menu::getMenuType, Arrays.asList(MenuEnum.CATALOGUE.value(), MenuEnum.MENU.value())) + .orderByAsc(Menu::getMenuSort)); + } + + public List listMenuByCurrentUser() { + UserAuth user = UserContextHolder.getCurrentUser(); + if (user.getRoleCodes().isEmpty()) { + return new ArrayList<>(); + } + List roleMenus = roleMenuService.list(user.getRoleCodes()); + if (roleMenus.isEmpty()) { + return new ArrayList<>(); + } + return list(new LambdaQueryWrapper() + .in(Menu::getMenuType, Arrays.asList(MenuEnum.CATALOGUE.value(), MenuEnum.MENU.value())) + .in(Menu::getId, roleMenus.stream().map(RoleMenu::getMenuId).collect(Collectors.toSet())) + .orderByAsc(Menu::getMenuSort)); + } + + public List listPermsByCurrentUser() { + UserAuth user = UserContextHolder.getCurrentUser(); + if (user.getRoleCodes().isEmpty()) { + return new ArrayList<>(); + } + List roleMenus = roleMenuService.list(user.getRoleCodes()); + if (roleMenus.isEmpty()) { + return new ArrayList<>(); + } + return list(new LambdaQueryWrapper() + .eq(Menu::getMenuType, MenuEnum.BUTTON.value()) + .in(Menu::getId, roleMenus.stream().map(RoleMenu::getMenuId).collect(Collectors.toSet())) + ).stream().map(Menu::getPerms).toList(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClassService.java b/src/main/java/com/biutag/supervision/service/ModelClassService.java new file mode 100644 index 0000000..37a42bc --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ModelClassService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.ModelClass; +import com.biutag.supervision.mapper.ModelClassMapper; +import org.springframework.stereotype.Service; + +@Service +public class ModelClassService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/ModelService.java b/src/main/java/com/biutag/supervision/service/ModelService.java new file mode 100644 index 0000000..379715d --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ModelService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.Model; +import com.biutag.supervision.mapper.ModelMapper; +import org.springframework.stereotype.Service; + +@Service +public class ModelService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/NegDepartAuthorityService.java b/src/main/java/com/biutag/supervision/service/NegDepartAuthorityService.java new file mode 100644 index 0000000..4f0ace7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegDepartAuthorityService.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegDepartAuthority; +import com.biutag.supervision.mapper.NegDepartAuthorityMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +public class NegDepartAuthorityService extends ServiceImpl { + + @Transactional(rollbackFor = Exception.class) + public boolean save(String idCode, List departs) { + remove(new LambdaQueryWrapper().eq(NegDepartAuthority::getIdCode, idCode)); + if (departs.isEmpty()) { + return true; + } + List list = departs.stream().map(departId -> { + NegDepartAuthority authority = new NegDepartAuthority(); + authority.setDepartId(departId); + authority.setIdCode(idCode); + return authority; + }).toList(); + return saveBatch(list); + } + + public List list(String idCode) { + return list(new LambdaQueryWrapper().eq(NegDepartAuthority::getIdCode, idCode)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java b/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java new file mode 100644 index 0000000..695d7e4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegDepartAuthority; +import com.biutag.supervision.pojo.entity.NegSourceAuthority; +import com.biutag.supervision.mapper.NegSourceAuthorityMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +public class NegSourceAuthorityService extends ServiceImpl { + + @Transactional(rollbackFor = Exception.class) + public boolean save(String idCode, List sources) { + remove(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); + if (sources.isEmpty()) { + return true; + } + List list = sources.stream().map(source -> { + NegSourceAuthority authority = new NegSourceAuthority(); + authority.setSource(source); + authority.setIdCode(idCode); + return authority; + }).toList(); + return saveBatch(list); + } + + public List list(String idCode) { + return list(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeApproveService.java b/src/main/java/com/biutag/supervision/service/NegativeApproveService.java new file mode 100644 index 0000000..61bb3e2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeApproveService.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeApprove; +import com.biutag.supervision.mapper.NegativeApproveMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeApproveService extends ServiceImpl { + + public List list(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeApprove::getNegativeId, negativeId)); + } + + public boolean remove(String negativeId) { + return remove(new LambdaQueryWrapper().eq(NegativeApprove::getNegativeId, negativeId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeBlameService.java b/src/main/java/com/biutag/supervision/service/NegativeBlameService.java new file mode 100644 index 0000000..cfb94e5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeBlameService.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.domain.Blame; +import com.biutag.supervision.pojo.entity.NegativeBlame; +import com.biutag.supervision.mapper.NegativeBlameMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class NegativeBlameService extends ServiceImpl { + + private final NegativeProblemRelationService problemRelationService; + + public List list(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeBlame::getNegativeId, negativeId)) + .stream() + .map(item -> { + Blame vo = new Blame(); + BeanUtil.copyProperties(item, vo); + vo.setProblems(problemRelationService.list(negativeId, item.getBlameId())); + return vo; + }).toList(); + } + + public boolean remove(String negativeId) { + return remove(new LambdaQueryWrapper().eq(NegativeBlame::getNegativeId, negativeId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java new file mode 100644 index 0000000..fcdda0a --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.domain.ExtensionApply; +import com.biutag.supervision.pojo.entity.NegativeExtensionApply; +import com.biutag.supervision.mapper.NegativeExtensionApplyMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@RequiredArgsConstructor +@Service +public class NegativeExtensionApplyService extends ServiceImpl { + + private final NegativeExtensionApproveService extensionApproveService; + + public ExtensionApply get(int id) { + NegativeExtensionApply extensionApply = getById(id); + ExtensionApply apply = new ExtensionApply(); + BeanUtil.copyProperties(extensionApply, apply); + apply.setApproves(extensionApproveService.list(id)); + return apply; + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeExtensionApproveService.java b/src/main/java/com/biutag/supervision/service/NegativeExtensionApproveService.java new file mode 100644 index 0000000..1aa69c0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeExtensionApproveService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.mapper.NegativeExtensionApproveMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeExtensionApproveService extends ServiceImpl { + + public List list(Integer negativeExtensionApplyId) { + return list(new LambdaQueryWrapper().eq(NegativeExtensionApprove::getNegativeExtensionApplyId, negativeExtensionApplyId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeFavService.java b/src/main/java/com/biutag/supervision/service/NegativeFavService.java new file mode 100644 index 0000000..e898611 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeFavService.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.mapper.NegativeFavMapper; +import com.biutag.supervision.pojo.entity.NegativeFav; +import com.biutag.supervision.pojo.model.NegativeFavModel; +import com.biutag.supervision.pojo.param.WorkParam; +import org.springframework.stereotype.Service; + +@Service +public class NegativeFavService extends ServiceImpl { + + public boolean existsByCurrentUser(String negativeId) { + return exists(new LambdaQueryWrapper().eq(NegativeFav::getNegativeId, negativeId) + .eq(NegativeFav::getUserId, UserContextHolder.getCurrentUserId())); + } + + public Page page(WorkParam workParam) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("f.user_id", UserContextHolder.getCurrentUserId()) + .orderByDesc("f.create_time"); + return baseMapper.queryPage(Page.of(workParam.getCurrent(), workParam.getSize()), queryWrapper); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeFileService.java b/src/main/java/com/biutag/supervision/service/NegativeFileService.java new file mode 100644 index 0000000..341c8a8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeFileService.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeFile; +import com.biutag.supervision.mapper.NegativeFileMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeFileService extends ServiceImpl { + + public List list(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeFile::getNegtiveId, negativeId)); + } + + public boolean remove(String negativeId) { + return remove(new LambdaQueryWrapper().eq(NegativeFile::getNegtiveId, negativeId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeHistoryService.java b/src/main/java/com/biutag/supervision/service/NegativeHistoryService.java new file mode 100644 index 0000000..ef58954 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeHistoryService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeHistory; +import com.biutag.supervision.mapper.NegativeHistoryMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeHistoryService extends ServiceImpl { + + public List listByNegativeId(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeHistory::getNegativeId, negativeId).orderByAsc(NegativeHistory::getCrtTime)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeProblemRelationService.java b/src/main/java/com/biutag/supervision/service/NegativeProblemRelationService.java new file mode 100644 index 0000000..3ae8855 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeProblemRelationService.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeBlame; +import com.biutag.supervision.pojo.entity.NegativeProblemRelation; +import com.biutag.supervision.mapper.NegativeProblemRelationMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeProblemRelationService extends ServiceImpl { + + public List list(String negativeId, String blameId) { + return list(new LambdaQueryWrapper().eq(NegativeProblemRelation::getNegativeId, negativeId).eq(NegativeProblemRelation::getBlameId, blameId)); + } + + public boolean remove(String negativeId) { + return remove(new LambdaQueryWrapper() + .eq(NegativeProblemRelation::getNegativeId, negativeId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java new file mode 100644 index 0000000..a6913b5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -0,0 +1,89 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.pojo.vo.NegativeQueryVo; +import com.biutag.supervision.util.TimeUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@RequiredArgsConstructor +@Service +public class NegativeQueryService { + + private final NegativeService negativeService; + + public Page page(NegativeQueryParam param) { + UserAuth user = UserContextHolder.getCurrentUser(); + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && (user.getRoleCodes().isEmpty() || user.getAuthSources().isEmpty() || user.getAuthDepartIds().isEmpty())) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) { + queryWrapper.in(Negative::getProblemSourcesCode, user.getAuthSources()); + if (user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode())) { + queryWrapper.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()); + } else if (user.getRoleCodes().contains(RoleCodeEnum.THREE_ADMIN.getCode())) { + queryWrapper.in(Negative::getHandleThreeDepartId, user.getAuthDepartIds()); + } + } + queryWrapper.like(StrUtil.isNotBlank(param.getOriginId()), Negative::getOriginId, param.getOriginId()) + .in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) + .eq(StrUtil.isNotBlank(param.getFlowKey()), Negative::getFlowKey, param.getFlowKey()) + .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) + .eq(StrUtil.isNotBlank(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode()) + .eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), Negative::getBusinessTypeCode, param.getBusinessTypeCode()) + .eq(StrUtil.isNotBlank(param.getCheckStatus()), Negative::getCheckStatus, param.getCheckStatus()) + .eq(StrUtil.isNotBlank(param.getIsRectifyCode()), Negative::getIsRectifyCode, param.getIsRectifyCode()) + .orderByDesc(Negative::getCrtTime); + if (param.getHappenTime().size() == 2) { + queryWrapper.between(Negative::getHappenTime, param.getHappenTime().get(0), param.getHappenTime().get(1)); + } + if (param.getDiscoveryTime().size() == 2) { + queryWrapper.between(Negative::getDiscoveryTime, param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1)); + } + if (StrUtil.isNotBlank(param.getResponderKey()) && StrUtil.isNotBlank(param.getResponderValue())) { + switch (param.getResponderKey()) { + case "name": + queryWrapper.like(Negative::getResponderName, param.getResponderValue()); + break; + case "phone": + queryWrapper.like(Negative::getContactPhone, param.getResponderValue()); + break; + } + } + if (Objects.nonNull(param.getTimeoutFlag())) { + if (param.getTimeoutFlag()) { + queryWrapper.isNotNull(Negative::getCompleteDate).apply("TIMESTAMPDIFF(HOUR, crtTime, completeDate) > 72"); + } else { + queryWrapper.isNotNull(Negative::getCompleteDate).apply("TIMESTAMPDIFF(HOUR, crtTime, completeDate) <= 72"); + } + } + Page page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + long l = System.currentTimeMillis(); + List list = page.getRecords().stream().map(item -> { + NegativeQueryVo vo = new NegativeQueryVo(); + BeanUtils.copyProperties(item, vo); + if (Objects.nonNull(item.getFirstDistributeTime()) && !ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())) { + vo.setRemainingDuration(TimeUtil.getRemainingDuration(item.getFirstDistributeTime(), item.getMaxSignDuration(), item.getMaxHandleDuration(), item.getExtensionDays(), item.getFlowKey())); + } + return vo; + }).toList(); + System.out.printf("耗时:%sms", System.currentTimeMillis() - l); + return new Page().setRecords(list).setTotal(page.getTotal()); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java new file mode 100644 index 0000000..44c7627 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -0,0 +1,260 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.flow.FlowService; +import com.biutag.supervision.mapper.NegativeMapper; +import com.biutag.supervision.pojo.domain.Blame; +import com.biutag.supervision.pojo.domain.NegativeDetail; +import com.biutag.supervision.pojo.domain.NegativeVo; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.NegativeDto; +import com.biutag.supervision.pojo.dto.flow.FirstDistributeData; +import com.biutag.supervision.pojo.dto.jwdc.NegativeApiDto; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.util.JSON; +import com.biutag.supervision.util.SpringUtil; +import com.biutag.supervision.util.TimeUtil; +import jakarta.validation.ValidationException; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@Service +public class NegativeService extends ServiceImpl { + + private final NegativeHistoryService negativeHistoryService; + + private final NegativeBlameService blameService; + + private final NegativeSignReturnService signReturnService; + + private final NegativeExtensionApplyService extensionApplyService; + + private final NegativeThingFileService thingFileService; + + private final NegativeFileService fileService; + + private final NegativeApproveService approveService; + + private final NegativeWorkService workService; + + private final NegativeFavService favService; + + private final FlowNodeService flowNodeService; + + private final FlowActionService flowActionService; + + private final SupDepartService departService; + + public NegativeDetail get(String id, Integer workId) { + Negative negative = getById(id); + List blameVos = blameService.list(id); + List flows = negativeHistoryService.listByNegativeId(id); + AtomicReference flowKey = new AtomicReference<>(negative.getFlowKey()); + List files = fileService.list(id); + List thingFiles = thingFileService.list(id); + if (Objects.nonNull(workId)) { + Optional.ofNullable(workService.getById(workId)).map(NegativeWork::getFlowKey).filter(StrUtil::isNotBlank).ifPresent(flowKey::set); + } + FlowNode flowNode = flowNodeService.getById(flowKey.get()); + List flowActions = flowActionService.list(flowKey.get()); + + NegativeVo vo = new NegativeVo(); + BeanUtil.copyProperties(negative, vo); + if (StrUtil.isNotBlank(negative.getInvolveProblem())) { + String involveProblemLables = JSON.readValueForList(negative.getInvolveProblem(), Map.class).stream().map(item -> String.valueOf(item.get("dictLabel"))).collect(Collectors.joining(" ")); + vo.setInvolveProblemLables(involveProblemLables); + } + vo.setBlames(blameVos); + vo.setFiles(files); + vo.setThingFiles(thingFiles); + NegativeDetail detail = new NegativeDetail() + .setNegative(vo) + .setActionHistory(flows) + .setFlowNode(flowNode) + .setFlowActions(flowActions) + .setApproves(approveService.list(id)) + .setIsFav(favService.existsByCurrentUser(id)); + // 签收退回 + if (!flows.isEmpty() && AppConstants.SIGN_RETURN_ACTION_NAME.equals(flows.get(flows.size() - 1).getActionName())) { + detail.setSignReturns(signReturnService.list(id)); + } + // 是否延期申请 + if (Objects.nonNull(negative.getNegativeExtensionApplyId()) && !negative.getExtensionApplyFlag()) { + detail.setExtensionApply(extensionApplyService.get(negative.getNegativeExtensionApplyId())); + } + // 办理剩余时长 + if (StrUtil.isNotBlank(negative.getFlowKey())) { + if (FlowNodeEnum.isSignFlow(negative.getFlowKey())) { + detail.setMaxDuration(NumberUtil.mul(negative.getMaxSignDuration(), TimeUtil.SECONDS_OF_A_DAY).longValue()); + } + // 未延期 + else if (Objects.isNull(negative.getExtensionDays())) { + detail.setMaxDuration(NumberUtil.mul(negative.getMaxHandleDuration(), TimeUtil.SECONDS_OF_A_DAY).longValue()); + } else { + // 已延期 + Integer maxDuration = negative.getMaxHandleDuration() + negative.getExtensionDays(); + detail.setMaxDuration(NumberUtil.mul(maxDuration, TimeUtil.SECONDS_OF_A_DAY).longValue()); + } + detail.setRemainingDuration(TimeUtil.getRemainingDuration(negative.getFirstDistributeTime(), + negative.getMaxSignDuration(), + negative.getMaxHandleDuration(), + negative.getExtensionDays(), + negative.getFlowKey())); + } + return detail; + } + + public Negative getByOriginId(String originId) { + return getOne(new LambdaUpdateWrapper().eq(Negative::getOriginId, originId)); + } + + @Transactional(rollbackFor = Exception.class) + public boolean save(NegativeDto negativeDto) { + Negative negative = new Negative(); + BeanUtil.copyProperties(negativeDto, negative); + String originId = generateOriginId(negativeDto.getProblemSourcesCode(), negativeDto.getBusinessTypeCode()); + negative.setOriginId(originId); + LocalDateTime now = LocalDateTime.now(); + negative.setId(IdUtil.getSnowflakeNextIdStr()) + .setProcessingStatus(ProcessingStatusEnum.signing.name()) + .setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) + .setCrtTime(now) + .setUpdTime(now); + if (Objects.nonNull(negativeDto.getInvolveProblem())) { + negative.setInvolveProblem(JSON.toJSONString(negativeDto.getInvolveProblem())); + } + save(negative); + if (!negativeDto.getThingFiles().isEmpty()) { + List files = negativeDto.getThingFiles().stream().map(item -> { + NegativeThingFile negativeThingFile = new NegativeThingFile(); + BeanUtil.copyProperties(item, negativeThingFile); + negativeThingFile.setNegativeId(negative.getId()); + negativeThingFile.setCreateTime(now); + return negativeThingFile; + }).toList(); + thingFileService.saveBatch(files); + } + + NegativeWork work = new NegativeWork() + .setNegativeId(negative.getId()). + setStatus(WorkStatusEnum.todo.name()) + .setDepartId(AppConstants.ROOT_DEPART_ID) + .setDepartName(AppConstants.ROOT_DEPART_NAME) + .setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode()) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setUpdateTime(now) + .setCreateTime(now); + workService.save(work); + // 下发 + FirstDistributeData firstDistributeData = new FirstDistributeData(); + BeanUtil.copyProperties(negativeDto, firstDistributeData); + ActionDto actionDto = new ActionDto() + .setActionKey(FlowActionEnum.FIRST_DISTRIBUTE.getKey()) + .setActionName(FlowActionEnum.FIRST_DISTRIBUTE.getName()) + .setNegativeId(negative.getId()) + .setWorkId(work.getId()) + .setNextFlowKey(FlowNodeEnum.SECOND_SIGN.getKey()) + .setData(firstDistributeData); + SpringUtil.getBean(FlowService.class).execute(actionDto); + return true; + } + + @Transactional(rollbackFor = Exception.class) + public boolean saveByJwdc(List list) { + LocalDateTime now = LocalDateTime.now(); + list.forEach(item -> { + SupDepart dept = departService.getByJwpyCode(item.getDepartCode()); + Negative negative = new Negative(); + + negative.setId(IdUtil.getSnowflakeNextIdStr()) + .setBusinessTypeCode(NegativeApiDto.BusinessType.getCode(item.getBusinessTypeName())) + .setPoliceType(NegativeApiDto.BusinessType.getPoliceType(item.getBusinessTypeName())) + .setPoliceTypeName(NegativeApiDto.BusinessType.getPoliceTypeName(item.getBusinessTypeName())) + // 导入的数据都是警务调查 + .setProblemSources(ProblemSourcesEnum.JWDC.getLabel()) + .setProblemSourcesCode(ProblemSourcesEnum.JWDC.getValue()) + // 警务调查默认为137工作制 + .setTimeLimit(TimeLimitEnum.WORK_137.getValue()) + .setMaxSignDuration(TimeLimitEnum.WORK_137.getMaxSignDuration()) + .setMaxHandleDuration(TimeLimitEnum.WORK_137.getMaxHandleDuration()) + .setMaxExtensionDuration(TimeLimitEnum.WORK_137.getMaxHandleDuration()) + .setApprovalFlow(ApprovalFlowEnum.SECOND_APPROVAL.getValue()) + .setFirstDistributeTime(now) + // 完成状态 0-待完善 1-已完善 + .setCompleteStatus("0") + .setTaskId("api") + .setCrtTime(now) + .setUpdTime(now); + + // [{"dictLabel":"自动回访不满意\n","dictType":"suspectProblem","dictValue":"1"}] + Map involveProblem = new HashMap<>(); + involveProblem.put("dictLabel", "自动回访不满意"); + involveProblem.put("dictType", "suspectProblem"); + involveProblem.put("dictValue", "1"); + negative.setInvolveProblem(JSON.toJSONString(Collections.singletonList(involveProblem))); + + NegativeWork work = new NegativeWork(); + if (Objects.nonNull(dept)) { + negative.setInvolveDepartId(dept.getId()) + .setInvolveDepartName(dept.getName()) + .setFlowKey(FlowNodeEnum.THREE_SIGN.getKey()); + work.setNegativeId(negative.getId()) + .setStatus(WorkStatusEnum.todo.name()) + .setDepartId(dept.getId()) + .setDepartName(dept.getName()) + .setRoleCode(RoleCodeEnum.THREE_ADMIN.getCode()) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setUpdateTime(now) + .setCreateTime(now); + } else { + log.error("未匹配上部门:{}, code: {}", item.getDepartName(), item.getDepartCode()); + work.setNegativeId(negative.getId()) + .setStatus(WorkStatusEnum.todo.name()) + .setDepartId(AppConstants.ROOT_DEPART_ID) + .setDepartName(AppConstants.ROOT_DEPART_NAME) + .setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode()) + .setUpdateTime(now) + .setCreateTime(now); + } + save(negative); + workService.save(work); + }); + return true; + } + + /** + * 生成样本源头编号 + * @param problemSourcesCode + * @return + */ + public String generateOriginId(String problemSourcesCode, String businessTypeCode) { + String originId = String.format("%s_%s_%s%s", ProblemSourcesEnum.get(problemSourcesCode).name(), + BusinessTypeEnum.get(businessTypeCode).getKey(), + DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT), + RandomUtil.randomString(4)); + if (exists(new LambdaUpdateWrapper().eq(Negative::getOriginId, originId))) { + return generateOriginId(problemSourcesCode, businessTypeCode); + } + return originId; + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/NegativeSignReturnService.java b/src/main/java/com/biutag/supervision/service/NegativeSignReturnService.java new file mode 100644 index 0000000..b93de58 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeSignReturnService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeSignReturn; +import com.biutag.supervision.mapper.NegativeSignReturnMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeSignReturnService extends ServiceImpl { + + public List list(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeSignReturn::getNegativeId, negativeId).orderByDesc(NegativeSignReturn::getCreateTime)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeThingFileService.java b/src/main/java/com/biutag/supervision/service/NegativeThingFileService.java new file mode 100644 index 0000000..8630f06 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeThingFileService.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeFile; +import com.biutag.supervision.pojo.entity.NegativeThingFile; +import com.biutag.supervision.mapper.NegativeThingFileMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeThingFileService extends ServiceImpl { + + public List list(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeThingFile::getNegativeId, negativeId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java new file mode 100644 index 0000000..9d69c75 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.mapper.NegativeWorkMapper; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.pojo.model.NegativeWorkModel; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.WorkParam; +import com.biutag.supervision.util.TimeUtil; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; + +@Service +public class NegativeWorkService extends ServiceImpl { + + public Page page(WorkParam workParam, String workStatus) { + UserAuth user = UserContextHolder.getCurrentUser(); + if (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty() || user.getAuthSources().isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("w.role_code", user.getRoleCodes()) + .in("w.depart_id", user.getAuthDepartIds()) + .in("w.problem_sources_code", user.getAuthSources()) + .eq("w.status", workStatus) + .eq(StrUtil.isNotBlank(workParam.getProblemSourcesCode()), "n.problemSourcesCode", workParam.getProblemSourcesCode()) + .eq(StrUtil.isNotBlank(workParam.getBusinessTypeCode()), "n.businessTypeCode", workParam.getBusinessTypeCode()) + .like(StrUtil.isNotBlank(workParam.getInvolveProblem()), "n.involveProblem", workParam.getInvolveProblem()) + .like(StrUtil.isNotBlank(workParam.getThingDesc()), "n.thingDesc", workParam.getThingDesc()) + .eq(StrUtil.isNotBlank(workParam.getInvolveDepartId()), "n.involveDepartId", workParam.getInvolveDepartId()) + .eq(StrUtil.isNotBlank(workParam.getHandleThreeDepartId()), "n.handle_three_depart_id", workParam.getHandleThreeDepartId()) + .eq(StrUtil.isNotBlank(workParam.getProcessingStatus()), "n.processing_status", workParam.getProcessingStatus()) + .orderByDesc("w.create_time"); + if (workParam.getHappenTime().size() == 2) { + queryWrapper.between("n.happenTime", workParam.getHappenTime().get(0), workParam.getHappenTime().get(1)); + } + Page modelPage = baseMapper.queryPage(Page.of(workParam.getCurrent(), workParam.getSize()), queryWrapper); + modelPage.getRecords().forEach(item -> { + item.setRemainingDuration(TimeUtil.getRemainingDuration(item.getFirstDistributeTime(), item.getMaxSignDuration(), item.getMaxHandleDuration(), item.getExtensionDays(), item.getFlowKey())); + }); + return modelPage; + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/RoleMenuService.java b/src/main/java/com/biutag/supervision/service/RoleMenuService.java new file mode 100644 index 0000000..a1570d3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RoleMenuService.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.RoleMenuMapper; +import com.biutag.supervision.pojo.entity.RoleMenu; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@DS("slave") +@Service +public class RoleMenuService extends ServiceImpl { + + @Transactional(rollbackFor = Exception.class) + public boolean update(String roleCode, List menuIds) { + remove(new LambdaQueryWrapper().eq(RoleMenu::getRoleCode, roleCode)); + if (menuIds.isEmpty()) { + return true; + } + List list = menuIds.stream().map(menuId -> new RoleMenu().setRoleCode(roleCode).setMenuId(menuId)).toList(); + return saveBatch(list); + } + + public List list(String roleCode) { + return list(new LambdaQueryWrapper().eq(RoleMenu::getRoleCode, roleCode)); + } + + public List list(List roleCodes) { + return list(new LambdaQueryWrapper().in(RoleMenu::getRoleCode, roleCodes)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDepartService.java b/src/main/java/com/biutag/supervision/service/SupDepartService.java new file mode 100644 index 0000000..041d3fe --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDepartService.java @@ -0,0 +1,170 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.StatusEnum; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.mapper.SupDepartMapper; +import com.biutag.supervision.pojo.param.DepartTreeListParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class SupDepartService extends ServiceImpl { + + public List listByEnabled() { + return list(new LambdaQueryWrapper() + .ne(SupDepart::getId, AppConstants.ROOT_DEPART_ID) + .notIn(SupDepart::getLevel, List.of(4, 5)) + .eq(SupDepart::getStatus, StatusEnum.ENABLE.getValue()) + .orderByAsc(SupDepart::getOrderNo)); + } + + public List listByLevel(List levels) { + return list(new LambdaQueryWrapper().in(SupDepart::getLevel, levels).eq(SupDepart::getStatus, StatusEnum.ENABLE.getValue()).orderByAsc(SupDepart::getOrderNo)); + } + + public List listAndChildrenIds(String departId) { + return listAndChildrenIds(List.of(departId)); + } + + public List listAndChildrenIds(List departIds) { + List list = buildTree(); + List ids = new ArrayList<>(); + listAndChildrenIds(departIds, list, ids); + return ids; + } + + private List listAndChildrenIds(List departIds, List list, List ids) { + list.forEach(item -> { + if (departIds.contains(item.getId())) { + listAndChildrenIds(ids, item); + } else { + listAndChildrenIds(departIds, item.getChildren(), ids); + } + }); + return ids; + } + + private void listAndChildrenIds(List ids, DepartTree departTree) { + ids.add(departTree.getId()); + listAndChildrenIds(ids, departTree.getChildren()); + } + + private void listAndChildrenIds(List ids, List list) { + if (list.isEmpty()) { + return; + } + ids.addAll(list.stream().map(DepartTree::getId).toList()); + list.forEach(item -> { + listAndChildrenIds(ids, item.getChildren()); + }); + } + + public SupDepart getParentDepart(String departId) { + return Optional.ofNullable(getById(departId)).map(item -> getById(item.getPid())).orElse(null); + } + public SupDepart getByJwpyCode(String departCode) { + return baseMapper.selectByJwpyCode(departCode); + } + + public boolean existsByPid(String pid) { + return exists(new LambdaQueryWrapper().eq(SupDepart::getPid, pid)); + } + + public boolean existsByCode(String code) { + return exists(new LambdaQueryWrapper().eq(SupDepart::getCode, code)); + } + + public boolean existsByName(String name) { + return exists(new LambdaQueryWrapper().eq(SupDepart::getName, name)); + } + + public Integer getMaxId() { + return baseMapper.getMaxId(); + } + + public List buildTree() { + // 所有有效的数据 + List departs = listByEnabled(); + return buildTree(departs); + } + public List buildTree(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(!depart.getLevel().equals(4) && departs.stream().anyMatch(item -> node.getId().equals(item.getPid()))); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + String pid = node.getPid(); + if (AppConstants.ROOT_DEPART_ID.equals(pid)) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + public List buildTreeByParam(DepartTreeListParam departTreeListParam) { + if (StrUtil.isNotBlank(departTreeListParam.getShortName())) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().like(SupDepart::getShortName, departTreeListParam.getShortName()).orderByAsc(SupDepart::getOrderNo); + return list(queryWrapper).stream() + .map(depart -> { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + return node; + }).toList(); + } + if (Objects.nonNull(departTreeListParam.getPid())) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(SupDepart::getPid, departTreeListParam.getPid()).orderByAsc(SupDepart::getOrderNo); + return list(queryWrapper).stream() + .map(depart -> { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(existsByPid(node.getId())); + return node; + }).toList(); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .in(SupDepart::getLevel, List.of(0, 1)).orderByAsc(SupDepart::getOrderNo); + List departs = list(queryWrapper); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(existsByPid(node.getId())); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + String pid = node.getPid(); + if (AppConstants.DEPART_ROOT_PID.equals(pid) || pid.equals(departTreeListParam.getPid())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + private static DepartTree buildTreeRecursive(DepartTree node, Map> childMap) { + List children = childMap.get(node.getId()); + if (children != null) { + node.getChildren().addAll(children.stream() + .map(childNode -> buildTreeRecursive(childNode, childMap)) + .toList()); + } + return node; + } + + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictContentService.java b/src/main/java/com/biutag/supervision/service/SupDictContentService.java new file mode 100644 index 0000000..3b6b653 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictContentService.java @@ -0,0 +1,54 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.mapper.SupDictContentMapper; +import com.biutag.supervision.pojo.entity.SupDictContent; +import com.biutag.supervision.pojo.entity.SupDictContent; +import com.biutag.supervision.pojo.vo.DictContentTree; +import com.biutag.supervision.pojo.vo.DictContentTree; +import com.biutag.supervision.pojo.vo.DictContentTree; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class SupDictContentService extends ServiceImpl { + + public List list() { + return list(new LambdaQueryWrapper().orderByAsc(SupDictContent::getSort)); + } + + public List buildTree() { + List dictContents = list(); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDictContent dictContent : dictContents) { + DictContentTree node = new DictContentTree(); + BeanUtils.copyProperties(dictContent, node); + List children = childMap.computeIfAbsent(node.getParentCode(), k -> new ArrayList<>()); + children.add(node); + String pCode = node.getParentCode(); + if (AppConstants.DICT_CONTENT_ROOT_PARENT_CODE.equals(pCode)) { + tree.add(node); + } + } + for (DictContentTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + private static DictContentTree buildTreeRecursive(DictContentTree node, Map> childMap) { + List children = childMap.get(node.getCode()); + if (children != null) { + node.getChildren().addAll(children.stream() + .map(childNode -> buildTreeRecursive(childNode, childMap)) + .toList()); + } + return node; + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictDataService.java b/src/main/java/com/biutag/supervision/service/SupDictDataService.java new file mode 100644 index 0000000..82a4530 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictDataService.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.dto.DictDataDto; +import com.biutag.supervision.pojo.dto.DictTypeDto; +import com.biutag.supervision.pojo.entity.SupDictData; +import com.biutag.supervision.mapper.SupDictDataMapper; +import com.biutag.supervision.pojo.entity.SupDictType; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class SupDictDataService extends ServiceImpl { + + public List listByDictType(String dictType) { + return list(new LambdaQueryWrapper().eq(SupDictData::getDictType, dictType)); + } + + public boolean save(DictDataDto dto) { + if (exists(new LambdaQueryWrapper().eq(SupDictData::getDictType, dto.getDictType()).eq(SupDictData::getDictValue, dto.getDictValue()))) { + throw new RuntimeException("字典值已存在"); + } + SupDictData supDictData = new SupDictData(); + BeanUtils.copyProperties(dto, supDictData); + supDictData.setCreateTime(LocalDateTime.now()); + supDictData.setUpdateTime(LocalDateTime.now()); + return save(supDictData); + } +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictTypeService.java b/src/main/java/com/biutag/supervision/service/SupDictTypeService.java new file mode 100644 index 0000000..e991835 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictTypeService.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.dto.DictTypeDto; +import com.biutag.supervision.pojo.entity.SupDictType; +import com.biutag.supervision.mapper.SupDictTypeMapper; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class SupDictTypeService extends ServiceImpl { + + public boolean save(DictTypeDto dto) { + if (exists(new LambdaQueryWrapper().eq(SupDictType::getDictType, dto.getDictType()))) { + throw new RuntimeException("字典类型已存在"); + } + SupDictType supDictType = new SupDictType(); + BeanUtils.copyProperties(dto, supDictType); + supDictType.setCreateTime(LocalDateTime.now()); + supDictType.setUpdateTime(LocalDateTime.now()); + return save(supDictType); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupPoliceService.java b/src/main/java/com/biutag/supervision/service/SupPoliceService.java new file mode 100644 index 0000000..aced720 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -0,0 +1,65 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.mapper.SupPoliceMapper; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.PoliceModel; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.PoliceQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@RequiredArgsConstructor +@Service +public class SupPoliceService extends ServiceImpl { + + private final SupDepartService departService; + + public Page page(PoliceQueryParam param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + UserAuth user = UserContextHolder.getCurrentUser(); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty() || !user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode()) && !user.getRoleCodes().contains(RoleCodeEnum.THREE_ADMIN.getCode())) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + List orgIds = departService.listAndChildrenIds(user.getAuthDepartIds()); + queryWrapper.in("p.org_id", orgIds); + } + queryWrapper.like(StrUtil.isNotBlank(param.getName()), "p.name", StrUtil.trim(param.getName())); + queryWrapper.like(StrUtil.isNotBlank(param.getIdCode()), "p.id_code", StrUtil.trim(param.getIdCode())); + queryWrapper.like(StrUtil.isNotBlank(param.getEmpNo()), "p.emp_no", StrUtil.trim(param.getEmpNo())); + queryWrapper.like(StrUtil.isNotBlank(param.getPhone()), "p.phone", StrUtil.trim(param.getPhone())); + if (StrUtil.isNotBlank(param.getDepartId())) { + if (Objects.nonNull(param.getDepartBranch()) && param.getDepartBranch()) { + List orgIds = departService.listAndChildrenIds(param.getDepartId()); + queryWrapper.in("p.org_id", orgIds); + } else { + queryWrapper.eq("p.org_id", param.getDepartId()); + } + } + queryWrapper.orderByDesc("p.emp_no"); + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public SupPolice getByIdCode(String idCode) { + return getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, idCode)); + } + + public List listAllByDepartId(String departId) { + List departIds = departService.listAndChildrenIds(List.of(departId)); + return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/UserLoginService.java b/src/main/java/com/biutag/supervision/service/UserLoginService.java new file mode 100644 index 0000000..11e10f4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/UserLoginService.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.service; + +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; + +@RequiredArgsConstructor +@Service +public class UserLoginService { + + private final BaseUserService userService; + + private final BaseRoleService roleService; + + private final SupPoliceService policeService; + + private final SupDepartService departService; + + private final NegDepartAuthorityService negDepartAuthorityService; + + private final NegSourceAuthorityService negSourceAuthorityService; + + public UserAuth buildUserAuth(String account) { + BaseUser user = userService.getByUserName(account); + SupDepart depart = Optional.ofNullable(policeService.getByIdCode(account)) + .map(item -> departService.getById(item.getOrgId())).orElse(null); + List roles = roleService.listByUserId(user.getUserId()); + List departAuthorities = negDepartAuthorityService.list(user.getUserName()); + List sourceAuthorities = negSourceAuthorityService.list(user.getUserName()); + UserAuth userAuth = new UserAuth() + .setUserId(user.getUserId()) + .setUserName(user.getUserName()) + .setUserType(user.getUserType()) + .setNickName(user.getNickName()) + .setDepartId(Optional.ofNullable(depart).map(SupDepart::getId).orElse(null)) + .setDepartName(Optional.ofNullable(depart).map(SupDepart::getShortName).orElse(null)) + .setRoleCodes(roles.stream().map(BaseRole::getRoleCode).toList()) + .setAuthSources(sourceAuthorities.stream().map(NegSourceAuthority::getSource).toList()) + .setAuthDepartIds(departAuthorities.stream().map(NegDepartAuthority::getDepartId).toList()); + return userAuth; + } +} diff --git a/src/main/java/com/biutag/supervision/service/UserService.java b/src/main/java/com/biutag/supervision/service/UserService.java new file mode 100644 index 0000000..2bcb196 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/UserService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.User; +import com.biutag.supervision.mapper.UserMapper; +import org.springframework.stereotype.Service; + +@Service +public class UserService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/util/AES.java b/src/main/java/com/biutag/supervision/util/AES.java new file mode 100644 index 0000000..546225d --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/AES.java @@ -0,0 +1,154 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.codec.Base64Decoder; +import cn.hutool.core.util.StrUtil; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.math.BigInteger; + + +/** + * AES的加密和解密 + * @author libo + */ +public class AES { + //密钥 (需要前端和后端保持一致) + private static final String KEY = "abcdefgabcdefg12"; + //算法 + private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding"; + + /** + * aes解密 + * @param encrypt 内容 + * @return + * @throws Exception + */ + public static String aesDecrypt(String encrypt) { + try { + return aesDecrypt(encrypt, KEY); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + } + + /** + * aes加密 + * @param content + * @return + * @throws Exception + */ + public static String aesEncrypt(String content) { + try { + return aesEncrypt(content, KEY); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + } + + /** + * 将byte[]转为各种进制的字符串 + * @param bytes byte[] + * @param radix 可以转换进制的范围,从Character.MIN_RADIX到Character.MAX_RADIX,超出范围后变为10进制 + * @return 转换后的字符串 + */ + public static String binary(byte[] bytes, int radix){ + return new BigInteger(1, bytes).toString(radix);// 这里的1代表正数 + } + + /** + * base 64 encode + * @param bytes 待编码的byte[] + * @return 编码后的base 64 code + */ + public static String base64Encode(byte[] bytes){ + return Base64.encodeBase64String(bytes); + } + + /** + * base 64 decode + * @param base64Code 待解码的base 64 code + * @return 解码后的byte[] + * @throws Exception + */ + public static byte[] base64Decode(String base64Code) { + return StrUtil.isEmpty(base64Code) ? null : Base64Decoder.decode(base64Code); + } + + + /** + * AES加密 + * @param content 待加密的内容 + * @param encryptKey 加密密钥 + * @return 加密后的byte[] + * @throws Exception + */ + public static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception { + KeyGenerator kgen = KeyGenerator.getInstance("AES"); + kgen.init(128); + Cipher cipher = Cipher.getInstance(ALGORITHMSTR); + cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES")); + + return cipher.doFinal(content.getBytes("utf-8")); + } + + + /** + * AES加密为base 64 code + * @param content 待加密的内容 + * @param encryptKey 加密密钥 + * @return 加密后的base 64 code + * @throws Exception + */ + public static String aesEncrypt(String content, String encryptKey) throws Exception { + return base64Encode(aesEncryptToBytes(content, encryptKey)); + } + + /** + * AES解密 + * @param encryptBytes 待解密的byte[] + * @param decryptKey 解密密钥 + * @return 解密后的String + * @throws Exception + */ + public static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception { + KeyGenerator kgen = KeyGenerator.getInstance("AES"); + kgen.init(128); + + Cipher cipher = Cipher.getInstance(ALGORITHMSTR); + cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptKey.getBytes(), "AES")); + byte[] decryptBytes = cipher.doFinal(encryptBytes); + return new String(decryptBytes); + } + + + /** + * 将base 64 code AES解密 + * @param encryptStr 待解密的base 64 code + * @param decryptKey 解密密钥 + * @return 解密后的string + * @throws Exception + */ + public static String aesDecrypt(String encryptStr, String decryptKey) throws Exception { + return StrUtil.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr), decryptKey); + } + + /** + * 测试 + */ + public static void main(String[] args) throws Exception { + String content = "123"; + System.out.println("加密前:" + content); + System.out.println("加密密钥和解密密钥:" + KEY); + String encrypt = aesEncrypt(content, KEY); + System.out.println("加密后:" + encrypt); + String decrypt = aesDecrypt(encrypt, KEY); + System.out.println("解密后:" + decrypt); + System.out.println(aesDecrypt("Sy93OjPDF5vwNrkTfL9AyA==")); + } + +} diff --git a/src/main/java/com/biutag/supervision/util/JSON.java b/src/main/java/com/biutag/supervision/util/JSON.java new file mode 100644 index 0000000..a2de7ef --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/JSON.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.util; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.List; + +public class JSON { + + private static ObjectMapper objectMapper = new ObjectMapper(); + + public static String toJSONString(Object object) { + try { + return objectMapper.writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static JsonNode readTree(String jsonString) { + try { + return objectMapper.readTree(jsonString); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static T readValue(String jsonString, Class valueType) { + try { + return objectMapper.readValue(jsonString, valueType); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static List readValueForList(String jsonString, Class valueType) { + try { + return objectMapper.readerForListOf(valueType).readValue(jsonString); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/src/main/java/com/biutag/supervision/util/SpringUtil.java b/src/main/java/com/biutag/supervision/util/SpringUtil.java new file mode 100644 index 0000000..75fcb1b --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/SpringUtil.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.util; + +import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; + +@Component +public class SpringUtil { + + private static ApplicationContext applicationContext; + + public SpringUtil(ApplicationContext applicationContext) { + SpringUtil.applicationContext = applicationContext; + } + + public static ListableBeanFactory getBeanFactory() { + return applicationContext; + } + + public static T getBean(Class clazz) { + return getBeanFactory().getBean(clazz); + } + + public static T getBean(String name, Class clazz) { + return getBeanFactory().getBean(name, clazz); + } + +} diff --git a/src/main/java/com/biutag/supervision/util/TimeUtil.java b/src/main/java/com/biutag/supervision/util/TimeUtil.java new file mode 100644 index 0000000..a9a9f13 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/TimeUtil.java @@ -0,0 +1,105 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.biutag.supervision.constants.enums.FlowNodeEnum; +import com.biutag.supervision.service.HolidayService; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; +import java.util.Objects; + +public class TimeUtil { + + // 一天86400秒 + public static final Long SECONDS_OF_A_DAY = 86400L; + + /** + * + * @param beginTime + * @param endTime + * @param maxDuration 最大时长(秒) + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, LocalDateTime endTime, Long maxDuration) { + if (Objects.isNull(beginTime)) { + return 0; + } + if (maxDuration < SECONDS_OF_A_DAY) { + return maxDuration - ChronoUnit.SECONDS.between(beginTime, endTime); + } + HolidayService holidayService = SpringUtil.getBean(HolidayService.class); + long duration = 0; + for (LocalDateTime time = beginTime; time.isBefore(endTime.with(LocalTime.MAX)); time = time.plusDays(1)) { + // 判断是否是节假日 + if (holidayService.isHoliday(DatePattern.NORM_DATE_FORMATTER.format(time))) { + continue; + } + // 开始时间是否是当天 + if (beginTime.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(beginTime, endTime); + } + // 是否是第一天 + else if (time.equals(beginTime)) { + duration += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX)); + } + // 当天(开始时间不是当天) + else if (time.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(time.with(LocalTime.MIN), endTime); + } + else { + duration += TimeUtil.SECONDS_OF_A_DAY; + } + } + return maxDuration - duration; + } + + /** + * + * @param beginTime + * @param maxDuration 最大时长(秒) + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, Long maxDuration) { + return getRemainingDuration(beginTime, LocalDateTime.now(), maxDuration); + } + + /** + * + * @param beginTime + * @param maxDurationDays 最大时长(天) + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, Integer maxDurationDays) { + if (Objects.isNull(maxDurationDays)) { + return 0; + } + return getRemainingDuration(beginTime, NumberUtil.mul(maxDurationDays, SECONDS_OF_A_DAY).longValue()); + } + + /** + * + * @param beginTime + * @param maxDuration + * @param extensionDurationDays 延期天数 + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, Integer maxDuration, Integer extensionDurationDays) { + return getRemainingDuration(beginTime, maxDuration) + NumberUtil.mul(extensionDurationDays, SECONDS_OF_A_DAY).longValue(); + } + + public static Long getRemainingDuration(LocalDateTime beginTime, Integer maxSignDuration, Integer maxHandleDuration, Integer extensionDurationDays, String flowKey) { + if (StrUtil.isBlank(flowKey)) { + return null; + } + if (FlowNodeEnum.isSignFlow(flowKey)) { + return getRemainingDuration(beginTime, maxSignDuration); + } + if (Objects.isNull(extensionDurationDays)) { + return getRemainingDuration(beginTime, maxHandleDuration); + } + return getRemainingDuration(beginTime, maxHandleDuration, maxSignDuration); + } +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..1b57321 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,32 @@ +spring: + datasource: + dynamic: + datasource: + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + slave: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/open-platform?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + data: + redis: + host: 127.0.0.1 + # 端口,默认为6379 + port: 6379 + password: 123456 + +fdfs: + tracker-list: #TrackerList参数,支持多个 + - 172.31.217.20:32060 + preview-url: http://172.31.217.20:31664 + +springdoc: + group-configs: + - group: 'plugin' + paths-to-match: + - '/api/plugin/**' + - '/login' \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..6a2c656 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,28 @@ +spring: + datasource: + dynamic: + datasource: + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/negative?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + slave: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/open-platform?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + data: + redis: + host: 65.47.6.109 + # 端口,默认为6379 + port: 6379 + password: ip1234!@#$ + +fdfs: + tracker-list: + - 65.47.6.110:22122 + preview-url: http://65.47.6.110:81 + +negative: + v1-user-url: http://65.47.6.108:8765/admin/current/user \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..ea2bee6 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,47 @@ +server: + port: 8080 +spring: + profiles: + active: @profiles.active@ + datasource: + dynamic: + primary: master + data: + redis: + # 数据库索引 + database: 1 + # 连接超时时间 + timeout: 10s + + jackson: + time-zone: Asia/Shanghai + servlet: + multipart: + max-file-size: 100MB + max-request-size: 100MB + +mybatis-plus: + # 对应的 XML 文件位置 + mapper-locations: classpath*:mapper/*Mapper.xml + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +fdfs: + soTimeout: 1500 # socket连接超时时长 + connectTimeout: 600 # 连接tracker服务器超时时长 + + pool: + #从池中借出的对象的最大数目(配置为-1表示不限制) + max-total: -1 + #获取连接时的最大等待毫秒数(默认配置为5秒) + max-wait-millis: 5000 + #每个key最大连接数 + max-total-per-key: 50 + #每个key对应的连接池最大空闲连接数 + max-idle-per-key: 10 + #每个key对应的连接池最小空闲连接数 + min-idle-per-key: 5 + +knife4j: + setting: + language: zh_cn \ No newline at end of file diff --git a/src/main/resources/mapper/NegativeFavMapper.xml b/src/main/resources/mapper/NegativeFavMapper.xml new file mode 100644 index 0000000..77cb878 --- /dev/null +++ b/src/main/resources/mapper/NegativeFavMapper.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/NegativeWorkMapper.xml b/src/main/resources/mapper/NegativeWorkMapper.xml new file mode 100644 index 0000000..1125f8a --- /dev/null +++ b/src/main/resources/mapper/NegativeWorkMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SupPoliceMapper.xml b/src/main/resources/mapper/SupPoliceMapper.xml new file mode 100644 index 0000000..793b6dc --- /dev/null +++ b/src/main/resources/mapper/SupPoliceMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/templates/《处理反馈表》.doc b/src/main/resources/static/templates/《处理反馈表》.doc new file mode 100644 index 0000000..221743a Binary files /dev/null and b/src/main/resources/static/templates/《处理反馈表》.doc differ diff --git a/src/main/resources/static/templates/《警务评议容错免责申请表》.docx b/src/main/resources/static/templates/《警务评议容错免责申请表》.docx new file mode 100644 index 0000000..c98bdc8 Binary files /dev/null and b/src/main/resources/static/templates/《警务评议容错免责申请表》.docx differ diff --git a/src/test/java/com/biutag/supervision/PasswordTests.java b/src/test/java/com/biutag/supervision/PasswordTests.java new file mode 100644 index 0000000..7c6b132 --- /dev/null +++ b/src/test/java/com/biutag/supervision/PasswordTests.java @@ -0,0 +1,29 @@ +package com.biutag.supervision; + +import com.biutag.supervision.util.TimeUtil; +import org.junit.jupiter.api.Test; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; + +public class PasswordTests { + + @Test + public void testAes() { + LocalDateTime beginTime = LocalDateTime.of(2024, 8, 26, 11, 0, 0); + LocalDateTime now = LocalDateTime.now(); + long i = 0; + for (LocalDateTime time = beginTime; time.isBefore(now); time = time.plusDays(1)) { + System.out.println(i); + if (time.equals(beginTime)) { + i += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX)); + } else if (time.toLocalDate().equals(now.toLocalDate())) { + i += ChronoUnit.SECONDS.between(time, now); + } else { + i += TimeUtil.SECONDS_OF_A_DAY; + } + } + System.out.println(i); + } +} diff --git a/src/test/java/com/biutag/supervision/StrUtil.java b/src/test/java/com/biutag/supervision/StrUtil.java new file mode 100644 index 0000000..9b1495c --- /dev/null +++ b/src/test/java/com/biutag/supervision/StrUtil.java @@ -0,0 +1,17 @@ +package com.biutag.supervision; + +import cn.hutool.core.io.resource.ResourceUtil; +import org.junit.jupiter.api.Test; + +import java.net.URL; +import java.util.List; + +public class StrUtil { + + @Test + public void testSubstr() { + List integers = List.of(3, 2, 1); + integers = integers.stream().sorted().toList(); + System.out.println(integers); + } +} diff --git a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java new file mode 100644 index 0000000..edf9ba4 --- /dev/null +++ b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java @@ -0,0 +1,29 @@ +package com.biutag.supervision; + +import com.github.tobato.fastdfs.domain.fdfs.StorePath; +import com.github.tobato.fastdfs.service.AppendFileStorageClient; +import com.github.tobato.fastdfs.service.FastFileStorageClient; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.redis.core.RedisTemplate; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +@SpringBootTest +class SupervisionApplicationTests { + + @Autowired + private FastFileStorageClient fastFileStorageClient; + + + @Test + void contextLoads() throws FileNotFoundException { + File file = new File("D:\\deploy\\response.txt"); + StorePath storePath = fastFileStorageClient.uploadFile("group1", new FileInputStream(file), file.length(), "txt"); + System.out.println(storePath); + } + +} diff --git a/src/test/java/com/biutag/supervision/tools/ColumnMapper.java b/src/test/java/com/biutag/supervision/tools/ColumnMapper.java new file mode 100644 index 0000000..eb56511 --- /dev/null +++ b/src/test/java/com/biutag/supervision/tools/ColumnMapper.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.tools; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface ColumnMapper { + + @Select("SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT, COLUMN_KEY, EXTRA FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = #{tableSchema} AND TABLE_NAME = #{tableName} ORDER BY ORDINAL_POSITION") + List> list(String tableSchema, String tableName); +} diff --git a/src/test/java/com/biutag/supervision/tools/ExcelToDb.java b/src/test/java/com/biutag/supervision/tools/ExcelToDb.java new file mode 100644 index 0000000..337f660 --- /dev/null +++ b/src/test/java/com/biutag/supervision/tools/ExcelToDb.java @@ -0,0 +1,51 @@ +package com.biutag.supervision.tools; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.stream.Collectors; + +public class ExcelToDb { + + @Test + public void simpleRead() { + String fileName = "D:\\Workspace\\创客\\公安项目\\数字督察\\文档\\信访投诉数据台账(新)_240731.xlsx"; + + // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 + EasyExcel.read(fileName, new ReadListener() { + int i = 0; + @Override + public void invoke(Object obj, AnalysisContext analysisContext) { + if (i++ == 0) { + System.out.println("("); + ((LinkedHashMap) obj).forEach((key, val) -> { + String zh = val.toString().replace("*", "").replace("\n", "").replace("(", " ").replace(")", ""); + + String en = Translate.zhToEn(zh); + String columnName = Arrays.stream(en.toLowerCase().replace(",", "").replace("'s", "").split(" ")) + .filter(item -> !"and".equals(item) && !"of".equals(item) && !"the".equals(item)) + .collect(Collectors.joining("_")); + + System.out.println(columnName + " varchar(255) COMMENT '" + val.toString().replace("*", "").replace("\n", "") + "',"); + }); + System.out.println(")"); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + + } + }).sheet().doRead(); + } + + @Test + public void testCamelName() { + System.out.println(StrUtil.toCamelCase("data_case_verification")); + } +} diff --git a/src/test/java/com/biutag/supervision/tools/GenCode.java b/src/test/java/com/biutag/supervision/tools/GenCode.java new file mode 100644 index 0000000..0162317 --- /dev/null +++ b/src/test/java/com/biutag/supervision/tools/GenCode.java @@ -0,0 +1,47 @@ +package com.biutag.supervision.tools; + +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import freemarker.template.Version; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + + +public class GenCode { + + public static File TEMPLATE_DIR = new File(System.getProperty("user.dir") + "\\src\\test\\resources\\templates"); + + public static void genMapper(String entityName) throws IOException, TemplateException { + Map data = new HashMap<>(); + data.put("entityName", entityName); + Configuration configuration = new Configuration(new Version("2.3.32")); + configuration.setDefaultEncoding("UTF-8"); + configuration.setDirectoryForTemplateLoading(TEMPLATE_DIR); + Template template = configuration.getTemplate("Mapper.ftl", "UTF-8"); + String path = String.format(System.getProperty("user.dir") + "\\src\\main\\java\\com\\biutag\\supervision\\mapper\\%sMapper.java", entityName); + Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.UTF_8)); + template.process(data, out); + out.flush(); + out.close(); + } + + public static void genService(String entityName) throws IOException, TemplateException { + Map data = new HashMap<>(); + data.put("entityName", entityName); + Configuration configuration = new Configuration(new Version("2.3.32")); + configuration.setDefaultEncoding("UTF-8"); + configuration.setDirectoryForTemplateLoading(TEMPLATE_DIR); + Template template = configuration.getTemplate("Service.ftl", "UTF-8"); + String path = String.format(System.getProperty("user.dir") + "\\src\\main\\java\\com\\biutag\\supervision\\service\\%sService.java", entityName); + Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.UTF_8)); + template.process(data, out); + out.flush(); + out.close(); + } + + +} diff --git a/src/test/java/com/biutag/supervision/tools/GenCodeTests.java b/src/test/java/com/biutag/supervision/tools/GenCodeTests.java new file mode 100644 index 0000000..b4a97f8 --- /dev/null +++ b/src/test/java/com/biutag/supervision/tools/GenCodeTests.java @@ -0,0 +1,79 @@ +package com.biutag.supervision.tools; + +import cn.hutool.core.util.StrUtil; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import freemarker.template.Version; +import org.junit.jupiter.api.Test; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@MapperScan(basePackages = "com.biutag.supervision.mapper", basePackageClasses = ColumnMapper.class) +@SpringBootTest +public class GenCodeTests { + + @Autowired + ColumnMapper columnMapper; + + @Test + public void genEntity() throws TemplateException, IOException { + String tableName = "model_class"; + String tableSchema = "negative"; + boolean genMapper = true; + boolean genService = true; + //-------------------------------------------- + Map data = new HashMap<>(); + String entityName = StrUtil.upperFirst(StrUtil.toCamelCase(tableName)); + + data.put("entityName", entityName); + List> list = columnMapper.list(tableSchema, tableName); + List> fields = list.stream().map(item -> { + Map field = new HashMap<>(); + field.put("name", StrUtil.toCamelCase(item.get("COLUMN_NAME").toString())); + field.put("type", getType(item.get("DATA_TYPE").toString())); + field.put("columnName", item.get("COLUMN_NAME")); + field.put("columnComment", item.get("COLUMN_COMMENT")); + field.put("columnKey", item.get("COLUMN_KEY")); + field.put("extra", item.get("EXTRA")); + return field; + }).toList(); + data.put("fields", fields); + Configuration configuration = new Configuration(new Version("2.3.32")); + configuration.setDefaultEncoding("UTF-8"); + + configuration.setDirectoryForTemplateLoading(GenCode.TEMPLATE_DIR); + Template template = configuration.getTemplate("Entity.ftl", "UTF-8"); + String path = String.format(System.getProperty("user.dir") + "\\src\\main\\java\\com\\biutag\\supervision\\pojo\\entity\\%s.java", entityName); + Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.UTF_8)); + template.process(data, out); + out.flush(); + out.close(); + if (genMapper) { + GenCode.genMapper(entityName); + if (genService) { + GenCode.genService(entityName); + } + } + } + + private String getType(String dataType) { + if ("datetime".equals(dataType)) { + return "LocalDateTime"; + } + if ("tinyint".equals(dataType)) { + return "Boolean"; + } + if ("int".equals(dataType)) { + return "Integer"; + } + return "String"; + } +} diff --git a/src/test/java/com/biutag/supervision/tools/Translate.java b/src/test/java/com/biutag/supervision/tools/Translate.java new file mode 100644 index 0000000..d045115 --- /dev/null +++ b/src/test/java/com/biutag/supervision/tools/Translate.java @@ -0,0 +1,44 @@ +package com.biutag.supervision.tools; + +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +public class Translate { + + public static String zhToEn(String query) { + HttpResponse httpResponse = HttpUtil.createPost("https://fanyi.baidu.com/ait/text/translate") + .body(String.format("{\"query\":\"%s\",\"from\":\"zh\",\"to\":\"en\",\"reference\":\"\",\"corpusIds\":[],\"qcSettings\":[],\"needPhonetic\":true,\"domain\":\"common\",\"milliTimestamp\":%s}", + query, + System.currentTimeMillis())) + .executeAsync(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.bodyStream())); + String line; + try { + while ((line = bufferedReader.readLine()) != null) { + if (line.startsWith("data")) { + String json = line.substring(5); + JsonNode jsonNode = new ObjectMapper().readTree(json); + JsonNode data = jsonNode.get("data"); + if ("Translating".equals(data.get("event").asText())) { + for (JsonNode item : data.get("list")) { + String val = item.get("dst").asText(); + return val; + } + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return null; + + } + +} diff --git a/src/test/resources/templates/Entity.ftl b/src/test/resources/templates/Entity.ftl new file mode 100644 index 0000000..99ab420 --- /dev/null +++ b/src/test/resources/templates/Entity.ftl @@ -0,0 +1,27 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class ${entityName} { + + <#list fields as field> + // ${field.columnComment} + <#if field.columnKey == 'PRI' && field.extra == 'auto_increment'> + @TableId(value = "${field.columnName}", type = IdType.AUTO) + <#elseif field.columnKey == 'PRI'> + @TableId(value = "${field.columnName}") + <#else> + @TableField("${field.columnName}") + + private ${field.type} ${field.name}; + + +} \ No newline at end of file diff --git a/src/test/resources/templates/Mapper.ftl b/src/test/resources/templates/Mapper.ftl new file mode 100644 index 0000000..6bb0763 --- /dev/null +++ b/src/test/resources/templates/Mapper.ftl @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.${entityName}; + +public interface ${entityName}Mapper extends BaseMapper<${entityName}> { + +} \ No newline at end of file diff --git a/src/test/resources/templates/Service.ftl b/src/test/resources/templates/Service.ftl new file mode 100644 index 0000000..e993e6b --- /dev/null +++ b/src/test/resources/templates/Service.ftl @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.${entityName}; +import com.biutag.supervision.mapper.${entityName}Mapper; +import org.springframework.stereotype.Service; + +@Service +public class ${entityName}Service extends ServiceImpl<${entityName}Mapper, ${entityName}> { + +}