From c684606410d2d3a9210b9d33d5875cb63c51fb35 Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Wed, 13 Nov 2024 09:31:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(management):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E4=BC=81=E4=BA=8B=E4=B8=9A=E5=8D=95=E4=BD=8D=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 PoliceEnterprisesUnitPager 相关代码 - 为 EnterprisesUnit 添加创建人信息 - 优化 EnterprisesUnit 分页查询逻辑 - 更新相关控制器和服务实现 -调整枚举类型和注解 --- .../common/annotation/CheckUserType.java | 1 + .../changhu/common/annotation/UserType.java | 22 ---- .../common/db/enums/EnterprisesUnitType.java | 52 +++++--- .../com/changhu/common/db/enums/UserType.java | 24 ++++ .../common/pojo/vo/CreateOrUpdateUser.java | 20 +++ .../com/changhu/common/utils/UserUtil.java | 2 +- .../handler/ManagementPoliceUnitLogin.java | 2 +- .../handler/ManagementSecurityUnitLogin.java | 2 +- .../enums/handler/ManagementSuperLogin.java | 2 +- .../enums/handler/MiniProgramUserLogin.java | 2 +- .../AssessmentCriteriaController.java | 2 +- .../controller/EnterprisesUnitController.java | 7 +- .../controller/ManagementController.java | 2 +- .../controller/PoliceController.java | 9 +- .../controller/SecurityController.java | 2 +- .../controller/ServiceProjectController.java | 2 +- .../controller/SuperController.java | 2 +- .../mapper/EnterprisesUnitMapper.java | 12 +- .../EnterprisesUnitSaveOrUpdateParams.java | 1 - .../EnterprisesUnitPagerQueryParams.java | 9 +- ...PoliceEnterprisesUnitPagerQueryParams.java | 19 --- .../pojo/vo/EnterprisesUnitPagerVo.java | 5 +- .../pojo/vo/PoliceEnterprisesUnitPagerVo.java | 46 ------- .../management/service/PoliceService.java | 9 -- .../impl/EnterprisesUnitServiceImpl.java | 13 +- .../service/impl/ManagementServiceImpl.java | 2 +- .../service/impl/PoliceServiceImpl.java | 6 - .../service/impl/SecurityServiceImpl.java | 2 +- .../controller/PoliceIndexController.java | 2 +- .../ProjectManageIndexController.java | 3 +- .../interceptor/UserTypeInterceptor.java | 2 +- .../mapper/EnterprisesUnitMapper.xml | 56 ++++----- .../src/components/aMap/MapContainer.vue | 11 +- .../src/components/iconfont/IconFont.vue | 6 - .../src/components/table/TableProMax.vue | 2 + superManagement/src/global.d.ts | 3 +- .../src/types/components/map/index.ts | 44 +++++++ .../src/types/views/data/dataOverview.ts | 28 +++++ superManagement/src/utils/aMapUtil.ts | 8 +- .../EnterprisesUnitInfoWindowContent.vue | 68 ++++++++++ .../src/views/data/dataOverview.vue | 49 ++++++-- .../unitManage/police/unitManage/index.tsx | 116 ++++++++++++------ .../unitManage/police/unitManage/index.vue | 1 - superManagement/vite.config.ts | 5 + 44 files changed, 420 insertions(+), 263 deletions(-) delete mode 100644 policeSecurityServer/src/main/java/com/changhu/common/annotation/UserType.java create mode 100644 policeSecurityServer/src/main/java/com/changhu/common/db/enums/UserType.java create mode 100644 policeSecurityServer/src/main/java/com/changhu/common/pojo/vo/CreateOrUpdateUser.java delete mode 100644 policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/PoliceEnterprisesUnitPagerQueryParams.java delete mode 100644 policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/PoliceEnterprisesUnitPagerVo.java create mode 100644 superManagement/src/types/components/map/index.ts create mode 100644 superManagement/src/types/views/data/dataOverview.ts create mode 100644 superManagement/src/views/data/components/EnterprisesUnitInfoWindowContent.vue diff --git a/policeSecurityServer/src/main/java/com/changhu/common/annotation/CheckUserType.java b/policeSecurityServer/src/main/java/com/changhu/common/annotation/CheckUserType.java index ccac842..0af45e3 100644 --- a/policeSecurityServer/src/main/java/com/changhu/common/annotation/CheckUserType.java +++ b/policeSecurityServer/src/main/java/com/changhu/common/annotation/CheckUserType.java @@ -1,5 +1,6 @@ package com.changhu.common.annotation; +import com.changhu.common.db.enums.UserType; import org.springframework.web.bind.annotation.RestController; import java.lang.annotation.*; diff --git a/policeSecurityServer/src/main/java/com/changhu/common/annotation/UserType.java b/policeSecurityServer/src/main/java/com/changhu/common/annotation/UserType.java deleted file mode 100644 index b63153c..0000000 --- a/policeSecurityServer/src/main/java/com/changhu/common/annotation/UserType.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.changhu.common.annotation; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author 20252 - * @createTime 2024/9/6 上午11:13 - * @desc UserType... - */ -@AllArgsConstructor -@Getter -public enum UserType { - MANAGEMENT_POLICE("公安后台用户"), - MANAGEMENT_SECURITY("保安后台用户"), - MANAGEMENT_SUPER("超级后台用户"), - - MINI_PROGRAM_POLICE("小程序公安用户"), - MINI_PROGRAM_PROJECT_MANAGE("小程序项目经理"); - - private final String remark; -} diff --git a/policeSecurityServer/src/main/java/com/changhu/common/db/enums/EnterprisesUnitType.java b/policeSecurityServer/src/main/java/com/changhu/common/db/enums/EnterprisesUnitType.java index 3e03b53..e6425e7 100644 --- a/policeSecurityServer/src/main/java/com/changhu/common/db/enums/EnterprisesUnitType.java +++ b/policeSecurityServer/src/main/java/com/changhu/common/db/enums/EnterprisesUnitType.java @@ -1,6 +1,8 @@ package com.changhu.common.db.enums; +import cn.hutool.core.lang.Dict; import com.baomidou.mybatisplus.annotation.IEnum; +import com.changhu.common.annotation.IsExtData; import com.changhu.common.db.BaseEnum; import lombok.AllArgsConstructor; import lombok.Getter; @@ -17,28 +19,38 @@ import java.util.stream.Collectors; @AllArgsConstructor public enum EnterprisesUnitType implements BaseEnum, IEnum { - party_government("party_government", "党政机关"), - medical("medical", "医疗机构"), - residential("residential", "小区"), - higher_learning("higher_learning", "高等院校"), - primary_and_secondary("primary_and_secondary", "中小学幼儿园"), - shopping_supermarkets("shopping_supermarkets", "商场超市"), - financial("financial", "金融机构"), - hydropower("hydropower", "水电油气"), - key_projects("key_projects", "重点工程建设单位"), - delivery_logistics("delivery_logistics", "寄递物流"), - military("military", "军工、科研单位"), - wen_bo("wen_bo", "文博单位"), - important_news("important_news ", "重要新闻单位"), - large_scale_material("large_scale_material ", "大型物资储备"), - transportation("transportation", "交通运输企业"), - industrial_park("industrial_park", "工业园区企业"), - complex_public_security("complex_public_security", "治安复杂场所"), - making_explosive_easily("making_explosive_easily ", "易制爆"), - hazardous_materials("hazardous_materials ", "危化物品存放场所"), - other("other", "其他单位"); + party_government("party_government", "党政机关", "party_government.png"), + medical("medical", "医疗机构", "medical.png"), + residential("residential", "小区", "residential.png"), + higher_learning("higher_learning", "高等院校", "higher_learning.png"), + primary_and_secondary("primary_and_secondary", "中小学幼儿园", "primary_and_secondary.png"), + shopping_supermarkets("shopping_supermarkets", "商场超市", "shopping_supermarkets.png"), + financial("financial", "金融机构", "financial.png"), + hydropower("hydropower", "水电油气", "hydropower.png"), + key_projects("key_projects", "重点工程建设单位", "key_projects.png"), + delivery_logistics("delivery_logistics", "寄递物流", "delivery_logistics.png"), + military("military", "军工、科研单位", "military.png"), + wen_bo("wen_bo", "文博单位", "wen_bo.png"), + important_news("important_news ", "重要新闻单位", "important_news.png"), + large_scale_material("large_scale_material ", "大型物资储备", "large_scale_material.png"), + transportation("transportation", "交通运输企业", "transportation.png"), + industrial_park("industrial_park", "工业园区企业", "industrial_park.png"), + complex_public_security("complex_public_security", "治安复杂场所", "complex_public_security.png"), + making_explosive_easily("making_explosive_easily ", "易制爆", "making_explosive_easily.png"), + hazardous_materials("hazardous_materials ", "危化物品存放场所", "hazardous_materials.png"), + other("other", "其他单位", "other.png"); private final String value; private final String label; + @IsExtData + private final String icon; + @Override + public Object serializer() { + return Dict.of( + "value", this.getValue(), + "label", this.getLabel(), + "extData", Dict.of("icon", "/resources/icon/gaode/marker/" + this.icon) + ); + } } diff --git a/policeSecurityServer/src/main/java/com/changhu/common/db/enums/UserType.java b/policeSecurityServer/src/main/java/com/changhu/common/db/enums/UserType.java new file mode 100644 index 0000000..5a8d11e --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/common/db/enums/UserType.java @@ -0,0 +1,24 @@ +package com.changhu.common.db.enums; + +import com.changhu.common.db.BaseEnum; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author 20252 + * @createTime 2024/9/6 上午11:13 + * @desc UserType... + */ +@AllArgsConstructor +@Getter +public enum UserType implements BaseEnum { + MANAGEMENT_POLICE("management_police", "公安后台用户"), + MANAGEMENT_SECURITY("management_security", "保安后台用户"), + MANAGEMENT_SUPER("management_super", "超级后台用户"), + + MINI_PROGRAM_POLICE("mini_program_police", "小程序公安用户"), + MINI_PROGRAM_PROJECT_MANAGE("mini_program_project_manage", "小程序项目经理"); + + private final String value; + private final String label; +} diff --git a/policeSecurityServer/src/main/java/com/changhu/common/pojo/vo/CreateOrUpdateUser.java b/policeSecurityServer/src/main/java/com/changhu/common/pojo/vo/CreateOrUpdateUser.java new file mode 100644 index 0000000..e6dd8fe --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/common/pojo/vo/CreateOrUpdateUser.java @@ -0,0 +1,20 @@ +package com.changhu.common.pojo.vo; + +import com.changhu.common.db.enums.UserType; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 20252 + * @createTime 2024/11/12 下午3:27 + * @desc 通过视图去找出数据创建人 + */ +@Data +public class CreateOrUpdateUser { + @Schema(description = "用户id") + private Long snowFlakeId; + @Schema(description = "用户名字") + private String name; + @Schema(description = "用户类型") + private UserType type; +} diff --git a/policeSecurityServer/src/main/java/com/changhu/common/utils/UserUtil.java b/policeSecurityServer/src/main/java/com/changhu/common/utils/UserUtil.java index ef4b3cd..7cca7ec 100644 --- a/policeSecurityServer/src/main/java/com/changhu/common/utils/UserUtil.java +++ b/policeSecurityServer/src/main/java/com/changhu/common/utils/UserUtil.java @@ -6,7 +6,7 @@ import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.enums.ResultCode; import com.changhu.common.exception.MessageException; import lombok.extern.slf4j.Slf4j; diff --git a/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementPoliceUnitLogin.java b/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementPoliceUnitLogin.java index fe6eaf7..74b9897 100644 --- a/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementPoliceUnitLogin.java +++ b/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementPoliceUnitLogin.java @@ -3,7 +3,7 @@ package com.changhu.enums.handler; import cn.dev33.satoken.stp.SaTokenInfo; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.extension.toolkit.Db; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.db.enums.IsEnable; import com.changhu.common.enums.ResultCode; import com.changhu.common.exception.MessageException; diff --git a/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSecurityUnitLogin.java b/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSecurityUnitLogin.java index 7205ccb..f185b4d 100644 --- a/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSecurityUnitLogin.java +++ b/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSecurityUnitLogin.java @@ -3,7 +3,7 @@ package com.changhu.enums.handler; import cn.dev33.satoken.stp.SaTokenInfo; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.extension.toolkit.Db; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.db.enums.IsEnable; import com.changhu.common.enums.ResultCode; import com.changhu.common.exception.MessageException; diff --git a/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSuperLogin.java b/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSuperLogin.java index 6b1ad39..a1acfd7 100644 --- a/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSuperLogin.java +++ b/policeSecurityServer/src/main/java/com/changhu/enums/handler/ManagementSuperLogin.java @@ -3,7 +3,7 @@ package com.changhu.enums.handler; import cn.dev33.satoken.stp.SaTokenInfo; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.extension.toolkit.Db; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.enums.ResultCode; import com.changhu.common.exception.MessageException; import com.changhu.common.pojo.vo.TokenInfo; diff --git a/policeSecurityServer/src/main/java/com/changhu/enums/handler/MiniProgramUserLogin.java b/policeSecurityServer/src/main/java/com/changhu/enums/handler/MiniProgramUserLogin.java index 2892af0..909bd6e 100644 --- a/policeSecurityServer/src/main/java/com/changhu/enums/handler/MiniProgramUserLogin.java +++ b/policeSecurityServer/src/main/java/com/changhu/enums/handler/MiniProgramUserLogin.java @@ -8,7 +8,7 @@ import cn.hutool.core.lang.func.LambdaUtil; import cn.hutool.extra.spring.SpringUtil; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.extension.toolkit.Db; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.db.enums.CheckStatus; import com.changhu.common.db.enums.IsEnable; import com.changhu.common.enums.ResultCode; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentCriteriaController.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentCriteriaController.java index 8024a93..df4f2bc 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentCriteriaController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentCriteriaController.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.toolkit.Db; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.db.enums.EnterprisesUnitType; import com.changhu.common.exception.MessageException; import com.changhu.common.pojo.vo.SelectNodeVo; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/EnterprisesUnitController.java b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/EnterprisesUnitController.java index 5bdf01e..54ea62d 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/EnterprisesUnitController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/EnterprisesUnitController.java @@ -1,7 +1,9 @@ package com.changhu.module.management.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; +import com.changhu.common.db.enums.UserType; import com.changhu.common.exception.MessageException; import com.changhu.common.pojo.vo.SelectNodeVo; import com.changhu.module.management.pojo.entity.EnterprisesUnit; @@ -34,18 +36,21 @@ public class EnterprisesUnitController { @Operation(summary = "分页查询") @PostMapping("/pager") - public Page pager(@RequestBody @Valid PageParams queryParams) { + @CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SUPER}) + public Page pager(@RequestBody PageParams queryParams) { return enterprisesUnitService.pager(queryParams); } @Operation(summary = "新增或保存") @PostMapping("/saveOrUpdate") + @CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SUPER}) public void saveOrUpdate(@RequestBody @Valid EnterprisesUnitSaveOrUpdateParams params) { enterprisesUnitService.saveOrUpdate(params); } @Operation(summary = "根据id删除") @DeleteMapping("/deleteById") + @CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SUPER}) public void deleteById(@RequestParam @Schema(description = "企事业单位id") Long enterprisesUnitId) { boolean b = enterprisesUnitService.removeById(enterprisesUnitId); if (!b) { diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ManagementController.java b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ManagementController.java index 2c66c49..c04c24b 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ManagementController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ManagementController.java @@ -3,7 +3,7 @@ package com.changhu.module.management.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.module.management.pojo.params.IndexCheckPassParams; import com.changhu.module.management.pojo.params.IndexCheckStatusParams; import com.changhu.module.management.pojo.params.IndexDisableOrEnableParams; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/PoliceController.java b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/PoliceController.java index dcf3512..578b327 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/PoliceController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/PoliceController.java @@ -3,12 +3,10 @@ package com.changhu.module.management.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.module.management.pojo.params.ManagementPoliceUserSaveOrUpdateParams; import com.changhu.module.management.pojo.queryParams.ManagementPoliceUnitUserPagerQueryParams; -import com.changhu.module.management.pojo.queryParams.PoliceEnterprisesUnitPagerQueryParams; import com.changhu.module.management.pojo.vo.ManagementPoliceUnitUserPagerVo; -import com.changhu.module.management.pojo.vo.PoliceEnterprisesUnitPagerVo; import com.changhu.module.management.service.PoliceService; import com.changhu.support.mybatisplus.pojo.params.PageParams; import io.swagger.v3.oas.annotations.Operation; @@ -50,9 +48,4 @@ public class PoliceController { policeService.userDeleteById(managementPoliceUnitUserId); } - @Operation(summary = "公安单位下的企事业单位分页") - @PostMapping("/enterprisesUnitPager") - public Page enterprisesUnitPager(@RequestBody PageParams queryParams) { - return policeService.enterprisesUnitPager(queryParams); - } } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SecurityController.java b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SecurityController.java index 3daec7d..9b8470f 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SecurityController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SecurityController.java @@ -3,7 +3,7 @@ package com.changhu.module.management.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.pojo.vo.SelectNodeVo; import com.changhu.module.management.pojo.params.ManagementSecurityUnitUserSaveOrUpdateParams; import com.changhu.module.management.pojo.queryParams.ManagementSecurityUnitUserPagerQueryParams; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ServiceProjectController.java b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ServiceProjectController.java index c9dc499..9e495a4 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ServiceProjectController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/ServiceProjectController.java @@ -3,7 +3,7 @@ package com.changhu.module.management.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.exception.MessageException; import com.changhu.module.management.pojo.params.ServiceProjectSaveOrUpdateParams; import com.changhu.module.management.pojo.queryParams.ServiceProjectPagerQueryParams; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SuperController.java b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SuperController.java index acee393..cbc7440 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SuperController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/controller/SuperController.java @@ -3,7 +3,7 @@ package com.changhu.module.management.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.module.management.pojo.params.ManagementSuperUserSaveOrUpdateParams; import com.changhu.module.management.pojo.queryParams.PoliceUnitPagerQueryParams; import com.changhu.module.management.pojo.queryParams.SecurityUnitPagerQueryParams; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/mapper/EnterprisesUnitMapper.java b/policeSecurityServer/src/main/java/com/changhu/module/management/mapper/EnterprisesUnitMapper.java index 7b273e8..9d9104d 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/mapper/EnterprisesUnitMapper.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/mapper/EnterprisesUnitMapper.java @@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.module.management.pojo.entity.EnterprisesUnit; import com.changhu.module.management.pojo.queryParams.EnterprisesUnitPagerQueryParams; -import com.changhu.module.management.pojo.queryParams.PoliceEnterprisesUnitPagerQueryParams; import com.changhu.module.management.pojo.vo.EnterprisesUnitPagerVo; -import com.changhu.module.management.pojo.vo.PoliceEnterprisesUnitPagerVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -26,15 +24,7 @@ public interface EnterprisesUnitMapper extends BaseMapper { * @return 结果 */ Page pager(@Param("page") Page page, + @Param("unitId") Long unitId, @Param("params") EnterprisesUnitPagerQueryParams params); - /** - * 公安单位下的企事业单位分页 - * - * @param page 分页对象 - * @param params 查询参数 - * @return 结果 - */ - Page policeEnterprisesUnitPager(@Param("page") Page page, - @Param("params") PoliceEnterprisesUnitPagerQueryParams params); } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/params/EnterprisesUnitSaveOrUpdateParams.java b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/params/EnterprisesUnitSaveOrUpdateParams.java index 4b7114f..f27bd6a 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/params/EnterprisesUnitSaveOrUpdateParams.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/params/EnterprisesUnitSaveOrUpdateParams.java @@ -23,7 +23,6 @@ public class EnterprisesUnitSaveOrUpdateParams { private Long snowFlakeId; @Schema(description = "公安单位id") - @NotNull(message = "公安单位不能为空") private Long policeUnitId; @Schema(description = "名称") diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/EnterprisesUnitPagerQueryParams.java b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/EnterprisesUnitPagerQueryParams.java index 90a28aa..67d2138 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/EnterprisesUnitPagerQueryParams.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/EnterprisesUnitPagerQueryParams.java @@ -1,7 +1,6 @@ package com.changhu.module.management.pojo.queryParams; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; import lombok.Data; /** @@ -12,7 +11,13 @@ import lombok.Data; @Data public class EnterprisesUnitPagerQueryParams { - @NotNull(message = "公安单位id不能为空") @Schema(description = "公安单位id") private Long policeUnitId; + + @Schema(description = "名称") + private String name; + @Schema(description = "详细地址") + private String address; + @Schema(description = "备注") + private String remark; } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/PoliceEnterprisesUnitPagerQueryParams.java b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/PoliceEnterprisesUnitPagerQueryParams.java deleted file mode 100644 index d349d76..0000000 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/queryParams/PoliceEnterprisesUnitPagerQueryParams.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.changhu.module.management.pojo.queryParams; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author 20252 - * @createTime 2024/9/5 下午2:49 - * @desc PoliceEnterprisesUnitPagerQueryParams... - */ -@Data -public class PoliceEnterprisesUnitPagerQueryParams { - @Schema(description = "名称") - private String name; - @Schema(description = "详细地址") - private String address; - @Schema(description = "备注") - private String remark; -} diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/EnterprisesUnitPagerVo.java b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/EnterprisesUnitPagerVo.java index 594c1ef..11c2e6e 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/EnterprisesUnitPagerVo.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/EnterprisesUnitPagerVo.java @@ -1,6 +1,7 @@ package com.changhu.module.management.pojo.vo; import com.changhu.common.db.enums.EnterprisesUnitType; +import com.changhu.common.pojo.vo.CreateOrUpdateUser; import com.changhu.module.management.pojo.model.ContactPersonInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -47,7 +48,7 @@ public class EnterprisesUnitPagerVo { @Schema(description = "地址") private String address; - @Schema(description = "坐标") + @Schema(description = "位置") private Point point; @Schema(description = "联系方式") @@ -56,6 +57,8 @@ public class EnterprisesUnitPagerVo { @Schema(description = "备注") private String remark; + @Schema(description = "创建人") + private CreateOrUpdateUser createUser; @Schema(description = "创建时间") private String createTime; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/PoliceEnterprisesUnitPagerVo.java b/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/PoliceEnterprisesUnitPagerVo.java deleted file mode 100644 index 83322fe..0000000 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/pojo/vo/PoliceEnterprisesUnitPagerVo.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.changhu.module.management.pojo.vo; - -import com.changhu.module.management.pojo.model.ContactPersonInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @author 20252 - * @createTime 2024/9/5 下午2:46 - * @desc PoliceEnterprisesUnitPagerVo... - */ -@Data -public class PoliceEnterprisesUnitPagerVo { - @Schema(description = "id") - private Long snowFlakeId; - @Schema(description = "名称") - private String name; - - @Schema(description = "省编码") - private String province; - @Schema(description = "省名称") - private String provinceName; - @Schema(description = "市编码") - private String city; - @Schema(description = "市名称") - private String cityName; - @Schema(description = "县编码") - private String districts; - @Schema(description = "县名称") - private String districtsName; - @Schema(description = "乡镇编码") - private String street; - @Schema(description = "乡镇名称") - private String streetName; - - @Schema(description = "详细地址") - private String address; - @Schema(description = "联系人") - private ContactPersonInfo contactPersonInfo; - @Schema(description = "备注") - private String remark; - @Schema(description = "创建时间") - private LocalDateTime createTime; -} diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/service/PoliceService.java b/policeSecurityServer/src/main/java/com/changhu/module/management/service/PoliceService.java index d1fac7a..2f129f8 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/service/PoliceService.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/service/PoliceService.java @@ -3,9 +3,7 @@ package com.changhu.module.management.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.changhu.module.management.pojo.params.ManagementPoliceUserSaveOrUpdateParams; import com.changhu.module.management.pojo.queryParams.ManagementPoliceUnitUserPagerQueryParams; -import com.changhu.module.management.pojo.queryParams.PoliceEnterprisesUnitPagerQueryParams; import com.changhu.module.management.pojo.vo.ManagementPoliceUnitUserPagerVo; -import com.changhu.module.management.pojo.vo.PoliceEnterprisesUnitPagerVo; import com.changhu.support.mybatisplus.pojo.params.PageParams; /** @@ -36,11 +34,4 @@ public interface PoliceService { */ void userDeleteById(Long managementPoliceUnitUserId); - /** - * 公安单位下的企事业单位分页 - * - * @param queryParams 查询参数 - * @return 结果 - */ - Page enterprisesUnitPager(PageParams queryParams); } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/EnterprisesUnitServiceImpl.java b/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/EnterprisesUnitServiceImpl.java index d24474b..c291287 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/EnterprisesUnitServiceImpl.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/EnterprisesUnitServiceImpl.java @@ -5,8 +5,10 @@ import cn.hutool.core.lang.Dict; import cn.hutool.core.lang.func.LambdaUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.changhu.common.db.enums.UserType; import com.changhu.common.exception.MessageException; import com.changhu.common.pojo.vo.SelectNodeVo; +import com.changhu.common.utils.UserUtil; import com.changhu.module.management.mapper.EnterprisesUnitMapper; import com.changhu.module.management.pojo.entity.EnterprisesUnit; import com.changhu.module.management.pojo.params.EnterprisesUnitSaveOrUpdateParams; @@ -29,12 +31,17 @@ public class EnterprisesUnitServiceImpl extends ServiceImpl pager(PageParams queryParams) { - return baseMapper.pager(queryParams.getPage(), queryParams.getParams()); + return switch (UserUtil.getUserType()) { + case MANAGEMENT_POLICE -> baseMapper.pager(queryParams.getPage(), UserUtil.getUnitId(), queryParams.getParams()); + case MANAGEMENT_SUPER -> baseMapper.pager(queryParams.getPage(), null, queryParams.getParams()); + default -> throw new MessageException(); + }; } @Override public void saveOrUpdate(EnterprisesUnitSaveOrUpdateParams params) { EnterprisesUnit enterprisesUnit = BeanUtil.copyProperties(params, EnterprisesUnit.class); + //需要将行政区划编码转换为省市区 Optional.ofNullable(params.getAdministrativeDivisionCodes()) .ifPresent(codes -> { if (!codes.isEmpty()) { @@ -50,6 +57,10 @@ public class EnterprisesUnitServiceImpl extends ServiceImpl enterprisesUnitPager(PageParams queryParams) { - return enterprisesUnitMapper.policeEnterprisesUnitPager(queryParams.getPage(), queryParams.getParams()); - } } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/SecurityServiceImpl.java b/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/SecurityServiceImpl.java index f7a504b..fea4772 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/SecurityServiceImpl.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/management/service/impl/SecurityServiceImpl.java @@ -8,7 +8,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.toolkit.Db; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.db.enums.IsEnable; import com.changhu.common.db.enums.MiniProgramUserIdentity; import com.changhu.common.enums.ResultCode; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/PoliceIndexController.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/PoliceIndexController.java index bc8af47..bde2ec2 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/PoliceIndexController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/PoliceIndexController.java @@ -2,7 +2,7 @@ package com.changhu.module.miniProgram.controller; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.pojo.vo.SelectNodeVo; import com.changhu.module.miniProgram.pojo.vo.IndexDataStatisticsVo; import com.changhu.module.miniProgram.pojo.vo.IndexServiceProjectListVo; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java index b64d237..1c3ee25 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java @@ -2,14 +2,13 @@ package com.changhu.module.miniProgram.controller; import com.changhu.common.annotation.CheckUserType; import com.changhu.common.annotation.JsonBody; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.module.miniProgram.pojo.params.SaveOrUpdateSecurityUserParams; import com.changhu.module.miniProgram.pojo.vo.IndexServiceProjectListVo; import com.changhu.module.miniProgram.service.ProjectManageIndexService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.Resource; diff --git a/policeSecurityServer/src/main/java/com/changhu/support/interceptor/UserTypeInterceptor.java b/policeSecurityServer/src/main/java/com/changhu/support/interceptor/UserTypeInterceptor.java index bac23f7..fd54d67 100644 --- a/policeSecurityServer/src/main/java/com/changhu/support/interceptor/UserTypeInterceptor.java +++ b/policeSecurityServer/src/main/java/com/changhu/support/interceptor/UserTypeInterceptor.java @@ -2,7 +2,7 @@ package com.changhu.support.interceptor; import cn.hutool.core.util.ArrayUtil; import com.changhu.common.annotation.CheckUserType; -import com.changhu.common.annotation.UserType; +import com.changhu.common.db.enums.UserType; import com.changhu.common.exception.MessageException; import com.changhu.common.utils.UserUtil; import jakarta.servlet.http.HttpServletRequest; diff --git a/policeSecurityServer/src/main/resources/mapper/EnterprisesUnitMapper.xml b/policeSecurityServer/src/main/resources/mapper/EnterprisesUnitMapper.xml index b84a0e1..881217a 100644 --- a/policeSecurityServer/src/main/resources/mapper/EnterprisesUnitMapper.xml +++ b/policeSecurityServer/src/main/resources/mapper/EnterprisesUnitMapper.xml @@ -6,44 +6,33 @@ column="contact_person_info" typeHandler="com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler" property="contactPersonInfo"/> + - - - - - + \ No newline at end of file diff --git a/superManagement/src/components/aMap/MapContainer.vue b/superManagement/src/components/aMap/MapContainer.vue index fdd897c..a945b0b 100644 --- a/superManagement/src/components/aMap/MapContainer.vue +++ b/superManagement/src/components/aMap/MapContainer.vue @@ -7,16 +7,13 @@ diff --git a/superManagement/src/views/data/dataOverview.vue b/superManagement/src/views/data/dataOverview.vue index 155c6a1..a10b43f 100644 --- a/superManagement/src/views/data/dataOverview.vue +++ b/superManagement/src/views/data/dataOverview.vue @@ -1,9 +1,9 @@ diff --git a/superManagement/vite.config.ts b/superManagement/vite.config.ts index 066fda5..6151972 100644 --- a/superManagement/vite.config.ts +++ b/superManagement/vite.config.ts @@ -78,6 +78,11 @@ export default defineConfig(({mode}) => { } } }, + css: { + preprocessorOptions: { + api: 'modern-compiler' + } + } } })