Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
| | |
| | | * @param imgType 文件类型:X光片/医院Logo[Xray/Logo] |
| | | */ |
| | | @PostMapping(value = "/baseUplaod",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | FileInfo baseUplaod(@RequestParam("file") String file,@RequestParam("imgType") String imgType); |
| | | FileInfo baseUplaod(@RequestParam("file") String file,@RequestParam("imgType") String imgType,@RequestParam("hospitalId") String hospitalId,@RequestParam("departmentId") String departmentId); |
| | | |
| | | /** |
| | | * base64 下载图片 |
| | |
| | | public FileInfo feignUpload(@RequestPart("file") MultipartFile file,@RequestParam String imgType) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public FileInfo baseUplaod(String file, String imgType) { |
| | | public FileInfo baseUplaod(String file, String imgType, String hospitalId, String departmentId) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | /** |
| | | * base64上传图片 |
| | | */ |
| | | FileInfo baseUplaod(String file, String imgType); |
| | | FileInfo baseUplaod(String file, String imgType, String hospitalId, String departmentId); |
| | | /** |
| | | * base64图片下载 |
| | | */ |
| | |
| | | */ |
| | | protected abstract void uploadFile(MultipartFile file, FileInfo fileInfo) throws Exception; |
| | | protected abstract void fileUpLoadOss(FileInfo fileInfo,String newFilePath, InputStream fileStream); |
| | | protected abstract String FilePath(String imgType,String folderByDate); |
| | | protected abstract String FilePath(String imgType,String folderByDate,String hospitalId,String departmentId); |
| | | protected abstract OSSObject down(String url); |
| | | |
| | | /** |
| | |
| | | //将生成的文件转换为流 |
| | | InputStream inputStream=new FileInputStream(thuFile); |
| | | String folderByDate = DateUtil.formatDate(new Date()); |
| | | String filefloder=this.FilePath(imgType,folderByDate); |
| | | String filefloder=this.FilePath(imgType,folderByDate,null,null); |
| | | FileInfo newfileInfo=new FileInfo(); |
| | | newfileInfo.setName(newFileName); |
| | | newfileInfo.setId(IdUtil.fastSimpleUUID()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public FileInfo baseUplaod(String file, String imgType) { |
| | | public FileInfo baseUplaod(String file, String imgType, String hospitalId, String departmentId) { |
| | | if(file==null||"".equals(file.trim())){ |
| | | return null; |
| | | } |
| | |
| | | newfileInfo.setSource("aliyun"); |
| | | newfileInfo.setImgType(imgType); |
| | | newfileInfo.setCreateTime(new Date()); |
| | | this.fileUpLoadOss(newfileInfo,"HospitalLogo/"+newFileName,input); |
| | | String folderByDate =DateUtil.formatDate(new Date()); |
| | | String filePath = FilePath(imgType, folderByDate, hospitalId, departmentId); |
| | | this.fileUpLoadOss(newfileInfo,filePath,input); |
| | | input.close(); |
| | | baseMapper.insert(newfileInfo); |
| | | return newfileInfo; |
| | |
| | | private FileServerProperties fileProperties; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 阿里云文件存储client |
| | | * 只有配置了aliyun.oss.access-key才可以使用 |
| | |
| | | String fileName= UUID.randomUUID().toString().replaceAll("-","")+fileType; |
| | | String fileFolder = ""; |
| | | if(clientID.equals("hospital")){//医院端平台, |
| | | fileFolder=FilePath(fileInfo.getImgType(),folderByDate); |
| | | fileFolder = FilePath(fileInfo.getImgType(), folderByDate, null, null); |
| | | fileUpLoadOss(fileInfo,fileFolder + fileName,file.getInputStream()); |
| | | } |
| | | else { |
| | | } else { |
| | | fileUpLoadOss(fileInfo,fileProperties.getOss().getFolder() + folderByDate + "/" + fileName,file.getInputStream()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 给OSS上上传文件 |
| | | * |
| | | * @param fileInfo 返回对象 |
| | | * @param newFilePath 上传到的文件路径 |
| | | * @param fileStream 要上传的文件流 |
| | | */ |
| | | public void fileUpLoadOss(FileInfo fileInfo,String newFilePath, InputStream fileStream) |
| | | { |
| | | public void fileUpLoadOss(FileInfo fileInfo, String newFilePath, InputStream fileStream) { |
| | | ossClient.putObject(fileProperties.getOss().getBucketName(), newFilePath, fileStream); |
| | | fileInfo.setUrl(fileProperties.getOss().getDomain() + newFilePath); |
| | | |
| | | } |
| | | |
| | | public OSSObject down(String url){ |
| | | GetObjectRequest request=new GetObjectRequest(fileProperties.getOss().getBucketName(),url); |
| | | return ossClient.getObject(request); |
| | | } |
| | | |
| | | /** |
| | | * 组合sso上的文件路径 |
| | | * |
| | | * @param imgType |
| | | * @return |
| | | */ |
| | | public String FilePath(String imgType,String folderByDate) |
| | | { |
| | | public String FilePath(String imgType, String folderByDate, String hospitalId, String departmentId) { |
| | | //返回的文件路径 |
| | | String fileFolder=""; |
| | | if (StringUtils.isNotBlank(imgType)) { |
| | |
| | | if (imgType.toLowerCase().equals("xray")) { |
| | | String hospitalID = httpServletRequest.getHeader(SecurityConstants.USER_HOSPITAL_ID_HEADER); |
| | | String depID = httpServletRequest.getHeader(SecurityConstants.USER_DEP_ID_HEADER); |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(hospitalID) && |
| | | org.apache.commons.lang3.StringUtils.isBlank(depID)) { |
| | | fileFolder = "Xray/" + hospitalID + "/" + depID + "/"+ folderByDate + "/"; |
| | | } else { |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(hospitalId) && |
| | | org.apache.commons.lang3.StringUtils.isBlank(departmentId)) { |
| | | fileFolder = "Xray/" + hospitalId + "/" + departmentId + "/" + folderByDate + "/"; |
| | | } else { |
| | | fileFolder = "Xray/" + folderByDate + "/"; |
| | | } |
| | | } |
| | | } else if (imgType.toLowerCase().equals("app")) { |
| | | //移动端APP上传 |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(hospitalId) && |
| | | org.apache.commons.lang3.StringUtils.isBlank(departmentId)) { |
| | | fileFolder = "AppXray/" + hospitalId + "/" + departmentId + "/" + folderByDate + "/"; |
| | | } else { |
| | | fileFolder = "AppXray/" + folderByDate + "/"; |
| | | } |
| | | } |
| | | // 医院Logo只保存在一个目录中 |
| | | else if (imgType.toLowerCase().equals("logo")) { |
| | | fileFolder = "HospitalLogo/"; |
| | | }else if (imgType.toLowerCase().equals("doctor")) { |
| | | fileFolder = "DoctorImage/"; |
| | | } |
| | | else { |
| | | } else { |
| | | fileFolder = "OtherImage/"+ folderByDate + "/"; |
| | | } |
| | | |
| | | } else { |
| | | fileFolder = "OtherImage/"+ folderByDate + "/"; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected String FilePath(String imgType, String folderByDate) { |
| | | protected String FilePath(String imgType, String folderByDate,String hospitalId,String departmentId) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected String FilePath(String imgType, String folderByDate) { |
| | | protected String FilePath(String imgType, String folderByDate,String hospitalId,String departmentId) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | * base64上传图片 |
| | | */ |
| | | @PostMapping(value="baseUplaod",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | public FileInfo baseUplaod(@RequestParam("file") String file,@RequestParam("imgType") String imgType){ |
| | | return fileService.baseUplaod(file,imgType); |
| | | public FileInfo baseUplaod(@RequestParam("file") String file,@RequestParam("imgType") String imgType, |
| | | @RequestParam("hospitalId") String hospitalId,@RequestParam("departmentId") String departmentId){ |
| | | return fileService.baseUplaod(file,imgType,hospitalId,departmentId); |
| | | } |
| | | /** |
| | | * base64图片下载 |
| | |
| | | application: |
| | | name: filecenter-server |
| | | datasource: |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/file_center?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/file_center_${spring.profiles.active}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: ${kidgrow.datasource.username} |
| | | password: ${kidgrow.datasource.password} |
| | | # driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | # domain: http://123.kidgrow.cloud/ |
| | | ## domain: https://kidgrow.oss-accelerate.aliyuncs.com/ |
| | | # folder: kidgrow/ |
| | | access-key: LTAI4FennfcwZupz3B6hkK3N |
| | | accessKeySecret: NzBBGe8SS41qJlp0nA3tlJ3t74lBZM |
| | | access-key: ${kidgrow.oss.access-key} |
| | | accessKeySecret: ${kidgrow.oss.accessKeySecret} |
| | | # endpoint: kidgrow.oss-cn-beijing-internal.aliyuncs.com |
| | | endpoint: 123.kidgrow.cloud |
| | | endpoint: ${kidgrow.oss.endpoint} |
| | | # endpoint: oss-accelerate.aliyuncs.com |
| | | bucketName: kidgrow |
| | | bucketName: ${kidgrow.oss.bucketName} |
| | | #注意加上/ |
| | | domain: http://123.kidgrow.cloud/ |
| | | domain: ${kidgrow.oss.domain} |
| | | # domain: https://kidgrow.oss-accelerate.aliyuncs.com/ |
| | | folder: kidgrow/ |
| | | |
| | |
| | | application: |
| | | name: oprationcenter-server |
| | | datasource: |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/opration_center?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/opration_center_${spring.profiles.active}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: ${kidgrow.datasource.username} |
| | | password: ${kidgrow.datasource.password} |
| | | # driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | aop-patterns: com.kidgrow.oprationcenter.controller.*,com.kidgrow.oprationcenter.mapper.* |
| | | # rabbitMQ |
| | | rabbitmq: |
| | | host: 182.92.99.224 |
| | | port: 5672 |
| | | username: liuke |
| | | password: kidgrow2020 |
| | | host: ${kidgrow.rabbitmq.host} |
| | | port: ${kidgrow.rabbitmq.port} |
| | | username: ${kidgrow.rabbitmq.username} |
| | | password: ${kidgrow.rabbitmq.password} |
| | | #交换机名称 |
| | | exchangeName: BoneAgeEvaluation |
| | | exchangeName: ${kidgrow.rabbitmq.exchangeName} |
| | | #队列名称 |
| | | queueName: test_queue #AdvancedEvaluation # AIEvaluation #,AdvancedEvaluationResult |
| | | queueName: ${kidgrow.rabbitmq.queueName} #AdvancedEvaluation # AIEvaluation #,AdvancedEvaluationResult |
| | | #routingKeyName |
| | | routingKeyName: Kidgrow2020 |
| | | virtual-host: kidgrow |
| | | routingKeyName: ${kidgrow.rabbitmq.routingKeyName} |
| | | virtual-host: ${kidgrow.rabbitmq.virtual-host} |
| | | AIEvaluationResults: AIEvaluationResults_${spring.profiles.active} |
| | | #开启重试机制 |
| | | listener: |
| | | simple: |
| | |
| | | package com.kidgrow.usercenter.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SysDoctorDto extends SysDoctorVo { |
| | | //private String username; |
| | | private String password; |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | private List<Long> roles; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Long HospitalIdByDepartmentId(Long departmentId); |
| | | |
| | | /** |
| | | * 删除用户 不删除关系表 ,role_user 表 和 用户组织 |
| | | * |
| | | * @param id |
| | | */ |
| | | boolean deleteNoContact(Long id); |
| | | } |
| | |
| | | @Autowired |
| | | private ISysUserService iSysUserService; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | @Autowired |
| | | private PasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | private ISysUserOrgService sysUserOrgService; |
| | |
| | | if (sysDoctor.getId() == null) { |
| | | Long sysUserId = null; |
| | | //保存部门信息 |
| | | ResultBody resultBody = this.saveFenjiekou(sysDoctor, id, sysHospital, sysDepartment); |
| | | ResultBody resultBody = this.saveFenjiekou(sysDoctor, id, sysHospital, sysDepartment,null); |
| | | if(resultBody.getCode()==0){ |
| | | sysUserId=(Long)resultBody.getData(); |
| | | }else { |
| | |
| | | //更新 |
| | | SysDoctor getOne = baseMapper.selectById(sysDoctor.getId()); |
| | | if (getOne.getDoctorType() != 2 && sysDoctor.getDoctorType() != 2) { |
| | | /** |
| | | * 管理员只有一个 |
| | | */ |
| | | if (isSupperRole(sysDoctor)) { |
| | | return ResultBody.failed("该部门已经有管理员"); |
| | | } |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("user_id", sysDoctor.getUserId()); |
| | | boolean b = sysUserOrgService.removeByMap(columnMap); |
| | |
| | | redisUtils.hdel(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString()); |
| | | } |
| | | redisUtils.hset(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString(), sysUserOrg); |
| | | //角色更换 |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("user_id",getOne.getUserId()); |
| | | int delete = sysUserRoleMapper.delete(queryWrapper); |
| | | sysDoctor.getRoles().forEach(e -> { |
| | | SysRoleUser sysRoleUser = new SysRoleUser(); |
| | | sysRoleUser.setRoleId(e); |
| | | sysRoleUser.setUserId(getOne.getUserId()); |
| | | int insert = sysUserRoleMapper.insert(sysRoleUser); |
| | | }); |
| | | } else if (getOne.getDoctorType() == 2 && sysDoctor.getDoctorType() != 2) { |
| | | /** |
| | | * 管理员只有一个 |
| | |
| | | if (isSupperRole(sysDoctor)) { |
| | | return ResultBody.failed("该部门已经有管理员"); |
| | | } |
| | | ResultBody resultBody = this.saveFenjiekou(sysDoctor, id, sysHospital, sysDepartment); |
| | | ResultBody resultBody = this.saveFenjiekou(sysDoctor, id, sysHospital, sysDepartment,getOne); |
| | | Long sysUserId = null; |
| | | if(resultBody.getCode()==0){ |
| | | sysUserId=(Long)resultBody.getData(); |
| | |
| | | redisUtils.hdel(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString()); |
| | | sysDoctor.setUserId(null); |
| | | baseMapper.updateById(sysDoctor); |
| | | //将用户删除 |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setId(getOne.getUserId()); |
| | | sysUser.setDel(true); |
| | | sysUserMapper.deleteById(sysUser); |
| | | } else if (getOne.getDoctorType() == 2 && sysDoctor.getDoctorType() == 2) { |
| | | baseMapper.updateById(sysDoctor); |
| | | } |
| | |
| | | wrapper.in("user_id", collect); |
| | | List<SysRoleUser> list = this.sysUserRoleMapper.selectList(wrapper); |
| | | for (SysRoleUser sysRoleUser : list) { |
| | | if (sysRoleUser.getRoleId() == CommonConstant.HOSPITAL_ADMIN_ID) { |
| | | if (sysRoleUser.getRoleId().equals( CommonConstant.HOSPITAL_ADMIN_ID)) { |
| | | flag = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //保存的分接口 |
| | | public ResultBody saveFenjiekou(SysDoctorDto sysDoctor, String id, SysHospital sysHospital, SysDepartment sysDepartment) { |
| | | public ResultBody saveFenjiekou(SysDoctorDto sysDoctor, String id, SysHospital sysHospital, SysDepartment sysDepartment,SysDoctor getOne) { |
| | | Long sysUserId = null; |
| | | /** |
| | | * 管理员只有一个 |
| | |
| | | return ResultBody.failed("该部门已经有管理员"); |
| | | } |
| | | if (sysDoctor.getDoctorType() != 2) { |
| | | //保存 |
| | | SysUser sysUser = new SysUser(); |
| | | //保存 |
| | | sysUser.setUsername(sysDoctor.getUsername()); |
| | | sysUser.setPassword(passwordEncoder.encode(sysDoctor.getPassword())); |
| | | sysUser.setNickname(sysDoctor.getDoctorName()); |
| | |
| | | sysUser.setCreateUserId(byId.getId()); |
| | | sysUser.setCreateUserName(byId.getUsername()); |
| | | } |
| | | //做判断是否注册过手机号; |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("username",sysDoctor.getDoctorTel()); |
| | | queryWrapper.eq("enabled",1); |
| | | queryWrapper.eq("is_del",0); |
| | | Integer integer = sysUserMapper.selectCount(queryWrapper); |
| | | if(integer>0){ |
| | | return ResultBody.failed("该手机号已经注册"); |
| | | } |
| | | if (getOne!=null&&getOne.getUserId()!=null) { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("id",getOne.getUserId()); |
| | | map.put("enabled",1); |
| | | map.put("is_del",1); |
| | | List<SysUser> sysUsers = sysUserMapper.selectByMap(map); |
| | | if(sysUsers!=null&&!sysUsers.isEmpty()){ |
| | | sysUser.setId(sysUsers.get(sysUsers.size()-1).getId()); |
| | | } |
| | | } |
| | | if(sysUser.getId()!=null){ |
| | | //更新 |
| | | sysUser.setDel(false); |
| | | iSysUserService.updateById(sysUser); |
| | | }else { |
| | | //保存 |
| | | iSysUserService.save(sysUser); |
| | | } |
| | | sysUserId = sysUser.getId(); |
| | | //保存一个角色 |
| | | sysDoctor.getRoles().forEach(e -> { |
| | |
| | | if (id > 0 && adminId > 0) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("user_id", adminId); |
| | | map.put("is_admin_user",1); |
| | | map.put("is_del",0); |
| | | map.put("enabled",1); |
| | | List<SysDoctor> sysDoctors = baseMapper.selectByMap(map); |
| | | if (sysDoctors == null || sysDoctors.size() <= 0) { |
| | | return ResultBody.failed("当前操作用户不是管理员"); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.constant.DictionariesConstants; |
| | |
| | | /** |
| | | * 获取登录用户的一系列信息 hrj 06-04修改 |
| | | * |
| | | * @param sysUser |
| | | * @param sysUserNew |
| | | * @return |
| | | */ |
| | | @Override |
| | | public LoginAppUser getLoginAppUser(SysUser sysUser) { |
| | | public LoginAppUser getLoginAppUser(SysUser sysUserNew) { |
| | | LoginAppUser loginAppUser = new LoginAppUser(); |
| | | SysUser sysUserNew = this.baseMapper.selectById(sysUser); |
| | | SysUser sysUser = this.baseMapper.selectById(sysUserNew); |
| | | if (sysUser != null) { |
| | | //返回的数据为什么要把密码也返回?清空!! |
| | | loginAppUser.setPassword(""); |
| | | loginAppUser.setNewPassword(""); |
| | | loginAppUser.setOldPassword(""); |
| | | |
| | | BeanUtils.copyProperties(sysUser, loginAppUser); |
| | | //获取用户所属组织机构列表 |
| | | loginAppUser.setDefaultAuth(sysUserNew.getDefaultAuth()); |
| | | loginAppUser.setDefaultAuth(sysUser.getDefaultAuth()); |
| | | List<SysOrganization> sysOrganizations = organizationService.findListByUserId(sysUser.getId()); |
| | | //设置组织机构集合 |
| | | if (sysOrganizations != null) { |
| | | loginAppUser.setOrganizations(sysOrganizations); |
| | | } |
| | | List<SysRole> sysRoles = roleUserService.findRolesByUserId(sysUser.getId()); |
| | | // 设置角色 |
| | | loginAppUser.setRoles(sysRoles); |
| | |
| | | loginAppUser.setPermissions(permissions); |
| | | } |
| | | } |
| | | //是否医院管理员 |
| | | com.kidgrow.usercenter.model.SysDoctor sysDoctor = findDoctorByUserId(sysUser.getId()); |
| | | if (sysDoctor.getIsAdminUser() != null) { |
| | | loginAppUser.setHAdminUser(sysDoctor.getIsAdminUser()); |
| | | } |
| | | //医院信息 只有H端要返回的信息 |
| | | if (sysUser.getTenantId().toLowerCase().equals(CommonConstant.H_TENANT.toLowerCase())) { |
| | | DoctorUserAll doctorUserAllVo = baseMapper.findDoctorUserAllData(sysUser.getId()); |
| | | loginAppUser.setDoctorUserAllVO(doctorUserAllVo); |
| | | //是否医院管理员 |
| | | loginAppUser.setHAdminUser(doctorUserAllVo.getIsAdminUser()); |
| | | } |
| | | //返回的数据为什么要把密码也返回?清空!! |
| | | loginAppUser.setPassword(""); |
| | | loginAppUser.setNewPassword(""); |
| | | loginAppUser.setOldPassword(""); |
| | | } |
| | | return loginAppUser; |
| | | } |
| | |
| | | organizationService.deleteByUserId(id); |
| | | //删除医生数据 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("userId", id); |
| | | params.put("user_id", id); |
| | | sysDoctorMapper.deleteByMap(params); |
| | | //删除用户数据 |
| | | return baseMapper.deleteById(id) > 0; |
| | |
| | | |
| | | @Override |
| | | public ResultBody findCountByMap(Map<String, Object> map) { |
| | | map.put("enable",1); |
| | | map.put("is_del",0); |
| | | Integer integer = baseMapper.selectCountByMap(map); |
| | | return ResultBody.ok().data(integer); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //业务执行中途出错 手动撤回数据 |
| | | //业务执行中途出错 |
| | | if (isReg && !isSuccess) { |
| | | RollBackData(userRegVo.getHospitalId(), |
| | | userRegVo.getDepartmentId(), 0L, 0L, |
| | | 0L, 0L, 0L); |
| | | return ResultBody.failed(expMsg); |
| | | } |
| | | if (!isReg && departmetAccountsCount(userRegVo.getDepartmentId()) < 1) { |
| | |
| | | //添加用户数据 如果没有输入密码,将会创建一个默认密码返回 |
| | | String defaultPassWord = ""; |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setUsername(userRegVo.getUsername()); |
| | | sysUser.setUsername(userRegVo.getMobile()); |
| | | sysUser.setMobile(userRegVo.getMobile()); |
| | | if (StringUtils.isBlank(userRegVo.getPassword())) { |
| | | defaultPassWord = com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | |
| | | sysUser.setDefaultAuth(false); |
| | | sysUser.setOpenId(userRegVo.getOpenId()); |
| | | sysUser.setDel(false); |
| | | sysUser.setTenantId("hospital"); |
| | | sysUser.setTenantId(CommonConstant.H_TENANT); |
| | | boolean u = this.save(sysUser); |
| | | SysRoleUser sysRoleUser = new SysRoleUser(); |
| | | if (u) { |
| | |
| | | } |
| | | /***返回数据***/ |
| | | if (!isSuccess) { |
| | | //撤回数据 |
| | | RollBackData(0L, |
| | | 0L, sysUser.getId(), sysUserOrgH.getId(), |
| | | sysUserOrgH.getId(), sysDictionaries.getId(), |
| | | sysDoctor.getId()); |
| | | return ResultBody.failed(expMsg); |
| | | } else { |
| | | return ResultBody.ok().data(sysUser); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 手动撤回数据,需要撤回那个,给那个id传值,不需要的传0 |
| | | * |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @param userId |
| | | * @param userOrgIdH |
| | | * @param userOrgIdD |
| | | * @param dicId |
| | | * @param doctorId |
| | | */ |
| | | private void RollBackData(Long hospitalId, Long departmentId, |
| | | Long userId, Long userOrgIdH, Long userOrgIdD, |
| | | Long dicId, Long doctorId) { |
| | | if (hospitalId > 0) { |
| | | hospitalService.removeById(hospitalId); |
| | | } |
| | | if (departmentId > 0) { |
| | | departmentService.removeById(departmentId); |
| | | } |
| | | if (userId > 0) { |
| | | baseMapper.deleteById(userId); |
| | | sysUserRoleMapper.deleteById(userId); |
| | | } |
| | | if (userOrgIdH > 0) { |
| | | sysUserRoleMapper.deleteById(userOrgIdH); |
| | | } |
| | | if (userOrgIdD > 0) { |
| | | sysUserRoleMapper.deleteById(userOrgIdD); |
| | | } |
| | | if (dicId > 0) { |
| | | sysDictionariesService.removeById(dicId); |
| | | } |
| | | if (doctorId > 0) { |
| | | sysDoctorMapper.deleteById(doctorId); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取医院科室下的所有H端有效的医生 |
| | | * |
| | |
| | | List<HospitalDoctorListVo> hospitalDoctorListVos = baseMapper.hospitalDoctorList(sysHospitalId, depatmentId, CommonConstant.HOSPITAL_DOCTOR_ID, CommonConstant.HOSPITAL_ADMIN_ID); |
| | | if (hospitalDoctorListVos != null) { |
| | | int doctorCount = hospitalDoctorListVos.size(); |
| | | int accountCount = sysDepartment.getAccountsCount(); |
| | | return (accountCount - doctorCount); |
| | | int accountCount = sysDepartment.getAccountsCount().intValue(); |
| | | int liveCount=accountCount - doctorCount; |
| | | return liveCount; |
| | | } else { |
| | | return 0; |
| | | } |
| | |
| | | } |
| | | return hospitalId; |
| | | } |
| | | /** |
| | | * 根据部门的id获取所属医院id |
| | | * |
| | | * @return |
| | | */ |
| | | // public List<Long> DepartmentIdListByhospitalId(Long hospitalId) { |
| | | // List<Long> hospitalIdList =new ArrayList<Long>(); |
| | | // SysHospital sysHospital = hospitalService.getById(hospitalId); |
| | | // if (sysHospital != null) { |
| | | // //先获取医院的组织数据 |
| | | // SysOrganization sysOrganization = sysOrganizationMapper.selectById(sysHospital.getOrgId()); |
| | | // if (sysOrganization != null) { |
| | | // //根据组织id获取下级科室组织id |
| | | // Map<String, Object> selectMap = new HashMap<>(); |
| | | // selectMap.put("org_parent_id", sysOrganization.getId()); |
| | | // List<SysOrganization> sysDepartmentList = sysOrganizationMapper.selectByMap(selectMap); |
| | | // if (sysDepartmentList != null && sysDepartmentList.size() > 0) { |
| | | // //hospitalIdList=sysDepartmentList.stream().sorted(Comparator.comparing(SysOrganization::getCreateTime).reversed()).map(SysOrganization::getId).collect(Collectors.toList()); |
| | | // sysDepartmentList.stream().sorted(Comparator.comparing(SysOrganization::getCreateTime).reversed()).map(SysOrganization::getId).collect(Collectors.toList()).get(0); |
| | | // } |
| | | // } |
| | | // } |
| | | // return hospitalIdList; |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 检查用户登录名是否已经注册 true存在 false不存在 |
| | |
| | | String encode = passwordEncoder.encode(password); |
| | | return ResultBody.ok().data(encode); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteNoContact(Long id) { |
| | | //删除医生数据 |
| | | QueryWrapper<SysDoctor> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id", id); |
| | | List<SysDoctor> sysDoctors = sysDoctorMapper.selectList(queryWrapper); |
| | | if(!sysDoctors.isEmpty()){ |
| | | sysDoctors.forEach(e->{ |
| | | e.setIsDel(true); |
| | | sysDoctorMapper.updateById(e); |
| | | }); |
| | | } |
| | | //删除用户数据 |
| | | return baseMapper.deleteById(id) > 0; |
| | | } |
| | | } |
| | |
| | | LEFT JOIN sys_user us ON dc.user_id = us.id |
| | | LEFT JOIN sys_role_user roleuser |
| | | ON roleuser.user_id=us.id |
| | | where dc.is_del=0 and dc.enabled=1 and dc.hospital_id=1 and dc.department_id=1 and us.enabled=1 |
| | | where dc.is_del=0 and dc.enabled=1 and us.enabled=1 |
| | | and dc.hospital_id=#{hospitalId} and dc.department_id=#{departmentId} and (role_id=#{roleId1} or role_id=#{roleId2}) |
| | | </select> |
| | | <select id="hospitalDoctorListAndDel" parameterType="long" resultType="com.kidgrow.usercenter.vo.HospitalDoctorListVo"> |
| | |
| | | LEFT JOIN sys_user us ON dc.user_id = us.id |
| | | LEFT JOIN sys_role_user roleuser |
| | | ON roleuser.user_id=us.id |
| | | where dc.enabled=1 and dc.hospital_id=1 and dc.department_id=1 and us.enabled=1 |
| | | where dc.enabled=1 and us.enabled=1 |
| | | and dc.hospital_id=#{hospitalId} and dc.department_id=#{departmentId} and (role_id=#{roleId1} or role_id=#{roleId2}) |
| | | </select> |
| | | </mapper> |
| | |
| | | boolean v = appUserService.delUser(id); |
| | | return ResultBody.ok().msg("删除成功").data(v); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户 不删除关系表 ,role_user 表 和 用户组织 |
| | | * |
| | | * @param id |
| | | */ |
| | | @DeleteMapping(value = "/users/deleteNoContact/{id}") |
| | | //@AuditLog(operation = "'删除用户:' + #id") |
| | | public ResultBody deleteNoContact(@PathVariable Long id) { |
| | | if (checkAdmin(id)) { |
| | | return ResultBody.failed(ADMIN_CHANGE_MSG); |
| | | } |
| | | boolean v = appUserService.deleteNoContact(id); |
| | | return ResultBody.ok().msg("删除成功").data(v); |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | |
| | | * 根据map查询 |
| | | */ |
| | | private boolean checkAdmin(long id) { |
| | | return id == 1L; |
| | | return id == CommonConstant.ADMIN_USER_ID; |
| | | } |
| | | |
| | | @PostMapping("/users/findAll") |
| | |
| | | |
| | | //查询 科室 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_id", sysUserOrg.getUpdateUserId()); |
| | | queryWrapper.eq("org_id", sysUserOrg.getOrgId()); |
| | | queryWrapper.eq("is_del", 0); |
| | | queryWrapper.eq("enabled", 1); |
| | | List<SysDepartment> list = sysDepartmentService.list(queryWrapper); |
| | |
| | | |
| | | //查询 科室 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_id", sysUserOrg.getUpdateUserId()); |
| | | queryWrapper.eq("org_id", sysUserOrg.getOrgId()); |
| | | queryWrapper.eq("is_del", 0); |
| | | queryWrapper.eq("enabled", 1); |
| | | List<SysDepartment> list = sysDepartmentService.list(queryWrapper); |
| | |
| | | application: |
| | | name: usercenter-server |
| | | datasource: |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/user_center?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/user_center_${spring.profiles.active}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: ${kidgrow.datasource.username} |
| | | password: ${kidgrow.datasource.password} |
| | | # driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | /** |
| | | * 超级管理员用户名 |
| | | */ |
| | | String ADMIN_USER_NAME = "admin"; |
| | | |
| | | String ADMIN_USER_NAME = "admin-xg"; |
| | | /** |
| | | * 超级管理的id |
| | | */ |
| | | Long ADMIN_USER_ID=1000000000000000001L; |
| | | /** |
| | | * 公共日期格式 |
| | | */ |
| | |
| | | */ |
| | | private String routingKeyName; |
| | | |
| | | /** |
| | | * AI返回结果队列 |
| | | */ |
| | | private String AIEvaluationResults; |
| | | |
| | | @Bean |
| | | public ConnectionFactory connectionFactory() { |
| | | CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host,port); |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public Queue AIEvaluationResults() { |
| | | return new Queue(AIEvaluationResults); |
| | | } |
| | | |
| | | @Bean |
| | | Binding bindingExchangeAIEvaluation(TopicExchange exchange) { |
| | | return BindingBuilder.bind(AIEvaluation()).to(exchange).with(routingKeyName); |
| | | } |
| | |
| | | spring.redis.password=kidgrow |
| | | spring.redis.timeout=5000 |
| | | |
| | | #rabbitmq\u914D\u7F6E |
| | | kidgrow.rabbitmq.host=182.92.99.224 |
| | | kidgrow.rabbitmq.port=5672 |
| | | kidgrow.rabbitmq.username=liuke |
| | | kidgrow.rabbitmq.password=kidgrow2020 |
| | | kidgrow.rabbitmq.exchangeName=BoneAgeEvaluation |
| | | kidgrow.rabbitmq.queueName=test_queue |
| | | kidgrow.rabbitmq.routingKeyName=Kidgrow2020 |
| | | kidgrow.rabbitmq.virtual-host=kidgrow |
| | | |
| | | #\u963F\u91CCDruid\u914D\u7F6E |
| | | kidgrow.druid.loginname=admin |
| | | kidgrow.druid.loginpwd=123456 |
| | |
| | | kidgrow.fdfs.web-url=127.0.0.1 |
| | | kidgrow.fdfs.trackerList=${kidgrow.fdfs.web-url}:22122 |
| | | |
| | | ####\u963F\u91CCOSS\u914D\u7F6E |
| | | kidgrow.oss.access-key=LTAI4FennfcwZupz3B6hkK3N |
| | | kidgrow.oss.accessKeySecret=NzBBGe8SS41qJlp0nA3tlJ3t74lBZM |
| | | kidgrow.oss.endpoint=123.kidgrow.cloud |
| | | kidgrow.oss.bucketName=kidgrow |
| | | kidgrow.oss.domain=http://123.kidgrow.cloud/ |
| | | |
| | | ##### \u65E5\u5FD7\u94FE\u8DEF\u8FFD\u8E2A |
| | | kidgrow.trace.enable=true |
| | | |
| | |
| | | kidgrow.audit-log.enabled=true |
| | | kidgrow.audit-log.log-type=db |
| | | kidgrow.audit-log.datasource.driver-class-name=com.mysql.jdbc.Driver |
| | | kidgrow.audit-log.datasource.jdbc-url=jdbc:mysql://${kidgrow.datasource.ip}:3306/logger_center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai |
| | | kidgrow.audit-log.datasource.jdbc-url=jdbc:mysql://${kidgrow.datasource.ip}:3306/logger_center_${spring.profiles.active}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai |
| | | kidgrow.audit-log.datasource.username=${kidgrow.datasource.username} |
| | | kidgrow.audit-log.datasource.password=${kidgrow.datasource.password} |
| | | |
| | |
| | | ########################## bootstrap\u7EA7\u522B\u901A\u7528\u914D\u7F6E ########################## |
| | | # \u9ED8\u8BA4\u5F00\u53D1\u73AF\u5883 |
| | | spring.profiles.active=dev |
| | | spring.profiles.active=uat |
| | | |
| | | ##### spring-boot-actuator\u914D\u7F6E |
| | | management.endpoints.web.exposure.include=* |
| | |
| | | application: |
| | | name: uaa-server |
| | | datasource: |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/oauth_center?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://${kidgrow.datasource.ip}:3306/oauth_center_${spring.profiles.active}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: ${kidgrow.datasource.username} |
| | | password: ${kidgrow.datasource.password} |
| | | # driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | layer.alert("密码重置为:"+data.data, {icon: 1}); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | |
| | | arr: roleSelectData |
| | | }); |
| | | // 回显user数据 |
| | | var doctor = admin.getTempData('t_doctor'); |
| | | if (doctor!=null&&doctor.roles) { |
| | | formSelects.value('roleId', doctor.roles); |
| | | } |
| | |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(user-form-submit)', function (data) { |
| | | layer.load(2); |
| | | data.field.hospitalId = $("#hospitalId").val(); |
| | | if (data.field.roleId != null && data.field.roleId != "") { |
| | | data.field.roles = data.field.roleId.split(','); |
| | |
| | | data.field.password = ""; |
| | | data.field.passwordSure = ""; |
| | | } else { |
| | | if (data.field.roles.length == 0) { |
| | | if (data.field.roles == null || data.field.roles.length == 0) { |
| | | layer.msg("请选择角色"); |
| | | return |
| | | return false; |
| | | } |
| | | if (data.field.roles.includes(guanliyuan_role)) { |
| | | data.field.isAdminUser = true; |
| | | } else { |
| | | data.field.isAdminUser = false; |
| | | } |
| | | var doctor = admin.getTempData('t_doctor'); |
| | | //判断只有输入密码的时候进行密码判断 |
| | | if (doctor != null) { |
| | | if (doctor.doctorType == 2 && doctorType != 2) { |
| | | if (data.field.username == null || data.field.username.trim() == "") { |
| | | layer.msg("请输入手机号"); |
| | | return false; |
| | | } |
| | | // guanliyuan_role |
| | | // data.field.hospitalId = ""+data.field.hospitalId; |
| | | if (data.field.password == null || data.field.password.trim() == "") { |
| | | layer.msg("请输入登录密码"); |
| | | return false; |
| | | } |
| | | if (data.field.passwordSure == null || data.field.passwordSure.trim() == "") { |
| | | layer.msg("请输入确认密码"); |
| | | return false; |
| | | } else { |
| | | if (data.field.password != data.field.passwordSure) { |
| | | layer.msg("两次密码不一致,请重新输入"); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | if (data.field.username == null || data.field.username.trim() == "") { |
| | | layer.msg("请输入手机号"); |
| | | return false; |
| | | } |
| | | if (data.field.password == null || data.field.password.trim() == "") { |
| | | layer.msg("请输入登录密码"); |
| | | return false; |
| | | } |
| | | if (data.field.passwordSure == null || data.field.passwordSure.trim() == "") { |
| | | layer.msg("请输入确认密码"); |
| | | return false; |
| | | } else { |
| | | if (data.field.password != data.field.passwordSure) { |
| | | layer.msg("两次密码不一致,请重新输入"); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | data.field.roleId = null; |
| | | |
| | | data.field.roles.forEach(element => { |
| | | element = "" + element |
| | | }); |
| | | layer.load(2); |
| | | admin.req('api-user/sysdoctor', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | |
| | | } |
| | | //获取销售代表 |
| | | var getXiaoShouDaiBiao = function () { |
| | | admin.req('api-user/users/getThisUserOrganizationUser', {}, function (data) { |
| | | admin.req('api-user/users/getAppointUser', { type: 0 }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | user = data.data; |
| | |
| | | //获取角色 |
| | | get_role(); |
| | | var upload = layui.upload; |
| | | $("#roleId_div").hide() |
| | | //执行实例 |
| | | upload.render({ |
| | | elem: '#phonto', |
| | |
| | | //将密码置空 |
| | | $("#password").val(""); |
| | | form.render(); |
| | | $("#username").blur(function () { |
| | | username_is_usered("username"); |
| | | }) |
| | | |
| | | //医生类型的选择事件 |
| | | // form.on('select(doctorType)', function (data) { |
| | | // // console.log("eeeeeeeeeeeeeeeee"); |
| | |
| | | // } |
| | | // }) |
| | | }; |
| | | $("#username").blur(function () { |
| | | if (!validatorTel(doctorTel_add)) { |
| | | layer.msg("请输入正确的手机号"); |
| | | } else { |
| | | username_is_usered("username"); |
| | | } |
| | | }) |
| | | $("#doctorTel-add").blur(function () { |
| | | $("#username").val($("#doctorTel-add").val()) |
| | | var doctorTel_add = $("#doctorTel-add").val(); |
| | | if (!validatorTel(doctorTel_add)) { |
| | | layer.msg("请输入正确的手机号"); |
| | | } |
| | | } else { |
| | | username_is_usered("username"); |
| | | } |
| | | }) |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |