|
@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.JSONPObject;
|
|
|
import com.yihu.edu.entity.RoleWithAuthorityCheck;
|
|
|
import com.yihu.es.entity.FollowupContentESDO;
|
|
|
import com.yihu.es.entity.HealthEduArticlePatient;
|
|
|
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.team.admin.AdminTeam;
|
|
@ -24,6 +26,12 @@ import com.yihu.wlyy.util.ElasticsearchUtil;
|
|
|
import com.yihu.wlyy.web.third.gateway.service.GcLabelService;
|
|
|
import com.yihu.wlyy.web.third.gateway.vo.DictModel;
|
|
|
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
|
|
|
import io.searchbox.client.JestClient;
|
|
|
import io.searchbox.core.Search;
|
|
|
import io.searchbox.core.SearchResult;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilders;
|
|
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.annotation.Transient;
|
|
@ -35,6 +43,8 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
import static org.bouncycastle.asn1.x509.X509ObjectIdentifiers.id;
|
|
|
|
|
|
/**
|
|
|
* Created by liuwenbin on 2017/8/12.
|
|
|
* 集美健教
|
|
@ -47,6 +57,9 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
private String esType;
|
|
|
@Value("${es.index.HealthEduArticlePatient}")
|
|
|
private String esIndex;
|
|
|
|
|
|
@Autowired
|
|
|
private ElasticFactory elasticFactory;
|
|
|
@Autowired
|
|
|
private ElasticsearchUtil elasticsearchUtil;
|
|
|
@Autowired
|
|
@ -892,6 +905,54 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
// }
|
|
|
// patientSet.addAll(resultList);
|
|
|
// }
|
|
|
|
|
|
|
|
|
public void readAllArticle(String patient)throws Exception{
|
|
|
|
|
|
// JestClient jestClient = null;
|
|
|
//
|
|
|
// try {
|
|
|
// jestClient = elasticFactory.getJestClient();
|
|
|
// //先根据条件查找出来
|
|
|
// SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
// searchSourceBuilder.query(
|
|
|
// new BoolQueryBuilder()
|
|
|
// .must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
// );
|
|
|
// Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
|
|
|
// SearchResult result = jestClient.execute(search);
|
|
|
//// logger.info("同步单条随访记录-开始查询ES数据,时间:"+DateUtil.getStringDate());
|
|
|
// List<com.yihu.es.entity.HealthEduArticlePatient> dataList = result.getSourceAsObjectList(com.yihu.es.entity.HealthEduArticlePatient.class);
|
|
|
//// logger.info("同步单条随访记录-ES数据查询成功,时间:"+DateUtil.getStringDate());
|
|
|
// if(!dataList.isEmpty()){
|
|
|
// //删除原有记录
|
|
|
//// logger.info("同步单条随访记录-开始删除ES数据,时间:"+DateUtil.getStringDate());
|
|
|
// this.esDeleteFollowUpContent(dataList);
|
|
|
//// logger.info("同步单条随访记录-ES数据删除成功,时间:"+DateUtil.getStringDate());
|
|
|
// }
|
|
|
// //保存新的随访详情记录
|
|
|
//// logger.info("同步单条随访记录-开始保存ES数据,时间:"+DateUtil.getStringDate());
|
|
|
// elastricSearchSave.save(newdatalist,esIndex,esType);
|
|
|
//// logger.info("同步单条随访记录-ES数据保存成功,时间:"+DateUtil.getStringDate());
|
|
|
// jestClient.shutdownClient();
|
|
|
// }catch (Exception e){
|
|
|
// logger.error(" save error :" + e.getMessage());
|
|
|
// e.printStackTrace();
|
|
|
// } finally {
|
|
|
// if (jestClient != null) {
|
|
|
// jestClient.shutdownClient();
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
// String sql = "SELECT * FROM " + esType + " where nested(patients.code)= '" + patient + "' ";
|
|
|
// List<com.yihu.es.entity.HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql, com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
|
|
|
// for (HealthEduArticlePatient healthEduArticlePatient: esList) {
|
|
|
// healthEduArticlePatient.setIsread("1");
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONArray pushArticleLogs(int page, int pagesize, String patientCode,String level1Type) throws Exception {
|
|
|
|
|
@ -937,6 +998,8 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
heapm.setComputeTime(computeTime(article.getString("insertTime")));
|
|
|
heapm.setOperatorName(article.getString("operatorName"));
|
|
|
heapm.setSendType(one.getSendType());//发送类型
|
|
|
heapm.setIsread(one.getIsread());//已读未读标识,1已读,2未读
|
|
|
heapm.setLeaveWords(one.getLeaveWords());
|
|
|
doctor = doctorDao.findByCode(one.getDoctorCode());
|
|
|
heapm.setPhoto(doctor.getPhoto());
|
|
|
result.add(heapm);
|