Browse Source

接种权限

feature/independent
zhangyuan 5 years ago
parent
commit
1f4c81e30a
  1. 14
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java
  2. 21
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java
  3. 106
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationRoleController.java
  4. 95
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/VaccinationUserRoleController.java
  5. 34
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationRoleDao.java
  6. 77
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationUserRoleDao.java
  7. 58
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationAuthDTO.java
  8. 101
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationRoleDTO.java
  9. 103
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationUserRoleDTO.java
  10. 69
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationRoleEntity.java
  11. 49
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/entity/VaccinationUserRoleEntity.java
  12. 74
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationRoleExcel.java
  13. 62
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationUserRoleExcel.java
  14. 33
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationRoleService.java
  15. 54
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationUserRoleService.java
  16. 18
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java
  17. 89
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationRoleServiceImpl.java
  18. 166
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationUserRoleServiceImpl.java
  19. 36
      epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml
  20. 77
      epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml
  21. 23
      epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationRoleDao.xml
  22. 66
      epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml

14
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java

@ -523,6 +523,7 @@ public class SysUserController {
public Result<List<SysRoleMembersDTO>> 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<java.util.List < com.elink.esua.epdc.dto.SysRoleMembersDTO>>
* @author zhy
* @date 2021/5/31 15:44
*/
@GetMapping("userList")
public Result<List<SysUserDTO>> userList(@RequestParam Map<String, Object> params) {
return new Result<List<SysUserDTO>>().ok(sysUserService.list(params));
}
}

21
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<EpidemicUserInf
public EpidemicUserInoutRecordService epidemicUserInoutRecordService;
@Autowired
public EpidemicReportUserInfoService epidemicReportUserInfoService;
@Autowired
public VaccinationUserRoleService vaccinationUserRoleService;
@Resource
public SelectAreaDao selectAreaDao;
@Resource
@ -84,6 +89,14 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
@Override
public PageData<EpidemicRecordListDTO> getPageList(Map<String, Object> params) {
IPage<EpidemicRecordListDTO> page = getPage(params);
UserDetail user = SecurityUser.getUser();
if (user == null) {
throw new RenException("用户未登录");
}
Map<String, Object> authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId());
params.putAll(authParams);
List<EpidemicRecordListDTO> list = baseDao.getEpidemicUserRecordList(params);
for (EpidemicRecordListDTO eru : list) {
eru.setUserName(nameDesensitization(eru.getUserName()));
@ -445,6 +458,14 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
@Override
public PageData<EpidemicPageResultDTO> getEpidemicPage(Map<String, Object> params) {
IPage<EpidemicPageResultDTO> page = getEpiPage(params);
UserDetail user = SecurityUser.getUser();
if (user == null) {
throw new RenException("用户未登录");
}
Map<String, Object> authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId());
params.putAll(authParams);
List<EpidemicPageResultDTO> list = baseDao.getEpidemicPage(params);
return new PageData<>(list, page.getTotal());
}

106
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<VaccinationRoleDTO>> page(@RequestParam Map<String, Object> params) {
PageData<VaccinationRoleDTO> page = vaccinationRoleService.page(params);
return new Result<PageData<VaccinationRoleDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<VaccinationRoleDTO> get(@PathVariable("id") Long id) {
VaccinationRoleDTO data = vaccinationRoleService.get(id);
return new Result<VaccinationRoleDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<VaccinationRoleDTO> list = vaccinationRoleService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, VaccinationRoleExcel.class);
}
/**
* 展示角色列表
*
* @param params
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < SysUserDTO>>
* @author zhy
* @date 2021/5/31 15:55
*/
@GetMapping("roleList")
public Result<List<VaccinationRoleDTO>> roleList(@RequestParam Map<String, Object> params) {
return new Result<List<VaccinationRoleDTO>>().ok(vaccinationRoleService.list(params));
}
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<VaccinationUserRoleDTO>> page(@RequestParam Map<String, Object> params){
PageData<VaccinationUserRoleDTO> page = vaccinationUserRoleService.page(params);
return new Result<PageData<VaccinationUserRoleDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<VaccinationUserRoleDTO> get(@PathVariable("id") Long id){
VaccinationUserRoleDTO data = vaccinationUserRoleService.get(id);
return new Result<VaccinationUserRoleDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<VaccinationUserRoleDTO> list = vaccinationUserRoleService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, VaccinationUserRoleExcel.class);
}
}

