Commit 535bad1d by lzy

Merge branch 'dev' of git.xmmakeit.com:huangjiay/iot-platform-server into dev

parents 61253d5c 37fdcf9e
Showing with 1750 additions and 395 deletions
-- 长者管理 -- 长者管理
CREATE TABLE `elder` CREATE TABLE `plat_elder`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`name` varchar(128) NOT NULL COMMENT '姓名', `name` varchar(128) NOT NULL COMMENT '姓名',
...@@ -31,10 +31,15 @@ CREATE TABLE `elder` ...@@ -31,10 +31,15 @@ CREATE TABLE `elder`
`home_district_name` varchar(64) DEFAULT NULL COMMENT '家庭区名称', `home_district_name` varchar(64) DEFAULT NULL COMMENT '家庭区名称',
`home_address_detail` varchar(64) DEFAULT NULL COMMENT '家庭地址详细', `home_address_detail` varchar(64) DEFAULT NULL COMMENT '家庭地址详细',
`space_id` varchar(64) DEFAULT NULL COMMENT '空间id', `space_id` varchar(64) DEFAULT NULL COMMENT '空间id',
street_space_id varchar(64) NULL COMMENT '小区/社区/街道空间id',
building_space_id varchar(64) NULL COMMENT '楼栋空间id',
unit_space_id varchar(64) NULL COMMENT '单元空间id',
floor_space_id varchar(64) NULL COMMENT '楼层id',
`room_id` varchar(64) DEFAULT NULL COMMENT '房间id', `room_id` varchar(64) DEFAULT NULL COMMENT '房间id',
`bed_id` varchar(64) DEFAULT NULL COMMENT '床位id', `bed_id` varchar(64) DEFAULT NULL COMMENT '床位id',
`space_path` varchar(64) DEFAULT NULL COMMENT '空间-房间-床位路径', `space_path` varchar(64) DEFAULT NULL COMMENT '空间-房间-床位路径',
`remark` varchar(1024) DEFAULT NULL COMMENT '备注', `remark` varchar(1024) DEFAULT NULL COMMENT '备注',
avatar varchar(64) NULL COMMENT '头像文件id',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者', `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
`create_date` datetime DEFAULT NULL COMMENT '创建时间', `create_date` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新者', `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
...@@ -47,7 +52,7 @@ CREATE TABLE `elder` ...@@ -47,7 +52,7 @@ CREATE TABLE `elder`
DEFAULT CHARSET = utf8mb4 COMMENT ='长者基本信息'; DEFAULT CHARSET = utf8mb4 COMMENT ='长者基本信息';
CREATE TABLE `elder_social_relation` CREATE TABLE `plat_elder_social_relation`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`elder_id` varchar(64) NOT NULL COMMENT '长者id', `elder_id` varchar(64) NOT NULL COMMENT '长者id',
...@@ -68,7 +73,7 @@ CREATE TABLE `elder_social_relation` ...@@ -68,7 +73,7 @@ CREATE TABLE `elder_social_relation`
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='长者社会关系'; DEFAULT CHARSET = utf8mb4 COMMENT ='长者社会关系';
CREATE TABLE `elder_health_info` CREATE TABLE `plat_elder_health_info`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`elder_id` VARCHAR(64) NOT NULL COMMENT '长者id', `elder_id` VARCHAR(64) NOT NULL COMMENT '长者id',
...@@ -94,7 +99,7 @@ CREATE TABLE `elder_health_info` ...@@ -94,7 +99,7 @@ CREATE TABLE `elder_health_info`
DEFAULT CHARSET = utf8mb4 COMMENT = '长者健康状态'; DEFAULT CHARSET = utf8mb4 COMMENT = '长者健康状态';
CREATE TABLE `elder_other_info` CREATE TABLE `plat_elder_other_info`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`elder_id` VARCHAR(64) NOT NULL COMMENT '长者id', `elder_id` VARCHAR(64) NOT NULL COMMENT '长者id',
...@@ -120,7 +125,7 @@ CREATE TABLE `elder_other_info` ...@@ -120,7 +125,7 @@ CREATE TABLE `elder_other_info`
DEFAULT CHARSET = utf8mb4 COMMENT = '长者其他信息'; DEFAULT CHARSET = utf8mb4 COMMENT = '长者其他信息';
CREATE TABLE `elder_medical_examination_info` CREATE TABLE `plat_elder_medical_examination_info`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`elder_id` varchar(64) NOT NULL COMMENT '长者id', `elder_id` varchar(64) NOT NULL COMMENT '长者id',
...@@ -137,7 +142,7 @@ CREATE TABLE `elder_medical_examination_info` ...@@ -137,7 +142,7 @@ CREATE TABLE `elder_medical_examination_info`
DEFAULT CHARSET = utf8mb4 COMMENT ='长者体检报告信息'; DEFAULT CHARSET = utf8mb4 COMMENT ='长者体检报告信息';
CREATE TABLE `elder_children_info` CREATE TABLE `plat_elder_children_info`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`elder_id` varchar(64) NOT NULL COMMENT '长者id', `elder_id` varchar(64) NOT NULL COMMENT '长者id',
...@@ -158,7 +163,7 @@ CREATE TABLE `elder_children_info` ...@@ -158,7 +163,7 @@ CREATE TABLE `elder_children_info`
CREATE TABLE `dict_type` CREATE TABLE `plat_dict_type`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`code` varchar(64) DEFAULT NULL '类型编码', `code` varchar(64) DEFAULT NULL '类型编码',
...@@ -173,7 +178,7 @@ CREATE TABLE `dict_type` ...@@ -173,7 +178,7 @@ CREATE TABLE `dict_type`
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='字典类型'; DEFAULT CHARSET = utf8mb4 COMMENT ='字典类型';
CREATE TABLE `dict_info` CREATE TABLE `plat_dict_info`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`dict_type_id` varchar(64) NOT NULL COMMENT '字典类型id', `dict_type_id` varchar(64) NOT NULL COMMENT '字典类型id',
...@@ -210,7 +215,7 @@ CREATE TABLE `sys_file` ...@@ -210,7 +215,7 @@ CREATE TABLE `sys_file`
ROW_FORMAT = DYNAMIC COMMENT ='文件管理'; ROW_FORMAT = DYNAMIC COMMENT ='文件管理';
CREATE TABLE `sys_user` CREATE TABLE `plat_user`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`name` varchar(128) NOT NULL COMMENT '姓名', `name` varchar(128) NOT NULL COMMENT '姓名',
...@@ -230,7 +235,7 @@ CREATE TABLE `sys_user` ...@@ -230,7 +235,7 @@ CREATE TABLE `sys_user`
CREATE TABLE `sys_role` CREATE TABLE `plat_role`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`name` VARCHAR(128) NOT NULL COMMENT '名称', `name` VARCHAR(128) NOT NULL COMMENT '名称',
...@@ -245,7 +250,7 @@ CREATE TABLE `sys_role` ...@@ -245,7 +250,7 @@ CREATE TABLE `sys_role`
) ENGINE = INNODB ) ENGINE = INNODB
DEFAULT CHARSET = utf8mb4 COMMENT = '角色管理'; DEFAULT CHARSET = utf8mb4 COMMENT = '角色管理';
CREATE TABLE `sys_user_role` CREATE TABLE `plat_user_role`
( (
`id` char(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT ' id ', `id` char(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT ' id ',
`tenant_id` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT ' 租户id ', `tenant_id` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT ' 租户id ',
...@@ -265,7 +270,7 @@ CREATE TABLE `sys_user_role` ...@@ -265,7 +270,7 @@ CREATE TABLE `sys_user_role`
COLLATE = utf8mb4_general_ci COMMENT =' 用户角色关联表 '; COLLATE = utf8mb4_general_ci COMMENT =' 用户角色关联表 ';
CREATE TABLE `sys_org` CREATE TABLE `plat_org`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`name` VARCHAR(128) NOT NULL COMMENT '名称', `name` VARCHAR(128) NOT NULL COMMENT '名称',
...@@ -284,7 +289,7 @@ CREATE TABLE `sys_org` ...@@ -284,7 +289,7 @@ CREATE TABLE `sys_org`
DEFAULT CHARSET = utf8mb4 COMMENT = '组织管理'; DEFAULT CHARSET = utf8mb4 COMMENT = '组织管理';
CREATE TABLE `sys_role_org` CREATE TABLE `plat_role_org`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`role_id` VARCHAR(64) NOT NULL COMMENT '角色id', `role_id` VARCHAR(64) NOT NULL COMMENT '角色id',
...@@ -302,7 +307,7 @@ CREATE TABLE `sys_role_org` ...@@ -302,7 +307,7 @@ CREATE TABLE `sys_role_org`
CREATE TABLE `sys_menu` CREATE TABLE `plat_menu`
( (
`id` varchar(64) NOT NULL COMMENT '编号', `id` varchar(64) NOT NULL COMMENT '编号',
`parent_id` varchar(64) DEFAULT NULL COMMENT '父级编号', `parent_id` varchar(64) DEFAULT NULL COMMENT '父级编号',
...@@ -328,7 +333,7 @@ CREATE TABLE `sys_menu` ...@@ -328,7 +333,7 @@ CREATE TABLE `sys_menu`
DEFAULT CHARSET = utf8 DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='菜单表'; ROW_FORMAT = DYNAMIC COMMENT ='菜单表';
CREATE TABLE `sys_role_menus` CREATE TABLE `plat_role_menus`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`role_id` varchar(64) NOT NULL COMMENT '角色id', `role_id` varchar(64) NOT NULL COMMENT '角色id',
...@@ -347,7 +352,7 @@ CREATE TABLE `sys_role_menus` ...@@ -347,7 +352,7 @@ CREATE TABLE `sys_role_menus`
CREATE TABLE `space` CREATE TABLE `plat_space`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`name` VARCHAR(128) NOT NULL COMMENT '名称', `name` VARCHAR(128) NOT NULL COMMENT '名称',
...@@ -364,7 +369,7 @@ CREATE TABLE `space` ...@@ -364,7 +369,7 @@ CREATE TABLE `space`
) ENGINE = INNODB ) ENGINE = INNODB
DEFAULT CHARSET = utf8mb4 COMMENT = '空间管理'; DEFAULT CHARSET = utf8mb4 COMMENT = '空间管理';
CREATE TABLE `room` CREATE TABLE `plat_room`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`name` VARCHAR(128) NOT NULL COMMENT '名称', `name` VARCHAR(128) NOT NULL COMMENT '名称',
...@@ -382,7 +387,7 @@ CREATE TABLE `room` ...@@ -382,7 +387,7 @@ CREATE TABLE `room`
DEFAULT CHARSET = utf8mb4 COMMENT = '房间管理'; DEFAULT CHARSET = utf8mb4 COMMENT = '房间管理';
-- 待完善 区域设置表 -- 待完善 区域设置表
CREATE TABLE `region_setting` CREATE TABLE `plat_region_setting`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`room_id` VARCHAR(64) NOT NULL COMMENT '房间id', `room_id` VARCHAR(64) NOT NULL COMMENT '房间id',
...@@ -398,7 +403,7 @@ CREATE TABLE `region_setting` ...@@ -398,7 +403,7 @@ CREATE TABLE `region_setting`
DEFAULT CHARSET = utf8mb4 COMMENT = '区域管理'; DEFAULT CHARSET = utf8mb4 COMMENT = '区域管理';
CREATE TABLE `bed` CREATE TABLE `plat_bed`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`name` varchar(128) NOT NULL COMMENT '床位名称 床位1,床位2', `name` varchar(128) NOT NULL COMMENT '床位名称 床位1,床位2',
...@@ -415,7 +420,7 @@ CREATE TABLE `bed` ...@@ -415,7 +420,7 @@ CREATE TABLE `bed`
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='床位管理'; DEFAULT CHARSET = utf8mb4 COMMENT ='床位管理';
CREATE TABLE `region_setting` CREATE TABLE `plat_region_setting`
( (
`id` varchar(64) NOT NULL COMMENT 'id', `id` varchar(64) NOT NULL COMMENT 'id',
`name` varchar(128) NOT NULL COMMENT '床位名称 床位1,床位2', `name` varchar(128) NOT NULL COMMENT '床位名称 床位1,床位2',
...@@ -431,7 +436,7 @@ CREATE TABLE `region_setting` ...@@ -431,7 +436,7 @@ CREATE TABLE `region_setting`
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区域设置'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区域设置';
CREATE TABLE `equipment` CREATE TABLE `plat_equipment`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`equipment_id` VARCHAR(64) NOT NULL COMMENT '设备id', `equipment_id` VARCHAR(64) NOT NULL COMMENT '设备id',
...@@ -455,7 +460,7 @@ CREATE TABLE `equipment` ...@@ -455,7 +460,7 @@ CREATE TABLE `equipment`
DEFAULT CHARSET = utf8mb4 COMMENT = '设备管理'; DEFAULT CHARSET = utf8mb4 COMMENT = '设备管理';
CREATE TABLE `alarm_config` CREATE TABLE `plat_alarm_config`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`alarm_type` VARCHAR(4) DEFAULT NULL COMMENT '告警类型 1 长者跌倒 2 呼吸异常 3 心率异常 4 行为异常', `alarm_type` VARCHAR(4) DEFAULT NULL COMMENT '告警类型 1 长者跌倒 2 呼吸异常 3 心率异常 4 行为异常',
...@@ -479,7 +484,7 @@ CREATE TABLE `alarm_config` ...@@ -479,7 +484,7 @@ CREATE TABLE `alarm_config`
DEFAULT CHARSET = utf8mb4 COMMENT = '告警配置'; DEFAULT CHARSET = utf8mb4 COMMENT = '告警配置';
CREATE TABLE `alarm_record` CREATE TABLE `plat_alarm_record`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`alarm_id` VARCHAR(64) DEFAULT NULL COMMENT '关联告警配置', `alarm_id` VARCHAR(64) DEFAULT NULL COMMENT '关联告警配置',
...@@ -498,7 +503,7 @@ CREATE TABLE `alarm_record` ...@@ -498,7 +503,7 @@ CREATE TABLE `alarm_record`
DEFAULT CHARSET = utf8mb4 COMMENT = '告警配置'; DEFAULT CHARSET = utf8mb4 COMMENT = '告警配置';
CREATE TABLE `plafform_setting` CREATE TABLE `plat_plafform_setting`
( (
`id` VARCHAR(64) NOT NULL COMMENT 'id', `id` VARCHAR(64) NOT NULL COMMENT 'id',
`name` VARCHAR(64) NOT NULL COMMENT '名称', `name` VARCHAR(64) NOT NULL COMMENT '名称',
......
package com.makeit.controller.config;
import com.makeit.config.BizCondition;
import com.makeit.config.swagger.SwaggerModuleConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.ApiSelectorBuilder;
import springfox.documentation.spring.web.plugins.Docket;
import java.util.Arrays;
/**
* swagger 配置类,访问地址:http://localhost:8080/swagger-ui.html
* Knife4j 访问地址:http://localhost:8080/doc.html
*
* @author yaohy
*/
@Configuration
@Conditional(BizCondition.class)
public class SwaggerFixtureConfig {
@Bean
public SwaggerModuleConfig fixtureModule() {
SwaggerModuleConfig config = new SwaggerModuleConfig();
config.setPackageList(Arrays.asList("com.makeit.controller"));
config.setModuleName("saas管理");
return config;
}
@Bean
public Docket fixtureApi() {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.groupName("01-saas管理");
ApiSelectorBuilder builder = docket.select();
//api过滤
builder = builder.apis(
RequestHandlerSelectors.basePackage("com.makeit.controller.saas")
);
return builder.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("IOT文档")
.description("服务端接口文档")
.version("1.0.1")
.build();
}
}
//TODO ywc 放到各自的模块里
\ No newline at end of file
...@@ -4,7 +4,7 @@ import com.makeit.common.dto.LoginDTO; ...@@ -4,7 +4,7 @@ import com.makeit.common.dto.LoginDTO;
import com.makeit.common.response.ApiResponseEntity; import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.service.saas.SaasUserService; import com.makeit.service.saas.SaasUserService;
import com.makeit.utils.user.UserLoginVO; import com.makeit.utils.user.SaasUserLoginVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,7 +23,7 @@ public class SaasLoginController { ...@@ -23,7 +23,7 @@ public class SaasLoginController {
@ApiOperation("登录") @ApiOperation("登录")
@PostMapping("login") @PostMapping("login")
public ApiResponseEntity<UserLoginVO> login(@RequestBody LoginDTO loginDTO) { public ApiResponseEntity<SaasUserLoginVO> login(@RequestBody LoginDTO loginDTO) {
return ApiResponseUtils.success(saasUserService.login(loginDTO)); return ApiResponseUtils.success(saasUserService.login(loginDTO));
} }
......
package com.makeit.controller.saas;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.dto.StatusDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.global.annotation.Action;
import com.makeit.module.admin.saas.SaasRoleDTOVO;
import com.makeit.module.admin.saas.PlatRoleMenuDTO;
import com.makeit.module.admin.saas.PlatUserRoleDTO;
import com.makeit.service.saas.SaasRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* saas端角色 前端控制器
* </p>
*
* @author eugene young
* @since 2022-05-10
*/
@Api(tags = "saas端-角色")
@RestController
@RequestMapping("/saas/role")
public class SaasRoleController {
@Autowired
private SaasRoleService saasRoleService;
@Action(module = "saas端-角色", name = "列表", code = "saas:role:list")
@ApiOperation("列表")
@PostMapping("list")
public ApiResponseEntity<List<SaasRoleDTOVO>> list(@RequestBody SaasRoleDTOVO dto){
return ApiResponseUtils.success(saasRoleService.list(dto));
}
@ApiOperation("列表(AuthIgnore)")
@PostMapping("listAuthIgnore")
public ApiResponseEntity<List<SaasRoleDTOVO>> listAuthIgnore(@RequestBody SaasRoleDTOVO dto){
return ApiResponseUtils.success(saasRoleService.list(dto));
}
@Action(module = "saas端-角色", name = "新增", code = "saas:role:add")
@ApiOperation("新增")
@PostMapping("add")
public ApiResponseEntity<?> add(@Validated @RequestBody SaasRoleDTOVO dto){
saasRoleService.add(dto);
return ApiResponseUtils.success();
}
@Action(module = "saas端-角色", name = "编辑", code = "saas:role:edit")
@ApiOperation("编辑")
@PostMapping("edit")
public ApiResponseEntity<?> edit(@Validated @RequestBody SaasRoleDTOVO dto){
saasRoleService.edit(dto);
return ApiResponseUtils.success();
}
@Action(module = "saas端-角色", name = "详情", code = "saas:role:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasRoleDTOVO> view(@RequestBody BaseIdDTO dto){
return ApiResponseUtils.success(saasRoleService.view(dto.getId()));
}
@Action(module = "saas端-角色", name = "删除", code = "saas:role:del")
@ApiOperation("删除")
@PostMapping("del")
public ApiResponseEntity<?> del(@RequestBody BaseIdDTO dto){
saasRoleService.del(dto.getId());
return ApiResponseUtils.success();
}
@Action(module = "saas端-角色", name = "改变状态", code = "saas:role:changeStatus")
@ApiOperation("改变状态")
@PostMapping("changeStatus")
public ApiResponseEntity<?> changeStatus(@RequestBody StatusDTO dto){
saasRoleService.changeStatus(dto);
return ApiResponseUtils.success();
}
@Action(module = "saas端-角色", name = "分配用户", code = "saas:role:assignUserList")
@ApiOperation("分配用户")
@PostMapping("assignUserList")
public ApiResponseEntity<?> assignUserList(@RequestBody List<PlatUserRoleDTO> userRoleDTOList){//参数要不要是一个对象里 有一个数组
saasRoleService.assignUserList(userRoleDTOList);
return ApiResponseUtils.success();
}
@Action(module = "saas端-角色", name = "删除分配用户", code = "saas:role:removeAssignUserList")
@ApiOperation("删除分配用户")
@PostMapping("removeAssignUserList")
public ApiResponseEntity<?> removeAssignUserList(@RequestBody List<PlatUserRoleDTO> userRoleDTOList){
saasRoleService.removeAssignUserList(userRoleDTOList);
return ApiResponseUtils.success();
}
@Action(module = "saas端-角色", name = "分配菜单", code = "saas:role:assignMenuList")
@ApiOperation("分配菜单")
@PostMapping("assignMenuList")
public ApiResponseEntity<?> assignMenuList(@RequestBody PlatRoleMenuDTO roleMenuDTO){
saasRoleService.assignMenuList(roleMenuDTO);
return ApiResponseUtils.success();
}
}
package com.makeit.controller.saas;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.global.annotation.Action;
import com.makeit.module.admin.saas.SaasUserDTOVO;
import com.makeit.module.admin.saas.PlatUserQueryDTO;
import com.makeit.service.saas.SaasUserService;
import com.makeit.utils.user.SaasUserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* SAAS端用户 前端控制器
* </p>
*
* @author eugene young
* @since 2022-05-10
*/
@Api(tags = "SAAS端-用户")
@RestController
@RequestMapping("/saas/user")
public class SaasUserController {
@Autowired
private SaasUserService saasUserService;
@Action(module = "SAAS端-用户", name = "分页列表", code = "saas:user:page")
@ApiOperation("分页列表")
@PostMapping("page")
public ApiResponseEntity<PageVO<SaasUserDTOVO>> page(@RequestBody PageReqDTO<PlatUserQueryDTO> page){
return ApiResponseUtils.success(saasUserService.page(page));
}
@ApiOperation("分页列表")
@PostMapping("pageAuthIgnore")
public ApiResponseEntity<PageVO<SaasUserDTOVO>> pageAuthIgnore(@RequestBody PageReqDTO<PlatUserQueryDTO> page){
return ApiResponseUtils.success(saasUserService.page(page));
}
//@Action(module = "SAAS端-用户", name = "分页列表-排除超级管理员", code = "plat:user:pageNotSuperAdmin")
@ApiOperation("分页列表-排除超级管理员")
@PostMapping("pageNotSuperAdmin")
public ApiResponseEntity<PageVO<SaasUserDTOVO>> pageNotSuperAdmin(@RequestBody PageReqDTO<PlatUserQueryDTO> page){
return ApiResponseUtils.success(saasUserService.pageNoSuperAdmin(page));
}
@ApiOperation("分页列表(AuthIgnore)")
@PostMapping("listAuthIgnore")
public ApiResponseEntity<List<SaasUserDTOVO>> listAuthIgnore(@RequestBody PlatUserQueryDTO dto){
return ApiResponseUtils.success(saasUserService.list(dto));
}
@ApiOperation("分页列表-排除超级管理员(AuthIgnore)")
@PostMapping("listNotSuperAdminAuthIgnore")
public ApiResponseEntity<List<SaasUserDTOVO>> listNotSuperAdminAuthIgnore(@RequestBody PlatUserQueryDTO dto){
return ApiResponseUtils.success(saasUserService.listNoSuperAdmin(dto));
}
@Action(module = "SAAS端-用户", name = "新增", code = "saas:user:add")
@ApiOperation("新增")
@PostMapping("add")
public ApiResponseEntity<?> add(@Validated @RequestBody SaasUserDTOVO dto){
saasUserService.add(dto);
return ApiResponseUtils.success();
}
@Action(module = "SAAS端-用户", name = "编辑", code = "saas:user:edit")
@ApiOperation("编辑")
@PostMapping("edit")
public ApiResponseEntity<?> edit(@Validated @RequestBody SaasUserDTOVO dto){
saasUserService.edit(dto);
return ApiResponseUtils.success();
}
@Action(module = "SAAS端-用户", name = "改变密码", code = "saas:user:changePassword")
@ApiOperation("改变密码")
@PostMapping("changePassword")
public ApiResponseEntity<?> changePassword(@RequestBody SaasUserDTOVO dto){
saasUserService.changePassword(dto);
return ApiResponseUtils.success();
}
@Action(module = "SAAS端-用户", name = "详情", code = "saas:user:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasUserDTOVO> view(@RequestBody BaseIdDTO dto){;
return ApiResponseUtils.success(saasUserService.view(dto.getId()));
}
@Action(module = "SAAS端-用户", name = "删除", code = "saas:user:del")
@ApiOperation("删除")
@PostMapping("del")
public ApiResponseEntity<?> del(@RequestBody BaseIdDTO dto){
saasUserService.del(dto.getId());
return ApiResponseUtils.success();
}
@Action(module = "SAAS端-用户", name = "改变状态", code = "saas:user:changeStatus")
@ApiOperation("改变状态")
@PostMapping("changeStatus")
public ApiResponseEntity<?> changeStatus(@RequestBody StatusDTO dto){
saasUserService.changeStatus(dto);
return ApiResponseUtils.success();
}
@ApiOperation("获取当前登录用户的角色菜单")
@PostMapping("getRoleMenu")
public ApiResponseEntity<SaasUserLoginVO> getRoleAndMenuList(){
return ApiResponseUtils.success(saasUserService.getRoleAndMenuList());
}
@ApiOperation("获取当前登录用户的用户信息")
@PostMapping("getUserVO")
public ApiResponseEntity<SaasUserLoginVO> getUserInfo(){
return ApiResponseUtils.success(saasUserService.getUserVO());
}
}
...@@ -10,16 +10,16 @@ import lombok.experimental.FieldNameConstants; ...@@ -10,16 +10,16 @@ import lombok.experimental.FieldNameConstants;
import java.io.Serializable; import java.io.Serializable;
@ApiModel("厂别dto") @ApiModel("租户dto")
@FieldNameConstants @FieldNameConstants
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
//@Builder //@Builder
public class BaseTenantIdDTO extends BaseIdDTO implements Serializable { public class BaseTenantDTO extends BaseIdDTO implements Serializable {
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "厂别id", required = true) @ApiModelProperty(value = "租户id", required = true)
private String tenantId; private String tenantId;
} }
...@@ -37,7 +37,7 @@ public class BaseEntity implements Serializable { ...@@ -37,7 +37,7 @@ public class BaseEntity implements Serializable {
@ApiModelProperty(value = "创建时间", required = false) @ApiModelProperty(value = "创建时间", required = false)
@TableField(value = "create_date", fill = FieldFill.INSERT, typeHandler = LocalDateTimeTypeHandler.class) @TableField(value = "create_date", fill = FieldFill.INSERT, typeHandler = LocalDateTimeTypeHandler.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createDate;
/** /**
* 更新时间 * 更新时间
...@@ -45,7 +45,7 @@ public class BaseEntity implements Serializable { ...@@ -45,7 +45,7 @@ public class BaseEntity implements Serializable {
@ApiModelProperty(value = "更新时间", required = false) @ApiModelProperty(value = "更新时间", required = false)
@TableField(value = "update_date", fill = FieldFill.INSERT_UPDATE, typeHandler = LocalDateTimeTypeHandler.class) @TableField(value = "update_date", fill = FieldFill.INSERT_UPDATE, typeHandler = LocalDateTimeTypeHandler.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updatedAt; private LocalDateTime updateDate;
@TableLogic @TableLogic
......
package com.makeit.config; package com.makeit.config;
import com.makeit.global.inteceptor.RequestIdInterceptor; import com.makeit.global.inteceptor.RequestIdInterceptor;
import com.makeit.global.inteceptor.SysAuthenticationInterceptor; import com.makeit.global.inteceptor.SaasAuthenticationInterceptor;
import com.makeit.global.inteceptor.SysAuthorizationInterceptor; import com.makeit.global.inteceptor.SaasAuthorizationInterceptor;
import com.makeit.global.inteceptor.TntAuthenticationInterceptor;
import com.makeit.global.inteceptor.TntAuthorizationInterceptor;
import com.makeit.utils.old.StringUtils; import com.makeit.utils.old.StringUtils;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,16 +25,21 @@ public class WebInterceptorConfig implements WebMvcConfigurer { ...@@ -23,16 +25,21 @@ public class WebInterceptorConfig implements WebMvcConfigurer {
private RequestIdInterceptor requestIdInterceptor; private RequestIdInterceptor requestIdInterceptor;
@Autowired @Autowired
private SysAuthenticationInterceptor sysAuthenticationInterceptor; private TntAuthenticationInterceptor tntAuthenticationInterceptor;
@Autowired
private TntAuthorizationInterceptor tntAuthorizationInterceptor;
@Autowired @Autowired
private SysAuthorizationInterceptor sysAuthorizationInterceptor; private SaasAuthenticationInterceptor saasAuthenticationInterceptor;
@Autowired
private SaasAuthorizationInterceptor saasAuthorizationInterceptor;
private String authenticationPlatPath;
private String authenticationPlatPathIgnore;
private String authorizationPlatPath; private String authenticationSaasPath;
private String authorizationPlatPathIgnore; private String authenticationSaasPathIgnore;
private String authorizationSaasPath;
private String authorizationSaasPathIgnore;
private String authenticationTntPath; private String authenticationTntPath;
...@@ -44,27 +51,29 @@ public class WebInterceptorConfig implements WebMvcConfigurer { ...@@ -44,27 +51,29 @@ public class WebInterceptorConfig implements WebMvcConfigurer {
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
//请求日志
registry.addInterceptor(requestIdInterceptor).addPathPatterns("/**"); registry.addInterceptor(requestIdInterceptor).addPathPatterns("/**");
InterceptorRegistration authenticationTnt = registry.addInterceptor(sysAuthenticationInterceptor); //tnt 认证
addInterceptor(registry.addInterceptor(tntAuthenticationInterceptor), authenticationTntPath, authenticationTntPathIgnore);
//tnt 授权
addInterceptor(registry.addInterceptor(tntAuthorizationInterceptor), authorizationTntPath, authorizationTntPathIgnore);
//saas 认证
addInterceptor(registry.addInterceptor(saasAuthenticationInterceptor), authenticationSaasPath, authenticationSaasPathIgnore);
//saas 授权
addInterceptor(registry.addInterceptor(saasAuthorizationInterceptor), authorizationSaasPath, authorizationSaasPathIgnore);
if (StringUtils.isNotBlank(authenticationTntPath)) { }
authenticationTnt.addPathPatterns(Arrays.asList(authenticationTntPath.split(",")));
}
if (StringUtils.isNotBlank(authenticationTntPathIgnore)) {
authenticationTnt.excludePathPatterns(Arrays.asList(authenticationTntPathIgnore.split(",")));
}
InterceptorRegistration authorizationTnt = registry.addInterceptor(sysAuthorizationInterceptor); private void addInterceptor(InterceptorRegistration registry, String authenticationPath, String authenticationPathIgnore) {
InterceptorRegistration authenticationTnt = registry;
if (StringUtils.isNotBlank(authorizationTntPath)) { if (StringUtils.isNotBlank(authenticationPath)) {
authorizationTnt.addPathPatterns(Arrays.asList(authorizationTntPath.split(","))); authenticationTnt.addPathPatterns(Arrays.asList(authenticationPath.split(",")));
} }
if (StringUtils.isNotBlank(authorizationTntPathIgnore)) { if (StringUtils.isNotBlank(authenticationPathIgnore)) {
authorizationTnt.excludePathPatterns(Arrays.asList(authorizationTntPathIgnore.split(","))); authenticationTnt.excludePathPatterns(Arrays.asList(authenticationPathIgnore.split(",")));
} }
} }
......
...@@ -19,12 +19,12 @@ public class LocalDateTimeObjectHandler implements MetaObjectHandlerInternal{ ...@@ -19,12 +19,12 @@ public class LocalDateTimeObjectHandler implements MetaObjectHandlerInternal{
@Override @Override
public void insertFill(MetaObject metaObject, MetaObjectHandler handler) { public void insertFill(MetaObject metaObject, MetaObjectHandler handler) {
handler.setFieldValByName(BaseEntity.Fields.createdAt, LocalDateTime.now(), metaObject); handler.setFieldValByName(BaseEntity.Fields.createDate, LocalDateTime.now(), metaObject);
handler.setFieldValByName(BaseEntity.Fields.updatedAt, LocalDateTime.now(), metaObject); handler.setFieldValByName(BaseEntity.Fields.updateDate, LocalDateTime.now(), metaObject);
} }
@Override @Override
public void updateFill(MetaObject metaObject, MetaObjectHandler handler) { public void updateFill(MetaObject metaObject, MetaObjectHandler handler) {
handler.setFieldValByName(BaseEntity.Fields.updatedAt, LocalDateTime.now(), metaObject); handler.setFieldValByName(BaseEntity.Fields.updateDate, LocalDateTime.now(), metaObject);
} }
} }
...@@ -88,160 +88,8 @@ public enum CodeMessageEnum { ...@@ -88,160 +88,8 @@ public enum CodeMessageEnum {
SYSTEM_ERROR_SMS_CODE_NOT_CORRECT(500, "SYSTEM.ERROR.SMS.CODE.NOT.CORRECT"), SYSTEM_ERROR_SMS_CODE_NOT_CORRECT(500, "SYSTEM.ERROR.SMS.CODE.NOT.CORRECT"),
CODE_EXISTS(500, "BASE.ERROR.CODE.EXISTS"), CODE_EXISTS(500, "BASE.ERROR.CODE.EXISTS"),
SYSTEM_ERROR_CONTRACT_TEMPLATE_ERROR(500, "SYSTEM.ERROR.CONTRACT.TEMPLATE.ERROR"),
PLATFORM_ERROR_ELDER_CERTIFICATENUMBER_DUPLICATE(500, "PLATFORM.ERROR.ELDER.CERTIFICATENUMBER.DUPLICATE"),
PRODUCT_ERROR_CATEGORY_LEVEL_MAX_FOUR(500, "PRODUCT.ERROR.CATEGORY.LEVEL.MAX.FOUR"),
PRODUCT_ERROR_PARAM_CATEGORY_LEVEL_NOT_CORRECT(500, "PRODUCT.ERROR.PARAM.CATEGORY.LEVEL.NOT.CORRECT"),
PRODUCT_ERROR_DETAIL_TEMPLATE_PRODUCT_ONLY_ONE(500, "PRODUCT.ERROR.DETAIL.TEMPLATE.PRODUCT.ONLY.ONE"),
PRODUCT_ERROR_DELETE_HAS_SUB_CHECK(500, "PRODUCT.ERROR.DELETE.HAS.SUB.CHECK"),
PRODUCT_BRAND(500, "PRODUCT.BRAND"),
PRODUCT_SERIES(500, "PRODUCT.SERIES"),
PRODUCT_PRODUCT(500, "PRODUCT.PRODUCT"),
PRODUCT_CATEGORY(500, "PRODUCT.CATEGORY"),
PRODUCT_CATEGORY_PARAM(500, "PRODUCT.CATEGORY.PARAM"),
PRODUCT_TEMPLATE(500, "PRODUCT.TEMPLATE"),
PRODUCT_MODEL(500, "PRODUCT.MODEL"),
// ----------------------------------------- 型号
PDT_ERROR_MODEL_ODDER_CODE_NOT_UNIQUE(500, "PDT.ERROR.MODEL.ORDER.CODE.NOT.UNIQUE"),
PDT_ERROR_MODEL_NOT_EXISTED(500, "PDT.ERROR.MODEL.ORDER.CODE.NOT.EXISTED"),
PDT_ERROR_MODEL_HAS_BLOCKED(500, "PDT.ERROR.MODEL.HAS.BLOCKED"),
PDT_ERROR_MODEL_SALE_VALUE(500, "PDT.ERROR.MODEL.SALE.VALUE"),
PDT_ERROR_MODEL_UNIT_VALUE_SYNC(500, "PDT.ERROR.MODEL.UNIT.VALUE.SYNC"),
PDT_ERROR_CATEGORY_NOT_EXISTED(500, "PRODUCT.ERROR.CATEGORY.NOT.EXISTED"),
PDT_ERROR_PRODUCT_NOT_EXISTED(500, "PRODUCT.ERROR.PRODUCT.NOT.EXISTED"),
// ----------------------------------------- 型号
// ----------------------------------------- 价格
PRICE_PERMISSION_NOT_EXISTED(500, "price.permission.not.existed"),
PRICE_PERMISSION_SYSTEM_NOT_AUTH(500, "price.permission.system.not.auth"),
PRICE_CUSTOMER_BELOW_AUTH(500, "price.customer.below.auth"),
PRICE_STRATEGY_NOT_EXISTED(500, "price.strategy.not.existed"),
PRICE_STRATEGY_PRICE_OR_RATE_ERR(500, "price.strategy.price.or.rate.err"),
PRICE_STRATEGY_MIN_RATE(500, "price.strategy.min.rate"),
// ----------------------------------------- 价格
// ----------------------------------------- 系统设置
TNT_PRODUCT_SETTING_NOT_INIT(500, "tnt.product.setting.not.init"),
TNT_PRODUCT_SETTING_HAS_INIT(500, "tnt.product.setting.has.init"),
TNT_INVOICE_SETTING_NOT_INIT(500, "tnt.invoice.setting.not.init"),
TNT_INVOICE_SETTING_HAS_INIT(500, "tnt.invoice.setting.has.init"),
// ----------------------------------------- 系统设置
//订单
OD_ORDER_ERROR_CONTRACT_NO_DUPLICATE(500, "OD.ORDER.ERROR.CONTRACT.NO.DUPLICATE"),
OD_ORDER_WAIT_PAY_CAN_CANCEL(500, "OD.ORDER.WAIT.PAY.CAN.CANCEL"),
OD_ORDER_CANCEL_CANT_DO(500, "OD.ORDER.CANCEL.CANT.DO"),
OD_STOCK_IN_ORDER_NOT_EMPTY(500, "OD.STOCK.IN.ORDER.NOT.EMPTY"),
OD_ORDER_ERROR_NO_EXISTED(500, "OD.ORDER.ERROR.NO.EXISTED"),
//
OD_DELIVERY_PART_SUCCESS(500, "OD_DELIVERY_PART_SUCCESS"),
// 库存相关-----start-----
// 仓库名称重复
WMS_WARE_NAME_DUPLICATE(500, "wms.ware.name.duplicate"),
// 库存采购单号不能为空
WMS_WARE_STOCK_PURCHASE_ORDER_NO_IS_NOT_EMPTY(500, "wms.ware.stock.purchase.order.no.is.not.empty"),
// 在途库存采购单号不能为空
WMS_WARE_STOCK_PASSAGE_AMOUNT_IS_NOT_EMPTY_OR_NE_ZERO(500, "wms.ware.stock.passage.amount.is.not.empty.or.ne.zero"),
// 在途库存类型不能为空
WMS_WARE_STOCK_PASSAGE_TYPE_IS_NOT_EMPTY(500, "wms.ware.stock.passage.type.is.not.empty"),
// 入库单明细不能为空
SYSTEM_ERROR_DETAIL_NOT_EMPTY(500, "system.error.detail.not.empty"),
WMS_WARE_STOCK_NO_STOCK(500, "wms.ware.stock.no.stock"),
NO_SUPPLIER_INVENTORY_DATA(500, "no.supplier.inventory.data"),
WMS_WARE_STOCK_TYPE_NOT_EMPTY(500, "wms.ware.stock.type.not.empty"),
WMS_WARE_STOCK_EVENT_TYPE_NOT_EMPTY(500, "wms.ware.stock.event.type.not.empty"),
WMS_WARE_STOCK_MODEL_DETAIL_NOT_EMPTY(500, "wms.ware.stock.model.detail.not.empty"),
// 库存相关-----end-----
// 采购
NO_PURCHASE_STATUS_OPERATE(500, "no.purchase.status.no.operate"),
QUANTITY_OVER_LIMIT(500, "quantity.over.limit"),
FIN_CREDIT_CUS_COMPANY_ID_NOT_EMPTY(500, "fin.credit.cus.company.id.not.empty"),
FIN_CREDIT_CUS_COMPANY_EXIST(500, "fin.credit.cus.company.exist"),
FIN_CREDIT_ID_NOT_EMPTY(500, "fin.credit.id.not.empty"),
FIN_CREDIT_ACCOUNT_NOT_FOUND(11002, "fin.credit.account.not.found"),
FIN_CREDIT_NOT_ENOUGH(11003, "fin.credit.not.enough"),
FIN_CREDIT_TRADE_NOT_FOUND(11004, "fin.credit.trade.not.found"),
// ------------------------------------- 财务
// 余额
FIN_CUSTOMER_BALANCE_NOT_ENOUGH(11000, "fin.customer.balance.not.enough"),
FIN_CUSTOMER_CREDIT_NOT_ENOUGH(11000, "fin.customer.credit.not.enough"),
FIN_CUSTOMER_PAY_OVER_REPAY(11001, "fin.customer.pay.over.repay"),
// ------------------------------------- 财务
//-----购物车
CART_STOCK_COUNT_ERROR(20000, "CART.STOCK.COUNT.ERROR"),
//-----购物车
//---前台售后
OD_ORDER_AFTER_SALE_ERROR_AFTER_SALE_VALIDITY(500, "OD.AFTER.SALE.ORDER.ERROR.AFTER.SALE.VALIDITY"),
OD_ORDER_AFTER_SALE_ERROR_NOT_SUPPORT(500, "OD.AFTER.SALE.ORDER.ERROR.AFTER.NOT.SUPPORT"),
//---前台售后
//-----------销售售后
OD_AFTER_SALE_ERROR_CANCEL_NOT_SUPPORT(500, "OD.AFTER.SALE.ERROR.CANCEL.NOT.SUPPORT"),
SYSTEM_ERROR_QUANTITY_INSUFFICIENT(500, "SYSTEM.ERROR.QUANTITY.INSUFFICIENT"),
//基础信息
BASE_PRODUCT_ERROR_CODE_EXISTS(500, "BASE.PRODUCT.ERROR.CODE.EXISTS"),
BASE_LINE_ERROR_CODE_EXISTS(500, "BASE.LINE.ERROR.CODE.EXISTS"),
BASE_LINE_ERROR_NAME_EXISTS(500, "BASE.LINE.ERROR.NAME.EXISTS"),
BASE_EQUIP_PARAM_ERROR_CODE_EXISTS(500, "BASE.EQUIP.PARAM.ERROR.CODE.EXISTS"),
BASE_EQUIP_PARAM_GROUP_ERROR_CODE_EXISTS(500, "BASE.EQUIP.PARAM.GROUP.ERROR.CODE.EXISTS"),
BASE_PROCESS_ERROR_CODE_EXISTS(500, "BASE.PROCESS.ERROR.CODE.EXISTS"),
BASE_PROCESS_ERROR_NAME_EXISTS(500, "BASE.PROCESS.ERROR.NAME.EXISTS"),
BASE_STATION_POST_ERROR_CODE_EXISTS(500, "BASE.STATION.POST.ERROR.CODE.EXISTS"),
BASE_STATION_POST_ERROR_NAME_EXISTS(500, "BASE.STATION.POST.ERROR.NAME.EXISTS"),
BASE_PROCESS_GRAPH_INFO_ERROR_EXISTS(500, "BASE.PROCESS.GRAPH.INFO.ERROR.EXISTS"),
//esop
ESOP_ERROR_PARAM_GROUP_CANT_DELETE(500, "ESOP.ERROR.PARAM.GROUP.CANT.DELETE"),
ESOP_ERROR_PARAM_FIRST_NAME_DUPLICATE(500, "ESOP.ERROR.PARAM.FIRST.NAME.DUPLICATE"),
ESOP_ERROR_PARAM_SECOND_NAME_DUPLICATE(500, "ESOP.ERROR.PARAM.SECOND.NAME.DUPLICATE"),
ESOP_ERROR_ING_MAKE_CANT_DO(500, "ESOP.ERROR.ING.MAKE.CANT.DO"),
//点检
INS_ITEM_GROUP_CANT_DELETE(500,"INS.ITEM.GROUP.CANT.DELETE"),
// 治具
FIXTURE_STATION_CATEG_EXISTS(500, "FIXTURE.STATION.CATEG.EXISTS"),
SYSTEM_ERROR_WAREHOUSE_CANT_DELETE(500, "SYSTEM.ERROR.WAREHOUSE.CANT.DELETE"),
SYSTEM_ERROR_GOODS_SHELVES_CANT_DELETE(500, "SYSTEM.ERROR.GOODS.SHELVES.CANT.DELETE"),
SYSTEM_ERROR_WAREHOUSE_LOCATION_CANT_DELETE(500, "SYSTEM.ERROR.WAREHOUSE.LOCATION.CANT.DELETE"),
SYSTEM_ERROR_WAREHOUSE_LOCATION_GENERATE_QRCODE(500, "SYSTEM.ERROR.WAREHOUSE.LOCATION.GENERATE.QRCODE"),
FIXTURE_TEST_SYSTEM_DELETE_FAIL(500, "FIXTURE.TEST.SYSTEM.DELETE.FAIL"),
FIXTURE_CATEGORY_DELETE_FAIL(500, "FIXTURE.CATEGORY.DELETE.FAIL"),
FIXTURE_LEDGER_SERIES_EXISTS(500, "FIXTURE.LEDGER.SERIES.EXISTS"),
FIXTURE_LEDGER_DELETE_FAIL(500, "FIXTURE.LEDGER.DELETE.FAIL"),
//治具单据
FIXTURE_BOUND_TYPE_NOT_NULL(500, "FIXTURE.BOUND.TYPE.NOT.NULL"),
FIXTURE_LEND_OUT_BOUND_CHECK(500, "FIXTURE.LEND.OUT.BOUND.CHECK"),
//材料管理
MATERIAL_NAME_ALREADY_EXISTS(500, "物料编号已存在"),
NO_MATERIALS_TO_COUNT(500, "没有可盘点的物料"),
CATEGORY_NAME_ALREADY_EXISTS(500, "此类型名称已存在"),
REASON_NAME_ALREADY_EXISTS(500, "此出库名称已存在"),
; ;
/** /**
......
...@@ -4,8 +4,9 @@ public class HeaderConst { ...@@ -4,8 +4,9 @@ public class HeaderConst {
public static final String TENANT_ID = Const.TENANT_ID; public static final String TENANT_ID = Const.TENANT_ID;
public static final String PLATFORM_TOKEN = "platformToken"; //todo 2023年8月29日 不区分呢
// public static final String PLATFORM_TOKEN = "platformToken";
public static final String PLATFORM_TOKEN = "token";
public static final String TOKEN = "token"; public static final String TOKEN = "token";
public static final String WECHAT_TOKEN = "wechatToken"; public static final String WECHAT_TOKEN = "wechatToken";
......
...@@ -12,6 +12,10 @@ public class InterceptorOrderConst { ...@@ -12,6 +12,10 @@ public class InterceptorOrderConst {
public static final int REQUEST_ID_INTERCEPTOR = 105;//这里用到用户信息 public static final int REQUEST_ID_INTERCEPTOR = 105;//这里用到用户信息
public static final int PLAT_AUTHENTICATION_INTERCEPTOR = 120;
public static final int PLAT_AUTHORIZATION_INTERCEPTOR = 130;
public static final int TNT_AUTHENTICATION_INTERCEPTOR = 140; public static final int TNT_AUTHENTICATION_INTERCEPTOR = 140;
public static final int TNT_AUTHORIZATION_INTERCEPTOR = 150; public static final int TNT_AUTHORIZATION_INTERCEPTOR = 150;
......
...@@ -48,12 +48,16 @@ public class RedisConst { ...@@ -48,12 +48,16 @@ public class RedisConst {
//public static final String PLATFORM_TOKEN_PREFIX = "plat:token:"; //public static final String PLATFORM_TOKEN_PREFIX = "plat:token:";
//public static final String PLATFORM_TOKEN_ROLE_MENU_PREFIX = "plat:role:menu:token:";//TODO ywc 这里可能有大key问题 //public static final String PLATFORM_TOKEN_ROLE_MENU_PREFIX = "plat:role:menu:token:";//TODO ywc 这里可能有大key问题
//todo 为啥要区分?
public static final String TOKEN_PREFIX = "token:"; public static final String TOKEN_PREFIX = "token:";
public static final String TOKEN_ROLE_MENU_PREFIX = "role:menu:token:";//TODO ywc 这里可能有大key问题 改成list存? public static final String TOKEN_ROLE_MENU_PREFIX = "role:menu:token:";//TODO ywc 这里可能有大key问题 改成list存?
public static final String WECHAT_TOKEN_PREFIX = "wechat:token:"; public static final String WECHAT_TOKEN_PREFIX = "wechat:token:";
public static final String WECHAT_TOKEN_ROLE_MENU_PREFIX = "wechat:role:menu:token:";//TODO ywc 这里可能有大key问题 public static final String WECHAT_TOKEN_ROLE_MENU_PREFIX = "wechat:role:menu:token:";//TODO ywc 这里可能有大key问题
public static final String PLATFORM_TOKEN_PREFIX = "plat:token:";
public static final String PLATFORM_TOKEN_ROLE_MENU_PREFIX = "plat:role:menu:token:";
//public static final String CUS_TOKEN_PREFIX = "cus:token:"; //public static final String CUS_TOKEN_PREFIX = "cus:token:";
public static final int PLATFORM_EXPIRE_MINUTES = 120; public static final int PLATFORM_EXPIRE_MINUTES = 120;
...@@ -86,8 +90,7 @@ public class RedisConst { ...@@ -86,8 +90,7 @@ public class RedisConst {
public static final String TOPIC_TNT_CONFIG_REFRESH = "topic:tnt:config:refresh"; public static final String TOPIC_TNT_CONFIG_REFRESH = "topic:tnt:config:refresh";
public static final String TOPIC_I18N_DIC_REFRESH = "topic:i18n:dict:refresh"; public static final String TOPIC_I18N_DIC_REFRESH = "topic:i18n:dict:refresh";
public static final String PLATFORM_TOKEN_PREFIX = "plat:token:";
public static final String PLATFORM_TOKEN_ROLE_MENU_PREFIX = "plat:role:menu:token:";
......
package com.makeit.global.inteceptor;
import com.makeit.enums.order.InterceptorOrderConst;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.utils.user.TokenUtil;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Order(InterceptorOrderConst.PLAT_AUTHENTICATION_INTERCEPTOR)
@Component
public class SaasAuthenticationInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
AuthIgnore annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(AuthIgnore.class);
} else {
return true;
}
//如果有@IgnoreAuth注解,则不验证token
if (annotation != null) {
return true;
}
TokenUtil.platGetToken();
TokenUtil.platRefreshToken();
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
}
}
package com.makeit.global.inteceptor;
import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.id.IdConst;
import com.makeit.enums.order.InterceptorOrderConst;
import com.makeit.exception.BusinessException;
import com.makeit.global.annotation.Action;
import com.makeit.module.admin.saas.SaasUserRoleMenuRedisVO;
import com.makeit.utils.user.PlatUserUtil;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashSet;
import java.util.Set;
@Order(InterceptorOrderConst.PLAT_AUTHORIZATION_INTERCEPTOR)
@Component
public class SaasAuthorizationInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
Action annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(Action.class);
} else {
return true;
}
//如果没有@PermissionInfo注解,则不验证
if (annotation == null) {
return true;
}
SaasUserRoleMenuRedisVO userLoginVO = PlatUserUtil.getPlatUserRoleMenu();
if (userLoginVO == null) {
return true;
}
if (IdConst.SUPER_ADMIN_ID.equals(userLoginVO.getId())) {
return true;
}
Set<String> codeSet = new HashSet<>(userLoginVO.getButtonCodeList());
for (String e : annotation.code()) {
if (codeSet.contains(e)) {
return true;
}
}
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_NO_PERMISSION);
//return false;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
}
}
...@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletResponse;
@Order(InterceptorOrderConst.TNT_AUTHENTICATION_INTERCEPTOR) @Order(InterceptorOrderConst.TNT_AUTHENTICATION_INTERCEPTOR)
@Component @Component
public class SysAuthenticationInterceptor implements HandlerInterceptor { public class TntAuthenticationInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
......
...@@ -20,7 +20,7 @@ import java.util.Set; ...@@ -20,7 +20,7 @@ import java.util.Set;
@Order(InterceptorOrderConst.TNT_AUTHORIZATION_INTERCEPTOR) @Order(InterceptorOrderConst.TNT_AUTHORIZATION_INTERCEPTOR)
@Component @Component
public class SysAuthorizationInterceptor implements HandlerInterceptor { public class TntAuthorizationInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
......
package com.makeit.module.admin.dto; package com.makeit.module.admin.dto;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ApiModel("部门 查询") @ApiModel("部门 查询")
@Data @Data
public class SysDeptQueryDTO extends BaseTenantIdDTO { public class SysDeptQueryDTO extends BaseTenantDTO {
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
private String name; private String name;
......
package com.makeit.module.admin.dto; package com.makeit.module.admin.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -15,7 +15,7 @@ import java.util.List; ...@@ -15,7 +15,7 @@ import java.util.List;
@ApiModel("角色 列表 新增 编辑 详情") @ApiModel("角色 列表 新增 编辑 详情")
@Data @Data
public class SysRoleDTOVO extends BaseTenantIdDTO implements Serializable { public class SysRoleDTOVO extends BaseTenantDTO implements Serializable {
@NotBlank(message = "名称不能为空") @NotBlank(message = "名称不能为空")
@Size(max = 64, message = "名称最长为64字符") @Size(max = 64, message = "名称最长为64字符")
......
package com.makeit.module.admin.dto; package com.makeit.module.admin.dto;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
@ApiModel("角色分配菜单") @ApiModel("角色分配菜单")
@Data @Data
public class SysRoleMenuDTO extends BaseTenantIdDTO implements Serializable { public class SysRoleMenuDTO extends BaseTenantDTO implements Serializable {
// @ApiModelProperty(value = "菜单id") // @ApiModelProperty(value = "菜单id")
// private String menuId; // private String menuId;
......
package com.makeit.module.admin.dto; package com.makeit.module.admin.dto;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -9,7 +9,7 @@ import java.io.Serializable; ...@@ -9,7 +9,7 @@ import java.io.Serializable;
@ApiModel("角色分配用户") @ApiModel("角色分配用户")
@Data @Data
public class SysUserRoleDTO extends BaseTenantIdDTO implements Serializable { public class SysUserRoleDTO extends BaseTenantDTO implements Serializable {
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private String userId; private String userId;
......
...@@ -67,7 +67,7 @@ public class PlatMenuDTOVO extends BaseIdDTO implements Serializable { ...@@ -67,7 +67,7 @@ public class PlatMenuDTOVO extends BaseIdDTO implements Serializable {
*/ */
@ApiModelProperty(value = "创建时间", required = false) @ApiModelProperty(value = "创建时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createDate;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "子集") @ApiModelProperty(value = "子集")
......
...@@ -12,9 +12,9 @@ import javax.validation.constraints.Size; ...@@ -12,9 +12,9 @@ import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("平台端角色 列表 新增 编辑 详情") @ApiModel("SAAS端角色 列表 新增 编辑 详情")
@Data @Data
public class PlatRoleDTOVO extends BaseIdDTO implements Serializable { public class SaasRoleDTOVO extends BaseIdDTO implements Serializable {
@NotBlank(message = "名称不能为空") @NotBlank(message = "名称不能为空")
@Size(max = 64, message = "名称最长为64字符") @Size(max = 64, message = "名称最长为64字符")
...@@ -47,7 +47,7 @@ public class PlatRoleDTOVO extends BaseIdDTO implements Serializable { ...@@ -47,7 +47,7 @@ public class PlatRoleDTOVO extends BaseIdDTO implements Serializable {
*/ */
@ApiModelProperty(value = "创建时间", required = false) @ApiModelProperty(value = "创建时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createDate;
@ApiModelProperty(value = "关键词 查询用") @ApiModelProperty(value = "关键词 查询用")
private String keyword; private String keyword;
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
@ApiModel("平台端用户 新增 编辑 详情") @ApiModel("平台端用户 新增 编辑 详情")
@Data @Data
public class PlatUserDTOVO extends BaseIdDTO implements Serializable { public class SaasUserDTOVO extends BaseIdDTO implements Serializable {
// @ApiModelProperty(value = "用户名") // @ApiModelProperty(value = "用户名")
...@@ -60,9 +60,9 @@ public class PlatUserDTOVO extends BaseIdDTO implements Serializable { ...@@ -60,9 +60,9 @@ public class PlatUserDTOVO extends BaseIdDTO implements Serializable {
*/ */
@ApiModelProperty(value = "创建时间", required = false) @ApiModelProperty(value = "创建时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createDate;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "角色集合") @ApiModelProperty(value = "角色集合")
private List<PlatRoleDTOVO> roleList; private List<SaasRoleDTOVO> roleList;
} }
...@@ -7,7 +7,7 @@ import java.io.Serializable; ...@@ -7,7 +7,7 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
public class UserRoleMenuRedisVO implements Serializable { public class SaasUserRoleMenuRedisVO implements Serializable {
@ApiModelProperty("id") @ApiModelProperty("id")
private String id; private String id;
......
...@@ -64,7 +64,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -64,7 +64,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
.eq(StringUtils.isNotBlank(dto.getTag()), SysDept::getTag, dto.getTag()) .eq(StringUtils.isNotBlank(dto.getTag()), SysDept::getTag, dto.getTag())
.orderByAsc(SysDept::getTag) .orderByAsc(SysDept::getTag)
.orderByAsc(SysDept::getCreatedAt); .orderByAsc(SysDept::getCreateDate);
return lambdaQueryWrapper; return lambdaQueryWrapper;
} }
......
...@@ -71,7 +71,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact ...@@ -71,7 +71,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
LambdaQueryWrapper<SysFactory> lambdaQueryWrapper = new QueryWrapper<SysFactory>().lambda() LambdaQueryWrapper<SysFactory> lambdaQueryWrapper = new QueryWrapper<SysFactory>().lambda()
.like(StringUtils.isNotBlank(dto.getName()), SysFactory::getName, dto.getName()); .like(StringUtils.isNotBlank(dto.getName()), SysFactory::getName, dto.getName());
lambdaQueryWrapper.orderByDesc(SysFactory::getCreatedAt); lambdaQueryWrapper.orderByDesc(SysFactory::getCreateDate);
return lambdaQueryWrapper; return lambdaQueryWrapper;
} }
...@@ -157,7 +157,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact ...@@ -157,7 +157,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
if (SysUserUtil.isSuper()) { if (SysUserUtil.isSuper()) {
List<SysFactory> factoryList = list(new QueryWrapper<SysFactory>().lambda() List<SysFactory> factoryList = list(new QueryWrapper<SysFactory>().lambda()
.orderByAsc(SysFactory::getCreatedAt) .orderByAsc(SysFactory::getCreateDate)
); );
return factoryList; return factoryList;
} }
...@@ -171,7 +171,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact ...@@ -171,7 +171,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
List<SysFactory> factoryList = list(new QueryWrapper<SysFactory>().lambda() List<SysFactory> factoryList = list(new QueryWrapper<SysFactory>().lambda()
.in(SysFactory::getId, factoryIdList) .in(SysFactory::getId, factoryIdList)
.orderByAsc(SysFactory::getCreatedAt) .orderByAsc(SysFactory::getCreateDate)
); );
return factoryList; return factoryList;
...@@ -200,7 +200,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact ...@@ -200,7 +200,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
userIdList = new ArrayList<>(userIdList); userIdList = new ArrayList<>(userIdList);
userIdList.add(-1 + ""); userIdList.add(-1 + "");
List<SysFactory> tenantList = list(new QueryWrapper<SysFactory>().lambda() List<SysFactory> tenantList = list(new QueryWrapper<SysFactory>().lambda()
.orderByAsc(SysFactory::getCreatedAt) .orderByAsc(SysFactory::getCreateDate)
); );
return BeanDtoVoUtils.listVo(tenantList, SysFactoryDTOVO.class); return BeanDtoVoUtils.listVo(tenantList, SysFactoryDTOVO.class);
} }
......
...@@ -68,7 +68,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl ...@@ -68,7 +68,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
.in(StringUtils.isNotBlank(dto.getRoleId()), SysMenu::getId, menuIdList) .in(StringUtils.isNotBlank(dto.getRoleId()), SysMenu::getId, menuIdList)
//.orderByAsc(TntMenu::getParentId) //.orderByAsc(TntMenu::getParentId)
.orderByAsc(SysMenu::getSort) .orderByAsc(SysMenu::getSort)
.orderByAsc(SysMenu::getCreatedAt) .orderByAsc(SysMenu::getCreateBy)
); );
return BeanDtoVoUtils.listVo(sysMenuList, SysMenuDTOVO.class); return BeanDtoVoUtils.listVo(sysMenuList, SysMenuDTOVO.class);
......
...@@ -86,7 +86,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -86,7 +86,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
.like(StringUtils.isNotBlank(dto.getKeyword()), SysRole::getName, dto.getKeyword()); .like(StringUtils.isNotBlank(dto.getKeyword()), SysRole::getName, dto.getKeyword());
}) })
.eq(StringUtils.isNotBlank(dto.getStatus()), SysRole::getStatus, dto.getStatus()) .eq(StringUtils.isNotBlank(dto.getStatus()), SysRole::getStatus, dto.getStatus())
.orderByDesc(SysRole::getCreatedAt); .orderByDesc(SysRole::getCreateDate);
menuFilter(dto, lambdaQueryWrapper); menuFilter(dto, lambdaQueryWrapper);
......
...@@ -271,7 +271,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -271,7 +271,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
List<SysMenu> menuList = sysMenuService.list(new QueryWrapper<SysMenu>().lambda() List<SysMenu> menuList = sysMenuService.list(new QueryWrapper<SysMenu>().lambda()
.eq(SysMenu::getStatus, CommonEnum.YES.getValue()) .eq(SysMenu::getStatus, CommonEnum.YES.getValue())
.orderByAsc(SysMenu::getSort) .orderByAsc(SysMenu::getSort)
.orderByAsc(SysMenu::getCreatedAt) .orderByAsc(SysMenu::getCreateDate)
); );
return menuList; return menuList;
...@@ -385,7 +385,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -385,7 +385,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
.in(SysMenu::getId, menuIdList) .in(SysMenu::getId, menuIdList)
.eq(SysMenu::getStatus, CommonEnum.YES.getValue()) .eq(SysMenu::getStatus, CommonEnum.YES.getValue())
.orderByAsc(SysMenu::getSort) .orderByAsc(SysMenu::getSort)
.orderByAsc(SysMenu::getCreatedAt) .orderByAsc(SysMenu::getCreateDate)
); );
userLoginVO.setRoleList(BeanDtoVoUtils.listVo(roleList, SysRoleDTOVO.class)); userLoginVO.setRoleList(BeanDtoVoUtils.listVo(roleList, SysRoleDTOVO.class));
...@@ -560,7 +560,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -560,7 +560,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
roleIdList(lambdaQueryWrapper, dto); roleIdList(lambdaQueryWrapper, dto);
lambdaQueryWrapper.orderByDesc(SysUser::getCreatedAt); lambdaQueryWrapper.orderByDesc(SysUser::getCreateDate);
lambdaQueryWrapper.orderByDesc(SysUser::getId); lambdaQueryWrapper.orderByDesc(SysUser::getId);
//TODO ywc 要不要改成全查出来 内存过滤 //TODO ywc 要不要改成全查出来 内存过滤
......
package com.makeit.module.system.dto; package com.makeit.module.system.dto;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
public class SysConfigCategoryDTOVO extends BaseTenantIdDTO { public class SysConfigCategoryDTOVO extends BaseTenantDTO {
@ApiModelProperty("编码") @ApiModelProperty("编码")
private String code; private String code;
......
...@@ -35,7 +35,7 @@ public class SysConfigCategoryServiceImpl extends ServiceImpl<SysConfigCategoryM ...@@ -35,7 +35,7 @@ public class SysConfigCategoryServiceImpl extends ServiceImpl<SysConfigCategoryM
.like(StringUtils.isNotBlank(tntConfigCategory.getName()), SysConfigCategory::getName, tntConfigCategory.getName()) .like(StringUtils.isNotBlank(tntConfigCategory.getName()), SysConfigCategory::getName, tntConfigCategory.getName())
.like(StringUtils.isNotBlank(tntConfigCategory.getCode()), SysConfigCategory::getCode, tntConfigCategory.getCode()) .like(StringUtils.isNotBlank(tntConfigCategory.getCode()), SysConfigCategory::getCode, tntConfigCategory.getCode())
.eq(SysConfigCategory::getTenantId, tntConfigCategory.getTenantId()) .eq(SysConfigCategory::getTenantId, tntConfigCategory.getTenantId())
.orderByAsc(SysConfigCategory::getCreatedAt) .orderByAsc(SysConfigCategory::getCreateDate)
); );
return BeanDtoVoUtils.listVo(configCategoryList, SysConfigCategoryDTOVO.class); return BeanDtoVoUtils.listVo(configCategoryList, SysConfigCategoryDTOVO.class);
} }
......
...@@ -36,10 +36,10 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC ...@@ -36,10 +36,10 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
public List<SysDictionaryCategory> getEpDictionaryCategoryByList() { public List<SysDictionaryCategory> getEpDictionaryCategoryByList() {
List<SysDictionaryCategory> sysDictionaryCategoryList = list(new QueryWrapper<SysDictionaryCategory>().lambda() List<SysDictionaryCategory> sysDictionaryCategoryList = list(new QueryWrapper<SysDictionaryCategory>().lambda()
/*.orderByAsc(PlatDictionaryCategory::getSort)*/.orderByAsc(SysDictionaryCategory::getCreatedAt)); /*.orderByAsc(PlatDictionaryCategory::getSort)*/.orderByAsc(SysDictionaryCategory::getCreateDate));
List<SysDictionary> sysDictionaryList = sysDictionaryService.list(new QueryWrapper<SysDictionary>().lambda() List<SysDictionary> sysDictionaryList = sysDictionaryService.list(new QueryWrapper<SysDictionary>().lambda()
.orderByAsc(SysDictionary::getSort).orderByAsc(SysDictionary::getCreatedAt)); .orderByAsc(SysDictionary::getSort).orderByAsc(SysDictionary::getCreateDate));
Map<String, List<SysDictionary>> sysDictionaryMap = sysDictionaryList.stream().collect(Collectors.groupingBy(item -> item.getCategoryId())); Map<String, List<SysDictionary>> sysDictionaryMap = sysDictionaryList.stream().collect(Collectors.groupingBy(item -> item.getCategoryId()));
for (SysDictionaryCategory sysDictionaryCategory : sysDictionaryCategoryList) { for (SysDictionaryCategory sysDictionaryCategory : sysDictionaryCategoryList) {
...@@ -55,13 +55,13 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC ...@@ -55,13 +55,13 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
List<SysDictionaryCategory> sysDictionaryCategoryList = list(new QueryWrapper<SysDictionaryCategory>().lambda() List<SysDictionaryCategory> sysDictionaryCategoryList = list(new QueryWrapper<SysDictionaryCategory>().lambda()
.like(SysDictionaryCategory::getCode, prefix) .like(SysDictionaryCategory::getCode, prefix)
.orderByAsc(SysDictionaryCategory::getCreatedAt)); .orderByAsc(SysDictionaryCategory::getCreateDate));
List<String> idList = StreamUtil.mapId(sysDictionaryCategoryList, SysDictionaryCategory::getId); List<String> idList = StreamUtil.mapId(sysDictionaryCategoryList, SysDictionaryCategory::getId);
List<SysDictionary> sysDictionaryList = sysDictionaryService.list(new QueryWrapper<SysDictionary>().lambda() List<SysDictionary> sysDictionaryList = sysDictionaryService.list(new QueryWrapper<SysDictionary>().lambda()
.in(SysDictionary::getCategoryId, idList) .in(SysDictionary::getCategoryId, idList)
.orderByAsc(SysDictionary::getSort).orderByAsc(SysDictionary::getCreatedAt)); .orderByAsc(SysDictionary::getSort).orderByAsc(SysDictionary::getCreateDate));
Map<String, List<SysDictionary>> sysDictionaryMap = sysDictionaryList.stream().collect(Collectors.groupingBy(item -> item.getCategoryId())); Map<String, List<SysDictionary>> sysDictionaryMap = sysDictionaryList.stream().collect(Collectors.groupingBy(item -> item.getCategoryId()));
for (SysDictionaryCategory sysDictionaryCategory : sysDictionaryCategoryList) { for (SysDictionaryCategory sysDictionaryCategory : sysDictionaryCategoryList) {
...@@ -124,7 +124,7 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC ...@@ -124,7 +124,7 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
public List<SysDictionaryCategory> list(SysDictionaryCategory sysDictionaryCategory) { public List<SysDictionaryCategory> list(SysDictionaryCategory sysDictionaryCategory) {
List<SysDictionaryCategory> configCategoryList = list(new QueryWrapper<SysDictionaryCategory>().lambda() List<SysDictionaryCategory> configCategoryList = list(new QueryWrapper<SysDictionaryCategory>().lambda()
.like(StringUtils.isNotBlank(sysDictionaryCategory.getName()), SysDictionaryCategory::getName, sysDictionaryCategory.getName()) .like(StringUtils.isNotBlank(sysDictionaryCategory.getName()), SysDictionaryCategory::getName, sysDictionaryCategory.getName())
.orderByAsc(SysDictionaryCategory::getCreatedAt) .orderByAsc(SysDictionaryCategory::getCreateDate)
); );
return configCategoryList; return configCategoryList;
} }
......
...@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; ...@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.common.entity.BaseBusEntity; import com.makeit.common.entity.BaseBusEntity;
import com.makeit.global.aspect.tenant.TenantIdUtil; import com.makeit.global.aspect.tenant.TenantIdUtil;
...@@ -30,7 +30,7 @@ public class WrapperUtil { ...@@ -30,7 +30,7 @@ public class WrapperUtil {
return lambdaQueryWrapper; return lambdaQueryWrapper;
} }
public static <T extends BaseBusEntity> LambdaQueryWrapper<T> withTenantId(BaseTenantIdDTO baseFactoryDTO, Class<T> clazz) { public static <T extends BaseBusEntity> LambdaQueryWrapper<T> withTenantId(BaseTenantDTO baseFactoryDTO, Class<T> clazz) {
LambdaQueryWrapper<T> lambdaQueryWrapper = new LambdaQueryWrapper<>(clazz); LambdaQueryWrapper<T> lambdaQueryWrapper = new LambdaQueryWrapper<>(clazz);
lambdaQueryWrapper.eq(BaseBusEntity::getTenantId, baseFactoryDTO.getTenantId()); lambdaQueryWrapper.eq(BaseBusEntity::getTenantId, baseFactoryDTO.getTenantId());
return lambdaQueryWrapper; return lambdaQueryWrapper;
......
package com.makeit.utils.user; package com.makeit.utils.user;
import com.makeit.module.admin.saas.UserRoleMenuRedisVO; import com.makeit.module.admin.saas.SaasUserRoleMenuRedisVO;
import com.makeit.utils.data.convert.BeanDtoVoUtils; import com.makeit.utils.data.convert.BeanDtoVoUtils;
public class PlatUserUtil { public class PlatUserUtil {
...@@ -15,12 +15,12 @@ public class PlatUserUtil { ...@@ -15,12 +15,12 @@ public class PlatUserUtil {
return BeanDtoVoUtils.convert(TokenUtil.getPlatUserDetail(), PlatUserVO.class); return BeanDtoVoUtils.convert(TokenUtil.getPlatUserDetail(), PlatUserVO.class);
} }
public static UserLoginVO getUserVODetail() { public static SaasUserLoginVO getUserVODetail() {
TokenUtil.platGetToken(); TokenUtil.platGetToken();
return TokenUtil.getPlatUserDetail(); return TokenUtil.getPlatUserDetail();
} }
public static UserRoleMenuRedisVO getPlatUserRoleMenu(){ public static SaasUserRoleMenuRedisVO getPlatUserRoleMenu(){
return TokenUtil.getPlatUserRoleMenu(); return TokenUtil.getPlatUserRoleMenu();
} }
......
...@@ -2,7 +2,7 @@ package com.makeit.utils.user; ...@@ -2,7 +2,7 @@ package com.makeit.utils.user;
import com.makeit.module.admin.saas.PlatMenuDTOVO; import com.makeit.module.admin.saas.PlatMenuDTOVO;
import com.makeit.module.admin.saas.PlatRoleDTOVO; import com.makeit.module.admin.saas.SaasRoleDTOVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -10,7 +10,7 @@ import java.io.Serializable; ...@@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
public class UserLoginVO implements Serializable { public class SaasUserLoginVO implements Serializable {
@ApiModelProperty("id") @ApiModelProperty("id")
private String id; private String id;
...@@ -19,7 +19,7 @@ public class UserLoginVO implements Serializable { ...@@ -19,7 +19,7 @@ public class UserLoginVO implements Serializable {
private String account; private String account;
@ApiModelProperty("姓名") @ApiModelProperty("姓名")
private String name; private String username;
// @ApiModelProperty("用户名") // @ApiModelProperty("用户名")
// private String username; // private String username;
...@@ -28,7 +28,7 @@ public class UserLoginVO implements Serializable { ...@@ -28,7 +28,7 @@ public class UserLoginVO implements Serializable {
private String token; private String token;
@ApiModelProperty("角色列表") @ApiModelProperty("角色列表")
private List<PlatRoleDTOVO> roleList; private List<SaasRoleDTOVO> roleList;
@ApiModelProperty("菜单树形列表") @ApiModelProperty("菜单树形列表")
private List<PlatMenuDTOVO> menuList; private List<PlatMenuDTOVO> menuList;
......
...@@ -13,7 +13,7 @@ public class ThreadLocalUserUtil { ...@@ -13,7 +13,7 @@ public class ThreadLocalUserUtil {
private static final ThreadLocal<String> THREAD_LOCAL_TNT_TOKEN = new BizThreadLocal<>(); private static final ThreadLocal<String> THREAD_LOCAL_TNT_TOKEN = new BizThreadLocal<>();
private static final ThreadLocal<String> THREAD_LOCAL_WECHAT_TOKEN = new BizThreadLocal<>(); private static final ThreadLocal<String> THREAD_LOCAL_WECHAT_TOKEN = new BizThreadLocal<>();
private static final ThreadLocal<UserLoginVO> THREAD_LOCAL_TNT_USER = new BizThreadLocal<>(); private static final ThreadLocal<SaasUserLoginVO> THREAD_LOCAL_TNT_USER = new BizThreadLocal<>();
private static final ThreadLocal<WechatUserInfo> THREAD_LOCAL_WECHAT_USER = new BizThreadLocal<>(); private static final ThreadLocal<WechatUserInfo> THREAD_LOCAL_WECHAT_USER = new BizThreadLocal<>();
private static final ThreadLocal<SysUserRoleMenuRedisVO> THREAD_LOCAL_TNT_USER_ROLE_MENU = new BizThreadLocal<>(); private static final ThreadLocal<SysUserRoleMenuRedisVO> THREAD_LOCAL_TNT_USER_ROLE_MENU = new BizThreadLocal<>();
...@@ -68,6 +68,11 @@ public class ThreadLocalUserUtil { ...@@ -68,6 +68,11 @@ public class ThreadLocalUserUtil {
} }
public static SaasUserLoginVO getSaasUser(){
SaasUserLoginVO saasUserDetail = TokenUtil.getSaasUserDetail();
return saasUserDetail;
}
public static WechatUserInfo getWechatUser() { public static WechatUserInfo getWechatUser() {
WechatUserInfo wechatUserInfo = THREAD_LOCAL_WECHAT_USER.get(); WechatUserInfo wechatUserInfo = THREAD_LOCAL_WECHAT_USER.get();
if (wechatUserInfo == null) { if (wechatUserInfo == null) {
......
...@@ -5,7 +5,7 @@ import com.makeit.enums.CodeMessageEnum; ...@@ -5,7 +5,7 @@ import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.HeaderConst; import com.makeit.enums.HeaderConst;
import com.makeit.enums.redis.RedisConst; import com.makeit.enums.redis.RedisConst;
import com.makeit.exception.BusinessException; import com.makeit.exception.BusinessException;
import com.makeit.module.admin.saas.UserRoleMenuRedisVO; import com.makeit.module.admin.saas.SaasUserRoleMenuRedisVO;
import com.makeit.utils.redis.RedisTemplateUtil; import com.makeit.utils.redis.RedisTemplateUtil;
import com.makeit.utils.redis.RedisUtil; import com.makeit.utils.redis.RedisUtil;
import com.makeit.utils.request.RequestUtil; import com.makeit.utils.request.RequestUtil;
...@@ -37,10 +37,10 @@ public class TokenUtil { ...@@ -37,10 +37,10 @@ public class TokenUtil {
return getToken(RedisConst.PLATFORM_TOKEN_PREFIX, RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN)); return getToken(RedisConst.PLATFORM_TOKEN_PREFIX, RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN));
} }
public static UserLoginVO getPlatUserDetail() { public static SaasUserLoginVO getPlatUserDetail() {
String token = RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN); String token = RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN);
if (StringUtils.isNotBlank(token)) { if (StringUtils.isNotBlank(token)) {
UserLoginVO userLoginVO = RedisUtil.get(RedisConst.PLATFORM_TOKEN_PREFIX + token); SaasUserLoginVO userLoginVO = RedisUtil.get(RedisConst.PLATFORM_TOKEN_PREFIX + token);
return userLoginVO; return userLoginVO;
} }
return null; return null;
...@@ -66,9 +66,9 @@ public class TokenUtil { ...@@ -66,9 +66,9 @@ public class TokenUtil {
RedisTemplateUtil.expire(prefix + token, RedisConst.PLATFORM_EXPIRE_MINUTES, TimeUnit.MINUTES); RedisTemplateUtil.expire(prefix + token, RedisConst.PLATFORM_EXPIRE_MINUTES, TimeUnit.MINUTES);
} }
public static UserLoginVO getTntUserDetail(String token) { public static SaasUserLoginVO getTntUserDetail(String token) {
if (StringUtils.isNotBlank(token)) { if (StringUtils.isNotBlank(token)) {
UserLoginVO userLoginVO = RedisTemplateUtil.get(RedisConst.TOKEN_PREFIX + token, UserLoginVO.class); SaasUserLoginVO userLoginVO = RedisTemplateUtil.get(RedisConst.TOKEN_PREFIX + token, SaasUserLoginVO.class);
return userLoginVO; return userLoginVO;
} }
return null; return null;
...@@ -217,6 +217,15 @@ public class TokenUtil { ...@@ -217,6 +217,15 @@ public class TokenUtil {
return null; return null;
} }
public static SaasUserLoginVO getSaasUserDetail() {
String token = RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN);
if (StringUtils.isNotBlank(token)) {
SaasUserLoginVO userLoginVO = RedisTemplateUtil.get(RedisConst.PLATFORM_TOKEN_PREFIX + token, SaasUserLoginVO.class);
return userLoginVO;
}
return null;
}
public static void setMobileCode(String phone, String token, Integer t, int minutes) { public static void setMobileCode(String phone, String token, Integer t, int minutes) {
RedisTemplateUtil.set(RedisConst.TOKEN_MOBILE_CODE_PREFIX + ":" + phone + ":" + token, t, minutes); RedisTemplateUtil.set(RedisConst.TOKEN_MOBILE_CODE_PREFIX + ":" + phone + ":" + token, t, minutes);
...@@ -284,16 +293,27 @@ public class TokenUtil { ...@@ -284,16 +293,27 @@ public class TokenUtil {
login(RedisConst.PLATFORM_TOKEN_ROLE_MENU_PREFIX, RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN), t); login(RedisConst.PLATFORM_TOKEN_ROLE_MENU_PREFIX, RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN), t);
} }
public static UserRoleMenuRedisVO getPlatUserRoleMenu() { public static SaasUserRoleMenuRedisVO getPlatUserRoleMenu() {
String token = RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN); String token = RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN);
if (StringUtils.isNotBlank(token)) { if (StringUtils.isNotBlank(token)) {
UserRoleMenuRedisVO userLoginVO = RedisUtil.get(RedisConst.PLATFORM_TOKEN_ROLE_MENU_PREFIX + token); SaasUserRoleMenuRedisVO userLoginVO = RedisUtil.get(RedisConst.PLATFORM_TOKEN_ROLE_MENU_PREFIX + token);
return userLoginVO; return userLoginVO;
} }
return null; return null;
} }
public static <T> void platLogin(String token, T t) { /**
* saas端登录
* @param token
* @param t
* @param <T>
*/
public static <T> void saasLogin(String token, T t) {
login(RedisConst.PLATFORM_TOKEN_PREFIX, token, t); login(RedisConst.PLATFORM_TOKEN_PREFIX, token, t);
} }
public static void platRefreshToken() {
refreshToken(RedisConst.PLATFORM_TOKEN_PREFIX, RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN));
refreshToken(RedisConst.PLATFORM_TOKEN_ROLE_MENU_PREFIX, RequestUtil.getHeader(HeaderConst.PLATFORM_TOKEN));
}
} }
...@@ -3,7 +3,7 @@ package com.makeit.utils.user.common; ...@@ -3,7 +3,7 @@ package com.makeit.utils.user.common;
import com.makeit.enums.HeaderConst; import com.makeit.enums.HeaderConst;
import com.makeit.utils.user.ThreadLocalUserUtil; import com.makeit.utils.user.ThreadLocalUserUtil;
import com.makeit.utils.user.TokenUtil; import com.makeit.utils.user.TokenUtil;
import com.makeit.utils.user.UserLoginVO; import com.makeit.utils.user.SaasUserLoginVO;
import com.makeit.utils.user.tenant.SysUserLoginVO; import com.makeit.utils.user.tenant.SysUserLoginVO;
import com.makeit.utils.user.wechat.WechatUserInfo; import com.makeit.utils.user.wechat.WechatUserInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -13,6 +13,7 @@ public class CommonUserUtil { ...@@ -13,6 +13,7 @@ public class CommonUserUtil {
public static CommonUserVO getUser() { public static CommonUserVO getUser() {
SysUserLoginVO sysUserLoginVO = ThreadLocalUserUtil.getTntUser(); SysUserLoginVO sysUserLoginVO = ThreadLocalUserUtil.getTntUser();
if (sysUserLoginVO != null) { if (sysUserLoginVO != null) {
return new CommonUserVO(sysUserLoginVO.getId(), sysUserLoginVO.getName()); return new CommonUserVO(sysUserLoginVO.getId(), sysUserLoginVO.getName());
...@@ -23,6 +24,11 @@ public class CommonUserUtil { ...@@ -23,6 +24,11 @@ public class CommonUserUtil {
return new CommonUserVO(wechatUserInfo.getId(), wechatUserInfo.getName()); return new CommonUserVO(wechatUserInfo.getId(), wechatUserInfo.getName());
} }
SaasUserLoginVO saasUser = ThreadLocalUserUtil.getSaasUser();
if(saasUser != null){
return new CommonUserVO(saasUser.getId(),saasUser.getUsername());
}
return null; return null;
} }
...@@ -39,9 +45,9 @@ public class CommonUserUtil { ...@@ -39,9 +45,9 @@ public class CommonUserUtil {
String wechatToken = httpHeaders.getFirst(HeaderConst.WECHAT_TOKEN); String wechatToken = httpHeaders.getFirst(HeaderConst.WECHAT_TOKEN);
if (StringUtils.isNotBlank(tenantToken)) { if (StringUtils.isNotBlank(tenantToken)) {
UserLoginVO sysUserLoginVO = TokenUtil.getTntUserDetail(tenantToken); SaasUserLoginVO sysUserLoginVO = TokenUtil.getTntUserDetail(tenantToken);
if (sysUserLoginVO != null) { if (sysUserLoginVO != null) {
return new CommonUserVO(sysUserLoginVO.getId(), sysUserLoginVO.getName()); return new CommonUserVO(sysUserLoginVO.getId(), sysUserLoginVO.getUsername());
} }
} }
......
package com.makeit.utils.user.tenant; package com.makeit.utils.user.tenant;
import com.makeit.common.dto.BaseTenantIdDTO; import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ApiModel("厂别用户vo") @ApiModel("厂别用户vo")
@Data @Data
public class SysUserVO extends BaseTenantIdDTO { public class SysUserVO extends BaseTenantDTO {
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
private String name; private String name;
......
# 业务信息
# 信息类型: info, error, warning, notice
# 格式: business + 信息类型 +\u3000模块\u3000+ 功能 +信息
# 请按模块区分\u3000例如business=error=auth=not=found, business=info=system
# 业务错误
TEST1=%ste%sst1
TEST2={0}te{1}st2
SYSTEM.ERROR.PARAMETER.ILLEGAL=参数不合法
SYSTEM.ERROR.SIGN.NOT.BLANK=签名不能为空
SYSTEM.ERROR.SIGN.ERROR=签名错误
SYSTEM.ERROR.NAME.DUPLICATE=该名称已存在
SYSTEM.ERROR.NAME.ENG.DUPLICATE=该英文名称已存在
SYSTEM.ERROR.CODE.DUPLICATE=该编码已存在
SYSTEM.ERROR.DICT.VALUE.DUPLICATE=该字典值已存在
SYSTEM.ERROR.DICT.NOT.EXIST=该字典值不存在
SYSTEM.ERROR.USER.JOB.NO.DUPLICATE=该登录名已存在
SYSTEM.ERROR.USER.ACCOUNT.DUPLICATE=该账号已存在
SYSTEM.ERROR.USER.NAME.DUPLICATE=该姓名已存在
SYSTEM.ERROR.USER.MOBILE.DUPLICATE=该手机号已存在
SYSTEM.ERROR.USER.MAIL.DUPLICATE=该邮箱已存在
SYSTEM.ERROR.CODE.RATE.LIMIT=验证码发送过于频繁,请稍后在发送
SYSTEM.ERROR.USER.PASSWORD.NOT.BLANK=密码不能为空
#SYSTEM.ERROR.USER.PASSWORD.FORMAT.ERROR=密码必须是包含大写字母、小写字母、数字、特殊符号(不含空格)的6~18位组合
SYSTEM.ERROR.USER.PASSWORD.FORMAT.ERROR=含字母和数字的6-18位密码
SYSTEM.ERROR.USER.PASSWORD.SAME=支付密码不能与登录密码一致
SYSTEM.ERROR.USER.SUPER.ADMIN.CANT.DO=超级管理员或超级管理员角色不支持该操作
SYSTEM.ERROR.USER.SUPER.ADMIN.CANT.EDIT=不能修改超级管理员或者超级管理员角色
SYSTEM.ERROR.ROLE.CANT.DELETE=存在员工绑定该角色,则不可删除
SYSTEM.ERROR.START.END.TIME.NOT.NULL=开始时间和结束时间不能为空
SYSTEM.ERROR.START.LE.END=开始时间要小于等于结束时间
SYSTEM.ERROR.CANT.CHANGE.TENANT.STATUS=当前时间要在开始时间和结束时间之间才能设置为启用
SYSTEM.ERROR.CANT.REMOVE.TENANT.USER.LINK=已经关联了厂别的管理员账号不允许删除
SYSTEM.ERROR.TMP.CODE.BLANK=验证码不能为空
#SYSTEM.ERROR.TMP.TOKEN.BLANK=token不能为空
SYSTEM.ERROR.TMP.TOKEN.BLANK=验证码不匹配
SYSTEM.ERROR.TOKEN.BLANK.OR.NOT.EXIST=token失效或不存在
SYSTEM.ERROR.NO.PERMISSION=无权限访问
SYSTEM.ERROR.TENANT.ID.NOT.BLANK=厂别id不能为空
SYSTEM.ERROR.TENANT.NOT.EXIST=该厂别不存在或者被禁用
SYSTEM.ERROR.DUPLICATE.REQUEST=请勿重复请求
#SYSTEM.ERROR.AUTH.USER.HAS.DISABLED=该用户已经离职/冻结
SYSTEM.ERROR.AUTH.USER.HAS.DISABLED=用户不存在/已冻结
SYSTEM.ERROR.AUTH.USER.ACCOUNT.PASSWORD=账号或者密码错误!
SYSTEM.ERROR.AUTH.USER.PASSWORD=密码错误
SYSTEM.ERROR.AUTH.USER.PAY.PASSWORD.BLANK=支付密码未设置
SYSTEM.ERROR.AUTH.USER.MAIL.NOT.SET=邮箱未设置
SYSTEM.ERROR.WECHAT.USER.NOT.EXIST=该企微账号对应的用户不存在
SYSTEM.ERROR.EXCEL.UPLOAD.EXIT=请上传excel
SYSTEM.ERROR.EXCEL.NOT.DATA=请至少上传一条数据
SYSTEM.ERROR.EXCEL.MAX.LIMIT=最大上传%s条数据
SYSTEM.ERROR.NO.EXCEL.FILE=请导入excel文件
SYSTEM.ERROR.CONFIG.NOT.EXIST=相关配置(数据字典不存在)
SYSTEM.ERROR.COMPANY.LEVEL.EXCEED=公司最多两级,集团——子公司
SYSTEM.ERROR.COMPANY.NOT.EXIST=公司不存在或者被禁用
SYSTEM.ERROR.DEPT.NAME.DUPLICATE=同一个公司下的部门不可重名
SYSTEM.ERROR.DEPT.LEVEL.EXCEED=同一个公司下的部门最多5级
SYSTEM.ERROR.DEPT.DELETE=当前部门有员工或当前部门有下级部门,不可删除
SYSTEM.ERROR.COMPANY.GROUP.CANT.EDIT=不能修改或删除集团
SYSTEM.ERROR.SMS.SEND=短信发送错误,错误信息%s
SYSTEM.ERROR.SMS.CODE.NOT.EXIST=验证码已过期
SYSTEM.ERROR.SMS.CODE.NOT.CORRECT=验证码不正确
PLATFORM.ERROR.ELDER.CERTIFICATENUMBER.DUPLICATE=证件号不能重复
\ No newline at end of file
SYSTEM.ERROR.PARAMETER.ILLEGAL=Illegal parameter
SYSTEM.ERROR.SIGN.NOT.BLANK=Signature cannot be empty
SYSTEM.ERROR.SIGN.ERROR=Signature error
SYSTEM.ERROR.NAME.DUPLICATE=The name already exists
SYSTEM.ERROR.NAME.ENG.DUPLICATE=The English name already exists
SYSTEM.ERROR.CODE.DUPLICATE=The code already exists
SYSTEM.ERROR.DICT.VALUE.DUPLICATE=The dictionary value already exists
SYSTEM.ERROR.DICT.NOT.EXIST=The dictionary value does not exist
SYSTEM.ERROR.USER.JOB.NO.DUPLICATE=The job number already exists
SYSTEM.ERROR.USER.ACCOUNT.DUPLICATE=This account already exists
SYSTEM.ERROR.USER.NAME.DUPLICATE=The name already exists
SYSTEM.ERROR.USER.MOBILE.DUPLICATE=The mobile number already exists
SYSTEM.ERROR.USER.MAIL.DUPLICATE=The mailbox already exists
SYSTEM.ERROR.CODE.RATE.LIMIT=The verification code is sent too frequently. Please send it later
SYSTEM.ERROR.USER.PASSWORD.NOT.BLANK=Password cannot be empty
#SYSTEM.ERROR.USER.PASSWORD.FORMAT.ERROR=The password must be a combination of 6 to 18 digits including uppercase letters, lowercase letters, numbers and special symbols (excluding spaces)
SYSTEM.ERROR.USER.PASSWORD.FORMAT.ERROR=6-18 digit password with letters and numbers
SYSTEM.ERROR.USER.PASSWORD.SAME=The payment password cannot be the same as the login password
SYSTEM.ERROR.USER.SUPER.ADMIN.CANT.DO=The operation is not supported by the administrator or administrator role
SYSTEM.ERROR.USER.SUPER.ADMIN.CANT.EDIT=Cannot modify super administrator or super administrator role
SYSTEM.ERROR.ROLE.CANT.DELETE=This role is bound by an employee and cannot be deleted
SYSTEM.ERROR.START.END.TIME.NOT.NULL=Start time and end time cannot be empty
SYSTEM.ERROR.START.LE.END=The start time should be less than or equal to the end time
SYSTEM.ERROR.CANT.CHANGE.TENANT.STATUS=The current time must be between the start time and the end time before it can be set as enabled
SYSTEM.ERROR.CANT.REMOVE.TENANT.USER.LINK=The administrator account associated with the tenant cannot be deleted
SYSTEM.ERROR.TMP.CODE.BLANK=Verification code does not match
SYSTEM.ERROR.TMP.TOKEN.BLANK=Token is invalid
SYSTEM.ERROR.TOKEN.BLANK.OR.NOT.EXIST=Token is invalid or does not exist
SYSTEM.ERROR.NO.PERMISSION=No access
SYSTEM.ERROR.TENANT.ID.NOT.BLANK=Tenant ID cannot be empty
SYSTEM.ERROR.TENANT.NOT.EXIST=The tenant does not exist or is disabled
SYSTEM.ERROR.DUPLICATE.REQUEST=Do not repeat the request
#SYSTEM.ERROR.AUTH.USER.HAS.DISABLED=The user has resigned/frozen
SYSTEM.ERROR.AUTH.USER.HAS.DISABLED=User does not exist/frozen
SYSTEM.ERROR.AUTH.USER.ACCOUNT.PASSWORD=Account or password error!
SYSTEM.ERROR.AUTH.USER.PASSWORD=Password error
SYSTEM.ERROR.AUTH.USER.PAY.PASSWORD.BLANK=Payment password is not set
SYSTEM.ERROR.AUTH.USER.MAIL.NOT.SET=Mailbox is not set
SYSTEM.ERROR.WECHAT.USER.NOT.EXIST=The user corresponding to the enterprise WeChat account does not exist
SYSTEM.ERROR.EXCEL.UPLOAD.EXIT=Please upload excel
SYSTEM.ERROR.EXCEL.NOT.DATA=Please upload at least one piece of data
SYSTEM.ERROR.EXCEL.MAX.LIMIT=Maximum upload %s data
SYSTEM.ERROR.NO.EXCEL.FILE=Please import excel file
SYSTEM.ERROR.CONFIG.NOT.EXIST=Related configuration (data dictionary does not exist)
SYSTEM.ERROR.COMPANY.LEVEL.EXCEED=At most two levels of the company
SYSTEM.ERROR.COMPANY.NOT.EXIST=The company does not exist or is disabled
SYSTEM.ERROR.DEPT.NAME.DUPLICATE=Departments under the same company cannot have the same name
SYSTEM.ERROR.DEPT.LEVEL.EXCEED=Up to 5 levels of departments in the same company
SYSTEM.ERROR.DEPT.DELETE=The current department has employees or subordinate departments, which cannot be deleted
SYSTEM.ERROR.COMPANY.GROUP.CANT.EDIT=Group cannot be modified or deleted
SYSTEM.ERROR.SMS.SEND=SMS sending error, error message %s
SYSTEM.ERROR.SMS.CODE.NOT.EXIST=The verification code has expired
SYSTEM.ERROR.SMS.CODE.NOT.CORRECT=Incorrect verification code
# 系统信息
# 信息类型: info, error, warning, notice
# 格式: menu + 信息类型 + 模块 + 信息
# 请按模块区分 例如menu.auth.not.found, system.info.system
# 系统异常
success=成功
system.error=系统错误! 请联系管理员
system.error.exception=系统异常
system.error.method.not.allowed=请求方法不对,请检查请求方法(post,get等)
system.error.not.found=请求地址不存在,请检查请求链接
system.error.null.pointer=NullPointerException,请联系管理员
system.error.illegal.argument=非法参数,请检查参数
system.error.type.mismatch=参数类型不匹配
system.error.missing.servlet.request.parameter=请求参数缺失,必填参数不能为空
system.error.body.mismatch=body参数异常,采用body传参,格式json
validation.error.exception=数据校验编码
# 系统信息
# 信息类型: info, error, warning, notice
# 格式: menu + 信息类型 + 模块 + 信息
# 请按模块区分 例如menu.auth.not.found, system.info.system
# 系统异常
success=Success
system.error=System error! Please contact the administrator
system.error.exception=System abnormality
system.error.method.not.allowed=The request method is incorrect. Please check the request method (post, get, etc.)
system.error.not.found=The request address does not exist, please check the request link
system.error.null.pointer=NullPointerException,please contact the administrator
system.error.illegal.argument=Illegal parameter, please check the parameter
system.error.type.mismatch=Parameter type mismatch
system.error.missing.servlet.request.parameter=The request parameter is missing. The required parameter cannot be empty
system.error.body.mismatch=The body parameter is abnormal. The body parameter is passed in json format
validation.error.exception=Data verification code
# 校验信息提示
# 信息类型: info, error, warning, notice
# 格式: validation + 信息类型 +\u3000模块 + 功能\u3000+ 信息
# 请按模块区分\u3000例如validation.error.auth.not.found, validation.info.system
# 数据校验
validation.error.notBlank=请输入参数{0}{1}
validation.error.min=大于参数
# 项目ID
validation.error.projectId.notBlank=项目ID不能为空
#系统管理模块
##数据字典模块
validation.error.system.dictionary.status.notBlank=状态不为空
validation.error.system.dictionary.status.allowValue=数据字典状态值错误
validation.error.system.dictionary.code.notBlank=数据字典编码不为空
validation.error.system.dictionary.code.size=数据字典编码必须在100个字符内
validation.error.system.dictionary.name.notBlank=数据字典名称不为空
validation.error.system.dictionary.name.size=数据字典名称必须在20个字符内
validation.error.system.dictionary.value.notBlank=数据字典值不能为空
validation.error.system.dictionary.value.allowValue=数据字典值只能为数字
validation.error.system.dictionary.description.notBlank=数据字典描述不能为空
validation.error.system.dictionary.description.size=数据字典描述必须在200字符内
validation.error.system.dict.option=可选值为 %s
\ No newline at end of file
# 校验信息提示
# 信息类型: info, error, warning, notice
# 格式: validation + 信息类型 +\u3000模块 + 功能\u3000+ 信息
# 请按模块区分\u3000例如validation.error.auth.not.found, validation.info.system
# 数据校验
validation.error.notBlank=请输入参数{0}{1}
validation.error.min=大于参数
# 项目ID
validation.error.projectId.notBlank=项目ID不能为空
#系统管理模块
##数据字典模块
validation.error.system.dictionary.status.notBlank=状态不为空
validation.error.system.dictionary.status.allowValue=数据字典状态值错误
validation.error.system.dictionary.code.notBlank=数据字典编码不为空
validation.error.system.dictionary.code.size=数据字典编码必须在100个字符内
validation.error.system.dictionary.name.notBlank=数据字典名称不为空
validation.error.system.dictionary.name.size=数据字典名称必须在20个字符内
validation.error.system.dictionary.value.notBlank=数据字典值不能为空
validation.error.system.dictionary.value.allowValue=数据字典值只能为数字
validation.error.system.dictionary.description.notBlank=数据字典描述不能为空
validation.error.system.dictionary.description.size=数据字典描述必须在200字符内
validation.error.system.dict.option=Optional value is %s
\ No newline at end of file
package com.makeit.dto.platform.elder;
import com.makeit.common.dto.BaseTenantIdDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* <p>
* 长者基本信息
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Elder对象", description = "长者基本信息")
public class ElderAddDTO extends BaseTenantIdDTO {
@NotBlank(message = "姓名不能为空")
@Size(max = 50, message = "姓名最长为50个字符")
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "年龄")
private Integer age;
@ApiModelProperty(value = "性别 数据字典 1 男 2 女")
private String sex;
@NotBlank(message = "证件类型不能为空")
@ApiModelProperty(value = "证件类型 数据字典 1 身份证 2 IC卡 3 护照 4 驾驶证 5 其他证件")
private String certificateType;
@NotBlank(message = "证件号码不能为空")
@Size(max = 50, message = "证件号码最长为50个字符")
@ApiModelProperty(value = "证件号码")
private String certificateNumber;
@ApiModelProperty(value = "手机号码")
private String phone;
@ApiModelProperty(value = "空间id")
private String spaceId;
@ApiModelProperty(value = "小区/社区/街道空间id")
private String streetSpaceId;
@ApiModelProperty(value = "楼栋空间id")
private String buildingSpaceId;
@ApiModelProperty(value = "单元空间id")
private String unitSpaceId;
@ApiModelProperty(value = "楼层id")
private String floorSpaceId;
@ApiModelProperty(value = "房间id")
private String roomId;
@ApiModelProperty(value = "床位id")
private String bedId;
@ApiModelProperty(value = "空间-房间-床位路径")
private String spacePath;
@ApiModelProperty(value = "备注")
private String remark;
}
package com.makeit.dto.platform.elder;
import com.makeit.common.dto.BaseTenantIdDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* <p>
* 长者基本信息
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="Elder对象", description="长者基本信息")
public class ElderDTOVO extends BaseTenantIdDTO {
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "年龄")
private Integer age;
@ApiModelProperty(value = "性别 数据字典 1 男 2 女")
private String sex;
@ApiModelProperty(value = "证件类型 数据字典 1 身份证 2 IC卡 3 护照 4 驾驶证 5 其他证件")
private String certificateType;
@ApiModelProperty(value = "证件号码")
private String certificateNumber;
@ApiModelProperty(value = "手机号码")
private String phone;
@ApiModelProperty(value = "固定电话")
private String telephone;
@ApiModelProperty(value = "出生日期")
private String birth;
@ApiModelProperty(value = "民族")
private String nation;
@ApiModelProperty(value = "血型")
private String blood;
@ApiModelProperty(value = "身高")
private String height;
@ApiModelProperty(value = "体重")
private String weight;
@ApiModelProperty(value = "户籍地址")
private String registerAddress;
@ApiModelProperty(value = "户籍省code")
private String registerProvinceCode;
@ApiModelProperty(value = "户籍省名称")
private String registerProvinceName;
@ApiModelProperty(value = "户籍市code")
private String registerCityCode;
@ApiModelProperty(value = "户籍市名称")
private String registerCityName;
@ApiModelProperty(value = "户籍区code")
private String registerDistrictCode;
@ApiModelProperty(value = "户籍区名称")
private String registerDistrictName;
@ApiModelProperty(value = "户籍地址详细")
private String registerAddressDetail;
@ApiModelProperty(value = "家庭地址")
private String homeAddress;
@ApiModelProperty(value = "家庭省code")
private String homeProvinceCode;
@ApiModelProperty(value = "家庭省名称")
private String homeProvinceName;
@ApiModelProperty(value = "家庭市code")
private String homeCityCode;
@ApiModelProperty(value = "家庭市名称")
private String homeCityName;
@ApiModelProperty(value = "家庭区code")
private String homeDistrictCode;
@ApiModelProperty(value = "家庭区名称")
private String homeDistrictName;
@ApiModelProperty(value = "家庭地址详细")
private String homeAddressDetail;
@ApiModelProperty(value = "空间id")
private String spaceId;
@ApiModelProperty(value = "小区/社区/街道空间id")
private String streetSpaceId;
@ApiModelProperty(value = "楼栋空间id")
private String buildingSpaceId;
@ApiModelProperty(value = "单元空间id")
private String unitSpaceId;
@ApiModelProperty(value = "楼层id")
private String floorSpaceId;
@ApiModelProperty(value = "房间id")
private String roomId;
@ApiModelProperty(value = "床位id")
private String bedId;
@ApiModelProperty(value = "空间-房间-床位路径")
private String spacePath;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "头像文件id")
private String avatar;
@ApiModelProperty(value = "社会关系列表")
private List<ElderSocialRelationDTOVO> relationList;
@ApiModelProperty(value = "健康状况")
private ElderHealthInfoDTOVO healthInfo;
@ApiModelProperty(value = "其他信息")
private ElderOtherInfoDTOVO otherInfo;
}
package com.makeit.dto.platform.elder;
import com.makeit.common.dto.BaseTenantIdDTO;
import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 长者健康状态
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ElderHealthInfo对象", description="长者健康状态")
public class ElderHealthInfoDTOVO extends BaseTenantIdDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "长者id")
private String elderId;
@ApiModelProperty(value = "老人类型")
private String elderType;
@ApiModelProperty(value = "医疗保险 数据字典 1 有 0 无")
private String medicalInsurance;
@ApiModelProperty(value = "疾病状况")
private String illness;
@ApiModelProperty(value = "饮食禁忌")
private String foodProhibition;
@ApiModelProperty(value = "兴趣爱好")
private String hobbies;
@ApiModelProperty(value = "呼吸率,范围用-区分")
private String respiratoryRate;
@ApiModelProperty(value = "呼吸率异常时间 单位:s")
private String respiratoryExceptionTime;
@ApiModelProperty(value = "心率,范围用-区分")
private String heartRate;
@ApiModelProperty(value = "心率异常时间 单位 s")
private String heartExceptionTime;
@ApiModelProperty(value = "备注")
private String remark;
}
package com.makeit.dto.platform.elder;
import com.makeit.common.dto.BaseTenantIdDTO;
import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 长者其他信息
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ElderOtherInfo对象", description="长者其他信息")
public class ElderOtherInfoDTOVO extends BaseTenantIdDTO {
@ApiModelProperty(value = "长者id")
private String elderId;
@ApiModelProperty(value = "文化程度")
private String education;
@ApiModelProperty(value = "婚姻")
private String marriage;
@ApiModelProperty(value = "信仰")
private String belief;
@ApiModelProperty(value = "职业")
private String profession;
@ApiModelProperty(value = "收入")
private String income;
@ApiModelProperty(value = "生活状况")
private String lifeStatus;
@ApiModelProperty(value = "子女数量")
private Integer childrenQuantity;
@ApiModelProperty(value = "外地子女数量")
private Integer otherChildrenQuantity;
@ApiModelProperty(value = "政治面貌")
private String politicsStatus;
@ApiModelProperty(value = "工作单位")
private String workUnit;
}
package com.makeit.dto.platform.elder;
import com.makeit.common.dto.BaseTenantIdDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 长者社会关系
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ElderSocialRelation对象", description="长者社会关系")
public class ElderSocialRelationDTOVO extends BaseTenantIdDTO {
@ApiModelProperty(value = "长者id")
private String elderId;
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "关系 数据字典 1 配偶 2 父女")
private String relation;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "身份证号码")
private String idCard;
@ApiModelProperty(value = "是否紧急联系人 数据字典 1 是 0 否")
private String emergencyContact;
@ApiModelProperty(value = "备注")
private String remark;
}
package com.makeit.entity.platform.elder; package com.makeit.entity.platform.elder;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.makeit.common.entity.BaseBusEntity; import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -19,7 +23,7 @@ import lombok.EqualsAndHashCode; ...@@ -19,7 +23,7 @@ import lombok.EqualsAndHashCode;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value="Elder对象", description="长者基本信息") @ApiModel(value = "Elder对象", description = "长者基本信息")
public class Elder extends BaseBusEntity { public class Elder extends BaseBusEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -27,9 +31,11 @@ public class Elder extends BaseBusEntity { ...@@ -27,9 +31,11 @@ public class Elder extends BaseBusEntity {
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
private String name; private String name;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "年龄") @ApiModelProperty(value = "年龄")
private Integer age; private Integer age;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "性别 数据字典 1 男 2 女") @ApiModelProperty(value = "性别 数据字典 1 男 2 女")
private String sex; private String sex;
...@@ -39,104 +45,136 @@ public class Elder extends BaseBusEntity { ...@@ -39,104 +45,136 @@ public class Elder extends BaseBusEntity {
@ApiModelProperty(value = "证件号码") @ApiModelProperty(value = "证件号码")
private String certificateNumber; private String certificateNumber;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "手机号码") @ApiModelProperty(value = "手机号码")
private String phone; private String phone;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "固定电话") @ApiModelProperty(value = "固定电话")
private String telephone; private String telephone;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "出生日期") @ApiModelProperty(value = "出生日期")
private String birth; private String birth;
@ApiModelProperty(value = "名族") @TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "民族")
private String nation; private String nation;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "血型") @ApiModelProperty(value = "血型")
private String blood; private String blood;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "身高") @ApiModelProperty(value = "身高")
private String height; private String height;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "体重") @ApiModelProperty(value = "体重")
private String weight; private String weight;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍地址") @ApiModelProperty(value = "户籍地址")
private String registerAddress; private String registerAddress;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍省code") @ApiModelProperty(value = "户籍省code")
private String registerProvinceCode; private String registerProvinceCode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍省名称") @ApiModelProperty(value = "户籍省名称")
private String registerProvinceName; private String registerProvinceName;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍市code") @ApiModelProperty(value = "户籍市code")
private String registerCityCode; private String registerCityCode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍市名称") @ApiModelProperty(value = "户籍市名称")
private String registerCityName; private String registerCityName;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍区code") @ApiModelProperty(value = "户籍区code")
private String registerDistrictCode; private String registerDistrictCode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍区名称") @ApiModelProperty(value = "户籍区名称")
private String registerDistrictName; private String registerDistrictName;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "户籍地址详细") @ApiModelProperty(value = "户籍地址详细")
private String registerAddressDetail; private String registerAddressDetail;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭地址") @ApiModelProperty(value = "家庭地址")
private String homeAddress; private String homeAddress;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭省code") @ApiModelProperty(value = "家庭省code")
private String homeProvinceCode; private String homeProvinceCode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭省名称") @ApiModelProperty(value = "家庭省名称")
private String homeProvinceName; private String homeProvinceName;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭市code") @ApiModelProperty(value = "家庭市code")
private String homeCityCode; private String homeCityCode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭市名称") @ApiModelProperty(value = "家庭市名称")
private String homeCityName; private String homeCityName;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭区code") @ApiModelProperty(value = "家庭区code")
private String homeDistrictCode; private String homeDistrictCode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭区名称") @ApiModelProperty(value = "家庭区名称")
private String homeDistrictName; private String homeDistrictName;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "家庭地址详细") @ApiModelProperty(value = "家庭地址详细")
private String homeAddressDetail; private String homeAddressDetail;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "空间id") @ApiModelProperty(value = "空间id")
private String spaceId; private String spaceId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "小区/社区/街道空间id")
private String streetSpaceId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "楼栋空间id")
private String buildingSpaceId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "单元空间id")
private String unitSpaceId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "楼层id")
private String floorSpaceId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "房间id") @ApiModelProperty(value = "房间id")
private String roomId; private String roomId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "床位id") @ApiModelProperty(value = "床位id")
private String bedId; private String bedId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "空间-房间-床位路径") @ApiModelProperty(value = "空间-房间-床位路径")
private String spacePath; private String spacePath;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "创建者") @TableField(updateStrategy = FieldStrategy.IGNORED)
private String createBy; @ApiModelProperty(value = "头像文件id")
private String avatar;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "更新者")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateDate;
@ApiModelProperty(value = " 租户id ")
private String tenantId;
} }
package com.makeit.entity.platform.elder; package com.makeit.entity.platform.elder;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.FieldStrategy;
import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.makeit.common.entity.BaseBusEntity; import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -27,50 +26,45 @@ public class ElderHealthInfo extends BaseBusEntity { ...@@ -27,50 +26,45 @@ public class ElderHealthInfo extends BaseBusEntity {
@ApiModelProperty(value = "长者id") @ApiModelProperty(value = "长者id")
private String elderId; private String elderId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "老人类型") @ApiModelProperty(value = "老人类型")
private String elderType; private String elderType;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "医疗保险 数据字典 1 有 0 无") @ApiModelProperty(value = "医疗保险 数据字典 1 有 0 无")
private String medicalInsurance; private String medicalInsurance;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "疾病状况") @ApiModelProperty(value = "疾病状况")
private String illness; private String illness;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "饮食禁忌") @ApiModelProperty(value = "饮食禁忌")
private String foodProhibition; private String foodProhibition;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "兴趣爱好") @ApiModelProperty(value = "兴趣爱好")
private String hobbies; private String hobbies;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "呼吸率,范围用-区分") @ApiModelProperty(value = "呼吸率,范围用-区分")
private String respiratoryRate; private String respiratoryRate;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "呼吸率异常时间 单位:s") @ApiModelProperty(value = "呼吸率异常时间 单位:s")
private String respiratoryExceptionTime; private String respiratoryExceptionTime;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "心率,范围用-区分") @ApiModelProperty(value = "心率,范围用-区分")
private String heartRate; private String heartRate;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "心率异常时间 单位 s") @ApiModelProperty(value = "心率异常时间 单位 s")
private String heartExceptionTime; private String heartExceptionTime;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "创建者")
private String createBy;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "更新者")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateDate;
@ApiModelProperty(value = " 租户id ")
private String tenantId;
} }
package com.makeit.entity.platform.elder; package com.makeit.entity.platform.elder;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.FieldStrategy;
import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.makeit.common.entity.BaseBusEntity; import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -27,50 +26,44 @@ public class ElderOtherInfo extends BaseBusEntity { ...@@ -27,50 +26,44 @@ public class ElderOtherInfo extends BaseBusEntity {
@ApiModelProperty(value = "长者id") @ApiModelProperty(value = "长者id")
private String elderId; private String elderId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "文化程度") @ApiModelProperty(value = "文化程度")
private String education; private String education;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "婚姻") @ApiModelProperty(value = "婚姻")
private String marriage; private String marriage;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "信仰") @ApiModelProperty(value = "信仰")
private String belief; private String belief;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "职业") @ApiModelProperty(value = "职业")
private String profession; private String profession;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "收入") @ApiModelProperty(value = "收入")
private String income; private String income;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "生活状况") @ApiModelProperty(value = "生活状况")
private String lifeStatus; private String lifeStatus;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "子女数量") @ApiModelProperty(value = "子女数量")
private Integer childrenQuantity; private Integer childrenQuantity;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "外地子女数量") @ApiModelProperty(value = "外地子女数量")
private Integer otherChildrenQuantity; private Integer otherChildrenQuantity;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "政治面貌") @ApiModelProperty(value = "政治面貌")
private String politicsStatus; private String politicsStatus;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "工作单位") @ApiModelProperty(value = "工作单位")
private String workUnit; private String workUnit;
@ApiModelProperty(value = "创建者")
private String createBy;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "更新者")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateDate;
@ApiModelProperty(value = " 租户id ")
private String tenantId;
} }
package com.makeit.entity.platform.elder; package com.makeit.entity.platform.elder;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.FieldStrategy;
import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.makeit.common.entity.BaseBusEntity; import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -27,38 +26,28 @@ public class ElderSocialRelation extends BaseBusEntity { ...@@ -27,38 +26,28 @@ public class ElderSocialRelation extends BaseBusEntity {
@ApiModelProperty(value = "长者id") @ApiModelProperty(value = "长者id")
private String elderId; private String elderId;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
private String name; private String name;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "关系 数据字典 1 配偶 2 父女") @ApiModelProperty(value = "关系 数据字典 1 配偶 2 父女")
private String relation; private String relation;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "联系电话") @ApiModelProperty(value = "联系电话")
private String phone; private String phone;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "身份证号码") @ApiModelProperty(value = "身份证号码")
private String idCard; private String idCard;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "是否紧急联系人 数据字典 1 是 0 否") @ApiModelProperty(value = "是否紧急联系人 数据字典 1 是 0 否")
private String emergencyContact; private String emergencyContact;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "创建者")
private String createBy;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "更新者")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateDate;
@ApiModelProperty(value = " 租户id ")
private String tenantId;
} }
package com.makeit.server.platform.elder; package com.makeit.server.platform.elder;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.dto.platform.elder.ElderAddDTO;
import com.makeit.dto.platform.elder.ElderDTOVO;
import com.makeit.entity.platform.elder.Elder; import com.makeit.entity.platform.elder.Elder;
/** /**
...@@ -13,4 +15,10 @@ import com.makeit.entity.platform.elder.Elder; ...@@ -13,4 +15,10 @@ import com.makeit.entity.platform.elder.Elder;
*/ */
public interface ElderService extends IService<Elder> { public interface ElderService extends IService<Elder> {
void add(ElderAddDTO dto);
void edit(ElderDTOVO dto);
ElderDTOVO view(String id);
} }
package com.makeit.server.platform.elder.impl; package com.makeit.server.platform.elder.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.platform.elder.*;
import com.makeit.entity.platform.elder.Elder; import com.makeit.entity.platform.elder.Elder;
import com.makeit.entity.platform.elder.ElderHealthInfo;
import com.makeit.entity.platform.elder.ElderOtherInfo;
import com.makeit.entity.platform.elder.ElderSocialRelation;
import com.makeit.enums.CodeMessageEnum;
import com.makeit.exception.BusinessException;
import com.makeit.mapper.platform.elder.ElderMapper; import com.makeit.mapper.platform.elder.ElderMapper;
import com.makeit.server.platform.elder.ElderHealthInfoService;
import com.makeit.server.platform.elder.ElderOtherInfoService;
import com.makeit.server.platform.elder.ElderService; import com.makeit.server.platform.elder.ElderService;
import com.makeit.server.platform.elder.ElderSocialRelationService;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* <p> * <p>
...@@ -17,4 +32,98 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +32,98 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ElderServiceImpl extends ServiceImpl<ElderMapper, Elder> implements ElderService { public class ElderServiceImpl extends ServiceImpl<ElderMapper, Elder> implements ElderService {
@Autowired
private ElderSocialRelationService elderSocialRelationService;
@Autowired
private ElderHealthInfoService elderHealthInfoService;
@Autowired
private ElderOtherInfoService elderOtherInfoService;
private void check(ElderAddDTO dto) {
Elder old = getOne(new QueryWrapper<Elder>().lambda()
.eq(Elder::getCertificateType, dto.getCertificateType())
.eq(Elder::getCertificateNumber, dto.getCertificateNumber())
);
if (old != null && !old.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_ELDER_CERTIFICATENUMBER_DUPLICATE);
}
}
@Override
@Transactional
public void add(ElderAddDTO dto) {
check(dto);
Elder elder = BeanDtoVoUtils.convert(dto, Elder.class);
save(elder);
}
@Override
@Transactional
public void edit(ElderDTOVO dto) {
check(BeanDtoVoUtils.convert(dto, ElderAddDTO.class));
Elder elder = BeanDtoVoUtils.convert(dto, Elder.class);
updateById(elder);
List<ElderSocialRelation> relationList = BeanDtoVoUtils.listVo(dto.getRelationList(), ElderSocialRelation.class);
relationList.forEach(e -> {
e.setElderId(dto.getId());
});
elderSocialRelationService.remove(new QueryWrapper<ElderSocialRelation>().lambda()
.eq(ElderSocialRelation::getElderId, dto.getId()));
elderSocialRelationService.saveBatch(relationList);
ElderHealthInfo healthInfo = BeanDtoVoUtils.convert(dto.getHealthInfo(), ElderHealthInfo.class);
healthInfo.setElderId(dto.getId());
elderHealthInfoService.saveOrUpdate(healthInfo);
ElderOtherInfo otherInfo = BeanDtoVoUtils.convert(dto.getOtherInfo(), ElderOtherInfo.class);
otherInfo.setElderId(dto.getId());
elderOtherInfoService.saveOrUpdate(otherInfo);
}
@Override
public ElderDTOVO view(String id) {
Elder elder = getById(id);
ElderDTOVO vo = BeanDtoVoUtils.convert(elder, ElderDTOVO.class);
List<ElderSocialRelation> dbSocialRelationList = elderSocialRelationService.list(new QueryWrapper<ElderSocialRelation>().lambda()
.eq(ElderSocialRelation::getElderId, id));
List<ElderSocialRelationDTOVO> socialRelationList = BeanDtoVoUtils.listVo(dbSocialRelationList, ElderSocialRelationDTOVO.class);
vo.setRelationList(socialRelationList);
ElderHealthInfo dbHealthInfo = elderHealthInfoService.getOne(new QueryWrapper<ElderHealthInfo>().lambda()
.eq(ElderHealthInfo::getElderId, id));
ElderHealthInfoDTOVO healthInfo = BeanDtoVoUtils.convert(dbHealthInfo, ElderHealthInfoDTOVO.class);
vo.setHealthInfo(healthInfo);
ElderOtherInfo dbOtherInfo = elderOtherInfoService.getOne(new QueryWrapper<ElderOtherInfo>().lambda()
.eq(ElderOtherInfo::getElderId, id));
ElderOtherInfoDTOVO otherInfo = BeanDtoVoUtils.convert(dbOtherInfo, ElderOtherInfoDTOVO.class);
vo.setOtherInfo(otherInfo);
return vo;
}
} }
//TODO ywc 数据字典
//还有空间相关的没有 列表 详情 导入 导出
\ No newline at end of file
package com.makeit.service.saas; package com.makeit.service.saas;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.dto.StatusDTO;
import com.makeit.entity.saas.SaasRole; import com.makeit.entity.saas.SaasRole;
import com.makeit.module.admin.saas.SaasRoleDTOVO;
import com.makeit.module.admin.saas.PlatRoleMenuDTO;
import com.makeit.module.admin.saas.PlatUserRoleDTO;
import java.util.List;
/** /**
* @author lixl * @author lixl
...@@ -10,4 +16,22 @@ import com.makeit.entity.saas.SaasRole; ...@@ -10,4 +16,22 @@ import com.makeit.entity.saas.SaasRole;
*/ */
public interface SaasRoleService extends IService<SaasRole> { public interface SaasRoleService extends IService<SaasRole> {
List<SaasRoleDTOVO> list(SaasRoleDTOVO dto);
void add(SaasRoleDTOVO dto);
void edit(SaasRoleDTOVO dto);
SaasRoleDTOVO view(String id);
void del(String id);
void changeStatus(StatusDTO dto);
void assignUserList(List<PlatUserRoleDTO> userRoleDTOList);
void removeAssignUserList(List<PlatUserRoleDTO> userRoleDTOList);
void assignMenuList(PlatRoleMenuDTO roleMenuDTO);
} }
...@@ -5,10 +5,10 @@ import com.makeit.common.dto.LoginDTO; ...@@ -5,10 +5,10 @@ import com.makeit.common.dto.LoginDTO;
import com.makeit.common.dto.StatusDTO; import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO; import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
import com.makeit.module.admin.saas.PlatUserDTOVO; import com.makeit.module.admin.saas.SaasUserDTOVO;
import com.makeit.module.admin.saas.PlatUserQueryDTO; import com.makeit.module.admin.saas.PlatUserQueryDTO;
import com.makeit.entity.saas.SaasUser; import com.makeit.entity.saas.SaasUser;
import com.makeit.utils.user.UserLoginVO; import com.makeit.utils.user.SaasUserLoginVO;
import java.util.List; import java.util.List;
...@@ -18,31 +18,31 @@ import java.util.List; ...@@ -18,31 +18,31 @@ import java.util.List;
* @createDate 2023-08-29 11:14:07 * @createDate 2023-08-29 11:14:07
*/ */
public interface SaasUserService extends IService<SaasUser> { public interface SaasUserService extends IService<SaasUser> {
PageVO<PlatUserDTOVO> page(PageReqDTO<PlatUserQueryDTO> page); PageVO<SaasUserDTOVO> page(PageReqDTO<PlatUserQueryDTO> page);
PageVO<PlatUserDTOVO> pageNoSuperAdmin(PageReqDTO<PlatUserQueryDTO> page); PageVO<SaasUserDTOVO> pageNoSuperAdmin(PageReqDTO<PlatUserQueryDTO> page);
List<PlatUserDTOVO> list(PlatUserQueryDTO dto); List<SaasUserDTOVO> list(PlatUserQueryDTO dto);
List<PlatUserDTOVO> listNoSuperAdmin(PlatUserQueryDTO dto); List<SaasUserDTOVO> listNoSuperAdmin(PlatUserQueryDTO dto);
void add(PlatUserDTOVO dto); void add(SaasUserDTOVO dto);
void edit(PlatUserDTOVO dto); void edit(SaasUserDTOVO dto);
void changePassword(PlatUserDTOVO dto); void changePassword(SaasUserDTOVO dto);
PlatUserDTOVO view(String id); SaasUserDTOVO view(String id);
void del(String id); void del(String id);
void changeStatus(StatusDTO dto); void changeStatus(StatusDTO dto);
UserLoginVO login(LoginDTO loginDTO); SaasUserLoginVO login(LoginDTO loginDTO);
UserLoginVO getRoleAndMenuList(); SaasUserLoginVO getRoleAndMenuList();
UserLoginVO getUserVO(); SaasUserLoginVO getUserVO();
void logout(); void logout();
......
...@@ -84,7 +84,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i ...@@ -84,7 +84,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i
.in(StringUtils.isNotBlank(dto.getRoleId()), SaasMenu::getId, menuIdList) .in(StringUtils.isNotBlank(dto.getRoleId()), SaasMenu::getId, menuIdList)
//.orderByAsc(PlatMenu::getParentId) //.orderByAsc(PlatMenu::getParentId)
.orderByAsc(SaasMenu::getSort) .orderByAsc(SaasMenu::getSort)
.orderByAsc(SaasMenu::getCreatedAt) .orderByAsc(SaasMenu::getCreateDate)
); );
return BeanDtoVoUtils.listVo(platMenuList, PlatMenuDTOVO.class); return BeanDtoVoUtils.listVo(platMenuList, PlatMenuDTOVO.class);
...@@ -178,7 +178,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i ...@@ -178,7 +178,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i
List<SaasMenu> exitList = list(new QueryWrapper<SaasMenu>().lambda() List<SaasMenu> exitList = list(new QueryWrapper<SaasMenu>().lambda()
.isNotNull(SaasMenu::getCode) .isNotNull(SaasMenu::getCode)
.in(SaasMenu::getCategory, SysEnum.MenuTypeEnum.MENU.getValue(), SysEnum.MenuTypeEnum.BUTTON.getValue()) .in(SaasMenu::getCategory, SysEnum.MenuTypeEnum.MENU.getValue(), SysEnum.MenuTypeEnum.BUTTON.getValue())
.orderByDesc(SaasMenu::getCreatedAt) .orderByDesc(SaasMenu::getCreateDate)
); );
Map<String, SaasMenu> exitCodeMap = StreamUtil.toMapDep(exitList, SaasMenu::getCode); Map<String, SaasMenu> exitCodeMap = StreamUtil.toMapDep(exitList, SaasMenu::getCode);
......
package com.makeit.service.saas.impl; package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.dto.StatusDTO;
import com.makeit.entity.saas.SaasRole; import com.makeit.entity.saas.SaasRole;
import com.makeit.entity.saas.SaasRoleMenu;
import com.makeit.entity.saas.SaasUserRole;
import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.CommonEnum;
import com.makeit.exception.BusinessException;
import com.makeit.mapper.saas.SaasRoleMapper; import com.makeit.mapper.saas.SaasRoleMapper;
import com.makeit.module.admin.saas.SaasRoleDTOVO;
import com.makeit.module.admin.saas.PlatRoleMenuDTO;
import com.makeit.module.admin.saas.PlatUserRoleDTO;
import com.makeit.service.saas.SaasRoleMenuService;
import com.makeit.service.saas.SaasRoleService; import com.makeit.service.saas.SaasRoleService;
import com.makeit.service.saas.SaasUserRoleService;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.data.convert.StreamUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* @author lixl * @author lixl
...@@ -15,4 +36,120 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +36,120 @@ import org.springframework.stereotype.Service;
public class SaasRoleServiceImpl extends ServiceImpl<SaasRoleMapper, SaasRole> public class SaasRoleServiceImpl extends ServiceImpl<SaasRoleMapper, SaasRole>
implements SaasRoleService{ implements SaasRoleService{
@Autowired
private SaasUserRoleService saasUserRoleService;
@Autowired
private SaasRoleMenuService saasRoleMenuService;
@Override
public List<SaasRoleDTOVO> list(SaasRoleDTOVO dto) {
List<SaasRole> platRoleList = list(new QueryWrapper<SaasRole>().lambda()
.like(StringUtils.isNotBlank(dto.getName()), SaasRole::getName, dto.getName())
.like(StringUtils.isNotBlank(dto.getCode()), SaasRole::getCode, dto.getCode())
.and(StringUtils.isNotBlank(dto.getKeyword()), qw -> {
qw.like(StringUtils.isNotBlank(dto.getKeyword()), SaasRole::getName, dto.getKeyword())
.or()
.like(StringUtils.isNotBlank(dto.getKeyword()), SaasRole::getCode, dto.getKeyword());
})
.eq(StringUtils.isNotBlank(dto.getStatus()), SaasRole::getStatus, dto.getStatus())
.orderByDesc(SaasRole::getCreateDate)
);
return BeanDtoVoUtils.listVo(platRoleList, SaasRoleDTOVO.class);
}
private void check(SaasRoleDTOVO dto) {
SaasRole old = getOne(new QueryWrapper<SaasRole>().lambda()
.eq(SaasRole::getName, dto.getName()));
if (old != null && !old.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_NAME_DUPLICATE);
}
old = getOne(new QueryWrapper<SaasRole>().lambda()
.eq(SaasRole::getCode, dto.getCode()));
if (old != null && !old.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_CODE_DUPLICATE);
}
}
@Transactional
@Override
public void add(SaasRoleDTOVO dto) {
check(dto);
save(BeanDtoVoUtils.convert(dto, SaasRole.class));
}
@Transactional
@Override
public void edit(SaasRoleDTOVO dto) {
check(dto);
updateById(BeanDtoVoUtils.convert(dto, SaasRole.class));
}
@Override
public SaasRoleDTOVO view(String id) {
return BeanDtoVoUtils.convert(getById(id), SaasRoleDTOVO.class);
}
@Transactional
@Override
public void del(String id) {
removeById(id);
}
@Transactional
@Override
public void changeStatus(StatusDTO dto) {
if (Arrays.stream(CommonEnum.values()).noneMatch(e -> e.getValue().equals(dto.getStatus()))) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR);
}
SaasRole role = getById(dto.getId());
if (role.getStatus().equals(dto.getStatus())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR);
}
role.setStatus(dto.getStatus());
updateById(role);
}
@Transactional
@Override
public void assignUserList(List<PlatUserRoleDTO> userRoleDTOList) {
removeAssignUserList(userRoleDTOList);
List<SaasUserRole> userRoleList = BeanDtoVoUtils.listVo(userRoleDTOList, SaasUserRole.class);
saasUserRoleService.saveBatch(userRoleList);
}
@Transactional
@Override
public void removeAssignUserList(List<PlatUserRoleDTO> userRoleDTOList) {
Map<String, List<PlatUserRoleDTO>> roleUserMap = StreamUtil.groupBy(userRoleDTOList, PlatUserRoleDTO::getRoleId);
roleUserMap.forEach((k, v) -> {
List<String> userIdList = StreamUtil.map(v, PlatUserRoleDTO::getUserId);
userIdList.add(-1 + "");
saasUserRoleService.remove(new QueryWrapper<SaasUserRole>().lambda()
.eq(SaasUserRole::getRoleId, k)
.in(SaasUserRole::getUserId, userIdList));
});
}
@Transactional
@Override
public void assignMenuList(PlatRoleMenuDTO roleMenuDTO) {
//removeAssignMenuList(roleMenuDTOList);
saasRoleMenuService.remove(new QueryWrapper<SaasRoleMenu>().lambda().eq(SaasRoleMenu::getRoleId, roleMenuDTO.getRoleId()));
List<SaasRoleMenu> roleMenuList = StreamUtil.map(roleMenuDTO.getMenuIdList(), e -> {
SaasRoleMenu platRoleMenu = new SaasRoleMenu();
platRoleMenu.setRoleId(roleMenuDTO.getRoleId());
platRoleMenu.setMenuId(e);
return platRoleMenu;
});
saasRoleMenuService.saveBatch(roleMenuList);
}
} }
package com.makeit.vo.platform.elder;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantIdDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.LocalDateTimeTypeHandler;
import java.time.LocalDateTime;
/**
* <p>
* 长者基本信息
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Elder对象", description = "长者基本信息")
public class ElderListVO extends BaseTenantIdDTO {
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "年龄")
private Integer age;
@ApiModelProperty(value = "性别 数据字典 1 男 2 女")
private String sex;
@ApiModelProperty(value = "证件类型 数据字典 1 身份证 2 IC卡 3 护照 4 驾驶证 5 其他证件")
private String certificateType;
@ApiModelProperty(value = "证件号码")
private String certificateNumber;
@ApiModelProperty(value = "手机号码")
private String phone;
@ApiModelProperty(value = "空间id")
private String spaceId;
@ApiModelProperty(value = "小区/社区/街道空间id")
private String streetSpaceId;
@ApiModelProperty(value = "楼栋空间id")
private String buildingSpaceId;
@ApiModelProperty(value = "单元空间id")
private String unitSpaceId;
@ApiModelProperty(value = "楼层id")
private String floorSpaceId;
@ApiModelProperty(value = "房间id")
private String roomId;
@ApiModelProperty(value = "床位id")
private String bedId;
@ApiModelProperty(value = "空间-房间-床位路径")
private String spacePath;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updatedAt;
@ApiModelProperty(value = "创建人名称")
private String createBy;
@ApiModelProperty(value = "更新人名称")
private String updateBy;
}
...@@ -110,13 +110,19 @@ sa-token: ...@@ -110,13 +110,19 @@ sa-token:
interceptor: interceptor:
## 登录拦截路径 ## 登录拦截路径
authenticationTntPath: /** authenticationTntPath: /**
authenticationTntPathIgnore: /swagger-resources/**,/v2/api-docs/**,/sys/login/**,/sys/dictionaryCategory/getDictionaryCategoryByList,/mobile/**,/doc.html,/saas/login/**,/error authenticationTntPathIgnore: /swagger-resources/**,/v2/api-docs/**,/sys/login/**,/sys/dictionaryCategory/getDictionaryCategoryByList,/mobile/**,/doc.html,/saas/**,/error
## 权限拦截路径 ## 权限拦截路径
authorizationTntPath: /** authorizationTntPath: /**
authorizationTntPathIgnore: /swagger-resources/**,/v2/api-docs/**,/sys/login/**,/sys/dictionaryCategory/getDictionaryCategoryByList,/mobile/**,/doc.html,/saas/login/**,/error authorizationTntPathIgnore: /swagger-resources/**,/v2/api-docs/**,/sys/login/**,/sys/dictionaryCategory/getDictionaryCategoryByList,/mobile/**,/doc.html,/saas/**,/error
## saas端登录拦截路径
authenticationSaasPath: /saas/**
authenticationSaasPathIgnore: /saas/login/login
## saas端权限拦截路径
authorizationSaasPath: /saas/**
authorizationSaasPathIgnore: /saas/login/login
sign: sign:
flag: true flag: true
......
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 sign in to comment