Переглянути джерело

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

zd_123 7 роки тому
батько
коміт
2704447e60
20 змінених файлів з 292 додано та 119 видалено
  1. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionPay.java
  2. 4 4
      edu-article/JkEdu/WebRoot/WEB-INF/classes/Article.sql.xml
  3. 1 1
      edu-article/JkEdu/WebRoot/WEB-INF/classes/articlePc.sql.xml
  4. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  5. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class
  6. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/BehaviorApi.class
  7. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  8. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class
  9. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/OrgArticleVo.class
  10. 2 2
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  11. 2 2
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java
  12. 47 34
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  13. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionPay.java
  14. 2 2
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp
  15. 48 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/prescription/PrescriptionPay.java
  16. 96 37
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  17. 43 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java
  18. 37 29
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  19. 5 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  20. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionPay.java

@ -17,7 +17,7 @@ public class PrescriptionPay extends IdEntity {
    private String code;//接入应用业务流水号outChargeNo
    private String prescriptionCode;//开处方的医生code 关联 wlyy_prescription
    private Integer type;//1 医保支付
    private Integer type;//1 医保支付 2基卫线下支付
    private Date outChargeTime;//接入应用时间
    private String channel;//支付方式
    private String chargeNo;//支付平台流水号

+ 4 - 4
edu-article/JkEdu/WebRoot/WEB-INF/classes/Article.sql.xml

@ -3,8 +3,8 @@
	<Sqls>
		<Sql name='getArticleList'>
			<![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  from Org_Article m
LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
		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, IFNULL(n.PushNumber,0) as PushNumber
		from Org_Article m JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
		
			]]>
		</Sql>
@ -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/WebRoot/WEB-INF/classes/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>

BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/BehaviorApi.class


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


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/ArticleStatistic.class


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/vo/OrgArticleVo.class


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

