| | |
| | | * @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 下载图片 |
| | |
| | | /** |
| | | * 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; |
| | |
| | | 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 { |
| | |
| | | * @param imgType |
| | | * @return |
| | | */ |
| | | public String FilePath(String imgType,String folderByDate) |
| | | public String FilePath(String imgType,String folderByDate,String hospitalId,String departmentId) |
| | | { |
| | | //返回的文件路径 |
| | | String fileFolder=""; |
| | |
| | | if (imgType.toLowerCase().equals("xray")) { |
| | | String hospitalID = httpServletRequest.getHeader(SecurityConstants.USER_HOSPITAL_ID_HEADER); |
| | | String depID = httpServletRequest.getHeader(SecurityConstants.USER_DEP_ID_HEADER); |
| | | fileFolder = "Xray/" + hospitalID + "/" + depID + "/"+ folderByDate + "/"; |
| | | 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 + "/"; |
| | | } |
| | | } |
| | | } |
| | | // 医院Logo只保存在一个目录中 |
| | | else if (imgType.toLowerCase().equals("logo")) { |
| | |
| | | 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图片下载 |
| | |
| | | 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("enable",1); |
| | | List<SysDoctor> sysDoctors = baseMapper.selectByMap(map); |
| | | if (sysDoctors == null || sysDoctors.size() <= 0) { |
| | | return ResultBody.failed("当前操作用户不是管理员"); |
| | |
| | | |
| | | //查询 科室 |
| | | 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); |
| | |
| | | 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, |
| | |
| | | } |
| | | //获取销售代表 |
| | | 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; |