34
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<VaccinationRoleEntity> {
}

77
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<VaccinationUserRoleEntity> {
/**
* 默认查询
*
* @param params
* @return java.util.List<com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO>
* @author zhy
* @date 2021/5/31 15:31
*/
List<VaccinationUserRoleDTO> getList(Map<String, Object> 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<VaccinationUserRoleDTO> selectByUserId(@Param("userId") Long userId);
/**
* 根据用户ID查找
*
* @param userId
* @return void
* @author zhy
* @date 2021/5/31 16:21
*/
List<VaccinationRoleDTO> selectRoleByUserId(@Param("userId") Long userId);
}

58
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<String> countyKeywords;
/**
* 街道/乡镇关键词
*/
private List<String> streetKeywords;
/**
* 社区/村关键词
*/
private List<String> communityKeywords;
/**
* 网格关键词
*/
private List<String> gridKeywords;
}

101
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

103
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<Long> roleIds;
/**
* 角色
*/
private String roleNames;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

69
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

49
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

74
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

62
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<VaccinationRoleEntity, VaccinationRoleDTO> {
}

54
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<VaccinationUserRoleEntity, VaccinationUserRoleDTO> {
/**
* 获取用户的所有接种数据权限
*
* @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<String, Object> getVaccinationAuthParams(Long userId);
}

18
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<Vaccinati
private VaccinationSiteService vaccinationSiteService;
@Autowired
private VaccinationErrorService vaccinationErrorService;
@Autowired
public VaccinationUserRoleService vaccinationUserRoleService;
@Resource
private VaccinationErrorDao vaccinationErrorDao;
@Resource
@ -88,6 +90,14 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
@Override
public PageData<VaccinationInfoDTO> page(Map<String, Object> params) {
IPage<VaccinationInfoEntity> page = getPage(params, FieldConstant.CREATED_TIME, false);
UserDetail user = SecurityUser.getUser();
if (user == null) {
throw new RenException("用户未登录");
}
Map<String, Object> authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId());
params.putAll(authParams);
List<VaccinationInfoDTO> list = getVaccinationInfoList(params);
return new PageData<>(list, page.getTotal());
}

89
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<VaccinationRoleDao, VaccinationRoleEntity, VaccinationRoleDTO> implements VaccinationRoleService {
@Override
public QueryWrapper<VaccinationRoleEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<VaccinationRoleEntity> 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}]", ",");
}
}

166
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<VaccinationUserRoleDao, VaccinationUserRoleEntity, VaccinationUserRoleDTO> implements VaccinationUserRoleService {
@Override
public QueryWrapper<VaccinationUserRoleEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<VaccinationUserRoleEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PageData<VaccinationUserRoleDTO> page(Map<String, Object> params) {
IPage<VaccinationUserRoleEntity> page = getPage(params, FieldConstant.CREATED_TIME, false);
List<VaccinationUserRoleDTO> list = baseDao.getList(params);
return new PageData<>(list, page.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(VaccinationUserRoleDTO dto) {
List<VaccinationUserRoleDTO> checkExist = baseDao.selectByUserId(dto.getUserId());
if (!checkExist.isEmpty()) {
throw new RenException("该用户已经授权");
}
List<Long> 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<Long> 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<VaccinationRoleDTO> roleList = baseDao.selectRoleByUserId(userId);
if (!roleList.isEmpty()) {
List<String> countyKeywords = new ArrayList<>();
List<String> streetKeywords = new ArrayList<>();
List<String> communityKeywords = new ArrayList<>();
List<String> 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<String, Object> getVaccinationAuthParams(Long userId) {
Map<String, Object> 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;
}
}

36
epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml

@ -124,6 +124,24 @@
<if test="isInoculate != null and isInoculate != '' and isInoculate == 12">
and ui.VACCINATION_STATE IN ('1', '2')
</if>
<if test="streetKeywords != null">
AND uir.LIVE_ADDRESS_NAME IN
<foreach collection="streetKeywords" index="index" item="street" open="(" separator="," close=")">
#{street}
</foreach>
</if>
<if test="communityKeywords != null">
AND uir.COMMUNITY IN
<foreach collection="communityKeywords" index="index" item="community" open="(" separator="," close=")">
#{community}
</foreach>
</if>
<if test="gridKeywords != null">
AND uir.GRID_NAME IN
<foreach collection="gridKeywords" index="index" item="grid" open="(" separator="," close=")">
#{grid}
</foreach>
</if>
GROUP BY ui.ID
ORDER BY uir.CREATED_TIME DESC
</select>
@ -265,6 +283,24 @@
<if test="userName!=null and userName!=''">
and i.USER_NAME like '%${userName}%'
</if>
<if test="streetKeywords != null">
AND r.LIVE_ADDRESS_NAME IN
<foreach collection="streetKeywords" index="index" item="street" open="(" separator="," close=")">
#{street}
</foreach>
</if>
<if test="communityKeywords != null">
AND r.COMMUNITY IN
<foreach collection="communityKeywords" index="index" item="community" open="(" separator="," close=")">
#{community}
</foreach>
</if>
<if test="gridKeywords != null">
AND r.GRID_NAME IN
<foreach collection="gridKeywords" index="index" item="grid" open="(" separator="," close=")">
#{grid}
</foreach>
</if>
GROUP BY i.ID
ORDER BY i.CREATED_TIME DESC
</select>

77
epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml

@ -5,28 +5,25 @@
<select id="getVaccinationInfoList" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO">
SELECT
DATE_FORMAT(v.VACCINATION_TIME,'%Y-%m-%d %H:%i:%S') as VACCINATION_TIME,
v.*
DATE_FORMAT(v.VACCINATION_TIME,'%Y-%m-%d %H:%i:%S') as VACCINATION_TIME1,
v.*
FROM
vaccination_info v
vaccination_info v
<if test="vaccTime != null and vaccTime != '' and vaccTime != 0">
LEFT JOIN epidemic_user_info u ON u.ID_CARD = v.IDENTITY_NO
INNER JOIN (
SELECT
IDENTITY_NO,
max(DOSE) AS maxDose,
IFNULL(VACCINATION_TIME,now()) as VACCINATION_TIME
FROM
vaccination_info
WHERE
DEL_FLAG = '0'
GROUP BY
IDENTITY_NO
) vi ON vi.IDENTITY_NO = v.IDENTITY_NO
AND vi.maxDose = v.DOSE
<if test="streetKeywords == null and communityKeywords == null and gridKeywords == null">
LEFT JOIN epidemic_user_info u ON u.ID_CARD = v.IDENTITY_NO
</if>
</if>
<if test="streetKeywords != null or communityKeywords != null or gridKeywords != null">
LEFT JOIN epidemic_user_info u ON u.ID_CARD = v.IDENTITY_NO
LEFT JOIN epidemic_user_inout_record uir ON uir.ID_CARD = v.IDENTITY_NO
</if>
WHERE
v.DEL_FLAG = '0'
v.DEL_FLAG = '0'
<if test="streetKeywords != null or communityKeywords != null or gridKeywords != null">
AND uir.DEL_FLAG = '0'
AND u.DEL_FLAG = '0'
</if>
<if test="realName != null and realName != ''">
AND v.REAL_NAME LIKE concat('%', #{realName}, '%')
</if>
@ -44,8 +41,9 @@
</if>
<if test="vaccTime != null and vaccTime != '' and vaccTime != 0">
AND u.DEL_FLAG = '0'
AND v.DOSE = u.VACCINATION_NUM
AND u.VACCINATION_STATE = 1
AND datediff(NOW(), vi.VACCINATION_TIME) >= #{vaccTime}
AND datediff(NOW(), v.VACCINATION_TIME) >= #{vaccTime}
</if>
<if test="vaccNo != null and vaccNo != '' and vaccNo != 0">
AND v.DOSE = #{vaccNo}
@ -62,15 +60,36 @@
<if test="gridName != null and gridName != ''">
and v.GRID like '%${gridName}%'
</if>
<if test="streetKeywords != null">
AND uir.LIVE_ADDRESS_NAME IN
<foreach collection="streetKeywords" index="index" item="street" open="(" separator="," close=")">
#{street}
</foreach>
</if>
<if test="communityKeywords != null">
AND uir.COMMUNITY IN
<foreach collection="communityKeywords" index="index" item="community" open="(" separator="," close=")">
#{community}
</foreach>
</if>
<if test="gridKeywords != null">
AND uir.GRID_NAME IN
<foreach collection="gridKeywords" index="index" item="grid" open="(" separator="," close=")">
#{grid}
</foreach>
</if>
GROUP BY
v.IDENTITY_NO,
v.DOSE
</select>
<select id="checkVaccination" resultType="com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity">
SELECT
id,dose
id,dose
FROM
vaccination_info
vaccination_info
WHERE
DEL_FLAG = '0'
DEL_FLAG = '0'
AND IDENTITY_NO = #{identityNo}
<if test="dose != null and dose != ''">
AND DOSE = #{dose}
@ -142,14 +161,14 @@
</select>
<resultMap id="userVimInfoResultMap" type="com.elink.esua.epdc.vaccine.vim.dto.result.EpdcAppVimInfoResultDTO">
<result column="USER_NAME" property="userName" />
<result column="ID_CARD" property="idCard" />
<result column="VACCINATION_STATE" property="vaccinationState" />
<result column="USER_NAME" property="userName"/>
<result column="ID_CARD" property="idCard"/>
<result column="VACCINATION_STATE" property="vaccinationState"/>
<collection property="vaccinationList" ofType="com.elink.esua.epdc.vaccine.vim.dto.result.EpdcAppDoseInfoDTO">
<result column="DOSE" property="vaccinationNum" />
<result column="VACCINATION_TIME" property="vaccinationTime" />
<result column="COMPANY_NAME" property="vaccinationCompany" />
<result column="SITE_NAME" property="vaccinationSite" />
<result column="DOSE" property="vaccinationNum"/>
<result column="VACCINATION_TIME" property="vaccinationTime"/>
<result column="COMPANY_NAME" property="vaccinationCompany"/>
<result column="SITE_NAME" property="vaccinationSite"/>
</collection>
</resultMap>

23
epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationRoleDao.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.vim.dao.VaccinationRoleDao">
<resultMap type="com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity" id="vaccinationRoleMap">
<result property="id" column="ID"/>
<result property="roleName" column="ROLE_NAME"/>
<result property="countyKeywords" column="COUNTY_KEYWORDS"/>
<result property="streetKeywords" column="STREET_KEYWORDS"/>
<result property="communityKeywords" column="COMMUNITY_KEYWORDS"/>
<result property="gridKeywords" column="GRID_KEYWORDS"/>
<result property="remark" column="REMARK"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

66
epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.vim.dao.VaccinationUserRoleDao">
<resultMap type="com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity" id="vaccinationUserRoleMap">
<result property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="roleId" column="ROLE_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getList" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO">
SELECT
ur.*, u.real_name AS userName,
group_concat(r.ROLE_NAME) AS roleNames
FROM
vaccination_user_role ur
INNER JOIN sys_user u ON u.id = ur.USER_ID
INNER JOIN vaccination_role r ON r.id = ur.ROLE_ID
WHERE
ur.DEL_FLAG = '0'
AND u.del_flag = '0'
AND r.DEL_FLAG = '0'
<if test="userName != null and userName != ''">
AND u.REAL_NAME LIKE concat('%', #{userName}, '%')
</if>
GROUP BY
ur.USER_ID
</select>
<delete id="deleteByUserId">
DELETE
FROM
vaccination_user_role
WHERE
user_id = #{userId}
</delete>
<select id="selectByUserId" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO">
SELECT *
FROM
vaccination_user_role
WHERE
user_id = #{userId}
</select>
<select id="selectRoleByUserId" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO">
SELECT
r.id,
r.ROLE_NAME,
IFNULL(COUNTY_KEYWORDS, '') AS COUNTY_KEYWORDS,
IFNULL(STREET_KEYWORDS, '') AS STREET_KEYWORDS,
IFNULL(COMMUNITY_KEYWORDS, '') AS COMMUNITY_KEYWORDS,
IFNULL(GRID_KEYWORDS, '') AS GRID_KEYWORDS,
REMARK
FROM
vaccination_user_role ur
LEFT JOIN vaccination_role r ON r.id = ur.ROLE_ID
WHERE
ur.user_id = #{userId}
</select>
</mapper>
Loading…
Cancel
Save