From 05770f7e5691b079a3da914298c755d51ccd3ce1 Mon Sep 17 00:00:00 2001 From: Lxq <19852720163@163.com> Date: Thu, 30 Apr 2026 15:16:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E4=BD=9C=E5=8F=82=E6=95=B0=E5=8F=96?= =?UTF-8?q?=E5=80=BC=E8=8C=83=E5=9B=B4+=E8=A7=92=E8=89=B2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rc_autoplc_backend/.idea/.gitignore | 8 - rc_autoplc_backend/.idea/compiler.xml | 26 - rc_autoplc_backend/.idea/encodings.xml | 10 - rc_autoplc_backend/.idea/jarRepositories.xml | 40 - rc_autoplc_backend/.idea/uiDesigner.xml | 124 - rc_autoplc_backend/.idea/workspace.xml | 54 + rc_autoplc_backend/LICENSE | 14 +- rc_autoplc_backend/README.md | 5 - rc_autoplc_backend/mvnw.cmd | 2 +- rc_autoplc_backend/pom.xml | 33 +- rc_autoplc_backend/rczn-admin/pom.xml | 17 +- .../java/com/rczn/RcznAdminApplication.java | 2 - .../main/java/com/rczn/config/CorsConfig.java | 25 - .../java/com/rczn/config/Knife4jConfig.java | 38 - .../main/java/com/rczn/config/WebConfig.java | 55 - .../rczn}/controller/ManageLogController.java | 15 +- .../com/rczn/controller/RoleController.java | 9 +- .../controller/RolePermissionController.java | 65 - .../rczn/controller/SysDicDataController.java | 109 - .../rczn/controller/SysDicTypeController.java | 95 - .../controller/SysPermissionController.java | 128 - .../com/rczn/controller/UserController.java | 119 - .../com/rczn/system}/domain/ManageLog.java | 4 +- .../com/rczn/system/domain/Permission.java | 35 +- .../com/rczn/system/domain/SysDicData.java | 52 - .../com/rczn/system/domain/SysDicType.java | 41 - .../domain/query/RolePermissionQuery.java | 34 - .../rczn/system}/mapper/ManageLogMapper.java | 5 +- .../system/mapper/RolePermissionMapper.java | 18 - .../rczn/system/mapper/SysDicDataMapper.java | 39 - .../rczn/system/mapper/SysDicTypeMapper.java | 34 - .../system/mapper/SysPermissionMapper.java | 52 - .../com/rczn/system/mapper/UserMapper.java | 9 - .../system}/service/ManageLogService.java | 4 +- .../system/service/RolePermissionService.java | 15 - .../system/service/SysDicDataService.java | 44 - .../system/service/SysDicTypeService.java | 40 - .../system/service/SysPermissionService.java | 26 - .../rczn/system/service/UserRoleService.java | 7 - .../com/rczn/system/service/UserService.java | 22 - .../service/impl/ManageLogServiceImpl.java | 11 +- .../impl/RolePermissionServiceImpl.java | 42 - .../service/impl/SysDicDataServiceImpl.java | 97 - .../service/impl/SysDicTypeServiceImpl.java | 84 - .../impl/SysPermissionServiceImpl.java | 140 - .../service/impl/UserRoleServiceImpl.java | 1 - .../system/service/impl/UserServiceImpl.java | 38 - .../src/main/resources/application.yml | 75 +- .../resources}/mapper/ManageLogMapper.xml | 8 +- .../resources/mapper/RolePermissionMapper.xml | 45 - .../resources/mapper/SysDicDataMapper.xml | 74 - .../resources/mapper/SysDicTypeMapper.xml | 62 - .../resources/mapper/SysPermissionMapper.xml | 72 - .../src/main/resources/mapper/UserMapper.xml | 19 - .../com/rczn/RcznAdminApplicationTests.java | 13 - rc_autoplc_backend/rczn-autoplc/pom.xml | 26 +- .../cache/IsLandActionParamToPlc.java | 28 - .../rczn/rcznautoplc/cache/PlcRunStatus.java | 110 - .../rcznautoplc/cache/RegisterAddrDic.java | 17 - .../controller/DevInfoController.java | 47 +- .../controller/DevParamController.java | 47 +- .../controller/FlowInfoController.java | 46 +- .../controller/GoodsFlowStatusController.java | 30 +- .../controller/GoodsInfoController.java | 54 +- .../rcznautoplc/controller/PlcController.java | 337 -- .../controller/StepInfoController.java | 65 +- .../controller/WebSocketController.java | 23 - .../com/rczn/rcznautoplc/domain/DevInfo.java | 23 - .../com/rczn/rcznautoplc/domain/DevParam.java | 36 +- .../rcznautoplc/domain/GoodsFlowStatus.java | 13 - .../rczn/rcznautoplc/domain/GoodsInfo.java | 62 +- .../rczn/rcznautoplc/domain/IslandInfo.java | 15 +- .../rczn/rcznautoplc/domain/IslandParam.java | 5 - .../rcznautoplc/domain/ModbusConnectObj.java | 85 - .../rcznautoplc/domain/PlcConnectObj.java | 84 - .../com/rczn/rcznautoplc/domain/StepInfo.java | 13 - .../com/rczn/rcznautoplc/domain/UserBusy.java | 111 - .../domain/query/DevInfoQuery.java | 122 - .../domain/query/DevParamQuery.java | 87 - .../domain/query/GoodsFlowStatusQuery.java | 75 - .../domain/query/GoodsInfoQuery.java | 125 - .../domain/query/IslandInfoQuery.java | 60 - .../domain/query/IslandParamQuery.java | 84 - .../domain/query/StepInfoQuery.java | 118 - .../rcznautoplc/mapper/DevInfoMapper.java | 3 - .../rcznautoplc/mapper/DevParamMapper.java | 7 +- .../mapper/GoodsFlowStatusMapper.java | 3 +- .../rcznautoplc/mapper/GoodsInfoMapper.java | 11 +- .../rcznautoplc/mapper/IslandInfoMapper.java | 6 - .../rcznautoplc/mapper/StepInfoMapper.java | 10 +- .../rcznautoplc/service/DevInfoService.java | 10 - .../rcznautoplc/service/DevParamService.java | 15 +- .../service/GoodsFlowStatusService.java | 6 +- .../rcznautoplc/service/GoodsInfoService.java | 21 +- .../service/IslandInfoService.java | 11 - .../rczn/rcznautoplc/service/PlcService.java | 125 - .../rcznautoplc/service/StepInfoService.java | 22 +- .../service/impl/DevInfoServiceImpl.java | 37 - .../service/impl/DevParamServiceImpl.java | 39 +- .../service/impl/FlowInfoServiceImpl.java | 6 +- .../impl/GoodsFlowStatusServiceImpl.java | 17 +- .../service/impl/GoodsInfoServiceImpl.java | 64 +- .../service/impl/IslandInfoServiceImpl.java | 11 - .../service/impl/PlcServiceImpl.java | 499 --- .../service/impl/StepInfoServiceImpl.java | 45 +- .../com/rczn/rcznautoplc/task/PlcTask.java | 159 - .../utils/PlcCommonProtcolUtil.java | 282 -- .../rczn/rcznautoplc/utils/PlcConnectMap.java | 24 - .../rczn/rcznautoplc/mapper/DevInfoMapper.xml | 64 +- .../rcznautoplc/mapper/DevParamMapper.xml | 102 +- .../mapper/GoodsFlowStatusMapper.xml | 6 +- .../rcznautoplc/mapper/GoodsInfoMapper.xml | 40 +- .../rcznautoplc/mapper/IslandInfoMapper.xml | 20 +- .../rcznautoplc/mapper/StepInfoMapper.xml | 217 +- .../RcznAutoplcApplicationTests.java | 13 - rc_autoplc_backend/rczn-common/pom.xml | 85 +- .../main/java/com/rczn/ModbusCmdConst.java | 23 - .../rczn/config/AsyncThreadPoolConfig.java | 40 - .../java/com/rczn/config/WebSocketConfig.java | 14 - .../main/java/com/rczn/domain/BaseBean.java | 3 - .../com/rczn/exception/GlobalException.java | 16 - .../rczn/interceptors/LoginInterceptor.java | 18 +- .../java/com/rczn/modbus/Modbus4jUtils.java | 380 --- .../com/rczn/modbus/Modbus4jWriteUtils.java | 247 -- .../src/main/java/com/rczn/plc/PLCData.java | 56 - .../main/java/com/rczn/plc/S7PlcClient.java | 102 - .../main/java/com/rczn/plc/S7PlcCommun.java | 131 - .../com/rczn/plc_common/S7ConnectorPLC.java | 220 -- .../src/main/java/com/rczn/task/TestCrc.java | 22 - .../src/main/java/com/rczn/task/TestTask.java | 17 - .../src/main/java/com/rczn/task/Video.java | 46 - .../java/com/rczn/utils/BeanFactoryUtils.java | 22 - .../src/main/java/com/rczn/utils/JwtUtil.java | 7 - .../com/rczn/websocket/WebSocketServer.java | 75 - .../src/main/resources/application-common.yml | 11 - .../RcznCommonApplicationTests.java | 13 - rc_autoplc_front/.env | 1 + rc_autoplc_front/index.html | 4 +- rc_autoplc_front/package-lock.json | 1898 +++++------ rc_autoplc_front/package.json | 5 + rc_autoplc_front/public/Laboratory.ico | Bin 0 -> 11119 bytes rc_autoplc_front/src/api/system/dicdata.ts | 53 + rc_autoplc_front/src/api/system/dictype.ts | 46 + rc_autoplc_front/src/api/system/permission.ts | 47 + .../src/api/system/role-permission.ts | 38 + rc_autoplc_front/src/api/system/user.ts | 22 + rc_autoplc_front/src/api/tb/devparam.ts | 24 + rc_autoplc_front/src/api/tb/flowinfo.ts | 39 + .../src/api/tb/goodsflowstatus.ts | 47 + rc_autoplc_front/src/api/tb/goodsinfo.ts | 39 + .../src/api/tb/plcdevicecontrol.ts | 121 + rc_autoplc_front/src/api/tb/stepinfo.ts | 63 + rc_autoplc_front/src/assets/image/plc.jpg | Bin 0 -> 306226 bytes rc_autoplc_front/src/router/index.ts | 97 +- rc_autoplc_front/src/router/permission.ts | 38 - rc_autoplc_front/src/utils/request.ts | 89 +- rc_autoplc_front/src/views/Home.vue | 56 + rc_autoplc_front/src/views/Layout.vue | 138 +- rc_autoplc_front/src/views/Login.vue | 317 ++ .../src/views/department/index.vue | 5 + rc_autoplc_front/src/views/devinfo/index.vue | 1098 ++++--- rc_autoplc_front/src/views/devinfo/plc.vue | 210 +- rc_autoplc_front/src/views/devparam/index.vue | 1576 +++++++++ rc_autoplc_front/src/views/flowinfo/index.vue | 1091 +++++++ rc_autoplc_front/src/views/goods/index.vue | 1056 ++++++ .../src/views/islandInfo/index.vue | 539 +--- .../src/views/manage-log/index.vue | 480 ++- .../src/views/permission/index.vue | 504 +++ .../src/views/plcdevicecontrol/index.vue | 1127 +++++++ rc_autoplc_front/src/views/position/index.vue | 5 + rc_autoplc_front/src/views/role/index.vue | 222 +- .../src/views/sampleinjection/index.vue | 1886 +++++++++++ rc_autoplc_front/src/views/stepinfo/index.vue | 2817 +++++++++++++++++ .../src/views/user-role/index.vue | 5 + rc_autoplc_front/src/views/user/index.vue | 293 +- rc_autoplc_front/tsconfig.app.json | 1 - rc_autoplc_front/vite.config.ts | 33 +- 177 files changed, 13913 insertions(+), 9863 deletions(-) delete mode 100644 rc_autoplc_backend/.idea/.gitignore delete mode 100644 rc_autoplc_backend/.idea/compiler.xml delete mode 100644 rc_autoplc_backend/.idea/encodings.xml delete mode 100644 rc_autoplc_backend/.idea/jarRepositories.xml delete mode 100644 rc_autoplc_backend/.idea/uiDesigner.xml create mode 100644 rc_autoplc_backend/.idea/workspace.xml delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/Knife4jConfig.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/WebConfig.java rename rc_autoplc_backend/{rczn-autoplc/src/main/java/com/rczn/rcznautoplc => rczn-admin/src/main/java/com/rczn}/controller/ManageLogController.java (91%) delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RolePermissionController.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicDataController.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicTypeController.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysPermissionController.java rename rc_autoplc_backend/{rczn-autoplc/src/main/java/com/rczn/rcznautoplc => rczn-admin/src/main/java/com/rczn/system}/domain/ManageLog.java (97%) delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicData.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicType.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/query/RolePermissionQuery.java rename rc_autoplc_backend/{rczn-autoplc/src/main/java/com/rczn/rcznautoplc => rczn-admin/src/main/java/com/rczn/system}/mapper/ManageLogMapper.java (90%) delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/RolePermissionMapper.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicDataMapper.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicTypeMapper.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysPermissionMapper.java rename rc_autoplc_backend/{rczn-autoplc/src/main/java/com/rczn/rcznautoplc => rczn-admin/src/main/java/com/rczn/system}/service/ManageLogService.java (85%) delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/RolePermissionService.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicDataService.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicTypeService.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysPermissionService.java rename rc_autoplc_backend/{rczn-autoplc/src/main/java/com/rczn/rcznautoplc => rczn-admin/src/main/java/com/rczn/system}/service/impl/ManageLogServiceImpl.java (93%) delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/RolePermissionServiceImpl.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicDataServiceImpl.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicTypeServiceImpl.java delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysPermissionServiceImpl.java rename rc_autoplc_backend/{rczn-autoplc/src/main/resources/com/rczn/rcznautoplc => rczn-admin/src/main/resources}/mapper/ManageLogMapper.xml (96%) delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/resources/mapper/RolePermissionMapper.xml delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicDataMapper.xml delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicTypeMapper.xml delete mode 100644 rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysPermissionMapper.xml delete mode 100644 rc_autoplc_backend/rczn-admin/src/test/java/com/rczn/RcznAdminApplicationTests.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/cache/IsLandActionParamToPlc.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/cache/PlcRunStatus.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/cache/RegisterAddrDic.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/controller/PlcController.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/controller/WebSocketController.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/ModbusConnectObj.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/PlcConnectObj.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/UserBusy.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/DevInfoQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/DevParamQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/GoodsFlowStatusQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/GoodsInfoQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/IslandInfoQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/IslandParamQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/query/StepInfoQuery.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/PlcService.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/impl/PlcServiceImpl.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/task/PlcTask.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/utils/PlcCommonProtcolUtil.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/utils/PlcConnectMap.java delete mode 100644 rc_autoplc_backend/rczn-autoplc/src/test/java/com/rczn/rcznautoplc/RcznAutoplcApplicationTests.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/ModbusCmdConst.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/config/AsyncThreadPoolConfig.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/config/WebSocketConfig.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/exception/GlobalException.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/modbus/Modbus4jUtils.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/modbus/Modbus4jWriteUtils.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/plc/PLCData.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/plc/S7PlcClient.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/plc/S7PlcCommun.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/plc_common/S7ConnectorPLC.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/task/TestCrc.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/task/TestTask.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/task/Video.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/utils/BeanFactoryUtils.java delete mode 100644 rc_autoplc_backend/rczn-common/src/main/java/com/rczn/websocket/WebSocketServer.java delete mode 100644 rc_autoplc_backend/rczn-common/src/test/java/com/rczn/rczncommon/RcznCommonApplicationTests.java create mode 100644 rc_autoplc_front/.env create mode 100644 rc_autoplc_front/public/Laboratory.ico create mode 100644 rc_autoplc_front/src/api/system/dicdata.ts create mode 100644 rc_autoplc_front/src/api/system/dictype.ts create mode 100644 rc_autoplc_front/src/api/system/permission.ts create mode 100644 rc_autoplc_front/src/api/system/role-permission.ts create mode 100644 rc_autoplc_front/src/api/tb/flowinfo.ts create mode 100644 rc_autoplc_front/src/api/tb/goodsflowstatus.ts create mode 100644 rc_autoplc_front/src/api/tb/goodsinfo.ts create mode 100644 rc_autoplc_front/src/api/tb/plcdevicecontrol.ts create mode 100644 rc_autoplc_front/src/api/tb/stepinfo.ts create mode 100644 rc_autoplc_front/src/assets/image/plc.jpg delete mode 100644 rc_autoplc_front/src/router/permission.ts create mode 100644 rc_autoplc_front/src/views/Home.vue create mode 100644 rc_autoplc_front/src/views/Login.vue create mode 100644 rc_autoplc_front/src/views/devparam/index.vue create mode 100644 rc_autoplc_front/src/views/flowinfo/index.vue create mode 100644 rc_autoplc_front/src/views/goods/index.vue create mode 100644 rc_autoplc_front/src/views/permission/index.vue create mode 100644 rc_autoplc_front/src/views/plcdevicecontrol/index.vue create mode 100644 rc_autoplc_front/src/views/sampleinjection/index.vue create mode 100644 rc_autoplc_front/src/views/stepinfo/index.vue diff --git a/rc_autoplc_backend/.idea/.gitignore b/rc_autoplc_backend/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/rc_autoplc_backend/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/rc_autoplc_backend/.idea/compiler.xml b/rc_autoplc_backend/.idea/compiler.xml deleted file mode 100644 index c858a1e..0000000 --- a/rc_autoplc_backend/.idea/compiler.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/.idea/encodings.xml b/rc_autoplc_backend/.idea/encodings.xml deleted file mode 100644 index e768916..0000000 --- a/rc_autoplc_backend/.idea/encodings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/.idea/jarRepositories.xml b/rc_autoplc_backend/.idea/jarRepositories.xml deleted file mode 100644 index 082f15f..0000000 --- a/rc_autoplc_backend/.idea/jarRepositories.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/.idea/uiDesigner.xml b/rc_autoplc_backend/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/rc_autoplc_backend/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/.idea/workspace.xml b/rc_autoplc_backend/.idea/workspace.xml new file mode 100644 index 0000000..42d1131 --- /dev/null +++ b/rc_autoplc_backend/.idea/workspace.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + 1767767108230 + + + + + + \ No newline at end of file diff --git a/rc_autoplc_backend/LICENSE b/rc_autoplc_backend/LICENSE index e5cbdd7..0ad25db 100644 --- a/rc_autoplc_backend/LICENSE +++ b/rc_autoplc_backend/LICENSE @@ -85,16 +85,16 @@ distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a userBusy through +parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive userBusy interface displays "Appropriate Legal Notices" + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) -tells the userBusy that there is no warranty for the work (except to the +tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If -the interface presents a list of userBusy commands or options, such as a +the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. @@ -215,7 +215,7 @@ terms of section 4, provided that you also meet all of these conditions: permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - d) If the work has interactive userBusy interfaces, each must display + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. @@ -287,9 +287,9 @@ tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular userBusy, "normally used" refers to a +product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status -of the particular userBusy or of the way in which the particular userBusy +of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent diff --git a/rc_autoplc_backend/README.md b/rc_autoplc_backend/README.md index 252cc97..69c3344 100644 --- a/rc_autoplc_backend/README.md +++ b/rc_autoplc_backend/README.md @@ -35,8 +35,3 @@ 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) - -#### 增加日志生成: -1. 2026-4-3:用户登录日志信息 -2. 2026-4-3:SOP用户操作日志信息 -3. 2026-4-3:基础数据(功能岛、SOP序列)用户操作(增-删-改)日志 \ No newline at end of file diff --git a/rc_autoplc_backend/mvnw.cmd b/rc_autoplc_backend/mvnw.cmd index 1acdbea..92450f9 100644 --- a/rc_autoplc_backend/mvnw.cmd +++ b/rc_autoplc_backend/mvnw.cmd @@ -23,7 +23,7 @@ @REM @REM Optional ENV vars @REM MVNW_REPOURL - repo url base for downloading maven distribution -@REM MVNW_USERNAME/MVNW_PASSWORD - userBusy and password for downloading maven +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven @REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @REM ---------------------------------------------------------------------------- diff --git a/rc_autoplc_backend/pom.xml b/rc_autoplc_backend/pom.xml index ff6d1b4..8b57d86 100644 --- a/rc_autoplc_backend/pom.xml +++ b/rc_autoplc_backend/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.12 + 3.4.12 @@ -30,7 +30,6 @@ 4.4.0 4.5.0 6.0.0 - 1.18.30 @@ -76,34 +75,6 @@ ${jakarta.servlet-api.version} provided - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - 2.15.4 - - - org.apache.commons - commons-lang3 - 3.14.0 - - - jakarta.validation - jakarta.validation-api - 3.0.2 - - - - com.github.s7connector - s7connector - 2.1 - - - - org.apache.commons - commons-pool2 - 2.12.0 - @@ -113,7 +84,6 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 ${java.version} ${java.version} @@ -122,7 +92,6 @@ org.projectlombok lombok - ${lombok.version} diff --git a/rc_autoplc_backend/rczn-admin/pom.xml b/rc_autoplc_backend/rczn-admin/pom.xml index cef4882..9df1e64 100644 --- a/rc_autoplc_backend/rczn-admin/pom.xml +++ b/rc_autoplc_backend/rczn-admin/pom.xml @@ -67,12 +67,6 @@ runtime - - - - - - org.projectlombok @@ -85,7 +79,10 @@ com.auth0 java-jwt - + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + com.github.pagehelper pagehelper-spring-boot-starter @@ -95,12 +92,6 @@ jackson-datatype-jsr310 - - - - - - org.springframework.boot diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/RcznAdminApplication.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/RcznAdminApplication.java index 088abe0..dfc48d0 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/RcznAdminApplication.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/RcznAdminApplication.java @@ -3,11 +3,9 @@ package com.rczn; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; -import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication @ComponentScan(value = "com.rczn.*") -@EnableScheduling public class RcznAdminApplication { public static void main(String[] args) { diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/CorsConfig.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/CorsConfig.java index 89628bc..7050a0b 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/CorsConfig.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/CorsConfig.java @@ -1,10 +1,6 @@ package com.rczn.config; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.filter.CorsFilter; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -21,25 +17,4 @@ public class CorsConfig implements WebMvcConfigurer { .allowCredentials(true) // 允许携带Cookie .maxAge(3600); // 预检请求缓存1小时 } - - @Bean - public CorsFilter corsFilter() { - CorsConfiguration config = new CorsConfiguration(); - // 1. 允许前端源(不要用*,和withCredentials=true配合需指定具体源,或用allowedOriginPatterns) - config.addAllowedOriginPattern("*"); - // 2. 允许携带凭证(和前端withCredentials=true对应) - config.setAllowCredentials(true); - // 3. 允许所有请求方法(包含OPTIONS) - config.addAllowedMethod("*"); - // 4. 允许所有请求头(包含Authorization) - config.addAllowedHeader("*"); - // 5. 预检请求缓存时间(减少OPTIONS请求次数) - config.setMaxAge(3600L); - - // 配置生效路径 - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/**", config); - - return new CorsFilter(source); - } } \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/Knife4jConfig.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/Knife4jConfig.java deleted file mode 100644 index 052ebcc..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/Knife4jConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.rczn.config; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.security.SecurityRequirement; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class Knife4jConfig { - - @Bean - public OpenAPI customOpenAPI() { - // 1. 声明JWT认证规则 - String securitySchemeName = "Authorization"; - return new OpenAPI() - // 2. 文档基础信息(可选) - .info(new Info() - .title("XX自动化编程系统API") - .version("1.0.0") - .description("集成JWT认证的Knife4j接口文档")) - // 3. 配置全局认证规则(所有接口默认需要Token) - .addSecurityItem(new SecurityRequirement().addList(securitySchemeName)) - // 4. 定义Token的传递方式(请求头+Bearer格式) - .components(new Components() - .addSecuritySchemes(securitySchemeName, - new SecurityScheme() - .name(securitySchemeName) - .type(SecurityScheme.Type.HTTP) // HTTP认证 - .scheme("bearer") // Bearer格式 - .bearerFormat("JWT") // Token类型为JWT - .in(SecurityScheme.In.HEADER) // 放在请求头 - ) - ); - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/WebConfig.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/WebConfig.java deleted file mode 100644 index 076da1a..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/config/WebConfig.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.rczn.config; - -import com.rczn.interceptors.LoginInterceptor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -// 必须启用@Configuration,让Spring扫描到 -@Configuration -public class WebConfig implements WebMvcConfigurer { - - // 必须注入拦截器(取消注释) - @Autowired - LoginInterceptor loginInterceptor; - - // 注册拦截器 - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(loginInterceptor) - // 拦截所有请求 - .addPathPatterns("/**") - // 放行Swagger/Knife4j所有相关路径(关键补充/doc.html) - .excludePathPatterns( - // Knife4j自定义UI路径(核心!) - "/doc.html", - // Swagger UI页面相关 - "/swagger-ui/**", - "/webjars/**", - // SpringDoc接口文档数据相关 - "/v3/api-docs/**", - "/v3/api-docs.yaml", - // 旧版Swagger兼容 - "/swagger-resources/**", - "/swagger-ui.html" - ) - // 放行登录/注册接口 - .excludePathPatterns("/user/login", "/user/register"); - } - - // 静态资源映射(适配Knife4j+SpringDoc) - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - // Knife4j静态资源(核心补充) - registry.addResourceHandler("/doc.html") - .addResourceLocations("classpath:/META-INF/resources/"); - // Swagger UI静态资源 - registry.addResourceHandler("/swagger-ui/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/springdoc-openapi-ui/"); - // Webjars通用资源 - registry.addResourceHandler("/webjars/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/"); - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/controller/ManageLogController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/ManageLogController.java similarity index 91% rename from rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/controller/ManageLogController.java rename to rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/ManageLogController.java index 06238d6..80fbccf 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/controller/ManageLogController.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/ManageLogController.java @@ -1,16 +1,15 @@ -package com.rczn.rcznautoplc.controller; +package com.rczn.controller; import com.rczn.domain.PageBean; import com.rczn.domain.Result; -import com.rczn.rcznautoplc.domain.ManageLog; -import com.rczn.rcznautoplc.service.ManageLogService; +import com.rczn.system.domain.ManageLog; +import com.rczn.system.service.ManageLogService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.format.annotation.DateTimeFormat; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; @@ -44,12 +43,8 @@ public class ManageLogController { @RequestParam(required = false) String logName, @RequestParam(required = false) String logType, @RequestParam(required = false) Long createId, - @RequestParam(required = false) - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - LocalDateTime logWritetimeStart, - @RequestParam(required = false) - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - LocalDateTime logWritetimeEnd) { + @RequestParam(required = false) LocalDateTime logWritetimeStart, + @RequestParam(required = false) LocalDateTime logWritetimeEnd) { // 构建查询条件(空字段自动忽略) ManageLog query = new ManageLog(); diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RoleController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RoleController.java index 21873ca..014c66d 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RoleController.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RoleController.java @@ -9,7 +9,6 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -22,8 +21,12 @@ import java.util.List; @Tag(name = "角色管理", description = "角色增删改查接口(支持分页+多条件查询+编码唯一性校验)") public class RoleController { - @Autowired - RoleService roleService; + private final RoleService roleService; + + // 构造器注入 + public RoleController(RoleService roleService) { + this.roleService = roleService; + } /** * 1. 分页查询角色(多条件模糊查询) diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RolePermissionController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RolePermissionController.java deleted file mode 100644 index 3930764..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/RolePermissionController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.rczn.controller; - -import com.rczn.domain.Result; -import com.rczn.system.domain.RolePermission; -import com.rczn.system.domain.query.RolePermissionQuery; -import com.rczn.system.service.RolePermissionService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/rolePermission") -@Tag(name = "角色权限管理", description = "角色权限关联接口") -public class RolePermissionController { - - @Autowired - RolePermissionService rolePermissionService; - - @GetMapping("/listByRoleId/{roleId}") - @Operation(summary = "根据角色ID查询权限ID列表") - public Result getListByRoleId( - @Parameter(name = "roleId", required = true) @PathVariable Integer roleId) { - List list = rolePermissionService.selectListByRoleId(roleId); - return Result.success(list); - } - - @PostMapping("/add") - @Operation(summary = "给角色添加权限") - public Result add(@RequestBody RolePermissionQuery rolePermission) { - if (rolePermission.getRoleId() == null || rolePermission.getPermissionId() == null) { - return Result.error("角色ID和权限ID不能为空"); - } - try { - RolePermission rolePermissionEntity = new RolePermission(); - rolePermissionEntity.setRoleId(rolePermission.getRoleId()); - rolePermissionEntity.setPermissionId(rolePermission.getPermissionId()); - rolePermissionService.insert(rolePermissionEntity); - return Result.success("添加成功"); - } catch (Exception e) { - return Result.error(e.getMessage()); - } - } - - @DeleteMapping("/del") - @Operation(summary = "删除角色权限关联") - public Result delete( - @RequestParam Integer roleId, - @RequestParam(required = false) Integer permissionId) { - boolean success = rolePermissionService.delete(roleId, permissionId); - return success ? Result.success("删除成功") : Result.error("删除失败"); - } - - @DeleteMapping("/clearByRoleId/{roleId}") - @Operation(summary = "清空某个角色的所有权限") - public Result clearByRoleId( - @Parameter(name = "roleId", required = true) @PathVariable Integer roleId) { - rolePermissionService.deleteByRoleId(roleId); - return Result.success("清空成功"); - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicDataController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicDataController.java deleted file mode 100644 index da28134..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicDataController.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.rczn.controller; - -import com.github.pagehelper.PageInfo; -import com.rczn.domain.Result; -import com.rczn.system.domain.SysDicData; -import com.rczn.system.service.SysDicDataService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; -import java.util.List; - -@RestController -@RequestMapping("/sysDicData") -@Tag(name = "字典数据管理", description = "字典数据增删改查+分页查询+按类型查询接口") -public class SysDicDataController { - - @Autowired - private SysDicDataService sysDicDataService; - - @GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "分页查询字典数据", description = "支持字典类型ID、标签、值查询") - @Parameters({ - @Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY), - @Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY), - @Parameter(name = "dicId", description = "字典类型ID(可选)", required = false, example = "1", in = ParameterIn.QUERY), - @Parameter(name = "dicLabel", description = "数据标签(可选,模糊查询)", required = false, example = "运行", in = ParameterIn.QUERY), - @Parameter(name = "dicValue", description = "数据值(可选,模糊查询)", required = false, example = "1", in = ParameterIn.QUERY) - }) - public Result getDicDataPage( - @RequestParam Integer pageNum, - @RequestParam Integer pageSize, - @RequestParam(required = false) Integer dicId, - @RequestParam(required = false) String dicLabel, - @RequestParam(required = false) String dicValue) { - PageInfo pageBean = sysDicDataService.selectPage(pageNum, pageSize, dicId, dicLabel, dicValue); - return Result.success(pageBean); - } - - @GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "查询字典数据", description = "支持字典类型ID、标签、值查询") - @Parameters({ - @Parameter(name = "dicId", description = "字典类型ID(可选)", required = false, example = "1", in = ParameterIn.QUERY), - @Parameter(name = "dicLabel", description = "数据标签(可选,模糊查询)", required = false, example = "运行", in = ParameterIn.QUERY), - @Parameter(name = "dicValue", description = "数据值(可选,模糊查询)", required = false, example = "1", in = ParameterIn.QUERY) - }) - public Result getList( - @RequestParam(required = false) Integer dicId, - @RequestParam(required = false) String dicLabel, - @RequestParam(required = false) String dicValue) { - List list = sysDicDataService.selectList( dicId, dicLabel, dicValue); - return Result.success(list); - } - - @GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "查询单个字典数据", description = "根据字典数据ID查询详情") - public Result getDicDataById(@PathVariable Long id) { - SysDicData sysDicData = sysDicDataService.selectById(id); - return sysDicData != null ? Result.success(sysDicData) : Result.error("字典数据不存在"); - } - - @GetMapping(value = "/listByDicId/{dicId}", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "按字典类型ID查询数据列表", description = "查询指定字典类型下的所有有效数据") - public Result getDicDataByDicId(@PathVariable Integer dicId) { - try { - List list = sysDicDataService.selectByDicId(dicId); - return Result.success(list); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } - - @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "新增字典数据", description = "字典类型ID、数据标签为必填项") - public Result addDicData(@RequestBody SysDicData sysDicData) { - try { - Long dicDataId = sysDicDataService.insert(sysDicData); - return Result.success(dicDataId); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } - - @PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "修改字典数据", description = "需传入字典数据ID,其他字段可选(非空则更新)") - public Result updateDicData(@RequestBody SysDicData sysDicData) { - try { - Boolean success = sysDicDataService.update(sysDicData); - return success ? Result.success(true) : Result.error("修改失败(字典数据不存在或已删除)"); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } - - @DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "删除字典数据", description = "逻辑删除(设置delSign=1,不物理删除数据)") - public Result deleteDicData(@PathVariable Long id) { - try { - Boolean success = sysDicDataService.deleteById(id); - return success ? Result.success(true) : Result.error("删除失败(字典数据不存在或已删除)"); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicTypeController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicTypeController.java deleted file mode 100644 index 36a814b..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysDicTypeController.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.rczn.controller; - -import com.github.pagehelper.PageInfo; -import com.rczn.domain.Result; -import com.rczn.system.domain.SysDicType; -import com.rczn.system.service.SysDicTypeService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/sysDicType") -@Tag(name = "字典类型管理", description = "字典类型增删改查+分页查询接口") -public class SysDicTypeController { - - @Autowired - private SysDicTypeService sysDicTypeService; - - @GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "分页查询字典类型", description = "支持字典名称、编码模糊查询") - @Parameters({ - @Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY), - @Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY), - @Parameter(name = "dicName", description = "字典名称(可选,模糊查询)", required = false, example = "设备状态", in = ParameterIn.QUERY), - @Parameter(name = "dicCode", description = "字典编码(可选,模糊查询)", required = false, example = "DEV_STATUS", in = ParameterIn.QUERY) - }) - public Result getDicTypePage( - @RequestParam Integer pageNum, - @RequestParam Integer pageSize, - @RequestParam(required = false) String dicName, - @RequestParam(required = false) String dicCode) { - PageInfo pageBean = sysDicTypeService.selectPage(pageNum, pageSize, dicName, dicCode); - return Result.success(pageBean); - } - - @GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "查询字典类型列表", description = "支持字典名称、编码模糊查询") - @Parameters({ - @Parameter(name = "dicName", description = "字典名称(可选,模糊查询)", required = false, example = "设备状态", in = ParameterIn.QUERY), - @Parameter(name = "dicCode", description = "字典编码(可选,模糊查询)", required = false, example = "DEV_STATUS", in = ParameterIn.QUERY) - }) - public Result getList( - @RequestParam(required = false) String dicName, - @RequestParam(required = false) String dicCode) { - List list = sysDicTypeService.selectList( dicName, dicCode); - return Result.success(list); - } - - @GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "查询单个字典类型", description = "根据字典类型ID查询详情") - public Result getDicTypeById(@PathVariable Long id) { - SysDicType sysDicType = sysDicTypeService.selectById(id); - return sysDicType != null ? Result.success(sysDicType) : Result.error("字典类型不存在"); - } - - @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "新增字典类型", description = "字典名称为必填项") - public Result addDicType(@RequestBody SysDicType sysDicType) { - try { - Long dicTypeId = sysDicTypeService.insert(sysDicType); - return Result.success(dicTypeId); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } - - @PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "修改字典类型", description = "需传入字典类型ID,其他字段可选(非空则更新)") - public Result updateDicType(@RequestBody SysDicType sysDicType) { - try { - Boolean success = sysDicTypeService.update(sysDicType); - return success ? Result.success(true) : Result.error("修改失败(字典类型不存在或已删除)"); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } - - @DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE) - @Operation(summary = "删除字典类型", description = "逻辑删除(设置delSign=1,不物理删除数据)") - public Result deleteDicType(@PathVariable Long id) { - try { - Boolean success = sysDicTypeService.deleteById(id); - return success ? Result.success(true) : Result.error("删除失败(字典类型不存在或已删除)"); - } catch (IllegalArgumentException e) { - return Result.error(e.getMessage()); - } - } -} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysPermissionController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysPermissionController.java deleted file mode 100644 index 4f7f2bb..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/SysPermissionController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.rczn.controller; - -import com.rczn.domain.PageBean; -import com.rczn.domain.Result; -import com.rczn.system.domain.Permission; -import com.rczn.system.domain.Role; -import com.rczn.system.service.SysPermissionService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 权限管理 API(MyBatis 树形结构实现) - */ -@RestController -@RequestMapping("/permission") -@Tag(name = "权限管理", description = "权限增删改查接口(树形结构)") -public class SysPermissionController { - - @Autowired - private SysPermissionService sysPermissionService; - - /** - * 1. 分页查询权限(多条件模糊查询) - */ - @GetMapping("/listPage") - @Operation(summary = "分页查询权限", description = "支持角色名、角色编码模糊查询,页码从1开始") - @Parameters({ - @Parameter(name = "pageNum", description = "页码(必填,从1开始)", required = true, example = "1", in = ParameterIn.QUERY), - @Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY), - @Parameter(name = "parentId", description = "父级ID(可选)", required = false, example = "0", in = ParameterIn.QUERY), - @Parameter(name = "permissionName", description = "权限名称(模糊查询,可选)", required = false, example = "用户添加", in = ParameterIn.QUERY) - }) - public Result> getRolePage( - @RequestParam Integer pageNum, - @RequestParam Integer pageSize, - @RequestParam(required = false) Integer parentId, - @RequestParam(required = false) String permissionName) { - - PageBean pageBean = sysPermissionService.selectRolePage(pageNum, pageSize, parentId,permissionName); - return Result.success(pageBean); - } - - /** - * 1. 查询权限树形结构列表 - */ - @GetMapping("/list") - @Operation(summary = "查询权限树形列表", description = "返回权限树形结构(parentId为0或null为顶级)") - public Result> getPermissionList() { - List treeList = sysPermissionService.getPermissionList(); - return Result.success(treeList); - } - - /** - * 1. 查询权限树形结构列表 - */ -// @GetMapping("/listByParentId/{parentId}") -// @Operation(summary = "查询权限树形列表", description = "返回权限树形结构(parentId为0或null为顶级)") -// public Result> getPermissionListByParentId(@PathVariable Integer parentId) { -// List treeList = sysPermissionService.getPermissionListByParentId(parentId); -// return Result.success(treeList); -// } - - /** - * 2. 根据ID查询单个权限 - */ - @GetMapping("/getById/{id}") - @Operation(summary = "查询单个权限", description = "根据权限ID查询详情") - public Result getPermissionById( - @Parameter(name = "id", description = "权限ID", required = true, example = "1", in = ParameterIn.PATH) - @PathVariable Integer id) { - - Permission permission = sysPermissionService.getPermissionById(id); - if (permission == null) { - return Result.error("权限ID:" + id + " 不存在"); - } - return Result.success(permission); - } - - /** - * 3. 新增权限 - */ - @PostMapping("/add") - @Operation(summary = "新增权限", description = "提交权限信息创建新权限") - public Result addPermission( - @Parameter(name = "permission", description = "权限信息", required = true) - @RequestBody Permission permission) { - - boolean success = sysPermissionService.addPermission(permission); - return success ? Result.success("新增权限成功") : Result.error("新增失败"); - } - - /** - * 4. 修改权限 - */ - @PutMapping("/update") - @Operation(summary = "修改权限", description = "传入权限ID和需要修改的字段") - public Result updatePermission( - @Parameter(name = "permission", description = "权限信息(必须包含ID)", required = true) - @RequestBody Permission permission) { - - try { - boolean success = sysPermissionService.updatePermission(permission); - return success ? Result.success("修改权限成功") : Result.error("修改失败(权限不存在)"); - } catch (Exception e) { - return Result.error(e.getMessage()); - } - } - - /** - * 5. 根据ID删除权限(逻辑删除) - */ - @DeleteMapping("/del/{id}") - @Operation(summary = "删除权限", description = "根据权限ID逻辑删除") - public Result deletePermission( - @Parameter(name = "id", description = "权限ID", required = true, example = "1", in = ParameterIn.PATH) - @PathVariable Integer id) { - - boolean success = sysPermissionService.deletePermission(id); - return success ? Result.success("删除权限成功") : Result.error("删除失败(权限不存在)"); - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/UserController.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/UserController.java index 126a663..b2a6972 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/UserController.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/controller/UserController.java @@ -1,33 +1,18 @@ package com.rczn.controller; -import com.fasterxml.jackson.databind.annotation.JsonAppend; import com.rczn.domain.PageBean; import com.rczn.domain.Result; -import com.rczn.rcznautoplc.domain.ManageLog; -import com.rczn.rcznautoplc.domain.RecordInfo; -import com.rczn.rcznautoplc.service.ManageLogService; -import com.rczn.rcznautoplc.service.RecordInfoService; -import com.rczn.system.domain.Permission; import com.rczn.system.domain.User; import com.rczn.system.service.UserService; -import com.rczn.utils.JwtUtil; -import com.rczn.utils.Md5Util; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.constraints.Pattern; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; /** * 用户管理 CRUD API(MyBatis+PageHelper 实现) @@ -132,108 +117,4 @@ public class UserController { Boolean success = userService.deleteById(id); return success ? Result.success("删除用户成功") : Result.error("删除失败(用户不存在)"); } - - - @PostMapping("/register") - @Operation(summary = "注册", description = "用户名必须是2-16位的字母、数字、下划线或减号") - public Result register(@Pattern(regexp = "^[a-zA-Z0-9_-]{2,16}$", message = "用户名必须是2-16位的字母、数字、下划线或减号") - @Parameter( - name = "username", - description = "用户名" - ) - @RequestParam - String username, - @Parameter( - name = "password", - description = "密码..." - ) - @RequestParam - String password) { - //查询数据库是否有该用户 - User user = userService.findeUserByUsername(username); - //注册 - if (user == null) { - //如果用户不存在,则注册 - int result = userService.register(username, password); - return Result.success("用户注册成功"); - } else { - //用户存在,返回错误信息 - return Result.error("该用户名已存在!"); - } - } - - @GetMapping("/getUserByUsername") - public Result getUserByUsername(String username) { - User user = userService.findeUserByUsername(username); - if (user == null) { - return Result.error("该用户不存在!"); - } else { - return Result.success(user); - } - } - - @Autowired - ManageLogService manageLogService; - - @PostMapping("/login") - @Operation(summary = "用户登录接口",description = "根据用户名和密码登录,返回JWT Token") - public Result login( - @Parameter( - name = "username", - description = "登录用户名(2-16位的字母、数字、下划线或减号)", - required = true, // 标记为必填参数 - example = "string" - ) - @RequestParam - String username, - @Parameter( - name = "password", - description = "登录密码", - required = true - ) - @RequestParam - String password) { - - //TODO 登录逻辑 - //查询数据库是否有该用户 - User user = userService.findeUserByUsername(username); - //登录 - if (user == null) { - //如果用户不存在,返回错误信息 - return Result.error("该用户不存在!"); - } else { - //校验密码: - String encryptPassword = user.getPassword(); - if (encryptPassword.equals(password)) { - //登录成功,增加登录日志: - LocalDateTime loginTime = LocalDateTime.now(); - ManageLog info = new ManageLog(); - info.setCreateId(user.getId()); - info.setLogName("登录日志"); - info.setLogType("登录日志");//1:登录日志、2:SOP操作日志、3:基础数据操作日志 - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("用户名:").append(user.getUserName()).append(",登录操作时间:").append(loginTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); - info.setLogContent(stringBuilder.toString()); - info.setCreateTime(loginTime); - manageLogService.insert(info); - -// if (Md5Util.checkPassword(password, encryptPassword)) { - //生产token - Map claims = new HashMap<>(); - claims.put("id", user.getId()); - claims.put("username", user.getUserName()); - //获取权限列表: - List permissions = userService.findUserPermissions(user.getId()); - List permissionList = permissions.stream().map(Permission::getPermissionCode).collect(Collectors.toList()); - claims.put("permissions", permissionList); - String jwtToken = JwtUtil.genToken(claims); - //密码正确,返回成功信息 - return Result.success(jwtToken); - } else { - //密码错误,返回错误信息 - return Result.error("密码错误!"); - } - } - } - } \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/ManageLog.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/ManageLog.java similarity index 97% rename from rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/ManageLog.java rename to rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/ManageLog.java index 4b5462e..8cceedc 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/domain/ManageLog.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/ManageLog.java @@ -1,8 +1,8 @@ -package com.rczn.rcznautoplc.domain; - +package com.rczn.system.domain; import com.rczn.domain.BaseBean; + import java.time.LocalDateTime; public class ManageLog extends BaseBean { diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/Permission.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/Permission.java index dfc2554..0ca598f 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/Permission.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/Permission.java @@ -1,31 +1,16 @@ package com.rczn.system.domain; import com.rczn.domain.BaseBean; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; -import java.util.List; - -public class Permission extends BaseBean{ - - private Integer parentId; +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class Permission extends BaseBean { private String permissionName; - private String permissionCode; - // 树形结构子节点 ✅ - private List children; - - // getter & setter - public Integer getParentId() { return parentId; } - public void setParentId(Integer parentId) { this.parentId = parentId; } - public String getPermissionName() { return permissionName; } - public void setPermissionName(String permissionName) { this.permissionName = permissionName; } - public String getPermissionCode() { return permissionCode; } - public void setPermissionCode(String permissionCode) { this.permissionCode = permissionCode; } - - // children - public List getChildren() { - return children; - } - public void setChildren(List children) { - this.children = children; - } -} + private String permissionCode;} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicData.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicData.java deleted file mode 100644 index a64751c..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicData.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.rczn.system.domain; - -import com.rczn.domain.BaseBean; -import java.time.LocalDateTime; - -/** - * 字典数据实体类 - * 对应表:sys_dic_data - */ -public class SysDicData extends BaseBean { - - // 字典类型id(外键) - private Integer dicId; - - // 数据标签 - private String dicLabel; - - // 数据字典值 - private String dicValue; - - public SysDicData() { - } - - public SysDicData(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) { - super(id, createId, createTime, updateId, updateTime, delSign, remark); - } - - // getter/setter - public Integer getDicId() { - return dicId; - } - - public void setDicId(Integer dicId) { - this.dicId = dicId; - } - - public String getDicLabel() { - return dicLabel; - } - - public void setDicLabel(String dicLabel) { - this.dicLabel = dicLabel; - } - - public String getDicValue() { - return dicValue; - } - - public void setDicValue(String dicValue) { - this.dicValue = dicValue; - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicType.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicType.java deleted file mode 100644 index 827bdce..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/SysDicType.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.rczn.system.domain; - -import com.rczn.domain.BaseBean; -import java.time.LocalDateTime; - -/** - * 字典类型实体类 - * 对应表:sys_dic_type - */ -public class SysDicType extends BaseBean { - - // 字典名称(必填) - private String dicName; - - // 字典编码 - private String dicCode; - - public SysDicType() { - } - - public SysDicType(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) { - super(id, createId, createTime, updateId, updateTime, delSign, remark); - } - - // getter/setter - public String getDicName() { - return dicName; - } - - public void setDicName(String dicName) { - this.dicName = dicName; - } - - public String getDicCode() { - return dicCode; - } - - public void setDicCode(String dicCode) { - this.dicCode = dicCode; - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/query/RolePermissionQuery.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/query/RolePermissionQuery.java deleted file mode 100644 index f17fa3a..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/domain/query/RolePermissionQuery.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.rczn.system.domain.query; - -public class RolePermissionQuery { - - //角色id - private Integer roleId; - - //权限id - private Integer permissionId; - - public RolePermissionQuery(Integer roleId, Integer permissionId) { - this.roleId = roleId; - this.permissionId = permissionId; - } - - public RolePermissionQuery() { - } - - public Integer getRoleId() { - return roleId; - } - - public void setRoleId(Integer roleId) { - this.roleId = roleId; - } - - public Integer getPermissionId() { - return permissionId; - } - - public void setPermissionId(Integer permissionId) { - this.permissionId = permissionId; - } -} diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/mapper/ManageLogMapper.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/ManageLogMapper.java similarity index 90% rename from rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/mapper/ManageLogMapper.java rename to rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/ManageLogMapper.java index 1300631..399f858 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/mapper/ManageLogMapper.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/ManageLogMapper.java @@ -1,8 +1,7 @@ -package com.rczn.rcznautoplc.mapper; +package com.rczn.system.mapper; -import com.rczn.rcznautoplc.domain.ManageLog; +import com.rczn.system.domain.ManageLog; import org.apache.ibatis.annotations.Mapper; - import java.util.List; @Mapper // 标记为 MyBatis Mapper 接口,确保被 Spring 扫描 diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/RolePermissionMapper.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/RolePermissionMapper.java deleted file mode 100644 index 93f27f9..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/RolePermissionMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.rczn.system.mapper; - -import com.rczn.system.domain.RolePermission; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; - -@Mapper -public interface RolePermissionMapper { - - List selectListByRoleId(@Param("roleId") Integer roleId); - - int insert(RolePermission rolePermission); - - int delete(@Param("roleId") Integer roleId, @Param("permissionId") Integer permissionId); - - int deleteByRoleId(@Param("roleId") Integer roleId); -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicDataMapper.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicDataMapper.java deleted file mode 100644 index 52cea18..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicDataMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.rczn.system.mapper; - -import com.rczn.system.domain.SysDicData; -import org.apache.ibatis.annotations.Mapper; -import java.util.List; - -@Mapper -public interface SysDicDataMapper { - - /** - * 新增字典数据 - */ - int insert(SysDicData sysDicData); - - /** - * 修改字典数据 - */ - int update(SysDicData sysDicData); - - /** - * 逻辑删除字典数据 - */ - int deleteById(Long id); - - /** - * 根据ID查询字典数据 - */ - SysDicData selectById(Long id); - - /** - * 分页查询字典数据(参数可选) - */ - List selectPage(SysDicData sysDicData); - - /** - * 根据字典类型ID查询字典数据列表 - */ - List selectByDicId(Integer dicId); -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicTypeMapper.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicTypeMapper.java deleted file mode 100644 index ec25b7a..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysDicTypeMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.rczn.system.mapper; - -import com.rczn.system.domain.SysDicType; -import org.apache.ibatis.annotations.Mapper; -import java.util.List; - -@Mapper -public interface SysDicTypeMapper { - - /** - * 新增字典类型 - */ - int insert(SysDicType sysDicType); - - /** - * 修改字典类型 - */ - int update(SysDicType sysDicType); - - /** - * 逻辑删除字典类型 - */ - int deleteById(Long id); - - /** - * 根据ID查询字典类型 - */ - SysDicType selectById(Long id); - - /** - * 分页查询字典类型(参数可选) - */ - List selectPage(SysDicType sysDicType); -} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysPermissionMapper.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysPermissionMapper.java deleted file mode 100644 index 4b67f65..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/SysPermissionMapper.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.rczn.system.mapper; - - -import com.rczn.system.domain.Permission; -import com.rczn.system.domain.Role; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface SysPermissionMapper { - - /** - * 分页查询角色(支持角色名/角色编码模糊查询) - */ - List selectPermissionPage( - @Param("parentId") Integer parentId, - @Param("permissionName") String permissionName); - - /** - * 查询总条数(支持模糊查询条件) - */ - Long selectTotal( - @Param("parentId") Integer parentId, - @Param("permissionName") String permissionName); - - /** - * 查询所有权限(未删除) - */ - List selectPermissionList(); - - /** - * 根据ID查询 - */ - Permission selectPermissionById(Integer id); - - /** - * 新增 - */ - int insertPermission(Permission permission); - - /** - * 修改 - */ - int updatePermission(Permission permission); - - /** - * 逻辑删除 - */ - int deletePermissionById(Integer id); -} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/UserMapper.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/UserMapper.java index bd19442..1287781 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/UserMapper.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/mapper/UserMapper.java @@ -1,11 +1,8 @@ package com.rczn.system.mapper; -import com.rczn.system.domain.Permission; import com.rczn.system.domain.User; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - import java.util.List; @Mapper @@ -34,10 +31,4 @@ public interface UserMapper { @Param("sex") Integer sex, @Param("delSign") Boolean delSign ); - - @Select("SELECT * FROM sys_user WHERE user_name = #{userName}") - User selectByUsername(String userName); - - //根据用户id,查询出对应的权限列表 - List findUserPermissions(Long userId); } \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/ManageLogService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/ManageLogService.java similarity index 85% rename from rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/ManageLogService.java rename to rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/ManageLogService.java index 7302508..5dd7325 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/ManageLogService.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/ManageLogService.java @@ -1,7 +1,7 @@ -package com.rczn.rcznautoplc.service; +package com.rczn.system.service; import com.rczn.domain.PageBean; -import com.rczn.rcznautoplc.domain.ManageLog; +import com.rczn.system.domain.ManageLog; public interface ManageLogService { // 新增日志 diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/RolePermissionService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/RolePermissionService.java deleted file mode 100644 index 6c175d6..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/RolePermissionService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.rczn.system.service; - -import com.rczn.system.domain.RolePermission; -import java.util.List; - -public interface RolePermissionService { - - List selectListByRoleId(Integer roleId); - - void insert(RolePermission rolePermission); - - boolean delete(Integer roleId, Integer permissionId); - - void deleteByRoleId(Integer roleId); -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicDataService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicDataService.java deleted file mode 100644 index a590771..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicDataService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.rczn.system.service; - -import com.github.pagehelper.PageInfo; -import com.rczn.system.domain.SysDicData; - -import java.util.List; - -public interface SysDicDataService { - - /** - * 分页查询字典数据 - */ - PageInfo selectPage(Integer pageNum, Integer pageSize, Integer dicId, String dicLabel, String dicValue); - - /** - * 查询字典数据列表 - */ - List selectList(Integer dicId, String dicLabel, String dicValue); - - /** - * 根据ID查询字典数据 - */ - SysDicData selectById(Long id); - - /** - * 根据字典类型ID查询字典数据列表 - */ - List selectByDicId(Integer dicId); - - /** - * 新增字典数据 - */ - Long insert(SysDicData sysDicData); - - /** - * 修改字典数据 - */ - Boolean update(SysDicData sysDicData); - - /** - * 逻辑删除字典数据 - */ - Boolean deleteById(Long id); -} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicTypeService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicTypeService.java deleted file mode 100644 index c04b731..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysDicTypeService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.rczn.system.service; - - -import com.github.pagehelper.PageInfo; -import com.rczn.system.domain.SysDicType; - -import java.util.List; - -public interface SysDicTypeService { - - /** - * 分页查询字典类型 - */ - PageInfo selectPage(Integer pageNum, Integer pageSize, String dicName, String dicCode); - - /** - * 查询字典类型列表 - */ - List selectList( String dicName, String dicCode); - - /** - * 根据ID查询字典类型 - */ - SysDicType selectById(Long id); - - /** - * 新增字典类型 - */ - Long insert(SysDicType sysDicType); - - /** - * 修改字典类型 - */ - Boolean update(SysDicType sysDicType); - - /** - * 逻辑删除字典类型 - */ - Boolean deleteById(Long id); -} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysPermissionService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysPermissionService.java deleted file mode 100644 index 8e5ee0a..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/SysPermissionService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.rczn.system.service; - -import com.rczn.domain.PageBean; -import com.rczn.system.domain.Permission; -import com.rczn.system.domain.Role; - -import java.util.List; - -public interface SysPermissionService { - List getPermissionList(); - //根据父ID查询权限列表: - List getPermissionListByParentId(Integer parentId); - Permission getPermissionById(Integer id); - boolean addPermission(Permission permission); - boolean updatePermission(Permission permission); - boolean deletePermission(Integer id); - - /** - * 1. 分页查询角色(多条件模糊查询) - * @param pageNum - * @param pageSize - * @param permissionName - * @return - */ - PageBean selectRolePage(Integer pageNum, Integer pageSize,Integer parentId, String permissionName); -} diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserRoleService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserRoleService.java index f3897ad..72a1875 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserRoleService.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserRoleService.java @@ -11,13 +11,6 @@ public interface UserRoleService { Boolean deleteByRoleId(Integer roleId); UserRole selectById(Long id); List selectByUserId(Integer userId); - -/** - * Selects user roles by the given role ID - * - * @param roleId The ID of the role to search for - * @return List of UserRole objects associated with the given role ID - */ List selectByRoleId(Integer roleId); PageBean selectPage(Integer pageNum, Integer pageSize, Integer userId, Integer roleId); } \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserService.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserService.java index 8a73a04..4493171 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserService.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/UserService.java @@ -1,7 +1,6 @@ package com.rczn.system.service; import com.rczn.domain.PageBean; -import com.rczn.system.domain.Permission; import com.rczn.system.domain.User; import java.util.List; @@ -54,25 +53,4 @@ public interface UserService { * @return 是否删除成功(true/false) */ Boolean deleteById(Long id); - - /** - * 6. 根据用户名查询用户 - * @param username 用户名 - * @return 用户实体 - */ - User findeUserByUsername(String username); - - /** - * 7. 注册用户 - * @param username 用户名 - * @param password 密码 - */ - int register(String username, String password); - - /** - * 根据用户id查询出关联的用户权限对象列表, - * 表直接的关系是: - * 用户表(user)--用户权限表(user_role)--权限表(role)-- 权限资源表(role_resource)--资源表(resource) - */ - List findUserPermissions(Long userId); } \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/impl/ManageLogServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/ManageLogServiceImpl.java similarity index 93% rename from rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/impl/ManageLogServiceImpl.java rename to rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/ManageLogServiceImpl.java index da73bba..c723e76 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/java/com/rczn/rcznautoplc/service/impl/ManageLogServiceImpl.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/ManageLogServiceImpl.java @@ -1,11 +1,12 @@ -package com.rczn.rcznautoplc.service.impl; +package com.rczn.system.service.impl; import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; import com.rczn.domain.PageBean; -import com.rczn.rcznautoplc.domain.ManageLog; -import com.rczn.rcznautoplc.mapper.ManageLogMapper; -import com.rczn.rcznautoplc.service.ManageLogService; +import com.rczn.system.domain.ManageLog; +import com.github.pagehelper.PageHelper; +import com.rczn.system.domain.Position; +import com.rczn.system.mapper.ManageLogMapper; +import com.rczn.system.service.ManageLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.Assert; diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/RolePermissionServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/RolePermissionServiceImpl.java deleted file mode 100644 index 5a1fb45..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/RolePermissionServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.rczn.system.service.impl; - -import com.rczn.system.domain.RolePermission; -import com.rczn.system.mapper.RolePermissionMapper; -import com.rczn.system.service.RolePermissionService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.List; - -@Service -public class RolePermissionServiceImpl implements RolePermissionService { - - @Autowired - RolePermissionMapper rolePermissionMapper; - - @Override - public List selectListByRoleId(Integer roleId) { - return rolePermissionMapper.selectListByRoleId(roleId); - } - - @Override - @Transactional - public void insert(RolePermission rolePermission) { - rolePermission.setCreateTime(LocalDateTime.now()); - rolePermissionMapper.insert(rolePermission); - } - - @Override - @Transactional - public boolean delete(Integer roleId, Integer permissionId) { - return rolePermissionMapper.delete(roleId, permissionId) > 0; - } - - @Override - @Transactional - public void deleteByRoleId(Integer roleId) { - rolePermissionMapper.deleteByRoleId(roleId); - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicDataServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicDataServiceImpl.java deleted file mode 100644 index ff69849..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicDataServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.rczn.system.service.impl; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.rczn.system.domain.SysDicData; -import com.rczn.system.mapper.SysDicDataMapper; -import com.rczn.system.service.SysDicDataService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import java.util.List; - -@Service -public class SysDicDataServiceImpl implements SysDicDataService { - - @Autowired - private SysDicDataMapper sysDicDataMapper; - - @Override - public PageInfo selectPage(Integer pageNum, Integer pageSize, Integer dicId, String dicLabel, String dicValue) { - PageHelper.startPage(pageNum, pageSize); - SysDicData query = new SysDicData(); - query.setDicId(dicId); - query.setDicLabel(dicLabel); - query.setDicValue(dicValue); - return new PageInfo<>(sysDicDataMapper.selectPage(query)); - } - - /** - * 查询字典数据列表 - * - * @param dicId - * @param dicLabel - * @param dicValue - */ - @Override - public List selectList(Integer dicId, String dicLabel, String dicValue) { - SysDicData query = new SysDicData(); - query.setDicId(dicId); - query.setDicLabel(dicLabel); - query.setDicValue(dicValue); - return sysDicDataMapper.selectPage(query); - } - - @Override - public SysDicData selectById(Long id) { - return sysDicDataMapper.selectById(id); - } - - @Override - public List selectByDicId(Integer dicId) { - if (dicId == null) { - throw new IllegalArgumentException("字典类型ID不能为空"); - } - return sysDicDataMapper.selectByDicId(dicId); - } - - @Override - public Long insert(SysDicData sysDicData) { - // 校验必填项 - if (sysDicData.getDicId() == null) { - throw new IllegalArgumentException("字典类型ID不能为空"); - } - if (sysDicData.getDicLabel() == null || sysDicData.getDicLabel().trim().isEmpty()) { - throw new IllegalArgumentException("数据标签不能为空"); - } - int count = sysDicDataMapper.insert(sysDicData); - return count > 0 ? sysDicData.getId() : null; - } - - @Override - public Boolean update(SysDicData sysDicData) { - if (sysDicData.getId() == null) { - throw new IllegalArgumentException("字典数据ID不能为空"); - } - // 校验是否存在 - SysDicData exist = sysDicDataMapper.selectById(sysDicData.getId()); - if (exist == null) { - return false; - } - int count = sysDicDataMapper.update(sysDicData); - return count > 0; - } - - @Override - public Boolean deleteById(Long id) { - if (id == null) { - throw new IllegalArgumentException("字典数据ID不能为空"); - } - // 校验是否存在 - SysDicData exist = sysDicDataMapper.selectById(id); - if (exist == null) { - return false; - } - int count = sysDicDataMapper.deleteById(id); - return count > 0; - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicTypeServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicTypeServiceImpl.java deleted file mode 100644 index f9b6625..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysDicTypeServiceImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.rczn.system.service.impl; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.rczn.system.domain.SysDicType; -import com.rczn.system.mapper.SysDicTypeMapper; -import com.rczn.system.service.SysDicTypeService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class SysDicTypeServiceImpl implements SysDicTypeService { - - @Autowired - private SysDicTypeMapper sysDicTypeMapper; - - @Override - public PageInfo selectPage(Integer pageNum, Integer pageSize, String dicName, String dicCode) { - PageHelper.startPage(pageNum, pageSize); - SysDicType query = new SysDicType(); - query.setDicName(dicName); - query.setDicCode(dicCode); - return new PageInfo<>(sysDicTypeMapper.selectPage(query)); - } - - /** - * 查询字典类型列表 - * - * @param dicName - * @param dicCode - */ - @Override - public List selectList(String dicName, String dicCode) { - SysDicType query = new SysDicType(); - query.setDicName(dicName); - query.setDicCode(dicCode); - return sysDicTypeMapper.selectPage(query); - } - - @Override - public SysDicType selectById(Long id) { - return sysDicTypeMapper.selectById(id); - } - - @Override - public Long insert(SysDicType sysDicType) { - // 校验必填项 - if (sysDicType.getDicName() == null || sysDicType.getDicName().trim().isEmpty()) { - throw new IllegalArgumentException("字典名称不能为空"); - } - int count = sysDicTypeMapper.insert(sysDicType); - return count > 0 ? sysDicType.getId() : null; - } - - @Override - public Boolean update(SysDicType sysDicType) { - if (sysDicType.getId() == null) { - throw new IllegalArgumentException("字典类型ID不能为空"); - } - // 校验是否存在 - SysDicType exist = sysDicTypeMapper.selectById(sysDicType.getId()); - if (exist == null) { - return false; - } - int count = sysDicTypeMapper.update(sysDicType); - return count > 0; - } - - @Override - public Boolean deleteById(Long id) { - if (id == null) { - throw new IllegalArgumentException("字典类型ID不能为空"); - } - // 校验是否存在 - SysDicType exist = sysDicTypeMapper.selectById(id); - if (exist == null) { - return false; - } - int count = sysDicTypeMapper.deleteById(id); - return count > 0; - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysPermissionServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysPermissionServiceImpl.java deleted file mode 100644 index 22fa1a3..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/SysPermissionServiceImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.rczn.system.service.impl; - -import com.github.pagehelper.PageHelper; -import com.rczn.domain.PageBean; -import com.rczn.system.domain.Permission; -import com.rczn.system.domain.Role; -import com.rczn.system.mapper.SysPermissionMapper; -import com.rczn.system.service.SysPermissionService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -@Service -public class SysPermissionServiceImpl implements SysPermissionService { - - @Autowired - private SysPermissionMapper sysPermissionMapper; - - @Override - public Permission getPermissionById(Integer id) { - return sysPermissionMapper.selectPermissionById(id); - } - - @Override - public boolean addPermission(Permission permission) { - return sysPermissionMapper.insertPermission(permission) > 0; - } - - @Override - public boolean updatePermission(Permission permission) { - return sysPermissionMapper.updatePermission(permission) > 0; - } - - @Override - public boolean deletePermission(Integer id) { - return sysPermissionMapper.deletePermissionById(id) > 0; - } - - /** - * 1. 分页查询角色(多条件模糊查询) - * - * @param pageNum - * @param pageSize - * @param permissionName - * @return - */ - @Override - public PageBean selectRolePage(Integer pageNum, Integer pageSize,Integer parentId, String permissionName) { - // 1. PageHelper 设置分页参数 - PageHelper.startPage(pageNum, pageSize); - //加一层过滤: - if(parentId == 0){ - parentId = null; - } - // 2. 执行查询 - List permissionList = sysPermissionMapper.selectPermissionPage(parentId,permissionName); - // 3. 查询总条数 - Long total = sysPermissionMapper.selectTotal(parentId,permissionName); - // 4. 封装分页结果 - return new PageBean() {{ - setTotal(total); - setItems(permissionList); - }}; - } - - @Override - public List getPermissionList() { - // 1. 查询所有平级权限 - List allPermissions = sysPermissionMapper.selectPermissionList(); - - // 2. 找到顶层节点(parentId = null 或 0) - List topNodes = new ArrayList<>(); - for (Permission p : allPermissions) { - if (p.getParentId() == null || p.getParentId() == 0) { - topNodes.add(p); - } - } - - // 3. 循环给每个顶层节点设置子节点(递归) - for (Permission node : topNodes) { - node.setChildren(findChildren(node, allPermissions)); - } - - return topNodes; - } - - /*** - * 根据父ID查询权限列表 - * @param parentId - * @return - */ - @Override - public List getPermissionListByParentId(Integer parentId) { - // 1. 查询所有平级权限 - List allPermissions = sysPermissionMapper.selectPermissionList(); - - // 2. 找到顶层节点(parentId = null 或 0) - List topNodes = new ArrayList<>(); - for (Permission p : allPermissions) { - if(parentId == null || parentId == 0){ - if (p.getParentId() == null || p.getParentId() == 0) { - topNodes.add(p); - } - }else { - if (p.getParentId() == parentId) { - topNodes.add(p); - } - } - - } - - // 3. 循环给每个顶层节点设置子节点(递归) - for (Permission node : topNodes) { - node.setChildren(findChildren(node, allPermissions)); - } - - return topNodes; - } - - /** - * 递归查找子节点(最稳妥、最清晰、不会漏) - */ - private List findChildren(Permission parent, List allList) { - List children = new ArrayList<>(); - - for (Permission p : allList) { - // 子节点的 parentId == 父节点 id - if (parent.getId().equals(p.getParentId()==null?0:p.getParentId().longValue())) { - children.add(p); - // 递归给子节点设置孙子节点 - p.setChildren(findChildren(p, allList)); - } - } - - return children; - } -} \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserRoleServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserRoleServiceImpl.java index a56a513..2be0cf1 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserRoleServiceImpl.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserRoleServiceImpl.java @@ -3,7 +3,6 @@ package com.rczn.system.service.impl; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.rczn.domain.PageBean; -import com.rczn.system.domain.Permission; import com.rczn.system.domain.Position; import com.rczn.system.domain.UserRole; import com.rczn.system.mapper.UserRoleMapper; diff --git a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserServiceImpl.java b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserServiceImpl.java index 701d98a..40d89e7 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserServiceImpl.java +++ b/rc_autoplc_backend/rczn-admin/src/main/java/com/rczn/system/service/impl/UserServiceImpl.java @@ -3,7 +3,6 @@ package com.rczn.system.service.impl; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.rczn.domain.PageBean; -import com.rczn.system.domain.Permission; import com.rczn.system.domain.User; import com.rczn.system.mapper.UserMapper; import com.rczn.system.service.UserService; @@ -91,41 +90,4 @@ public class UserServiceImpl implements UserService { int rows = userMapper.deleteById(id,null); return rows > 0; } - - /** - * 6. 根据用户名查询用户 - * - * @param username 用户名 - * @return 用户实体 - */ - @Override - public User findeUserByUsername(String username) { - return userMapper.selectByUsername(username); - } - - /** - * 7. 注册用户 - * - * @param username 用户名 - * @param password 密码 - */ - @Override - public int register(String username, String password) { - User user = new User(); - user.setUserName(username); - user.setPassword(password); - return userMapper.insert(user); - } - - /** - * 根据用户id查询出关联的用户权限对象列表, - * 表直接的关系是: - * 用户表(user)--用户权限表(user_role)--权限表(role)-- 权限资源表(role_resource)--资源表(resource) - * - * @param userId - */ - @Override - public List findUserPermissions(Long userId) { - return userMapper.findUserPermissions(userId); - } } \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/resources/application.yml b/rc_autoplc_backend/rczn-admin/src/main/resources/application.yml index 720422e..74a95d1 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/resources/application.yml +++ b/rc_autoplc_backend/rczn-admin/src/main/resources/application.yml @@ -14,7 +14,7 @@ spring: # 数据源配置(MySQL 8.x) datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://47.116.126.33:3306/rc_autoplc_program?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true + url: jdbc:mysql://47.116.126.33:3306/rc_autoplc_program?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true username: nianke password: Jy@.niankeCrm2025 # 解决跨域(可选,配合之前的CorsConfig) @@ -42,12 +42,11 @@ spring: mybatis: configuration: map-underscore-to-camel-case: true # 下划线转驼峰 - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 关键:SQL 打印到控制台 - log-prefix: "[MyBatis] " # 可选:日志前缀,便于区分 SQL 日志 - default-statement-timeout: 30 # 可选:SQL 执行超时时间(秒) mapper-locations: classpath:mapper/**/*.xml # 补充:指定Mapper.xml文件路径(必加) type-aliases-package: com.rczn.**.domain # 补充:实体类别名包(可选) - + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 关键:SQL 打印到控制台 + log-prefix: "[MyBatis] " # 可选:日志前缀,便于区分 SQL 日志 + default-statement-timeout: 30 # 可选:SQL 执行超时时间(秒) # HikariCP 连接池配置(关键) hikari: @@ -67,22 +66,22 @@ pagehelper: support-methods-arguments: true # 支持通过 Mapper 接口参数传递分页参数 params: count=countSql # 分页参数名映射 -# -## SpringDoc OpenAPI 3 核心配置(适配Spring Boot 3.x) -#springdoc: -# packages-to-scan: com.rczn # 扫描的基础包(Controller所在包) -# api-docs: -# enabled: true # 启用/v3/api-docs接口 -# path: /v3/api-docs # OpenAPI JSON数据路径(默认) -# swagger-ui: -# path: /swagger-ui.html # 自定义Swagger UI访问路径(兼容Spring Boot 2.x习惯) -# tags-sorter: alpha # 标签字母排序 -# operations-sorter: alpha # 接口字母排序 -# disable-swagger-default-url: true # 禁用默认PetStore示例 -# default-flat-param-object: false # 禁用扁平参数对象 -# paths-to-exclude: /error, /actuator/** # 排除错误接口/监控接口(可选) -# -## OpenAPI文档基础信息(中文正常显示) + +# SpringDoc OpenAPI 3 核心配置(适配Spring Boot 3.x) +springdoc: + packages-to-scan: com.rczn # 扫描的基础包(Controller所在包) + api-docs: + enabled: true # 启用/v3/api-docs接口 + path: /v3/api-docs # OpenAPI JSON数据路径(默认) + swagger-ui: + path: /swagger-ui.html # 自定义Swagger UI访问路径(兼容Spring Boot 2.x习惯) + tags-sorter: alpha # 标签字母排序 + operations-sorter: alpha # 接口字母排序 + disable-swagger-default-url: true # 禁用默认PetStore示例 + default-flat-param-object: false # 禁用扁平参数对象 + paths-to-exclude: /error, /actuator/** # 排除错误接口/监控接口(可选) + +# OpenAPI文档基础信息(中文正常显示) openapi: info: title: XX自动化编程系统API文档 @@ -97,40 +96,6 @@ openapi: - url: http://47.116.126.33:9090 # 测试环境地址 description: 测试环境 - -# SpringDoc + Knife4j 核心配置 -springdoc: - packages-to-scan: com.rczn # 扫描Controller所在包 - api-docs: - enabled: true - path: /v3/api-docs - swagger-ui: - tags-sorter: alpha - operations-sorter: alpha - paths-to-exclude: /error, /actuator/** - -# Knife4j增强配置(可选,开启中文UI) -knife4j: - enable: true - setting: - language: zh_cn # 中文界面 - enable-swagger-models: true # 显示模型 - enable-document-manage: false # 关闭文档管理(开发环境) - -# OpenAPI文档信息 -#openapi: -# info: -# title: XX自动化编程系统API文档 -# description: SpringBoot 3.x + Knife4j + OpenAPI 3 接口文档 -# version: 1.0.0 -# contact: -# name: 研发组 -# email: xxx@xxx.com -# servers: -# - url: http://localhost:9090 -# description: 本地开发环境 -# - url: http://47.116.126.33:9090 -# description: 测试环境 # Spring Boot 日志核心配置 logging: # 1. 全局日志级别(可细化到包/类) diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/ManageLogMapper.xml b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/ManageLogMapper.xml similarity index 96% rename from rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/ManageLogMapper.xml rename to rc_autoplc_backend/rczn-admin/src/main/resources/mapper/ManageLogMapper.xml index fbfd66a..915b2e5 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/ManageLogMapper.xml +++ b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/ManageLogMapper.xml @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ - + @@ -107,7 +107,7 @@ - SELECT , @@ -144,7 +144,7 @@ - SELECT COUNT(*) FROM sys_manage_log diff --git a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/RolePermissionMapper.xml b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/RolePermissionMapper.xml deleted file mode 100644 index ba72578..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/RolePermissionMapper.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - id, role_id, permission_id - - - - - - INSERT INTO sys_role_permission (role_id, permission_id) - VALUES (#{roleId}, #{permissionId}) - - - - DELETE FROM sys_role_permission - - - role_id = #{roleId} - - - AND permission_id = #{permissionId} - - - - - - DELETE FROM sys_role_permission - WHERE role_id = #{roleId} - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicDataMapper.xml b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicDataMapper.xml deleted file mode 100644 index 2ab76dc..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicDataMapper.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - id, create_by, create_time, update_by, update_time, del_sign, remark - - - - dic_id, dic_label, dic_value - - - - - INSERT INTO sys_dic_data ( - , - create_by, create_time, update_by, update_time, del_sign - ) VALUES ( - #{dicId}, #{dicLabel}, #{dicValue}, - #{createId}, NOW(), #{updateId}, NOW(), 0 - ) - - - - - UPDATE sys_dic_data - - dic_id = #{dicId}, - dic_label = #{dicLabel}, - dic_value = #{dicValue}, - update_by = #{updateId}, - update_time = NOW() - - WHERE id = #{id} AND del_sign = 0 - - - - - UPDATE sys_dic_data - SET del_sign = 1, update_time = NOW() - WHERE id = #{id} AND del_sign = 0 - - - - - - - - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicTypeMapper.xml b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicTypeMapper.xml deleted file mode 100644 index 29f9613..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysDicTypeMapper.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - id, create_by, create_time, update_by, update_time, del_sign, remark - - - - dic_name, dic_code - - - - - INSERT INTO sys_dic_type ( - , - create_by, create_time, update_by, update_time, del_sign - ) VALUES ( - #{dicName}, #{dicCode}, - #{createId}, NOW(), #{updateId}, NOW(), 0 - ) - - - - - UPDATE sys_dic_type - - dic_name = #{dicName}, - dic_code = #{dicCode}, - update_by = #{updateId}, - update_time = NOW() - - WHERE id = #{id} AND del_sign = 0 - - - - - UPDATE sys_dic_type - SET del_sign = 1, update_time = NOW() - WHERE id = #{id} AND del_sign = 0 - - - - - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysPermissionMapper.xml b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysPermissionMapper.xml deleted file mode 100644 index dfba1f9..0000000 --- a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/SysPermissionMapper.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO sys_permission - (parent_id, permission_name, permission_code, create_id, remark, del_sign) - VALUES - (#{parentId}, #{permissionName}, #{permissionCode}, #{createId}, #{remark}, 0) - - - - - UPDATE sys_permission - SET - parent_id = #{parentId}, - permission_name = #{permissionName}, - permission_code = #{permissionCode}, - update_id = #{updateId}, - remark = #{remark} - WHERE id = #{id} - - - - - UPDATE sys_permission SET del_sign = 1 WHERE id = #{id} - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/UserMapper.xml b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/UserMapper.xml index 27907f9..5bf4d95 100644 --- a/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/UserMapper.xml +++ b/rc_autoplc_backend/rczn-admin/src/main/resources/mapper/UserMapper.xml @@ -198,24 +198,5 @@ - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-admin/src/test/java/com/rczn/RcznAdminApplicationTests.java b/rc_autoplc_backend/rczn-admin/src/test/java/com/rczn/RcznAdminApplicationTests.java deleted file mode 100644 index aadd54c..0000000 --- a/rc_autoplc_backend/rczn-admin/src/test/java/com/rczn/RcznAdminApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.rczn; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class RcznAdminApplicationTests { - -// @Test - void contextLoads() { - } - -} diff --git a/rc_autoplc_backend/rczn-autoplc/pom.xml b/rc_autoplc_backend/rczn-autoplc/pom.xml index 8eb981a..0d84e78 100644 --- a/rc_autoplc_backend/rczn-autoplc/pom.xml +++ b/rc_autoplc_backend/rczn-autoplc/pom.xml @@ -38,7 +38,6 @@ org.projectlombok lombok - ${lombok.version} true @@ -47,7 +46,12 @@ 5.3.3 compile - + + io.swagger.core.v3 + swagger-annotations-jakarta + 2.2.21 + compile + org.mybatis mybatis @@ -65,18 +69,14 @@ 7.11.0 test - - io.swagger.core.v3 - swagger-models-jakarta - 2.2.19 - compile - - - org.junit.jupiter - junit-jupiter-api - + + org.springdoc + springdoc-openapi-starter-common + 2.3.0 + compile + - + - island_id, dev_name, dev_model,plc_addr, ip_addr, port, protocol_type, company, status,run_model, dev_desc + island_id, dev_name, dev_model, ip_addr, port, protocol_type, company, status, dev_desc @@ -25,13 +25,11 @@ - - @@ -43,13 +41,11 @@ island_id, dev_name, dev_model, - plc_addr, ip_addr, port, protocol_type, company, status, - run_model, `dev_desc`, create_id, @@ -65,13 +61,11 @@ #{islandId}, #{devName}, #{devModel}, - #{plcAddr}, #{ipAddr}, #{port}, #{protocolType}, #{company}, #{status}, - #{runModel}, #{devDesc}, #{createId}, @@ -84,6 +78,7 @@ ) + UPDATE tb_dev_info @@ -99,13 +94,11 @@ island_id = #{islandId}, dev_name = #{devName}, dev_model = #{devModel}, - plc_addr = #{plcAddr}, ip_addr = #{ipAddr}, port = #{port}, protocol_type = #{protocolType}, company = #{company}, status = #{status}, - #{runModel}, `dev_desc` = #{devDesc}, @@ -120,7 +113,6 @@ AND dev_model LIKE CONCAT('%', #{devModel}, '%') - - and plc_addr = #{plcAddr} - AND ip_addr = #{ipAddr} @@ -173,9 +162,6 @@ AND status = #{status} - - and run_model = #{runModel} - AND protocol_type = #{protocolType} @@ -197,18 +183,12 @@ AND dev_model LIKE CONCAT('%', #{devModel}, '%') - - and plc_addr = #{plcAddr} - AND ip_addr = #{ipAddr} AND status = #{status} - - AND run_model = #{runModel} - AND protocol_type = #{protocolType} @@ -223,44 +203,4 @@ WHERE del_sign = 0 ORDER BY id ASC - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/DevParamMapper.xml b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/DevParamMapper.xml index b0b33a3..8a5c76d 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/DevParamMapper.xml +++ b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/DevParamMapper.xml @@ -8,56 +8,45 @@ - dev_ids, param_name, plc_addr, dic_data_id, param_value, param_type, param_unit, form_type, param_desc + dev_id, param_name, param_value,param_type,param_unit,form_type, param_desc - + INSERT INTO tb_dev_param ( - - dev_ids, - plc_addr, - dic_data_id, - param_name, - param_value, - param_type, - param_unit, - form_type, - param_desc, - create_id, - update_id, - create_time, - update_time, - del_sign - - ) - VALUES ( - - #{devIds}, - #{plcAddr}, - #{dicDataId}, - #{paramName}, - #{paramValue}, - #{paramType}, - #{paramUnit}, - #{formType}, - #{paramDesc}, - #{createId}, - #{updateId}, - NOW(), - NOW(), - 0 - + + dev_id, + param_name, + param_value, + param_type, + param_unit, + form_type, + param_desc, + create_id, + update_id, + create_time, update_time, del_sign + + ) VALUES ( + + #{devId}, + #{paramName}, + #{paramValue}, + #{paramType}, + #{paramUnit}, + #{formType}, + #{paramDesc}, + #{createId}, + #{updateId}, + NOW(), NOW(), 0 + ) - + UPDATE tb_dev_param - dev_ids = #{devIds}, - plc_addr = #{plcAddr}, - dic_data_id = #{dicDataId}, + dev_id = #{devId}, param_name = #{paramName}, param_value = #{paramValue}, param_type = #{paramType}, @@ -65,21 +54,19 @@ form_type = #{formType}, param_desc = #{paramDesc}, update_id = #{updateId}, - remark = #{remark}, update_time = NOW() WHERE id = #{id} AND del_sign = 0 - + UPDATE tb_dev_param SET del_sign = 1, update_time = NOW() WHERE id = #{id} AND del_sign = 0 - AND 1=2 - + - + - - - - UPDATE tb_dev_param - SET dev_ids = CASE - WHEN dev_ids IS NULL OR dev_ids = '' THEN CONCAT(#{devId}, ';') - ELSE CONCAT(dev_ids, #{devId}, ';') - END - WHERE id = #{paramId} - AND 1=2 - - - - - UPDATE tb_dev_param - SET dev_ids = REPLACE(dev_ids, CONCAT(#{devId}, ';'), '') - WHERE id = #{paramId} - AND 1=2 - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsFlowStatusMapper.xml b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsFlowStatusMapper.xml index 04873f4..707f6ef 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsFlowStatusMapper.xml +++ b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsFlowStatusMapper.xml @@ -6,7 +6,7 @@ - goods_id, flow_id, island_id,dev_id, flow_sort, status + goods_id, flow_id, island_id, flow_sort, status @@ -14,7 +14,7 @@ , create_id, create_time, update_id, update_time, del_sign ) VALUES ( - #{goodsId}, #{flowId}, #{islandId},#{devId}, #{flowSort}, #{status}, + #{goodsId}, #{flowId}, #{islandId}, #{flowSort}, #{status}, #{createId}, NOW(), #{updateId}, NOW(), 0 ) @@ -26,7 +26,6 @@ flow_id = #{flowId}, island_id = #{islandId}, flow_sort = #{flowSort}, - dev_id = #{devId}, status = #{status}, update_id = #{updateId}, update_time = NOW() @@ -57,7 +56,6 @@ AND goods_id = #{goodsId} AND flow_id = #{flowId} AND island_id = #{islandId} - AND dev_id = #{devId} AND status = #{status} ORDER BY flow_sort ASC diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsInfoMapper.xml b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsInfoMapper.xml index 4286eee..18eca1b 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsInfoMapper.xml +++ b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/GoodsInfoMapper.xml @@ -6,7 +6,7 @@ - goods_name, goods_type, income_time, good_from, good_batch,point_num ,goal_detect,bar_code,flow_id,goods_status, `desc` + goods_name, goods_type, income_time, good_from, good_batch, `desc` @@ -14,7 +14,7 @@ , create_id, create_time, update_id, update_time, del_sign ) VALUES ( - #{goodsName}, #{goodsType}, #{incomeTime}, #{goodFrom}, #{goodBatch},#{pointNum},#{goalDetect}, #{barCode}, #{flowId}, #{goodsStatus}, #{desc}, + #{goodsName}, #{goodsType}, #{incomeTime}, #{goodFrom}, #{goodBatch}, #{desc}, #{createId}, NOW(), #{updateId}, NOW(), 0 ) @@ -27,11 +27,6 @@ income_time = #{incomeTime}, good_from = #{goodFrom}, good_batch = #{goodBatch}, - point_num = #{pointNum}, - goal_detect = #{goalDetect}, - bar_code = #{barCode}, - flow_id = #{flowId}, - goods_status = #{goodsStatus}, `desc` = #{desc}, update_id = #{updateId}, update_time = NOW() @@ -53,20 +48,6 @@ WHERE id = #{id} AND del_sign = 0 - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/IslandInfoMapper.xml b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/IslandInfoMapper.xml index c2059a3..851d869 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/IslandInfoMapper.xml +++ b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/IslandInfoMapper.xml @@ -6,7 +6,7 @@ - island_name, island_code, plc_addr, island_logo, `desc` + island_name, island_code, island_logo, `desc` @@ -14,7 +14,7 @@ , create_id, create_time, update_id, update_time, del_sign ) VALUES ( - #{islandName}, #{islandCode},#{plcAddr}, #{islandLogo}, #{desc}, + #{islandName}, #{islandCode}, #{islandLogo}, #{desc}, #{createId}, NOW(), #{updateId}, NOW(), 0 ) @@ -24,7 +24,6 @@ island_name = #{islandName}, island_code = #{islandCode}, - plc_addr = #{plcAddr}, island_logo = #{islandLogo}, `desc` = #{desc}, update_id = #{updateId}, @@ -47,20 +46,6 @@ WHERE id = #{id} AND del_sign = 0 - - - - \ No newline at end of file diff --git a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/StepInfoMapper.xml b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/StepInfoMapper.xml index 6869197..5cf6fd9 100644 --- a/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/StepInfoMapper.xml +++ b/rc_autoplc_backend/rczn-autoplc/src/main/resources/com/rczn/rcznautoplc/mapper/StepInfoMapper.xml @@ -6,7 +6,7 @@ - island_id,dev_id,step_order ,step_name, step_desc,flow_id,param_name,param_type,param_unit,param_value,form_type + island_id,dev_id, step_name, step_desc,flow_id,param_name,param_type,param_unit,param_value,form_type @@ -21,7 +21,6 @@ island_id, dev_id, - step_order, step_name, step_desc, flow_id, @@ -44,7 +43,6 @@ #{islandId}, #{devId}, - #{stepOrder}, #{stepName}, #{stepDesc}, #{flowId}, @@ -59,178 +57,11 @@ ) - - - INSERT INTO tb_step_info ( - - create_id, - create_time, - update_id, - update_time, - remark, - del_sign, - island_id, - dev_id, - step_order, - step_name, - step_desc, - flow_id, - param_name, - param_type, - param_unit, - param_value, - form_type - - ) VALUES - - ( - - #{item.createId,jdbcType=BIGINT}, - NOW(), - #{item.updateId,jdbcType=BIGINT}, - NOW(), - #{item.remark}, - null, - 0, - #{item.islandId,jdbcType=INTEGER}, - null, - #{item.devId,jdbcType=INTEGER}, - null, - #{item.stepOrder,jdbcType=INTEGER}, - null, - #{item.stepName}, - null, - #{item.stepDesc}, - null, - #{item.flowId,jdbcType=INTEGER}, - null, - #{item.paramName}, - null, - #{item.paramType}, - null, - #{item.paramUnit}, - null, - #{item.paramValue}, - null, - #{item.formType}, - null, - - ) - - - - - - UPDATE tb_step_info - - update_id = #{item.updateId,jdbcType=BIGINT}, - remark = #{item.remark}, - - island_id = #{item.islandId,jdbcType=INTEGER}, - dev_id = #{item.devId,jdbcType=INTEGER}, - step_order = #{item.stepOrder,jdbcType=INTEGER}, - step_name = #{item.stepName}, - step_desc = #{item.stepDesc}, - flow_id = #{item.flowId,jdbcType=INTEGER}, - param_name = #{item.paramName}, - param_type = #{item.paramType}, - param_unit = #{item.paramUnit}, - param_value = #{item.paramValue}, - form_type = #{item.formType}, - - update_time = NOW() - - WHERE id = #{item.id,jdbcType=BIGINT} - AND del_sign = 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UPDATE tb_step_info island_id = #{islandId}, dev_id = #{devId}, - step_order = #{stepOrder}, step_name = #{stepName}, step_desc = #{stepDesc}, update_id = #{updateId}, @@ -252,19 +83,6 @@ WHERE id = #{id} AND del_sign = 0 - - - UPDATE tb_step_info - SET del_sign = 1, update_time = NOW() - WHERE id in - - #{id} - - AND del_sign = 0 - - - - - - -