Bladeren bron

代码修改

LAPTOP-KB9HII50\70708 1 jaar geleden
bovenliggende
commit
de028edf07

+ 17 - 9
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -1,15 +1,14 @@
package com.yihu.jw.hospital.service.consult;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.article.dao.KnowledgeArticleDeptDao;
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDeptDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
@ -47,7 +46,8 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
	
	@Autowired
	private KnowledgeArticleDao knowledgeArticleDao;
	
	@Autowired
	private KnowledgeArticleDictDao knowledgeArticleDictDao;
	@Autowired
	private KnowledgeArticleDeptDao knowledgeArticleDeptDao;
	@Autowired
@ -264,14 +264,22 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
				patientBusinessDO.setCollection(0);
				patientBusinessDO.setDel(1);
				patientBusinessDO = patientBusinessDao.save(patientBusinessDO);
					if (patientBusinessDO.getRelationType()==1){
				if (patientBusinessDO.getRelationType()==1){
					KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleDao.findByIdAndDel(patientBusinessDO.getRelationCode());
					System.out.println("content:"+JSON.toJSONString(knowledgeArticleDO));
					JSONObject object = new JSONObject();
					object.put("id",knowledgeArticleDO.getId());
					object.put("title",knowledgeArticleDO.getTitle());
					object.put("content",knowledgeArticleDO.getIntro());
					object.put("img",knowledgeArticleDO.getImage());
					if(knowledgeArticleDO==null){
						KnowledgeArticleDictDO knowledgeArticleDictDO = knowledgeArticleDictDao.findByIdAndDel(patientBusinessDO.getRelationCode());
						object.put("id",knowledgeArticleDictDO.getId());
						object.put("title",knowledgeArticleDictDO.getTitle());
						object.put("content",knowledgeArticleDictDO.getIntro());
						object.put("img",knowledgeArticleDictDO.getImage());
						object.put("type",knowledgeArticleDictDO.getType());
					}else {
						object.put("id",knowledgeArticleDO.getId());
						object.put("title",knowledgeArticleDO.getTitle());
						object.put("content",knowledgeArticleDO.getIntro());
						object.put("img",knowledgeArticleDO.getImage());
					}
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "4", object.toJSONString(),"1",null);
				}else {
					WlyySurveyUserDO wlyySurveyUserDO = new WlyySurveyUserDO();