Commit 46500bff by zzrdark

1.增加页面

2.系统管理大模块的修改
3.设备控制模块
parent d95f6ed4
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="58efcb75-622d-40c1-b8e0-10cd2fb456b4" name="Default Changelist" comment="1.用户模块">
<change afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/ProductSeriesDao.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/entity/ProductSeriesEntity.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/ProductSeriesDao.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/SeriesDto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/SeriesVo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/DeviceClient.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/Dockerfile" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/build.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/ProductSeriesService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/ProductSeriesServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/ProductSeriesController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/resources/application-dev.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/resources/application.yml" afterDir="false" />
<list default="true" id="58efcb75-622d-40c1-b8e0-10cd2fb456b4" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DataFilterDto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DevicesDto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/DevicesVo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-authorization/src/main/java/com/mx/cneeds/server/anthorization/service/MxJwtTokenEnhancer.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/client/UserClient.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/common/DataFilterAspect.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/config/MybatisPlusConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/db/cneeds_server.sql" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/db/cneeds_server.sql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/DeviceInfoDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/DeviceInfoDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/ProductSeriesDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/ProductSeriesDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysUserDeptDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysUserDeptDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/entity/DeviceInfoEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/entity/DeviceInfoEntity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/DeviceInfoDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/DeviceInfoDao.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/UserDto.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/UserDto.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/RoleVo.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/RoleVo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/UserVo.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/UserVo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/ProductSeriesDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/ProductSeriesDao.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysUserDeptDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysUserDeptDao.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/DeviceChannelVo.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/DeviceChannelVo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-utils/src/main/java/com/mx/cneeds/common/annotation/DataFilter.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-utils/src/main/java/com/mx/cneeds/common/annotation/DataFilter.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-authorization/src/main/java/com/mx/cneeds/server/anthorization/config/OAuth2AuthorizationServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-authorization/src/main/java/com/mx/cneeds/server/anthorization/config/OAuth2AuthorizationServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/DeviceClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/DeviceClient.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/DeviceController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/DeviceController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/system/SystemController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/system/SystemController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/DeviceApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/DeviceApplication.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceInfoService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceInfoService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/ProductSeriesService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/ProductSeriesService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceInfoServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceInfoServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/ProductSeriesServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/ProductSeriesServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceInfoController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceInfoController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceLogController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceLogController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/resources/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/resources/application-dev.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/ProductSeriesController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/ProductSeriesController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/common/DataFilterAspect.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/common/DataFilterAspect.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysRoleService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysRoleService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysUserDeptService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysUserDeptService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysUserService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysUserService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysUserDeptServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysUserDeptServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysUserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysUserServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/web/SysUserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/web/SysUserController.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -116,28 +118,29 @@
<property name="settings.editor.splitter.proportion" value="0.20898877" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\java\com\mx\cneeds" />
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\resources" />
<recent name="E:\mx_project\cneeds-server" />
<recent name="E:\mx_project\cneeds-server\src" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\resources\statics" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-device" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-device\src\main\resources" />
<recent name="E:\mx_project\cneeds-server\cneeds-common-data\src\main\resources\mapper" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.mx.cneeds.server.device.common" />
<recent name="com.mx.cneeds.common.dto" />
<recent name="com.mx.cneeds.server.device.config" />
<recent name="com.mx.cneeds.common.vo" />
<recent name="com.mx.cneeds.common.generate" />
<recent name="com.mx.cneeds.server.anthorization.service" />
<recent name="com.mx.cneeds.server.datashow.web.system" />
<recent name="com.mx.cneeds.common.dto" />
</key>
<key name="CopyFile.RECENT_KEYS">
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\mx_project\cneeds-server\cneeds-common-data\src\test" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\java\com\mx\cneeds" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\resources" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\resources\statics" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-device" />
<recent name="E:\mx_project\cneeds-server\cneeds-server-device\src\main\resources" />
<recent name="E:\mx_project\cneeds-server\cneeds-common-data\src\main\resources\mapper" />
<recent name="E:\mx_project\cneeds-server" />
<recent name="E:\mx_project\cneeds-server\src" />
</key>
</component>
<component name="RunManager" selected="Spring Boot.DatashowApplication">
<component name="RunManager" selected="Spring Boot.DeviceApplication">
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<module name="cneeds-server-advice-control" />
<option name="VM_PARAMETERS" />
......@@ -301,7 +304,10 @@
<workItem from="1584066161394" duration="18287000" />
<workItem from="1584325001929" duration="18105000" />
<workItem from="1584411045642" duration="12603000" />
<workItem from="1584497551021" duration="17555000" />
<workItem from="1584497551021" duration="17798000" />
<workItem from="1584583200954" duration="19003000" />
<workItem from="1584671773646" duration="19144000" />
<workItem from="1584927645789" duration="18067000" />
</task>
<task id="LOCAL-00001" summary="1.修改不需要web服务 &#10;2.增加一个logupload">
<created>1578451117064</created>
......@@ -401,7 +407,14 @@
<option name="project" value="LOCAL" />
<updated>1584449816639</updated>
</task>
<option name="localTasksCounter" value="15" />
<task id="LOCAL-00015" summary="1.增加页面&#10;2.系统管理大模块的修改&#10;3. 产品系列">
<created>1584530106783</created>
<option name="number" value="00015" />
<option name="presentableId" value="LOCAL-00015" />
<option name="project" value="LOCAL" />
<updated>1584530106783</updated>
</task>
<option name="localTasksCounter" value="16" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -435,7 +448,8 @@
<MESSAGE value="1.部门模块&#10;2.角色模块部分" />
<MESSAGE value="2.角色模块增删改查" />
<MESSAGE value="1.用户模块" />
<option name="LAST_COMMIT_MESSAGE" value="1.用户模块" />
<MESSAGE value="1.增加页面&#10;2.系统管理大模块的修改&#10;3. 产品系列" />
<option name="LAST_COMMIT_MESSAGE" value="1.增加页面&#10;2.系统管理大模块的修改&#10;3. 产品系列" />
</component>
<component name="WindowStateProjectService">
<state x="552" y="178" key="#Project_Structure" timestamp="1584514052764">
......@@ -446,10 +460,10 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="414" y="175" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1583824373022" />
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser" timestamp="1584514224862">
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser" timestamp="1584673670733">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1584514224862" />
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1584673670733" />
<state x="640" y="246" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1582697117117">
<screen x="0" y="0" width="1920" height="1040" />
</state>
......@@ -474,54 +488,54 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="740" y="275" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1583991202144" />
<state width="1877" height="361" key="GridCell.Tab.0.bottom" timestamp="1584529997167">
<state width="1877" height="215" key="GridCell.Tab.0.bottom" timestamp="1584956421111">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997167" />
<state width="1877" height="361" key="GridCell.Tab.0.center" timestamp="1584529997167">
<state width="1877" height="215" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421111" />
<state width="1877" height="215" key="GridCell.Tab.0.center" timestamp="1584956421111">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997167" />
<state width="1877" height="361" key="GridCell.Tab.0.left" timestamp="1584529997167">
<state width="1877" height="215" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421111" />
<state width="1877" height="215" key="GridCell.Tab.0.left" timestamp="1584956421111">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997167" />
<state width="1877" height="361" key="GridCell.Tab.0.right" timestamp="1584529997167">
<state width="1877" height="215" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421111" />
<state width="1877" height="215" key="GridCell.Tab.0.right" timestamp="1584956421111">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997167" />
<state width="1877" height="361" key="GridCell.Tab.1.bottom" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421111" />
<state width="1877" height="215" key="GridCell.Tab.1.bottom" timestamp="1584956421112">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.1.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.1.center" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.1.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421112" />
<state width="1877" height="215" key="GridCell.Tab.1.center" timestamp="1584956421111">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.1.center/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.1.left" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.1.center/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421111" />
<state width="1877" height="215" key="GridCell.Tab.1.left" timestamp="1584956421111">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.1.left/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.1.right" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.1.left/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421111" />
<state width="1877" height="215" key="GridCell.Tab.1.right" timestamp="1584956421112">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.1.right/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.2.bottom" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.1.right/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421112" />
<state width="1877" height="215" key="GridCell.Tab.2.bottom" timestamp="1584956421112">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.2.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.2.center" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.2.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421112" />
<state width="1877" height="215" key="GridCell.Tab.2.center" timestamp="1584956421112">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.2.center/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.2.left" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.2.center/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421112" />
<state width="1877" height="215" key="GridCell.Tab.2.left" timestamp="1584956421112">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.2.left/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="361" key="GridCell.Tab.2.right" timestamp="1584529997047">
<state width="1877" height="215" key="GridCell.Tab.2.left/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421112" />
<state width="1877" height="215" key="GridCell.Tab.2.right" timestamp="1584956421112">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="361" key="GridCell.Tab.2.right/0.0.1920.1040@0.0.1920.1040" timestamp="1584529997047" />
<state width="1877" height="215" key="GridCell.Tab.2.right/0.0.1920.1040@0.0.1920.1040" timestamp="1584956421112" />
<state x="490" y="175" key="Maven.ArtifactSearchDialog" timestamp="1583320014926">
<screen x="0" y="0" width="1920" height="1040" />
</state>
......@@ -534,10 +548,10 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="438" y="166" width="1352" height="708" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1583725437328" />
<state x="552" y="253" key="Vcs.Push.Dialog.v2" timestamp="1584449818854">
<state x="552" y="253" key="Vcs.Push.Dialog.v2" timestamp="1584530108501">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="552" y="253" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1584449818854" />
<state x="552" y="253" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1584530108501" />
<state x="752" y="437" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1583724603426">
<screen x="0" y="0" width="1920" height="1040" />
</state>
......@@ -554,10 +568,10 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="511" y="210" key="new project wizard/0.0.1920.1040@0.0.1920.1040" timestamp="1583318693876" />
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup" timestamp="1584518495568">
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup" timestamp="1584700567292">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1584518495568" />
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1584700567292" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
......
......@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mx.cneeds.server.entity.ProductSeriesEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
*
*
......@@ -13,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ProductSeriesDao extends BaseMapper<ProductSeriesEntity> {
List<ProductSeriesEntity> queryList(Map<String, Object> params);
}
......@@ -24,4 +24,9 @@ public interface SysUserDeptDao extends BaseMapper<SysUserDeptEntity> {
* 根据角色ID,获取部门ID列表
*/
List<Long> queryDeptIdList(Long userId);
/**
* 根据角色ID,获取部门ID列表
*/
List<Long> queryDeptId(Long userId);
}
package com.mx.cneeds.server.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -24,49 +25,66 @@ public class DeviceInfoEntity implements Serializable {
*/
@TableId
private Long deviceId;
/**
*
*/
private Long deptId;
/**
* imei
*/
private String imei;
/**
* iccid
*/
private String iccid;
/**
* 状态0未激活,1已激活
*/
private String status;
/**
* 设备版本
*/
private String deviceVersion;
/**
* 产品系列
*/
private Long seriesId;
/**
* 创建时间
*/
private Date createTime;
/**
* 激活时间
*/
private Date activeTime;
/**
* 渠道号
*/
private String channelNums;
/**
* 渠道号提示信息
*/
private String channelNumsMessage;
/**
* 0:黑名单,1:白名单
*/
private Integer channelRules;
/**
* 产品系列号
*/
@TableField( exist=false )
private String seriesNum;
}
......@@ -12,4 +12,12 @@
</resultMap>
<select id="queryList" resultType="com.mx.cneeds.server.entity.ProductSeriesEntity">
select t1.* from product_series t1 where
1 = 1
<if test="sql_filter != null">
and ${sql_filter}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -23,4 +23,9 @@
</select>
<select id="queryDeptId" resultType="long">
select dept_id from sys_user_dept where user_id = #{userId}
</select>
</mapper>
\ No newline at end of file
package com.mx.cneeds.common.dto;
import lombok.Data;
/**
* @ClassName DataFilterDto
* @Author zzrdark
* @Date 2020-03-20 18:18
* @Description TODO
**/
@Data
public class DataFilterDto {
/** 表的别名 */
private String tableAlias;
/** true:没有本部门数据权限,也能查询本人数据 */
private boolean user;
/** true:拥有子部门数据权限 */
private boolean subDept;
/** 部门ID */
private String deptId;
/** 用户ID */
private String userId;
private String username;
}
package com.mx.cneeds.common.dto;
import lombok.Data;
import java.util.List;
/**
* @ClassName DevicesVo
* @Author zzrdark
* @Date 2020-03-19 17:20
* @Description TODO
**/
@Data
public class DevicesDto {
/**
* 产品系列Id
*/
private Long seriesId;
/**
* 设备imeis
*/
private List<String> imeis;
/**
* 部门Id
*/
private Long deptId;
}
......@@ -23,6 +23,7 @@ public class DeviceChannelVo {
/**
* 名单规则
* 0:黑名单,1:白名单
*/
private Integer channelRules;
......
package com.mx.cneeds.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ClassName DevicesVo
* @Author zzrdark
* @Date 2020-03-19 17:20
* @Description TODO
**/
@Data
public class DevicesVo {
/**
* 产品系列Id
*/
private Long seriesId;
/**
* 设备ids
*/
private List<String> imeis;
/**
* 部门Id
*/
private Long deptId;
}
......@@ -33,5 +33,6 @@ public @interface DataFilter {
/** 用户ID */
String userId() default "user_id";
}
package com.mx.cneeds.server.anthorization.config;
import com.mx.cneeds.server.anthorization.service.MxJwtTokenEnhancer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
......@@ -12,10 +14,15 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.A
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
import org.springframework.security.oauth2.provider.token.TokenEnhancerChain;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import java.util.ArrayList;
import java.util.List;
@Configuration
@EnableAuthorizationServer
public class OAuth2AuthorizationServer extends AuthorizationServerConfigurerAdapter {
......@@ -33,11 +40,19 @@ public class OAuth2AuthorizationServer extends AuthorizationServerConfigurerAdap
@Autowired
private PasswordEncoder passwordEncoder;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.authenticationManager(authenticationManager);
endpoints.userDetailsService(myUserDetailsService);
endpoints.tokenStore(jwtTokenStore()).accessTokenConverter(jwtAccessTokenConverter());
//配置jwt
TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
List<TokenEnhancer> enhancerList = new ArrayList();
enhancerList.add(jwtTokenEnhancer());
enhancerList.add(jwtAccessTokenConverter());
tokenEnhancerChain.setTokenEnhancers(enhancerList);
endpoints.tokenStore(jwtTokenStore()).tokenEnhancer(tokenEnhancerChain).accessTokenConverter(jwtAccessTokenConverter());
}
/**
......@@ -57,6 +72,16 @@ public class OAuth2AuthorizationServer extends AuthorizationServerConfigurerAdap
return converter;
}
/**
* 用于扩展JWT
* @return
*/
@Bean
@ConditionalOnMissingBean(name = "jwtTokenEnhancer")
public TokenEnhancer jwtTokenEnhancer(){
return new MxJwtTokenEnhancer();
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.inMemory()
......@@ -77,4 +102,5 @@ public class OAuth2AuthorizationServer extends AuthorizationServerConfigurerAdap
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
security.passwordEncoder(new BCryptPasswordEncoder());
}
}
\ No newline at end of file
package com.mx.cneeds.server.anthorization.service;
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
import java.util.HashMap;
import java.util.Map;
public class MxJwtTokenEnhancer implements TokenEnhancer {
@Override
public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
Map<String, Object> info = new HashMap<>();
info.put("company", "美行科技");
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(info);
return accessToken;
}
}
\ No newline at end of file
package com.mx.cneeds.server.datashow.client;
import com.mx.cneeds.common.dto.DevicesDto;
import com.mx.cneeds.common.dto.PageDto;
import com.mx.cneeds.common.dto.SeriesDto;
import org.springframework.cloud.openfeign.FeignClient;
......@@ -24,6 +25,9 @@ public interface DeviceClient {
@RequestParam("sidx") String orderField,
@RequestParam("order") String order);
@PostMapping("/device/series/listAll")
List<SeriesDto> seriesListAll();
@PostMapping("/device/series/save")
void addSeries(@RequestBody SeriesDto dto);
......@@ -33,4 +37,21 @@ public interface DeviceClient {
@PostMapping("/device/series/delete")
void deleteSeries(@RequestBody List<Long> ids);
@PostMapping("device/info/list")
PageDto deviceList(@RequestParam Integer page,
@RequestParam("limit") Integer pageSize,
@RequestParam("sidx") String orderField,
@RequestParam("order") String order);
@PostMapping("/device/info/importDevice")
void importDevice(@RequestBody DevicesDto dto);
@PostMapping("/device/info/updateDeviceSeriesBatch")
void updateDeviceSeriesBatch(@RequestBody DevicesDto dto);
@PostMapping("/device/info/delete")
void deleteDevice(@RequestBody List<Long> ids);
}
package com.mx.cneeds.server.datashow.web.device;
import com.mx.cneeds.common.converter.RequestParamterConverter;
import com.mx.cneeds.common.dto.DepartmentDto;
import com.mx.cneeds.common.dto.PageDto;
import com.mx.cneeds.common.dto.SeriesDto;
import com.mx.cneeds.common.dto.*;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.vo.DeviceChannelVo;
import com.mx.cneeds.common.vo.DevicesVo;
import com.mx.cneeds.common.vo.SeriesVo;
import com.mx.cneeds.server.datashow.client.DeviceClient;
import lombok.extern.slf4j.Slf4j;
......@@ -40,6 +39,17 @@ public class DeviceController {
return new R().put("data",channelVo);
}
@PostMapping("/saveChannel")
public R saveChannel_nums(DeviceChannelVo channelVo){
DevicesDto devicesDto = new DevicesDto();
BeanUtils.copyProperties(channelVo,devicesDto);
deviceClient.updateDeviceSeriesBatch(devicesDto);
return new R().put("data",channelVo);
}
@PostMapping("/series/list")
public R seriesList(@RequestParam(required = false) Integer page,
......@@ -73,6 +83,13 @@ public class DeviceController {
return new R().put("data",pageDto);
}
@PostMapping("/series/listAll")
public R selectSeries(){
List<SeriesDto> seriesDtos = deviceClient.seriesListAll();
return new R().put("data",seriesDtos);
}
@PostMapping("/series/add")
public R addSeries(SeriesVo seriesVo){
SeriesDto seriesDto = new SeriesDto();
......@@ -102,7 +119,62 @@ public class DeviceController {
}
@PostMapping("/device/list")
public R deviceList(@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String sort){
String orderField = null;
String order = null;
if (page==null || page==0){
page = new Integer(1);
}
if (pageSize==null || pageSize==0){
pageSize = new Integer(10);
}
if (StringUtils.isNotEmpty(sort) && StringUtils.isNotBlank(sort.trim())){
if (sort.contains("+")){
order = new String("asc");
}
if (sort.contains("-")){
order = new String("desc");
}
orderField = sort.substring(1);
orderField = RequestParamterConverter.toLine(orderField);
}
PageDto pageDto = deviceClient.deviceList(page,pageSize,orderField,order);
return new R().put("data",pageDto);
}
@PostMapping("/device/importDevice")
public R importDevice(DevicesVo devicesVo){
DevicesDto devicesDto = new DevicesDto();
BeanUtils.copyProperties(devicesVo,devicesDto);
deviceClient.importDevice(devicesDto);
return R.ok();
}
@PostMapping("/device/updateDeviceSeriesBatch")
public R updateDeviceSeriesBatch(DevicesVo devicesVo){
DevicesDto devicesDto = new DevicesDto();
BeanUtils.copyProperties(devicesVo,devicesDto);
deviceClient.updateDeviceSeriesBatch(devicesDto);
return R.ok();
}
@PostMapping("/device/delete")
public R deleteDevice(@RequestParam(value = "ids",required = false) List<Long> ids){
deviceClient.deleteDevice(ids);
return R.ok();
}
}
......@@ -6,6 +6,7 @@ import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* @ClassName DeviceApplication
......@@ -16,6 +17,7 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
@MapperScan("com.mx.cneeds.server.dao")
@EnableFeignClients
public class DeviceApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(DeviceApplication.class).web(WebApplicationType.SERVLET).run(args);
......
package com.mx.cneeds.server.device.client;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.dto.DataFilterDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = "CNEEDS-SERVER-USER")
public interface UserClient {
@PostMapping("sys/user/genDataFilter")
String genDataFilter(@RequestBody DataFilterDto dataFilterDto);
}
\ No newline at end of file
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.mx.cneeds.server.device.common;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.dto.DataFilterDto;
import com.mx.cneeds.common.exception.RRException;
import com.mx.cneeds.common.pager.Constant;
import com.mx.cneeds.server.device.client.UserClient;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 数据过滤,切面处理类
*
* @author Mark sunlightcs@gmail.com
*/
@Aspect
@Component
public class DataFilterAspect {
@Autowired
private UserClient userClient;
@Pointcut("@annotation(com.mx.cneeds.common.annotation.DataFilter)")
public void dataFilterCut() {
}
@Before("dataFilterCut()")
public void dataFilter(JoinPoint point){
Object params = point.getArgs()[0];
if(params != null && params instanceof Map){
String username = (String) ((Map) params).get("login_username");
//如果不是超级管理员,则进行数据过滤
if(!Constant.STRING_SUPER_ADMIN.equals(username)){
Map map = (Map)params;
map.put(Constant.SQL_FILTER, getSQLFilter(username, point));
}
return ;
}
throw new RRException("数据权限接口,只能是Map类型参数,且不能为NULL");
}
/**
* 获取数据过滤的SQL
*/
private String getSQLFilter(String username, JoinPoint point){
MethodSignature signature = (MethodSignature) point.getSignature();
DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class);
DataFilterDto dataFilterDto = new DataFilterDto();
dataFilterDto.setDeptId(dataFilter.deptId());
dataFilterDto.setUserId(dataFilter.userId());
dataFilterDto.setUser(dataFilter.user());
dataFilterDto.setSubDept(dataFilter.subDept());
dataFilterDto.setTableAlias(dataFilter.tableAlias());
dataFilterDto.setUsername(username);
String sqlFilter = userClient.genDataFilter(dataFilterDto);
return sqlFilter;
}
}
package com.mx.cneeds.server.device.config;
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisPlusConfig {
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
@Bean
public ISqlInjector sqlInjector() {
return new LogicSqlInjector();
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.server.entity.DeviceInfoEntity;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +17,7 @@ import java.util.Map;
public interface DeviceInfoService extends IService<DeviceInfoEntity> {
PageUtils queryPage(Map<String, Object> params);
void updateBatchByImei(List<DeviceInfoEntity> deviceInfoEntityList);
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.server.entity.ProductSeriesEntity;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +18,9 @@ import java.util.Map;
public interface ProductSeriesService extends IService<ProductSeriesEntity> {
PageUtils queryPage(Map<String, Object> params);
List<ProductSeriesEntity> queryListById(Collection<Long> array);
List<ProductSeriesEntity> queryList(Map<String, Object> params);
}
......@@ -4,9 +4,17 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceInfoDao;
import com.mx.cneeds.server.device.service.DeviceInfoService;
import com.mx.cneeds.server.device.service.ProductSeriesService;
import com.mx.cneeds.server.entity.DeviceInfoEntity;
import com.mx.cneeds.server.entity.ProductSeriesEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -15,6 +23,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service("deviceInfoService")
public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoDao, DeviceInfoEntity> implements DeviceInfoService {
@Autowired
private ProductSeriesService productSeriesService;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<DeviceInfoEntity> page = this.page(
......@@ -22,7 +33,31 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoDao, DeviceInfo
new QueryWrapper<DeviceInfoEntity>()
);
Set<Long> set = new HashSet<>();
page.getRecords().forEach(deviceInfoEntity -> {
set.add(deviceInfoEntity.getSeriesId());
});
if (set.size() != 0){
List<ProductSeriesEntity> seriesEntityList = productSeriesService.queryListById(set);
page.getRecords().forEach(deviceInfoEntity -> {
seriesEntityList.forEach(seriesEntity -> {
if (deviceInfoEntity.getSeriesId().equals(seriesEntity.getSeriesId())){
deviceInfoEntity.setSeriesNum(seriesEntity.getSeriesNum());
}
});
});
}
return new PageUtils(page);
}
@Override
public void updateBatchByImei(List<DeviceInfoEntity> deviceInfoEntityList) {
deviceInfoEntityList.forEach(deviceInfoEntity -> {
getBaseMapper().update(deviceInfoEntity,new QueryWrapper<DeviceInfoEntity>().eq("imei",deviceInfoEntity.getImei()));
});
}
}
package com.mx.cneeds.server.device.service.impl;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.ProductSeriesDao;
import com.mx.cneeds.server.device.service.ProductSeriesService;
import com.mx.cneeds.server.entity.ProductSeriesEntity;
import com.mx.cneeds.server.entity.SysRoleEntity;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -25,4 +30,16 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesDao, Prod
return new PageUtils(page);
}
@Override
public List<ProductSeriesEntity> queryListById(Collection<Long> array){
List<ProductSeriesEntity> productSeriesEntityList = getBaseMapper().selectBatchIds(array);
return productSeriesEntityList;
}
@Override
public List<ProductSeriesEntity> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.mx.cneeds.server.device.web;
import java.util.Arrays;
import java.util.Map;
import java.util.*;
import com.mx.cneeds.common.dto.DevicesDto;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
......@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-03-18 14:44:30
*/
@RestController
@RequestMapping("sys/deviceinfo")
@RequestMapping("device/info")
public class DeviceInfoController {
@Autowired
private DeviceInfoService deviceInfoService;
......@@ -34,10 +34,10 @@ public class DeviceInfoController {
* 列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
public PageUtils list(@RequestParam Map<String, Object> params){
PageUtils page = deviceInfoService.queryPage(params);
return R.ok().put("page", page);
return page;
}
......@@ -82,4 +82,44 @@ public class DeviceInfoController {
return R.ok();
}
/**
* 保存
*/
@RequestMapping("/importDevice")
public R importDevice(@RequestBody DevicesDto devicesDto){
List<DeviceInfoEntity> deviceInfoEntityList = new LinkedList<>();
if (devicesDto.getImeis() != null && devicesDto.getImeis().size() != 0) {
devicesDto.getImeis().forEach(str -> {
DeviceInfoEntity deviceInfoEntity = new DeviceInfoEntity();
deviceInfoEntity.setImei(str);
deviceInfoEntity.setSeriesId(devicesDto.getSeriesId());
deviceInfoEntity.setDeptId(devicesDto.getDeptId());
deviceInfoEntity.setCreateTime(new Date());
deviceInfoEntityList.add(deviceInfoEntity);
});
}
deviceInfoService.saveBatch(deviceInfoEntityList);
return R.ok();
}
/**
* 保存
*/
@RequestMapping("/updateDeviceSeriesBatch")
public R updateDeviceSeriesBatch(@RequestBody DevicesDto devicesDto){
List<DeviceInfoEntity> deviceInfoEntityList = new LinkedList<>();
if (devicesDto.getImeis() != null && devicesDto.getImeis().size() != 0) {
devicesDto.getImeis().forEach(str -> {
DeviceInfoEntity deviceInfoEntity = new DeviceInfoEntity();
deviceInfoEntity.setImei(str);
deviceInfoEntity.setSeriesId(devicesDto.getSeriesId());
deviceInfoEntity.setDeptId(devicesDto.getDeptId());
deviceInfoEntityList.add(deviceInfoEntity);
});
}
deviceInfoService.updateBatchByImei(deviceInfoEntityList);
return R.ok();
}
}
......@@ -48,6 +48,20 @@ public class ProductSeriesController {
}
return page;
}
@RequestMapping("listAll")
public List<SeriesDto> listAll(Map<String, Object> params){
List<ProductSeriesEntity> productSeriesEntities = productSeriesService.queryList(params);
List<SeriesDto> list = new ArrayList<SeriesDto>();
for (Object entity : productSeriesEntities){
SeriesDto dto = new SeriesDto();
ProductSeriesEntity seriesEntity = (ProductSeriesEntity) entity;
BeanUtils.copyProperties(seriesEntity,dto);
list.add(dto);
}
return list;
}
/**
......
......@@ -11,13 +11,11 @@ package com.mx.cneeds.server.user.common;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.dto.DataFilterDto;
import com.mx.cneeds.common.exception.RRException;
import com.mx.cneeds.common.pager.Constant;
import com.mx.cneeds.server.entity.SysUserEntity;
import com.mx.cneeds.server.user.service.SysDeptService;
import com.mx.cneeds.server.user.service.SysRoleDeptService;
import com.mx.cneeds.server.user.service.SysUserRoleService;
import com.mx.cneeds.server.user.service.SysUserService;
import com.mx.cneeds.server.user.service.*;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
......@@ -43,12 +41,6 @@ public class DataFilterAspect {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysDeptService sysDeptService;
@Autowired
private SysUserRoleService sysUserRoleService;
@Autowired
private SysRoleDeptService sysRoleDeptService;
@Pointcut("@annotation(com.mx.cneeds.common.annotation.DataFilter)")
public void dataFilterCut() {
......@@ -77,51 +69,21 @@ public class DataFilterAspect {
private String getSQLFilter(String username, JoinPoint point){
MethodSignature signature = (MethodSignature) point.getSignature();
DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class);
//获取表的别名
String tableAlias = dataFilter.tableAlias();
if(StringUtils.isNotBlank(tableAlias)){
tableAlias += ".";
}
//部门ID列表
Set<Long> deptIdList = new HashSet<>();
DataFilterDto dataFilterDto = new DataFilterDto();
SysUserEntity sysUserEntity = sysUserService.queryUserByUsername(username);
//用户角色对应的部门ID列表
Long roleId = sysUserRoleService.queryRoleId(sysUserEntity.getUserId());
if(roleId != null){
List<Long> userDeptIdList = sysRoleDeptService.queryDeptId(roleId);
deptIdList.addAll(userDeptIdList);
}
//用户子部门ID列表
if(dataFilter.subDept()){
List<Long> subDeptIdList = sysDeptService.getSubDeptIdList(sysUserEntity.getUserId());
deptIdList.addAll(subDeptIdList);
}
dataFilterDto.setDeptId(dataFilter.deptId());
dataFilterDto.setUserId(dataFilter.userId());
dataFilterDto.setUser(dataFilter.user());
dataFilterDto.setSubDept(dataFilter.subDept());
dataFilterDto.setTableAlias(dataFilter.tableAlias());
dataFilterDto.setUsername(username);
StringBuilder sqlFilter = new StringBuilder();
sqlFilter.append(" (");
String sqlFilter = sysUserService.genDataFilter(dataFilterDto);
if(deptIdList.size() > 0){
sqlFilter.append(tableAlias).append(dataFilter.deptId()).append(" in(").append(StringUtils.join(deptIdList, ",")).append(")");
}
//没有本部门数据权限,也能查询本人数据
if(dataFilter.user()){
if(deptIdList.size() > 0){
sqlFilter.append(" or ");
}
sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(sysUserEntity.getUserId());
}
return sqlFilter;
}
sqlFilter.append(")");
if(sqlFilter.toString().trim().equals("()")){
return null;
}
return sqlFilter.toString();
}
}
......@@ -20,7 +20,6 @@ public interface SysRoleService extends IService<SysRoleEntity> {
PageUtils queryPage(Map<String, Object> params);
@DataFilter(subDept = true, user = false, tableAlias = "t1")
List<SysRoleEntity> queryList(Map<String, Object> params);
void saveRole(SysRoleEntity role, List<Long> funcIdList, List<Long> deptIdList);
......
......@@ -24,5 +24,7 @@ public interface SysUserDeptService extends IService<SysUserDeptEntity> {
void saveOrUpdate(Long userId, List<Long> deptIdList);
List<Long> queryDeptIdList(Long userId);
List<Long> queryDeptId(Long userId);
}
package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.dto.DataFilterDto;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.server.entity.SysUserEntity;
import org.springframework.transaction.annotation.Transactional;
......@@ -26,5 +28,7 @@ public interface SysUserService extends IService<SysUserEntity> {
void saveUser(SysUserEntity user, List<Long> funcIdList, List<Long> deptIdList, Long roleId);
void update(SysUserEntity user, List<Long> funcIdList, List<Long> deptIdList);
String genDataFilter(DataFilterDto dataFilterDto);
}
......@@ -60,4 +60,8 @@ public class SysUserDeptServiceImpl extends ServiceImpl<SysUserDeptDao, SysUserD
return baseMapper.queryDeptIdList(userId);
}
@Override
public List<Long> queryDeptId(Long userId) {
return baseMapper.queryDeptId(userId);
}
}
package com.mx.cneeds.server.user.service.impl;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.dto.DataFilterDto;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysUserDao;
import com.mx.cneeds.server.entity.SysUserEntity;
import com.mx.cneeds.server.user.service.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -30,6 +31,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
@Autowired
private SysUserRoleService sysUserRoleService;
@Autowired
private SysDeptService sysDeptService;
@Autowired
private SysRoleDeptService sysRoleDeptService;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<SysUserEntity> page = this.page(
......@@ -91,4 +99,58 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
sysUserDeptService.saveOrUpdate(user.getUserId(), deptIdList);
}
@Override
public String genDataFilter(DataFilterDto dataFilterDto) {
//获取表的别名
String tableAlias = dataFilterDto.getTableAlias();
if(StringUtils.isNotBlank(tableAlias)){
tableAlias += ".";
}
StringBuilder sqlFilter = new StringBuilder();
sqlFilter.append(" (");
//部门ID列表
Set<Long> deptIdList = new HashSet<>();
SysUserEntity sysUserEntity = queryUserByUsername(dataFilterDto.getUsername());
//用户角色对应的部门ID列表
Long roleId = sysUserRoleService.queryRoleId(sysUserEntity.getUserId());
// 查询用户关联的部门权限表
List<Long> userDeptIdList = sysUserDeptService.queryDeptId(sysUserEntity.getUserId());
deptIdList.addAll(userDeptIdList);
if(roleId != null){
List<Long> roleDeptIdList = sysRoleDeptService.queryDeptId(roleId);
deptIdList.addAll(roleDeptIdList);
}
//用户子部门ID列表
if(dataFilterDto.isSubDept()){
List<Long> subDeptIdList = sysDeptService.getSubDeptIdList(sysUserEntity.getUserId());
deptIdList.addAll(subDeptIdList);
}
if(deptIdList.size() > 0){
sqlFilter.append(tableAlias).append(dataFilterDto.getDeptId()).append(" in(").append(StringUtils.join(deptIdList, ",")).append(")");
}
//没有本部门数据权限,也能查询本人数据
if(dataFilterDto.isUser()){
if(deptIdList.size() > 0){
sqlFilter.append(" or ");
}
sqlFilter.append(tableAlias).append(dataFilterDto.getUserId()).append("=").append(sysUserEntity.getUserId());
}
sqlFilter.append(")");
if(sqlFilter.toString().trim().equals("()")){
return null;
}
return sqlFilter.toString();
}
}
package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.dto.DataFilterDto;
import com.mx.cneeds.common.dto.UserDto;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
......@@ -116,4 +118,15 @@ public class SysUserController {
return R.ok();
}
/**
* TODO 暂时通过这里去实现
* @param dataFilterDto
* @return
*/
@RequestMapping("/genDataFilter")
public String genDataFilter(@RequestBody DataFilterDto dataFilterDto){
return sysUserService.genDataFilter(dataFilterDto);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment