Selaa lähdekoodia

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 7 vuotta sitten
vanhempi
commit
d1771776e6

+ 4 - 12
common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java

@ -19,10 +19,10 @@ public class HealthEduArticleES {
    private String batchNo;//批次号记录发送所属批次
    private String patientCode; // 患者标识
    private String patientName; // 患者名称
    private String doctorCode;  //推送的医生code(包括医生本人、卫计委)
    private String doctorName;  //推送的医生名称(包括医生本人、卫计委)
    private String sendCode;   // 发送人code(如管理员推送,保存登陆者code)
    private String sendName;   // 发送人名称(如管理员推送,保存登陆者name)
    private String doctorCode;  //发送人code(如管理员推送,保存登陆者code)
    private String doctorName;  //发送人名称(如管理员推送,保存登陆者name)
//    private String sendCode;   // 发送人code(如管理员推送,保存登陆者code)
    private String sendName;   // 推送的医生名称(包括医生本人、卫计委)
    private String sendPic;   // 发送人头像
    private String sendSex;   // 发送人性别
@ -109,14 +109,6 @@ public class HealthEduArticleES {
        this.doctorName = doctorName;
    }
    public String getSendCode() {
        return sendCode;
    }
    public void setSendCode(String sendCode) {
        this.sendCode = sendCode;
    }
    public String getSendName() {
        return sendName;
    }

+ 6 - 6
edu-article/JkEdu/src/sys.xml

@ -8,14 +8,14 @@
  <!-- 数据库连接配置  -->
  <DB.Alias>jkedudb</DB.Alias>
  <DB.DatabaseName>jkedudb</DB.DatabaseName>
  <!--<DB.IP>172.19.103.85</DB.IP>-->
  <!--<DB.Port>3306</DB.Port>-->
  <!--<DB.UserName>linzhou</DB.UserName>-->
  <!--<DB.Password>FDw6DUFgoKg=</DB.Password>-->
  <DB.IP>172.19.103.77</DB.IP>
  <DB.IP>172.19.103.85</DB.IP>
  <DB.Port>3306</DB.Port>
  <DB.UserName>linzhou</DB.UserName>
  <DB.Password>FDw6DUFgoKg=</DB.Password>
  <!--<DB.IP>172.19.103.77</DB.IP>
  <DB.Port>3306</DB.Port>
  <DB.UserName>root</DB.UserName>
  <DB.Password>VYhw4YNnygE=</DB.Password>
  <DB.Password>VYhw4YNnygE=</DB.Password>-->
  <!--<EhrApiUrl>http://ehr.yihu.com/wlyyfz</EhrApiUrl>-->
  <EhrApiUrl>http://192.168.131.131:8080/</EhrApiUrl>

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java

@ -47,7 +47,7 @@ public class HealthArtListener implements MessageListener {
    public void onMessage(Message message) {
        try {
            TextMessage textMessage = (TextMessage) message;
            HealthEduArticleES healthEduArticleES = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticlePatient.class);
            HealthEduArticleES healthEduArticleES = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticleES.class);
//            logger.info(jo.toString());
            sendWxTemplateAndIM(healthEduArticleES);
            //返回服务器表示消息消费成功

+ 148 - 53
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -29,8 +29,7 @@ import com.yihu.wlyy.web.third.gateway.service.GcLabelService;
import com.yihu.wlyy.web.third.gateway.vo.DictModel;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import io.searchbox.client.JestClient;
import io.searchbox.core.Search;
import io.searchbox.core.SearchResult;
import io.searchbox.core.*;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
@ -117,10 +116,10 @@ public class JMJkEduArticleService extends BaseService {
            sql2.append(" and sendType='"+sendType+"' ");
        }
        if(!StringUtils.isEmpty(firstLevelCategoryId)){
            sql2.append("and level1Type="+firstLevelCategoryId);
            sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
        }
        if(!StringUtils.isEmpty(secondLevelCategoryId)){
            sql2.append("and level2Type="+secondLevelCategoryId);
            sql2.append("and secondLevelCategoryId="+secondLevelCategoryId);
        }
        if(myArticle==1){
            sql2.append(" and operatorId="+sendCode);
@ -139,7 +138,7 @@ public class JMJkEduArticleService extends BaseService {
            sql2.append(" and createTime <='"+sendTimeEnd+"'");
        }
        sql2.append("  order by createTime limit " + page + "," + pagesize);
        List<com.yihu.es.entity.HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql2.toString(), com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(), HealthEduArticleES.class, esIndex, esType);
        Map<String, HealthEduArticlePatientModel> result = new HashMap<>();
        HealthEduArticlePatientModel heapm = null;
        com.alibaba.fastjson.JSONObject article = null;
@ -147,7 +146,7 @@ public class JMJkEduArticleService extends BaseService {
    
        List<HealthEduArticlePatientModel> resultList = new ArrayList<>();
        
        for (HealthEduArticlePatient one : esList) {
        for (HealthEduArticleES one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            if (result.get(one.getArticleId()) != null) {
                heapm = result.get(one.getArticleId());
@ -162,19 +161,33 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setAttachedTitle(article.getString("articleTitle"));
            heapm.setAttachedContent(article.getString("articleContent"));
            heapm.setArticleType(article.getString("articleType"));
            heapm.setLevel1Type(article.getString("firstLevelCategoryId"));
            heapm.setLevel2Type(article.getString("secondLevelCategoryId"));
            heapm.setLevel1Type(one.getFirstLevelCategoryId());
            heapm.setLevel1TypeName(one.getFirstLevelCategoryName());
            heapm.setLevel2Type(one.getSecondLevelCategoryId());
            heapm.setLevel2TypeName(one.getSecondLevelCategoryName());
            heapm.setLevel(article.getString("articlelevel"));
            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            if(article.getString("browseNumber") != null){
//            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            if(!StringUtils.isEmpty(article.getString("browseNumber"))){
                heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
            }else{
                heapm.setBrowseNumbere(0);//文章浏览数
            }
            if(article.getString("commentNumber") != null){
            if(!StringUtils.isEmpty(article.getString("commentNumber"))){
                heapm.setCommentNumber(Integer.valueOf(article.getString("commentNumber")));//文章评论数
            }else{
                heapm.setCommentNumber(0);//文章评论数
            }
            
            if(article.getString("pointNumber") != null){
            if(!StringUtils.isEmpty(article.getString("pointNumber"))){
                heapm.setPointNumber(Integer.valueOf(article.getString("pointNumber")));//文章点赞数
            }else{
                heapm.setPointNumber(0);//文章点赞数
            }
            if(!StringUtils.isEmpty(article.getString("collectionNumberCount"))){
                heapm.setCollectionNumber(Integer.valueOf(article.getString("collectionNumberCount")));//文章点赞数
            }else{
                heapm.setCollectionNumber(0);//文章点赞数
            }
            
            heapm.setArticleCover(article.getString("articleCover"));//封面
@ -201,20 +214,20 @@ public class JMJkEduArticleService extends BaseService {
     * @return
     * @throws Exception
     */
    public List<HealthEduArticlePatient> pushArticleListCount(String sendCode,  String firstLevelCategoryId,String secondLevelCategoryId,Integer myArticle,Integer sendType,String currentUserRole,
    public List<HealthEduArticleES> pushArticleListCount(String sendCode,  String firstLevelCategoryId,String secondLevelCategoryId,Integer myArticle,Integer sendType,String currentUserRole,
                                                              String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
        StringBuffer sql2 = new StringBuffer("select *  from   " + esType +
                " where  doctorCode='" + sendCode + "'");
                " where  sendCode='" + sendCode + "'");
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
        }
        if(!StringUtils.isEmpty(firstLevelCategoryId)){
            sql2.append("and level1Type="+firstLevelCategoryId);
            sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
        }
        if(!StringUtils.isEmpty(secondLevelCategoryId)){
            sql2.append("and level2Type="+secondLevelCategoryId);
            sql2.append("and secondLevelCategoryId="+secondLevelCategoryId);
        }
        if(myArticle==1){
            sql2.append(" and operatorId="+sendCode);
@ -232,7 +245,7 @@ public class JMJkEduArticleService extends BaseService {
            sendTimeEnd = elasticsearchUtil.changeTime(sendTimeEnd);
            sql2.append(" and createTime <='"+sendTimeEnd+"'");
        }
        List<HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql2.toString(), com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(),HealthEduArticleES.class, esIndex, esType);
        return esList;
    }
@ -513,51 +526,54 @@ public class JMJkEduArticleService extends BaseService {
        List<HealthEduArticleES> healthEduArticleESList = new ArrayList<>();
        Doctor doctor = doctorDao.findByCode(sendCode);
        AdminTeam adminTeam =null;
        if(teamId!=null){
        String resultSql ="";
        String whereSql ="";
        switch (currentUserRoleLevel){
            case "1":{resultSql +=" DISTINCT (province_name) as name";
                whereSql+=" and province ='"+currentUserRoleCode+"'";break;}
            case "2":{resultSql +=" DISTINCT (city_name) as name";
                whereSql+=" and city ='"+currentUserRoleCode+"'";break;}
            case "3":{resultSql +=" DISTINCT (town_name) as name";
                whereSql+=" and town ='"+currentUserRoleCode+"'";break;}
            case "4":{resultSql +=" DISTINCT (name) as name";
                whereSql+=" and code ='"+currentUserRoleCode+"'";break;}
            adminTeam = adminTeamService.getTeam(teamId);
        }
        String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ;
        List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql);
        String doctorName = returnList.get(0).get("name")+"";
        Doctor doctor = doctorDao.findByCode(sendCode);
        AdminTeam adminTeam = adminTeamService.getTeam(teamId);
        Patient one = null;
        String batchNo = UUID.randomUUID().toString();
        for (String patient : patientSet) {
            one = patientDao.findByCode(patient);
            HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
            healthEduArticleES.setDoctorCode(doctor.getCode());
            healthEduArticleES.setDoctorName(doctor.getName());
            healthEduArticleES.setBatchNo(batchNo);
            healthEduArticleES.setPatientCode(patient);
            healthEduArticleES.setPatientName(one.getName());
            if(sendType==2){
                healthEduArticleES.setDoctorCode(currentUserRoleCode);
                healthEduArticleES.setDoctorName(doctorName);
                String resultSql ="";
                String whereSql ="";
                switch (currentUserRoleLevel){
                    case "1":{resultSql +=" DISTINCT (province_name) as name";
                        whereSql+=" and province ='"+currentUserRoleCode+"'";break;}
                    case "2":{resultSql +=" DISTINCT (city_name) as name";
                        whereSql+=" and city ='"+currentUserRoleCode+"'";break;}
                    case "3":{resultSql +=" DISTINCT (town_name) as name";
                        whereSql+=" and town ='"+currentUserRoleCode+"'";break;}
                    case "4":{resultSql +=" DISTINCT (name) as name";
                        whereSql+=" and code ='"+currentUserRoleCode+"'";break;}
                }
                String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ;
                List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql);
                String sendName = returnList.get(0).get("name")+"";
                healthEduArticleES.setSendName(sendName);
                healthEduArticleES.setSendLevel("4");
            }else{
                healthEduArticleES.setSendName(doctor.getName());
                healthEduArticleES.setSendLevel(doctor.getLevel()+"");
            }
            healthEduArticleES.setSendCode(doctor.getCode());
            healthEduArticleES.setSendName(doctor.getName());
            healthEduArticleES.setSendPic(doctor.getPhoto());
            healthEduArticleES.setSendSex(doctor.getSex()+"");
            healthEduArticleES.setAdminTeamCode(adminTeam.getId());
            healthEduArticleES.setAdminTeamName(adminTeam.getName());
            if(adminTeam!=null){
                healthEduArticleES.setAdminTeamCode(adminTeam.getId());
                healthEduArticleES.setAdminTeamName(adminTeam.getName());
            }
            healthEduArticleES.setHospital(doctor.getHospital());
            healthEduArticleES.setHospitalName(doctor.getHospitalName());
            healthEduArticleES.setTown(doctor.getTown());
@ -1041,31 +1057,110 @@ public class JMJkEduArticleService extends BaseService {
        
    }
    
    /**
     * 一键修改居民推送文章的文章为已读
     * @param patient
     */
    public void readAllArticleNew(String patient){
        JestClient jestClient = null;
    
        try {
            jestClient = elasticFactory.getJestClient();
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("patientCode", patient))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
            SearchResult result = jestClient.execute(search);
            List<HealthEduArticleES> dataList = result.getSourceAsObjectList(HealthEduArticleES.class);
            if(!dataList.isEmpty()){
                //根据id批量删除
                Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
                for (HealthEduArticleES obj : dataList) {
                    Delete index = new Delete.Builder(obj.getId()).build();
                    bulk.addAction(index);
                }
                BulkResult br = jestClient.execute(bulk.build());
            }
            for (HealthEduArticleES healthEduArticleES:dataList) {
                healthEduArticleES.setIsRead(1);
            }
            elastricSearchSave.save(dataList,esIndex,esType);
            jestClient.shutdownClient();
        }catch (Exception e){
            e.printStackTrace();
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
    }
    
    /**
     * 居民单条文章增加已读状态
     * @param patient
     * @param articleId
     */
    public void readPatientArticle(String patient,String articleId){
        JestClient jestClient = null;
        
        try {
            jestClient = elasticFactory.getJestClient();
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("patientCode", patient))
                            .must(QueryBuilders.matchQuery("articleId", articleId))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
            SearchResult result = jestClient.execute(search);
            List<HealthEduArticleES> dataList = result.getSourceAsObjectList(HealthEduArticleES.class);
            if(!dataList.isEmpty()){
                //根据id批量删除
                Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
                for (HealthEduArticleES obj : dataList) {
                    Delete index = new Delete.Builder(obj.getId()).build();
                    bulk.addAction(index);
                }
                BulkResult br = jestClient.execute(bulk.build());
            }
            for (HealthEduArticleES healthEduArticleES:dataList) {
                healthEduArticleES.setIsRead(1);
            }
            elastricSearchSave.save(dataList,esIndex,esType);
            jestClient.shutdownClient();
        }catch (Exception e){
            e.printStackTrace();
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
    }
    
    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode,String level1Type) throws Exception {
        pagesize = page * pagesize;
        page = (page - 1) * pagesize;
//
//        StringBuffer sql2 = new StringBuffer("select *  from   " + esType +
//                " where  sendCode='" + sendCode + "' ");
//        sql2.append("  order by createTime limit " + page + "," + pagesize);
        String sql = "SELECT * FROM " + esType + "  where nested(patients.code)= '" + patientCode + "' ";
        String sql = "SELECT * FROM " + esType + "  where patientCode= '" + patientCode + "' ";
        
        if(!StringUtils.isEmpty(level1Type)){
            sql= sql + " and level1Type = '"+level1Type+"' ";
            sql= sql + " and firstLevelCategoryId = '"+level1Type+"' ";
        }
        
        if(page !=0 && pagesize !=0){
            sql= sql+  " order by createTime desc limit " + page + "," + pagesize;
        }
        
        List<com.yihu.es.entity.HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql, com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql, HealthEduArticleES.class, esIndex, esType);
        HealthEduArticlePatientModel heapm = null;
        com.alibaba.fastjson.JSONObject article = null;
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        for (HealthEduArticlePatient one : esList) {
        for (HealthEduArticleES one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            heapm = new HealthEduArticlePatientModel();
            heapm.setSendName(one.getSendName());
@ -1078,7 +1173,7 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setLevel1Type(article.getString("firstLevelCategoryId"));
            heapm.setLevel2Type(article.getString("secondLevelCategoryId"));
            heapm.setLevel(article.getString("articlelevel"));
            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
//            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
            heapm.setCommentNumber(Integer.valueOf(article.getString("commentNumber")));//文章评论数
            heapm.setPointNumber(Integer.valueOf(article.getString("pointNumber")));//文章点赞数
@ -1086,8 +1181,8 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setComputeTime(computeTime(article.getString("insertTime")));
            heapm.setOperatorName(article.getString("operatorName"));
            heapm.setSendType(one.getSendType());//发送类型
            heapm.setIsread(one.getIsread());//已读未读标识,1已读,2未读
            heapm.setLeaveWords(one.getLeaveWords());
            heapm.setIsread(String.valueOf(one.getIsRead()));//已读未读标识,1已读,2未读
            heapm.setLeaveWords(one.getLeaveWords());//医生留言
            doctor = doctorDao.findByCode(one.getDoctorCode());
            heapm.setPhoto(doctor.getPhoto());
            result.add(heapm);

+ 47 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java

@ -12,14 +12,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -34,7 +26,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -42,7 +33,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
@ -568,6 +558,53 @@ public class FileUploadController extends BaseController {
        }
    }
    /**
     * 图片上传
     *
     * @return
     * @throws IOException
     * @throws IllegalStateException
     */
    @RequestMapping(value = "pcimage", method = RequestMethod.POST  /*,headers = "Accept=image/png"*/ )
    @ResponseBody
    public String pcimage(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);
                    tempPaths.add(imgNode.get("fid").toString());
                }
                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, "上传失败");
            }
        } else {
            return CommonUtil.toNeiWang(request, response);
        }
    }
//    @RequestMapping(value = "fastDFSImags", method = RequestMethod.POST)
//    @ApiOperation("编辑文章上传图片")
//    @ResponseBody

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

@ -2,15 +2,10 @@ 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.es.entity.HealthEduArticleES;
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;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultPageListModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -19,10 +14,6 @@ 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.io.InputStream;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -285,7 +276,7 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            }
            List<HealthEduArticlePatientModel> eduArticlePatients = jmJkEduArticleService.pushArticleList(page, pagesize, getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,currentRoleLevel,articleTitle,sendTimeStart,sendTimeEnd);
//            Long count = jmJkEduArticleService.pushArticleListCount(getUID(),2);
            List<HealthEduArticlePatient> eduArticlePatientsCount = jmJkEduArticleService.pushArticleListCount(getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,
            List<HealthEduArticleES> eduArticlePatientsCount = jmJkEduArticleService.pushArticleListCount(getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,
                    currentRoleLevel, articleTitle,sendTimeStart, sendTimeEnd);
            net.sf.json.JSONObject obj = new net.sf.json.JSONObject();
            obj.put("Code", 100);

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -9,6 +9,7 @@ import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import com.yihu.wlyy.service.app.health.HealthEduArticlePatientService;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
@ -57,7 +58,7 @@ public class HealthEduArticleController extends BaseController {
    private ThirdJkEduArticleService healthEducationArticleService;
    
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    private JMJkEduArticleService jmJkEduArticleService;
    /**
     * 查询文章列表
@ -210,7 +211,8 @@ public class HealthEduArticleController extends BaseController {
        try {
//            String patient = getUID();
            String patient = getRepUID();
            healthEduArticleService.readAllArticle(patient);
//            healthEduArticleService.readAllArticle(patient);
            jmJkEduArticleService.readAllArticleNew(patient);
            return write(200, "更改状态成功!");
        } catch (Exception e) {
            error(e);

+ 30 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/HealthEduArticlePatientModel.java

@ -25,8 +25,12 @@ public class HealthEduArticlePatientModel {
    private String articleType;//文章类别
    @ApiModelProperty(value = "1级类别", required = false, access = "response")
    private String level1Type;//1级类别
    @ApiModelProperty(value = "1级类别名称", required = false, access = "response")
    private String level1TypeName;//1级类别
    @ApiModelProperty(value = "2级类别", required = false, access = "response")
    private String level2Type;//2级类别
    @ApiModelProperty(value = "2级类别名称", required = false, access = "response")
    private String level2TypeName;//2级类别
    @ApiModelProperty(value = "等级", required = false, access = "response")
    private String level;//等级
    @ApiModelProperty(value = "所有的推送数目", required = false, access = "response")
@ -45,6 +49,8 @@ public class HealthEduArticlePatientModel {
    private String isread;//已读未读
    @ApiModelProperty(value = "", required = false, access = "response")
    private String leaveWords;//医生留言
    @ApiModelProperty(value = "", required = false, access = "response")
    private Integer collectionNumber;//收藏数
    
    private String computeTime;//时间
    private String photo;//医生头像
@ -217,4 +223,28 @@ public class HealthEduArticlePatientModel {
    public void setLeaveWords(String leaveWords) {
        this.leaveWords = leaveWords;
    }
    
    public String getLevel1TypeName() {
        return level1TypeName;
    }
    
    public void setLevel1TypeName(String level1TypeName) {
        this.level1TypeName = level1TypeName;
    }
    
    public String getLevel2TypeName() {
        return level2TypeName;
    }
    
    public void setLevel2TypeName(String level2TypeName) {
        this.level2TypeName = level2TypeName;
    }
    public Integer getCollectionNumber() {
        return collectionNumber;
    }
    public void setCollectionNumber(Integer collectionNumber) {
        this.collectionNumber = collectionNumber;
    }
}

+ 8 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -117,9 +117,16 @@ public class ThirdJkEduArticleController extends BaseController {
    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
    @ApiOperation("获取文章详情")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                 @RequestParam(value = "articleId", required = true) String articleId){
                                 @RequestParam(value = "articleId", required = true) String articleId,
                                 @ApiParam(name = "userType", value = "用户类型:1医生,2居民",defaultValue = "1")
                                 @RequestParam(value = "userType", required = true) Integer userType){
        try {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getRepUID());
            
            if(2 == userType){
                jmJkEduArticleService.readPatientArticle(getRepUID(),articleId);
            }
            
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -119,9 +119,9 @@ jkEdu:
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  username: jkzl
  password: jkzlehr
  url: tcp://192.168.120.153:61616
  queue:
    healtHarticleQueue: healthArticleChannel  #健康文章推送