| 
					
				 | 
			
			
				@ -38,10 +38,7 @@ import com.yihu.wlyy.service.app.talk.TalkGroupService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.third.jw.JwPrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.third.jw.ZyDictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.task.PushMsgTask; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.HttpClientUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.ImUtill; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.MessageType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -64,11 +61,14 @@ import org.springside.modules.persistence.DynamicSpecifications; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springside.modules.persistence.SearchFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springside.modules.persistence.SearchFilter.Operator; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springside.modules.utils.Clock; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.CommonUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import javax.annotation.PostConstruct; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * 網絡諮詢类. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * test 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -961,7 +961,8 @@ public class ConsultTeamService extends ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject messages = ImUtill.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(),agent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //5、(im创建咨询) 续方咨询的sessionid为居民code+续方code+咨询类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject obj = ImUtill.createTopics(patient + "_" + consult.getCode() + "_" + ct.getType(), consult.getCode(), p.getName(), users, messages, ImUtill.SESSION_TYPE_PRESCRIPTION); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sessionId = patient + "_" + consult.getCode() + "_" + ct.getType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject obj = ImUtill.createTopics(sessionId, consult.getCode(), p.getName(), users, messages, ImUtill.SESSION_TYPE_PRESCRIPTION); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (obj == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                throw new RuntimeException("IM消息发送异常!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -985,7 +986,7 @@ public class ConsultTeamService extends ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            consultTeamDoctorDao.save(cd); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //7、发送系统消息提示团队长有未审核的消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            addCheckMessage(prescription); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            addCheckMessage(prescription,sessionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //8、 保存医生咨询信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            // 添加咨询转发记录 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1000,7 +1001,7 @@ public class ConsultTeamService extends ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 保存审核提醒消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param prescription 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void addCheckMessage(Prescription prescription){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void addCheckMessage(Prescription prescription,String sessionId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Message message = new Message(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setCzrq(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setCreateTime(new Date()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1017,6 +1018,8 @@ public class ConsultTeamService extends ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setRelationCode(prescription.getConsult()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setPrescriptionStatus("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setSessionId(sessionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message.setSessionName(prescription.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        messageDao.save(message); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1076,14 +1079,14 @@ public class ConsultTeamService extends ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDrugName(info.getString("drugName"));//药品名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDrugRate(info.getString("drugRate"));//吃药频率 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDrugFormat(info.getString("drugFormat"));//药品规格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setNum(doubleToInt(info.getDouble("num")));//药品数目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setPrice(doubleToInt(info.getDouble("price")));//药品单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setNum(CommonUtil.doubleToInt(info.getDouble("num")));//药品数目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setPrice(CommonUtil.doubleToInt(info.getDouble("price")));//药品单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setJwSubCode("");//智业子处方号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDrugNumUnitName(info.getString("drugNumUnitName"));//数量单位名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setCost(doubleToInt(info.getDouble("cost")));//金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setCharge(doubleToInt(info.getDouble("charge")));//自付 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setCost(CommonUtil.doubleToInt(info.getDouble("cost")));//金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setCharge(CommonUtil.doubleToInt(info.getDouble("charge")));//自付 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setBindFlag(info.getString("bindFlag"));//成组标志, 0.非成组,1.成组 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDayCount(info.getInteger("dayCount"));//用药天数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionInfo.setDrugUsage(info.getString("drugUsage"));//用药方法编码 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1134,17 +1137,6 @@ public class ConsultTeamService extends ConsultService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * double*100转int 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param d 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private Integer doubleToInt(Double d){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(d==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new Double(d*100).intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 发送消息给IM 
			 |