浏览代码

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

trick9191 7 年之前
父节点
当前提交
c5cc26733f

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

@ -1,66 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<das-client>
<das-client>
	<Sqls> 
		 <Sql name='getArticleList'>
		 <![CDATA[
	<Sqls>
		<Sql name='getArticleList'>
			<![CDATA[
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
		
		
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='getArticleListCount'>
		 <![CDATA[
		<Sql name='getArticleListCount'>
			<![CDATA[
	select count(*) from Org_Article m 
	select count(*) from Org_Article m 
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
			]]>
		</Sql>
		</Sql>
				 <Sql name='getCollectionArticleList'>
		 <![CDATA[
		<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 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 
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
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
			]]>
		</Sql>
		</Sql>
					 <Sql name='getCollectionArticleListCount'>
		 <![CDATA[
		<Sql name='getCollectionArticleListCount'>
			<![CDATA[
select count(*) from (
select count(*) 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 
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
User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='pointNumberCount'>
		 <![CDATA[
		<Sql name='pointNumberCount'>
			<![CDATA[
select *  from User_Behavior where  BehaviorAction=1 and 1=1 @Condition
select *  from User_Behavior where  BehaviorAction=1 and 1=1 @Condition
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='collectionNumberCount'>
		 <![CDATA[
		<Sql name='collectionNumberCount'>
			<![CDATA[
select * from User_ArticleCollection where 1=1 @Condition
select * from User_ArticleCollection where 1=1 @Condition
			]]>
			]]>
		</Sql>
		</Sql>
		 <Sql name='updateArticleStatistic'>
		 <![CDATA[
		<Sql name='updateArticleStatistic'>
			<![CDATA[
		 update User_ArticleStatistics set @behaviorParam where @ArticleId
		 update User_ArticleStatistics set @behaviorParam where @ArticleId
			]]>
			]]>
		</Sql>
		</Sql>
		
		 <Sql name='updateCollectionStatistic'>
		 <![CDATA[
		<Sql name='updateCollectionStatistic'>
			<![CDATA[
		 update User_ArticleStatistics set @behaviorParam= (
		 update User_ArticleStatistics set @behaviorParam= (
select count(*) from User_ArticleCollection where 1=1 @Condition) where @ArticleId
select count(*) from User_ArticleCollection where 1=1 @Condition) where @ArticleId
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='updateCommentStatistic'>
		 <![CDATA[
		<Sql name='updateCommentStatistic'>
			<![CDATA[
		 update User_ArticleStatistics  set @behaviorParam= (
		 update User_ArticleStatistics  set @behaviorParam= (
select count(*) from User_ArticleComment where 1=1 @Condition) where @ArticleId
select count(*) from User_ArticleComment where 1=1 @Condition) where @ArticleId
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='insertArticleStatistic'>
		 <![CDATA[
		<Sql name='insertArticleStatistic'>
			<![CDATA[
					
					
				INSERT INTO User_ArticleStatistics (		
				INSERT INTO User_ArticleStatistics (		
			ArticleId
			ArticleId
@ -70,14 +70,14 @@ FROM dual   where not exists( select ArticleId from User_ArticleStatistics where
	
	
			]]>
			]]>
		</Sql>
		</Sql>
		 <Sql name='deleteArticleStatistic'>
		 <![CDATA[
		<Sql name='deleteArticleStatistic'>
			<![CDATA[
					
					
				delete  from User_ArticleStatistics
				delete  from User_ArticleStatistics
			]]>
			]]>
		</Sql>
		</Sql>
		 <Sql name='queryArticleStatistic'>
		 <![CDATA[
		<Sql name='queryArticleStatistic'>
			<![CDATA[
				select * from (
				select * from (
			select count(case behavioraction when '1' then 'PointNumber' end) as PointNumber,
			select count(case behavioraction when '1' then 'PointNumber' end) as PointNumber,
			 count(case behavioraction when '3' then 'ShareNumber' end) as ShareNumber, 
			 count(case behavioraction when '3' then 'ShareNumber' end) as ShareNumber, 
@ -89,19 +89,19 @@ FROM dual   where not exists( select ArticleId from User_ArticleStatistics where
			ON  aa.articleid=bb.articleid
			ON  aa.articleid=bb.articleid
			]]>
			]]>
			
		</Sql>
		</Sql>
		 <Sql name='insertArticleInitStatistic'>
		 <![CDATA[
		<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) VALUES (?,?,?,?,?,?);
			]]>
			]]>
			
		</Sql>
		</Sql>
		
			 <Sql name='getDoctorArticleList'>
		 <![CDATA[
		<Sql name='getDoctorArticleList'>
			<![CDATA[
				select * from (
				select * from (
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
@ -113,8 +113,8 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where   m.isauthen
		
		
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='getDoctorArticleListCount'>
		 <![CDATA[
		<Sql name='getDoctorArticleListCount'>
			<![CDATA[
		select articleid from (
		select articleid from (
		select articleid from Org_Article where isauthentication=1  and 1=1  @Condition
		select articleid from Org_Article where isauthentication=1  and 1=1  @Condition
		union
		union
@ -123,16 +123,16 @@ LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where   m.isauthen
			]]>
			]]>
		</Sql>
		</Sql>
		
			 <Sql name='getDoctorArticalByUserId'>
		 <![CDATA[
		<Sql name='getDoctorArticalByUserId'>
			<![CDATA[
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where   1=1 @Condition
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where   1=1 @Condition
			]]>
			]]>
		</Sql>
		</Sql>
			 <Sql name='getDoctorArticalByUserIdCount'>
		 <![CDATA[
		<Sql name='getDoctorArticalByUserIdCount'>
			<![CDATA[
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
		select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m 
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where   1=1 @Condition 		 
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where   1=1 @Condition 		 

+ 37 - 7
edu-article/JkEdu/src/com/yihu/jk/action/UserAction.java

@ -2,6 +2,8 @@ package com.yihu.jk.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import net.sf.json.JSONArray;
import net.sf.json.JsonConfig;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseBody;
@ -12,6 +14,9 @@ import com.yihu.wsgw.api.ServiceBus;
import net.sf.json.JSONObject;
import net.sf.json.JSONObject;
import java.util.List;
import java.util.Map;
@Controller
@Controller
@RequestMapping("user")
@RequestMapping("user")
@ -29,7 +34,7 @@ public class UserAction {
			return ApiUtil.getRespJSON(-10000, e.getMessage()).toString();
			return ApiUtil.getRespJSON(-10000, e.getMessage()).toString();
		}
		}
	}
	}
	
	@RequestMapping("ssoLogin")
	@RequestMapping("ssoLogin")
	@ResponseBody
	@ResponseBody
	public String ssoLogin(HttpServletRequest request) {
	public String ssoLogin(HttpServletRequest request) {
@ -39,7 +44,7 @@ public class UserAction {
				return ApiUtil.getRespJSON(-10000, "参数param不能为空").toString();
				return ApiUtil.getRespJSON(-10000, "参数param不能为空").toString();
			}
			}
			JSONObject jsonParam=JSONObject.fromObject(param);
			JSONObject jsonParam=JSONObject.fromObject(param);
			
			if(jsonParam.optString("doctorType")==null){
			if(jsonParam.optString("doctorType")==null){
				return ApiUtil.getRespJSON(-10000, "您不是医生,不能登入系统").toString();
				return ApiUtil.getRespJSON(-10000, "您不是医生,不能登入系统").toString();
			}
			}
@ -52,11 +57,15 @@ public class UserAction {
			sessionBean.setPhoto(jsonParam.optString("photo"));
			sessionBean.setPhoto(jsonParam.optString("photo"));
//			sessionBean.setUserId(jsonParam.optString("id"));
//			sessionBean.setUserId(jsonParam.optString("id"));
			sessionBean.setOrgId(jsonParam.optString("hospital"));
			sessionBean.setOrgId(jsonParam.optString("hospital"));
			
			sessionBean.setToken(jsonParam.optString("token"));
			sessionBean.setToken(jsonParam.optString("token"));
			
			JSONArray jsonArray = jsonParam.getJSONArray("userRole");
			List<Map<String,Object>> list = JSONArray.toList(jsonArray, Map.class);
			sessionBean.setUserRoleList(list);
			JSONObject jsonObject = jsonParam.getJSONObject("currentRole");
			Map<String,Object> map = jsonObject;
			sessionBean.setCurrentRole(map);
			
			//获取医生的信息
			//获取医生的信息
			JSONObject queryParam=new JSONObject();
			JSONObject queryParam=new JSONObject();
			queryParam.put("userId", sessionBean.getUserId());
			queryParam.put("userId", sessionBean.getUserId());
@ -72,7 +81,7 @@ public class UserAction {
			}
			}
			
			request.getSession().setAttribute("session", sessionBean);
			request.getSession().setAttribute("session", sessionBean);
			request.getSession().setMaxInactiveInterval(-1);
			request.getSession().setMaxInactiveInterval(-1);
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
@ -82,6 +91,27 @@ public class UserAction {
			e.printStackTrace();
			e.printStackTrace();
			return ApiUtil.getRespJSON(-10000, e.getMessage()).toString();
			return ApiUtil.getRespJSON(-10000, e.getMessage()).toString();
		}
		}
	}	
	}
//	public static void main(String[] args) {
//		String a = "{'uid':'0de7295862dd11e69faffa163e8aee56'," +
//				"'doctorType' :2," +
//				"'name':'团队长'," +
//				"'token':'aeb3b537040b8607d9b82308aabef313'," +
//				"'photo' : '../../../images/d-male.png'," +
//				"'id' :4798," +
//				"'hospital':'3502110400'," +
//				"'userRole':[{'code':'350200','name':'厦门市卫生与计划生育委员会','areas':'350203'}]," +
//				"'currentRole':{'code':'350200','name':'厦门市卫生与计划生育委员会','areas':'350203'}}";
//
//		JSONObject jsonParam=JSONObject.fromObject(a);
//		SessionBean sessionBean=new SessionBean();
//		JSONArray jsonArray = jsonParam.getJSONArray("userRole");
//		List<Map<String,Object>> list = JSONArray.toList(jsonArray, Map.class);
//		sessionBean.setUserRoleList(list);
//		JSONObject jsonObject = jsonParam.getJSONObject("currentRole");
//		Map<String,Object> map = jsonObject;
//		sessionBean.setCurrentRole(map);
//	}
}
}

+ 8 - 8
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -23,7 +23,7 @@ public class ArticleApi {
	/**
	/**
	 * 查询文章列表 返回(文章统计,文章相关字段
	 * 查询文章列表 返回(文章统计,文章相关字段
	 * 
	 *
	 * @param im
	 * @param im
	 * @return
	 * @return
	 * @throws JSONException
	 * @throws JSONException
@ -98,7 +98,7 @@ public class ArticleApi {
	/**
	/**
	 * // 获取文章收藏列表
	 * // 获取文章收藏列表
	 * 
	 *
	 * @param im
	 * @param im
	 * @return
	 * @return
	 * @throws JSONException
	 * @throws JSONException
@ -112,7 +112,7 @@ public class ArticleApi {
		Integer pageSize = StringUtil.isEmpty(json.get("pageSize")) ? 5 : json.getInt("pageSize");
		Integer pageSize = StringUtil.isEmpty(json.get("pageSize")) ? 5 : json.getInt("pageSize");
		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId");
		String userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getString("userId");
		int userType = StringUtil.isEmpty(json.get("userType")) ? 2 : json.getInt("userType");// 1医生
		int userType = StringUtil.isEmpty(json.get("userType")) ? 2 : json.getInt("userType");// 1医生
		int myArticle = StringUtil.isEmpty(json.get("myArticle")) ? 2 : json.getInt("myArticle");
		boolean myArticle = StringUtil.isEmpty(json.get("myArticle")) ? false : json.getBoolean("myArticle");
		if (StringUtil.isEmpty(userId)) {
		if (StringUtil.isEmpty(userId)) {
			return ApiUtil.getRespJSON(-10000, "userId 必传").toString();
			return ApiUtil.getRespJSON(-10000, "userId 必传").toString();
@ -173,7 +173,7 @@ public class ArticleApi {
	/**
	/**
	 * 根据文章ID 获取文章详情
	 * 根据文章ID 获取文章详情
	 * 
	 *
	 * @param im
	 * @param im
	 * @return
	 * @return
	 * @throws JSONException
	 * @throws JSONException
@ -250,7 +250,7 @@ public class ArticleApi {
	/**
	/**
	 * // 更新统计表数据
	 * // 更新统计表数据
	 * 
	 *
	 * @param articleId
	 * @param articleId
	 * @param behaviorAction
	 * @param behaviorAction
	 * @param number
	 * @param number
@ -303,7 +303,7 @@ public class ArticleApi {
	/**
	/**
	 * // 初始化统计数据
	 * // 初始化统计数据
	 * 
	 *
	 * @throws SQLException
	 * @throws SQLException
	 */
	 */
	public static void initArticleStatistic() throws SQLException {
	public static void initArticleStatistic() throws SQLException {
@ -323,7 +323,7 @@ public class ArticleApi {
	/**
	/**
	 * 医生端查询文章列表
	 * 医生端查询文章列表
	 * 
	 *
	 * @param im
	 * @param im
	 * @return
	 * @return
	 * @throws JSONException
	 * @throws JSONException
@ -399,7 +399,7 @@ public class ArticleApi {
	/**
	/**
	 * 医生 端根据用户ID 查询发表文章
	 * 医生 端根据用户ID 查询发表文章
	 * 
	 *
	 * @param im
	 * @param im
	 * @return
	 * @return
	 * @throws JSONException
	 * @throws JSONException

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

@ -1,7 +1,11 @@
package com.yihu.jk.api;
package com.yihu.jk.api;
import java.io.IOException;
import java.sql.SQLException;
import java.sql.SQLException;
import com.coreframework.remoting.standard.DateOper;
import com.yihu.jk.utils.Utils;
import com.yihu.jk.vo.SessionBean;
import net.sf.json.JSONObject;
import net.sf.json.JSONObject;
import com.yihu.jk.dao.CategoryDao;
import com.yihu.jk.dao.CategoryDao;
@ -9,9 +13,14 @@ import com.yihu.jk.utils.ApiUtil;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.Category;
import com.yihu.jk.vo.Category;
import com.yihu.wsgw.api.InterfaceMessage;
import com.yihu.wsgw.api.InterfaceMessage;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CategoryApi {
public class CategoryApi {
	CategoryDao dao = new CategoryDao();
	//	@Autowired
	private CategoryDao dao = new CategoryDao();
	public String getCategoryList(InterfaceMessage im) {
	public String getCategoryList(InterfaceMessage im) {
		JSONObject json = JSONObject.fromObject(im.getParam());
		JSONObject json = JSONObject.fromObject(im.getParam());
@ -34,4 +43,55 @@ public class CategoryApi {
		}
		}
	}
	}
	/**
	 *添加文章分类
	 * @param im
	 * @return
	 */
	public String addCategory(InterfaceMessage im){
		JSONObject json = JSONObject.fromObject(im.getParam());
		String categoryId = StringUtil.isEmpty(json.get("categoryId")) ? null : json.getString("categoryId");
		String categoryName = StringUtil.isEmpty(json.get("categoryName")) ? null : json.getString("categoryName");
		Integer categoryLevel = StringUtil.isEmpty(json.get("categoryLevel")) ? null : json.getInt("categoryLevel");
		String secondLevelId = StringUtil.isEmpty(json.get("secondLevelId")) ? null : json.getString("secondLevelId");
		String firstlevelId = StringUtil.isEmpty(json.get("firstlevelId")) ? null : json.getString("firstlevelId");
		String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName");
		String orgId = StringUtil.isEmpty(json.get("orgId")) ? null : json.getString("orgId");
		String operatorName = StringUtil.isEmpty(json.get("operatorName")) ? null : json.getString("operatorName");
		String operatorId = StringUtil.isEmpty(json.get("operatorId")) ? null : json.getString("operatorId");
		Category vo = new Category();
		vo.setCategoryId(categoryId);
		vo.setCategoryName(categoryName);
		vo.setCategoryLevel(categoryLevel);
		vo.setFirstlevelId(firstlevelId);
		vo.setSecondLevelId(secondLevelId);
		vo.setOperatorId(operatorId);
		vo.setOperatorName(operatorName);
		vo.setOrgId(orgId);
		vo.setOrgName(orgName);
		vo.setInsertTime(DateOper.getNowDateTime().toString());
		vo.setCategoryState(1);
		return dao.addCategory(vo).toString();
	}
	/**
	 * 更新文章分类
	 * @param im
	 * @return
	 */
	public String updateCategory(InterfaceMessage im){
		JSONObject json = JSONObject.fromObject(im.getParam());
		String categoryId = StringUtil.isEmpty(json.get("categoryId")) ? null : json.getString("categoryId");
		String categoryName = StringUtil.isEmpty(json.get("categoryName")) ? null : json.getString("categoryName");
		Integer categoryState = StringUtil.isEmpty(json.get("categoryState")) ? null : json.getInt("categoryState");
		Category vo = new Category();
		vo.setCategoryId(categoryId);
		vo.setCategoryName(categoryName);
		vo.setCategoryState(categoryState);
		vo.setUpdateTime(DateOper.getNowDateTime().toString());
		return dao.updateCategory(vo).toString();
	}
}
}

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

@ -10,7 +10,9 @@ import com.yihu.jk.enums.ArticleSqlNameEnum;
import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.ArticleStatistic;
import com.yihu.jk.vo.ArticleStatistic;
import org.springframework.stereotype.Component;
@Component
public class ArticleDao {
public class ArticleDao {
	public List<ArticleStatistic> getArticleList(ArticleStatistic vo, int start, int pageSize) throws SQLException {
	public List<ArticleStatistic> getArticleList(ArticleStatistic vo, int start, int pageSize) throws SQLException {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticleList);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticleList);
@ -76,7 +78,7 @@ public class ArticleDao {
	 * @return
	 * @return
	 * @throws SQLException
	 * @throws SQLException
	 */
	 */
	public List<ArticleStatistic> getArticleCollectionArticleList(ArticleStatistic vo, int start, int pageSize,int myArticle)
	public List<ArticleStatistic> getArticleCollectionArticleList(ArticleStatistic vo, int start, int pageSize,boolean myArticle)
			throws SQLException {
			throws SQLException {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getCollectionArticleList);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getCollectionArticleList);
		StringBuffer param = new StringBuffer();
		StringBuffer param = new StringBuffer();
@ -89,6 +91,9 @@ public class ArticleDao {
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			param.append(" and FirstLevelCategoryId  in (").append(vo.getFirstLevelCategoryId()).append(")");
			param.append(" and FirstLevelCategoryId  in (").append(vo.getFirstLevelCategoryId()).append(")");
		}
		}
		if(myArticle){
			userParam.append(" and OperatorId = '").append(vo.getUserId()).append("'");
		}
		if (StringUtil.isNotEmpty(vo.getUserId())) {
		if (StringUtil.isNotEmpty(vo.getUserId())) {
			userParam.append(" and UserId  ='").append(vo.getUserId()).append("'");
			userParam.append(" and UserId  ='").append(vo.getUserId()).append("'");
		}
		}
@ -100,6 +105,7 @@ public class ArticleDao {
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition", param.toString());
		sql.addVar("@UserParam", userParam.toString());
		sql.addVar("@UserParam", userParam.toString());
		System.out.printf(sql.toString());
		List<ArticleStatistic> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql, ArticleStatistic.class);
		List<ArticleStatistic> list = DB.me().queryForBeanList(MyDatabaseEnum.JkEduDB, sql, ArticleStatistic.class);
		return list;
		return list;
	}
	}

+ 47 - 45
edu-article/JkEdu/src/com/yihu/jk/dao/ArticlePcDao.java

@ -12,19 +12,21 @@ import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.OrgArticleVo;
import com.yihu.jk.vo.OrgArticleVo;
import org.springframework.stereotype.Component;
@Component
public class ArticlePcDao {
public class ArticlePcDao {
	public JSONObject queryArticlePcList(OrgArticleVo vo, int start, int pageSize) throws Exception {
	public JSONObject queryArticlePcList(OrgArticleVo vo, int start, int pageSize) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
 		StringBuilder sb = new StringBuilder();
		
	
		
		StringBuilder sb = new StringBuilder();
		if (StringUtil.isNotEmpty(vo.getArticleId())) {
		if (StringUtil.isNotEmpty(vo.getArticleId())) {
			sb.append(" and ArticleId = ? ");
			sb.append(" and ArticleId = ? ");
			sql.addParamValue(vo.getArticleId() );
			sql.addParamValue(vo.getArticleId() );
		}
		}
		
		if (StringUtil.isNotEmpty(vo.getArticleState())) {
		if (StringUtil.isNotEmpty(vo.getArticleState())) {
			sb.append(" and ArticleState = ? ");
			sb.append(" and ArticleState = ? ");
			sql.addParamValue(vo.getArticleState());
			sql.addParamValue(vo.getArticleState());
@ -37,70 +39,70 @@ public class ArticlePcDao {
			sb.append(" and Articlelevel = ? ");
			sb.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
		}
		}
		 
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			
			sb.append(" and (ArticleTitle like '%" + vo.getArticleTitle() + "%'");
			sb.append(" and (ArticleTitle like '%" + vo.getArticleTitle() + "%'");
			sb.append(" or ArticleSource like '%" + vo.getArticleTitle() + "%')");
			sb.append(" or ArticleSource like '%" + vo.getArticleTitle() + "%')");
		}
		}
 		
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
			String startTime = vo.getStartTime();
			String startTime = vo.getStartTime();
			sb.append(" and  InsertTime >=? ");
			sb.append(" and  InsertTime >=? ");
			sql.addParamValue(startTime);
			sql.addParamValue(startTime);
 		}
		
		}
		if (StringUtil.isNotEmpty(vo.getEndTime())) {
		if (StringUtil.isNotEmpty(vo.getEndTime())) {
			
			String endTime = vo.getEndTime();
			String endTime = vo.getEndTime();
			sb.append(" and  InsertTime <=? ");
			sb.append(" and  InsertTime <=? ");
			sql.addParamValue(endTime);
			sql.addParamValue(endTime);
			 
		}
		}
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
			sb.append(" and Articlelevel = ? ");
			sb.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
		}
		}
		
		if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
		if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
			
			sb.append(" and SecondLevelCategoryId = ? ");
			sb.append(" and SecondLevelCategoryId = ? ");
			sql.addParamValue(vo.getSecondLevelCategoryId());
			sql.addParamValue(vo.getSecondLevelCategoryId());
			
		}
		}
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			sb.append(" and FirstLevelCategoryId = ? ");
			sb.append(" and FirstLevelCategoryId = ? ");
			sql.addParamValue(vo.getFirstLevelCategoryId());
			sql.addParamValue(vo.getFirstLevelCategoryId());
			
 		}
		}
		if (StringUtil.isNotEmpty(vo.getArticleType())) {
		if (StringUtil.isNotEmpty(vo.getArticleType())) {
			sb.append(" and ArticleType = ? ");
			sb.append(" and ArticleType = ? ");
			sql.addParamValue(vo.getArticleType());
			sql.addParamValue(vo.getArticleType());
			
 		}
		 
		}
		if (StringUtil.isNotEmpty(vo.getArticleSource())) {
		if (StringUtil.isNotEmpty(vo.getArticleSource())) {
			sb.append(" and ArticleSource = ? ");
			sb.append(" and ArticleSource = ? ");
			sql.addParamValue(vo.getArticleSource());
			sql.addParamValue(vo.getArticleSource());
			
 		}
		}
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
			sb.append(" and Articlelevel = ? ");
			sb.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
			
 		}
		}
		sql.addVar("@Condition", sb.toString());
		sql.addVar("@Condition", sb.toString());
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
	}
	}
	
	public Integer removeArticle(OrgArticleVo bean) {
	public Integer removeArticle(OrgArticleVo bean) {
		try {
		try {
			bean.setUpdateTime(DateOper.getNowDateTime());
			bean.setUpdateTime(DateOper.getNowDateTime());
			Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Org_Article,
			Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Org_Article,
					"ArticleId = ?");
					"ArticleId = ?");
			sql.addParamValue(bean.getArticleId());
			sql.addParamValue(bean.getArticleId());
			
			int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			if (code == 1) {
			if (code == 1) {
				return 10000;
				return 10000;
@ -113,8 +115,8 @@ public class ArticlePcDao {
		}
		}
	}
	}
	
	
	/**
	/**
	 * 修改 
	 * 修改 
	 * @author lxh <br> 2017-08-30
	 * @author lxh <br> 2017-08-30
@ -124,17 +126,17 @@ public class ArticlePcDao {
		Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Org_Article,
		Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Org_Article,
				"ArticleId = ?");
				"ArticleId = ?");
		sql.addParamValue(bean.getArticleId());
		sql.addParamValue(bean.getArticleId());
		
		int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
		int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
		
		return code;
		return code;
	}
	}
	
	public Integer saveArticle(OrgArticleVo orgArticleVo) {
	public Integer saveArticle(OrgArticleVo orgArticleVo) {
		try {
		try {
			 
			Sql sql = DB.me().createInsertSql(orgArticleVo, MyTableEnum.Org_Article);
			Sql sql = DB.me().createInsertSql(orgArticleVo, MyTableEnum.Org_Article);
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			return 10000;
			return 10000;
@ -143,14 +145,14 @@ public class ArticlePcDao {
			return -14444;
			return -14444;
		}
		}
	}
	}
	
	public JSONObject queryCategory(Integer categoryLevel,String secondLevelCategoryId,String firstLevelCategoryId) throws Exception {
	public JSONObject queryCategory(Integer categoryLevel,String secondLevelCategoryId,String firstLevelCategoryId) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.queryCategory);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.queryCategory);
		StringBuffer param = new StringBuffer();
		StringBuffer param = new StringBuffer();
		if (StringUtil.isNotEmpty(categoryLevel)) {
		if (StringUtil.isNotEmpty(categoryLevel)) {
			param.append(" and CategoryLevel = ? ");
			param.append(" and CategoryLevel = ? ");
			sql.addParamValue(categoryLevel);
			sql.addParamValue(categoryLevel);
			
		}
		}
	/*	if (StringUtil.isNotEmpty(secondLevelCategoryId)) {
	/*	if (StringUtil.isNotEmpty(secondLevelCategoryId)) {
@ -159,9 +161,9 @@ public class ArticlePcDao {
			sql.addParamValue(secondLevelCategoryId);
			sql.addParamValue(secondLevelCategoryId);
			
			
		}*/
		}*/
	
		if (StringUtil.isNotEmpty(firstLevelCategoryId)) {
		if (StringUtil.isNotEmpty(firstLevelCategoryId)) {
			
			param.append(" and FirstLevelId = ? ");
			param.append(" and FirstLevelId = ? ");
			sql.addParamValue(firstLevelCategoryId);
			sql.addParamValue(firstLevelCategoryId);
		}
		}
@ -169,29 +171,29 @@ public class ArticlePcDao {
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql);
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql);
	}
	}
	
	public JSONObject queryArticlePcId(OrgArticleVo vo) throws SQLException, JSONException {
	public JSONObject queryArticlePcId(OrgArticleVo vo) throws SQLException, JSONException {
		JSONObject jo;
		JSONObject jo;
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcId);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcId);
		StringBuffer param = new StringBuffer();
		StringBuffer param = new StringBuffer();
	 
		if (StringUtil.isNotEmpty(vo.getArticleId())) {
		if (StringUtil.isNotEmpty(vo.getArticleId())) {
			param.append(" and ArticleId = ? ");
			param.append(" and ArticleId = ? ");
			sql.addParamValue(vo.getArticleId() );
			sql.addParamValue(vo.getArticleId() );
		}
		}
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition", param.toString());
		jo=	 DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql );
		jo=	 DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql );
		
		JSONObject jb = new JSONObject();
		JSONObject jb = new JSONObject();
		 
		if (!jo.isNull("result")) {
		if (!jo.isNull("result")) {
			for (int i = 0; i < jo.getJSONArray("result").length(); i++) {
			for (int i = 0; i < jo.getJSONArray("result").length(); i++) {
				
				JSONObject myjObject = jo.getJSONArray("result").getJSONObject(i);
				JSONObject myjObject = jo.getJSONArray("result").getJSONObject(i);
				jb.put("result", myjObject);
				jb.put("result", myjObject);
			}
			}
			
		} else {
		} else {
			jb.put("Message", "查询失败");
			jb.put("Message", "查询失败");
			jb.put("Code", -10000);
			jb.put("Code", -10000);
@ -201,13 +203,13 @@ public class ArticlePcDao {
		// System.out.println("==" + sql.toString() + "==");
		// System.out.println("==" + sql.toString() + "==");
		return jb;
		return jb;
	}
	}
	
	public net.sf.json.JSONObject editArticle(OrgArticleVo orgArticleVo) {
	public net.sf.json.JSONObject editArticle(OrgArticleVo orgArticleVo) {
		net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
		net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
		try {
		try {
			String articleId = orgArticleVo.getArticleId();
			String articleId = orgArticleVo.getArticleId();
			Sql sql = DB.me().createUpdateSql(orgArticleVo,  MyTableEnum.Org_Article, " ArticleId=" + "'"+articleId+"'");
			Sql sql = DB.me().createUpdateSql(orgArticleVo,  MyTableEnum.Org_Article, " ArticleId=" + "'"+articleId+"'");
			
			int r = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			int r = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			if (r > 0) {
			if (r > 0) {
@ -224,5 +226,5 @@ public class ArticlePcDao {
			return jo;
			return jo;
		}
		}
	}
	}
	 
}
}

+ 44 - 42
edu-article/JkEdu/src/com/yihu/jk/dao/ArticlePcDoctorDao.java

@ -12,19 +12,21 @@ import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.OrgArticleVo;
import com.yihu.jk.vo.OrgArticleVo;
import org.springframework.stereotype.Component;
@Component
public class ArticlePcDoctorDao {
public class ArticlePcDoctorDao {
	public JSONObject queryArticlePcDoctorList(OrgArticleVo vo, int start, int pageSize) throws Exception {
	public JSONObject queryArticlePcDoctorList(OrgArticleVo vo, int start, int pageSize) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
 		StringBuilder sb = new StringBuilder();
		
	
		
		StringBuilder sb = new StringBuilder();
		if (StringUtil.isNotEmpty(vo.getArticleId())) {
		if (StringUtil.isNotEmpty(vo.getArticleId())) {
			sb.append(" and ArticleId = ? ");
			sb.append(" and ArticleId = ? ");
			sql.addParamValue(vo.getArticleId() );
			sql.addParamValue(vo.getArticleId() );
		}
		}
		
		if (StringUtil.isNotEmpty(vo.getArticleState())) {
		if (StringUtil.isNotEmpty(vo.getArticleState())) {
			sb.append(" and ArticleState = ? ");
			sb.append(" and ArticleState = ? ");
			sql.addParamValue(vo.getArticleState());
			sql.addParamValue(vo.getArticleState());
@ -37,70 +39,70 @@ public class ArticlePcDoctorDao {
			sb.append(" and Articlelevel = ? ");
			sb.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
		}
		}
		 
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
			
			sb.append(" and (ArticleTitle like '%" + vo.getArticleTitle() + "%'");
			sb.append(" and (ArticleTitle like '%" + vo.getArticleTitle() + "%'");
			sb.append(" or ArticleSource like '%" + vo.getArticleTitle() + "%')");
			sb.append(" or ArticleSource like '%" + vo.getArticleTitle() + "%')");
		}
		}
 		
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
			String startTime = vo.getStartTime();
			String startTime = vo.getStartTime();
			sb.append(" and  InsertTime >=? ");
			sb.append(" and  InsertTime >=? ");
			sql.addParamValue(startTime);
			sql.addParamValue(startTime);
 		}
		
		}
		if (StringUtil.isNotEmpty(vo.getEndTime())) {
		if (StringUtil.isNotEmpty(vo.getEndTime())) {
			
			String endTime = vo.getEndTime();
			String endTime = vo.getEndTime();
			sb.append(" and  InsertTime <=? ");
			sb.append(" and  InsertTime <=? ");
			sql.addParamValue(endTime);
			sql.addParamValue(endTime);
			 
		}
		}
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
			sb.append(" and Articlelevel = ? ");
			sb.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
		}
		}
		
		if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
		if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
			
			sb.append(" and SecondLevelCategoryId = ? ");
			sb.append(" and SecondLevelCategoryId = ? ");
			sql.addParamValue(vo.getSecondLevelCategoryId());
			sql.addParamValue(vo.getSecondLevelCategoryId());
			
		}
		}
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			sb.append(" and FirstLevelCategoryId = ? ");
			sb.append(" and FirstLevelCategoryId = ? ");
			sql.addParamValue(vo.getFirstLevelCategoryId());
			sql.addParamValue(vo.getFirstLevelCategoryId());
			
 		}
		}
		if (StringUtil.isNotEmpty(vo.getArticleType())) {
		if (StringUtil.isNotEmpty(vo.getArticleType())) {
			sb.append(" and ArticleType = ? ");
			sb.append(" and ArticleType = ? ");
			sql.addParamValue(vo.getArticleType());
			sql.addParamValue(vo.getArticleType());
			
 		}
		 
		}
		if (StringUtil.isNotEmpty(vo.getArticleSource())) {
		if (StringUtil.isNotEmpty(vo.getArticleSource())) {
			sb.append(" and ArticleSource = ? ");
			sb.append(" and ArticleSource = ? ");
			sql.addParamValue(vo.getArticleSource());
			sql.addParamValue(vo.getArticleSource());
			
 		}
		}
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
			sb.append(" and Articlelevel = ? ");
			sb.append(" and Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
			sql.addParamValue(vo.getArticlelevel());
			
 		}
		}
		sql.addVar("@Condition", sb.toString());
		sql.addVar("@Condition", sb.toString());
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
		return DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql, start, pageSize);
	}
	}
	
	public Integer removeArticleDoctor(OrgArticleVo bean) {
	public Integer removeArticleDoctor(OrgArticleVo bean) {
		try {
		try {
			bean.setUpdateTime(DateOper.getNowDateTime());
			bean.setUpdateTime(DateOper.getNowDateTime());
			Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Org_Article,
			Sql sql = DB.me().createUpdateSql(bean, MyTableEnum.Org_Article,
					"ArticleId = ?");
					"ArticleId = ?");
			sql.addParamValue(bean.getArticleId());
			sql.addParamValue(bean.getArticleId());
			
			int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			int code = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			if (code == 1) {
			if (code == 1) {
				return 10000;
				return 10000;
@ -113,14 +115,14 @@ public class ArticlePcDoctorDao {
		}
		}
	}
	}
	
	
	 
	
	public Integer saveArticle(OrgArticleVo orgArticleVo) {
	public Integer saveArticle(OrgArticleVo orgArticleVo) {
		try {
		try {
			 
			Sql sql = DB.me().createInsertSql(orgArticleVo, MyTableEnum.Org_Article);
			Sql sql = DB.me().createInsertSql(orgArticleVo, MyTableEnum.Org_Article);
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			return 10000;
			return 10000;
@ -129,26 +131,26 @@ public class ArticlePcDoctorDao {
			return -14444;
			return -14444;
		}
		}
	}
	}
	
	
	public JSONObject queryArticlePcDoctorId(OrgArticleVo vo) throws SQLException, JSONException {
	public JSONObject queryArticlePcDoctorId(OrgArticleVo vo) throws SQLException, JSONException {
		JSONObject jo;
		JSONObject jo;
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcId);
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcId);
		StringBuffer param = new StringBuffer();
		StringBuffer param = new StringBuffer();
 
		sql.addVar("@Condition", param.toString());
		sql.addVar("@Condition", param.toString());
		jo=	 DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql );
		jo=	 DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql );
		
		JSONObject jb = new JSONObject();
		JSONObject jb = new JSONObject();
		 
		if (!jo.isNull("result")) {
		if (!jo.isNull("result")) {
			for (int i = 0; i < jo.getJSONArray("result").length(); i++) {
			for (int i = 0; i < jo.getJSONArray("result").length(); i++) {
				
				JSONObject myjObject = jo.getJSONArray("result").getJSONObject(i);
				JSONObject myjObject = jo.getJSONArray("result").getJSONObject(i);
				jb.put("result", myjObject);
				jb.put("result", myjObject);
			}
			}
			
		} else {
		} else {
			jb.put("Message", "查询失败");
			jb.put("Message", "查询失败");
			jb.put("Code", -10000);
			jb.put("Code", -10000);
@ -158,13 +160,13 @@ public class ArticlePcDoctorDao {
		// System.out.println("==" + sql.toString() + "==");
		// System.out.println("==" + sql.toString() + "==");
		return jb;
		return jb;
	}
	}
	
	public net.sf.json.JSONObject editArticleDoctor(OrgArticleVo orgArticleVo) {
	public net.sf.json.JSONObject editArticleDoctor(OrgArticleVo orgArticleVo) {
		net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
		net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
		try {
		try {
			String articleId = orgArticleVo.getArticleId();
			String articleId = orgArticleVo.getArticleId();
			Sql sql = DB.me().createUpdateSql(orgArticleVo,  MyTableEnum.Org_Article, " ArticleId=" + "'"+articleId+"'");
			Sql sql = DB.me().createUpdateSql(orgArticleVo,  MyTableEnum.Org_Article, " ArticleId=" + "'"+articleId+"'");
			
			int r = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			int r = DB.me().update(MyDatabaseEnum.JkEduDB, sql);
			if (r > 0) {
			if (r > 0) {
@ -181,6 +183,6 @@ public class ArticlePcDoctorDao {
			return jo;
			return jo;
		}
		}
	}
	}
	
	 
}
}

+ 11 - 9
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleQRCodeDao.java

@ -12,31 +12,33 @@ import com.yihu.jk.enums.MyDatabaseEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.enums.MyTableEnum;
import com.yihu.jk.vo.ArticleQRCode;
import com.yihu.jk.vo.ArticleQRCode;
import com.yihu.jk.vo.OperationLogVo;
import com.yihu.jk.vo.OperationLogVo;
import org.springframework.stereotype.Component;
/**
/**
 * 二维码管理表操作
 * 二维码管理表操作
 * @author chenzhibin <br> 2017-9-6 下午15:42:30 
 * @author chenzhibin <br> 2017-9-6 下午15:42:30
 */
 */
@Component
public class ArticleQRCodeDao {
public class ArticleQRCodeDao {
	
	/**
	/**
	 * 查询二维码管理
	 * 查询二维码管理
	 * @author chenzhibin <br> 2017-9-6 下午15:44:30 
	 * @author chenzhibin <br> 2017-9-6 下午15:44:30 
	 * @throws SQLException 
	 * @throws SQLException
	 */
	 */
	public JSONObject queryArticleQRCodeDao() throws SQLException {
	public JSONObject queryArticleQRCodeDao() throws SQLException {
		Sql sql = DB.me().createSql(ConfigSysSqlNameEnum.getArticleORCode);
		Sql sql = DB.me().createSql(ConfigSysSqlNameEnum.getArticleORCode);
		
		JSONObject jo = DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql);
		JSONObject jo = DB.me().queryForJson(MyDatabaseEnum.JkEduDB, sql);
		return jo;
		return jo;
	}
	}
	
	/**
	/**
	 * 新增二维码管理
	 * 新增二维码管理
	 * @author chenzhi <br> 2017-9-6 下午15:45:30
	 * @author chenzhi <br> 2017-9-6 下午15:45:30
	 * @param bean 
	 * @throws SQLException 
	 * @param bean
	 * @throws SQLException
	 */
	 */
	public int saveArticleQRCode(ArticleQRCode bean) throws SQLException {
	public int saveArticleQRCode(ArticleQRCode bean) throws SQLException {
		Timestamp nowTime = DateOper.getNowDateTime();
		Timestamp nowTime = DateOper.getNowDateTime();
@ -55,14 +57,14 @@ public class ArticleQRCodeDao {
		OperatorLogDao.addLog(logBean);
		OperatorLogDao.addLog(logBean);
		return 1;
		return 1;
	}
	}
	
	/**
	/**
	 * 修改二维码管理
	 * 修改二维码管理
	 * @author chenzhibin <br> 2017-9-6 下午15:50:30
	 * @author chenzhibin <br> 2017-9-6 下午15:50:30
	 * @param bean
	 * @param bean
	 * @param userId 修改人ID
	 * @param userId 修改人ID
	 * @param userName 修改人
	 * @param userName 修改人
	 * @throws SQLException 
	 * @throws SQLException
	 */
	 */
	public int updateArticleQRCode(ArticleQRCode bean, String userId, String userName) throws SQLException {
	public int updateArticleQRCode(ArticleQRCode bean, String userId, String userName) throws SQLException {
		Timestamp nowTime = DateOper.getNowDateTime();
		Timestamp nowTime = DateOper.getNowDateTime();

+ 2 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/BehaviorDao.java

@ -11,7 +11,9 @@ import com.yihu.jk.utils.StringUtil;
import com.yihu.jk.vo.ArticleCollection;
import com.yihu.jk.vo.ArticleCollection;
import com.yihu.jk.vo.ArticleComment;
import com.yihu.jk.vo.ArticleComment;
import com.yihu.jk.vo.Behavior;
import com.yihu.jk.vo.Behavior;
import org.springframework.stereotype.Component;
@Component
public class BehaviorDao {
public class BehaviorDao {
	// 保存
	// 保存
	public void saveBehavior(Behavior vo) throws SQLException {
	public void saveBehavior(Behavior vo) throws SQLException {

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDeviceDao.java

@ -34,7 +34,7 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<PatientDevi
    //更换患者绑定的血糖仪
    //更换患者绑定的血糖仪
    @Modifying
    @Modifying
    @Query("update PatientDevice t set t.deviceSn = ?3 , t.userType = ?4 where t.user = ?1 and t.deviceSn = ?2 ")
    int updatePatientDevice(String user, String deviceSN, String newDeviceSN,String userType);
    @Query("update PatientDevice t set t.deviceSn = ?3 , t.userType = ?4,t.sim=?5 where t.user = ?1 and t.deviceSn = ?2 ")
    int updatePatientDevice(String user, String deviceSN, String newDeviceSN,String userType,String sim);
}
}

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -18,7 +18,6 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
@ -569,8 +568,8 @@ public class PatientDeviceService extends BaseService {
     * @param newDeviceSN
     * @param newDeviceSN
     * @throws Exception
     * @throws Exception
     */
     */
    public int updatePatientDevice(String user, String deviceSN, String newDeviceSN, String userType) throws Exception {
        int rows = patientDeviceDao.updatePatientDevice(user, deviceSN, newDeviceSN, userType);
    public int updatePatientDevice(String user, String deviceSN, String newDeviceSN, String userType,String sim) throws Exception {
        int rows = patientDeviceDao.updatePatientDevice(user, deviceSN, newDeviceSN, userType,sim);
        return rows;
        return rows;
    }
    }

+ 67 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -5101,26 +5101,62 @@ public class StatisticsService extends BaseService {
     * @param type 类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消
     * @param type 类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消
     * @return
     * @return
     */
     */
    public List<Map<String,Object>> getPrescriptionTotalHistogram(String level,String area,String disease,String type){
    public List<Map<String,Object>> getPrescriptionTotalHistogram(String level,String area,String disease,String type,int interval){
        List<Map<String,Object>> rs =new ArrayList<>();
        List<Map<String,Object>> rs =new ArrayList<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String sql ="";
        Calendar dd = Calendar.getInstance();//定义日期实例
        Calendar dd = Calendar.getInstance();//定义日期实例
        Date endDate = new Date();
        Date endDate = new Date();
        dd.setTime(endDate);
        dd.setTime(endDate);
        for(int i=1;i<7;i++){
            Map<String,Object> mc = new HashedMap();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
            String date = sdf.format(dd.getTime());
            mc.put("month",date);
            mc.put("count",0);
            dd.add(Calendar.MONTH,-1);
            rs.add(mc);
        String startTime ="";
        String endTime = "";
        //六个月前的开始时间
        Date startDate = DateUtil.getNextMonthReturnDate(endDate,-6);
        startDate = DateUtil.getDateShort(startDate);
        if (interval==1){
            sql = "SELECT count(1) AS count,LEFT(p.create_time,10) date  FROM wlyy_prescription p ";
            rs = DateUtil.findDates(startDate,endDate);
            //加入当天数据
            Map<String,Object> dateMap = new HashedMap();
            dateMap.put("date",sdf.format(endDate));
            dateMap.put("count", 0.0D);
            rs.add(dateMap);
            startTime = DateUtil.dateToStr(startDate, "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
        }
        if (interval==2){
            sql = "SELECT count(1) AS count,LEFT(date_sub(p.create_time,INTERVAL WEEKDAY(p.create_time) +0 DAY),10) date  FROM wlyy_prescription p ";
            rs = DateUtil.findDateASWeeks(startDate,endDate);
            String MondayWeekDateStr = DateUtil.getMondayOfThisDate(startDate);
            Date MondayWeekDate = DateUtil.strToDate(MondayWeekDateStr,"yyyy-MM-dd");
            if (startDate.after(MondayWeekDate)){
                //开始时间不是当周的周一,则加入本周周一的时间
                Map<String,Object> dateMap = new HashedMap();
                dateMap.put("date",MondayWeekDateStr);
                dateMap.put("count", 0.0D);
                rs.add(0,dateMap);
            }
            startTime = DateUtil.dateToStr(startDate, "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
        }else if (interval==3){
            sql = "SELECT count(1) AS count,LEFT(p.create_time,7) AS month  FROM wlyy_prescription p ";
            for (int i = 1; i < 7; i++) {
                Map<String, Object> mc = new HashedMap();
                SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM");
                String date = sdf2.format(dd.getTime());
                mc.put("month", date);
                mc.put("count", 0.0D);
                dd.add(Calendar.MONTH, -1);
                rs.add(mc);
            }
            startTime = DateUtil.dateToStr(dd.getTime(), "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(new Date(), "YYYY-MM-dd HH:mm:ss");
        }
        }
        String sql = "SELECT count(1) AS count,LEFT(p.create_time,7) AS month " +
                " FROM wlyy_prescription p ";
        if(StringUtils.isNotBlank(disease)){
        if(StringUtils.isNotBlank(disease)){
            sql += " JOIN wlyy_prescription_diagnosis d ON d.prescription_code = p.code WHERE d.health_problem ='"+disease+"' ";
            sql += " JOIN wlyy_prescription_diagnosis d ON d.prescription_code = p.code WHERE d.health_problem ='"+disease+"' ";
        }else{
        }else{
@ -5152,17 +5188,32 @@ public class StatisticsService extends BaseService {
            sql +=" AND p.`status` <='"+PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue()+"'";
            sql +=" AND p.`status` <='"+PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue()+"'";
        }
        }
        sql += " AND p.create_time >='"+DateUtil.dateToStr(dd.getTime(),"YYYY-MM-dd HH:mm:ss")+"' AND p.create_time <='"+ DateUtil.dateToStr(new Date(),"YYYY-MM-dd HH:mm:ss")+"'  GROUP BY LEFT(p.create_time,7) ";
        //增加时间维度
        if(interval==1){
            sql += " AND p.create_time >='"+startTime+"' AND p.create_time <='"+ endTime+"'  GROUP BY LEFT(p.create_time,10) ";
        }else if (interval==2){
            sql += " AND p.create_time >='"+startTime+"' AND p.create_time <='"+ endTime+"'  GROUP BY DATE_FORMAT(p.create_time, '%v %x') ";
        }else if (interval==3){
            sql += " AND p.create_time >='"+startTime+"' AND p.create_time <='"+ endTime+"'  GROUP BY LEFT(p.create_time,7) ";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for(Map<String,Object> m:rs){
        for(Map<String,Object> m:rs){
            Iterator iterator = list.iterator();
            Iterator iterator = list.iterator();
            String key = "";
            String keyDb = "";
            while (iterator.hasNext()){
            while (iterator.hasNext()){
                Map<String,Object> ml = ( Map<String,Object>)iterator.next();
                Map<String,Object> ml = ( Map<String,Object>)iterator.next();
                String monthKey = (String)m.get("month");
                String monthKeyDb = (String)ml.get("month");
                if(monthKey.equals(monthKeyDb)){
                if (interval!=3){
                    key = (String)m.get("date");
                    keyDb = (String)ml.get("date");
                }else{
                    key = (String)m.get("month");
                    keyDb = (String)ml.get("month");
                }
                if(key.equals(keyDb)){
                    m.put("count",ml.get("count"));
                    m.put("count",ml.get("count"));
                }
                }
            }
            }

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -3931,6 +3931,7 @@ public class StatisticsESService {
        dd.setTime(endDate);
        dd.setTime(endDate);
        //六个月前的开始时间
        //六个月前的开始时间
        Date startDate = DateUtil.getNextMonthReturnDate(endDate,-6);
        Date startDate = DateUtil.getNextMonthReturnDate(endDate,-6);
        startDate = DateUtil.getDateShort(startDate);
        if (interval==1){
        if (interval==1){
            rs = DateUtil.findDates(startDate,endDate);
            rs = DateUtil.findDates(startDate,endDate);
            //加入当天数据
            //加入当天数据
@ -3939,12 +3940,14 @@ public class StatisticsESService {
            dateMap.put("avg",0);
            dateMap.put("avg",0);
            dateMap.put("count", 0.0D);
            dateMap.put("count", 0.0D);
            rs.add(dateMap);
            rs.add(dateMap);
            startTime = dateFormat.format(startDate);
            endTime = dateFormat.format(endDate);
        }
        }
        if (interval==2){
        if (interval==2){
            rs = DateUtil.findDateASWeeks(startDate,endDate);
            rs = DateUtil.findDateASWeeks(startDate,endDate);
            String MondayWeekDateStr = DateUtil.getMondayOfThisDate(startDate);
            String MondayWeekDateStr = DateUtil.getMondayOfThisDate(startDate);
            Date MondayWeekDate = dateFormat.parse(MondayWeekDateStr);
            if (startDate.compareTo(MondayWeekDate)==1){
            Date MondayWeekDate = dateFormat3.parse(MondayWeekDateStr);
            if (startDate.after(MondayWeekDate)){
                //开始时间不是当周的周一,则加入本周周一的时间
                //开始时间不是当周的周一,则加入本周周一的时间
                Map<String,Object> dateMap = new HashedMap();
                Map<String,Object> dateMap = new HashedMap();
                dateMap.put("date",MondayWeekDateStr);
                dateMap.put("date",MondayWeekDateStr);

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -1152,4 +1152,15 @@ public class DateUtil {
		c.add(Calendar.DATE, -day_of_week + 7);
		c.add(Calendar.DATE, -day_of_week + 7);
		return df2.format(c.getTime());
		return df2.format(c.getTime());
	}
	}
	/**
	 * 获取某个时间
	 *
	 * @return返回短时间格式 yyyy-MM-dd
	 */
	public static Date getDateShort(Date date) {
		SimpleDateFormat formatter = new SimpleDateFormat(YYYY_MM_DD);
		String dateString = formatter.format(date);
		return strToDate(dateString, YYYY_MM_DD);
	}
}
}

+ 36 - 30
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -104,6 +104,7 @@ public class PatientDeviceController extends BaseController {
                               @RequestParam(required = false) String afterDinnerEnd,
                               @RequestParam(required = false) String afterDinnerEnd,
                               @RequestParam(required = false) String beforeSleepStart,
                               @RequestParam(required = false) String beforeSleepStart,
                               @RequestParam(required = false) String beforeSleepEnd,
                               @RequestParam(required = false) String beforeSleepEnd,
                               @RequestParam(required = false) String sim,
                               @RequestParam String deviceSN,
                               @RequestParam String deviceSN,
                               @RequestParam String categoryCode,
                               @RequestParam String categoryCode,
                               @RequestParam String userType,
                               @RequestParam String userType,
@ -115,43 +116,48 @@ public class PatientDeviceController extends BaseController {
            if (StringUtils.isNotEmpty(newDeviceSN)) {
            if (StringUtils.isNotEmpty(newDeviceSN)) {
//                校验新的sn码 1.是否被占用 2.是否是真的设备码
//                校验新的sn码 1.是否被占用 2.是否是真的设备码
                PatientDevice device = patientDeviceDao.findByDeviceSnAndUserType(newDeviceSN, userType);
                if (device != null) {
                    throw new Exception("sn码" + newDeviceSN + "已被使用!");
                }
                if(!newDeviceSN.equals(deviceSN)){
                    //有改sn码
                    PatientDevice device = patientDeviceDao.findByDeviceSnAndUserType(newDeviceSN, userType);
                    if (device != null) {
                        throw new Exception("sn码" + newDeviceSN + "已被使用!");
                    }
                    //注册设备
                    Map<String, String> params = new HashMap<>();
                    params.put("deviceSn", newDeviceSN);
                //注册设备
                Map<String, String> params = new HashMap<>();
                params.put("deviceSn", newDeviceSN);
                    //调用服务
                    String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
                    System.out.println("注册设备=" + response);
                    JSONObject json = new JSONObject(response);
                    String code = json.get("Code").toString();
                    //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
                    if ("10000".equals(code) || "10001".equals(code)) {
                //调用服务
                String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
                System.out.println("注册设备=" + response);
                JSONObject json = new JSONObject(response);
                String code = json.get("Code").toString();
                //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
                if ("10000".equals(code) || "10001".equals(code)) {
                    if ("1".equals(categoryCode)) {
                    } else {
                        String message = json.get("Message").toString();
                        return error(-1,message);
                    }
                }
                if ("1".equals(categoryCode)) {
//                        先修改患者设备绑定表
//                        先修改患者设备绑定表
                        int rows = patientDeviceService.updatePatientDevice(user, deviceSN, newDeviceSN,userType);
                        if (rows != 0) {
                            //                只更换设备编码,不更改时间值
                    int rows = patientDeviceService.updatePatientDevice(user, deviceSN, newDeviceSN,userType,sim);
                    if (rows != 0) {
                        //                只更换设备编码,不更改时间值
//                1.先查询是否自定义时间段,没有则新增,有则修改
//                1.先查询是否自定义时间段,没有则新增,有则修改
                            PatientHealthTime healthTime = patientHealthTimeDao.findByUserAndSN(user, deviceSN);
                            if (healthTime == null) {
                                patientDeviceService.setBloodTime(user, newDeviceSN, "null", "null", "null", "null", "null", "null",
                                        "null", "null", "null", "null", "null", "null", "null", "null");
                            } else {
                                patientDeviceService.updateDeviceSN(user, deviceSN, newDeviceSN);
                            }
                        PatientHealthTime healthTime = patientHealthTimeDao.findByUserAndSN(user, deviceSN);
                        if (healthTime == null) {
                            patientDeviceService.setBloodTime(user, newDeviceSN, "null", "null", "null", "null", "null", "null",
                                    "null", "null", "null", "null", "null", "null", "null", "null");
                        } else {
                            patientDeviceService.updateDeviceSN(user, deviceSN, newDeviceSN);
                        }
                        }
                    }else {
                        int rows = patientDeviceService.updatePatientDevice(user, deviceSN, newDeviceSN,userType);
                    }
                    }
                } else {
                    String message = json.get("Message").toString();
                    throw new Exception(message);
                }else {
                    int rows = patientDeviceService.updatePatientDevice(user, deviceSN, newDeviceSN,userType,sim);
                }
                }
                return write(200, "更改sv码成功!");
                return write(200, "更改sv码成功!");
            }
            }
            patientDeviceService.setBloodTime(user, deviceSN, fastingStart, fastingEnd, afterBreakfastStart, afterBreakfastEnd, beforeLunchStart, beforeLunchEnd,
            patientDeviceService.setBloodTime(user, deviceSN, fastingStart, fastingEnd, afterBreakfastStart, afterBreakfastEnd, beforeLunchStart, beforeLunchEnd,

+ 23 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -499,7 +499,6 @@ public class EsStatisticsController extends BaseController {
                    if ("13".equals(idx)){
                    if ("13".equals(idx)){
                        idx="1";
                        idx="1";
                    }
                    }
//                    JSONObject json = statisticsAllService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode,year);
                    JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year);
                    JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year);
                    result.put("index_" + idx, json);
                    result.put("index_" + idx, json);
                }
                }
@ -1737,10 +1736,11 @@ public class EsStatisticsController extends BaseController {
    public String getPrescriptionTotalHistogram(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
    public String getPrescriptionTotalHistogram(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                                @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,
                                                @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,
                                                @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
                                                @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
                                                @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
                                                @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type,
                                                @ApiParam(name="interval",value ="时间类型:1日2周3月")@RequestParam(required = false,defaultValue = "1")int interval){
        try{
        try{
            return write(200, "查询成功", "data", statisticsService.getPrescriptionTotalHistogram(level,area,disease,type));
            return write(200, "查询成功", "data", statisticsService.getPrescriptionTotalHistogram(level,area,disease,type,interval));
           // return write(200, "查询成功", "data", statisticsESService.getPrescriptionTotalHistogram(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease,type));
           // return write(200, "查询成功", "data", statisticsESService.getPrescriptionTotalHistogram(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease,type));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
@ -1872,7 +1872,7 @@ public class EsStatisticsController extends BaseController {
    /*==================================版本1.4.1统计优化开始start=====================================*/
    /*==================================版本1.4.1统计优化开始start=====================================*/
    /**
    /**
     * 获取签约率、签约完成率 续签率
     * 获取签约率、线上签约率
     *
     *
     * @param endDate 截止日期
     * @param endDate 截止日期
     * @param area    区域
     * @param area    区域
@ -2064,5 +2064,24 @@ public class EsStatisticsController extends BaseController {
            return error(-1, "查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
    /**
     *
     * @param interval
     * @param date
     * @param disease
     * @param type
     * @return
     */
    @RequestMapping("/getPrescriptionTotalDetailTime")
    @ResponseBody
    @ApiOperation("订单统计-点击柱状图获取详情")
    public String getPrescriptionTotalDetailTime(
            @RequestParam(required = true)int interval,
            @RequestParam(required = true)String date,
            @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
            @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
        return "";
    }
    /*==================================版本1.4.1统计优化结束 end=====================================*/
    /*==================================版本1.4.1统计优化结束 end=====================================*/
}
}

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

@ -1699,7 +1699,7 @@ public class StatisticsController extends BaseController {
                                                @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
                                                @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
                                                @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
                                                @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
        try{
        try{
            return write(200, "查询成功", "data", statisticsService.getPrescriptionTotalHistogram(level,area,disease,type));
            return write(200, "查询成功", "data", statisticsService.getPrescriptionTotalHistogram(level,area,disease,type,3));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败");
            return error(-1, "查询失败");