Browse Source

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

huangwenjie 7 years ago
parent
commit
a9b577f72f

BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class


+ 1 - 1
edu-article/JkEdu/src/Article.sql.xml

@ -19,7 +19,7 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Conditi
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
select m.* from Org_Article m  INNER JOIN User_ArticleCollection n on  m.articleid=n.ArticleId and  1=1 @UserParam) as aa LEFT JOIN 
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition order by insertTime desc
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
		</Sql>
		<Sql name='getCollectionArticleListCount'>

+ 1 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -114,6 +114,7 @@ public class ArticleDao {
			userParam.append(" and UserType  =").append(vo.getUserType());
		}
		param.append(" order by insertTime desc ");
		param.append(" limit ").append(start * pageSize + "," + pageSize);
		sql.addVar("@Condition", param.toString());

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

@ -49,6 +49,10 @@ public class HealthArtListener implements MessageListener {
            TextMessage textMessage = (TextMessage) message;
            HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
            JSONObject obj = JSONObject.fromObject(textMessage.getText());
            if(obj.get("doctorCode")==null||obj.get("doctorName")==null){
                message.acknowledge();
                return ;
            }
            healthEduArticleES.setBatchNo(obj.get("batchNo")!=null?obj.get("batchNo").toString():null);
            healthEduArticleES.setPatientCode(obj.get("patientCode")!=null?obj.get("patientCode").toString():null);
            healthEduArticleES.setPatientName(obj.get("patientName")!=null?obj.get("patientName").toString():null);

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

@ -172,7 +172,7 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setLevel(article.getString("articlelevel"));
//            heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
            sql3 = new StringBuffer();
            sql3.append("SELECT COUNT(*) as num FROM health_edu_article_patient_test3 WHERE isRead='1' AND batchNo = '"+one.getBatchNo()+"' AND patientCode is not null AND articleId='"+article.getString("articleId")+"'");
            sql3.append("SELECT COUNT(*) as num FROM "+esType+" WHERE isRead='1' AND batchNo = '"+one.getBatchNo()+"' AND patientCode is not null AND articleId='"+article.getString("articleId")+"'");
            Long num = elasticsearchUtil.excuteForLong(sql3.toString(), esType, esIndex);
            if(num!=null){
                heapm.setReadNumber(num.longValue());

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

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import io.swagger.annotations.Api;
@ -32,6 +33,12 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    String fastdfs_file_url;
    @Value("${neiwang.enable}")
    private Boolean isneiwang = false;  //如果不是内网项目要转到到内网wlyy在上传
    @Value("${es.type.HealthEduArticlePatient}")
    private String esType;
    @Value("${es.index.HealthEduArticlePatient}")
    private String esIndex;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加、编辑文章")
@ -136,12 +143,13 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            if(StringUtils.isNotBlank(patient)){
                com.alibaba.fastjson.JSONArray pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");
                Set<String> articleids = new HashSet<>();
                if(pushresponse.size() > 0){
                if(pushresponse.size() > 0)
                {
                    for (int i = 0; i < pushresponse.size(); i++) {
                        articleids.add(pushresponse.getJSONObject(i).getString("articleId"));
                    }
                }
                
                StringBuffer sql3 = null;
                JSONArray datas = response.getJSONArray("aaData");
                if(datas.size() > 0 && !articleids.isEmpty()){
                    for (int i = 0; i < datas.size(); i++) {
@ -151,6 +159,10 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                        }else{
                            datas.getJSONObject(i).put("ispush","0");
                        }
//                        sql3 = new StringBuffer();
//                        sql3.append("SELECT COUNT(*) as num FROM "+esType+" WHERE  userType=2 AND articleId='"+dataarticleid+"'");
//                        Long num = elasticsearchUtil.excuteForLong(sql3.toString(), esType, esIndex);
//                        datas.getJSONObject(i).put("ispush","0");
                    }
                    response.put("aaData",datas);
                }