@ -622,7 +622,7 @@ public class ArticleApi {
		System.out.printf("OrgArticleVo参数:"+vo.toString());
		try {
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			com.common.json.JSONObject result = dao.queryArticlePcList(vo, page, pageSize,userCode);
			com.common.json.JSONObject result = dao.queryArticlePcList(vo, page, pageSize,userCode,isMyArticle);
//			array.addAll(list);
//			int count = dao.queryArticlePcListCount(vo);
//			rv.put("Result", array);
@ -683,7 +683,7 @@ public class ArticleApi {
		JSONArray array = new JSONArray();
		try {
			JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
			List<Article> result = dao.queryArticleAPPList(vo, page, pageSize,userCode);
			List<Article> result = dao.queryArticleAPPList(vo, page, pageSize,userCode,isMyArticle);
			array.addAll(result);
//			int count = dao.queryArticlePcListCount(vo);
//			rv.put("Result", array);

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

@ -34,7 +34,7 @@ public class ArticleApiTest {
		// System.out.println(api.getCollectionArticalList(im));
		// System.out.println(api.getArticalById(im));
		saveBehavior();
		queryArticlePcList();
//		System.out.printf("350200".substring(0,3));
	}
@ -79,7 +79,7 @@ public class ArticleApiTest {
		obj.put("pageSize","9");
		obj.put("currentUserRoleLevel",2);//
		obj.put("sEcho","1");
		obj.put("articleTitle","健管师");
//		obj.put("articleTitle","健管师");
		im.setParam(obj.toString());
		initDB();
		try{

+ 47 - 34
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -545,7 +545,7 @@ public class ArticleDao {
	 * @return
	 * @throws Exception
	 */
	public JSONObject queryArticlePcList(OrgArticleVo vo, int start, int pageSize,String userCode) throws Exception {
	public JSONObject queryArticlePcList(OrgArticleVo vo, int start, int pageSize,String userCode,Boolean isMyArticle) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		StringBuffer param = new StringBuffer();
@ -565,26 +565,31 @@ public class ArticleDao {
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			int roleLevel = Integer.valueOf(vo.getOperatorRoleLevel())-1;
			String temp = "";
			for(int i=1;i<roleLevel;i++){//123
			for(int i=1;i<=roleLevel;i++){//123
				switch(i){
					case 1:{temp+=" or UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,4)+"00 "):vo.getOperatorRoleCode())+"'";break;}
					case 2:{temp+=" or UserScope = 2 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"'";break;}
					case 3:{temp+=" or UserScope = 3 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"'";break;}
					case 1:{
						temp+=" or (UserScope = 1 and OperatorRoleCode like '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,4)):vo.getOperatorRoleCode())+"%')";
//						temp+=" or (UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"')";
//						temp+=" or (UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";
						break;}
					case 2:{
						temp+=" or (UserScope = 2 and OperatorRoleCode like '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"%')";
//						temp+=" or (UserScope = 2 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";
						break;}
					case 3:{temp+=" or (UserScope = 3 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";break;}
				}
			}
			if(!StringUtils.isEmpty(temp)){
				param3.append(temp.substring(3));
				param3.append("  or (UserScope = ? and OperatorRoleCode =?) ");
			}else{
				param3.append("  (UserScope = ? and OperatorRoleCode =?) ");
			}
			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
			sql.addParamValue(vo.getOperatorRoleCode());
		}else{
			param3.append(" UserScope <= 3 ");
//
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+")");
			param3.append(temp.substring(3));
//			if(!StringUtils.isEmpty(temp)){
//				param3.append(temp.substring(3));
//				param3.append("  or (UserScope = ? and OperatorRoleCode =?) ");
//			}else{
//				param3.append("  (UserScope = ? and OperatorRoleCode =?) ");
//			}
//			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
//			sql.addParamValue(vo.getOperatorRoleCode());
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+" and OperatorRoleCode = "+vo.getOperatorRoleCode()+")");
		if("1".equals(vo.getOperatorRoleLevel())){//省
//			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
@ -600,7 +605,7 @@ public class ArticleDao {
		param3.append(" or (OperatorRoleLevel= "+vo.getOperatorRoleLevel()+" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"' ) ");
		param.append("and ("+param3.toString()+")");
		if(vo.getRoleType()!=null) {
		if(isMyArticle&&vo.getRoleType()!=null) {
			param.append(" and RoleType = ? ");
			sql.addParamValue(vo.getRoleType().intValue());
		}
@ -672,7 +677,7 @@ public class ArticleDao {
	 * @return
	 * @throws Exception
	 */
	public List<Article> queryArticleAPPList(OrgArticleVo vo, int start, int pageSize,String userCode) throws Exception {
	public List<Article> queryArticleAPPList(OrgArticleVo vo, int start, int pageSize,String userCode,Boolean isMyArticle) throws Exception {
		Sql sql = DB.me().createSql(ArticleSqlNameEnum.getArticlePcList);
		StringBuffer param = new StringBuffer();
@ -689,23 +694,31 @@ public class ArticleDao {
		if(StringUtil.isNotEmpty(vo.getOperatorRoleLevel())){
			int roleLevel = Integer.valueOf(vo.getOperatorRoleLevel())-1;
			String temp = "";
			for(int i=1;i<roleLevel;i++){//123
			for(int i=1;i<=roleLevel;i++){//123
				switch(i){
					case 1:{temp+=" or (UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,4)+"00 "):vo.getOperatorRoleCode())+"')";break;}
					case 2:{temp+=" or (UserScope = 2 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"')";break;}
					case 1:{
						temp+=" or (UserScope = 1 and OperatorRoleCode like '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,4)):vo.getOperatorRoleCode())+"%')";
//						temp+=" or (UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"')";
//						temp+=" or (UserScope = 1 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";
						break;}
					case 2:{
						temp+=" or (UserScope = 2 and OperatorRoleCode like '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode().substring(0,6)):vo.getOperatorRoleCode())+"%')";
//						temp+=" or (UserScope = 2 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";
						break;}
					case 3:{temp+=" or (UserScope = 3 and OperatorRoleCode = '"+(vo.getOperatorRoleCode().length()<=10?(vo.getOperatorRoleCode()):vo.getOperatorRoleCode())+"')";break;}
				}
			}
			if(!StringUtils.isEmpty(temp)){
				param3.append(temp.substring(3));
				param3.append("  or (UserScope = ? and OperatorRoleCode =?) ");
			}else{
				param3.append("  (UserScope = ? and OperatorRoleCode =?) ");
			}
			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
			sql.addParamValue(vo.getOperatorRoleCode());
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+")");
			param3.append(temp.substring(3));
//			if(!StringUtils.isEmpty(temp)){
//				param3.append(temp.substring(3));
//				param3.append("  or (UserScope = ? and OperatorRoleCode =?) ");
//			}else{
//				param3.append("  (UserScope = ? and OperatorRoleCode =?) ");
//			}
//			sql.addParamValue(Integer.valueOf(vo.getOperatorRoleLevel())-1);
//			sql.addParamValue(vo.getOperatorRoleCode());
		}
		param3.append(" or  ( OperatorId='"+userCode+"' and UserScope=4 "+(vo.getRoleType()!=null?" and RoleType = "+vo.getRoleType().intValue():"")+" and OperatorRoleCode = "+vo.getOperatorRoleCode()+")");
		if("1".equals(vo.getOperatorRoleLevel())){//省
//			param.append(" and OperatorRoleCode like '"+vo.getOperatorRoleCode().substring(0,3)+"%' ");
		}else if("2".equals(vo.getOperatorRoleLevel())){//市
@ -721,7 +734,7 @@ public class ArticleDao {
		param3.append(" or (OperatorRoleLevel= "+vo.getOperatorRoleLevel()+" and OperatorRoleCode = '"+vo.getOperatorRoleCode()+"' ) ");
		param.append("and ("+param3.toString()+")");
		if(vo.getRoleType()!=null) {
		if(isMyArticle&&vo.getRoleType()!=null) {
			param.append(" and RoleType = ? ");
			sql.addParamValue(vo.getRoleType().intValue());
		}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/prescription/PrescriptionPay.java

@ -17,7 +17,7 @@ public class PrescriptionPay extends IdEntity {
	
	private String code;//接入应用业务流水号outChargeNo
	private String prescriptionCode;//开处方的医生code 关联 wlyy_prescription
	private Integer type;//1 医保支付
	private Integer type;//1 医保支付 2基卫线下支付
	private Date outChargeTime;//接入应用时间
	private String channel;//支付方式
	private String chargeNo;//支付平台流水号

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp

@ -219,7 +219,7 @@
					</sec:authorize>
					<%-- 意见反馈--%>
					<sec:authorize url="/admin/message/center">
					<sec:authorize url="/admin/feedback/center">
					<div class="a-divider"></div>
					<div class="a-menu">
						<div class="a-menu-tit"><i class="icons icons-aside-2 icons-24 mr15"></i>申诉反馈</div>
@ -232,7 +232,7 @@
								<sec:authorize url="/admin/appeal/initial">
									<li><a href="javascript:locationMenu('appeal');">账号申诉</a></li>
								</sec:authorize>
								<sec:authorize url="/admin/message/center">
								<sec:authorize url="/admin/feedback/center">
							</ul>
						</div>
					</div>

+ 48 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/prescription/PrescriptionPay.java

@ -17,7 +17,7 @@ public class PrescriptionPay extends IdEntity {
    private String code;//接入应用业务流水号outChargeNo
    private String prescriptionCode;//开处方的医生code 关联 wlyy_prescription
    private Integer type;//1 医保支付
    private Integer type;//1 医保支付 2基卫线下支付
    private Date outChargeTime;//接入应用时间
    private String channel;//支付方式
    private String chargeNo;//支付平台流水号
@ -58,6 +58,53 @@ public class PrescriptionPay extends IdEntity {
    private String mxlist;//处方明细
    private Date createTime;//续方确认支付时间
    private Date czrq;//续方记录最后操作时间
    //    易联众新增查询返回字段v1.3.7
    private String medOrgNo;//医疗机构编号
    private String medOrgName;//医疗机构名称
    private Date traceTime;//交易成功时间
    private String traceNo;//支付平台跟踪号
    private String principalCardNo;//实际签约卡号
    public String getMedOrgNo() {
        return medOrgNo;
    }
    public void setMedOrgNo(String medOrgNo) {
        this.medOrgNo = medOrgNo;
    }
    public String getMedOrgName() {
        return medOrgName;
    }
    public void setMedOrgName(String medOrgName) {
        this.medOrgName = medOrgName;
    }
    public Date getTraceTime() {
        return traceTime;
    }
    public void setTraceTime(Date traceTime) {
        this.traceTime = traceTime;
    }
    public String getTraceNo() {
        return traceNo;
    }
    public void setTraceNo(String traceNo) {
        this.traceNo = traceNo;
    }
    public String getPrincipalCardNo() {
        return principalCardNo;
    }
    public void setPrincipalCardNo(String principalCardNo) {
        this.principalCardNo = principalCardNo;
    }
    public Integer getAccountBalance() {
        return accountBalance;

+ 96 - 37
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -28,6 +28,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -1243,23 +1244,79 @@ public class PrescriptionService extends ZysoftBaseService{
        String errMsg = null;
        try{
            JSONObject json = JSONObject.parseObject(data);
            Integer code = json.getInteger("CODE");
            Integer code = json.getInteger("code");
            if(code==1){
                String orderNo = json.getString("ORDER_NO");//挂号编号
                String recipeNo = json.getString("RECIPE_NO");//处方编号
                String orderNo = json.getString("orderNo");//挂号编号
                String recipeNo = json.getString("recipeNo");//处方编号
            
                Prescription prescription = prescriptionDao.findByVisitNoAndRecipeNo(orderNo,recipeNo);
                if(prescription.getStatus().equals(PrescriptionLog.PrescriptionLogStatus.pay_success.getValue())){
                
                    if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
                    } else{
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                    }
                
                    prescription.setJwPayStatus(1);//0为未结算,1为结算成功,默认为0
                    prescription.setDrugDeliveryTime(new Date());
                    prescriptionDao.save(prescription);
                
                    //新增基卫线下支付记录
                    PrescriptionPay pay = new PrescriptionPay();
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    String uuid = sdf.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4);
                    pay.setCode(uuid); //接入应用业务流水号outChargeNo
                    pay.setPrescriptionCode(prescription.getCode());//开处方的医生code 关联 wlyy_prescription
                    pay.setType(2);//1 医保支付 2基卫线下支付
                    pay.setOutChargeTime(json.containsKey("outChargeTime")?format.parse(json.getString("outChargeTime")):null);//支付日期
                    pay.setChannel("offline");//支付方式
                    pay.setChargeNo(json.containsKey("chargeNo")?json.getString("chargeNo"):null);//支付平台流水号
                    pay.setChargeTime(json.containsKey("chargeTime")?format.parse(json.getString("chargeTime")):null);//支付平台交易成功时间
                    pay.setBillNo(json.containsKey("billNo")?json.getString("billNo"):null);//待结算费用单据号
                    pay.setCardNo(json.containsKey("cardNo")?json.getString("cardNo"):null);//医保卡号
                    pay.setTotalAmount(json.containsKey("totalAmount")?json.getInteger("totalAmount"):null);//交易总金额
                    pay.setInsuranceAmount(json.containsKey("insuranceAmount")?json.getInteger("insuranceAmount"):null);//医保支付金额
                    pay.setSelfPayAmount(json.containsKey("selfPayAmount")?json.getInteger("selfPayAmount"):null);//自付金额
                    pay.setOpenid(null);//用户openID
                    pay.setUserName(json.containsKey("userName")?json.getString("userName"):null);//用户名字
                    pay.setIdType("01"); //证件类型
                    pay.setIdNo(json.containsKey("idNo")?json.getString("idNo"):null);//证件号码
                    pay.setTradeStatus("1");//交易状态
                    pay.setMiSettleNo(json.containsKey("miSettleNo")?json.getString("miSettleNo"):null);//医保收费单据号
                    pay.setMiRegisterNo(json.containsKey("miRegisterNo")?json.getString("miRegisterNo"):null); //医保挂号
                    pay.setMiCollectDate(json.containsKey("miCollectDate")?format.parse(json.getString("miCollectDate")):null);//收费日期
                    pay.setMiCollectTime(json.containsKey("miCollectTime")?format.parse(json.getString("miCollectTime")):null);//收费时间
                    pay.setMiCollectorName(json.containsKey("miCollectorName")?json.getString("miCollectorName"):null);//收费人姓名
                    pay.setMiTotalFee(json.containsKey("miTotalFee")?json.getInteger("miTotalFee"):null);//本次报销总额
                    pay.setSelfPay(json.containsKey("selfPay")?json.getInteger("selfPay"):null);//个人现金支付
                    pay.setAccountPay(json.containsKey("accountPay")?json.getInteger("accountPay"):null);//个人账户支付
                    pay.setHeathPay(json.containsKey("heathPay")?json.getInteger("heathPay"):null);//健康账户支付
                    pay.setCadresPay(json.containsKey("cadresPay")?json.getInteger("cadresPay"):null);//公务员补助
                    pay.setFundPay(json.containsKey("fundPay")?json.getInteger("fundPay"):null);//基金支付
                    pay.setHealthCarePay(json.containsKey("healthCarePay")?json.getInteger("healthCarePay"):null);//保健基金支付
                    pay.setCommercePay(json.containsKey("commercePay")?json.getInteger("commercePay"):null);//商业保险支付
                    pay.setFamilyPay(json.containsKey("familyPay")?json.getInteger("familyPay"):null);//共济账户支付
                    pay.setCivilPay(json.containsKey("civilPay")?json.getInteger("civilPay"):null);//民政补助金额
                    pay.setCivilZone(json.containsKey("civilZone")?json.getString("civilZone"):null);//民政行政区号
                    pay.setBdrugPay(json.containsKey("bdrugPay")?json.getInteger("bdrugPay"):null);//乙类支付金额
                    pay.setUnlessAmount(json.containsKey("unlessAmount")?json.getInteger("unlessAmount"):null);//非医保费用
                    pay.setExceedAmount(json.containsKey("exceedAmount")?json.getInteger("exceedAmount"):null);//超封顶线金额
                    pay.setAccountBalance(json.containsKey("accountBalance")?json.getInteger("accountBalance"):null);//个人账户余额
                    pay.setHealthBalance(json.containsKey("healthBalance")?json.getInteger("healthBalance"):null);//健康账户余额
                    pay.setRecipeContent(json.containsKey("recipeContent")?json.getString("recipeContent"):null);//处方主信息
                    pay.setZdlist(json.containsKey("zdlist")?json.getString("zdlist"):null);//诊断明细
                    pay.setMxlist(json.containsKey("mxlist")?json.getString("mxlist"):null);//处方明细
                    pay.setCreateTime(new Date());//续方确认支付时间
                    pay.setCzrq(new Date());//续方记录最后操作时间
                    //    易联众新增查询返回字段v1.3.7
                    pay.setMedOrgNo(json.containsKey("medOrgNo")?json.getString("medOrgNo"):null);//医疗机构编号
                    pay.setMedOrgName(json.containsKey("medOrgName")?json.getString("medOrgName"):null);//医疗机构名称
                    pay.setTraceTime(json.containsKey("traceTime")?format.parse(json.getString("traceTime")):null);//交易成功时间
                    pay.setTraceNo(json.containsKey("traceNo")?json.getString("traceNo"):null);//支付平台跟踪号
                    pay.setPrincipalCardNo(json.containsKey("cardNo")?json.getString("cardNo"):null);//实际签约卡号
                    prescriptionPayDao.save(pay);
                    //新增log表
                    PrescriptionLog log = new PrescriptionLog();
                    log.setPrescriptionCode(prescription.getCode());
@ -1278,42 +1335,44 @@ public class PrescriptionService extends ZysoftBaseService{
                        prescriptionLogDao.save(log);
                    } else{
                        log.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                        log.setRemark("配药成功");
                        log.setRemark("等待领药");
                        prescriptionLogDao.save(log);
                    
                        //健管师配送
                        PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(prescription.getCode());
                        if(StringUtils.isNotBlank(expressage.getExpressageCode())){
                            Message message = new Message();
                            message.setCzrq(new Date());
                            message.setCreateTime(new Date());
                            message.setRead(1);//设置未读
                            message.setOver("1");
                            message.setReceiver(expressage.getExpressageCode());
                            message.setSender("system");
                            message.setCode(getCode());
                            message.setSenderName("系统");
                            message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
                            message.setContent("您有一条新的续方订单待取药!");
                            message.setType(7);//续方订单待取药
                            message.setReadonly(1);//是否只读消息
                            message.setDel("1");
                            message.setRelationCode(prescription.getCode());
                            message.setPrescriptionStatus("0");//待取药
                            message.setData(prescription.getAdminTeamId()+"");
                            messageDao.save(message);
                        }
                    
                        //判断提示健管师有续方代配送,居民待取药
                        JSONObject message = new JSONObject();
                        message.put("title","dispensingComplete");
                        message.put("state",1);
                        message.put("prescription",prescription.getCode());
                        message.put("mes","success");
                        if(3 == prescription.getDispensaryType()){//健管师配送
                            PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(prescription.getCode());
                            if(StringUtils.isNotBlank(expressage.getExpressageCode())){
                                Message message = new Message();
                                message.setCzrq(new Date());
                                message.setCreateTime(new Date());
                                message.setRead(1);//设置未读
                                message.setOver("1");
                                message.setReceiver(expressage.getExpressageCode());
                                message.setSender("system");
                                message.setCode(getCode());
                                message.setSenderName("系统");
                                message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
                                message.setContent("您有一条新的续方订单待取药!");
                                message.setType(7);//续方订单待取药
                                message.setReadonly(1);//是否只读消息
                                message.setDel("1");
                                message.setRelationCode(prescription.getCode());
                                message.setPrescriptionStatus("0");//待取药
                                message.setData(prescription.getAdminTeamId()+"");
                                messageDao.save(message);
                            }
                            //判断提示健管师有续方代配送,居民待取药
                            JSONObject message = new JSONObject();
                            message.put("title","dispensingComplete");
                            message.put("state",1);
                            message.put("prescription",prescription.getCode());
                            message.put("mes","success");
//                redisTemplate.convertAndSend(channelTopic,message.toString());
//                redisTemplate.watch(channelTopic);
                        redisTemplate.opsForList().leftPush(channelTopic,message.toString());
                            redisTemplate.opsForList().leftPush(channelTopic,message.toString());
//                redisTemplate.unwatch();
                        }
                    }
                
                }else {

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

@ -21,6 +21,8 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.util.Date;
import java.util.List;
/**
 * Created by chenweida on 2017/9/9.
@ -45,8 +47,48 @@ public class HealthArtListener implements MessageListener {
    public void onMessage(Message message) {
        try {
            TextMessage textMessage = (TextMessage) message;
            HealthEduArticleES healthEduArticleES = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticleES.class);
            HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
            JSONObject obj = JSONObject.fromObject(textMessage.getText());
            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);
            healthEduArticleES.setDoctorCode(obj.get("doctorCode")!=null?obj.get("doctorCode").toString():null);
            healthEduArticleES.setDoctorName(obj.get("doctorName")!=null?obj.get("doctorName").toString():null);
            healthEduArticleES.setSendPic(obj.get("sendPic")!=null?obj.get("sendPic").toString():null);
            healthEduArticleES.setSendSex(obj.get("sendSex")!=null?obj.get("sendSex").toString():null);
//            healthEduArticleES.setAdminTeamCode(obj.get("adminTeamCode")!=null?(Long)obj.get("adminTeamCode"):null);
//            healthEduArticleES.setAdminTeamName(obj.get("adminTeamName")!=null?obj.get("adminTeamCode").toString():null);
            healthEduArticleES.setHospital(obj.get("hospital")!=null?obj.get("hospital").toString():null);
            healthEduArticleES.setHospitalName(obj.get("hospitalName")!=null?obj.get("hospitalName").toString():null);
            healthEduArticleES.setTown(obj.get("town")!=null?obj.get("town").toString():null);
            healthEduArticleES.setTownName(obj.get("townName")!=null?obj.get("townName").toString():null);
//            healthEduArticleES.setCreateTime(obj.get("createTime")!=null?(Date)obj.get("createTime"):null);
            healthEduArticleES.setSendType(obj.get("sendType")!=null?(Integer)obj.get("sendType"):null);
            healthEduArticleES.setSendLevel(obj.get("sendLevel")!=null?obj.get("sendLevel").toString():null);
            healthEduArticleES.setArticleId(obj.get("articleId")!=null?obj.get("articleId").toString():null);
            healthEduArticleES.setArticleTitle(obj.get("articleTitle")!=null?obj.get("articleTitle").toString():null);
            healthEduArticleES.setArticleCover(obj.get("articleCover")!=null?obj.get("articleCover").toString():null);
            healthEduArticleES.setArticleContent(obj.get("articleContent")!=null?obj.get("articleContent").toString():null);
            healthEduArticleES.setArticleCategoryId(obj.get("articleCategoryId")!=null?obj.get("articleCategoryId").toString():null);
            healthEduArticleES.setFirstLevelCategoryId(obj.get("firstLevelCategoryId")!=null?obj.get("firstLevelCategoryId").toString():null);
            healthEduArticleES.setFirstLevelCategoryName(obj.get("firstLevelCategoryName")!=null?obj.get("firstLevelCategoryName").toString():null);
            healthEduArticleES.setSecondLevelCategoryId(obj.get("secondLevelCategoryId")!=null?obj.get("secondLevelCategoryId").toString():null);
            healthEduArticleES.setSecondLevelCategoryName(obj.get("secondLevelCategoryName")!=null?obj.get("secondLevelCategoryName").toString():null);
            healthEduArticleES.setOperatorId(obj.get("operatorId")!=null?obj.get("operatorId").toString():null);
//            healthEduArticleES.setIsRead(obj.get("isRead")!=null?(Integer)obj.get("isRead"):null);
            healthEduArticleES.setArticleSource(obj.get("articleSource")!=null?obj.get("articleSource").toString():null);
//            healthEduArticleES.setRoleList(obj.get("roleList")!=null?(List)obj.get("roleList"):null);
            healthEduArticleES.setLeaveWords(obj.get("leaveWords")!=null?obj.get("leaveWords").toString():null);
            healthEduArticleES.setCurrentUserRoleCode(obj.get("currentUserRoleCode")!=null?obj.get("currentUserRoleCode").toString():null);
            healthEduArticleES.setCurrentUserRoleLevel(obj.get("currentUserRoleLevel")!=null?obj.get("currentUserRoleLevel").toString():null);
            healthEduArticleES.setSendSource(obj.get("sendSource")!=null?(Integer)obj.get("sendSource"):null);
            healthEduArticleES.setAllCount(obj.get("allCount")!=null?(Integer)obj.get("allCount"):null);
            healthEduArticleES.setReadNumber(obj.get("readNumber")!=null?(Long)obj.get("readNumber"):null);
            healthEduArticleES.setNewArricleFlag(obj.get("newArricleFlag")!=null?(Boolean)obj.get("newArricleFlag"):null);
            healthEduArticleES.setUserType(obj.get("userType")!=null?(Integer) obj.get("userType"):null);
//            HealthEduArticleES one = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticleES.class);
//            logger.info(jo.toString());
//            System.out.printf(healthEduArticleES.toString());
            sendWxTemplateAndIM(healthEduArticleES);
            //返回服务器表示消息消费成功
            message.acknowledge();

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

@ -7,10 +7,12 @@ import com.yihu.es.entity.RoleVo;
import com.yihu.wlyy.config.es.ElasticFactory;
import com.yihu.wlyy.config.es.ElastricSearchSave;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.DoctorRole;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
@ -80,6 +82,8 @@ public class JMJkEduArticleService extends BaseService {
    private SignPatientLabelInfoService signPatientLabelInfoService;
    @Autowired
    private DoctorInfoService doctorInfoService;
    @Autowired
    private DoctorRoleDao doctorRoleDao;
    /**
     *
@ -94,8 +98,8 @@ public class JMJkEduArticleService extends BaseService {
     */
    public List<HealthEduArticlePatientModel> pushArticleList(int page, int pagesize, String sendCode,  String firstLevelCategoryId,String secondLevelCategoryId,Integer myArticle,Integer sendType,String currentUserRole,
                                                              String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
        pagesize = page * pagesize;
        page = (page - 1) * pagesize;
//        pagesize = page * pagesize;
//        page = (page - 1) ;
//        if(loginType==2){
//
//            String sql = "select r.code as roleCode from wlyy_user_role u " +
@ -167,7 +171,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 patientCode is not null AND articleId='"+article.getString("articleId")+"'");
            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")+"'");
            Long num = elasticsearchUtil.excuteForLong(sql3.toString(), esType, esIndex);
            if(num!=null){
                heapm.setReadNumber(num.longValue());
@ -516,7 +520,6 @@ public class JMJkEduArticleService extends BaseService {
//        healthEduArticlePatient.setBatchNo(batchNo);
//        healthEduArticlePatient.setCreateTime(new Date());
//
//
//        //通过文章id 获取文章详情
//        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
//
@ -544,34 +547,41 @@ public class JMJkEduArticleService extends BaseService {
        Patient one = null;
        String batchNo = UUID.randomUUID().toString();
        String sendName = "";
        List<DoctorRole> roleList = doctorRoleDao.findUserRole(sendCode);
        if(sendType==2){
            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 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);
//            sendName = returnList.get(0).get("name")+"";
            //通过当前的登陆角色获取角色名称
            for(DoctorRole ones :roleList){
                if(ones.getCode().equals(currentUserRoleCode)){
                    if(currentUserRoleCode.length()==6&&!currentUserRoleCode.endsWith("00")){
                        sendName =  ones.getName()+"卫生和计划生育局";
                    }else{
                        sendName =  ones.getName();
                    }
                    break;
                }
            }
            String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ;
            List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql);
            sendName = returnList.get(0).get("name")+"";
        }
        Map<String,Object> resultMap = labelService.fetchUserHighestAuthority(sendCode);
        List<RoleVo> roleVoLists= new ArrayList<>();
        if(resultMap.containsKey("roleList") && resultMap.get("roleList") != null){
            List<String> roleList = (List<String>)resultMap.get("roleList");
            for(String temp:roleList){
                RoleVo roleVo = new RoleVo();
                roleVo.setCode(temp);
                roleVoLists.add(roleVo);
            }
        for(DoctorRole ones :roleList){
            RoleVo roleVo = new RoleVo();
            roleVo.setCode(ones.getCode());
            roleVoLists.add(roleVo);
        }
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        Date createTime = new Date();
        for (String patient : patientSet) {
@ -640,8 +650,6 @@ 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;
    }

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

@ -459,7 +459,11 @@ public class ThirdJkEduArticleService extends BaseService {
                        rolemap.put(doctorRole.getCode(),doctorRole.getName());
                    }
                    if(rolemap.keySet().contains(operatorRoleCode)){
                        operatorRoleCodeName =  rolemap.get(operatorRoleCode);
                        if(operatorRoleCode.length()==6&&!operatorRoleCode.endsWith("00")){
                            operatorRoleCodeName =  rolemap.get(operatorRoleCode)+"卫生和计划生育局";
                        }else{
                            operatorRoleCodeName =  rolemap.get(operatorRoleCode);
                        }
                    }else{
                        operatorRoleCodeName = doctor.getHospitalName();
                    }

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

@ -271,9 +271,9 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            if(StringUtils.isEmpty(currentRoleLevel)){
                currentRoleLevel = getCurrentRoleLevel();
            }
            if(page == 0){
                page ++;
            }
//            if(page == 0){
//                page ++;
//            }
            List<HealthEduArticlePatientModel> eduArticlePatients = jmJkEduArticleService.pushArticleList(page, pagesize, getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,currentRoleLevel,articleTitle,sendTimeStart,sendTimeEnd);
//            Long count = jmJkEduArticleService.pushArticleListCount(getUID(),2);
            List<HealthEduArticleES> eduArticlePatientsCount = jmJkEduArticleService.pushArticleListCount( getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,