瀏覽代碼

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

yeshijie 7 年之前
父節點
當前提交
ba135c6d86

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

@ -17,7 +17,7 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Conditi
		</Sql>
		<Sql name='getCollectionArticleList'>
			<![CDATA[
select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from (
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
			]]>
@ -94,7 +94,7 @@ FROM dual   where not exists( select ArticleId from User_ArticleStatistics where
		<Sql name='insertArticleInitStatistic'>
			<![CDATA[
			INSERT INTO User_ArticleStatistics (ArticleId, BrowseNumber, PointNumber, CommentNumber, ShareNumber, CollectionNumber) VALUES (?,?,?,?,?,?);
			INSERT INTO User_ArticleStatistics (ArticleId, BrowseNumber, PointNumber, CommentNumber, ShareNumber, CollectionNumber,PushNumber) VALUES (?,?,?,?,?,?,?);
			]]>

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

@ -4,7 +4,7 @@
		 <Sql name='getArticlePcList'>
		 <![CDATA[
				select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber ,
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType from Org_Article m
				(select count(1) from user_articlecollection a where a.ArticleId=m.ArticleId  @Condition2 )as collectionType, IFNULL(n.PushNumber,0) as PushNumber from Org_Article m
				LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1   and  ArticleState =1  @Condition    order by ArticleOrder desc  ,UpdateTime desc   @PageParam
			]]>
		</Sql>

+ 21 - 1
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java

@ -2,6 +2,7 @@ package com.yihu.jk.api;
import com.coreframework.remoting.standard.DateOper;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.Behavior;
import com.yihu.jk.vo.Category;
import net.sf.json.JSONObject;
@ -33,7 +34,7 @@ public class ArticleApiTest {
		// System.out.println(api.getCollectionArticalList(im));
		// System.out.println(api.getArticalById(im));
		queryArticlePcList();
		saveBehavior();
//		System.out.printf("350200".substring(0,3));
	}
@ -115,4 +116,23 @@ public class ArticleApiTest {
		}
	}
	public static void saveBehavior(){
		BehaviorApi api = new BehaviorApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("articleId","0A2BABB7A6734DD7B47496461CF04B21");
		obj.put("cName","标题");//
		obj.put("userId","11");
		obj.put("number",2);//
		obj.put("behaviorAction",7);
		im.setParam(obj.toString());
		initDB();
		try{
//			api.authenticationArticle(im);
			System.out.println(api.saveBehavior(im));
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}

+ 1 - 1
edu-article/JkEdu/src/com/yihu/jk/api/BehaviorApi.java

@ -31,6 +31,7 @@ public class BehaviorApi {
		String articleId = StringUtil.isEmpty(json.get("articleId")) ? null : json.getString("articleId");
		String cName = StringUtil.isEmpty(json.get("cName")) ? null : json.getString("cName");
		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId");
		int number = StringUtil.isEmpty(json.get("number")) ? 1 : json.getInt("userId");
		// 1、点赞 2、转发3、分享 4、浏览
		Integer behaviorAction = StringUtil.isEmpty(json.get("behaviorAction")) ? null : json.getInt("behaviorAction");
		if (StringUtil.isEmpty(articleId) || StringUtil.isEmpty(behaviorAction) || StringUtil.isEmpty(userId)) {
@ -46,7 +47,6 @@ public class BehaviorApi {
		arvo.setArticleId(articleId);
		try {
			subDao.saveBehavior(vo);
			int number = 1;
			ArticleApi.updateArticleStatistic(articleId, behaviorAction, number);
			return ApiUtil.getRespJSON(10000, "成功").toString();
		} catch (SQLException e) {

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

@ -628,6 +628,8 @@ public class JMJkEduArticleService extends BaseService {
        e.setPatientCode(null);
        e.setPatientName(null);
        elastricSearchSave.save(e, esIndex, esType);
        //记录推送量
        thirdJkEduArticleService.saveBehavior(articleId,sendCode,7,patientSet.size());
        return healthEduArticleESList;
    }

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

@ -945,19 +945,23 @@ public class ThirdJkEduArticleService extends BaseService {
    /**************************************************** behaver *******************************************************/
    public void saveBehavior(String articleId,String userId) throws Exception {
    public void saveBehavior(String articleId,String userId,Integer behaviorAction,Integer number) throws Exception {
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleId",articleId);// 文章ID
            Patient patient = patientDao.findByCode(userId);
            Doctor doctor = doctorDao.findByCode(userId);
            String cName = "";
            if(patient!=null){
                cName = patient.getName();
            }else if(doctor!=null){
                cName = doctor.getName();
            }
            param.put("cName",cName);//用户名称
            param.put("userId",userId);//用户ID
            param.put("behaviorAction",behaviorAction);//用户
            param.put("number",number);//用户
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveBehavior, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/jimeiJkEdu/PatientJMJkEduArticleController.java

@ -190,9 +190,10 @@ public class PatientJMJkEduArticleController extends BaseController {
    @RequestMapping(value = "saveBehavior", method = RequestMethod.POST)
    @ApiOperation("添加 浏览、转发、分享、点赞 ")
    public String saveBehavior(
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId){
            @ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
            @ApiParam(name = "behaviorAction", value = "1、点赞 2、转发 3、分享 4、浏览 5、评论 6、收藏 7、发送", required = true) @RequestParam(value = "behaviorAction", required = true) Integer behaviorAction){
        try {
            thirdJkEduArticleService.saveBehavior(articleId,getUID());
            thirdJkEduArticleService.saveBehavior(articleId,getUID(),behaviorAction,null);
//            Long count = healthEducationArticleService.pushArticleLogsCount("ece5c665b16542b0847e52b4a9fee44a");
            return write(200,"保存成功!");
        }catch (Exception e) {