Jelajahi Sumber

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

yeshijie 7 tahun lalu
induk
melakukan
22d8790914

+ 20 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -172,8 +172,6 @@ public class JMJkEduArticleService extends BaseService {
    /**
     *
     * @param page
     * @param pagesize
     * @param sendCode
     * @param firstLevelCategoryId 一级分类
     * @param myArticle (条件:我的文章)
@ -746,7 +744,7 @@ public class JMJkEduArticleService extends BaseService {
        return re;
    }
    public void initPatients(String userCode,String[] groups,String group,String labelType,long teamCode,String[] patients,Set<String> patientSet) throws Exception{
    public void initPatients(String userCode,String[] groups,String group,String labelType,Long teamCode,String[] patients,Set<String> patientSet) throws Exception{
        Map<String, HealthEduArticle> maps = new HashMap<String, HealthEduArticle>();
        if (org.apache.commons.lang3.StringUtils.isNotBlank(group) && groups.length > 0) {
            //递归患者数据
@ -958,9 +956,15 @@ public class JMJkEduArticleService extends BaseService {
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String opertorRoleLevel,Integer userScope,String articleId,Integer roleType) throws Exception {
        if(!StringUtils.isEmpty(image)){
            image = commonUtil.copyTempImage(image);
        if(!StringUtils.isEmpty(articleId)){
            JSONObject obj = thirdJkEduArticleService.getArticalById(articleId,null);
            if(!StringUtils.isEmpty(image)&&!(obj.get("articleCover")+"").equals(image)){
                image = commonUtil.copyTempImage(image);
            };
        }else{
            if(!StringUtils.isEmpty(image)){
                image = commonUtil.copyTempImage(image);
            }
        }
        Integer isAuthentication = 0;
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
@ -1051,7 +1055,16 @@ public class JMJkEduArticleService extends BaseService {
//        if(StringUtils.isEmpty()){
//
//        }
//        imgUrl = commonUtil.copyTempImage(imgUrl);
        if(id!=null){
            JSONObject obj = thirdJkEduArticleService.getArticleQRCodeById(id);
            if(!StringUtils.isEmpty(imgUrl)&&!(obj.get("imgUrl")+"").equals(imgUrl)){
                imgUrl = commonUtil.copyTempImage(imgUrl);
            };
        }else{
            if(!StringUtils.isEmpty(imgUrl)){
                imgUrl = commonUtil.copyTempImage(imgUrl);
            }
        }
        Doctor doctor = doctorDao.findByCode(userCode);
        String userName = doctor.getName();
        String orgId = doctor.getHospital();

+ 19 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java

@ -89,7 +89,7 @@ public class ThirdJkEduArticleService extends BaseService {
    private String getArticleQRCode = "JkEdu.ArticleQR.getArticleQRCode";//获取认证标识
    private String updateArticleQRCode = "JkEdu.ArticleQR.updateArticleQRCode";//更新认证标识
    private String saveArticleQRCode = "JkEdu.ArticleQR.saveArticleQRCode";//添加认证标识
    private String getArticleQRCodeById = "JkEdu.ArticleQR.getArticleQRCodeById";//根据id获取认证标识
    /**
     * 封装入参
     *
@ -835,6 +835,24 @@ public class ThirdJkEduArticleService extends BaseService {
        }
    }
    public JSONObject getArticleQRCodeById(Integer id) throws Exception {
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("id",id);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticleQRCodeById, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return json.getJSONObject("Result");
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**************************************************** other *******************************************************/
    /**

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java

@ -47,7 +47,7 @@ public class BaseController {
            JSONObject json = new JSONObject(userAgent);
            return json.getString("uid");
//            return "0de7295862dd11e69faffa163e8aee56";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
//            return "hqD2016082902";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
        } catch (Exception e) {
            return null;
        }

+ 7 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -63,7 +63,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
        patients.stream().forEach(one -> {
            healthEduArticlePatient.setPatient(one.getCode());
            healthEduArticlePatient.setPatients(null);
            healthEduArticlePatient.setArticleUrl(articleBaseUrl+"JkEduWeb/web/jkEdu/articleDetail.html?behavior=4&articleId="+healthEduArticlePatient.getArticleId()+"&userId="+one);
            //temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
//            healthEduArticlePatient.setArticleUrl(articleBaseUrl+"jkjy/html/article2.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"))
//            healthEduArticlePatient.setArticleUrl(articleBaseUrl+"JkEduWeb/web/jkEdu/articleDetail.html?behavior=4&articleId="+healthEduArticlePatient.getArticleId()+"&userId="+one);
            healthEduArticlePatient.setArticleUrl("新版文章请求路径");
            jmsTemplate.send(channelName, new MessageCreator() {
                @Override
                public Message createMessage(Session session) throws JMSException {
@ -91,8 +94,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @ApiParam(name = "sendTimeEnd", value = "发送时间结束", required = false) @RequestParam(value = "sendTimeEnd", required = false) String sendTimeEnd,
            @ApiParam(name = "myArticle", value = "我的文章 1选中0未选", required = false) @RequestParam(value = "myArticle", required = false,defaultValue = "0") Integer myArticle,
            @ApiParam(name = "sendType", value = "1医生 2卫计委(管理员)", required = true) @RequestParam(value = "sendType", required = true) Integer sendType,
            @ApiParam(name = "page", value = "当前页 起始1", required = true) @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(name = "pagesize", value = "每页显示条数", required = true) @RequestParam(value = "pagesize", required = true) Integer pagesize,
            @ApiParam(name = "iDisplayStart", value = "当前页 起始1", required = true) @RequestParam(value = "iDisplayStart", required = true) Integer page,
            @ApiParam(name = "iDisplayLength", value = "每页显示条数", required = true) @RequestParam(value = "iDisplayLength", required = true) Integer pagesize,
            @ApiParam(name = "currentRoleCode", value = "当前登录的角色code", required = false) @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode,
            @ApiParam(name = "currentRoleLevel", value = "当前登录的角色级别", required = false) @RequestParam(value = "currentRoleLevel", required = false) String currentRoleLevel) {
        try {
@ -269,7 +272,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                              @RequestParam(value = "patient", required = false) String patient,
                                              @RequestParam(value = "group", required = false, defaultValue = "") String group,
                                              @RequestParam(value = "labelType", required = false) String labelType,
                                              @RequestParam(value = "teamCode", required = false) long teamCode,
                                              @RequestParam(value = "teamCode", required = false) Long teamCode,
                                              @RequestParam(value = "articleId", required = false) String articleId,
                                              @RequestParam(value = "leaveWords", required = false) String leaveWords,
                                              @RequestParam(value = "currentUserRole", required = false) String currentUserRole,

+ 28 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -2,9 +2,11 @@ package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
@ -14,9 +16,12 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.List;
/**
@ -31,9 +36,11 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    private JMJkEduArticleService jmJkEduArticleService;
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    @Value("${fastDFS.fastdfs_file_url}")
    String fastdfs_file_url;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加文章")
    @ApiOperation("添加、编辑文章")
    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
                               @RequestParam(value = "articleId", required = false) String articleId,
                               @ApiParam(name = "articleTitle", value = "文章标题")
@ -262,4 +269,24 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
        }
    }
    @RequestMapping(value = "uploadArticleImag", method = RequestMethod.POST)
    @ApiOperation("编辑文章上传图片")
    public String pushArticleList(@ApiParam(name = "file", value = "文件", required = true)
                                   @RequestParam(value = "file", required = false) MultipartFile file){
//        temp=new File(FileUploadUtil.getTomcatLogDir()+System.currentTimeMillis()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.')-1));
//        file.transferTo(temp);
        try {
            ObjectNode imgNode = FastDFSUtil.upload(file.getInputStream(),"png",file.getOriginalFilename());
            String fileUrl = fastdfs_file_url + imgNode.get("groupName").toString().replaceAll("\"","")
                    + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"","");
            return write(200,"上传成功!","data",fileUrl);
        }catch (Exception e) {
            e.printStackTrace();
            return error(-1,"失败!");
        }
    }
}