diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java index 6b100f4..19f8150 100644 --- a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java @@ -523,6 +523,7 @@ public class SysUserController { public Result> getRoleMembers(SysRoleMembersFormDTO formDTO) { return sysUserService.getRoleMembers(formDTO); } + /** * 获取用户部门多层结构,用户前端显示,请求需携带token - 工作日志使用 * @@ -535,4 +536,17 @@ public class SysUserController { return sysDeptService.getUserDeptOptionByUserId(String.valueOf(SecurityUser.getUserId())); } + /** + * 展示用户列表 + * + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2021/5/31 15:44 + */ + @GetMapping("userList") + public Result> userList(@RequestParam Map params) { + return new Result>().ok(sysUserService.list(params)); + } + } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java index 5a70de5..4d3018f 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java @@ -8,6 +8,8 @@ import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; @@ -30,6 +32,7 @@ import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInoutRecordServi import com.elink.esua.epdc.vaccine.vim.dao.VaccinationInfoDao; import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; import com.elink.esua.epdc.vaccine.vim.service.VaccinationInfoService; +import com.elink.esua.epdc.vaccine.vim.service.VaccinationUserRoleService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -61,6 +64,8 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl getPageList(Map params) { IPage page = getPage(params); + + UserDetail user = SecurityUser.getUser(); + if (user == null) { + throw new RenException("用户未登录"); + } + Map authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId()); + params.putAll(authParams); + List list = baseDao.getEpidemicUserRecordList(params); for (EpidemicRecordListDTO eru : list) { eru.setUserName(nameDesensitization(eru.getUserName())); @@ -445,6 +458,14 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl getEpidemicPage(Map params) { IPage page = getEpiPage(params); + + UserDetail user = SecurityUser.getUser(); + if (user == null) { + throw new RenException("用户未登录"); + } + Map authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId()); + params.putAll(authParams); + List list = baseDao.getEpidemicPage(params); return new PageData<>(list, page.getTotal()); } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationRoleController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationRoleController.java new file mode 100644 index 0000000..f8e28c3 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationRoleController.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; +import com.elink.esua.epdc.vaccine.vim.excel.VaccinationRoleExcel; +import com.elink.esua.epdc.vaccine.vim.service.VaccinationRoleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@RestController +@RequestMapping("vaccinationrole") +public class VaccinationRoleController { + + @Autowired + private VaccinationRoleService vaccinationRoleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = vaccinationRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") Long id) { + VaccinationRoleDTO data = vaccinationRoleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VaccinationRoleDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + vaccinationRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VaccinationRoleDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + vaccinationRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody Long[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + vaccinationRoleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = vaccinationRoleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VaccinationRoleExcel.class); + } + + /** + * 展示角色列表 + * + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2021/5/31 15:55 + */ + @GetMapping("roleList") + public Result> roleList(@RequestParam Map params) { + return new Result>().ok(vaccinationRoleService.list(params)); + } +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationUserRoleController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationUserRoleController.java new file mode 100644 index 0000000..bc35bf5 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationUserRoleController.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; +import com.elink.esua.epdc.vaccine.vim.excel.VaccinationUserRoleExcel; +import com.elink.esua.epdc.vaccine.vim.service.VaccinationUserRoleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@RestController +@RequestMapping("vaccinationuserrole") +public class VaccinationUserRoleController { + + @Autowired + private VaccinationUserRoleService vaccinationUserRoleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = vaccinationUserRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") Long id){ + VaccinationUserRoleDTO data = vaccinationUserRoleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VaccinationUserRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + vaccinationUserRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VaccinationUserRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + vaccinationUserRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + vaccinationUserRoleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = vaccinationUserRoleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VaccinationUserRoleExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationRoleDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationRoleDao.java new file mode 100644 index 0000000..e15c432 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationRoleDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Mapper +public interface VaccinationRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationUserRoleDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationUserRoleDao.java new file mode 100644 index 0000000..a756fab --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationUserRoleDao.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; +import com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Mapper +public interface VaccinationUserRoleDao extends BaseDao { + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2021/5/31 15:31 + */ + List getList(Map params); + + /** + * 根据用户ID删除 + * + * @param userId + * @return void + * @author zhy + * @date 2021/5/31 16:21 + */ + void deleteByUserId(@Param("userId") Long userId); + + /** + * 根据用户ID查找 + * + * @param userId + * @return void + * @author zhy + * @date 2021/5/31 16:21 + */ + List selectByUserId(@Param("userId") Long userId); + + /** + * 根据用户ID查找 + * + * @param userId + * @return void + * @author zhy + * @date 2021/5/31 16:21 + */ + List selectRoleByUserId(@Param("userId") Long userId); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationAuthDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationAuthDTO.java new file mode 100644 index 0000000..1e73f1a --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationAuthDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +public class VaccinationAuthDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 县/区关键词 + */ + private List countyKeywords; + + /** + * 街道/乡镇关键词 + */ + private List streetKeywords; + + /** + * 社区/村关键词 + */ + private List communityKeywords; + + /** + * 网格关键词 + */ + private List gridKeywords; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationRoleDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationRoleDTO.java new file mode 100644 index 0000000..2cbbbfa --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationRoleDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +public class VaccinationRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Long id; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 县/区关键词 + */ + private String countyKeywords; + + /** + * 街道/乡镇关键词 + */ + private String streetKeywords; + + /** + * 社区/村关键词 + */ + private String communityKeywords; + + /** + * 网格关键词 + */ + private String gridKeywords; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationUserRoleDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationUserRoleDTO.java new file mode 100644 index 0000000..f6708b2 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationUserRoleDTO.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.dto; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import lombok.Data; + + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +public class VaccinationUserRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户 + */ + private String userName; + + /** + * 角色ID + */ + private Long roleId; + + /** + * 角色 + */ + private String roleName; + + /** + * 角色ID + */ + private List roleIds; + + /** + * 角色 + */ + private String roleNames; + + /** + * 删除标识 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationRoleEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationRoleEntity.java new file mode 100644 index 0000000..523bc02 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationRoleEntity.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import com.elink.esua.epdc.vaccine.common.base.BasePingyinEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("vaccination_role") +public class VaccinationRoleEntity extends BasePingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 县/区关键词 + */ + private String countyKeywords; + + /** + * 街道/乡镇关键词 + */ + private String streetKeywords; + + /** + * 社区/村关键词 + */ + private String communityKeywords; + + /** + * 网格关键词 + */ + private String gridKeywords; + + /** + * 备注 + */ + private String remark; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationUserRoleEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationUserRoleEntity.java new file mode 100644 index 0000000..39dfe87 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationUserRoleEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import com.elink.esua.epdc.vaccine.common.base.BasePingyinEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("vaccination_user_role") +public class VaccinationUserRoleEntity extends BasePingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private Long userId; + + /** + * 角色ID + */ + private Long roleId; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationRoleExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationRoleExcel.java new file mode 100644 index 0000000..b3d5086 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationRoleExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +public class VaccinationRoleExcel { + + @Excel(name = "ID") + private Long id; + + @Excel(name = "角色名称") + private String roleName; + + @Excel(name = "县/区关键词") + private String countyKeywords; + + @Excel(name = "街道/乡镇关键词") + private String streetKeywords; + + @Excel(name = "社区/村关键词") + private String communityKeywords; + + @Excel(name = "网格关键词") + private String gridKeywords; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "删除标识 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationUserRoleExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationUserRoleExcel.java new file mode 100644 index 0000000..bcafc91 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationUserRoleExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Data +public class VaccinationUserRoleExcel { + + @Excel(name = "ID") + private Long id; + + @Excel(name = "用户id") + private Long userId; + + @Excel(name = "角色ID") + private Long roleId; + + @Excel(name = "删除标识 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationRoleService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationRoleService.java new file mode 100644 index 0000000..91d7aea --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationRoleService.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.service; + + +import com.elink.esua.epdc.commons.mybatis.service.CrudService; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; +import com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity; + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +public interface VaccinationRoleService extends CrudService { + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationUserRoleService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationUserRoleService.java new file mode 100644 index 0000000..c750acd --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationUserRoleService.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.service; + +import com.elink.esua.epdc.commons.mybatis.service.CrudService; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; +import com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity; + +import java.util.Map; + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +public interface VaccinationUserRoleService extends CrudService { + + /** + * 获取用户的所有接种数据权限 + * + * @param userId + * @return com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO + * @author zhy + * @date 2021/5/31 17:27 + */ + VaccinationAuthDTO getVaccinationAuth(Long userId); + + /** + * 获取用户的所有接种数据权限 + * + * @param userId + * @return com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO + * @author zhy + * @date 2021/5/31 17:27 + */ + Map getVaccinationAuthParams(Long userId); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java index 349a7d3..2f1b7d1 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java @@ -7,7 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.FileUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -28,10 +31,7 @@ import com.elink.esua.epdc.vaccine.vim.dto.result.VaccineDto; import com.elink.esua.epdc.vaccine.vim.entity.VaccinationErrorEntity; import com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity; import com.elink.esua.epdc.vaccine.vim.excel.VaccinationInfoAllExcel; -import com.elink.esua.epdc.vaccine.vim.service.VaccinationErrorService; -import com.elink.esua.epdc.vaccine.vim.service.VaccinationInfoService; -import com.elink.esua.epdc.vaccine.vim.service.VaccinationSiteService; -import com.elink.esua.epdc.vaccine.vim.service.VaccineCompanyService; +import com.elink.esua.epdc.vaccine.vim.service.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -62,6 +62,8 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl page(Map params) { IPage page = getPage(params, FieldConstant.CREATED_TIME, false); + + UserDetail user = SecurityUser.getUser(); + if (user == null) { + throw new RenException("用户未登录"); + } + Map authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId()); + params.putAll(authParams); + List list = getVaccinationInfoList(params); return new PageData<>(list, page.getTotal()); } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationRoleServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationRoleServiceImpl.java new file mode 100644 index 0000000..ee1b856 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationRoleServiceImpl.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.vaccine.common.base.BaseVimCurdServiceImpl; +import com.elink.esua.epdc.vaccine.vim.dao.VaccinationRoleDao; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; +import com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity; +import com.elink.esua.epdc.vaccine.vim.service.VaccinationRoleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Map; + +/** + * 接种登记人员角色管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Service +public class VaccinationRoleServiceImpl extends BaseVimCurdServiceImpl implements VaccinationRoleService { + + @Override + public QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.orderByDesc("CREATED_TIME"); + String roleName = (String) params.get("roleName"); + wrapper.like(StringUtils.isNotBlank(roleName), "ROLE_NAME", roleName); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VaccinationRoleDTO dto) { + VaccinationRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationRoleEntity.class); + entity.setCountyKeywords(replacePunctuation(entity.getCountyKeywords().trim())); + entity.setStreetKeywords(replacePunctuation(entity.getStreetKeywords().trim())); + entity.setCommunityKeywords(replacePunctuation(entity.getCommunityKeywords().trim())); + entity.setGridKeywords(replacePunctuation(entity.getGridKeywords().trim())); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VaccinationRoleDTO dto) { + VaccinationRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationRoleEntity.class); + entity.setCountyKeywords(replacePunctuation(entity.getCountyKeywords().trim())); + entity.setStreetKeywords(replacePunctuation(entity.getStreetKeywords().trim())); + entity.setCommunityKeywords(replacePunctuation(entity.getCommunityKeywords().trim())); + entity.setGridKeywords(replacePunctuation(entity.getGridKeywords().trim())); + updateById(entity); + } + + /** + * 所有的标点替换为英文逗号 + * + * @param str + * @return java.lang.String + * @author zhy + * @date 2021/5/31 15:17 + */ + private String replacePunctuation(String str) { + return str.replaceAll("[\\pP\\p{Punct}]", ","); + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationUserRoleServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationUserRoleServiceImpl.java new file mode 100644 index 0000000..d007de5 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationUserRoleServiceImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.vim.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.vaccine.common.base.BaseVimCurdServiceImpl; +import com.elink.esua.epdc.vaccine.vim.dao.VaccinationUserRoleDao; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; +import com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity; +import com.elink.esua.epdc.vaccine.vim.service.VaccinationUserRoleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 接种登记人员角色绑定关系管理 + * + * @author zhangyuan qu@elink-cn.com + * @since v1.0.0 2021-05-31 + */ +@Service +public class VaccinationUserRoleServiceImpl extends BaseVimCurdServiceImpl implements VaccinationUserRoleService { + + @Override + public QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PageData page(Map params) { + IPage page = getPage(params, FieldConstant.CREATED_TIME, false); + List list = baseDao.getList(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VaccinationUserRoleDTO dto) { + List checkExist = baseDao.selectByUserId(dto.getUserId()); + if (!checkExist.isEmpty()) { + throw new RenException("该用户已经授权"); + } + List roleIds = dto.getRoleIds(); + roleIds.forEach(roleId -> { + VaccinationUserRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationUserRoleEntity.class); + entity.setRoleId(roleId); + insert(entity); + }); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VaccinationUserRoleDTO dto) { + baseDao.deleteByUserId(dto.getUserId()); + List roleIds = dto.getRoleIds(); + roleIds.forEach(roleId -> { + VaccinationUserRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationUserRoleEntity.class); + entity.setRoleId(roleId); + insert(entity); + }); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + VaccinationUserRoleEntity entity = selectById(ids[0]); + baseDao.deleteByUserId(entity.getUserId()); + } + + @Override + public VaccinationAuthDTO getVaccinationAuth(Long userId) { + VaccinationAuthDTO vaccinationAuthDTO = new VaccinationAuthDTO(); + UserDetail user = SecurityUser.getUser(); + if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { + return vaccinationAuthDTO; + } + + List roleList = baseDao.selectRoleByUserId(userId); + if (!roleList.isEmpty()) { + List countyKeywords = new ArrayList<>(); + List streetKeywords = new ArrayList<>(); + List communityKeywords = new ArrayList<>(); + List gridKeywords = new ArrayList<>(); + roleList.forEach(role -> { + countyKeywords.addAll(Arrays.asList(role.getCountyKeywords().split(","))); + streetKeywords.addAll(Arrays.asList(role.getStreetKeywords().split(","))); + communityKeywords.addAll(Arrays.asList(role.getCommunityKeywords().split(","))); + gridKeywords.addAll(Arrays.asList(role.getGridKeywords().split(","))); + }); + + // 去重去空 + vaccinationAuthDTO.setCountyKeywords(countyKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); + vaccinationAuthDTO.setStreetKeywords(streetKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); + vaccinationAuthDTO.setCommunityKeywords(communityKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); + vaccinationAuthDTO.setGridKeywords(gridKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); + } + return vaccinationAuthDTO; + } + + @Override + public Map getVaccinationAuthParams(Long userId) { + Map map = new HashMap<>(4); + UserDetail user = SecurityUser.getUser(); + if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { + return map; + } + + VaccinationAuthDTO dto = getVaccinationAuth(userId); + + if (!dto.getCountyKeywords().isEmpty()) { + map.put("countyKeywords", dto.getCountyKeywords()); + } else { + map.put("countyKeywords", null); + } + if (!dto.getStreetKeywords().isEmpty()) { + map.put("streetKeywords", dto.getStreetKeywords()); + } else { + map.put("streetKeywords", null); + } + if (!dto.getCommunityKeywords().isEmpty()) { + map.put("communityKeywords", dto.getCommunityKeywords()); + } else { + map.put("communityKeywords", null); + } + if (!dto.getGridKeywords().isEmpty()) { + map.put("gridKeywords", dto.getGridKeywords()); + } else { + map.put("gridKeywords", null); + } + return map; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml index 5299867..c77b89e 100644 --- a/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml @@ -124,6 +124,24 @@ and ui.VACCINATION_STATE IN ('1', '2') + + AND uir.LIVE_ADDRESS_NAME IN + + #{street} + + + + AND uir.COMMUNITY IN + + #{community} + + + + AND uir.GRID_NAME IN + + #{grid} + + GROUP BY ui.ID ORDER BY uir.CREATED_TIME DESC @@ -265,6 +283,24 @@ and i.USER_NAME like '%${userName}%' + + AND r.LIVE_ADDRESS_NAME IN + + #{street} + + + + AND r.COMMUNITY IN + + #{community} + + + + AND r.GRID_NAME IN + + #{grid} + + GROUP BY i.ID ORDER BY i.CREATED_TIME DESC diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml index 7f9b808..a1f1f07 100644 --- a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml @@ -5,28 +5,25 @@ - - - + + + - - - - + + + + diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationRoleDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationRoleDao.xml new file mode 100644 index 0000000..8d7fb0b --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationRoleDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml new file mode 100644 index 0000000..9d5692c --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + vaccination_user_role + WHERE + user_id = #{userId} + + + + \ No newline at end of file