commit 2aadc94bd4142b3b39beecce0da1fd78fdcd82d5 Author: wxc <191104855@qq.com> Date: Fri Nov 1 19:56:16 2024 +0800 2411011956 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/README.md b/README.md new file mode 100644 index 0000000..e8893ec --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# 数字督察一体化平台 +## 技术栈 +- JDK17 +- SpringBoot 3 +- MySQL \ No newline at end of file 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..8b4e47c --- /dev/null +++ b/pom.xml @@ -0,0 +1,219 @@ + + + 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 + + + + commons-io + commons-io + 2.17.0 + + + + + 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 + + + + com.gbase + gbase-jdbc + system + 8.3.81.53-build55.2.1-bin + ${project.basedir}/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar + + + + com.alibaba + druid-spring-boot-starter + 1.2.22 + + + + com.alibaba + fastjson + 2.0.53 + + + + + + + + src/main/resources + false + + + src/main/resources + + application.yml + + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + org.projectlombok + lombok + + + + + + + supervision + + + + + local + + + local + + + + + true + + + + dev + + + dev + + + + 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/1008.sql b/sql/1008.sql new file mode 100644 index 0000000..b7f5b8a --- /dev/null +++ b/sql/1008.sql @@ -0,0 +1,115 @@ +ALTER TABLE `negative`.`negative_problem_relation` + ADD COLUMN `threeLevelCode` varchar(255) NULL AFTER `twoLevelContent`, +ADD COLUMN `threeLevelContent` varchar(255) NULL AFTER `threeLevelCode`; + +ALTER TABLE `negative`.`sup_police` + ADD COLUMN `position` varchar(255); + +update sup_police set position = '正职' where job like '%正职%'; + +update sup_police set position = '副职' where job like '%副职%'; + + +INSERT INTO `sup_dict_problem_type` VALUES (1, '内务管理', '1', '-1', '0', '内务管理', '', 1, 1, NULL, '', '', '', '', '2020-08-13 14:47:51', '521677655146233856', 'oumyye', '127.0.0.1'); +INSERT INTO `sup_dict_problem_type` VALUES (2, '服务群众', '2', '-1', '0', '服务群众', '', 1, 2, NULL, '', '', '', '', '2020-08-13 14:48:21', '521677655146233856', 'oumyye', '127.0.0.1'); +INSERT INTO `sup_dict_problem_type` VALUES (3, '服务基层', '3', '-1', '0', NULL, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (4, '纪律作风', '4', '-1', '0', NULL, NULL, 1, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (5, '执法办案', '5', '-1', '0', NULL, NULL, 1, 5, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (6, '安保维稳', '6', '-1', '0', NULL, NULL, 1, 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (7, '专项工作', '7', '-1', '0', NULL, NULL, 1, 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (8, '“二十个不准”', '8', '-1', '0', NULL, NULL, 1, 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (9, '钉钉使用弄虚作假。', '9', '1', '0', NULL, '/1/', 2, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (10, '未按规定请示报告。', '10', '1', '0', NULL, '/1/', 2, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (11, '迟到、早退、脱岗、旷工等。', '11', '1', '0', NULL, '/1/', 2, 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (12, '值班装备配备、使用不规范。', '12', '1', '0', NULL, '/1/', 2, 12, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (13, '内务卫生不整洁', '13', '1', '0', NULL, '/1/', 2, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (14, '违反着装管理规定', '14', '1', '0', NULL, '/1/', 2, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (15, '枪支保管使用不规范', '15', '1', '0', NULL, '/1/', 2, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (16, '公车管理使用不规范', '16', '1', '0', NULL, '/1/', 2, 16, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (17, '办公备勤用房违规', '17', '1', '0', NULL, '/1/', 2, 17, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (18, '内部安全防范不到位', '18', '1', '0', NULL, '/1/', 2, 18, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (19, '会风会纪差', '19', '1', '0', NULL, '/1/', 2, 19, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (20, '违反保密管理规定', '20', '1', '0', NULL, '/1/', 2, 20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (21, '泄露警务秘密', '21', '1', '0', NULL, '/1/', 2, 21, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (22, '违反宣传纪律', '22', '1', '0', NULL, '/1/', 2, 22, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (23, '其他', '23', '1', '0', NULL, '/1/', 2, 23, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (24, '态度不好', '24', '2', '0', NULL, '/2/', 2, 24, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (26, '办事推诿、拖拉', '26', '2', '0', NULL, '/2/', 2, 26, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (27, '违规办理', '27', '2', '0', NULL, '/2/', 2, 27, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (28, '吃拿卡要', '28', '2', '0', NULL, '/2/', 2, 28, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (29, '其他', '29', '2', '0', NULL, '/2/', 2, 29, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (30, '测评满意率低', '30', '3', '0', NULL, '/3/', 2, 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (31, '办事推诿、拖拉', '31', '3', '0', NULL, '/3/', 2, 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (32, '违规摊派任务', '32', '3', '0', NULL, '/3/', 2, 32, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (33, '办理不满意', '33', '3', '0', NULL, '/3/', 2, 33, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (34, '拒不整改问题', '34', '3', '0', NULL, '/3/', 2, 34, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (35, '形式主义、官僚主义', '35', '3', '0', NULL, '/3/', 2, 35, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (36, '其他', '36', '3', '0', NULL, '/3/', 2, 36, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (37, '违反规定饮酒。', '37', '4', '0', NULL, '/4/', 2, 37, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (38, '酒后驾驶机动车。', '38', '4', '0', NULL, '/4/', 2, 38, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (39, '在公共场所酗酒滋事。', '39', '4', '0', NULL, '/4/', 2, 39, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (40, '携带枪支饮酒。', '40', '4', '0', NULL, '/4/', 2, 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (41, '吸食、注射毒品。', '41', '4', '0', NULL, '/4/', 2, 41, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (42, '贪污受贿', '42', '4', '0', NULL, '/4/', 2, 42, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (43, '其他违反政治纪律的行为', '43', '4', '0', NULL, '/4/', 2, 43, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (44, '其他违反组织纪律的行为', '44', '4', '0', NULL, '/4/', 2, 44, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (45, '其他违反廉洁纪律的行为', '45', '4', '0', NULL, '/4/', 2, 45, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (46, '其他违反群众纪律的行为', '46', '4', '0', NULL, '/4/', 2, 46, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (47, '其他违反工作纪律的行为', '47', '4', '0', NULL, '/4/', 2, 47, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (48, '其他违反生活纪律的行为', '48', '4', '0', NULL, '/4/', 2, 48, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (49, '其他违法犯罪行为', '49', '4', '0', NULL, '/4/', 2, 49, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (50, '其他', '50', '4', '0', NULL, '/4/', 2, 50, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (51, '接处警不及时。', '51', '5', '0', NULL, '/5/', 2, 51, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (52, '现场处置不文明、不规范。', '52', '5', '0', NULL, '/5/', 2, 52, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (53, '不如实、及时受立案', '53', '5', '0', NULL, '/5/', 2, 53, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (54, '调查取证不及时', '54', '5', '0', NULL, '/5/', 2, 54, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (55, '未按规定使用执法记录仪', '55', '5', '0', NULL, '/5/', 2, 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (56, '违反执法办案场所相关规定', '56', '5', '0', NULL, '/5/', 2, 56, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (57, '违反规定采取强制措施', '57', '5', '0', NULL, '/5/', 2, 57, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (58, '违规处理案件,执法不公、不严。', '58', '5', '0', NULL, '/5/', 2, 58, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (59, '执行不到位', '59', '5', '0', NULL, '/5/', 2, 59, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (60, '违规介入经济纠纷', '60', '5', '0', NULL, '/5/', 2, 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (61, '违规查封、扣押、冻结,影响营商环境', '61', '5', '0', NULL, '/5/', 2, 61, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (62, '涉案财物、随身物品管理违规', '62', '5', '0', NULL, '/5/', 2, 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (63, '违反法定程序办案。', '63', '5', '0', NULL, '/5/', 2, 63, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (64, '指供、诱供、刑讯逼供。', '64', '5', '0', NULL, '/5/', 2, 64, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (65, '办人情案、关系案、金钱案。', '65', '5', '0', NULL, '/5/', 2, 65, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (66, '充当违法犯罪保护伞。', '66', '5', '0', NULL, '/5/', 2, 66, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (67, '向违法犯罪嫌疑人通风报信', '67', '5', '0', NULL, '/5/', 2, 67, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (68, '违规安排会见,私自传递物品、信件。', '68', '5', '0', NULL, '/5/', 2, 68, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (69, '体罚、虐待被监管人员。', '69', '5', '0', NULL, '/5/', 2, 69, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (70, '违反监所安全管理规定。', '70', '5', '0', NULL, '/5/', 2, 70, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (71, '失职渎职导致发生执法安全事故', '71', '5', '0', NULL, '/5/', 2, 71, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (72, '处置不当引发负面舆情', '72', '5', '0', NULL, '/5/', 2, 72, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (73, '其他', '73', '5', '0', NULL, '/5/', 2, 73, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (74, '未按时到岗、脱岗', '74', '6', '0', NULL, '/6/', 2, 74, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (75, '履职不认真', '75', '6', '0', NULL, '/6/', 2, 75, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (76, '不按规定佩戴装备', '76', '6', '0', NULL, '/6/', 2, 76, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (77, '警容不整及不文明行为', '77', '6', '0', NULL, '/6/', 2, 77, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (78, '处置不规范', '78', '6', '0', NULL, '/6/', 2, 78, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (79, '失职渎职', '79', '6', '0', NULL, '/6/', 2, 79, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (80, '其他', '80', '6', '0', NULL, '/6/', 2, 80, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (81, '部署推进不力', '81', '7', '0', NULL, '/7/', 2, 81, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (82, '考核排名落后', '82', '7', '0', NULL, '/7/', 2, 82, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (83, '被上级点名通报', '83', '7', '0', NULL, '/7/', 2, 83, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (84, '其他', '84', '7', '0', NULL, '/7/', 2, 84, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (85, '搞团团伙伙。', '85', '8', '0', NULL, '/8/', 2, 85, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (86, '搞权力交换、利益输送。', '86', '8', '0', NULL, '/8/', 2, 86, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (87, '收受礼金及贵重礼品。', '87', '8', '0', NULL, '/8/', 2, 87, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (88, '组织参与黄、赌活动', '88', '8', '0', NULL, '/8/', 2, 88, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (89, '相互拆台、诬告、陷害,破坏队伍团结。', '89', '8', '0', NULL, '/8/', 2, 89, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (90, '拒绝、拖延执行上级依法依规作出的决定。', '90', '8', '0', NULL, '/8/', 2, 90, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (91, '违反党的干部政策,培植私人势力。', '91', '8', '0', NULL, '/8/', 2, 91, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (92, '干预执法办案。', '92', '8', '0', NULL, '/8/', 2, 92, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (93, '搞无原则一团和气。', '93', '8', '0', NULL, '/8/', 2, 93, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (94, '使用庸俗化称谓,搞人身依附。', '94', '8', '0', NULL, '/8/', 2, 94, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (95, '妄议中央大政方针。', '95', '8', '0', NULL, '/8/', 2, 95, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (96, '结交“风水大师”、参与迷信活动。', '96', '8', '0', NULL, '/8/', 2, 96, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (97, '帮助违法犯罪嫌疑人逃避法律责任。', '97', '8', '0', NULL, '/8/', 2, 97, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (98, '违规与当事人、中间人等特定关系人交往。', '98', '8', '0', NULL, '/8/', 2, 98, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (99, '超越“亲”“清”政商关系与企业老板交往。', '99', '8', '0', NULL, '/8/', 2, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (100, '受雇于任何组织、个人。', '100', '8', '0', NULL, '/8/', 2, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (101, '收受管理、服务对象及其代理人任何好处。', '101', '8', '0', NULL, '/8/', 2, 101, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (102, '违规从事盈利性经营活动。', '102', '8', '0', NULL, '/8/', 2, 102, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (103, '利用职权或影响力为亲友谋取好处。', '103', '8', '0', NULL, '/8/', 2, 103, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sup_dict_problem_type` VALUES (104, '利用网络社交媒体进行不正当交往。', '104', '8', '0', NULL, '/8/', 2, 104, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/sql/1011.sql b/sql/1011.sql new file mode 100644 index 0000000..ad0ae15 --- /dev/null +++ b/sql/1011.sql @@ -0,0 +1,5 @@ +ALTER TABLE `negative`.`sup_police` + ADD COLUMN `person_type` varchar(255) NULL COMMENT '人员属性' AFTER `position`, +ADD COLUMN `marital_status` varchar(255) NULL COMMENT '婚姻状况' AFTER `person_type`, +ADD COLUMN `have_children` tinyint(1) NULL COMMENT '子女' AFTER `marital_status`, +ADD COLUMN `education` varchar(255) NULL COMMENT '学历' AFTER `have_children`; \ No newline at end of file diff --git a/sql/1014.sql b/sql/1014.sql new file mode 100644 index 0000000..dd77ac8 --- /dev/null +++ b/sql/1014.sql @@ -0,0 +1,9 @@ +ALTER TABLE `negative`.`sup_depart` + ADD COLUMN `first_host` tinyint DEFAULT '0' COMMENT '是否是市局主办'; + +ALTER TABLE `negative`.`negative` + ADD COLUMN `current_processing_object` varchar(255) COMMENT '当前处理对象'; + +ALTER TABLE `negative`.`sup_police` + ADD COLUMN `employment_date` datetime COMMENT '入职时间', + ADD COLUMN `police_role` varchar(255) COMMENT '角色'; diff --git a/sql/1027.sql b/sql/1027.sql new file mode 100644 index 0000000..1e0fc67 --- /dev/null +++ b/sql/1027.sql @@ -0,0 +1,21 @@ +UPDATE negative_work w + LEFT JOIN negative n ON w.create_time = n.crtTime + AND n.involveDepartId = w.depart_id + SET w.negative_id = n.id +WHERE + w.negative_id IS NULL + AND n.id IS NOT NULL; + +UPDATE negative +SET handle_three_depart_id = involveDepartId, + handle_three_depart_name = involveDepartName +WHERE + crtTime > '2024-10-25 19:00:00' + AND handle_three_depart_id IS NULL; + +// 删除数据 +DELETE +FROM + negative_work +WHERE + negative_id IS NULL; \ 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..d83bb84 --- /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 -> "不能为空".equals(item.getDefaultMessage()) ? item.getField() + "-" + item.getDefaultMessage() : 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..37ee69d --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -0,0 +1,73 @@ +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; +import java.util.concurrent.TimeUnit; + +/** + * @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(); + } + // 更新 会话 有效期 + redisTemplate.expire(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), 24, TimeUnit.HOURS); + 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/ScheduledConfig.java b/src/main/java/com/biutag/supervision/config/ScheduledConfig.java new file mode 100644 index 0000000..705eef7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/ScheduledConfig.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Configuration +public class ScheduledConfig { + + @Bean + public ScheduledTaskRegistrar scheduledTaskRegistrar(TaskScheduler taskScheduler) { + ScheduledTaskRegistrar scheduledTaskRegistrar = new ScheduledTaskRegistrar(); + scheduledTaskRegistrar.setTaskScheduler(taskScheduler); + return scheduledTaskRegistrar; + } + +} 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..18d145b --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/AppConstants.java @@ -0,0 +1,28 @@ +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 Integer DICT_PROBLEM_SOURCE_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..71d27c8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java @@ -0,0 +1,39 @@ +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"), + FFJC("服务基层", "12", "FF"), + DWGL("队伍管理", "13", "DW"), + QT("其他", "14", "QT"), + ; + + 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/CaseVerifProblemNatureEnum.java b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java new file mode 100644 index 0000000..9714240 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@AllArgsConstructor +public enum CaseVerifProblemNatureEnum { + + ZFBA("执法办案"), + FWGL("服务管理"), + JJJG("警纪警规"); + + @Getter + private String laebl; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java new file mode 100644 index 0000000..b8795c2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.constants.enums; + +public enum DataUpdateMethodEnum { + + // 增量更新 + incremental, + // 覆盖更新 + overwrite +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java new file mode 100644 index 0000000..160743f --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@AllArgsConstructor +@Getter +public enum DepartGroupEnum { + + COUNTY_CITY_BUREAUS(3, "分县市局"), + BUREAU_AFFILIATED(4, "局属单位"); + + private Integer id; + + private String label; +} 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..18b7a41 --- /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 Integer value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java new file mode 100644 index 0000000..2130ac6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2024/10/17 + */ +public enum DistributionCycleEnum { + day, + weekly +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java new file mode 100644 index 0000000..25f8809 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/17 + */ +@AllArgsConstructor +@Getter +public enum DistributionFlowEnum { + + SECOND("2"), + THIRD("3"); + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java new file mode 100644 index 0000000..76aa7d5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/17 + */ +@AllArgsConstructor +@Getter +public enum DistributionMethodEnum { + + // 问题下发 + NEGATIVE_DISTRIBUTE("1"), + // 数据保存 + DATA_SAVE("2"), + // 预警通知 + WARNING_NOTIFICATION("3"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java new file mode 100644 index 0000000..cd2b2e5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/17 + */ +@AllArgsConstructor +public enum DistributionStateEnum { + + // 未分发 + UNDISTRIBUTED("0"), + // 已分发 + DISTRIBUTED("1"), + // 已处置 + HANDLED("2"); + + @Getter + private String 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/InitialPetition.java b/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java new file mode 100644 index 0000000..8de6cca --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * + * @author wxc + * @date 2024/10/22 + */ +@Getter +@AllArgsConstructor +public enum InitialPetition { + + THE_FIRST("1", "初访"), + + REPEAT("2", "重访"); + + private String value; + + public String label; + + public static String getValue(String str) { + if ("初".equals(str)) { + return THE_FIRST.getValue(); + } + if ("重".equals(str)) { + return REPEAT.getValue(); + } + for (InitialPetition value : values()) { + if (value.getLabel().equals(str)) { + return value.getValue(); + } + } + return null; + } + +} \ No newline at end of file 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/NegativeTaskCategoryEnum.java b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java new file mode 100644 index 0000000..04aa08d --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum NegativeTaskCategoryEnum { + IMPORT("0"), + EXPORT("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java new file mode 100644 index 0000000..3102a9d --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum NegativeTaskStatusEnum { + SUCCESS("0"), + FAIL("1"), + PADDING("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java new file mode 100644 index 0000000..c0bd005 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Getter +@AllArgsConstructor +public enum PersonTypeEnum { + + police("1", "民警"), + works("2", "职工"), + aux("3", "辅警"), + clerk("4", "文员"), + xj("5", "协警"); + private String value; + private String label; +} 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..9bc160e --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ProblemSourcesEnum { + XCDC("现场督察", "13"), + SZDC("数字督察", "14"), + ZXDC("专项督察", "15"), + SPDC("视频督察", "16"), + + A12389("12389", "17"), + SLDJB("市局领导交办", "18"), + ZDDJB("支队领导交办", "19"), + SJJB("上级交办", "20"), + + GJXFPT("国家信访平台", "21"), + GABXF("公安部信访", "22"), + JZXX("局长信箱", "23"), + XF12337("12337信访", "24"), + XF_QT("其他", "25"), + + SJJD("审计监督", "26"), + + JWDC("警务评议", "2"), + JYDC("警意调查", "3"), + CFJD("持法监督", "4"), + JCKH("检查考核", "8"), + QT("其他", "9"), + LMGZ("灵敏感知", "27"); + + 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..617753f --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum ProcessingStatusEnum { + + signing("签收中"), + processing("办理中"), + approval("审批中"), + completed("已办结"); + + @Getter + private String label; + + public static String getLabel(String name) { + for (ProcessingStatusEnum value : values()) { + if (value.name().equals(name)) { + return value.getLabel(); + } + } + return null; + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java b/src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java new file mode 100644 index 0000000..0ad1243 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.constants.enums; + + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum RepeatEnum { + + FIRST_MAIL(1, "初访信件"), + REPEAT_MAIL(2, "重访信件"); + + private Integer id; + + private String label; + +} 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..695e60b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/AuthController.java @@ -0,0 +1,79 @@ +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); + } + } + if (Objects.isNull(user)) { + throw new AuthException(); + } + 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..a1dd2d9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/FileController.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.io.IoUtil; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.vo.FileVo; +import com.biutag.supervision.service.FileService; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +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 FileService fileService; + + @ResponseBody + @PostMapping("upload") + public Result upload(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件上传 upload------------------------------"); + String filePath = fileService.upload(file); + return Result.success(new FileVo() + .setFileName(file.getOriginalFilename()) + .setFilePath(filePath)); + } + + @GetMapping("stream/**") + public void download(HttpServletRequest request, HttpServletResponse response) throws IOException { + String filePath = request.getRequestURI().substring(12); + if (filePath.toLowerCase().endsWith(".pdf")) { + response.setContentType("application/pdf"); + } else { + response.setContentType("application/octet-stream"); + } + IoUtil.copy(fileService.download(filePath), 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..41d4624 --- /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.getByLogin(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..57a635f --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/StatisticsController.java @@ -0,0 +1,156 @@ +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() + .eq(Negative::getProcessingStatus, ProcessingStatusEnum.signing.name()) + .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::getProcessingStatus, ProcessingStatusEnum.processing.name()) + .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..69d5a3b --- /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.alibaba.fastjson.JSON; +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 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.saveByJwpy(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("警务调查责任民警查询,返回结果数量: {}", list.size()); + 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/baseData/BusinessDepartController.java b/src/main/java/com/biutag/supervision/controller/baseData/BusinessDepartController.java new file mode 100644 index 0000000..b76bc44 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/baseData/BusinessDepartController.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.controller.baseData; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.model.BusinessPoliceModel; +import com.biutag.supervision.pojo.param.BusinessQueryParam; +import com.biutag.supervision.service.BusinessDepartService; +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("baseData/depart") +@RestController +public class BusinessDepartController { + private final BusinessDepartService businessDepartService; + + @GetMapping("page") + public Result> page(BusinessQueryParam businessQueryParam) { + return Result.success(businessDepartService.page(businessQueryParam)); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/baseData/BusinessPoliceController.java b/src/main/java/com/biutag/supervision/controller/baseData/BusinessPoliceController.java new file mode 100644 index 0000000..b2be0a0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/baseData/BusinessPoliceController.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.controller.baseData; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.model.BusinessPoliceModel; +import com.biutag.supervision.pojo.param.BusinessQueryParam; +import com.biutag.supervision.service.BusinessPoliceService; +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("baseData/police") +@RestController +public class BusinessPoliceController { + + private final BusinessPoliceService businessPoliceService; + + @GetMapping("page") + public Result> page(BusinessQueryParam businessQueryParam) { + return Result.success(businessPoliceService.page(businessQueryParam)); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java new file mode 100644 index 0000000..9ca59c1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java @@ -0,0 +1,119 @@ +package com.biutag.supervision.controller.data; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.exception.ExcelDataConvertException; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute; +import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; +import com.biutag.supervision.service.DataCaseVerifService; +import com.biutag.supervision.service.SupDepartService; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Slf4j +@RequestMapping("data/caseVerif") +@RequiredArgsConstructor +@RestController +public class DataCaseVerifController { + + private final DataCaseVerifService dataCaseVerifService; + + private final SupDepartService departService; + + private final Validator validator; + + @GetMapping + public Result> list(DataCaseVerifQueryParam queryParam) { + return Result.success(dataCaseVerifService.page(queryParam)); + } + + @PostMapping("import") + public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件导入中------------------------------"); + String fileNameType = FileUtil.extName(file.getOriginalFilename()); + if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { + throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); + } + List list = new ArrayList<>(); + List secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue())); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataCaseVerifImportDto.class, new ReadListener() { + @Override + public void invoke(DataCaseVerifImportDto data, AnalysisContext analysisContext) { + String secondDepartId = secondDeparts.stream() + .filter(item -> item.getShortName().equals(data.getSecondDepartName())).findFirst() + .map(SupDepart::getId).orElse(""); + data.setSecondDepartId(secondDepartId); + if (StrUtil.isNotBlank(secondDepartId)) { + String complainedThirdDepartId = departService.list(new LambdaQueryWrapper().eq(SupDepart::getPid, secondDepartId) + .like(SupDepart::getShortName, data.getThirdDepartName())) + .stream().findFirst().map(SupDepart::getId).orElse(""); + data.setThirdDepartId(complainedThirdDepartId); + } + Set> validate = validator.validate(data); + if (!validate.isEmpty()) { + String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n")); + data.setErrMsg(message); + data.setState("fail"); + } else { + data.setState("success"); + } + list.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet(0).build(); + try { + excelReader.read(sheet); + } catch (ExcelDataConvertException e) { + log.error(e.getMessage(), e); + throw new RuntimeException("日期格式错误"); + } + excelReader.close(); + return Result.success(list); + } + + @PostMapping("{dataUpdateMethod}") + public Result add(@RequestBody List body, @PathVariable String dataUpdateMethod) { + if (body.isEmpty()) { + return Result.success(); + } + return Result.success(dataCaseVerifService.save(body, dataUpdateMethod)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(dataCaseVerifService.removeById(id)); + } + + @PostMapping("distribute") + public Result distribute(@RequestBody DataCaseVerifDistribute dataDistribute) { + return Result.success(dataCaseVerifService.distribution(dataDistribute)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java new file mode 100644 index 0000000..893fbad --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java @@ -0,0 +1,134 @@ +package com.biutag.supervision.controller.data; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.constants.enums.InitialPetition; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute; +import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto; +import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; +import com.biutag.supervision.service.DataPetitionComplaintService; +import com.biutag.supervision.service.SupDepartService; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * + * @author wxc + * @date + */ +@Slf4j +@RequiredArgsConstructor +@RequestMapping("data/petitionComplaint") +@RestController +public class DataPetitionComplaintController { + + private final DataPetitionComplaintService dataPetitionComplaintService; + + private final SupDepartService departService; + + private final Validator validator; + + @GetMapping + public Result> list(DataPetitionComplaintQueryParam queryParam) { + return Result.success(dataPetitionComplaintService.page(queryParam)); + } + + @PostMapping("import") + public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件导入中------------------------------"); + String fileNameType = FileUtil.extName(file.getOriginalFilename()); + if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { + throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); + } + List secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue())); + + List list = new ArrayList<>(); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener() { + + @Override + public void invoke(DataPetitionComplaintImportDto data, AnalysisContext analysisContext) { + if ("是".equals(data.getEntanglementVisitsLabel())) { + data.setEntanglementVisits(true); + } + if ("否".equals(data.getEntanglementVisitsLabel())) { + data.setEntanglementVisits(false); + } + if ("是".equals(data.getMassVisitsLabel())) { + data.setMassVisits(true); + } + if ("否".equals(data.getMassVisitsLabel())) { + data.setMassVisits(false); + } + data.setInitialPetition(InitialPetition.getValue(data.getInitialPetition())); + + String secondDepartId = secondDeparts.stream() + .filter(item -> item.getShortName().equals(data.getInvolveSecondDepartName())).findFirst() + .map(SupDepart::getId).orElse(""); + data.setInvolveSecondDepartId(secondDepartId); + if (StrUtil.isNotBlank(secondDepartId)) { + String complainedThirdDepartId = departService.list(new LambdaQueryWrapper().eq(SupDepart::getPid, secondDepartId) + .like(SupDepart::getShortName, data.getInvolveThirdDepartName())) + .stream().findFirst().map(SupDepart::getId).orElse(""); + data.setInvolveThirdDepartId(complainedThirdDepartId); + } + Set> validate = validator.validate(data); + if (!validate.isEmpty()) { + String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n")); + data.setErrMsg(message); + data.setState("fail"); + } else { + data.setState("success"); + } + list.add(data); + } + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet(0).build(); + excelReader.read(sheet); + excelReader.close(); + return Result.success(list); + } + + @PostMapping() + public Result add(@RequestBody DataPetitionComplaintAddDto body) { + if (body.getData().isEmpty()) { + return Result.success(); + } + return Result.success(dataPetitionComplaintService.save(body)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(dataPetitionComplaintService.removeById(id)); + } + + @PostMapping("distribute") + public Result distribute(@RequestBody DataDataPetitionComplainDistribute dataDistribute) { + return Result.success(dataPetitionComplaintService.distribution(dataDistribute)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java b/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java new file mode 100644 index 0000000..ff0bbdf --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java @@ -0,0 +1,79 @@ +package com.biutag.supervision.controller.datav; + + +import cn.hutool.core.util.NumberUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.biutag.supervision.constants.enums.DepartGroupEnum; +import com.biutag.supervision.constants.enums.RepeatEnum; +import com.biutag.supervision.mapper.DataCaseVerifMapper; +import com.biutag.supervision.mapper.DataPetitionComplaintMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.CaseVerifDepart; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.service.DataPetitionComplaintService; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * @author: sh + * @date: 2024/10/31 + */ +@RequestMapping("datav/mailVisits") +@RequiredArgsConstructor +@RestController +public class DataPetitionComplaintViewController { + + private final DataPetitionComplaintService dataPetitionComplaintService; + private final DataPetitionComplaintMapper dataPetitionComplaintMapper; + + /** + * 信访数据大屏统计 + * + * @param beginTime + * @param endTime + * @return + */ + @GetMapping + public Result mailVisits(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 信访数据总数概览 + JSONObject overview = dataPetitionComplaintService.allMailCount(beginTime, endTime); + // 分县市局信初重访领导访排名 + List fxsjFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); + List fxsjRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); + List fxsjLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime); + // 部委支队初重领导访排名 + List bwzdFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); + List bwzdRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); + List bwzdLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime); + // 分县市局领导督办、缠访、集访排名 + List fxsjEntanglementMailList = dataPetitionComplaintMapper.selectEntanglementMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), 1, beginTime, endTime); + List fxsjMassMailList = dataPetitionComplaintMapper.selectMassMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), 1, beginTime, endTime); + // 部委支队缠访集访排名 + List bwzdEntanglementMailList = dataPetitionComplaintMapper.selectEntanglementMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), 1, beginTime, endTime); + List bwzdMassMailList = dataPetitionComplaintMapper.selectMassMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), 1, beginTime, endTime); + JSONObject data = new JSONObject().fluentPut("overview", overview) + .fluentPut("fxsjFirstMailList", fxsjFirstMailList) + .fluentPut("fxsjRepeatMailList", fxsjRepeatMailList) + .fluentPut("fxsjLeaderViewMailList", fxsjLeaderViewMailList) + .fluentPut("bwzdFirstMailList", bwzdFirstMailList) + .fluentPut("bwzdRepeatMailList", bwzdRepeatMailList) + .fluentPut("bwzdLeaderViewMailList", bwzdLeaderViewMailList) + .fluentPut("fxsjEntanglementMailList", fxsjEntanglementMailList) + .fluentPut("fxsjMassMailList", fxsjMassMailList) + .fluentPut("bwzdEntanglementMailList", bwzdEntanglementMailList) + .fluentPut("bwzdMassMailList", bwzdMassMailList); + return Result.success(data); + } + + +} diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java new file mode 100644 index 0000000..41283dd --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -0,0 +1,78 @@ +package com.biutag.supervision.controller.datav; + +import cn.hutool.core.util.NumberUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.constants.enums.CaseVerifProblemNatureEnum; +import com.biutag.supervision.constants.enums.DepartGroupEnum; +import com.biutag.supervision.mapper.DataCaseVerifMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.CaseVerifDepart; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.service.DataCaseVerifService; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/24 + */ +@RequestMapping("datav/caseVerif") +@RequiredArgsConstructor +@RestController +public class DataVCaseVerifController { + + private final DataCaseVerifService dataCaseVerifService; + + private final DataCaseVerifMapper dataCaseVerifMapper; + + @GetMapping + public Result caseVerif(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + long total = dataCaseVerifService.count(new LambdaQueryWrapper().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime)); + long confirmed = 0; + JSONObject overview = new JSONObject() + // 案件总数(起) + .fluentPut("total", total) + // 查实案件数 + .fluentPut("confirmed", 0) + // 查处问题(个) + .fluentPut("investigateAndPunish", 0) + // 问责人次 + .fluentPut("accountablePeopleNumber", 0) + // 问责单位数 + .fluentPut("accountableDepartNumber", 0) + // 查实率 + .fluentPut("confirmedRate", total == 0 ? 0 : BigDecimal.valueOf(NumberUtil.div(confirmed, total) * 100).intValue()); + // 分县市局排名 + List fxsjBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime); + // 局属单位排名 + List jsdwBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime); + // 执法办案 + List zfbaPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.ZFBA.getLaebl(), beginTime, endTime); + // 服务管理 + List fwglPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.FWGL.getLaebl(), beginTime, endTime); + // 警察纪警规 + List jjjgPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.JJJG.getLaebl(), beginTime, endTime); + // 案件来源占比 + List ajlyPieList = dataCaseVerifMapper.selectGroupByProblemSources(beginTime, endTime); + + JSONObject data = new JSONObject().fluentPut("overview", overview) + .fluentPut("fxsjBarList", fxsjBarList) + .fluentPut("jsdwBarList", jsdwBarList) + .fluentPut("zfbaPieList", zfbaPieList) + .fluentPut("fwglPieList", fwglPieList) + .fluentPut("jjjgPieList", jjjgPieList) + .fluentPut("ajlyPieList", ajlyPieList); + return Result.success(data); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java new file mode 100644 index 0000000..edeee4c --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java @@ -0,0 +1,54 @@ +package com.biutag.supervision.controller.datav; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.model.DataRightsComfortModel; +import com.biutag.supervision.service.DataRightsComfortService; +import com.biutag.supervision.service.RpcApplyService; +import com.biutag.supervision.service.RpcInfringerResultService; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +@RequestMapping("datav/rightsComfort") +@RequiredArgsConstructor +@RestController +public class DatavRightsComfortController { + + private final RpcApplyService rpcApplyService; + + private final DataRightsComfortService dataRightsComfortService; + private final RpcInfringerResultService rpcInfringerResultService; + + @GetMapping + public Result rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + DataRightsComfortModel result = new DataRightsComfortModel(); + // 维权案件总数 + + // 受侵害人数 + + // 抚慰人数 + result.setComfortPersonNumber(dataRightsComfortService.countComfortPersonNumber(beginTime, endTime)); + // 打击处理人数 + result.setHitPersonNumber(dataRightsComfortService.countHitPersonNumber(beginTime, endTime)); + // 抚慰金额(万元) + result.setComfortMoney(dataRightsComfortService.countComfortMoney(beginTime, endTime)); + // 维权案件情况 + + // 案件类别占比 + + // 打处情况 + result.setPunishmentSituation(dataRightsComfortService.selectPunishmentSituation(beginTime, endTime)); + // 抚慰情况 + result.setComfortSituation(dataRightsComfortService.selectComfortSituation(beginTime, endTime)); + // 民辅警受伤情况 + + // 发案情况占比 + + return Result.success(result); + } +} 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/ModelClueController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueController.java new file mode 100644 index 0000000..5c223d8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueController.java @@ -0,0 +1,58 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.ModelClueDepartDto; +import com.biutag.supervision.pojo.dto.ModelClueTaskDistribute; +import com.biutag.supervision.pojo.entity.ModelClue; +import com.biutag.supervision.pojo.model.ModelClueModel; +import com.biutag.supervision.pojo.param.ModelClueQueryParam; +import com.biutag.supervision.service.ModelClueService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +/** + * @author wxc + * @date 2024/10/16 + */ +@RequestMapping("model/clues") +@RequiredArgsConstructor +@RestController +public class ModelClueController { + + private final ModelClueService modelClueService; + + @GetMapping + public Result> page(ModelClueQueryParam param) { + return Result.success(modelClueService.page(param)); + } + + @GetMapping("{id}") + public Result page(@PathVariable Integer id) { + ModelClueModel modelClueModel = new ModelClueModel(); + ModelClue modelClue = modelClueService.getById(id); + BeanUtils.copyProperties(modelClue, modelClueModel); + return Result.success(modelClueModel); + } + + /** + * 手动分发 + * @param taskDistribute + * @return + */ + @PostMapping("task/distribute/manuel") + public Result manuelDistribute(@RequestBody ModelClueTaskDistribute taskDistribute) { + return Result.success(modelClueService.distribution(taskDistribute)); + } + + @PostMapping("{id}/updateDepart") + public Result updateDepart(@PathVariable Integer id, @RequestBody ModelClueDepartDto departDto) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .eq(ModelClue::getId, id) + .set(ModelClue::getInvolveDepartId, departDto.getDepartId()); + return Result.success(modelClueService.update(updateWrapper)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java new file mode 100644 index 0000000..8be86bb --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.ModelClueRecord; +import com.biutag.supervision.service.ModelClueRecordService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author wxc + * @date 2024/10/16 + */ +@RequestMapping("model/clue/records") +@RequiredArgsConstructor +@RestController +public class ModelClueRecordController { + + private final ModelClueRecordService modelClueRecordService; + + @GetMapping("/{modelId}/top") + public Result> list(@PathVariable Integer modelId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(ModelClueRecord::getModelId, modelId) + .orderByDesc(ModelClueRecord::getCreateTime); + return Result.success(modelClueRecordService.page(new Page<>(1, 8), queryWrapper).getRecords()); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java new file mode 100644 index 0000000..4baa0a1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel; +import com.biutag.supervision.pojo.model.ModelClueTaskModel; +import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam; +import com.biutag.supervision.service.ModelClueTaskService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author wxc + * @date 2024/10/16 + */ +@RequestMapping("model/clue/tasks") +@RequiredArgsConstructor +@RestController +public class ModelClueTaskController { + + private final ModelClueTaskService modelClueTaskService; + + @GetMapping + public Result> page(ModelClueTaskQueryParam param) { + return Result.success(modelClueTaskService.page(param)); + } + + @GetMapping("{taskId}/byDepart") + public Result> listDepart(@PathVariable Integer taskId) { + return Result.success(modelClueTaskService.listDepart(taskId)); + } + +} 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..49a15ce --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java @@ -0,0 +1,75 @@ +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.pojo.Result; +import com.biutag.supervision.pojo.entity.Model; +import com.biutag.supervision.pojo.entity.ModelClass; +import com.biutag.supervision.pojo.param.ModelQueryParam; +import com.biutag.supervision.pojo.vo.ModelTree; +import com.biutag.supervision.service.ModelClassService; +import com.biutag.supervision.service.ModelService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@RequestMapping("models") +@RequiredArgsConstructor +@RestController +public class ModelController { + + private final ModelService modelService; + + private final ModelClassService modelClassService; + + @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)); + } + + @GetMapping("tree") + public Result> tree() { + List modelClasses = modelClassService.list(); + List models = modelService.list(); + List list = new ArrayList<>(); + list.addAll(modelClasses.stream().map(item -> { + ModelTree node = new ModelTree(); + node.setValue(item.getId()); + node.setLabel(item.getName()); + node.setType("modelClass"); + List children = models.stream().filter(model -> item.getId().equals(model.getClassId())).map(ModelTree::of).toList(); + node.setChildren(children); + return node; + }).toList()); + list.addAll(models.stream().filter(model -> Objects.isNull(model.getClassId())).map(ModelTree::of).toList()); + return Result.success(list); + } + + @PostMapping + public Result add(@RequestBody Model model) { + + return Result.success(modelService.saveModel(model)); + } + + @PutMapping + public Result update(@RequestBody Model model) { + modelService.updateModel(model); + return Result.success(model); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable Integer id) { + return Result.success(modelService.remove(id)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java new file mode 100644 index 0000000..5cea706 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -0,0 +1,81 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.InspectCaseEnum; +import com.biutag.supervision.constants.enums.PersonTypeEnum; +import com.biutag.supervision.mapper.ProfileDepartMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.ProfileDepart; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeBlame; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.DepartNegativeModel; +import com.biutag.supervision.pojo.param.DepartNegativeQueryParam; +import com.biutag.supervision.service.NegativeBlameService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.SupPoliceService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 单位/个人画像 + * @author wxc + * @date 2024/10/31 + */ +@RequiredArgsConstructor +@RequestMapping("profile/depart") +@RestController +public class ProfileDepartController { + + private final ProfileDepartMapper profileDepartMapper; + private final SupDepartService departService; + private final SupPoliceService policeService; + private final NegativeService negativeService; + private final NegativeBlameService blameService; + + @GetMapping + public Result> list(DepartNegativeQueryParam param) { + Date beginTime = DateUtil.parse("1949", "YYYY"); + Date endTime = new Date(); + if (Objects.nonNull(param.getCrtTime()) && !param.getCrtTime().isEmpty()) { + beginTime = param.getCrtTime().get(0); + endTime = param.getCrtTime().get(1); + } + Page page = profileDepartMapper.queryDepartNegative(Page.of(param.getCurrent(), param.getSize()), beginTime, endTime, param.getDepartName(), param.getDepartId()); + return Result.success(page); + } + + @GetMapping("{departId}") + public Result profile(@PathVariable String departId, Date beginTime, Date endTime) { + ProfileDepart profileDepart = new ProfileDepart(); + SupDepart depart = departService.getById(departId); + profileDepart.getDepartInfo() + .setName(depart.getName()) + .setShortName(depart.getShortName()); + List polices = policeService.listAllByDepartId(departId); + profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null)); + profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList()); + // 民警数量 + profileDepart.getDepartInfo().setPoliceSize(polices.stream().filter(item -> PersonTypeEnum.police.getValue().equals(item.getPersonStatus())).count()); + + // 协警辅警数量 + profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonStatus()) || PersonTypeEnum.xj.getValue().equals(item.getPersonStatus())).count()); + long negativeSize = negativeService.count(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) + .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); + profileDepart.getNegativeInfo().setSize(negativeSize); + + return Result.success(profileDepart); + } + +} 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..3d8ae14 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -0,0 +1,100 @@ +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.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.DepartQueryParam; +import com.biutag.supervision.pojo.param.DepartTreeListParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.SupPoliceService; +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; + + public final SupPoliceService policeService; + + @GetMapping + public Result> treeList(DepartTreeListParam departTreeListParam) { + return Result.success(departService.buildTreeByParam(departTreeListParam)); + } + + @GetMapping("list") + public Result> list(DepartQueryParam departQueryParam) { + return Result.success(departService.page(departQueryParam)); + } + + @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) { + if (policeService.exists(id)) { + throw new RuntimeException("该单位下还有警务人员,请移除后再删除"); + } + return Result.success(departService.removeById(id)); + } + + @GetMapping("tree") + public Result> tree() { + return Result.success(departService.buildTreeByAuth()); + } + + @GetMapping("second") + public Result> seconds() { + List supDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND_CATEGORY.getValue(), DepartLevelEnum.SECOND.getValue())); + return Result.success(departService.buildTreeBySecond(supDeparts)); + } + + @GetMapping("firstHost") + public Result> firstHost() { + return Result.success(departService.buildTreeByFirstHost()); + } + + @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..203c210 --- /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.SupDictProblemType; +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 SupDictProblemType dictContent) { + dictContent.setUpdTime(LocalDateTime.now()); + dictContent.setCrtTime(LocalDateTime.now()); + dictContent.setStatus("0"); + dictContentService.save(dictContent); + dictContentService.update(new LambdaUpdateWrapper().eq(SupDictProblemType::getId, dictContent.getId()).set(SupDictProblemType::getCode, dictContent.getId())); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDictProblemType 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(SupDictProblemType::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..550fefd --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DictController.java @@ -0,0 +1,104 @@ +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.core.conditions.update.LambdaUpdateWrapper; +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.DictProblemSourceTree; +import com.biutag.supervision.service.SupDictDataService; +import com.biutag.supervision.service.SupDictProblemSourceService; +import com.biutag.supervision.service.SupDictTypeService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("dict") +@RestController +public class DictController { + + private final SupDictTypeService dictTypeService; + + private final SupDictDataService dictDataService; + + private final SupDictProblemSourceService dictProblemSourceService; + + @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)); + } + + @PutMapping + public Result update(@RequestBody DictTypeDto dictType) { + SupDictType supDictType = new SupDictType(); + BeanUtil.copyProperties(dictType, supDictType); + supDictType.setUpdateTime(LocalDateTime.now()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().ne(SupDictType::getDictId, dictType.getDictId()).eq(SupDictType::getDictType, dictType.getDictType()); + if (dictTypeService.exists(queryWrapper)) { + throw new RuntimeException("字典类型已存在"); + } + SupDictType oldSupDictType = dictTypeService.getById(dictType.getDictId()); + if (!oldSupDictType.getDictType().equals(supDictType.getDictType())) { + // 更新 + dictDataService.update(new LambdaUpdateWrapper().eq(SupDictData::getDictType, oldSupDictType.getDictType()).set(SupDictData::getDictType, dictType.getDictType())); + } + return Result.success(dictTypeService.updateById(supDictType)); + } + + @DeleteMapping("{dictId}") + public Result update(@PathVariable Integer dictId) { + return Result.success(dictTypeService.removeById(dictId)); + } + @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))); + } + + @GetMapping("problemSource") + public Result> listProblemSource() { + return Result.success(dictProblemSourceService.buildTree()); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/HolidayController.java b/src/main/java/com/biutag/supervision/controller/system/HolidayController.java new file mode 100644 index 0000000..a331b0b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/HolidayController.java @@ -0,0 +1,71 @@ +package com.biutag.supervision.controller.system; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Holiday; +import com.biutag.supervision.service.HolidayService; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDate; +import java.time.temporal.TemporalAdjusters; +import java.util.ArrayList; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("holiday") +@RestController +public class HolidayController { + + private final HolidayService holidayService; + + public static final List months = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12); + + @GetMapping("{year}") + public Result> list(@PathVariable Integer year) { + List holidays = holidayService.list(year); + List list = months.stream().map(month -> { + HolidayVo holidayVo = new HolidayVo(); + holidayVo.setMonth(month); + LocalDate beginDay = LocalDate.of(year, month, 1); + int beginDayOfWeek = beginDay.getDayOfWeek().getValue(); + for (int i = 0; i < (beginDayOfWeek != 0 ? beginDayOfWeek - 1 : 6); i++) { + holidayVo.getDays().add(new Day()); + } + LocalDate.of(year, month, 1); + for (int i = 1; i <= beginDay.with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth(); i++) { + String date = LocalDate.of(year, month, i).toString(); + Boolean flag = holidays.stream().filter(item -> item.getDate().equals(date)).findFirst().map(Holiday::getFlag).orElse(false); + holidayVo.getDays().add(Day.of(i, flag)); + } + return holidayVo; + }).toList(); + return Result.success(list); + } + + @Setter + @Getter + public static class HolidayVo { + private Integer month; + private List days = new ArrayList<>(); + } + + @Setter + @Getter + public static class Day { + private Integer day; + private Boolean flag = false; + + public static Day of(Integer day, Boolean flag) { + Day obj = new Day(); + obj.setDay(day); + obj.setFlag(flag); + return obj; + } + } + +} 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..90ac260 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/MenuController.java @@ -0,0 +1,51 @@ +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(); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable Integer id) { + return Result.success(menuService.removeById(id)); + } + +} 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..c54ae56 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java @@ -0,0 +1,249 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.constants.enums.InitialPetition; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.PoliceAuth; +import com.biutag.supervision.pojo.dto.PoliceImport; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.PoliceModel; +import com.biutag.supervision.pojo.param.PoliceQueryParam; +import com.biutag.supervision.service.*; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +@RequestMapping("police") +@RequiredArgsConstructor +@RestController +public class PoliceController { + + private final SupPoliceService policeService; + + private final SupDepartService departService; + + private final NegDepartAuthorityService negDepartAuthorityService; + + private final NegSourceAuthorityService negSourceAuthorityService; + + private final Validator validator; + + @GetMapping + public Result> list(PoliceQueryParam param) { + return Result.success(policeService.page(param)); + } + + @PostMapping + public Result add(@RequestBody SupPolice police) { + SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, police.getEmpNo())); + if (Objects.nonNull(policeByEmpNo)) { + SupDepart depart = departService.getById(policeByEmpNo.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getEmpNo(), depart.getName())); + } + SupPolice one = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, police.getIdCode())); + if (Objects.nonNull(one)) { + SupDepart depart = departService.getById(one.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getIdCode(), depart.getName())); + } + police.setId(IdUtil.getSnowflakeNextIdStr()); + police.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + police.setCreatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + return Result.success(policeService.save(police)); + } + + @PutMapping + public Result update(@RequestBody SupPolice police) { + SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, police.getEmpNo()).ne(SupPolice::getId, police.getId())); + if (Objects.nonNull(policeByEmpNo)) { + SupDepart depart = departService.getById(policeByEmpNo.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getEmpNo(), depart.getName())); + } + SupPolice one = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, police.getIdCode()).ne(SupPolice::getId, police.getId())); + if (Objects.nonNull(one)) { + SupDepart depart = departService.getById(one.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getIdCode(), depart.getName())); + } + police.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + return Result.success(policeService.updateById(police)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(policeService.removeById(id)); + } + + @GetMapping("{departId}/all") + public Result> all(@PathVariable String departId) { + return Result.success(policeService.listAllByDepartId(departId)); + } + + @GetMapping("{departId}/leader") + public Result> leader(@PathVariable String departId) { + return Result.success(policeService.listLeaderByDepartId(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(); + } + + private final BaseUserService userService; + private final BaseAccountService accountService; + private final SupDictProblemSourceService dictProblemSourceService; + + @PostMapping("import") + public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + String fileNameType = FileUtil.extName(file.getOriginalFilename()); + if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { + throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); + } + List list = new ArrayList<>(); + List problemSources = dictProblemSourceService.list(); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), PoliceImport.class, new ReadListener() { + @Override + public void invoke(PoliceImport data, AnalysisContext analysisContext) { + Set> validate = validator.validate(data); + if (!validate.isEmpty()) { + String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n")); + throw new RuntimeException(String.format("第%s条数据的异常:%s", list.size() + 1, message)); + } + list.add(data); + } + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet(0).build(); + excelReader.read(sheet); + excelReader.close(); + for (int i = 0; i < list.size(); i++) { + PoliceImport police = list.get(i); + SupDepart depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2)); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("%s 该单位在系统中未找到,请核实", police.getSecondDepartName())); + } + if (StrUtil.isNotBlank(police.getThirdDepartName())) { + depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getPid, depart.getId()) + .eq(SupDepart::getShortName, police.getThirdDepartName()).eq(SupDepart::getLevel, 3)); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("%s/%s 该单位在系统中未找到,请核实", police.getSecondDepartName(), police.getThirdDepartName())); + } + } + SupPolice supPolice = policeService.getByIdCode(list.get(i).getIdCode()); + if (supPolice == null) { + supPolice = new SupPolice(); + supPolice.setName(police.getName()); + supPolice.setIdCode(police.getIdCode()); + supPolice.setEmpNo(police.getEmpNo()); + supPolice.setOrgId(depart.getId()); + + } else { + supPolice.setName(police.getName()); + supPolice.setIdCode(police.getIdCode()); + supPolice.setEmpNo(police.getEmpNo()); + supPolice.setOrgId(depart.getId()); + if (police.getEmpNo().contains("A")) { + supPolice.setPersonType("3"); + } else { + supPolice.setPersonType("1"); + } + policeService.updateById(supPolice); + } + if ("三级机构专班".equals(police.getRole()) || "二级机构专班".equals(police.getRole())) { + String userId = saveOrUpdateUser(police); + // 角色 + addRoleUser(userId, police.getRole()); + // 权限 + addAuth(police.getIdCode(), supPolice.getOrgId(), problemSources); + } + + } + return Result.success(list); + } + + public String saveOrUpdateUser(PoliceImport police) { + BaseUser user = userService.getByUserName(police.getIdCode()); + if (user != null) { + return user.getUserId(); + } + BaseUser baseUser = new BaseUser(); + baseUser.setUserName(police.getIdCode()); + baseUser.setNickName(police.getName()); + baseUser.setUserType("admin"); + baseUser.setCreateTime(LocalDateTime.now()); + baseUser.setUpdateTime(LocalDateTime.now()); + userService.save(baseUser); + BaseAccount account = new BaseAccount(); + account.setAccount(police.getIdCode()); + account.setUserId(baseUser.getUserId()); + account.setAccountType("username"); + account.setDomain("@admin.com"); + account.setPassword("$2a$10$q0NbHH1fbkDotxJ1dT7PbOcV4G47R8n15uVxz2.imTiDqdCwAJYBC"); + account.setDomain("@admin.com"); + account.setCreateTime(LocalDateTime.now()); + account.setUpdateTime(LocalDateTime.now()); + accountService.save(account); + return baseUser.getUserId(); + } + + private final BaseRoleUserService roleUserService; + public void addRoleUser(String userId, String role) { + roleUserService.remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + BaseRoleUser baseRoleUser = new BaseRoleUser(); + baseRoleUser.setUserId(userId); + if ("三级机构专班".equals(role)) { + baseRoleUser.setRoleId("5"); + } + if ("二级机构专班".equals(role)) { + baseRoleUser.setRoleId("4"); + } + baseRoleUser.setCreateTime(LocalDateTime.now()); + baseRoleUser.setUpdateTime(LocalDateTime.now()); + roleUserService.save(baseRoleUser); + } + + public void addAuth(String idCode, String orgId, List problemSources) { + negDepartAuthorityService.remove(new LambdaQueryWrapper().eq(NegDepartAuthority::getIdCode, idCode)); + NegDepartAuthority authority = new NegDepartAuthority(); + authority.setDepartId(orgId); + authority.setIdCode(idCode); + negDepartAuthorityService.save(authority); + negSourceAuthorityService.remove(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); + + List list = problemSources.stream().map(item -> { + NegSourceAuthority sourceAuthority = new NegSourceAuthority(); + sourceAuthority.setIdCode(idCode); + sourceAuthority.setSource(item.getId()); + return sourceAuthority; + }).toList(); + negSourceAuthorityService.saveBatch(list); + } +} \ 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..eda9da7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -0,0 +1,68 @@ +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.entity.NegativeTask; +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 com.biutag.supervision.service.NegativeTaskService; +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; + + private final NegativeTaskService negativeTaskService; + + @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)); + } + + @PostMapping("export/excel") + public Result export(NegativeQueryParam queryParam) { + queryParam.setSize(10000); + queryParam.setCurrent(1); + Page page = negativeQueryService.page(queryParam); + NegativeTask negativeTask = negativeTaskService.save(page.getRecords().size()); + negativeTaskService.updateExcel(page.getRecords(), negativeTask.getId()); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result remove(@PathVariable String id) { + return Result.success(negativeService.remove(id)); + } + +} 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/NegativeTaskController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java new file mode 100644 index 0000000..73d52fe --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java @@ -0,0 +1,26 @@ +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.pojo.Result; +import com.biutag.supervision.pojo.entity.NegativeTask; +import com.biutag.supervision.pojo.param.NegativeTaskQueryParam; +import com.biutag.supervision.service.NegativeTaskService; +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("negativeTask") +@RestController +public class NegativeTaskController { + + private final NegativeTaskService negativeTaskService; + + @GetMapping + public Result> page(NegativeTaskQueryParam param) { + return Result.success(negativeTaskService.page(param)); + } + +} 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..5afeb74 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -0,0 +1,182 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +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.VerifyData; +import com.biutag.supervision.pojo.entity.*; +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.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()); + 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() + .eq(Negative::getId, negativeId) + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, now) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) + .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()) + .set(Negative::getCaseNumber, verifyData.getCaseNumber()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName())); + // 未整改 + 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().filter(problem -> StrUtil.isNotBlank(problem.getOneLevelCode())).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); + // 新增涉及人员问题类型 + // 先删除 + negativeProblemRelationService.remove(negativeId); + if (!problemRelations.isEmpty()) { + // 新增 + negativeProblemRelationService.saveBatch(problemRelations); + } + } + if (!verifyData.getFiles().isEmpty()) { + // 先删除 + fileService.remove(negativeId); + // 新增 + fileService.saveBatch(verifyData.getFiles(), negativeId); + } + 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()); + String parentDepartId; + String parentDepartName; + if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { + parentDepartId = AppConstants.ROOT_DEPART_ID; + parentDepartName = AppConstants.ROOT_DEPART_NAME; + } else { + SupDepart parentDepart = departService.getById(depart.getPid()); + parentDepartId = parentDepart.getId(); + parentDepartName = parentDepart.getShortName(); + } + + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, parentDepartId)); + + NegativeWork work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(parentDepartId) + .setDepartName(parentDepartName) + .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..8c391b7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java @@ -0,0 +1,108 @@ +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.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); + } + + 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) { + NegativeWork currentWork = workService.getById(actionDto.getWorkId()); + Negative negative = negativeService.getById(actionDto.getNegativeId()); + String roleCode; + String departId; + String departName; + // 是否是二级机构办理 + if (negative.getIsSecondHandle()) { + roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); + departId = AppConstants.ROOT_DEPART_ID; + departName = AppConstants.ROOT_DEPART_NAME; + } else { + roleCode = RoleCodeEnum.SECOND_ADMIN.getCode(); + SupDepart parentDepart = departService.getParentDepart(currentWork.getDepartId()); + departId = parentDepart.getId(); + departName = parentDepart.getShortName(); + } + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, actionDto.getNegativeId()) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, departId)); + + NegativeWork work = new NegativeWork() + .setNegativeId(actionDto.getNegativeId()) + .setRoleCode(roleCode) + .setDepartId(departId) + .setDepartName(departName) + .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..6e4b102 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -0,0 +1,89 @@ +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; +import java.util.List; + +/** + * 市局 退回整改 + */ +@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) { + Negative negative = negativeService.getById(negativeId); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName())) + .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) { + List works = workService.list(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .orderByDesc(NegativeWork::getCreateTime)); + if (works.isEmpty()) { + throw new RuntimeException("数据异常,请联系管理员:无二级机构工作流程数据"); + } + works.get(0).setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(works.get(0)); + } +} 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..2e0cefd --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java @@ -0,0 +1,114 @@ +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); + SupDepart depart = departService.getById(firstDistributeData.getDepartId()); + // 三级单位办理 + boolean thirdHandling = DepartLevelEnum.THREE.getValue().equals(depart.getLevel()); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), firstDistributeData, thirdHandling); + doneWork(actionDto.getWorkId()); + + addWork(actionDto.getNegativeId(), + thirdHandling ? RoleCodeEnum.THREE_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(), + firstDistributeData.getDepartId(), firstDistributeData.getDepartName()); + } + + public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData, boolean thirdHandling) { + 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::getCurrentProcessingObject, String.format("%s专班", distributeData.getDepartName())) + .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 (thirdHandling) { + 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..62b1151 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionApproveAction.java @@ -0,0 +1,82 @@ +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()); + updateNegative(negative); + 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..bf3ff7e --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java @@ -0,0 +1,98 @@ +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.NegativeFileService; +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; + + private final NegativeFileService fileService; + + @Override + public void next(ActionDto actionDto) { + VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); + updateNegative(actionDto.getNegativeId(), verifyData); + } + + public void updateNegative(String negativeId, VerifyData verifyData) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .eq(Negative::getId, negativeId) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc()) + .set(Negative::getCaseNumber, verifyData.getCaseNumber()) + .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); + } + } + fileService.remove(negativeId); + fileService.saveBatch(verifyData.getFiles(), negativeId); + } + +} 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..c6d2260 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -0,0 +1,104 @@ +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) + .set(Negative::getCurrentProcessingObject, "市局专班"); + } + 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..cd7afeb --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -0,0 +1,92 @@ +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; +import java.util.List; + +/** + * 二级机构 退回整改 + */ +@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) { + Negative negative = negativeService.getById(negativeId); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleThreeDepartName())) + .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) { + List works = workService.list(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .orderByDesc(NegativeWork::getCreateTime)); + if (works.isEmpty()) { + throw new RuntimeException("数据异常,请联系管理员:无三级机构工作流程数据"); + } + works.get(0).setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(works.get(0)); + } + +} 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..bb98ba3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java @@ -0,0 +1,76 @@ +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()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, String.format("%s专班", secondDistributeData.getDepartName())) + .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..44d5e4b --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/SecondSignReturnAction.java @@ -0,0 +1,83 @@ +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()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, "市局专班") + .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..459c0cf --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java @@ -0,0 +1,125 @@ +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.FlowNodeEnum; +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; +import java.util.Objects; + +/** + * 三级机构问题退回 + */ +@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; + + private final NegativeWorkService negativeWorkService; + + @Override + public void next(ActionDto actionDto) { + SignReturnData signReturnData = BeanUtil.toBean(actionDto.getData(), SignReturnData.class); + boolean secondFlag = negativeWorkService.exists(new LambdaQueryWrapper() + .eq(NegativeWork::getRoleCode, RoleCodeEnum.SECOND_ADMIN.getCode()) + .eq(NegativeWork::getNegativeId, actionDto.getNegativeId())); + updateNegative(actionDto.getNegativeId(), secondFlag); + addSignReturn(actionDto, signReturnData.getComments()); + doneWork(actionDto.getWorkId()); + addWork(actionDto.getNegativeId(), secondFlag); + } + + public void updateNegative(String negativeId, boolean secondFlag) { + Negative negative = negativeService.getById(negativeId); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getFlowKey, secondFlag ? FlowNodeEnum.SECOND_SIGN.getKey() : FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) + .set(Negative::getUpdTime, LocalDateTime.now()) + .set(Negative::getProcessingStatus, ProcessingStatusEnum.signing.name()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, secondFlag ? String.format("%s专班", negative.getHandleSecondDepartName()) : "市局专班") + //----------------------------------------------------------------------------- + .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, boolean secondFlag) { + String roleCode = secondFlag ? RoleCodeEnum.SECOND_ADMIN.getCode() : RoleCodeEnum.FIRST_ADMIN.getCode(); + NegativeWork work = workService.getOne(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode)); + if (Objects.nonNull(work)) { + work.setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.updateById(work); + } else { + Negative negative = negativeService.getById(negativeId); + work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(secondFlag ? negative.getHandleSecondDepartId() : AppConstants.ROOT_DEPART_ID) + .setDepartName(secondFlag ? negative.getHandleSecondDepartName() : AppConstants.ROOT_DEPART_NAME) + .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/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java new file mode 100644 index 0000000..f4a8816 --- /dev/null +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -0,0 +1,98 @@ +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.*; +import com.biutag.supervision.util.TimeUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@RequiredArgsConstructor +@Component +public class Job { + + private final NegativeService negativeService; + + private final SupDepartService departService; + + private final BusinessPoliceService businessPoliceService; + + private final BusinessDepartService businessDepartService; + + private final ModelClueService modelClueService; + + // 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())); + } + }); + } + + // 每日04:00更新基础数据 +// @Scheduled(cron = "0 0 4 * * ?") + public void updateBaseData() { + List happenTime = new ArrayList<>(); + Date start = Date.from(LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()); + Date end = Date.from(LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).withNano(0).atZone(ZoneId.systemDefault()).toInstant()); + happenTime.add(start); + happenTime.add(end); + businessDepartService.generate(happenTime); + businessPoliceService.generate(happenTime); + } + +// @Scheduled(cron = "0 0 5 * * ?") + public void executeModel() { + modelClueService.generate(1); + } +} 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..5e9a799 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java @@ -0,0 +1,14 @@ +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; +import org.apache.ibatis.annotations.Select; + +@DS("slave") +public interface BaseAccountMapper extends BaseMapper { + + @Select("select a.* from base_account a left join negative.sup_police p on a.account = p.id_code where a.account = #{account} or p.emp_no = #{account}") + BaseAccount selectByLogin(String account); + +} \ 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/BusinessDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java new file mode 100644 index 0000000..d0ac758 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java @@ -0,0 +1,14 @@ +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.BusinessDepart; +import com.biutag.supervision.pojo.model.BusinessPoliceModel; +import org.apache.ibatis.annotations.Param; + +public interface BusinessDepartMapper 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/BusinessLogMapper.java b/src/main/java/com/biutag/supervision/mapper/BusinessLogMapper.java new file mode 100644 index 0000000..ed4e0f9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BusinessLogMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BusinessLog; + +public interface BusinessLogMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/BusinessPoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/BusinessPoliceMapper.java new file mode 100644 index 0000000..18aff6a --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BusinessPoliceMapper.java @@ -0,0 +1,13 @@ +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.BusinessPolice; +import com.biutag.supervision.pojo.model.BusinessPoliceModel; +import org.apache.ibatis.annotations.Param; + +public interface BusinessPoliceMapper 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/DataCaseVerifMapper.java b/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java new file mode 100644 index 0000000..5c588bb --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.CaseVerifDepart; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import org.apache.ibatis.annotations.Select; + +import java.util.Date; +import java.util.List; + +public interface DataCaseVerifMapper extends BaseMapper { + + @Select("select d.id, d.short_name label, count(cv.originId) value from sup_depart d left join (select originId, second_depart_id from data_case_verif where discovery_time between #{beginTime} and #{endTime} ) cv " + + "on d.id = cv.second_depart_id where d.statistics_group_id = #{departGroupId} GROUP BY d.id, d.short_name order by value desc, d.order_no") + List selectDepartStatistic(Integer departGroupId, Date beginTime, Date endTime); + + @Select("select involve_problem name, count(originId) value from data_case_verif where business_type_name = #{businessTypeName} and discovery_time between #{beginTime} and #{endTime} group by involve_problem") + List selectInvolveProblemGroupByBusinessTypeName(String businessTypeName, Date beginTime, Date endTime); + + @Select("select problem_sources name, count(originId) value from data_case_verif where discovery_time between #{beginTime} and #{endTime} group by problem_sources") + List selectGroupByProblemSources(Date beginTime, Date endTime); + +} \ 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..b45bd53 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -0,0 +1,74 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.CaseVerifDepart; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import org.apache.ibatis.annotations.Select; + +import java.util.Date; +import java.util.List; + +public interface DataPetitionComplaintMapper extends BaseMapper { + + + /** + * 查询初访重访 + * @param departId + * @param Repeat + * @param beginTime + * @param endTime + * @return + */ + @Select("SELECT sd.id, sd.short_name label,count(*) value " + + "FROM (SELECT * FROM data_petition_complaint dpc " + + "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + + "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + + "WHERE sd.statistics_group_id=#{departId} and temp.initial_petition=#{Repeat} " + + "GROUP BY temp.second_depart_id " + + "ORDER BY value DESC") + List selectDepartStatistic(Integer departId, Integer Repeat, Date beginTime, Date endTime); + + /** + * 查询领导阅信接访 + * @param departId + * @param beginTime + * @param endTime + * @return + */ + @Select("SELECT sd.id, sd.short_name label,count(*) value " + + "FROM (SELECT * FROM data_petition_complaint dpc " + + "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + + "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + + "WHERE sd.statistics_group_id=#{departId} and temp.receiving_leader_name is not null " + + "GROUP BY temp.second_depart_id " + + "ORDER BY value DESC") + List selectLeaderViewMail(Integer departId, Date beginTime, Date endTime); + + + /** + * 缠访闹访县局排行 + * @param id + * @param isEntanglement + * @param beginTime + * @param endTime + * @return + */ + @Select("SELECT sd.id, sd.short_name label,count(*) value " + + "FROM (SELECT * FROM data_petition_complaint dpc " + + "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + + "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + + "WHERE sd.statistics_group_id=#{id} AND entanglement_visits =#{isEntanglement} " + + "GROUP BY temp.second_depart_id " + + "ORDER BY value DESC") + List selectEntanglementMail(Integer id, int isEntanglement, Date beginTime, Date endTime); + + + @Select("SELECT sd.id, sd.short_name label,count(*) value " + + "FROM (SELECT * FROM data_petition_complaint dpc " + + "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + + "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + + "WHERE sd.statistics_group_id=#{id} AND mass_visits =#{isMass} " + + "GROUP BY temp.second_depart_id " + + "ORDER BY value DESC") + List selectMassMail(Integer id, int isMass, Date beginTime, Date endTime); +} diff --git a/src/main/java/com/biutag/supervision/mapper/DataRightsComfortMapper.java b/src/main/java/com/biutag/supervision/mapper/DataRightsComfortMapper.java new file mode 100644 index 0000000..87f3812 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DataRightsComfortMapper.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.DataRightsComfort; + +public interface DataRightsComfortMapper 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/GBaseAJJBXXMapper.java b/src/main/java/com/biutag/supervision/mapper/GBaseAJJBXXMapper.java new file mode 100644 index 0000000..fa6a29f --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/GBaseAJJBXXMapper.java @@ -0,0 +1,12 @@ +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.GBaseAJJBXX; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave2") +@Mapper +public interface GBaseAJJBXXMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/GBaseCJDMapper.java b/src/main/java/com/biutag/supervision/mapper/GBaseCJDMapper.java new file mode 100644 index 0000000..515bc29 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/GBaseCJDMapper.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.biutag.supervision.pojo.entity.GBaseCJD; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@DS("slave2") +@Mapper +public interface GBaseCJDMapper extends BaseMapper { + List selectCJDList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/src/main/java/com/biutag/supervision/mapper/GBaseJJDMapper.java b/src/main/java/com/biutag/supervision/mapper/GBaseJJDMapper.java new file mode 100644 index 0000000..5eed9dd --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/GBaseJJDMapper.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.biutag.supervision.pojo.entity.GBaseJJD; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@DS("slave2") +@Mapper +public interface GBaseJJDMapper extends BaseMapper { + List selectJJDList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} 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/ModelClueDataMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java new file mode 100644 index 0000000..3d1c1a1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java @@ -0,0 +1,23 @@ +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.ModelClue; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +@DS("slave2") // 该注解勿动 +public interface ModelClueDataMapper extends BaseMapper { + + @Select("${sql}") + List selectDataByDynamicSql(@org.apache.ibatis.annotations.Param("sql") String sql); + + @Select("${newSql}") + List> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql); + + @Select("SELECT XM, JH FROM dwd_ry_zfba_baryxx WHERE ZJ = #{barID}") + Map selectBAR(String barID); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java new file mode 100644 index 0000000..1572155 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueMapper.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.ModelClue; +import com.biutag.supervision.pojo.model.ModelClueModel; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +public interface ModelClueMapper 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/ModelClueRecordMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueRecordMapper.java new file mode 100644 index 0000000..41c00b3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueRecordMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.ModelClueRecord; + +public interface ModelClueRecordMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java new file mode 100644 index 0000000..09f908e --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java @@ -0,0 +1,22 @@ +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.ModelClueTask; +import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel; +import com.biutag.supervision.pojo.model.ModelClueTaskModel; +import com.biutag.supervision.pojo.model.NegativeWorkModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ModelClueTaskMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + + List selectGroupByDepart(@Param("taskId") Integer taskId); + +} \ 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/NegativeTaskMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeTaskMapper.java new file mode 100644 index 0000000..3fd1ad8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeTaskMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeTask; + +public interface NegativeTaskMapper 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/ProfileDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java new file mode 100644 index 0000000..64c761e --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.model.DepartNegativeModel; + +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/1 + */ +public interface ProfileDepartMapper { + + Page queryDepartNegative(Page page, Date beginTime, Date endTime, String departName, String departId); + + int getNegativePoliceSize(List idCodes); + +} 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/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java new file mode 100644 index 0000000..293a8e0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.entity.RpcInfringerResult; +import org.apache.ibatis.annotations.Select; + +import java.util.Date; +import java.util.List; + +public interface RpcApplyMapper extends BaseMapper { + + @Select("SELECT COUNT(a.rpc_id) FROM rpc_apply_person a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + + "WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2") + Integer countComfortPersonNumber(Date beginTime, Date endTime); + + @Select("SELECT a.tort_name FROM rpc_infringer_result a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + + "WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2") + List getHitPeople(Date beginTime, Date endTime); + + @Select("SELECT SUM(a.provide_relief) FROM rpc_apply_person a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + + "WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2") + Double countComfortMoney(Date beginTime, Date endTime); + + @Select("select tort_name, defend_handle_way_name from rpc_infringer_result a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + + "WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2") + List selectPunishmentSituation(Date beginTime, Date endTime); + + @Select("SELECT c.job name, COUNT(c.job) value FROM sup_police c JOIN " + + "(SELECT a.emp_no FROM rpc_apply_person a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + + "WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2) d on c.emp_no = d.emp_no " + + "GROUP BY c.job") + List selectComfortSituation(Date beginTime, Date endTime); + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java new file mode 100644 index 0000000..6f3d607 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RpcApplyPerson; + +public interface RpcApplyPersonMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java new file mode 100644 index 0000000..f3ba7b0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RpcInfringerResult; + +public interface RpcInfringerResultMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java new file mode 100644 index 0000000..a644031 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.StatisticsDepart; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +public interface StatisticsDepartMapper extends BaseMapper { + @Select("") + List> getGroupIdsByDepartIds(List departIds); +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java b/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java new file mode 100644 index 0000000..f21f7f4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.StatisticsGroup; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +public interface StatisticsGroupMapper extends BaseMapper { + @Select("") + List> getNameByGroupIds(List groupIds); +} \ 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..af017f0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java @@ -0,0 +1,33 @@ +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; + +import java.util.List; +import java.util.Map; + +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(); + + @Select("") + List> getIdsByDepartIds(List departIds); + + @Select("") + List> getIdsByCode(List departIds); +} \ 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..4df70ab --- /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.SupDictProblemType; + +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/SupDictProblemSourceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java new file mode 100644 index 0000000..835c3ca --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemSource; + +public interface SupDictProblemSourceMapper 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/SupExternalDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java new file mode 100644 index 0000000..1ab38d0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupExternalDepart; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +public interface SupExternalDepartMapper extends BaseMapper { + + @Select("") + List> getIdsByDepartIds(List departIds); +} \ 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..d301431 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/Blame.java @@ -0,0 +1,180 @@ +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 leadEmpNo; + + // 责任领导身份证 + 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; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime crtTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + 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..d477eef --- /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/ProfileDepart.java b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java new file mode 100644 index 0000000..9b4b389 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java @@ -0,0 +1,52 @@ +package com.biutag.supervision.pojo.domain; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class ProfileDepart { + + private DepartInfo departInfo = new DepartInfo(); + private NegativeInfo negativeInfo = new NegativeInfo(); + + + @Setter + @Getter + @Accessors(chain = true) + public static class DepartInfo { + private String name; + private String shortName; + // 所长 + private String mainRole; + // 副所长 + private List deputyRole; + + private Long policeSize; + // 问题涉及民警数 + private Integer negativePoliceSize; + private Long auxSize; + // 问题涉及协辅警数 + private Integer negativeAuxSize; + } + + @Setter + @Getter + public static class NegativeInfo { + private long size; + // 接处警 + private Integer jcjBusinessSize; + private Integer jcjSize; + // 执法办案 + private Integer zfbaBusinessSize; + private Integer jfbaSize; + } + +} 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/CaseVerifDepart.java b/src/main/java/com/biutag/supervision/pojo/dto/CaseVerifDepart.java new file mode 100644 index 0000000..7ec5f6f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/CaseVerifDepart.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@Setter +@Getter +public class CaseVerifDepart { + + private String label; + private String departId; + private Integer value; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifDistribute.java b/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifDistribute.java new file mode 100644 index 0000000..28179ed --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifDistribute.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/24 + */ +@Setter +@Getter +public class DataCaseVerifDistribute { + + List data = new ArrayList<>(); + + // 办理时限 + @NotBlank + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + @NotBlank + private String approvalFlow; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java new file mode 100644 index 0000000..69283b7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java @@ -0,0 +1,72 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Schema(description = "案件核查") +@Setter +@Getter +public class DataCaseVerifImportDto { + + // 信件编号 + @ExcelProperty({"问题基本信息", "案件编号"}) + private String originId; + + // 登记时间 + @ExcelProperty({"问题基本信息", "受理时间"}) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 登记时间 + @ExcelProperty({"问题基本信息", "问题发生时间"}) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + @ExcelProperty({"问题基本信息", "问题来源"}) + private String problemSources; + + // 投诉人 + @ExcelProperty({"问题基本信息", "投诉人"}) + private String responderName; + + // 投诉人电话 + @ExcelProperty({"问题基本信息", "投诉人电话"}) + private String contactPhone; + + @ExcelProperty({"问题基本信息", "业务类别"}) + private String businessTypeName; + + @ExcelProperty({"问题基本信息", "涉嫌问题"}) + private String involveProblem; + + @ExcelProperty({"问题基本信息", "涉及警种"}) + private String policeTypeName; + + // 被投诉机构 + private String secondDepartId; + + @ExcelProperty({"问题基本信息", "涉及单位(二级机构)"}) + private String secondDepartName; + + // 被投诉机构 + @ExcelProperty({"问题基本信息", "涉及单位(三级机构)"}) + private String thirdDepartName; + + private String thirdDepartId; + + // 具体内容 + @ExcelProperty({"问题基本信息", "具体内容"}) + @NotBlank(message = "具体内容为空") + private String thingDesc; + + private String state; + + private String errMsg; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataDataPetitionComplainDistribute.java b/src/main/java/com/biutag/supervision/pojo/dto/DataDataPetitionComplainDistribute.java new file mode 100644 index 0000000..7f8a4b8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataDataPetitionComplainDistribute.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/24 + */ +@Setter +@Getter +public class DataDataPetitionComplainDistribute { + + List data = new ArrayList<>(); + + // 办理时限 + @NotBlank + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + @NotBlank + private String approvalFlow; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintAddDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintAddDto.java new file mode 100644 index 0000000..55ee1ff --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintAddDto.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DataPetitionComplaintAddDto { + + // 更新方式 + private String dataUpdateMethod; + + // 来源 + private String problemSourcesCode; + + List data = new ArrayList<>(); +} 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..00f23e6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintDto.java @@ -0,0 +1,94 @@ +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 discoveryTime; + + // 投诉人 + @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/DataPetitionComplaintImportDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java new file mode 100644 index 0000000..9d7c986 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java @@ -0,0 +1,89 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Schema(description = "信访投诉") +@Setter +@Getter +public class DataPetitionComplaintImportDto { + + // 投诉渠道 + @ExcelProperty({"信访基本信息", "投诉渠道"}) + private String channelForFilingComplaints; + + // 信件编号 + @ExcelProperty({"信访基本信息", "信件编号"}) + private String originId; + + // 受理层级 + @ExcelProperty({"信访基本信息", "受理层级"}) + private String acceptanceLevel; + + // 登记时间 + @ExcelProperty({"信访基本信息", "登记时间"}) + private String discoveryTime; + + // 投诉人 + @ExcelProperty({"信访基本信息", "投诉人"}) + private String responderName; + + // 投诉人电话 + @ExcelProperty({"信访基本信息", "投诉人电话"}) + private String contactPhone; + + // 初重信访 + @ExcelProperty({"信访基本信息", "初重信访"}) + @NotBlank(message = "初重信访为空或值描述不准确") + private String initialPetition; + + // 缠访闹访 + @ExcelProperty({"信访基本信息", "缠访闹访"}) + private String entanglementVisitsLabel; + + private Boolean entanglementVisits; + + // 群众集访 + @ExcelProperty({"信访基本信息", "群众集访"}) + private String massVisitsLabel; + + private Boolean massVisits; + + // 涉嫌问题 + @ExcelProperty({"信访基本信息", "涉嫌问题"}) + private String involveProblem; + + // 业务类别 + @ExcelProperty({"信访基本信息", "业务类别"}) + private String businessTypeName; + + @ExcelProperty({"信访基本信息", "被投诉二级机构"}) + private String involveSecondDepartName; + + // 被投诉机构 + @ExcelProperty({"信访基本信息", "被投诉所队"}) + private String involveThirdDepartName; + + + @NotBlank(message = "涉及二级机构为空或与系统未匹配上") + private String involveSecondDepartId; + + private String involveThirdDepartId; + + // 具体内容 + @ExcelProperty({"信访基本信息", "具体内容"}) + @NotBlank(message = "具体内容为空") + private String thingDesc; + + private String state; + + private String errMsg; + +} \ 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/ModelClueDepartDto.java b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueDepartDto.java new file mode 100644 index 0000000..774541b --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueDepartDto.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/22 + */ +@Setter +@Getter +public class ModelClueDepartDto { + + private String departId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java new file mode 100644 index 0000000..cb2252d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.entity.ModelClue; +import com.biutag.supervision.pojo.model.ModelClueModel; +import com.biutag.supervision.pojo.vo.FileVo; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 模型线索手动分发 + * @author wxc + * @date 2024/10/18 + */ +@Setter +@Getter +public class ModelClueTaskDistribute { + + private List modelClues = new ArrayList<>(); + + private String taskName; + + // 办理时限 + @NotBlank + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 下发流程 + private String distributionFlow; + + // 审批流程 + @NotBlank + private String approvalFlow; + + + private List thingFiles = new ArrayList<>(); + +} 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..1a2d7b3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java @@ -0,0 +1,101 @@ +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 { + + private String id; + + private String originId; + + @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(message = "问题来源不能为空") + private String problemSourcesCode; + + // 问题来源 + @NotBlank(message = "问题来源不能为空") + private String problemSources; + + // 业务类别 + @NotBlank(message = "业务类别不能为空") + private String businessTypeCode; + + // 业务类别名称 + @NotBlank(message = "业务类别不能为空") + private String businessTypeName; + + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉嫌问题JSON + private List> involveProblem; + + // 反映人姓名 + private String responderName; + + // 联系电话 + private String contactPhone; + + // 简要描述 + @NotBlank(message = "简要描述不能为空") + private String thingDesc; + + private List thingFiles = new ArrayList<>(); + + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + @NotBlank(message = "主办层级不能为空") + private String hostLevel; + + // 办理时限 + @NotBlank(message = "办理时限不能为空") + private String timeLimit; + + // 审批流程 + @NotBlank(message = "审批流程不能为空") + private String approvalFlow; + + @NotBlank(message = "指定具体办理单位不能为空") + private String departId; + + @NotBlank(message = "指定具体办理单位不能为空") + 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/PoliceImport.java b/src/main/java/com/biutag/supervision/pojo/dto/PoliceImport.java new file mode 100644 index 0000000..f19c0b3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/PoliceImport.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/30 + */ +@Setter +@Getter +public class PoliceImport { + + @NotBlank(message = "姓名为空") + @ExcelProperty("姓名") + private String name; + + @NotBlank(message = "警号为空") + @ExcelProperty("警号") + private String empNo; + + @NotBlank(message = "身份证为空") + @ExcelProperty("身份证") + private String idCode; + + @NotBlank(message = "二级单位为空") + @ExcelProperty("二级单位") + private String secondDepartName; + + @ExcelProperty("三级单位") + private String thirdDepartName; + + @NotBlank(message = "角色为空") + @ExcelProperty("角色") + private String role; + +} 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/common/PieItem.java b/src/main/java/com/biutag/supervision/pojo/dto/common/PieItem.java new file mode 100644 index 0000000..0960e65 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/common/PieItem.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.dto.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@Setter +@Getter +@AllArgsConstructor +public class PieItem { + + private String name; + private Integer value; +} 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..21a2e3c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java @@ -0,0 +1,223 @@ +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.List; + +@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 String caseNumber; + + 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; + + @NotBlank + private String ivPersonType; + + // 人员属性 + @NotBlank + private String ivPersonTypeCode; + + // 核查情况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 leadEmpNo; + + // 责任领导身份证 + @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; + + @NotBlank + private String threeLevelCode; + + @NotBlank + private String threeLevelContent; + + } + +} 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/BusinessDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java new file mode 100644 index 0000000..a4b040d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.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; + +import java.time.LocalDateTime; +import java.util.Date; + +@Setter +@Getter +public class BusinessDepart { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 日期(天) + @TableField("date") + private Date date; + + // 单位ID + @TableField("depart_id") + private String departId; + + // 单位名称 + @TableField("depart_name") + private String departName; + + // 单位类型ID + @TableField("group_id") + private Long groupId; + + // 单位类型名称 + @TableField("group_name") + private String groupName; + + // 业务类型 + @TableField("business_type") + private String businessType; + + // 业务类型名称 + @TableField("business_type_name") + private String businessTypeName; + + // 业务量 + @TableField("number") + private Integer number; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BusinessLog.java b/src/main/java/com/biutag/supervision/pojo/entity/BusinessLog.java new file mode 100644 index 0000000..6faea4e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BusinessLog.java @@ -0,0 +1,37 @@ +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 BusinessLog { + + // id + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 类型 + @TableField("type") + private String type; + + // 应更新数量 + @TableField("num") + private Integer num; + + // 实际更新数量 + @TableField("actual_num") + private Integer actualNum; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BusinessPolice.java b/src/main/java/com/biutag/supervision/pojo/entity/BusinessPolice.java new file mode 100644 index 0000000..cf264c6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BusinessPolice.java @@ -0,0 +1,68 @@ +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; +import java.util.Date; + +@Setter +@Getter +public class BusinessPolice { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 日期(天) + @TableField("date") + private Date date; + + // 警员姓名 + @TableField("police_name") + private String policeName; + + // 警员身份证 + @TableField("police_id_code") + private String policeIdCode; + + // 警号 + @TableField("emp_no") + private String empNo; + + // 警员所属单位ID + @TableField("depart_id") + private String departId; + + // 警员所属单位名称 + @TableField("depart_name") + private String departName; + + // 单位类型ID + @TableField("group_id") + private Long groupId; + + // 单位类型名称 + @TableField("group_name") + private String groupName; + + // 业务类别 + @TableField("business_type") + private String businessType; + + // 业务量 + @TableField("number") + private Integer number; + + // 业务类型名称 + @TableField("business_type_name") + private String businessTypeName; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java b/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java new file mode 100644 index 0000000..3fab562 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java @@ -0,0 +1,74 @@ +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 DataCaseVerif { + + // 样本源头编号 + @TableId(value = "originId") + private String originId; + + // 问题发现时间 + @TableField("discovery_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题发生时间 + @TableField("happen_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题来源 + @TableField("problem_sources") + private String problemSources; + + // 投诉人姓名 + @TableField("responder_name") + private String responderName; + + // 投诉人电话 + @TableField("responder_phone") + private String responderPhone; + + // 业务类型 + @TableField("business_type_name") + private String businessTypeName; + + // 涉及问题 + @TableField("involve_problem") + private String involveProblem; + + // 涉及警种 + @TableField("police_type_name") + private String policeTypeName; + + // 涉及单位 二级 + private String secondDepartId; + + private String secondDepartName; + + // 所对 + private String thirdDepartId; + + private String thirdDepartName; + + // 事情简述 + @TableField("thing_desc") + private String thingDesc; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // 分发状态 + private String distributionState; + +} \ 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..2e8fd6b --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java @@ -0,0 +1,92 @@ +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 DataPetitionComplaint { + + // 信件编号 + @TableId + private String originId; + + // 投诉渠道 + @TableField("channel_for_filing_complaints") + private String channelForFilingComplaints; + + // 受理层级 + @TableField("acceptance_level") + private String acceptanceLevel; + + // 登记时间 + private LocalDateTime discoveryTime; + + // 投诉人 + @TableField("responder_name") + private String responderName; + + // 投诉人电话 + @TableField("responder_phone") + private String responderPhone; + + // 初重信访 + @TableField("initial_petition") + private String initialPetition; + + // 缠访闹访 + @TableField("entanglement_visits") + private Boolean entanglementVisits; + + // 群众集访 + @TableField("mass_visits") + private Boolean massVisits; + + // 涉嫌问题 + @TableField("involve_problem") + private String involveProblem; + + // 业务类别 + @TableField("business_type_name") + private String businessTypeName; + + // 涉及警种名称 + @TableField("police_type_name") + private String policeTypeName; + + // 具体内容 + @TableField("thing_desc") + private String thingDesc; + + + //--------------------- + + // 涉及单位 二级 + private String secondDepartId; + + private String secondDepartName; + + // 所对 + private String thirdDepartId; + + private String thirdDepartName; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + // 来源 + private String problemSourcesCode; + + // 分发状态 + private String distributionState; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataRightsComfort.java b/src/main/java/com/biutag/supervision/pojo/entity/DataRightsComfort.java new file mode 100644 index 0000000..fd49c97 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataRightsComfort.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.pojo.entity; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DataRightsComfort { +} 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/GBaseAJJBXX.java b/src/main/java/com/biutag/supervision/pojo/entity/GBaseAJJBXX.java new file mode 100644 index 0000000..e1d9958 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/GBaseAJJBXX.java @@ -0,0 +1,58 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@TableName("dwd_asj_zfba_ajjbxx") +public class GBaseAJJBXX { + + // 立案单位编码 + @TableField("LADWBMdm") + private String LADWBMdm; + + // 立案单位名称 + @TableField("LADWBMmc") + private String LADWBMmc; + + // 破案单位编码 + @TableField("PADWBMdm") + private String PADWBMdm; + + // 破案单位名称 + @TableField("PADWBMmc") + private String PADWBMmc; + + // 办案单位编码 + @TableField("BADWIDdm") + private String BADWIDdm; + + // 办案单位名称 + @TableField("BADWIDmc") + private String BADWIDmc; + + // 办案人1ID + @TableField("BAR1ID") + private String BAR1ID; + + // 办案人2ID + @TableField("BAR2ID") + private String BAR2ID; + + // 办案人姓名 + @TableField("XM") + private String XM; + + // 办案人ID + @TableField(exist = false) + private String BARID; + + @TableField(exist = false) + private Integer BADWNum; + + @TableField(exist = false) + private Integer BARNum; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/GBaseCJD.java b/src/main/java/com/biutag/supervision/pojo/entity/GBaseCJD.java new file mode 100644 index 0000000..22e6c18 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/GBaseCJD.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@TableName("dwd_asj_zhtx_cjd") +@Setter +@Getter +public class GBaseCJD { + + private Integer clwbrxmTotal; + + // 处理完毕人姓名 + @TableField("clwbrxm") + private String clwbrxm; + + // 处警时间 + @TableField("cjsj") + private Date cjsj; + + // 处理完毕人编号 + @TableField("clwbrbh") + private String clwbrbh; + + // 处警对象所属单位代码 + @TableField("cjdxssdwdm") + private String cjdxssdwdm; + + // 处警对象所属单位名称 + @TableField("cjdxssdwmc") + private String cjdxssdwmc; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/GBaseJJD.java b/src/main/java/com/biutag/supervision/pojo/entity/GBaseJJD.java new file mode 100644 index 0000000..98a7e9e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/GBaseJJD.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@TableName("dwd_asj_zhtx_jjd") +@Setter +@Getter +public class GBaseJJD { + + @TableField(exist = false) + private Integer jjdbhTotal; + + // 接警单编号 + @TableField("jjdbh") + private String jjdbh; + + // 创建时间 + @TableField("cjsj") + private Date cjsj; + + // 管辖单位代码 + @TableField("gxdwdm") + private String gxdwdm; + + // 管辖单位名称 + @TableField("gxdwmc") + private String gxdwmc; +} 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..aa66988 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Model.java @@ -0,0 +1,94 @@ +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; + + // 分发周期 周 + private String distributionCycleDayOfWeek; + + // 分发周期 时间 + private String distributionCycleTime; + + // 分发周期,cron 表达式 + private String distributionCycleExpression; + + // 限时 + @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; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + @TableField("create_time") + private LocalDateTime createTime; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + private String createDepartId; + + private String createDepartName; + + // 建模方式 + private String modelingMethod; + + // 模型数据类型 + private String modelDataType; + + @TableField("model_sql") + private String modelSql; +} \ 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/ModelClue.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java new file mode 100644 index 0000000..556f076 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java @@ -0,0 +1,96 @@ +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.math.BigDecimal; +import java.time.LocalDateTime; + +@Setter +@Getter +public class ModelClue { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("model_id") + private Integer modelId; + + // 涉及单位 + @TableField("involve_depart_name") + private String involveDepartName; + + @TableField("involve_depart_id") + private String involveDepartId; + + // 涉及人员 + @TableField("involve_police_name") + private String involvePoliceName; + + // 涉及人员警号 + @TableField("involve_police_emp_no") + private String involvePoliceEmpNo; + + // 预警内容 + @TableField("thing_desc") + private String thingDesc; + + // 分发状态 默认 0-未分发 1-已分发 + @TableField("distribution_state") + private String distributionState; + + @TableField("create_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + @TableField("update_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime updateTime; + + // 数据详情 JSON + private String data; + + // 问题ID + @TableField("negative_id") + private String negativeId; + + // 状态:0-未处理 1-已处理 + @TableField("status") + private Integer status; + + // 外部主键 + @TableField("unique_key") + private String uniqueKey; + + // 任务ID + private Integer taskId; + + + // 总警情数 + @TableField(exist = false) + private Long zjjs; + + // 执法场所登记数 + @TableField(exist = false) + private Long zfcsdjs; + + // 比例 + @TableField(exist = false) + private BigDecimal bl; + + @TableField(exist = false) + private String parentId; + + @TableField(exist = false) + private String thisId; + + @TableField(exist = false) + private Integer departLevel; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClueRecord.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueRecord.java new file mode 100644 index 0000000..5888f89 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueRecord.java @@ -0,0 +1,42 @@ +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 ModelClueRecord { + + // + @TableId(type = IdType.AUTO) + private Integer id; + + // 模型ID + private Integer modelId; + + // 条数 + @TableField("size") + private Integer size; + + // 创建时间 + @TableField("create_time") + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime createTime; + + // 状态 success-成功 fail-失败 + @TableField("state") + private String state; + + // 异常详情 + @TableField("err_msg") + private String errMsg; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClueTask.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueTask.java new file mode 100644 index 0000000..eb92b2a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueTask.java @@ -0,0 +1,37 @@ +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 ModelClueTask { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 任务名称 + @TableField("task_name") + private String taskName; + + // 模型名称 + @TableField("model_id") + private Integer modelId; + + // 下发时间 + @TableField("distribution_time") + private LocalDateTime distributionTime; + + // 条数 + @TableField("size") + private Integer size; + + private String distributionMethod; + +} \ 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..202376f --- /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 Integer 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..73239d0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -0,0 +1,255 @@ +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; + + // 当前处理对象 + private String currentProcessingObject; + +} \ 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..6106e46 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java @@ -0,0 +1,243 @@ +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; + + // 领导警号 + private String leadEmpNo; + + // 责任领导身份证 + @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..2c2ce88 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java @@ -0,0 +1,48 @@ +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; + + @TableField("threeLevelCode") + private String threeLevelCode; + + @TableField("threeLevelContent") + private String threeLevelContent; + +} \ 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..dec841a --- /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.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 NegativeSignReturn { + + @TableId(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("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/NegativeTask.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java new file mode 100644 index 0000000..66cba99 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java @@ -0,0 +1,83 @@ +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 NegativeTask { + + // + @TableId(value = "id") + private String id; + + // 任务名称 + @TableField("taskName") + private String taskName; + + // 导入条数 + @TableField("importRow") + private Integer importRow; + + // 成功条数 + @TableField("successRow") + private String successRow; + + // 错误条数 + @TableField("errorRow") + private String errorRow; + + // 文件路径 + @TableField("filePath") + private String filePath; + + // 错误信息下载 + @TableField("errorPath") + private String errorPath; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + @TableField("crtTime") + private LocalDateTime crtTime; + + // + @TableField("crtUser") + private String crtUser; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + @TableField("updTime") + private LocalDateTime updTime; + + // + @TableField("updUser") + private String updUser; + + // 状态 0 成功 1 失败 2 导入中 + @TableField("status") + private String status; + + // 备注 + @TableField("remark") + private String remark; + + // 文件id + @TableField("fileId") + private String fileId; + + // 导入任务类型 0 完整导入 1 部分导入 + @TableField("type") + private String type; + + // + @TableField("excepionInfo") + private String excepionInfo; + + // + @TableField("category") + private String category; + +} \ 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/RpcApply.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java new file mode 100644 index 0000000..c6d41f0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java @@ -0,0 +1,38 @@ +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 RpcApply { + + @TableId(value = "rpc_id") + private String rpcId; + + // 申请时间 + @TableField("apply_date") + private LocalDateTime applyDate; + + // 部门id + @TableField("depart_id") + private String departId; + + // 部门 + @TableField("depart_name") + private String departName; + + // 类型,1维权,2,抚慰,3容错 + @TableField("type") + private String type; + + // 状态 + @TableField("rpc_status") + private String rpcStatus; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java new file mode 100644 index 0000000..6068748 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.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 RpcApplyPerson { + + // + @TableId(value = "id") + private String id; + + // 申请id + @TableField("rpc_id") + private String rpcId; + + // 警号 + @TableField("emp_no") + private String empNo; + + // 提供救济 + @TableField("provide_relief") + private String provideRelief; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcInfringerResult.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcInfringerResult.java new file mode 100644 index 0000000..b1cc1d8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcInfringerResult.java @@ -0,0 +1,35 @@ +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 RpcInfringerResult { + + // + @TableId(value = "id") + private String id; + + // + @TableField("rpc_id") + private String rpcId; + + // 侵权人 + @TableField("tort_name") + private String tortName; + + // 处理方式 + @TableField("defend_handle_way") + private String defendHandleWay; + + // 处理方式-名称 + @TableField("defend_handle_way_name") + private String defendHandleWayName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/StatisticsDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/StatisticsDepart.java new file mode 100644 index 0000000..203ebc6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/StatisticsDepart.java @@ -0,0 +1,47 @@ +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 StatisticsDepart { + + // + @TableId(value = "departId") + private String departId; + + // + @TableField("name") + private String name; + + // + @TableField("level") + private Integer level; + + // + @TableField("groupId") + private String groupId; + + // + @TableField("pid") + private String pid; + + // 总人数 + @TableField("total") + private Integer total; + + // 警察人数 + @TableField("policeNumber") + private Integer policeNumber; + + // 辅警人数 + @TableField("auxiliaryPoliceNumber") + private Integer auxiliaryPoliceNumber; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/StatisticsGroup.java b/src/main/java/com/biutag/supervision/pojo/entity/StatisticsGroup.java new file mode 100644 index 0000000..bcc2fa3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/StatisticsGroup.java @@ -0,0 +1,47 @@ +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 StatisticsGroup { + + // + @TableId(value = "groupId") + private String groupId; + + // + @TableField("name") + private String name; + + // + @TableField("level") + private Integer level; + + // + @TableField("remark") + private String remark; + + // + @TableField("type") + private String type; + + // + @TableField("pid") + private String pid; + + // 特殊处理, 为1为派出所 + @TableField("flag") + private String flag; + + // + @TableField("sort") + private Integer sort; + +} \ 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..a2bc7c0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java @@ -0,0 +1,84 @@ +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; + + private Boolean firstHost; + +} \ 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/SupDictProblemSource.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java new file mode 100644 index 0000000..11ec2b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.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 SupDictProblemSource { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("parent_id") + private Integer parentId; + + // + @TableField("label") + private String label; + + // + @TableField("sort") + private Integer sort; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java new file mode 100644 index 0000000..a5e7048 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java @@ -0,0 +1,90 @@ +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 SupDictProblemType { + + @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; + + private Double score; + + // 是否开启严重等级 + private Boolean isActiveLevel; + +} \ 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/SupExternalDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/SupExternalDepart.java new file mode 100644 index 0000000..22f9493 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupExternalDepart.java @@ -0,0 +1,63 @@ +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 SupExternalDepart { + + // id + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 外部单位id + @TableField("external_id") + private String externalId; + + // 外部单位名称 + @TableField("external_name") + private String externalName; + + // 外部来源 + @TableField("source") + private String source; + + // 内部单位id + @TableField("internal_id") + private String internalId; + + // 内部单位名称 + @TableField("internal_name") + private String internalName; + + // 内部单位短名称 + @TableField("internal_short_name") + private String internalShortName; + + // 单位级别 + @TableField("level") + private Integer level; + + // 上级单位id + @TableField("pid") + private String pid; + + // 状态:0-启用,1-禁用 + @TableField("status") + private Integer status; + + // 创建时间 + @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/SupPolice.java b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java new file mode 100644 index 0000000..1d22bc8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java @@ -0,0 +1,151 @@ +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 jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.time.LocalDate; + +@Setter +@Getter +public class SupPolice implements Serializable { + + + // + @TableId + private String id; + + // 账号id + @TableField("account_id") + private String accountId; + + // + @TableField("district_id") + private String districtId; + + // 组织机构id + @NotBlank + @TableField("org_id") + private String orgId; + + // 警号 + @NotBlank + @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; + + // 身份证 + @NotBlank + @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; + + // 职位 正职 副职 + private String position; + + // 人员属性 + private String personType; + + // 婚姻状况 + private String maritalStatus; + + // 子女 + private Boolean haveChildren; + + // 学历 + private String education; + + // 入职日期 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate employmentDate; + + // 警员角色 + private String policeRole; + +} \ 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/BusinessPoliceModel.java b/src/main/java/com/biutag/supervision/pojo/model/BusinessPoliceModel.java new file mode 100644 index 0000000..8eafa07 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/BusinessPoliceModel.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class BusinessPoliceModel { + // 警员姓名 + private String policeName; + + // 警号 + private String empNo; + + // 单位名称 + private String departName; + + // 单位类型 + private String groupName; + + // 110接处警 + private Integer jiechujing110; + + // 122接处警 + private Integer jiechujing122; + + // 身份证业务 + private Integer shenfenzhengyewu; + + // 执法办案(受案) + private Integer zhifabananSA; + + // 执法办案(立案) + private Integer zhifabananLA; + + // 执法办案(破案) + private Integer zhifabananPA; + + // 户口业务 + private Integer hukouyewu; + + // 出入境业务 + private Integer churujingyewu; + + // 车辆上牌 + private Integer cheliangshangpai; + + // 驾驶人考试 + private Integer jiashirenkaoshi; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/DataRightsComfortModel.java b/src/main/java/com/biutag/supervision/pojo/model/DataRightsComfortModel.java new file mode 100644 index 0000000..f7b71f4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/DataRightsComfortModel.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.model; + +import com.biutag.supervision.pojo.dto.common.PieItem; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class DataRightsComfortModel { + // 维权案件总数 + // 受侵害人数 + // 抚慰人数 + private Integer comfortPersonNumber; + // 打击处理人数 + Integer hitPersonNumber; + // 抚慰金额(万元) + Double comfortMoney; + // 维权案件情况 + // 案件类别占比 + // 打处情况 + List punishmentSituation; + // 抚慰情况 + List comfortSituation; + // 民辅警受伤情况 + // 发案情况占比 +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/DepartNegativeModel.java b/src/main/java/com/biutag/supervision/pojo/model/DepartNegativeModel.java new file mode 100644 index 0000000..371a42f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/DepartNegativeModel.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class DepartNegativeModel { + + private String departId; + private String departName; + private String parentDepartName; + // + //民警人数 + private Integer policeSize; + // + //协辅警人数 + private Integer auxSize; + // 查实问题涉及人数 + private Integer verifyPoliceSize; + // 查实问题数 + private Integer verifySize; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java new file mode 100644 index 0000000..7b3b13d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java @@ -0,0 +1,51 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * + * @author wxc + * @date 2024/10/16 + */ +@Setter +@Getter +public class ModelClueModel { + + private Integer id; + + private Integer modelId; + + private String modelName; + + private String involveDepartId; + // 涉及单位 + private String involveDepartName; + + private String involveParentDepartName; + + // 涉及人员 + private String involvePoliceName; + + // 涉及人员警号 + private String involvePoliceEmpNo; + + // 预警内容 + private String thingDesc; + + // 分发状态 + private String distributionState; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime createTime; + + private String data; + + private String negativeId; + + private String status; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java new file mode 100644 index 0000000..fc42caf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Setter +@Getter +public class ModelClueTaskDepartModel { + + private String departId; + + // 模型名称 + private String departName; + + // 条数 + private Integer size; + + private Integer completedSize; + + private Double completedRate; + + private Integer verifySize; + + private Integer personalSize; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java new file mode 100644 index 0000000..003bfdf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java @@ -0,0 +1,40 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Setter +@Getter +public class ModelClueTaskModel { + + private Integer id; + + // 任务名称 + private String taskName; + + // 模型名称 + private String modelName; + + // 下发时间 + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime distributionTime; + + // 条数 + private Integer size; + + private Integer completedSize; + + private Integer verifySize; + + private Integer departSize; + + private Integer personalSize; + +} 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..d61117f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java @@ -0,0 +1,90 @@ +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; + + // 涉嫌问题 + private String involveProblem; + +} 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..793a6dc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java @@ -0,0 +1,112 @@ +package com.biutag.supervision.pojo.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@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; + + private String parentDepartShortName; + + private String position; + + // 人员属性 + private String personType; + + // 婚姻状况 + private String maritalStatus; + + // 子女 + private Boolean haveChildren; + + // 学历 + private String education; + + private String createdAt; + + private String updatedAt; + + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDateTime employmentDate; + + // 警员角色 + private String policeRole; + + private Integer level; + + private String role; + + +} 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..2915246 --- /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/BasePage.java b/src/main/java/com/biutag/supervision/pojo/param/BasePage.java new file mode 100644 index 0000000..c259aec --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/BasePage.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class BasePage { + + private long current = 1; + private long size = 10; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/BusinessQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/BusinessQueryParam.java new file mode 100644 index 0000000..ea13eda --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/BusinessQueryParam.java @@ -0,0 +1,30 @@ +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 BusinessQueryParam { + private long current = 1; + private long size = 10; + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List happenTime = new ArrayList<>(); + // 姓名 + private String policeName; + // 警号 + private String empNo; + // 单位名称 + private String departName; + // 单位类型 + private String groupName; + // 排序字段 + private String sortField; + // 排序顺序(ASC 或 DESC) + private String sortOrder; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java new file mode 100644 index 0000000..84ffd85 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/15 + */ +@Setter +@Getter +public class DataCaseVerifQueryParam extends BasePage { + + private String originId; + + private String responderKey; + + private String responderValue; + + private String thingDesc; + + private String distributionState; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java new file mode 100644 index 0000000..6306ba1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java @@ -0,0 +1,29 @@ +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 DataPetitionComplaintQueryParam extends BasePage { + + // 来源 + private String problemSourcesCode; + + private String responderKey; + + private String responderValue; + + private String originId; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List discoveryTime = new ArrayList<>(); + + private String thingDesc; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartNegativeQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartNegativeQueryParam.java new file mode 100644 index 0000000..1743c4d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartNegativeQueryParam.java @@ -0,0 +1,23 @@ +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; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class DepartNegativeQueryParam extends BasePage { + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = new ArrayList<>(); + private String departName; + private String departId; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java new file mode 100644 index 0000000..8f6a092 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DepartQueryParam extends BasePage { + + private String shortName; + + private String name; + + private String code; + +} 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..f2fa5be --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DepartTreeListParam { + + private String pid; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/ModelClueQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ModelClueQueryParam.java new file mode 100644 index 0000000..e5513dd --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ModelClueQueryParam.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.pojo.param; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/16 + */ +@Setter +@Getter +public class ModelClueQueryParam extends BasePage { + private List modelIds; + private String modelType; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List createTime = new ArrayList<>(); + private Integer involveDepartId; + private String thingDesc; + private String distributionState; + private String distributionMethod; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java new file mode 100644 index 0000000..c2a3bc2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java @@ -0,0 +1,23 @@ +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; + +/** + * @author wxc + * @date 2024/10/16 + */ +@Setter +@Getter +public class ModelClueTaskQueryParam extends BasePage { + private List modelIds; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List distributionTime = new ArrayList<>(); + private String taskName; +} 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..c7ffaec --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ModelQueryParam.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ModelQueryParam extends BasePage { + + 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..8ca3e67 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -0,0 +1,56 @@ +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 extends BasePage { + + 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<>(); + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = 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 List checkStatusList = new ArrayList<>(); + + private String isRectifyCode; + + // 是否超时 + private Boolean timeoutFlag; + + private String involveDepartId; + + private String handleDepartId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java new file mode 100644 index 0000000..96c0c10 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java @@ -0,0 +1,20 @@ +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 NegativeTaskQueryParam extends BasePage { + + private String taskName; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = new ArrayList<>(); + +} 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..f2126ae --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class PoliceQueryParam extends BasePage { + + private String name; + private String empNo; + private String idCode; + private String phone; + private String departId; + // 当前单位及其所有子单位 + private Boolean departBranch; + private String roleId; +} 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..2080e06 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class UserQueryParam extends BasePage { + + 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..5f624b1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java @@ -0,0 +1,24 @@ +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 extends BasePage { + + @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..19a0a90 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java @@ -0,0 +1,41 @@ +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 String updatedAt; + + private List children = new ArrayList<>(); + + private boolean hasChildren = false; + + private Boolean firstHost; + +} 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..49ebec1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java @@ -0,0 +1,48 @@ +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; + + private Double score; + + // 是否开启严重等级 + private Boolean isActiveLevel; + + @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/DictProblemSourceTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java new file mode 100644 index 0000000..b6a0203 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DictProblemSourceTree { + + private Integer id; + + private Integer parentId; + + private String label; + + private Integer sort; + + private List children = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java new file mode 100644 index 0000000..7aec4d0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java @@ -0,0 +1,80 @@ +package com.biutag.supervision.pojo.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class ExportNegativeVo { + + @ExcelProperty("样本源头编号") + private String originId; + + // 问题发生时间 + @ExcelProperty("问题发生时间") + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @ExcelProperty("问题发现时间") + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + @ExcelProperty("问题来源") + private String problemSources; + + // 业务类别名称 + @ExcelProperty("业务类别") + private String businessTypeName; + + // 涉嫌问题 JSON + @ExcelProperty("涉嫌问题") + private String involveProblem; + + // 简要描述 + @ExcelProperty("简要描述") + private String thingDesc; + + // 反映人姓名 + @ExcelProperty("投诉反映人") + private String responderName; + + // 联系电话 + @ExcelProperty("联系电话") + private String contactPhone; + + // 涉及警种名称 + @ExcelProperty("涉及警种") + private String policeTypeName; + + // 涉及单位名称 + @ExcelProperty("涉及单位") + private String involveDepartName; + + // 办理状态 + @ExcelProperty("办理状态") + private String processingStatus; + + // 办理单位 二级 + @ExcelProperty("办理单位(二级)") + private String handleSecondDepartName; + + // 办理单位 三级 + @ExcelProperty("办理单位(三级)") + private String handleThreeDepartName; + + // 核查情况 + @ExcelProperty("核查情况") + private String checkStatusName; + + // 是否整改 + @ExcelProperty("是否整改") + private String isRectifyName; + +} \ No newline at end of file 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/ModelTree.java b/src/main/java/com/biutag/supervision/pojo/vo/ModelTree.java new file mode 100644 index 0000000..05db427 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/ModelTree.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.pojo.vo; + +import com.biutag.supervision.pojo.entity.Model; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/15 + */ +@Setter +@Getter +public class ModelTree { + + private Integer value; + + private String label; + + private String type; + + private List children = new ArrayList<>(); + + public static ModelTree of(Model model) { + ModelTree child = new ModelTree(); + child.setValue(model.getId()); + child.setLabel(model.getModelName()); + child.setType("model"); + return child; + } + +} 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..4eeb262 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java @@ -0,0 +1,185 @@ +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; + + // 当前处理对象 + private String currentProcessingObject; + +} 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..39030f2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseAccountService.java @@ -0,0 +1,20 @@ +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)); + } + + public BaseAccount getByLogin(String account) { + return baseMapper.selectByLogin(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..a1dd2f1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseUserService.java @@ -0,0 +1,92 @@ +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.mapper.BaseUserMapper; +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.pojo.model.UserModel; +import com.biutag.supervision.pojo.param.UserQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +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()); + if (Objects.nonNull(queryParam.getRoleId()) && !queryParam.getRoleId().isEmpty()) { + List userIds = roleUserService.list(new LambdaQueryWrapper() + .in(BaseRoleUser::getRoleId, queryParam.getRoleId())).stream().map(BaseRoleUser::getUserId).toList(); + if (userIds.isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + queryWrapper.in(BaseUser::getUserId, userIds); + } + 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/BusinessDepartService.java b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java new file mode 100644 index 0000000..b95a48a --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java @@ -0,0 +1,282 @@ +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.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.entity.BusinessDepart; +import com.biutag.supervision.pojo.entity.BusinessLog; +import com.biutag.supervision.pojo.entity.GBaseAJJBXX; +import com.biutag.supervision.pojo.entity.GBaseJJD; +import com.biutag.supervision.pojo.model.BusinessPoliceModel; +import com.biutag.supervision.pojo.model.DataRightsComfortModel; +import com.biutag.supervision.pojo.param.BusinessQueryParam; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.executor.BatchResult; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@Service +public class BusinessDepartService extends ServiceImpl { + + private final GBaseJJDMapper gBaseJJDMapper; + + private final StatisticsDepartMapper statisticsDepartMapper; + + private final StatisticsGroupMapper statisticsGroupMapper; + + private final BusinessLogMapper businessLogMapper; + + private final ModelClueService modelClueService; + + private final SupExternalDepartService externalDepartService; + + private final GBaseAJJBXXMapper gBaseAJJBXXMapper; + + private final SupExternalDepartMapper supExternalDepartMapper; + + private final DataRightsComfortService dataRightsComfortService; + + public Page page(BusinessQueryParam businessQueryParam) { + // 测基础数据 + if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今年所有的数据")) { + LocalDate start = LocalDate.parse("2024-01-01"); + LocalDate end = LocalDate.parse("2024-10-31"); + for (LocalDate date = start; !date.isAfter(end); date = date.plusDays(1)) { + List happenTime = new ArrayList<>(); + Date startDate = Date.from(date.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + Date endDate = Date.from(date.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()); + happenTime.add(startDate); + happenTime.add(endDate); + generate(happenTime); + log.info("已经导入{}的单位数据", date.format(DateTimeFormatter.ofPattern("yyyy年M月d日"))); + } + } else if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今天所有的数据")) { + List happenTime = new ArrayList<>(); + Date start = Date.from(LocalDateTime.parse("2024-09-17T00:00:00", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant()); + Date end = Date.from(LocalDateTime.parse("2024-09-17T23:59:59", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant()); + happenTime.add(start); + happenTime.add(end); + generate(happenTime); + } + // 测模型 + String departName = businessQueryParam.getDepartName(); + if (departName != null && departName.startsWith("运行测试")) { + int testNumber = Integer.parseInt(departName.substring(4)); + System.out.println("开始执行测试" + testNumber); + modelClueService.generate(testNumber); + System.out.println("测试" + testNumber + "执行完毕"); + } + if (departName != null && departName.equals("测大屏")) { + Date beginTime = Date.from(LocalDateTime.parse("2024-10-01T00:00:00", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant()); + Date endTime = Date.from(LocalDateTime.parse("2024-10-02T00:00:00", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant()); + DataRightsComfortModel result = new DataRightsComfortModel(); + + int i = 0; + } + // 测导入单位关联表 + if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("导入单位")) { + System.out.println("开始导入单位"); + externalDepartService.insertPreData(); + System.out.println("导入单位完毕"); + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper + .like(StrUtil.isNotBlank(businessQueryParam.getDepartName()), "depart_name", businessQueryParam.getDepartName()) + .eq(StrUtil.isNotBlank(businessQueryParam.getGroupName()), "group_name", businessQueryParam.getGroupName()) + .groupBy("depart_name") + .orderBy(StrUtil.isNotBlank(businessQueryParam.getSortField()), businessQueryParam.getSortOrder().equals("ASC"), businessQueryParam.getSortField()); + if (businessQueryParam.getHappenTime().size() == 2) { + queryWrapper.between("date", businessQueryParam.getHappenTime().get(0), businessQueryParam.getHappenTime().get(1)); + } + return baseMapper.queryPage(Page.of(businessQueryParam.getCurrent(), businessQueryParam.getSize()), queryWrapper); + } + + public void generate(List happenTime) { + List businessDepartList = new ArrayList<>(); + List gBaseJJDSList = selectJJDList(happenTime); + List gBaseAJJBXXListSA = selectAJJBXX(1, happenTime); + List gBaseAJJBXXListLA = selectAJJBXX(2, happenTime); + List gBaseAJJBXXListPA = selectAJJBXX(3, happenTime); + if (gBaseJJDSList.isEmpty() && gBaseAJJBXXListSA.isEmpty() && gBaseAJJBXXListLA.isEmpty() && gBaseAJJBXXListPA.isEmpty()) { + businessLogMapper.insert(new BusinessLog().setType("单位业务数据").setNum(0).setCreateTime(LocalDateTime.now())); + log.info("{}没有单位数据", happenTime.get(0)); + return; + } + List departIds = new ArrayList<>(); + generateDepartIds(gBaseJJDSList, departIds, gBaseAJJBXXListSA, gBaseAJJBXXListLA, gBaseAJJBXXListPA); + if (departIds.isEmpty()) { + return; + } + List> idsByDepartIds = supExternalDepartMapper.getIdsByDepartIds(departIds);// 430100221100-1011 + Map resultMap2 = idsByDepartIds.stream().filter(map -> map.get("external_id") != null).collect(Collectors.toMap( + map -> (String) map.get("external_id"), + map -> map.get("internal_id") == null ? "" : (String) map.get("internal_id") + )); + List values = resultMap2.values().stream().filter(Objects::nonNull).toList();// 1011 + Map resultMap3 = idsByDepartIds.stream().filter(map -> map.get("external_id") != null).collect(Collectors.toMap( + map -> (String) map.get("external_id"), + map -> map.get("internal_short_name") == null ? "" : (String) map.get("internal_short_name") + )); + List> resultList = new ArrayList<>(); + if (!values.isEmpty()) { + resultList = statisticsDepartMapper.getGroupIdsByDepartIds(values); + } + if (resultList.isEmpty()) { + businessLogMapper.insert(new BusinessLog().setType("单位业务数据").setNum(0).setCreateTime(LocalDateTime.now())); + log.info("{}没有单位数据", happenTime.get(0)); + return; + } + Map resultMap = resultList.stream().collect(Collectors.toMap(map -> (String) map.get("departId"), map -> (Long) map.get("groupId"))); + List groupIds = new ArrayList<>(); + generateBusinessDepartList(happenTime, gBaseJJDSList, resultMap, resultMap2, resultMap3, groupIds, businessDepartList, gBaseAJJBXXListSA, gBaseAJJBXXListLA, gBaseAJJBXXListPA); + List> nameList = statisticsGroupMapper.getNameByGroupIds(groupIds); + Map names = nameList.stream().collect(Collectors.toMap(map -> (Long) map.get("groupId"), map -> (String) map.get("name"))); + for (BusinessDepart businessDepart : businessDepartList) { + businessDepart.setGroupName(names.get(businessDepart.getGroupId())); + businessDepart.setCreateTime(LocalDateTime.now()); + } + log.info("单位业务数据准备插入:{}", businessDepartList.size()); + List insert = baseMapper.insert(businessDepartList); + log.info("单位业务数据插入成功"); + int actualNum = (int) Arrays.stream(insert.get(0).getUpdateCounts()).parallel().filter(num -> num != 0).count(); + businessLogMapper.insert(new BusinessLog().setType("单位业务数据").setNum(gBaseJJDSList.size() + gBaseAJJBXXListSA.size() + gBaseAJJBXXListLA.size() + gBaseAJJBXXListPA.size()).setActualNum(actualNum).setCreateTime(LocalDateTime.now())); + } + + private static void generateBusinessDepartList(List happenTime, List gBaseJJDSList, Map resultMap, Map resultMap2, Map resultMap3, List groupIds, List businessDepartList, List gBaseAJJBXXListSA, List gBaseAJJBXXListLA, List gBaseAJJBXXListPA) { + for (GBaseJJD gBaseJJD : gBaseJJDSList) { + Long groupId = resultMap.get(resultMap2.get(gBaseJJD.getGxdwdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessDepart businessDepart = getJJDBusinessDepart(happenTime, gBaseJJD, groupId, resultMap2, resultMap3); + businessDepartList.add(businessDepart); + } + for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXListSA) { + Long groupId = resultMap.get(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 1, resultMap2, resultMap3); + businessDepartList.add(businessDepart); + } + for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXListLA) { + Long groupId = resultMap.get(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 2, resultMap2, resultMap3); + businessDepartList.add(businessDepart); + } + for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXListPA) { + Long groupId = resultMap.get(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 3, resultMap2, resultMap3); + businessDepartList.add(businessDepart); + } + } + + private static void generateDepartIds(List gBaseJJDSList, List departIds, List gBaseAJJBXXListSA, List gBaseAJJBXXListLA, List gBaseAJJBXXListPA) { + if (!gBaseJJDSList.isEmpty()) { + departIds.addAll(gBaseJJDSList.stream().map(GBaseJJD::getGxdwdm).toList()); + } + if (!gBaseAJJBXXListSA.isEmpty()) { + departIds.addAll(gBaseAJJBXXListSA.stream().map(GBaseAJJBXX::getBADWIDdm).toList()); + } + if (!gBaseAJJBXXListLA.isEmpty()) { + departIds.addAll(gBaseAJJBXXListLA.stream().map(GBaseAJJBXX::getLADWBMdm).toList()); + } + if (!gBaseAJJBXXListPA.isEmpty()) { + departIds.addAll(gBaseAJJBXXListPA.stream().map(GBaseAJJBXX::getLADWBMdm).toList()); + } + } + + private static BusinessDepart getJJDBusinessDepart(List happenTime, GBaseJJD gBaseJJD, Long groupId, Map resultMap2, Map resultMap3) { + BusinessDepart businessDepart = new BusinessDepart(); + businessDepart.setDate(happenTime.get(0)); + businessDepart.setDepartId(resultMap2.get(gBaseJJD.getGxdwdm())); + businessDepart.setDepartName(resultMap3.get(gBaseJJD.getGxdwdm())); + businessDepart.setGroupId(groupId); + businessDepart.setNumber(gBaseJJD.getJjdbhTotal()); + if (groupId != null) { + if (groupId == 10L) { + businessDepart.setBusinessType("1"); + businessDepart.setBusinessTypeName("110接处警"); + } else if (groupId == 11L) { + businessDepart.setBusinessType("2"); + businessDepart.setBusinessTypeName("122接处警"); + } + } + return businessDepart; + } + + private static BusinessDepart getAJJBXXBusinessDepart(List happenTime, GBaseAJJBXX gBasAJJBXX, Long groupId, int type, Map resultMap2, Map resultMap3) { + BusinessDepart businessDepart = new BusinessDepart(); + businessDepart.setDate(happenTime.get(0)); + businessDepart.setDepartId(resultMap2.get(gBasAJJBXX.getBADWIDdm())); + businessDepart.setDepartName(resultMap3.get(gBasAJJBXX.getBADWIDdm())); + businessDepart.setGroupId(groupId); + businessDepart.setNumber(gBasAJJBXX.getBADWNum()); + if (type == 1) { + businessDepart.setBusinessType("4"); + businessDepart.setBusinessTypeName("执法办案(受案)"); + } else if (type == 2) { + businessDepart.setBusinessType("5"); + businessDepart.setBusinessTypeName("执法办案(立案)"); + } else if (type == 3) { + businessDepart.setBusinessType("6"); + businessDepart.setBusinessTypeName("执法办案(破案)"); + } + return businessDepart; + } + + @DS("slave2") + public List selectJJDList(List happenTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.between("cjsj", happenTime.get(0), happenTime.get(1)); + queryWrapper.notLikeRight("jqxzdm", "11"); + queryWrapper.notLikeRight("jqxzdm", "99"); + queryWrapper.groupBy("gxdwdm", "gxdwmc"); + return gBaseJJDMapper.selectJJDList(queryWrapper); + } + + @DS("slave2") + private List selectAJJBXX(int type, List happenTime) { + List result = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (type == 1) { + queryWrapper.select("COUNT(BADWIDdm) as BADWNum, BADWIDdm, BADWIDmc").ne("AJBZdm", "3").between("slrq", happenTime.get(0), happenTime.get(1)).groupBy("BADWIDdm", "BADWIDmc"); + } else if (type == 2) { + queryWrapper.select("COUNT(BADWIDdm) as BADWNum, BADWIDdm, BADWIDmc").ne("AJBZdm", "3").between("larq", happenTime.get(0), happenTime.get(1)).groupBy("BADWIDdm", "BADWIDmc"); + } else if (type == 3) { + queryWrapper.select("COUNT(BADWIDdm) as BADWNum, BADWIDdm, BADWIDmc").ne("AJBZdm", "3").between("parq", happenTime.get(0), happenTime.get(1)).groupBy("BADWIDdm", "BADWIDmc"); + } + List gBaseAJJBXXs = gBaseAJJBXXMapper.selectList(queryWrapper); + if (!gBaseAJJBXXs.isEmpty()) { + gBaseAJJBXXs.forEach(item -> { + if (item != null && item.getBADWIDdm() != null && !item.getBADWIDmc().isEmpty()) { + result.add(item); + } + }); + } + return result; + } +} diff --git a/src/main/java/com/biutag/supervision/service/BusinessLogService.java b/src/main/java/com/biutag/supervision/service/BusinessLogService.java new file mode 100644 index 0000000..9cb14d9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BusinessLogService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BusinessLog; +import com.biutag.supervision.mapper.BusinessLogMapper; +import org.springframework.stereotype.Service; + +@Service +public class BusinessLogService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/BusinessPoliceService.java b/src/main/java/com/biutag/supervision/service/BusinessPoliceService.java new file mode 100644 index 0000000..48f30d6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BusinessPoliceService.java @@ -0,0 +1,423 @@ +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.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.entity.BusinessLog; +import com.biutag.supervision.pojo.entity.BusinessPolice; +import com.biutag.supervision.pojo.entity.GBaseAJJBXX; +import com.biutag.supervision.pojo.entity.GBaseCJD; +import com.biutag.supervision.pojo.model.BusinessPoliceModel; +import com.biutag.supervision.pojo.param.BusinessQueryParam; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.executor.BatchResult; +import org.springframework.stereotype.Service; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@Service +public class BusinessPoliceService extends ServiceImpl { + + private final GBaseCJDMapper gBaseCJDMapper; + + private final StatisticsDepartMapper statisticsDepartMapper; + + private final StatisticsGroupMapper statisticsGroupMapper; + + private final BusinessLogMapper businessLogMapper; + + public final ModelClueDataMapper modelClueDataMapper; + + private final SupExternalDepartMapper supExternalDepartMapper; + + public Page page(BusinessQueryParam businessQueryParam) { + if (businessQueryParam.getDepartName()!=null && businessQueryParam.getDepartName().equals("开始导入今年所有的数据")) { + LocalDate start = LocalDate.parse("2024-01-01"); + LocalDate end = LocalDate.parse("2024-10-31"); + for (LocalDate date = start; !date.isAfter(end); date = date.plusDays(1)) { + List happenTime = new ArrayList<>(); + Date startDate = Date.from(date.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + Date endDate = Date.from(date.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()); + happenTime.add(startDate); + happenTime.add(endDate); + generate(happenTime); + log.info("已经导入{}的个人数据", date.format(DateTimeFormatter.ofPattern("yyyy年M月d日"))); + } + } else if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今天所有的数据")) { + List happenTime = new ArrayList<>(); + Date start = Date.from(LocalDateTime.parse("2024-09-02T00:00:00", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant()); + Date end = Date.from(LocalDateTime.parse("2024-10-14T09:59:59", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant()); + happenTime.add(start); + happenTime.add(end); + generate(happenTime); + } + String empNo = ""; + if (businessQueryParam.getEmpNo() != null && !businessQueryParam.getEmpNo().isEmpty()) { + empNo = businessQueryParam.getEmpNo(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(businessQueryParam.getPoliceName()), "police_name", businessQueryParam.getPoliceName()) + .like(StrUtil.isNotBlank(empNo), "emp_no", empNo) + .like(StrUtil.isNotBlank(businessQueryParam.getDepartName()), "depart_name", businessQueryParam.getDepartName()) + .eq(StrUtil.isNotBlank(businessQueryParam.getGroupName()), "group_name", businessQueryParam.getGroupName()) + .groupBy("police_name") + .orderBy(StrUtil.isNotBlank(businessQueryParam.getSortField()), businessQueryParam.getSortOrder().equals("ASC"), businessQueryParam.getSortField()); + if (businessQueryParam.getHappenTime().size() == 2) { + queryWrapper.between("date", businessQueryParam.getHappenTime().get(0), businessQueryParam.getHappenTime().get(1)); + } + return baseMapper.queryPage(Page.of(businessQueryParam.getCurrent(), businessQueryParam.getSize()), queryWrapper); + } + + public void generate(List happenTime) { + List businessPoliceList = new ArrayList<>(); + // 110、122 + List gBaseCJDSList = selectCJDList(happenTime); + // 执法办案 + ZFBAResult zfbaresult = getZfbaResult(happenTime); + if (gBaseCJDSList.isEmpty() && zfbaresult.bar1().isEmpty() && zfbaresult.bar2().isEmpty() && zfbaresult.bar3().isEmpty() && zfbaresult.bar4().isEmpty() && zfbaresult.bar5().isEmpty() && zfbaresult.bar6().isEmpty()) { + log.info("{}没有个人数据", happenTime.get(0)); + businessLogMapper.insert(new BusinessLog().setType("个人业务数据").setNum(0).setCreateTime(LocalDateTime.now())); + return; + } + Map gBaseAJJBXXMapSR = new HashMap<>(); + Map gBaseAJJBXXMapLR = new HashMap<>(); + Map gBaseAJJBXXMapPR = new HashMap<>(); + generateAJJBXXMap(zfbaresult, gBaseAJJBXXMapSR, gBaseAJJBXXMapLR, gBaseAJJBXXMapPR); + List departIds = new ArrayList<>(); + generateDepartIds(gBaseCJDSList, departIds, zfbaresult); + if (departIds.isEmpty()) { + return; + } + List> idsByDepartIds = supExternalDepartMapper.getIdsByDepartIds(departIds);// 430100221100-1011 + Map resultMap2 = idsByDepartIds.stream().filter(map -> map.get("external_id") != null).collect(Collectors.toMap( + map -> (String) map.get("external_id"), + map -> map.get("internal_id") == null ? "" : (String) map.get("internal_id") + )); + List values = resultMap2.values().stream().filter(Objects::nonNull).toList();// 1011 + Map resultMap3 = idsByDepartIds.stream().filter(map -> map.get("external_id") != null).collect(Collectors.toMap( + map -> (String) map.get("external_id"), + map -> map.get("internal_short_name") == null ? "" : (String) map.get("internal_short_name") + )); + List> resultList = statisticsDepartMapper.getGroupIdsByDepartIds(values); + Map resultMap = resultList.stream().collect(Collectors.toMap( + map -> (String) map.get("departId"), + map -> (Long) map.get("groupId") + )); + List groupIds = new ArrayList<>(); + generateBusinessPoliceList(happenTime, gBaseCJDSList, resultMap, resultMap2, resultMap3, groupIds, businessPoliceList, gBaseAJJBXXMapSR, gBaseAJJBXXMapLR, gBaseAJJBXXMapPR); + List> nameList = statisticsGroupMapper.getNameByGroupIds(groupIds); + Map names = nameList.stream().collect(Collectors.toMap( + map -> (Long) map.get("groupId"), + map -> (String) map.get("name") + )); + for (BusinessPolice businessPolice : businessPoliceList) { + businessPolice.setGroupName(names.get(businessPolice.getGroupId())); + businessPolice.setCreateTime(LocalDateTime.now()); + } + log.info("个人业务数据准备插入:{}", businessPoliceList.size()); + List insert = baseMapper.insert(businessPoliceList); + log.info("个人业务数据插入成功"); + int actualNum = (int) Arrays.stream(insert.get(0).getUpdateCounts()).parallel().filter(num -> num != 0).count(); + businessLogMapper.insert(new BusinessLog().setType("个人业务数据").setNum(gBaseCJDSList.size()).setActualNum(actualNum).setCreateTime(LocalDateTime.now())); + } + + private static void generateBusinessPoliceList(List happenTime, List gBaseCJDSList, Map resultMap, Map resultMap2, Map resultMap3, List groupIds, List businessPoliceList, Map gBaseAJJBXXMapSR, Map gBaseAJJBXXMapLR, Map gBaseAJJBXXMapPR) { + for (GBaseCJD gBaseCJD : gBaseCJDSList) { + Long groupId = resultMap.get(resultMap2.get(gBaseCJD.getCjdxssdwdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessPolice businessPolice = getJJDBusinessPolice(happenTime, gBaseCJD, groupId, resultMap2, resultMap3); + businessPoliceList.add(businessPolice); + } + for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapSR.values()) { + Long groupId = resultMap.get(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 4, resultMap2, resultMap3); + businessPoliceList.add(businessPolice); + } + for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapLR.values()) { + Long groupId = resultMap.get(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 5, resultMap2, resultMap3); + businessPoliceList.add(businessPolice); + } + for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapPR.values()) { + Long groupId = resultMap.get(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + if (groupId == null) { + continue; + } + groupIds.add(groupId); + BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 6, resultMap2, resultMap3); + businessPoliceList.add(businessPolice); + } + } + + private static void generateDepartIds(List gBaseCJDSList, List departIds, ZFBAResult zfbaresult) { + List collect = gBaseCJDSList.stream().map(GBaseCJD::getCjdxssdwdm).toList(); + if (!collect.isEmpty()) { + departIds.addAll(collect); + } + List badwiDdm1 = zfbaresult.bar1().stream().map(map -> (String) map.get("BADWIDdm")).toList(); + if (!badwiDdm1.isEmpty()) { + departIds.addAll(badwiDdm1); + } + List badwiDdm2 = zfbaresult.bar2().stream().map(map -> (String) map.get("BADWIDdm")).toList(); + if (!badwiDdm2.isEmpty()) { + departIds.addAll(badwiDdm2); + } + List badwiDdm3 = zfbaresult.bar3().stream().map(map -> (String) map.get("BADWIDdm")).toList(); + if (!badwiDdm3.isEmpty()) { + departIds.addAll(badwiDdm3); + } + List badwiDdm4 = zfbaresult.bar4().stream().map(map -> (String) map.get("BADWIDdm")).toList(); + if (!badwiDdm4.isEmpty()) { + departIds.addAll(badwiDdm4); + } + } + + private static void generateAJJBXXMap(ZFBAResult zfbaresult, Map gBaseAJJBXXMapSR, Map gBaseAJJBXXMapLR, Map gBaseAJJBXXMapPR) { + for (Map bar : zfbaresult.bar1()) { + if (bar.get("BAR1ID") == null) { + continue; + } + if (gBaseAJJBXXMapSR.containsKey((String)bar.get("BAR1ID"))) { + GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapSR.get((String) bar.get("BAR1ID")); + gBaseAJJBXX.setBARNum(gBaseAJJBXX.getBARNum() + Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapSR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } else { + GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX(); + gBaseAJJBXX.setBARID((String)bar.get("BAR1ID")); + gBaseAJJBXX.setBADWIDdm((String)bar.get("BADWIDdm")); + gBaseAJJBXX.setBADWIDmc((String)bar.get("BADWIDmc")); + gBaseAJJBXX.setXM((String)bar.get("XM")); + gBaseAJJBXX.setBARNum(Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapSR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } + } + for (Map bar : zfbaresult.bar2()) { + if (bar.get("BAR2ID") == null) { + continue; + } + if (gBaseAJJBXXMapSR.containsKey((String)bar.get("BAR2ID"))) { + GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapSR.get((String) bar.get("BAR2ID")); + gBaseAJJBXX.setBARNum(gBaseAJJBXX.getBARNum() + Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapSR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } else { + GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX(); + gBaseAJJBXX.setBARID((String)bar.get("BAR2ID")); + gBaseAJJBXX.setBADWIDdm((String)bar.get("BADWIDdm")); + gBaseAJJBXX.setBADWIDmc((String)bar.get("BADWIDmc")); + gBaseAJJBXX.setXM((String)bar.get("XM")); + gBaseAJJBXX.setBARNum(Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapSR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } + } + for (Map bar : zfbaresult.bar3()) { + if (bar.get("BAR1ID") == null) { + continue; + } + if (gBaseAJJBXXMapLR.containsKey((String)bar.get("BAR1ID"))) { + GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapLR.get((String) bar.get("BAR1ID")); + gBaseAJJBXX.setBARNum(gBaseAJJBXX.getBARNum() + Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapLR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } else { + GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX(); + gBaseAJJBXX.setBARID((String)bar.get("BAR1ID")); + gBaseAJJBXX.setBADWIDdm((String)bar.get("BADWIDdm")); + gBaseAJJBXX.setBADWIDmc((String)bar.get("BADWIDmc")); + gBaseAJJBXX.setXM((String)bar.get("XM")); + gBaseAJJBXX.setBARNum(Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapLR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } + } + for (Map bar : zfbaresult.bar4()) { + if (bar.get("BAR2ID") == null) { + continue; + } + if (gBaseAJJBXXMapLR.containsKey((String)bar.get("BAR2ID"))) { + GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapLR.get((String) bar.get("BAR2ID")); + gBaseAJJBXX.setBARNum(gBaseAJJBXX.getBARNum() + Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapLR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } else { + GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX(); + gBaseAJJBXX.setBARID((String)bar.get("BAR2ID")); + gBaseAJJBXX.setBADWIDdm((String)bar.get("BADWIDdm")); + gBaseAJJBXX.setBADWIDmc((String)bar.get("BADWIDmc")); + gBaseAJJBXX.setXM((String)bar.get("XM")); + gBaseAJJBXX.setBARNum(Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapLR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } + } + for (Map bar : zfbaresult.bar5()) { + if (bar.get("BAR1ID") == null) { + continue; + } + if (gBaseAJJBXXMapPR.containsKey((String)bar.get("BAR1ID"))) { + GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapPR.get((String) bar.get("BAR1ID")); + gBaseAJJBXX.setBARNum(gBaseAJJBXX.getBARNum() + Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapPR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } else { + GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX(); + gBaseAJJBXX.setBARID((String)bar.get("BAR1ID")); + gBaseAJJBXX.setBADWIDdm((String)bar.get("BADWIDdm")); + gBaseAJJBXX.setBADWIDmc((String)bar.get("BADWIDmc")); + gBaseAJJBXX.setXM((String)bar.get("XM")); + gBaseAJJBXX.setBARNum(Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapPR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } + } + for (Map bar : zfbaresult.bar6()) { + if (bar.get("BAR2ID") == null) { + continue; + } + if (gBaseAJJBXXMapPR.containsKey((String)bar.get("BAR2ID"))) { + GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapPR.get((String) bar.get("BAR2ID")); + gBaseAJJBXX.setBARNum(gBaseAJJBXX.getBARNum() + Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapPR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } else { + GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX(); + gBaseAJJBXX.setBARID((String)bar.get("BAR2ID")); + gBaseAJJBXX.setBADWIDdm((String)bar.get("BADWIDdm")); + gBaseAJJBXX.setBADWIDmc((String)bar.get("BADWIDmc")); + gBaseAJJBXX.setXM((String)bar.get("XM")); + gBaseAJJBXX.setBARNum(Math.toIntExact((Long) bar.get("num"))); + gBaseAJJBXXMapPR.put(gBaseAJJBXX.getBARID(), gBaseAJJBXX); + } + } + } + + private ZFBAResult getZfbaResult(List happenTime) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 4:受案 + List> bar1 = modelClueDataMapper.selectByUniqueKeys("select COUNT(a.BAR1ID) as num, a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM " + + "FROM dwd_asj_zfba_ajjbxx a " + + "LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR1ID = b.ZJ " + + "WHERE a.SLRQ BETWEEN '" + formatter.format(happenTime.get(0)) + "' AND '" + formatter.format(happenTime.get(1)) + "' AND a.AJBZdm !=3 " + + "GROUP BY a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM;"); + List> bar2 = modelClueDataMapper.selectByUniqueKeys("select COUNT(a.BAR2ID) as num, a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM " + + "FROM dwd_asj_zfba_ajjbxx a " + + "LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR2ID = b.ZJ " + + "WHERE a.SLRQ BETWEEN '" + formatter.format(happenTime.get(0)) + "' AND '" + formatter.format(happenTime.get(1)) + "' AND a.AJBZdm !=3 " + + "GROUP BY a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM;"); + // 5:立案 + List> bar3 = modelClueDataMapper.selectByUniqueKeys("select COUNT(a.BAR1ID) as num, a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM " + + "FROM dwd_asj_zfba_ajjbxx a " + + "LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR1ID = b.ZJ " + + "WHERE a.LARQ BETWEEN '" + formatter.format(happenTime.get(0)) + "' AND '" + formatter.format(happenTime.get(1)) + "' AND a.AJBZdm !=3 " + + "GROUP BY a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM;"); + List> bar4 = modelClueDataMapper.selectByUniqueKeys("select COUNT(a.BAR2ID) as num, a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM " + + "FROM dwd_asj_zfba_ajjbxx a " + + "LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR2ID = b.ZJ " + + "WHERE a.LARQ BETWEEN '" + formatter.format(happenTime.get(0)) + "' AND '" + formatter.format(happenTime.get(1)) + "' AND a.AJBZdm !=3 " + + "GROUP BY a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM;"); + // 6:破案 + List> bar5 = modelClueDataMapper.selectByUniqueKeys("select COUNT(a.BAR1ID) as num, a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM " + + "FROM dwd_asj_zfba_ajjbxx a " + + "LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR1ID = b.ZJ " + + "WHERE a.PARQ BETWEEN '" + formatter.format(happenTime.get(0)) + "' AND '" + formatter.format(happenTime.get(1)) + "' AND a.AJBZdm !=3 " + + "GROUP BY a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM;"); + List> bar6 = modelClueDataMapper.selectByUniqueKeys("select COUNT(a.BAR2ID) as num, a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM " + + "FROM dwd_asj_zfba_ajjbxx a " + + "LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR2ID = b.ZJ " + + "WHERE a.PARQ BETWEEN '" + formatter.format(happenTime.get(0)) + "' AND '" + formatter.format(happenTime.get(1)) + "' AND a.AJBZdm !=3 " + + "GROUP BY a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM;"); + ZFBAResult zfbaresult = new ZFBAResult(bar1, bar2, bar3, bar4, bar5, bar6); + return zfbaresult; + } + + private record ZFBAResult(List> bar1, List> bar2, List> bar3, List> bar4, List> bar5, List> bar6) { + } + + private static BusinessPolice getJJDBusinessPolice(List happenTime, GBaseCJD gBaseCJD, Long groupId, Map resultMap2, Map resultMap3) { + BusinessPolice businessPolice = new BusinessPolice(); + businessPolice.setDate(happenTime.get(0)); + businessPolice.setDepartId(resultMap2.get(gBaseCJD.getCjdxssdwdm())); + businessPolice.setDepartName(resultMap3.get(gBaseCJD.getCjdxssdwdm())); + businessPolice.setGroupId(groupId); + businessPolice.setNumber(gBaseCJD.getClwbrxmTotal()); + businessPolice.setPoliceName(gBaseCJD.getClwbrxm()); + businessPolice.setEmpNo(gBaseCJD.getClwbrbh()); + businessPolice.setPoliceIdCode(hashConcatenatedStrings(gBaseCJD.getClwbrxm(), gBaseCJD.getClwbrbh())); + if (groupId != null) { + if (groupId == 10L) { + businessPolice.setBusinessType("1"); + businessPolice.setBusinessTypeName("110接处警"); + } else if (groupId == 11L) { + businessPolice.setBusinessType("2"); + businessPolice.setBusinessTypeName("122接处警"); + } + } + return businessPolice; + } + + private static BusinessPolice getAJJBXXBusinessPolice(List happenTime, GBaseAJJBXX gBaseAJJBXX, Long groupId, int type, Map resultMap2, Map resultMap3) { + BusinessPolice businessPolice = new BusinessPolice(); + businessPolice.setDate(happenTime.get(0)); + businessPolice.setDepartId(resultMap2.get(gBaseAJJBXX.getBADWIDdm())); + businessPolice.setDepartName(resultMap3.get(gBaseAJJBXX.getBADWIDdm())); + businessPolice.setGroupId(groupId); + businessPolice.setNumber(gBaseAJJBXX.getBARNum()); + businessPolice.setPoliceName(gBaseAJJBXX.getXM()); + businessPolice.setEmpNo(gBaseAJJBXX.getBARID()); + businessPolice.setPoliceIdCode(hashConcatenatedStrings(businessPolice.getPoliceName(), businessPolice.getEmpNo())); + if (type == 4) { + businessPolice.setBusinessType("4"); + businessPolice.setBusinessTypeName("执法办案(受案)"); + } else if (type == 5) { + businessPolice.setBusinessType("5"); + businessPolice.setBusinessTypeName("执法办案(立案)"); + } else if (type == 6) { + businessPolice.setBusinessType("6"); + businessPolice.setBusinessTypeName("执法办案(破案)"); + } + return businessPolice; + } + + @DS("slave2") + public List selectCJDList(List happenTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.isNotNull("clwbrxm"); + queryWrapper.between("cjsj", happenTime.get(0), happenTime.get(1)); + queryWrapper.groupBy("clwbrxm", "clwbrbh", "cjdxssdwdm", "cjdxssdwmc"); + return gBaseCJDMapper.selectCJDList(queryWrapper); + } + + public static String hashConcatenatedStrings(String a, String b) { + try { + String concatenated = a + b; + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + byte[] hash = digest.digest(concatenated.getBytes()); + StringBuilder hexString = new StringBuilder(); + for (byte b1 : hash) { + String hex = Integer.toHexString(0xff & b1); + if(hex.length() == 1) hexString.append('0'); + hexString.append(hex); + } + return hexString.toString(); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException("Error while hashing", e); + } + } +} diff --git a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java new file mode 100644 index 0000000..0ce6268 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java @@ -0,0 +1,100 @@ +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.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.DataUpdateMethodEnum; +import com.biutag.supervision.constants.enums.DistributionStateEnum; +import com.biutag.supervision.constants.enums.HostLevelEnums; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.mapper.DataCaseVerifMapper; +import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; +import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute; +import com.biutag.supervision.pojo.dto.NegativeDto; +import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@Service +public class DataCaseVerifService extends ServiceImpl { + + private final NegativeService negativeService; + + public Page page(DataCaseVerifQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(queryParam.getOriginId()), DataCaseVerif::getOriginId, queryParam.getOriginId()) + .like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataCaseVerif::getThingDesc, queryParam.getThingDesc()) + .eq(StrUtil.isNotBlank(queryParam.getDistributionState()), DataCaseVerif::getDistributionState, queryParam.getDistributionState()) + .orderByDesc(DataCaseVerif::getCreateTime); + return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + } + + public boolean save(List list, String dataUpdateMethod) { + LocalDateTime now = LocalDateTime.now(); + int index = 0; + for (DataCaseVerifImportDto dto : list) { + index++; + boolean exists = exists(new LambdaQueryWrapper().eq(DataCaseVerif::getOriginId, dto.getOriginId())); + // 增量更新 + if (DataUpdateMethodEnum.incremental.name().equals(dataUpdateMethod) && exists) { + throw new RuntimeException(String.format("第%s条数据的案件编号已存在,请核实", index)); + } + DataCaseVerif data = new DataCaseVerif(); + BeanUtils.copyProperties(dto, data); + data.setCreateTime(now); + data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); + saveOrUpdate(data); + } + return true; + } + + public boolean distribution(DataCaseVerifDistribute dataDistribute) { + dataDistribute.getData().forEach(item -> { + NegativeDto negativeDto = new NegativeDto(); + negativeDto.setOriginId(item.getOriginId()); + negativeDto.setHappenTime(item.getHappenTime()); + negativeDto.setDiscoveryTime(item.getDiscoveryTime()); + negativeDto.setProblemSourcesCode(ProblemSourcesEnum.A12389.getValue()); + negativeDto.setProblemSources(ProblemSourcesEnum.A12389.getLabel()); +// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW); +// negativeDto.setBusinessTypeName(); + negativeDto.setResponderName(item.getResponderName()); + negativeDto.setContactPhone(item.getResponderPhone()); + negativeDto.setThingDesc(item.getThingDesc()); + String departId; + String departName; + if (StrUtil.isBlank(item.getThirdDepartId())) { + departId = item.getSecondDepartId(); + departName = item.getSecondDepartName(); + } else { + departId = item.getThirdDepartId(); + departName = item.getThirdDepartName(); + } + negativeDto.setInvolveDepartId(departId); + negativeDto.setInvolveDepartName(departName); + negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + + negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); + negativeDto.setDepartId(departId); + negativeDto.setDepartName(departName); + negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); + negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); + negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); + negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); + negativeDto.setCaseNumber(item.getOriginId()); + negativeService.save(negativeDto); + update(new LambdaUpdateWrapper().eq(DataCaseVerif::getOriginId, item.getOriginId()) + .set(DataCaseVerif::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); + }); + return true; + } + +} 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..713cfdf --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java @@ -0,0 +1,206 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.mapper.DataPetitionComplaintMapper; +import com.biutag.supervision.pojo.dto.*; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; +import lombok.RequiredArgsConstructor; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +@RequiredArgsConstructor +@Service +public class DataPetitionComplaintService extends ServiceImpl { + + private final NegativeService negativeService; + + private final DataPetitionComplaintMapper dataPetitionComplaintMapper; + + public Page page(DataPetitionComplaintQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode()) + .like(StrUtil.isNotBlank(queryParam.getOriginId()), DataPetitionComplaint::getOriginId, queryParam.getOriginId()) + .like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataPetitionComplaint::getThingDesc, queryParam.getThingDesc()) + .orderByDesc(DataPetitionComplaint::getCreateTime); + if (queryParam.getDiscoveryTime().size() == 2) { + queryWrapper.between(DataPetitionComplaint::getDiscoveryTime, queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); + } + if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { + switch (queryParam.getResponderKey()) { + case "name": + queryWrapper.like(DataPetitionComplaint::getResponderName, queryParam.getResponderValue()); + break; + case "phone": + queryWrapper.like(DataPetitionComplaint::getResponderPhone, queryParam.getResponderValue()); + break; + } + } + return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + } + + public boolean save(DataPetitionComplaintDto dto) { + DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); + BeanUtil.copyProperties(dto, dataPetitionComplaint); + dataPetitionComplaint.setCreateTime(LocalDateTime.now()); + dataPetitionComplaint.setUpdateTime(LocalDateTime.now()); + return save(dataPetitionComplaint); + } + + public boolean save(DataPetitionComplaintAddDto body) { + LocalDateTime now = LocalDateTime.now(); + int index = 0; + for (DataPetitionComplaintImportDto dto : body.getData()) { + index++; + boolean exists = exists(new LambdaQueryWrapper().eq(DataPetitionComplaint::getOriginId, dto.getOriginId())); + // 增量更新 + if (DataUpdateMethodEnum.incremental.name().equals(body.getDataUpdateMethod()) && exists) { + throw new RuntimeException(String.format("第%s条数据的信件编号已存在,请核实", index)); + } + DataPetitionComplaint data = new DataPetitionComplaint(); + BeanUtils.copyProperties(dto, data); + + data.setCreateTime(now); + data.setUpdateTime(now); + data.setProblemSourcesCode(body.getProblemSourcesCode()); + data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); + saveOrUpdate(data); + } + return true; + } + + public boolean distribution(DataDataPetitionComplainDistribute dataDistribute) { + dataDistribute.getData().forEach(item -> { + NegativeDto negativeDto = new NegativeDto(); + negativeDto.setOriginId(item.getOriginId()); + negativeDto.setDiscoveryTime(item.getDiscoveryTime()); + negativeDto.setProblemSourcesCode(item.getProblemSourcesCode()); + negativeDto.setProblemSources(ProblemSourcesEnum.get(item.getProblemSourcesCode()).getLabel()); +// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW); +// negativeDto.setBusinessTypeName(); + negativeDto.setResponderName(item.getResponderName()); + negativeDto.setContactPhone(item.getResponderPhone()); + negativeDto.setThingDesc(item.getThingDesc()); + String departId; + String departName; + if (StrUtil.isBlank(item.getThirdDepartId())) { + departId = item.getSecondDepartId(); + departName = item.getSecondDepartName(); + } else { + departId = item.getThirdDepartId(); + departName = item.getThirdDepartName(); + } + negativeDto.setInvolveDepartId(departId); + negativeDto.setInvolveDepartName(departName); + negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + + negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); + negativeDto.setDepartId(departId); + negativeDto.setDepartName(departName); + negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); + negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); + negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); + negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); + negativeDto.setCaseNumber(item.getOriginId()); + negativeService.save(negativeDto); + update(new LambdaUpdateWrapper().eq(DataPetitionComplaint::getOriginId, item.getOriginId()) + .set(DataPetitionComplaint::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); + }); + return true; + } + + //所有分类数据总数 + public JSONObject allMailCount(Date beginTime, Date endTime) { + QueryWrapper totalQueryWrapper = new QueryWrapper<>(); + totalQueryWrapper.between("discovery_time", beginTime, endTime); + long totalMail = this.count(totalQueryWrapper); + // 国家信访 + QueryWrapper countryQueryWrapper = new QueryWrapper<>(); + countryQueryWrapper.eq("problem_sources_code", 21); + countryQueryWrapper.between("discovery_time", beginTime, endTime); + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); + // 公安部信访 + QueryWrapper policeQueryWrapper = new QueryWrapper<>(); + policeQueryWrapper.eq("problem_sources_code", 22); + policeQueryWrapper.between("discovery_time", beginTime, endTime); + Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); + // 初访 + QueryWrapper firstQueryWrapper = new QueryWrapper<>(); + firstQueryWrapper.eq("initial_petition", 1); + firstQueryWrapper.between("discovery_time", beginTime, endTime); + Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper); + // 重访 + QueryWrapper secondQueryWrapper = new QueryWrapper<>(); + secondQueryWrapper.eq("initial_petition", 2); + secondQueryWrapper.between("discovery_time", beginTime, endTime); + Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper); + // 领导接访 + QueryWrapper leaderQueryWrapper = new QueryWrapper<>(); + leaderQueryWrapper.isNotNull("receiving_leader_name"); + leaderQueryWrapper.between("discovery_time", beginTime, endTime); + Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper); + // 领导督办 + QueryWrapper leaderViewQueryWrapper = new QueryWrapper<>(); + leaderViewQueryWrapper.isNotNull("receiving_leader_name"); + leaderViewQueryWrapper.between("discovery_time", beginTime, endTime); + Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper); + // 闹访 1:闹 2:不闹 + QueryWrapper tangleQueryWrapper = new QueryWrapper<>(); + tangleQueryWrapper.eq("entanglement_visits", 1); + tangleQueryWrapper.between("discovery_time", beginTime, endTime); + Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper); + // 集访 1:集 2:不集 + QueryWrapper massQueryWrapper = new QueryWrapper<>(); + massQueryWrapper.eq("mass_visits", 1); + massQueryWrapper.between("discovery_time", beginTime, endTime); + Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper); + JSONObject overview = new JSONObject() + // 信访总数(起) + .fluentPut("total", totalMail) + // 国家信访 + .fluentPut("countryMail", countryMail) + // 公安部信访 + .fluentPut("policeMail", policeMail) + // 局长信箱 + .fluentPut("commissionerMail", 10) + // 12337信访 + .fluentPut("numMail", 10) + // 初访; + .fluentPut("firstMail", firstMail) + // 重访 + .fluentPut("secondMail", secondMail) + // 领导接访 + .fluentPut("leaderReceiveMail", leaderReceiveMail) + // 领导督办 + .fluentPut("leaderViewMail", leaderViewMail) + // 闹访问 + .fluentPut("tangleMail", tangleMail) + // 集访 + .fluentPut("massMail", massMail); + return overview; + } + + + // 初访重访分类数据排行 + public List mailRank(Integer departId, Integer Repeat, Date beginTime, Date endTime) { + List list = dataPetitionComplaintMapper. + selectDepartStatistic(departId, Repeat, beginTime, endTime); + return list; + } + + + +} diff --git a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java new file mode 100644 index 0000000..214c53c --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java @@ -0,0 +1,73 @@ +package com.biutag.supervision.service; + +import com.biutag.supervision.mapper.RpcApplyMapper; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.RpcInfringerResult; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class DataRightsComfortService { + + private final RpcApplyService rpcApplyService; + + private final RpcApplyPersonService rpcApplyPersonService; + + private final RpcInfringerResultService rpcInfringerResultService; + + private final RpcApplyMapper rpcApplyMapper; + + // 抚慰人数 + public Integer countComfortPersonNumber(Date beginTime, Date endTime) { + return rpcApplyMapper.countComfortPersonNumber(beginTime, endTime); + } + + // 打击处理人数 + public Integer countHitPersonNumber(Date beginTime, Date endTime) { + List hitPeople = rpcApplyMapper.getHitPeople(beginTime, endTime); + int totalPeople = 0; + if (hitPeople == null || hitPeople.isEmpty()) { + return 0; + } + for (String hitPerson : hitPeople) { + if (hitPerson.isEmpty()) { + continue; + } + if (hitPerson.contains(",")) { + String[] people = hitPerson.split(","); + totalPeople += people.length; + } else { + totalPeople += 1; + } + } + return totalPeople; + } + + public Double countComfortMoney(Date beginTime, Date endTime) { + return rpcApplyMapper.countComfortMoney(beginTime, endTime) / 10000.0; + } + + public List selectPunishmentSituation(Date beginTime, Date endTime) { + List rpcInfringerResults = rpcApplyMapper.selectPunishmentSituation(beginTime, endTime); + if (rpcInfringerResults == null || rpcInfringerResults.isEmpty()) { + return new ArrayList<>(); + } + Map countMap = new HashMap<>(); + for (RpcInfringerResult rpcInfringerResult : rpcInfringerResults) { + String defendHandleWayName = rpcInfringerResult.getDefendHandleWayName(); + String tortName = rpcInfringerResult.getTortName(); + String[] names = tortName.split(","); + int count = names.length; + countMap.put(defendHandleWayName, countMap.getOrDefault(defendHandleWayName, 0) + count); + } + return countMap.entrySet().stream().map(entry -> new PieItem(entry.getKey(), entry.getValue())).collect(Collectors.toList()); + } + + public List selectComfortSituation(Date beginTime, Date endTime) { + return rpcApplyMapper.selectComfortSituation(beginTime, endTime); + } +} diff --git a/src/main/java/com/biutag/supervision/service/FileService.java b/src/main/java/com/biutag/supervision/service/FileService.java new file mode 100644 index 0000000..f969293 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FileService.java @@ -0,0 +1,44 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.io.FileUtil; +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 lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +@RequiredArgsConstructor +@Service +public class FileService { + + private final FastFileStorageClient fastFileStorageClient; + + @Value("${fdfs.preview-url}") + private String FDFS_PREVIEW_URL; + + public String upload(MultipartFile file) throws IOException { + return upload(file.getInputStream(), file.getSize(), FileUtil.extName(file.getOriginalFilename())); + } + + public String upload(InputStream is, long size, String fileExtName) { + StorePath storePath = fastFileStorageClient.uploadFile("group1", is, size, fileExtName); + return "/" + storePath.getFullPath(); + } + + public InputStream download(String filePath) { + HttpResponse httpResponse = HttpUtil.createGet(FDFS_PREVIEW_URL + filePath) + .execute(); + return httpResponse.bodyStream(); + } + +} 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..ce9062e --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/HolidayService.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.List; +import java.util.Objects; + +@Slf4j +@RequiredArgsConstructor +@Service +public class HolidayService extends ServiceImpl { + + private final RedisTemplate redisTemplate; + + public List list(Integer year) { + return list(new LambdaQueryWrapper().eq(Holiday::getYear, year)); + } + + public boolean isHoliday(String date) { + long l = System.currentTimeMillis(); + Boolean result = (Boolean) redisTemplate.opsForValue().get(String.format("holiday:%s", date)); + if (Objects.nonNull(result)) { + return result; + } + Holiday holiday = getOne(new LambdaUpdateWrapper().eq(Holiday::getDate, date)); + if (Objects.isNull(holiday)) { + // log.error("节假日 {} 数据未找到", date); + return false; + } + redisTemplate.opsForValue().set(String.format("holiday:%s", date), holiday.getFlag()); + 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/ModelClueRecordService.java b/src/main/java/com/biutag/supervision/service/ModelClueRecordService.java new file mode 100644 index 0000000..4641af1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ModelClueRecordService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.ModelClueRecord; +import com.biutag.supervision.mapper.ModelClueRecordMapper; +import org.springframework.stereotype.Service; + +@Service +public class ModelClueRecordService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java new file mode 100644 index 0000000..96a08bd --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -0,0 +1,802 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.dto.ModelClueTaskDistribute; +import com.biutag.supervision.pojo.dto.NegativeDto; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.ModelClueModel; +import com.biutag.supervision.pojo.param.ModelClueQueryParam; +import com.biutag.supervision.pojo.vo.FileVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@Slf4j +@RequiredArgsConstructor +@Service +public class ModelClueService extends ServiceImpl { + + private final ModelMapper modelMapper; + + private final ModelClueTaskService modelClueTaskService; + + private final NegativeService negativeService; + + public final SupDepartService departService; + + public final ModelClueMapper modelClueMapper; + + public final ModelClueDataMapper modelClueDataMapper; + + public final ModelClueRecordMapper modelClueRecordMapper; + + public final SupExternalDepartMapper supExternalDepartMapper; + + public Page page(ModelClueQueryParam param) { + if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + QueryWrapper queryWrapper = new QueryWrapper() + .eq(StrUtil.isNotBlank(param.getDistributionMethod()), "m.distribution_method", param.getDistributionMethod()) + .in(Objects.nonNull(param.getModelIds()) && !param.getModelIds().isEmpty(), "mc.model_id", param.getModelIds()) + .eq(Objects.nonNull(param.getInvolveDepartId()), "mc.involve_depart_id", param.getInvolveDepartId()) + .eq(StrUtil.isNotBlank(param.getDistributionState()), "mc.distribution_state", param.getDistributionState()) + .like(StrUtil.isNotBlank(param.getThingDesc()), "mc.thing_desc", param.getThingDesc()) + .orderByDesc("mc.create_time"); + if (Objects.nonNull(param.getCreateTime()) && param.getCreateTime().size() == 2) { + queryWrapper.between("mc.create_time", param.getCreateTime().get(0), param.getCreateTime().get(1)); + } + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public List listByUnDistributed(Integer modelId) { + return list(new LambdaQueryWrapper().eq(ModelClue::getModelId, modelId).eq(ModelClue::getDistributionState, DistributionStateEnum.UNDISTRIBUTED.getValue())); + } + + public boolean distribution(ModelClueTaskDistribute taskDistribute) { + List modelClues = taskDistribute.getModelClues(); + Model model = modelMapper.selectById(modelClues.get(0).getModelId()); + model.setTimeLimit(taskDistribute.getTimeLimit()); + model.setMaxSignDuration(taskDistribute.getMaxSignDuration()); + model.setMaxHandleDuration(taskDistribute.getMaxHandleDuration()); + model.setMaxExtensionDuration(taskDistribute.getMaxExtensionDuration()); + model.setApprovalFlow(taskDistribute.getApprovalFlow()); + model.setDistributionFlow(taskDistribute.getDistributionFlow()); + + return distribution(modelClues, model, taskDistribute.getTaskName(), taskDistribute.getThingFiles()); + } + + + public boolean distribution(Integer modelId) { + List modelClues = listByUnDistributed(modelId); + Model model = modelMapper.selectById(modelId); + String taskName = "自动下发"; + return distribution(modelClues, model, taskName, new ArrayList<>()); + } + + @Transactional(rollbackFor = Exception.class) + public boolean distribution(List modelClues, Model model, String taskName, List thingFiles) { + LocalDateTime now = LocalDateTime.now(); + modelClues.forEach(item -> { + if (Objects.isNull(item.getInvolveDepartId())) { + throw new RuntimeException("涉及单位不能为空..."); + } + NegativeDto negative = new NegativeDto(); + // 问题来源 + negative.setProblemSources(ProblemSourcesEnum.LMGZ.getLabel()); + negative.setProblemSourcesCode(ProblemSourcesEnum.LMGZ.getValue()); + // TODO 业务类别 涉及问题 + // 涉及单位 + negative.setInvolveDepartId(item.getInvolveDepartId()); + negative.setInvolveDepartName(item.getInvolveDepartName()); + // 问题发生时间 + negative.setHappenTime(item.getCreateTime()); + // 问题发现时间 + negative.setDiscoveryTime(item.getCreateTime()); + // 事情简要描述 + negative.setThingDesc(item.getThingDesc()); + // 主办层级 + negative.setHostLevel(HostLevelEnums.THREE.getValue()); + // 办理单位 + SupDepart depart = departService.getById(item.getInvolveDepartId()); + if (depart.getLevel().equals(DepartLevelEnum.SECOND.getValue())) { + negative.setDepartId(depart.getId()); + negative.setDepartName(depart.getName()); + } + if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue())) { + SupDepart parentDepart = departService.getParentDepart(item.getInvolveDepartId()); + negative.setDepartId(parentDepart.getId()); + negative.setDepartName(parentDepart.getName()); + } + if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.THIRD.getValue())) { + negative.setDepartId(depart.getId()); + negative.setDepartName(depart.getName()); + } + negative.setTimeLimit(model.getTimeLimit()); + negative.setMaxSignDuration(model.getMaxSignDuration()); + negative.setMaxHandleDuration(model.getMaxHandleDuration()); + negative.setMaxExtensionDuration(model.getMaxExtensionDuration()); + // 审批流程 + negative.setApprovalFlow(model.getApprovalFlow()); + + negativeService.save(negative); + + item.setDistributionState(DistributionStateEnum.DISTRIBUTED.getValue()); + item.setUpdateTime(LocalDateTime.now()); + item.setNegativeId(negative.getId()); + updateById(item); + }); + ModelClueTask modelClueTask = new ModelClueTask(); + modelClueTask.setTaskName(taskName); + modelClueTask.setModelId(model.getId()); + modelClueTask.setSize(modelClues.size()); + modelClueTask.setDistributionTime(now); + // 下发方式 + modelClueTask.setDistributionMethod(model.getDistributionMethod()); + modelClueTaskService.save(modelClueTask); + return true; + } + + public void generate(Integer modelId) { + Model model = modelMapper.selectById(modelId); + List modelClues = new ArrayList<>(); + if (!Objects.isNull(model)) { + if (model.getModelSql() != null) { + modelClues.addAll(getModelClueBySql(model.getModelSql(), modelId)); + } + } + if (!modelClues.isEmpty()) { + for (ModelClue modelClue : modelClues) { + modelClue.setModelId(modelId); + modelClue.setCreateTime(LocalDateTime.now()); + } + modelClueMapper.insert(modelClues); + modelClueRecordMapper.insert(new ModelClueRecord().setModelId(modelId).setSize(modelClues.size()).setCreateTime(LocalDateTime.now()).setState("success")); + } else { + modelClueRecordMapper.insert(new ModelClueRecord().setModelId(modelId).setSize(0).setCreateTime(LocalDateTime.now()).setState("fail").setErrMsg("数据为空")); + } + } + + public List getModelClueBySql(String sql, Integer modelId) { + List modelClues = new ArrayList<>(); + if (modelId == 2) { // 2号模型:行政、刑事案件受立案不及时问题监督模型 + return getModelCluesForModel2(sql, modelClues); + } else if (modelId == 4) { // 4号模型:疑似漏登执法办案场所问题监督模型 + return getModelCluesForModel4(sql, modelClues); + } else if (modelId == 16) { // 16号模型:多次取保的异常数据 + getModelCluesForModel16(sql, modelClues); + return modelClues; + } else { + System.out.println("模型" + modelId + "开始查询数据库"); + modelClues = modelClueDataMapper.selectDataByDynamicSql(sql); + System.out.println("模型" + modelId + "查询数据库完毕,数量为:" + modelClues.size()); + } + List uniqueKeys = modelClues.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList(); + List oldUniqueKeys = this.listObjs(new LambdaQueryWrapper().select(ModelClue::getUniqueKey).eq(ModelClue::getStatus, 0).eq(ModelClue::getModelId, modelId), String::valueOf); + List changeStatusIds = oldUniqueKeys.stream().filter(item -> !uniqueKeys.contains(item)).toList(); + if (!changeStatusIds.isEmpty()) { + modelClueMapper.update(null, new LambdaUpdateWrapper().in(ModelClue::getUniqueKey, changeStatusIds).set(ModelClue::getStatus, 1)); + } + List needsInsertIds = uniqueKeys.stream().filter(item -> !oldUniqueKeys.contains(item)).toList(); + if (needsInsertIds.isEmpty()) { + return new ArrayList<>(); + } + List needsInsertModelClues = modelClues.stream().filter(item -> needsInsertIds.contains(item.getUniqueKey())).toList(); + String newSql = generateNewSql(sql, needsInsertIds); + List> allData = modelClueDataMapper.selectByUniqueKeys(newSql); + String originalFieldName = getKeyFieldName(sql); + for (ModelClue modelClue : needsInsertModelClues) { + for (Map data : allData) { + String keyColumn = (String) data.get(originalFieldName); + if (Objects.equals(keyColumn, modelClue.getUniqueKey())) { + modelClue.setData(JSONObject.toJSONString(data)); + modelClue.setStatus(0); + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, modelClue.getInvolveDepartId()).last("LIMIT 1")); + if (supExternalDepart != null && supExternalDepart.getInternalShortName() != null && !supExternalDepart.getInternalShortName().isEmpty()) { + modelClue.setInvolveDepartName(supExternalDepart.getInternalShortName()); + modelClue.setInvolveDepartId(supExternalDepart.getInternalId()); + } + setPerson(modelId, modelClue, data); + generateZFBAThingDesc(modelId, modelClue, data); + break; + } + } + } + return needsInsertModelClues; + } + + private void setPerson(Integer modelId, ModelClue modelClue, Map data) { + if (modelId == 3) { // 执法区域人员表 + if (data.get("bar1") != null && !data.get("bar1").equals("")) { + if (data.get("bar2") != null && !data.get("bar2").equals("")) { + modelClue.setInvolvePoliceName(data.get("bar1") + "," + data.get("bar2")); + } else { + modelClue.setInvolvePoliceName((String) data.get("bar1")); + } + } else { + if (data.get("bar2") != null && !data.get("bar2").equals("")) { + modelClue.setInvolvePoliceName((String) data.get("bar2")); + } else { + modelClue.setInvolvePoliceName("无数据"); + } + } + if (data.get("bar1jh") != null && !data.get("bar1jh").equals("")) { + if (data.get("bar2jh") != null && !data.get("bar2jh").equals("")) { + modelClue.setInvolvePoliceEmpNo(data.get("bar1jh") + "," + data.get("bar2jh")); + } else { + modelClue.setInvolvePoliceEmpNo((String) data.get("bar1jh")); + } + } else { + if (data.get("bar2jh") != null && !data.get("bar2jh").equals("")) { + modelClue.setInvolvePoliceEmpNo((String) data.get("bar2jh")); + } else { + modelClue.setInvolvePoliceEmpNo("无数据"); + } + } + } + if (modelId == 10 || modelId == 11 || modelId == 12 || modelId == 13 || modelId == 14 || modelId == 15) { // 案件基本信息表 + Map bar1; + Map bar2; + if (data.get("BAR1ID") != null && !data.get("BAR1ID").equals("")) { + bar1 = modelClueDataMapper.selectBAR((String) data.get("BAR1ID")); + if (data.get("BAR2ID") != null && !data.get("BAR2ID").equals("")) { + bar2 = modelClueDataMapper.selectBAR((String) data.get("BAR2ID")); + if (bar1 != null) { + if (bar2 != null) { + modelClue.setInvolvePoliceEmpNo(bar1.get("JH") + "," + bar2.get("JH")); + modelClue.setInvolvePoliceName(bar1.get("XM") + "," + bar2.get("XM")); + } else { + modelClue.setInvolvePoliceEmpNo((String) bar1.get("JH")); + modelClue.setInvolvePoliceName((String) bar1.get("XM")); + } + } else if (bar2 != null) { + modelClue.setInvolvePoliceEmpNo((String) bar2.get("JH")); + modelClue.setInvolvePoliceName((String) bar2.get("XM")); + } else { + modelClue.setInvolvePoliceEmpNo("无数据"); + modelClue.setInvolvePoliceName("无数据"); + } + } else { + if (bar1 != null) { + modelClue.setInvolvePoliceEmpNo((String) bar1.get("JH")); + modelClue.setInvolvePoliceName((String) bar1.get("XM")); + } else { + modelClue.setInvolvePoliceEmpNo("无数据"); + modelClue.setInvolvePoliceName("无数据"); + } + } + } else { + if (data.get("bar2jh") != null && !data.get("bar2jh").equals("")) { + bar2 = modelClueDataMapper.selectBAR((String) data.get("BAR2ID")); + if (bar2 != null) { + modelClue.setInvolvePoliceEmpNo((String) bar2.get("JH")); + modelClue.setInvolvePoliceName((String) bar2.get("XM")); + } else { + modelClue.setInvolvePoliceEmpNo("无数据"); + modelClue.setInvolvePoliceName("无数据"); + } + } else { + modelClue.setInvolvePoliceEmpNo("无数据"); + modelClue.setInvolvePoliceName("无数据"); + } + } + } + } + + private static void generateZFBAThingDesc(Integer modelId, ModelClue modelClue, Map data) { + if (modelId == 1) { // 1号模型:行政、刑事案件受理30天仍未立案问题监督模型 + String thingDesc = modelClue.getThingDesc(); + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + data.get("AJBH") + + ",报案日期为" + getDateString(data.get("BARQ")) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",当前案件状态为“" + data.get("AJZTmc") + + "”,已经超过" + "30" + + "日仍未受理。" + thingDesc); + } else if (modelId == 3) { // 3号模型:执法办案场所登记时长超时问题监督模型 + if (data.get("lksj") != null && !data.get("lksj").equals("")) { + modelClue.setThingDesc("姓名" + data.get("xm") + + ",身份证号" + data.get("zjhm") + + ",于" + formatStringDate((String) data.get("djsj")) + + "登记进入" + modelClue.getInvolveDepartName() + + ",离开时间为" + formatStringDate((String) data.get("lksj")) + + ",超过了48小时。"); + } else { + modelClue.setThingDesc("姓名" + data.get("xm") + + ",身份证号" + data.get("zjhm") + + ",于" + formatStringDate((String) data.get("djsj")) + + "登记进入" + modelClue.getInvolveDepartName() + + ",没有离开时间。"); + } + } else if (modelId == 10) { // 10号模型:案件受理不及时的异常数据 + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + getAjbh(data) + + ",报案日期为" + getDateString(data.get("BARQ")) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",当前案件状态为“" + data.get("AJZTmc") + + "”,超过" + "3" + + "日未受理。"); + } else if (modelId == 11) { // 11号模型:立案不及时的异常数据(7天) + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + getAjbh(data) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",立案日期为" + getDateString(data.get("LARQ")) + + ",当前案件状态为“" + data.get("AJZTmc") + + "”,超过" + "7" + + "日未受理。"); + } else if (modelId == 12) { // 12号模型:立案不及时的异常数据(30天) + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + getAjbh(data) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",立案日期为" + getDateString(data.get("LARQ")) + + ",当前案件状态为“" + data.get("AJZTmc") + + "”,超过" + "30" + + "日未受理。"); + } else if (modelId == 13) { // 13号模型:立案不及时的异常数据(60天) + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + getAjbh(data) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",立案日期为" + getDateString(data.get("LARQ")) + + ",当前案件状态为“" + data.get("AJZTmc") + + "”,超过" + "60" + + "日未受理。"); + } else if (modelId == 14) { // 14号模型:立案不及时的异常数据(无数据) + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + getAjbh(data) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",立案日期 无数据" + + ",当前案件状态为“" + data.get("AJZTmc") + + "”,立案不及时。"); + } else if (modelId == 15) { // 15号模型:未录入受害人员的异常数据 + modelClue.setThingDesc("该" + data.get("AJBZmc") + + "案件编号为" + getAjbh(data) + + ",受理日期为" + getDateString(data.get("SLRQ")) + + ",没有录入受害人。"); + } + } + + private static String getAjbh(Map data) { + String AJBH; + if (data.get("AJBH") == null || data.get("AJBH").equals("")) { + AJBH = "空"; + } else { + AJBH = (String) data.get("AJBH"); + } + return AJBH; + } + + private List getModelCluesForModel4(String param, List modelClues) { + System.out.println("模型4开始查询数据库"); + List params = parseSqlForModel2(param); + String jjdSql = "SELECT gxdwdm AS involve_depart_id, gxdwmc AS involve_depart_name, COUNT(*) AS zjjs FROM dwd_asj_zhtx_jjd WHERE cjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY gxdwdm, gxdwmc;"; + String zfqySql = "SELECT csid AS involve_depart_id, COUNT(*) AS zfcsdjs FROM dwd_ry_zfba_zfqywfryb WHERE STR_TO_DATE( djsj, '%Y%m%d%H%i%s' ) BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY csid;"; + List> jjdmaps = modelClueDataMapper.selectByUniqueKeys(jjdSql); + List> zfqymaps = modelClueDataMapper.selectByUniqueKeys(zfqySql); + System.out.println("模型4查询数据库完毕"); + if (jjdmaps.isEmpty()) { + return modelClues; + } + List jjdModelClues = new ArrayList<>(); + for (Map data : jjdmaps) { + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, data.get("involve_depart_id")).last("LIMIT 1")); + if (supExternalDepart != null && supExternalDepart.getExternalId() != null && supExternalDepart.getExternalName() != null && supExternalDepart.getInternalId() != null && supExternalDepart.getLevel() != null && supExternalDepart.getPid() != null) { + ModelClue modelClue = new ModelClue(); + modelClue.setData(JSONObject.toJSONString(data)); + modelClue.setInvolveDepartId(supExternalDepart.getExternalId()); + modelClue.setInvolveDepartName(supExternalDepart.getExternalName()); + modelClue.setZjjs((Long) data.get("zjjs")); + modelClue.setDepartLevel(supExternalDepart.getLevel()); + modelClue.setParentId(supExternalDepart.getPid()); + modelClue.setThisId(supExternalDepart.getInternalId()); + jjdModelClues.add(modelClue); + } + } + List jjdModelClues3 = new ArrayList<>(jjdModelClues.stream().filter(clue -> clue.getDepartLevel() == 3).toList()); + List jjdModelClues4 = new ArrayList<>(jjdModelClues.stream().filter(clue -> clue.getDepartLevel() == 4).toList()); + List jjdModelClues5 = new ArrayList<>(jjdModelClues.stream().filter(clue -> clue.getDepartLevel() == 5).toList()); + mergeModelClues(jjdModelClues5, jjdModelClues4, 1); + mergeModelClues(jjdModelClues4, jjdModelClues3, 1); + List zfqymModelClues = new ArrayList<>(); + for (Map data : zfqymaps) { + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, data.get("involve_depart_id")).last("LIMIT 1")); + if (supExternalDepart != null && supExternalDepart.getExternalId() != null && supExternalDepart.getExternalName() != null && supExternalDepart.getInternalId() != null && supExternalDepart.getLevel() != null && supExternalDepart.getPid() != null) { + ModelClue modelClue = new ModelClue(); + modelClue.setData(JSONObject.toJSONString(data)); + modelClue.setInvolveDepartId(supExternalDepart.getExternalId()); + modelClue.setZfcsdjs((Long) data.get("zfcsdjs")); + modelClue.setDepartLevel(supExternalDepart.getLevel()); + modelClue.setParentId(supExternalDepart.getPid()); + modelClue.setThisId(supExternalDepart.getInternalId()); + zfqymModelClues.add(modelClue); + } + } + List zfqymModelClues3 = new ArrayList<>(zfqymModelClues.stream().filter(clue -> clue.getDepartLevel() == 3).toList()); + List zfqymModelClues4 = new ArrayList<>(zfqymModelClues.stream().filter(clue -> clue.getDepartLevel() == 4).toList()); + List zfqymModelClues5 = new ArrayList<>(zfqymModelClues.stream().filter(clue -> clue.getDepartLevel() == 5).toList()); + mergeModelClues(zfqymModelClues5, zfqymModelClues4, 2); + mergeModelClues(zfqymModelClues4, zfqymModelClues3, 2); + BigDecimal avgPercentage; + if (!zfqymModelClues3.isEmpty()) { + BigDecimal zjjsTotal = BigDecimal.valueOf(jjdModelClues3.stream().mapToLong(ModelClue::getZjjs).sum()); + BigDecimal zfcsdjsTotal = BigDecimal.valueOf(zfqymModelClues3.stream().mapToLong(ModelClue::getZfcsdjs).sum()); + // 全市平均数 + avgPercentage = zfcsdjsTotal.divide(zjjsTotal, 2, RoundingMode.HALF_UP); + } else { + avgPercentage = BigDecimal.ZERO; + } + for (ModelClue jjdModelClue : jjdModelClues3) { + if (zfqymModelClues3.isEmpty()) { + jjdModelClue.setStatus(0); + jjdModelClue.setThingDesc("在" + params.get(0) + "到" + params.get(1) + "之间," + jjdModelClue.getInvolveDepartName() + + "的总警情数为" + jjdModelClue.getZjjs() + + ",执法场所登记数为0" + + ",每100起警情执法场所登记比例为0" + + ",低于全市平均值(" + avgPercentage + + "%),疑似漏登执法办案场所。"); + } else { + Iterator iterator1 = zfqymModelClues3.iterator(); + boolean found = false; + while (iterator1.hasNext()) { + ModelClue zfqymModelClue = iterator1.next(); + if (jjdModelClue.getInvolveDepartId().equals(zfqymModelClue.getInvolveDepartId())) { + jjdModelClue.setZfcsdjs(zfqymModelClue.getZfcsdjs()); + BigDecimal zfcsdjs = BigDecimal.valueOf(jjdModelClue.getZfcsdjs()); + BigDecimal zjjs = BigDecimal.valueOf(jjdModelClue.getZjjs()); + BigDecimal bl = zfcsdjs.divide(zjjs, 2, RoundingMode.HALF_UP); + jjdModelClue.setBl(bl); + jjdModelClue.setStatus(0); + jjdModelClue.setThingDesc("在" + params.get(0) + "到" + params.get(1) + "之间," + jjdModelClue.getInvolveDepartName() + + "的总警情数为" + jjdModelClue.getZjjs() + + ",执法场所登记数为" + jjdModelClue.getZfcsdjs() + + ",每100起警情执法场所登记比例为" + jjdModelClue.getBl() + + ",低于全市平均值(" + avgPercentage + + "%),疑似漏登执法办案场所。"); + iterator1.remove(); + found = true; + break; + } + } + if (!found) { + jjdModelClue.setStatus(0); + jjdModelClue.setThingDesc("在" + params.get(0) + "到" + params.get(1) + "之间," + jjdModelClue.getInvolveDepartName() + + "的总警情数为" + jjdModelClue.getZjjs() + + ",执法场所登记数为0" + + ",每100起警情执法场所登记比例为0%" + + ",低于全市平均值(" + avgPercentage + + "%),疑似漏登执法办案场所。"); + } + } + } + modelClues.addAll(jjdModelClues3); + return modelClues; + } + + private void getModelCluesForModel16(String param, List modelClues) { + System.out.println("模型16开始查询数据库"); + List params = parseSqlForModel2(param); + String selectSfzh = "SELECT count(sfzh) as num, sfzh FROM dwd_wp_zfba_qbhsjds WHERE STR_TO_DATE(pzrq, '%Y%m%d%H%i%s') BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY sfzh HAVING count(sfzh) > 2;"; + List> sfzhList = modelClueDataMapper.selectByUniqueKeys(selectSfzh); + Map sfzhMap = sfzhList.stream().filter(map -> map.get("sfzh") != null).collect(Collectors.toMap( + map -> (String) map.get("sfzh"), + map -> (long)map.get("num")) + ); + System.out.println("模型16查询数据库完毕"); + if (sfzhMap.isEmpty()) { + return; + } + String selectSfzh2 = "SELECT a.zj AS uniqueKey, a.sfzh AS negative_id, a.badwid AS involve_depart_id, a.badwmc AS involve_depart_name, a.bar1xm, a.bar2xm, a.bar1id, a.bar2id, a.sfzh, a.xm FROM dwd_wp_zfba_qbhsjds a INNER JOIN (SELECT sfzh, MAX(STR_TO_DATE(pzrq, '%Y%m%d%H%i%s')) AS max_create_time FROM dwd_wp_zfba_qbhsjds WHERE STR_TO_DATE(pzrq, '%Y%m%d%H%i%s') BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY sfzh) b ON a.sfzh = b.sfzh AND STR_TO_DATE(a.pzrq, '%Y%m%d%H%i%s') = b.max_create_time;"; + List> newModelClues = modelClueDataMapper.selectByUniqueKeys(selectSfzh2); + for (Map modelClue : newModelClues) { + if (!sfzhMap.containsKey((String) modelClue.get("sfzh"))) { + continue; + } + Long count = baseMapper.selectCount(new LambdaQueryWrapper().eq(ModelClue::getNegativeId, modelClue.get("sfzh"))); + if (count > 0) { + continue; + } + ModelClue newModelClue = new ModelClue(); + newModelClue.setUniqueKey((String) modelClue.get("uniqueKey")); + newModelClue.setNegativeId((String) modelClue.get("negative_id")); + if (modelClue.get("involve_depart_id") != null) { + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, modelClue.get("involve_depart_id")).last("LIMIT 1")); + if (supExternalDepart != null) { + if (supExternalDepart.getInternalId() != null) { + newModelClue.setInvolveDepartId(supExternalDepart.getInternalId()); + } + if (supExternalDepart.getInternalShortName() != null) { + newModelClue.setInvolveDepartName(supExternalDepart.getInternalShortName()); + } + } + } + if (modelClue.get("bar1xm") != null) { + if (modelClue.get("bar2xm") != null) { + newModelClue.setInvolvePoliceName(modelClue.get("bar1xm") + "、" + modelClue.get("bar2xm")); + } else { + newModelClue.setInvolvePoliceName((String) modelClue.get("bar1xm")); + } + } else { + if (modelClue.get("bar2xm") != null) { + newModelClue.setInvolvePoliceName((String) modelClue.get("bar2xm")); + } else { + newModelClue.setInvolvePoliceName("无数据"); + } + } + Map bar1 = modelClueDataMapper.selectBAR((String) modelClue.get("bar1id")); + Map bar2 = modelClueDataMapper.selectBAR((String) modelClue.get("bar2id")); + if (bar1 != null && bar1.get("JH") != null) { + if (bar2 != null && bar2.get("JH") != null) { + newModelClue.setInvolvePoliceEmpNo(bar1.get("JH") + "、" + bar2.get("JH")); + } else { + newModelClue.setInvolvePoliceEmpNo((String) bar1.get("JH")); + } + } else { + if (bar2 != null && bar2.get("JH") != null) { + newModelClue.setInvolvePoliceEmpNo((String) bar2.get("JH")); + } else { + newModelClue.setInvolvePoliceEmpNo("无数据"); + } + } + newModelClue.setData(JSONObject.toJSONString(modelClue)); + newModelClue.setStatus(0); + newModelClue.setThingDesc("在" + params.get(0) + "到" + params.get(1) + "之间," + + (String) modelClue.get("xm") + + "(身份证号:" + modelClue.get("sfzh") + ")的取保次数为" + + sfzhMap.get((String) modelClue.get("sfzh")) + "次,大于2次,属于多次取保异常数据。"); + modelClues.add(newModelClue); + sfzhMap.remove((String) modelClue.get("sfzh")); + } + } + + private void mergeModelClues(List modelClues2, List modelClues1 , int no) { + for (ModelClue modelClue2 : modelClues2) { + Iterator iterator1 = modelClues1.iterator(); + boolean found = false; + while (iterator1.hasNext()) { + ModelClue modelClue1 = iterator1.next(); + if (modelClue2.getParentId().equals(modelClue1.getThisId())) { + if (no == 1) { + modelClue1.setZjjs(modelClue2.getZjjs() + modelClue1.getZjjs()); + } else if (no == 2) { + modelClue1.setZfcsdjs(modelClue2.getZfcsdjs() + modelClue1.getZfcsdjs()); + } + modelClue1.setData(modelClue1.getData() + modelClue2.getData()); + found = true; + break; + } + } + if (!found) { + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getInternalId, modelClue2.getParentId()).last("LIMIT 1")); + if (supExternalDepart != null) { + ModelClue newModelClue = new ModelClue(); + newModelClue.setData(modelClue2.getData()); + newModelClue.setInvolveDepartId(supExternalDepart.getExternalId()); + newModelClue.setInvolveDepartName(supExternalDepart.getExternalName()); + newModelClue.setParentId(supExternalDepart.getPid()); + newModelClue.setThisId(supExternalDepart.getInternalId()); + newModelClue.setDepartLevel(supExternalDepart.getLevel()); + if (no == 1) { + newModelClue.setZjjs(modelClue2.getZjjs()); + } else if (no == 2) { + newModelClue.setZfcsdjs(modelClue2.getZfcsdjs()); + } + modelClues1.add(newModelClue); + } else { + System.out.println("父级部门" + modelClue2.getParentId() + "不存在"); + } + } + } + } + + private List getModelCluesForModel2(String param, List modelClues) { + List modelClues1 = new ArrayList<>(); + List params = parseSqlForModel2(param); + String preSql = "SELECT a.jjdbh AS uniqueKey, a.jjdbh AS negative_id, a.gxdwmc AS involve_depart_name, a.gxdwdm AS involve_depart_id FROM dwd_asj_zhtx_jjd a WHERE (a.jqxzdm LIKE '01%' OR a.jqxzdm LIKE '02%') AND a.bjnr LIKE '%"; + String postSql = "%' AND NOT EXISTS (SELECT 1 FROM dwd_asj_sjjhygx_jjcjxxb b WHERE b.BARLXDH = a.bjdh) AND a.bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00';"; + genarateModelCluesForModel2(preSql, postSql, modelClues1); + List uniqueKeys = modelClues1.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList(); + if (!uniqueKeys.isEmpty()) { + String newSql = "SELECT a.* FROM dwd_asj_zhtx_jjd a LEFT JOIN dwd_asj_sjjhygx_jjcjxxb b ON b.BARLXDH = a.bjdh WHERE a.jjdbh IN " + "(" + uniqueKeys.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");"; + System.out.println("测试2开始查询数据库 newSql"); + List> allData = modelClueDataMapper.selectByUniqueKeys(newSql); + System.out.println("测试2查询数据库newSql记录条数:" + allData.size()); + for (ModelClue modelClue : modelClues1) { + for (Map data : allData) { + String keyColumn = (String) data.get("jjdbh"); + if (Objects.equals(keyColumn, modelClue.getUniqueKey())) { + modelClue.setData(JSONObject.toJSONString(data)); + modelClue.setStatus(0); + String jqxz = ""; + jqxz = summarizeAttribute(data, jqxz); + modelClue.setThingDesc("该" + jqxz + + "警情接警单编号为" + data.get("jjdbh") + + ",报案时间为" + getDateString(data.get("bjsj")) + + ",没有匹配到立案时间,受立案不及时。"); + break; + } + } + } + modelClues.addAll(modelClues1); + } + List modelClues2 = new ArrayList<>(); + String preSql2 = "SELECT a.jjdbh AS uniqueKey, a.jjdbh AS negative_id, a.gxdwmc AS involve_depart_name, a.gxdwdm AS involve_depart_id FROM dwd_asj_zhtx_jjd a WHERE (a.jqxzdm LIKE '01%' OR a.jqxzdm LIKE '02%') AND a.bjnr LIKE '%"; + String postSql2 = "%' AND EXISTS (SELECT 1 FROM dwd_asj_sjjhygx_jjcjxxb b WHERE b.lasj IS NOT NULL AND b.basj < DATE_SUB(STR_TO_DATE(b.lasj, '%Y%m%d%H%i%s') , INTERVAL 7 DAY) AND b.BARLXDH = a.bjdh AND STR_TO_DATE(b.lasj, '%Y%m%d%H%i%s') > a.bjsj) AND a.bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' ORDER BY a.bjsj desc LIMIT 1;"; + genarateModelCluesForModel2(preSql2, postSql2, modelClues2); + List uniqueKeys2 = modelClues2.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList(); + if (!uniqueKeys2.isEmpty()) { + String newSql2 = "SELECT a.*, b.ajbh, b.lasj FROM dwd_asj_zhtx_jjd a LEFT JOIN dwd_asj_sjjhygx_jjcjxxb b ON b.BARLXDH = a.bjdh WHERE a.jjdbh IN " + "(" + uniqueKeys2.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");"; + List> allData2 = modelClueDataMapper.selectByUniqueKeys(newSql2); + for (ModelClue modelClue : modelClues2) { + for (Map data : allData2) { + String keyColumn = (String) data.get("jjdbh"); + if (Objects.equals(keyColumn, modelClue.getUniqueKey())) { + modelClue.setData(JSONObject.toJSONString(data)); + modelClue.setStatus(0); + String jqxz = ""; + jqxz = summarizeAttribute(data, jqxz); + modelClue.setThingDesc("该" + jqxz + + "警情接警单编号为" + data.get("jjdbh") + + ",报案时间为" + getDateString(data.get("bjsj")) + + ",案件编号为" + data.get("ajbh") + + ",立案时间为" + formatStringDate((String) data.get("lasj")) + + ",报案时间与立案时间超过7天,受立案不及时。"); + break; + } + } + } + modelClues.addAll(modelClues2); + } + return modelClues; + } + + private void genarateModelCluesForModel2(String preSql, String postSql, List modelClues) { + System.out.println("模型2开始查询数据库 盗"); + List modelClues1 = modelClueDataMapper.selectDataByDynamicSql(preSql + "盗" + postSql); + System.out.println("模型2开始查询数据库 骗"); + List modelClues2 = modelClueDataMapper.selectDataByDynamicSql(preSql + "骗" + postSql); + System.out.println("模型2开始查询数据库 强奸"); + List modelClues3 = modelClueDataMapper.selectDataByDynamicSql(preSql + "强奸" + postSql); + System.out.println("模型2开始查询数据库 抢"); + List modelClues4 = modelClueDataMapper.selectDataByDynamicSql(preSql + "抢" + postSql); + System.out.println("模型2开始查询数据库 10岁"); + List modelClues5 = modelClueDataMapper.selectDataByDynamicSql(preSql + "10岁" + postSql); + System.out.println("模型2开始查询数据库 11岁"); + List modelClues6 = modelClueDataMapper.selectDataByDynamicSql(preSql + "11岁" + postSql); + System.out.println("模型2开始查询数据库 12岁"); + List modelClues7 = modelClueDataMapper.selectDataByDynamicSql(preSql + "12岁" + postSql); + System.out.println("模型2开始查询数据库 13岁"); + List modelClues8 = modelClueDataMapper.selectDataByDynamicSql(preSql + "13岁" + postSql); + System.out.println("模型2开始查询数据库 14岁"); + List modelClues9 = modelClueDataMapper.selectDataByDynamicSql(preSql + "14岁" + postSql); + System.out.println("模型2开始查询数据库 15岁"); + List modelClues10 = modelClueDataMapper.selectDataByDynamicSql(preSql + "15岁" + postSql); + System.out.println("模型2开始查询数据库 16岁"); + List modelClues11 = modelClueDataMapper.selectDataByDynamicSql(preSql + "16岁" + postSql); + System.out.println("模型2开始查询数据库 未成年"); + List modelClues12 = modelClueDataMapper.selectDataByDynamicSql(preSql + "未成年" + postSql); + modelClues.addAll(Stream.of(modelClues1, modelClues2, modelClues3, modelClues4, modelClues5, modelClues6, modelClues7, modelClues8, modelClues9, modelClues10, modelClues11, modelClues12) + .flatMap(List::stream) + .collect(Collectors.toMap(ModelClue::getUniqueKey, data -> data, (existing, replacement) -> existing)) + .values()); + System.out.println("模型2查询数据库完毕,数量为:" + modelClues.size()); + } + + private static String getDateString(Object param) { + if (param != null) { + String time = null; + try { + time = String.valueOf(param); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + Date parse = sdf.parse(time); + Instant instant = parse.toInstant(); + ZoneId zoneId = ZoneId.systemDefault(); + LocalDateTime localDateTime = instant.atZone(zoneId).toLocalDateTime(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + return formatter.format(localDateTime); + } catch (Exception e) { + try { + time = String.valueOf(param); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); + Date parse = sdf.parse(time); + Instant instant = parse.toInstant(); + ZoneId zoneId = ZoneId.systemDefault(); + LocalDateTime localDateTime = instant.atZone(zoneId).toLocalDateTime(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + return formatter.format(localDateTime); + } catch (Exception ex) { + log.info("日期转换异常{}", time, ex); + } + } + } + return " 无时间数据 "; + } + + public static String generateNewSql(String originalSql, List uniqueKeys) { + Pattern tablePattern = Pattern.compile("FROM\\s+(\\w+)", Pattern.CASE_INSENSITIVE); + Matcher tableMatcher = tablePattern.matcher(originalSql); + String tableName = ""; + if (tableMatcher.find()) { + tableName = tableMatcher.group(1); + } + String originalFieldName = getKeyFieldName(originalSql); + return "SELECT * FROM " + tableName + " " + "WHERE " + originalFieldName + " IN " + "(" + uniqueKeys.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");"; + } + + private static String getKeyFieldName(String originalSql) { + String patternString = "SELECT\\s+(\\w+)\\s+AS\\s+" + Pattern.quote("uniqueKey"); + Pattern uniqueKeyPattern = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE); + Matcher uniqueKeyMatcher = uniqueKeyPattern.matcher(originalSql); + String originalFieldName = ""; + if (uniqueKeyMatcher.find()) { + originalFieldName = uniqueKeyMatcher.group(1); + } + if (originalFieldName.isEmpty()) { + throw new RuntimeException("未找到唯一键字段名"); + } + return originalFieldName; + } + + public static String formatStringDate(String date) { + DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + try { + DateTimeFormatter inputFormatterWithSeconds = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + LocalDateTime dateTime = LocalDateTime.parse(date, inputFormatterWithSeconds); + return dateTime.format(outputFormatter); + } catch (Exception e) { + try { + DateTimeFormatter inputFormatterWithMinutes = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); + LocalDateTime dateTime = LocalDateTime.parse(date, inputFormatterWithMinutes); + return dateTime.withSecond(0).format(outputFormatter); + } catch (Exception ex) { + log.info("日期转换异常", ex); + } + } + return " 无时间数据 "; + } + + public static List parseSqlForModel2(String param) { + List result = new ArrayList<>(); + String date1 = param.substring(0, 8); + String date2 = param.substring(8, 16); + String formattedDate1 = date1.substring(0, 4) + "-" + date1.substring(4, 6) + "-" + date1.substring(6, 8); + String formattedDate2 = date2.substring(0, 4) + "-" + date2.substring(4, 6) + "-" + date2.substring(6, 8); + result.add(formattedDate1); + result.add(formattedDate2); + return result; + } + + private static String summarizeAttribute(Map data, String jqxz) { + try { + String substring = String.valueOf(data.get("jqxzdm")).substring(0, 2); + if (substring.equals("01")) { + jqxz = "刑事"; + } else if (substring.equals("02")) { + jqxz = "行政"; + } + } catch (Exception e) { + System.out.println("警情性质转换失败" + e); + } + return jqxz; + } +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java b/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java new file mode 100644 index 0000000..bdeee9a --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java @@ -0,0 +1,41 @@ +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.mapper.ModelClueTaskMapper; +import com.biutag.supervision.pojo.entity.ModelClueTask; +import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel; +import com.biutag.supervision.pojo.model.ModelClueTaskModel; +import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@RequiredArgsConstructor +@Service +public class ModelClueTaskService extends ServiceImpl { + + public Page page(ModelClueTaskQueryParam param) { + if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in(Objects.nonNull(param.getModelIds()), "mt.model_id", param.getModelIds()); + queryWrapper.like(StrUtil.isNotBlank(param.getTaskName()), "mt.task_name", param.getTaskName()); + if (Objects.nonNull(param.getDistributionTime()) && !param.getDistributionTime().isEmpty()) { + queryWrapper.between("mt.distribution_time", param.getDistributionTime().get(0), param.getDistributionTime().get(1)); + } + Page page = baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + return page; + } + + public List listDepart(Integer taskId) { + return baseMapper.selectGroupByDepart(taskId); + } + +} 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..884d0e0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ModelService.java @@ -0,0 +1,55 @@ +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.DistributionCycleEnum; +import com.biutag.supervision.constants.enums.DistributionMethodEnum; +import com.biutag.supervision.mapper.ModelMapper; +import com.biutag.supervision.pojo.entity.Model; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.util.ExpressionBuilder; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@Service +public class ModelService extends ServiceImpl { + + public List listByDistributionMethodOfNegative() { + return list(new LambdaQueryWrapper().eq(Model::getDistributionMethod, DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue())); + } + + public boolean saveModel(Model model) { + if (DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { + String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) : + ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek()); + model.setDistributionCycleExpression(expression); + } + model.setCreateTime(LocalDateTime.now()); + model.setUpdateTime(LocalDateTime.now()); + UserAuth user = UserContextHolder.getCurrentUser(); + model.setCreateDepartId(user.getDepartId()); + model.setCreateDepartName(user.getDepartName()); + boolean save = save(model); + return save; + } + + public boolean updateModel(Model model) { + if (DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { + String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) : + ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek()); + model.setDistributionCycleExpression(expression); + } + model.setUpdateTime(LocalDateTime.now()); + return updateById(model); + } + + public boolean remove(Integer modelId) { + return removeById(modelId); + } + +} 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..325504f --- /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..665ef40 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeFileService.java @@ -0,0 +1,37 @@ +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.entity.NegativeFile; +import com.biutag.supervision.mapper.NegativeFileMapper; +import com.biutag.supervision.pojo.vo.FileVo; +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)); + } + + public boolean saveBatch(List fileVos, String negativeId) { + if (fileVos.isEmpty()) { + return false; + } + List files = fileVos.stream().map(item -> { + NegativeFile file = new NegativeFile(); + BeanUtil.copyProperties(item, file); + file.setNegtiveId(negativeId); + return file; + }).toList(); + return saveBatch(files); + } + +} 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..d7fc4ab --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -0,0 +1,112 @@ +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.DepartLevelEnum; +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.DepartTree; +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; + + private final SupDepartService departService; + + 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()) + .in(!param.getCheckStatusList().isEmpty(), Negative::getCheckStatus, param.getCheckStatusList()) + .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 (param.getCrtTime().size() == 2) { + queryWrapper.between(Negative::getCrtTime, param.getCrtTime().get(0), param.getCrtTime().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"); + } + } + // 涉及单位 + if (StrUtil.isNotBlank(param.getInvolveDepartId())) { + List departIds = departService.getAllNodeIds(param.getInvolveDepartId()); + queryWrapper.in(Negative::getInvolveDepartId, departIds); + } + // 办理单位 + if (StrUtil.isNotBlank(param.getHandleDepartId())) { + List nodes = departService.getAllNode(List.of(param.getHandleDepartId())); + List secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); + if (!secondIds.isEmpty()) { + queryWrapper.in(Negative::getHandleSecondDepartId, secondIds); + } else { + queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); + } + } + 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..1cb1276 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -0,0 +1,308 @@ +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.query.LambdaQueryWrapper; +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 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); + if (StrUtil.isBlank(negativeDto.getOriginId())) { + 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); + negativeDto.setId(negative.getId()); + 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 saveByJwpy(List list) { + LocalDateTime now = LocalDateTime.now(); + list.forEach(item -> { + if (exists(item.getOriginId())) { + throw new RuntimeException("样本源头编号已存在请核实"); + } + SupDepart dept = departService.getByJwpyCode(item.getDepartCode()); + Negative negative = new Negative(); + BeanUtil.copyProperties(item, negative); + negative + .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) + .setProcessingStatus(ProcessingStatusEnum.signing.name()) + // 完成状态 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))); + + if (Objects.nonNull(dept)) { + negative.setInvolveDepartId(dept.getId()) + .setInvolveDepartName(dept.getShortName()) + .setFlowKey(FlowNodeEnum.THREE_SIGN.getKey()); + if (DepartLevelEnum.THREE.getValue().equals(dept.getLevel())) { + SupDepart parentDepart = departService.getById(dept.getPid()); + negative.setHandleThreeDepartId(dept.getId()) + .setHandleThreeDepartName(dept.getShortName()) + .setHandleSecondDepartId(parentDepart.getId()) + .setHandleSecondDepartName(parentDepart.getShortName()); + } + } + save(negative); + // 新增work + String departId; + String departName; + String roleCode; + if (Objects.nonNull(dept)) { + departId = dept.getId(); + departName = dept.getShortName(); + roleCode = RoleCodeEnum.THREE_ADMIN.getCode(); + } else { + log.error("未匹配上单位:{}, code: {}", item.getDepartName(), item.getDepartCode()); + departId = AppConstants.ROOT_DEPART_ID; + departName = AppConstants.ROOT_DEPART_NAME; + roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); + } + NegativeWork work = new NegativeWork() + .setNegativeId(negative.getId()) + .setDepartId(departId) + .setDepartName(departName) + .setRoleCode(roleCode) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setStatus(WorkStatusEnum.todo.name()) + .setUpdateTime(now) + .setCreateTime(now); + workService.save(work); + }); + return true; + } + + public boolean exists(String originId) { + return exists(new LambdaUpdateWrapper().eq(Negative::getOriginId, originId)); + } + + /** + * 生成样本源头编号 + * @param problemSourcesCode + * @return + */ + public String generateOriginId(String problemSourcesCode, String businessTypeCode) { + String originId = String.format("%s_%s_%s%s", StrUtil.isBlank(problemSourcesCode) ? "" : ProblemSourcesEnum.get(problemSourcesCode).name(), + StrUtil.isBlank(businessTypeCode) ? "" : BusinessTypeEnum.get(businessTypeCode).getKey(), + DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT), + RandomUtil.randomString(4)); + if (exists(originId)) { + return generateOriginId(problemSourcesCode, businessTypeCode); + } + return originId; + } + + @Transactional(rollbackFor = Exception.class) + public boolean remove(String id) { + removeById(id); + negativeHistoryService.removeById(id); + // 工作表 + workService.remove(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, id)); + // 收藏表 + favService.remove(new LambdaQueryWrapper().eq(NegativeFav::getNegativeId, id)); + // 事件详情描述表 + thingFileService.remove(new LambdaQueryWrapper().eq(NegativeThingFile::getNegativeId, id)); + // 涉及人员 + blameService.remove(id); + // 核查附件 + fileService.remove(new LambdaQueryWrapper().eq(NegativeFile::getNegtiveId, id)); + // 签收退回 + signReturnService.remove(new LambdaQueryWrapper().eq(NegativeSignReturn::getNegativeId, id)); + // 申请延期 + extensionApplyService.remove(new LambdaQueryWrapper().eq(NegativeExtensionApply::getNegativeId, id)); + // 审批 + approveService.remove(new LambdaQueryWrapper().eq(NegativeApprove::getNegativeId, id)); + return true; + } + +} \ 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/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java new file mode 100644 index 0000000..2755ca8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -0,0 +1,90 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +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.enums.NegativeTaskCategoryEnum; +import com.biutag.supervision.constants.enums.NegativeTaskStatusEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.mapper.NegativeTaskMapper; +import com.biutag.supervision.pojo.entity.NegativeTask; +import com.biutag.supervision.pojo.param.NegativeTaskQueryParam; +import com.biutag.supervision.pojo.vo.ExportNegativeVo; +import com.biutag.supervision.pojo.vo.NegativeQueryVo; +import com.biutag.supervision.util.JSON; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class NegativeTaskService extends ServiceImpl { + + private final FileService fileService; + + public Page page(NegativeTaskQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(NegativeTask::getCategory, NegativeTaskCategoryEnum.EXPORT.getValue()) + .like(StrUtil.isNotBlank(param.getTaskName()), NegativeTask::getTaskName, param.getTaskName()) + .orderByDesc(NegativeTask::getCrtTime); + if (param.getCrtTime().size() == 2) { + queryWrapper.between(NegativeTask::getCrtTime, param.getCrtTime().get(0), param.getCrtTime().get(1)); + } + return page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public NegativeTask save(Integer importRow) { + NegativeTask task = new NegativeTask(); + task.setId(IdUtil.simpleUUID()); + task.setTaskName(String.format("问题台账_%s", LocalDate.now())); + task.setImportRow(importRow); + task.setCrtTime(LocalDateTime.now()); + task.setStatus(NegativeTaskStatusEnum.PADDING.getValue()); + task.setCategory(NegativeTaskCategoryEnum.EXPORT.getValue()); + task.setCrtUser(UserContextHolder.getCurrentUser().getNickName()); + save(task); + return task; + } + + @Async + public boolean updateExcel(List data, String negativeTaskId) { + List list = data.stream().map(item -> { + ExportNegativeVo vo = new ExportNegativeVo(); + BeanUtils.copyProperties(item, vo); + if (StrUtil.isNotBlank(item.getInvolveProblem())) { + JsonNode jsonNode = JSON.readTree(item.getInvolveProblem()); + List arr = new ArrayList<>(); + jsonNode.forEach(problem -> { + String dictLabel = problem.get("dictLabel").asText(); + arr.add(dictLabel); + }); + vo.setInvolveProblem(arr.stream().collect(Collectors.joining("、"))); + } + vo.setProcessingStatus(ProcessingStatusEnum.getLabel(item.getProcessingStatus())); + return vo; + }).toList(); + ByteArrayOutputStream os = new ByteArrayOutputStream(); + EasyExcel.write(os, ExportNegativeVo.class).inMemory(Boolean.TRUE).sheet("问题台账").doWrite(list); + String filePath = fileService.upload(new ByteArrayInputStream(os.toByteArray()), os.size(), ".xlsx"); + return update(new LambdaUpdateWrapper().eq(NegativeTask::getId, negativeTaskId) + .set(NegativeTask::getStatus, NegativeTaskStatusEnum.SUCCESS.getValue()) + .set(NegativeTask::getFilePath, filePath) + .set(NegativeTask::getUpdTime, LocalDateTime.now())); + } + +} 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/RpcApplyPersonService.java b/src/main/java/com/biutag/supervision/service/RpcApplyPersonService.java new file mode 100644 index 0000000..4497f75 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RpcApplyPersonService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.RpcApplyPerson; +import com.biutag.supervision.mapper.RpcApplyPersonMapper; +import org.springframework.stereotype.Service; + +@Service +public class RpcApplyPersonService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyService.java b/src/main/java/com/biutag/supervision/service/RpcApplyService.java new file mode 100644 index 0000000..9507279 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RpcApplyService.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.mapper.RpcApplyMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@RequiredArgsConstructor +@Service +public class RpcApplyService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/RpcInfringerResultService.java b/src/main/java/com/biutag/supervision/service/RpcInfringerResultService.java new file mode 100644 index 0000000..5058903 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RpcInfringerResultService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.RpcInfringerResultMapper; +import com.biutag.supervision.pojo.entity.RpcInfringerResult; +import org.springframework.stereotype.Service; + +@Service +public class RpcInfringerResultService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/StatisticsDepartService.java b/src/main/java/com/biutag/supervision/service/StatisticsDepartService.java new file mode 100644 index 0000000..1911326 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/StatisticsDepartService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.StatisticsDepart; +import com.biutag.supervision.mapper.StatisticsDepartMapper; +import org.springframework.stereotype.Service; + +@Service +public class StatisticsDepartService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/StatisticsGroupService.java b/src/main/java/com/biutag/supervision/service/StatisticsGroupService.java new file mode 100644 index 0000000..5012593 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/StatisticsGroupService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.StatisticsGroup; +import com.biutag.supervision.mapper.StatisticsGroupMapper; +import org.springframework.stereotype.Service; + +@Service +public class StatisticsGroupService extends ServiceImpl { + +} 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..fc75311 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDepartService.java @@ -0,0 +1,273 @@ +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.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.constants.enums.StatusEnum; +import com.biutag.supervision.mapper.SupDepartMapper; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.DepartQueryParam; +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 Page page(DepartQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(param.getShortName()), SupDepart::getShortName, param.getShortName()) + .like(StrUtil.isNotBlank(param.getName()), SupDepart::getName, param.getName()) + .like(StrUtil.isNotBlank(param.getCode()), SupDepart::getCode, param.getCode()) + .ne(SupDepart::getId, AppConstants.ROOT_DEPART_ID) + .orderByAsc(SupDepart::getLevel) + .orderByAsc(SupDepart::getOrderNo); + return page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public List listByEnabled() { + return list(new LambdaQueryWrapper() + .notIn(SupDepart::getLevel, List.of(4, 5)) + .eq(SupDepart::getStatus, StatusEnum.ENABLE.getValue()) + .orderByAsc(SupDepart::getOrderNo)); + } + + public List listAllByEnabled() { + return list(new LambdaQueryWrapper() + .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 getAllNodeIds(String departId) { + return getAllNodeIds(List.of(departId)); + } + + public List getAllNodeIds(List departIds) { + return getAllNode(departIds).stream().map(DepartTree::getId).toList(); + } + + public List getAllNode(List departIds) { + List treeList = buildTreeAll(); + List nodes = new ArrayList<>(); + getAllNodeRecursive(departIds, treeList, nodes); + return nodes; + } + + private void getAllNodeRecursive(List departIds, List treeList, List nodes) { + treeList.forEach(item -> { + if (departIds.contains(item.getId())) { + getAllNodeRecursive(item, nodes); + } else { + getAllNodeRecursive(departIds, item.getChildren(), nodes); + } + }); + } + + private void getAllNodeRecursive(DepartTree tree, List nodes) { + nodes.add(tree); + tree.getChildren().forEach(item -> { + getAllNodeRecursive(item, nodes); + }); + } + + 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 buildTreeAll() { + // 所有有效的数据 + List departs = listAllByEnabled(); + return buildTreeAll(departs); + } + + public List buildTreeAll(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); + if (AppConstants.ROOT_DEPART_ID.equals(node.getId())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + /** + * 市局主办 + * @return + */ + public List buildTreeByFirstHost() { + List departs = listByEnabled(); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + if (node.getFirstHost()) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + /** + * 根据角色权限 + * @return + */ + public List buildTreeByAuth() { + // 所有有效的数据 + List departs = listByEnabled(); + return buildTreeByAuth(departs); + } + + /** + * 根据角色权限 + * @param departs + * @return + */ + public List buildTreeByAuth(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + UserAuth user = UserContextHolder.getCurrentUser(); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty())) { + return tree; + } + // 市局权限 + boolean firstAuth = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) || user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); + List authDepartIds = new ArrayList<>(); + if (!firstAuth) { + List authDeparts = departs.stream().filter(item -> user.getAuthDepartIds().contains(item.getId())).toList(); + Integer maxLevel = authDeparts.stream().map(SupDepart::getLevel).max(Integer::compareTo).get(); + authDepartIds = authDeparts.stream().filter(item -> maxLevel.equals(item.getLevel())).map(SupDepart::getId).toList(); + } + 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); + if (firstAuth && AppConstants.ROOT_DEPART_ID.equals(node.getId())) { + tree.add(node); + } else if (authDepartIds.contains(node.getId())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + public List buildTreeBySecond(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + if (AppConstants.ROOT_DEPART_ID.equals(node.getPid())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + public List buildTreeByParam(DepartTreeListParam departTreeListParam) { + 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(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.ROOT_DEPART_ID.equals(pid) || pid.equals(departTreeListParam.getPid())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + /** + * 递归构建 + * @param node + * @param childMap + * @return + */ + 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..634ea9d --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictContentService.java @@ -0,0 +1,51 @@ +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.SupDictProblemType; +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(SupDictProblemType::getSort)); + } + + public List buildTree() { + List dictContents = list(); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDictProblemType 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/SupDictProblemSourceService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java new file mode 100644 index 0000000..a42b981 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java @@ -0,0 +1,50 @@ +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.SupDictProblemSourceMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemSource; +import com.biutag.supervision.pojo.vo.DictProblemSourceTree; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class SupDictProblemSourceService extends ServiceImpl { + + public List buildTree() { + List dictProblemSources = list(new LambdaQueryWrapper().orderByAsc(SupDictProblemSource::getSort)); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDictProblemSource dictProblemSource : dictProblemSources) { + DictProblemSourceTree node = new DictProblemSourceTree(); + BeanUtils.copyProperties(dictProblemSource, node); + List children = childMap.computeIfAbsent(node.getParentId(), k -> new ArrayList<>()); + children.add(node); + Integer parentId = node.getParentId(); + if (AppConstants.DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE.equals(parentId)) { + tree.add(node); + } + } + for (DictProblemSourceTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + private static DictProblemSourceTree buildTreeRecursive(DictProblemSourceTree 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/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/SupExternalDepartService.java b/src/main/java/com/biutag/supervision/service/SupExternalDepartService.java new file mode 100644 index 0000000..0f21d39 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupExternalDepartService.java @@ -0,0 +1,141 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.entity.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@Service +public class SupExternalDepartService extends ServiceImpl { + + private final SupExternalDepartMapper supExternalDepartMapper; + + private final GBaseAJJBXXMapper gBaseAJJBXXMapper; + + private final SupDepartMapper supDepartMapper; + + private final GBaseJJDMapper gBaseJJDMapper; + + private final GBaseCJDMapper gBaseCJDMapper; + + public final ModelClueDataMapper modelClueDataMapper; + + public void insertPreData() { + List supExternalDeparts = new ArrayList<>(); + Set dms = new HashSet<>(); + selectAJJBXX(1, supExternalDeparts, dms); + selectAJJBXX(2, supExternalDeparts, dms); + selectAJJBXX(3, supExternalDeparts, dms); + selectJJDandCJD(dms, supExternalDeparts); + selectWFQYZFRYB(dms, supExternalDeparts); + List supDeparts = supDepartMapper.selectList(new LambdaQueryWrapper().in(SupDepart::getCode, dms)); + for (SupExternalDepart supExternalDepart : supExternalDeparts) { + SupDepart supDepart = supDeparts.stream().filter(item -> item.getCode().equals(supExternalDepart.getExternalId())).findFirst().orElse(null); + if (supDepart != null) { + supExternalDepart.setInternalId(supDepart.getId()); + supExternalDepart.setInternalName(supDepart.getName()); + supExternalDepart.setInternalShortName(supDepart.getShortName()); + supExternalDepart.setLevel(supDepart.getLevel()); + supExternalDepart.setPid(supDepart.getPid()); + } + supExternalDepart.setStatus(0); + supExternalDepart.setCreateTime(LocalDateTime.now()); + } + supExternalDepartMapper.insert(supExternalDeparts); + } + + private void selectJJDandCJD(Set dms, List supExternalDeparts) { + List gBaseJJDS = gBaseJJDMapper.selectList(new QueryWrapper().select("DISTINCT gxdwdm, gxdwmc").ge("bjsj", "2022-10-01")); + if (!gBaseJJDS.isEmpty()) { + gBaseJJDS.forEach(item -> { + if (item != null && item.getGxdwdm() != null && !item.getGxdwdm().isEmpty() && !dms.contains(item.getGxdwdm())) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + supExternalDepart.setExternalId(item.getGxdwdm()); + supExternalDepart.setExternalName(item.getGxdwmc() == null ? "" : item.getGxdwmc()); + dms.add(item.getGxdwdm()); + supExternalDepart.setSource("情指行"); + supExternalDeparts.add(supExternalDepart); + } + }); + } + List gBaseCJDS = gBaseCJDMapper.selectList(new QueryWrapper().select("DISTINCT cjdxssdwdm, cjdxssdwmc").ge("cjsj", "2022-10-01")); + if (!gBaseCJDS.isEmpty()) { + gBaseCJDS.forEach(item -> { + if (item != null && item.getCjdxssdwdm() != null && !item.getCjdxssdwdm().isEmpty() && !dms.contains(item.getCjdxssdwdm())) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + supExternalDepart.setExternalId(item.getCjdxssdwdm()); + supExternalDepart.setExternalName(item.getCjdxssdwmc() == null ? "" : item.getCjdxssdwmc()); + dms.add(item.getCjdxssdwdm()); + supExternalDepart.setSource("情指行"); + supExternalDeparts.add(supExternalDepart); + } + }); + } + } + + private void selectWFQYZFRYB(Set dms, List supExternalDeparts) { + List> jjdmaps = modelClueDataMapper.selectByUniqueKeys("SELECT DISTINCT csid, csmc FROM dwd_ry_zfba_zfqywfryb WHERE STR_TO_DATE(djsj, '%Y%m%d%H%i%s') > '2022-10-01';"); + if (!jjdmaps.isEmpty()) { + jjdmaps.forEach(item -> { + if (item != null && item.get("csid") != null && !Objects.equals(item.get("csid"), "") && !dms.contains((String)item.get("csid"))) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + supExternalDepart.setExternalId((String)item.get("csid")); + supExternalDepart.setExternalName(item.get("csmc") == null ? "" : (String)item.get("csmc")); + dms.add((String)item.get("csid")); + supExternalDepart.setSource("执法办案"); + supExternalDeparts.add(supExternalDepart); + } + }); + } + } + + @DS("slave2") + private void selectAJJBXX(int type, List result, Set dms) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (type == 1) { + queryWrapper.select("DISTINCT LADWBMdm, LADWBMmc").ge("BARQ", "2022-10-01"); + } else if (type == 2) { + queryWrapper.select("DISTINCT PADWBMdm, PADWBMmc").ge("BARQ", "2022-10-01"); + } else if (type == 3) { + queryWrapper.select("DISTINCT BADWIDdm, BADWIDmc").ge("BARQ", "2022-10-01"); + } else { + return; + } + List supExternalDeparts = gBaseAJJBXXMapper.selectList(queryWrapper); + if (!supExternalDeparts.isEmpty()) { + supExternalDeparts.forEach(item -> { + if (item != null && item.getLADWBMdm() != null && !item.getLADWBMdm().isEmpty()) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + if (type == 1) { + supExternalDepart.setExternalId(item.getLADWBMdm()); + supExternalDepart.setExternalName(item.getLADWBMmc() == null ? "" : item.getLADWBMmc()); + } else if (type == 2 && !dms.contains(item.getPADWBMdm())) { + supExternalDepart.setExternalId(item.getPADWBMdm() == null ? "" : item.getPADWBMdm()); + supExternalDepart.setExternalName(item.getPADWBMmc() == null ? "" : item.getPADWBMmc()); + dms.add(item.getPADWBMdm()); + } else if (type == 3 && !dms.contains(item.getBADWIDdm())) { + supExternalDepart.setExternalId(item.getBADWIDdm() == null ? "" : item.getBADWIDdm()); + supExternalDepart.setExternalName(item.getBADWIDmc() == null ? "" : item.getBADWIDmc()); + dms.add(item.getBADWIDdm()); + } + supExternalDepart.setSource("执法办案"); + result.add(supExternalDepart); + } + }); + } + if (dms.isEmpty() && type == 1) { + dms.addAll(result.stream().map(SupExternalDepart::getExternalId).collect(Collectors.toSet())); + } + } +} 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..7c7d7e7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -0,0 +1,87 @@ +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.getAllNodeIds(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.getAllNodeIds(param.getDepartId()); + queryWrapper.in("p.org_id", orgIds); + } else { + queryWrapper.eq("p.org_id", param.getDepartId()); + } + } + queryWrapper.apply(StrUtil.isNotBlank(param.getRoleId()), String.format("find_in_set( '%s', u.role_id) > 0", param.getRoleId())); + queryWrapper.orderByAsc("d.level").orderByDesc("p.position").orderByAsc("p.person_status"); + 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.getAllNodeIds(List.of(departId)); + return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds).orderByDesc(SupPolice::getPosition)); + } + + public List listLeaderByDepartId(String departId) { + List departIds = departService.getAllNodeIds(List.of(departId)); + return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds).isNotNull(SupPolice::getPhone)); + } + + public Boolean exists(String departId) { + List orgIds = departService.getAllNodeIds(departId); + if (orgIds.isEmpty()) { + return false; + } + return exists(new LambdaQueryWrapper().in(SupPolice::getOrgId, orgIds)); + } + + public Boolean ge(String empNo) { + return exists(new LambdaQueryWrapper().in(SupPolice::getEmpNo, empNo)); + } + + public Boolean existsByIdCode(String idCode) { + return exists(new LambdaQueryWrapper().in(SupPolice::getIdCode, idCode)); + } + +} 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/support/ModelClueDistributionAware.java b/src/main/java/com/biutag/supervision/support/ModelClueDistributionAware.java new file mode 100644 index 0000000..854487c --- /dev/null +++ b/src/main/java/com/biutag/supervision/support/ModelClueDistributionAware.java @@ -0,0 +1,78 @@ +package com.biutag.supervision.support; + +import cn.hutool.core.util.StrUtil; +import com.biutag.supervision.pojo.entity.Model; +import com.biutag.supervision.service.ModelClueService; +import com.biutag.supervision.service.ModelService; +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.config.CronTask; +import org.springframework.scheduling.config.ScheduledTask; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 模型线索数据分发 + * @author wxc + * @date 2024/10/17 + */ +@Slf4j +@RequiredArgsConstructor +@Component +public class ModelClueDistributionAware { + + private final ScheduledTaskRegistrar taskRegistrar; + private final Map taskMap = new ConcurrentHashMap<>(); + + private final ModelService modelService; + + private final ModelClueService modelClueService; + + @PostConstruct + public void init() { + log.info("初始化模型分发任务-------------------------------------------"); + List models = modelService.listByDistributionMethodOfNegative(); + for (Model model : models) { + try { + put(model); + } catch (RuntimeException e) { + log.info("模型分发异常", e); + } + } + } + + public void put(Model model) { + log.info("新增模型【{}】分发任务", model.getModelName()); + String expression = model.getDistributionCycleExpression(); + if (StrUtil.isBlank(expression)) { + throw new RuntimeException("分发周期配置[expression]为空"); + } + if (taskMap.containsKey(model.getId())) { + remove(model.getId()); + } + Runnable task = () -> { + log.info("开始执行任务-------------------------------------------"); + // 线索下发 + modelClueService.distribution(model.getId()); + }; + log.info("expression : {}", expression); + ScheduledTask scheduledTask = taskRegistrar.scheduleTriggerTask(new CronTask(task, expression)); + taskMap.put(model.getId(), scheduledTask); + } + + public void remove(Integer key) { + log.info("移除模型【{}】分发任务", key); + ScheduledTask scheduledTask = taskMap.get(key); + if (Objects.nonNull(scheduledTask)) { + scheduledTask.cancel(); + taskMap.remove(key); + } + + } +} diff --git a/src/main/java/com/biutag/supervision/support/ModelEditAspect.java b/src/main/java/com/biutag/supervision/support/ModelEditAspect.java new file mode 100644 index 0000000..69e270c --- /dev/null +++ b/src/main/java/com/biutag/supervision/support/ModelEditAspect.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.support; + +import com.biutag.supervision.constants.enums.DistributionMethodEnum; +import com.biutag.supervision.pojo.entity.Model; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.*; +import org.springframework.stereotype.Component; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Slf4j +@RequiredArgsConstructor +@Aspect +@Component +public class ModelEditAspect { + + private final ModelClueDistributionAware modelClueDistributionAware; + + @Pointcut("execution(* com.biutag.supervision.service.ModelService.saveModel(..))") + public void saveMethod() {} + + @Pointcut("execution(* com.biutag.supervision.service.ModelService.updateModel(..))") + public void updateMethod() {} + + @Pointcut("execution(* com.biutag.supervision.service.ModelService.remove(Integer))") + public void removeMethod() {} + + @After("saveMethod() || updateMethod()") + public void afterSaveOrUpdateAdvice(JoinPoint joinPoint) { + Model model = (Model) joinPoint.getArgs()[0]; + if (!DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { + return; + } + modelClueDistributionAware.put(model); + log.info("afterSaveOrUpdateAdvice---------------"); + } + + @After("removeMethod()") + public void afterRemove(JoinPoint joinPoint) { + Integer modelId = (Integer) joinPoint.getArgs()[0]; + modelClueDistributionAware.remove(modelId); + log.info("afterRemove---------------"); + } + +} 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/ExpressionBuilder.java b/src/main/java/com/biutag/supervision/util/ExpressionBuilder.java new file mode 100644 index 0000000..4519ba7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/ExpressionBuilder.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.util; + +import java.util.Optional; + +/** + * @author wxc + * @date 2024/10/17 + */ +public class ExpressionBuilder { + + public static String build(String time) { + return build(time, null); + } + + public static String build(String time, String week) { + String expressionFormat = "%s %s %s * * %s"; + String[] split = time.split(":"); + String weekArg = Optional.ofNullable(week).orElse("*"); + return String.format(expressionFormat, Integer.parseInt(split[2]), Integer.parseInt(split[1]), Integer.parseInt(split[0]), weekArg); + } + +} 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..d08a03f --- /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, extensionDurationDays); + } +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..dc5065e --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,65 @@ +spring: + datasource: + dynamic: + datasource: + master: + type: com.alibaba.druid.pool.DruidDataSource + 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: + type: com.alibaba.druid.pool.DruidDataSource + 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 + slave2: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + druid: + min-evictable-idle-time-millis: 300000 + test-on-borrow: false + test-on-return: false + initial-size: 10 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + test-while-idle: true + validation-query: select 1 + time-between-eviction-runs-millis: 60000 + max-pool-prepared-statement-per-connection-size: 20 + max-active: 100 + # druid监控全局配置 + druid: + stat-view-servlet: + enabled: true + url-pattern: /druid/* + data: + redis: + host: 172.31.217.20 + # 端口,默认为6379 + port: 31707 + # 数据库索引 + database: 1 + # 连接超时时间 + timeout: 10s + +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +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-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..506acbc --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,36 @@ +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 + +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +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..619c861 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,57 @@ +spring: + datasource: + dynamic: + datasource: + master: + type: com.alibaba.druid.pool.DruidDataSource + 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: + type: com.alibaba.druid.pool.DruidDataSource + 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 + slave2: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.gbase.jdbc.Driver + url: jdbc:gbase://65.47.16.209:5258/csga_dwd + username: csga_wdpc + password: csga_wdpc@123 + druid: + min-evictable-idle-time-millis: 300000 + test-on-borrow: false + test-on-return: false + initial-size: 10 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + test-while-idle: true + validation-query: select 1 + time-between-eviction-runs-millis: 60000 + max-pool-prepared-statement-per-connection-size: 20 + max-active: 100 + + # druid监控全局配置 + druid: + stat-view-servlet: + enabled: true + url-pattern: /druid/* + wall: + multi-statement-allow: true + 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..64d18db --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,45 @@ +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 + +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 diff --git a/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar b/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar new file mode 100644 index 0000000..778cd39 Binary files /dev/null and b/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar differ diff --git a/src/main/resources/mapper/BusinessDepartMapper.xml b/src/main/resources/mapper/BusinessDepartMapper.xml new file mode 100644 index 0000000..888686c --- /dev/null +++ b/src/main/resources/mapper/BusinessDepartMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/BusinessPoliceMapper.xml b/src/main/resources/mapper/BusinessPoliceMapper.xml new file mode 100644 index 0000000..b6d9836 --- /dev/null +++ b/src/main/resources/mapper/BusinessPoliceMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/GBaseCJDMapper.xml b/src/main/resources/mapper/GBaseCJDMapper.xml new file mode 100644 index 0000000..279c474 --- /dev/null +++ b/src/main/resources/mapper/GBaseCJDMapper.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/GBaseJJDMapper.xml b/src/main/resources/mapper/GBaseJJDMapper.xml new file mode 100644 index 0000000..45d98a1 --- /dev/null +++ b/src/main/resources/mapper/GBaseJJDMapper.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ModelClueMapper.xml b/src/main/resources/mapper/ModelClueMapper.xml new file mode 100644 index 0000000..b1fa0fd --- /dev/null +++ b/src/main/resources/mapper/ModelClueMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ModelClueTaskMapper.xml b/src/main/resources/mapper/ModelClueTaskMapper.xml new file mode 100644 index 0000000..a6a4817 --- /dev/null +++ b/src/main/resources/mapper/ModelClueTaskMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + + \ 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..99e667f --- /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/ProfileDepartMapper.xml b/src/main/resources/mapper/ProfileDepartMapper.xml new file mode 100644 index 0000000..de021f6 --- /dev/null +++ b/src/main/resources/mapper/ProfileDepartMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + \ 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..c2f3e43 --- /dev/null +++ b/src/main/resources/mapper/SupPoliceMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + \ 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/main/resources/static/templates/信访投诉数据台账(模板).xlsx b/src/main/resources/static/templates/信访投诉数据台账(模板).xlsx new file mode 100644 index 0000000..56008b1 Binary files /dev/null and b/src/main/resources/static/templates/信访投诉数据台账(模板).xlsx differ diff --git a/src/main/resources/static/templates/数字督察警员权限导入模板.xlsx b/src/main/resources/static/templates/数字督察警员权限导入模板.xlsx new file mode 100644 index 0000000..fadc15d Binary files /dev/null and b/src/main/resources/static/templates/数字督察警员权限导入模板.xlsx differ diff --git a/src/main/resources/static/templates/案件核查问题台账(模板).xlsx b/src/main/resources/static/templates/案件核查问题台账(模板).xlsx new file mode 100644 index 0000000..ea83085 Binary files /dev/null and b/src/main/resources/static/templates/案件核查问题台账(模板).xlsx differ diff --git a/src/main/resources/static/templates/长沙公安数字督察灵敏感知体系问题赋分及风险预警机制.pdf b/src/main/resources/static/templates/长沙公安数字督察灵敏感知体系问题赋分及风险预警机制.pdf new file mode 100644 index 0000000..9e3379e Binary files /dev/null and b/src/main/resources/static/templates/长沙公安数字督察灵敏感知体系问题赋分及风险预警机制.pdf 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..9435bfc --- /dev/null +++ b/src/test/java/com/biutag/supervision/StrUtil.java @@ -0,0 +1,22 @@ +package com.biutag.supervision; + +import cn.hutool.core.io.FileTypeUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.resource.ResourceUtil; +import com.biutag.supervision.util.JSON; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; + +import java.net.URL; +import java.util.List; + +public class StrUtil { + + @Test + public void testSubstr() { + + String type = FileUtil.extName("1.xls"); + System.out.println(type); + } +} 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..e056ff1 --- /dev/null +++ b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java @@ -0,0 +1,40 @@ +package com.biutag.supervision; + +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.scheduling.TaskScheduler; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; +import org.springframework.scheduling.support.CronTrigger; + +import java.time.LocalDateTime; + +@SpringBootTest +class SupervisionApplicationTests { + + @Autowired + private FastFileStorageClient fastFileStorageClient; + + @Autowired + private ScheduledTaskRegistrar taskRegistrar; + + @Autowired + private TaskScheduler taskScheduler; + + @Test + void contextLoads() { + ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); + scheduler.setPoolSize(5); + scheduler.setThreadNamePrefix("scheduled-task-"); + scheduler.initialize(); + Runnable runnable = () -> { + System.out.println("Executing task at " + LocalDateTime.now()); + }; + taskRegistrar.setTaskScheduler(scheduler); + taskRegistrar.addTriggerTask(runnable, new CronTrigger("0 2 * * * ?")); + + } + +} 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..dd001a2 --- /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 = "rpc_infringer_result"; + 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}> { + +}