Jelajahi Sumber

Merge branch 'dev' of huangwenjie/patient-co-management into dev

huangwenjie 7 tahun lalu
induk
melakukan
25c12b32d2

+ 22 - 19
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -106,10 +106,10 @@ public class JMJkEduArticleService extends BaseService {
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  doctorCode='" + sendCode + "' and userType = 2");
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
        }
//        if(sendType==1){
//
//            sql2.append(" and sendType='"+sendType+"' ");
//        }
        if(!StringUtils.isEmpty(firstLevelCategoryId)){
            sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
        }
@ -119,8 +119,8 @@ public class JMJkEduArticleService extends BaseService {
        if(myArticle==1){
            sql2.append(" and operatorId="+sendCode);
        }
        sql2.append(" and currentUserRoleCode ="+currentUserRole);
        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
//        sql2.append(" and currentUserRoleCode ="+currentUserRole);
//        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
        if(!StringUtils.isEmpty(articleTitle)){
            sql2.append(" and articleTitle like'%"+articleTitle+"%'");
        }
@ -132,7 +132,7 @@ public class JMJkEduArticleService extends BaseService {
            sendTimeEnd = elasticsearchUtil.changeTime(sendTimeEnd);
            sql2.append(" and createTime <='"+sendTimeEnd+"'");
        }
        sql2.append(" order by createTime limit " + page + "," + pagesize);
        sql2.append(" order by createTime desc limit " + page + "," + pagesize);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(), HealthEduArticleES.class, esIndex, esType);
        Map<String, HealthEduArticlePatientModel> result = new HashMap<>();
        HealthEduArticlePatientModel heapm = null;
@ -215,11 +215,11 @@ public class JMJkEduArticleService extends BaseService {
                                                              String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  sendCode='" + sendCode + "' and userType = 2" );
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
        }
                " where  doctorCode='" + sendCode + "' and userType = 2" );
//        if(sendType==1){
//
//            sql2.append(" and sendType='"+sendType+"' ");
//        }
        if(!StringUtils.isEmpty(firstLevelCategoryId)){
            sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
        }
@ -229,8 +229,8 @@ public class JMJkEduArticleService extends BaseService {
        if(myArticle==1){
            sql2.append(" and operatorId="+sendCode);
        }
        sql2.append(" and currentUserRoleCode ="+currentUserRole);
        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
//        sql2.append(" and currentUserRoleCode ="+currentUserRole);
//        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
        if(!StringUtils.isEmpty(articleTitle)){
            sql2.append(" and articleTitle like'%"+articleTitle+"%'");
        }
@ -550,13 +550,16 @@ public class JMJkEduArticleService extends BaseService {
            sendName = returnList.get(0).get("name")+"";
        }
        Map<String,Object> resultMap = labelService.fetchUserHighestAuthority(sendCode);
        List<String> roleList = (List<String>)resultMap.get("roleList");
        List<RoleVo> roleVoLists= new ArrayList<>();
        for(String temp:roleList){
            RoleVo roleVo = new RoleVo();
            roleVo.setCode(temp);
            roleVoLists.add(roleVo);
        if(resultMap.containsKey("roleList") && resultMap.get("roleList") != null){
            List<String> roleList = (List<String>)resultMap.get("roleList");
            for(String temp:roleList){
                RoleVo roleVo = new RoleVo();
                roleVo.setCode(temp);
                roleVoLists.add(roleVo);
            }
        }
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        Date createTime = new Date();
        for (String patient : patientSet) {

+ 38 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java

@ -541,20 +541,45 @@ public class FileUploadController extends BaseController {
    @ApiOperation("编辑文章上传图片")
    @ResponseBody
    public String pushArticleList(@ApiParam(name = "file", value = "文件", required = true)
                                  @RequestParam(value = "file", required = true) MultipartFile file){
        try {
            InputStream inputStream  = file.getInputStream();
            String fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf("."));
            ObjectNode imgNode = FastDFSUtil.upload(inputStream,"png",fileName);
            String fileUrl = imgNode.get("groupName").toString().replaceAll("\"","")
                    + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"","");
            if(!isneiwang){
                fileUrl=fastdfs_file_url+fileUrl;
                                  @RequestParam(value = "file", required = true) MultipartFile file,
                                  HttpServletRequest request, HttpServletResponse response){
        if (isneiwang) {
            // 圖片列表
            List<String> tempPaths = new ArrayList<String>();
            try {
                MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                    // 上传文件
                    MultipartFile mf = entity.getValue();
                    InputStream inputStream  = mf.getInputStream();
                    String fileName = mf.getOriginalFilename().substring(0,mf.getOriginalFilename().lastIndexOf("."));
                    ObjectNode imgNode = FastDFSUtil.upload(inputStream,"png",fileName);
                    com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(imgNode.toString());
                    tempPaths.add(json.getString("fid"));
                }
                String urls = "";
                for (String image : tempPaths) {
                    if (urls.length() == 0) {
                        urls = image;
                    } else {
                        urls += "," + image;
                    }
                }
                JSONObject json = new JSONObject();
                json.put("status", 200);
                json.put("msg", "上传成功");
                json.put("urls", urls);
                logger.info("图片上传:" + json.toString());
                return json.toString();
            } catch (Exception e) {
                error(e);
                return error(-1, "上传失败");
            }
            return write(200,"上传成功!","data",fileUrl);
        }catch (Exception e) {
            e.printStackTrace();
            return error(-1,"失败!");
        } else {
            String result  = CommonUtil.toNeiWang(request, response);
            logger.info("fastDFSImag reslt :" + result);
            return CommonUtil.toNeiWang(request, response);
        }
    }