Forráskód Böngészése

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

trick9191 7 éve
szülő
commit
c163d4d499
14 módosított fájl, 289 hozzáadás és 83 törlés
  1. 11 5
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  2. 19 12
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/DoctorFeldsherTemplateJob.java
  3. 1 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/patient/PatientSchemeListDao.java
  4. 7 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempDao.java
  5. 19 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java
  6. 48 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  7. 27 39
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java
  8. 48 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java
  9. 17 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  10. 62 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java
  11. 5 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java
  12. 9 16
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  13. 14 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  14. 2 2
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

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

@ -1251,12 +1251,14 @@ public class PrescriptionService extends ZysoftBaseService{
            
                Prescription prescription = prescriptionDao.findByVisitNoAndRecipeNo(orderNo,recipeNo);
                if(prescription.getStatus().equals(PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue())){
                    if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                    /*if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
                    } else{
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                    }
                
                    }*/
                    prescription.setDispensaryType(1);
                    prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_success.getValue());
                    prescription.setJwPayStatus(1);//0为未结算,1为结算成功,默认为0
                    prescription.setDrugDeliveryTime(new Date());
                    prescriptionDao.save(prescription);
@ -1329,7 +1331,11 @@ public class PrescriptionService extends ZysoftBaseService{
                    log.setUserName(prescription.getDoctorName());
                    log.setFlag(1);
                    log.setUserCode(prescription.getDoctor());
                    if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                    log.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_success.getValue());
                    log.setRemark("待配药");
                    prescriptionLogDao.save(log);
     /*               if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                        log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
                        log.setRemark("快递配送:配药成功,配送中");
                        prescriptionLogDao.save(log);
@ -1373,7 +1379,7 @@ public class PrescriptionService extends ZysoftBaseService{
                            redisTemplate.opsForList().leftPush(channelTopic,message.toString());
//                redisTemplate.unwatch();
                        }
                    }
                    }*/
                
                }else {
                    error = "code:"+prescription.getCode()+",status:"+prescription.getStatus();

+ 19 - 12
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/DoctorFeldsherTemplateJob.java

@ -52,6 +52,7 @@ public class DoctorFeldsherTemplateJob implements Job {
            c.setTime(today);
            int weekday=c.get(Calendar.DAY_OF_WEEK);
            //查询当天医生设置的监测方案
            List<DoctorSchemeBloodSugger> patientCodeList = schemeListDao.findSuggerPatient((short)weekday);
            for (DoctorSchemeBloodSugger patientCodeLis : patientCodeList) {
                String schemecode = patientCodeLis.getCode();
@ -240,21 +241,27 @@ public class DoctorFeldsherTemplateJob implements Job {
        Date today = new Date();
        if (minutes <= 30 && minutes > 0) {
            PatientSchemeList patient = schemeListDao.findPatientBySchemecode(schemecode,type);
            String patientCode = patient.getPatientcode();
            //查询使用同一套监测方案的所有居民
            List<PatientSchemeList> patientList = schemeListDao.findPatientBySchemecode(schemecode,type);
            for (PatientSchemeList patient :patientList) {
                String patientCode = patient.getPatientcode();
            String day = formatDay.format(today);
            Date begin = formatTime.parse(day + beginTime);
            Date end = formatTime.parse(day + endTime);
            List<DevicePatientHealthIndex> healthIndices = patientHealthIndexDao.findByPatient(patientCode, type, begin, end);
            if (healthIndices==null || healthIndices.size()==0) {
                try {
                    //为居民发送监测代办事项提醒消息
                    feldsherTemplateService.sendChangeTemplate(type, patientCode, comment);
                } catch (Exception e) {
                    logger.info("DoctorFeldsherTemplateJob error ..........continue this JOB,CODE:" + patientCode + ",message:" + e.getMessage());
                String day = formatDay.format(today);
                Date begin = formatTime.parse(day + beginTime);
                Date end = formatTime.parse(day + endTime);
                //查询监测提醒时间段居民是否有对应设备数据上传
                List<DevicePatientHealthIndex> healthIndices = patientHealthIndexDao.findByPatient(patientCode, type, begin, end);
                if (healthIndices==null || healthIndices.size()==0) {
                    try {
                        //为居民发送监测代办事项提醒消息
                        feldsherTemplateService.sendChangeTemplate(type, patientCode, comment);
                    } catch (Exception e) {
                        logger.info("DoctorFeldsherTemplateJob error ..........continue this JOB,CODE:" + patientCode + ",message:" + e.getMessage());
                    }
                }
            }
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/patient/PatientSchemeListDao.java

@ -23,5 +23,5 @@ public interface PatientSchemeListDao extends PagingAndSortingRepository<Patient
    //根据schemecode查询患者监测方案
    @Query(" select p from PatientSchemeList p where p.schemecode = ?1 and p.type = ?2 ")
    PatientSchemeList findPatientBySchemecode(String schemecode,Integer type);
    List<PatientSchemeList> findPatientBySchemecode(String schemecode,Integer type);
}

+ 7 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempDao.java

@ -38,4 +38,11 @@ public interface DoctorGuidanceTempDao extends PagingAndSortingRepository<Doctor
    //根据模板文章标题模糊搜索个人指导模板
    @Query(value = "select t from DoctorGuidanceTemp t where t.owner != 'system' and t.modelName like ?1 order by t.sendTimes desc ")
    Page<DoctorGuidanceTemp> listByTile(String filter, Pageable pageRequest);
    //根据模板文章标题模糊搜索个人指导模板
    @Query(value = "select t from DoctorGuidanceTemp t where t.owner = ?1 and t.modelName like ?2 order by t.sendTimes desc ")
    Page<DoctorGuidanceTemp> listOwnerByTile(String owner, String filter, Pageable pageRequest);
    @Query("select t from DoctorGuidanceTemp t where (t.owner = 'system' or t.owner = ?1) and t.modelName like ?2 order by t.sendTimes desc ")
    Page<DoctorGuidanceTemp> listByTileAll(String owner,String filter, Pageable pageRequest);
}

+ 19 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java

@ -23,6 +23,10 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
    @Query("select t from DoctorTeamGuidanceTemplate t where t.del = 1 and t.teamId = ?1 ")
    List<DoctorTeamGuidanceTemplate> findGuidanceByTeamId(int teamId, Pageable request);
    //    根据团队ID获取团队内的模板列表(带分页和创建时间倒序)
    @Query("select t from DoctorTeamGuidanceTemplate t where t.del = 1 and t.teamId = ?1 ")
    List<DoctorTeamGuidanceTemplate> countGuidanceByTeamId(int teamId);
    //    由模板编码获取拥有该模板的团队信息
    @Query("select t from DoctorTeamGuidanceTemplate t where t.del = 1 and t.teamTemplateCode = ?1 ")
    List<DoctorTeamGuidanceTemplate> getTeamsByGuidance(String guidanceCode);
@ -52,4 +56,19 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
            " AND b.del = 1 AND b.title LIKE ?1 order by b.useTimes desc  ")
    Page<DoctorTeamGuidanceTemplate> listByTile(String title, Pageable pageRequest);
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +
            " AND b.del = 1 AND b.creater = ?1  AND b.teamId = ?2 AND b.title LIKE ?3 order by b.useTimes desc  ")
    List<DoctorTeamGuidanceTemplate> countTeamListByTile(String doctor, int teamId, String title);
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +
            " AND b.del = 1  AND b.creater = ?1  AND b.title LIKE ?2 GROUP BY b.teamId order by b.useTimes desc  ")
    List<DoctorTeamGuidanceTemplate> countTeamListByTile(String doctor, String title);
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +
            " AND b.del = 1 AND b.creater = ?1 AND b.title LIKE ?2 order by b.useTimes desc  ")
    List<DoctorTeamGuidanceTemplate> getListByTile(String doctor, String title, Pageable pageRequest);
}

+ 48 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -1033,5 +1033,53 @@ public class JMJkEduArticleService extends BaseService {
        }
    }
    /**
     * 查询给患者发送的健康教育文章
     *
     * @param patient
     * @param teamCode
     * @param page
     * @param pageSize
     * @return
     */
//    public List<Map<String, Object>> findByPatientAndTeam(String patient, long teamCode, int page, int pageSize) {
//        List<Object> params = new ArrayList<Object>();
//        String sql = "select " +
//                "    a.article" +
//                "    ,b.title" +
//                "    ,b.url" +
//                "    ,a.czrq" +
//                "    ,b.summary content" +
//                "    ,d.code" +
//                "    ,d.name" +
//                "    ,d.photo" +
//                "    ,a.admin_team_code" +
//                "    ,a.is_read" +
//                "    ,a.attached_content" +
//                "  from" +
//                "    wlyy_health_edu_article_patient a" +
//                "    ,wlyy_health_edu_article b" +
//                "    ,wlyy_doctor d" +
//                "  where" +
//                "    a.article = b.code " +
//                "    and a.doctor = d.code " +
//                "   and ( a.send_type =1 or a.send_type is null or a.send_type = '') "+  //添加类型判断是集美的推送还是三师原来的推送
//                "    and a.patient = ?" +
//                "    and a.admin_team_code = ?" +
//                "  order by a.czrq desc limit " + page*pageSize + "," + pageSize;
//
//        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql,new Object[]{patient,teamCode});
//        return result;
//    }
    public List<HealthEduArticleES> findByPatientAndTeam(String patient, long teamCode, int page, int pageSize) {
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where adminTeamCode='"+teamCode+"' and userType='1' and patientCode='"+patient+"' " );
        sql2.append(" order by createTime desc limit " + page + "," + pageSize);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(),HealthEduArticleES.class, esIndex, esType);
        return esList;
    }
}

+ 27 - 39
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java

@ -7,6 +7,7 @@ import com.yihu.wlyy.repository.template.DoctorTeamGuidanceTemplateDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.CodeFomat;
import com.yihu.wlyy.util.CommonUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
@ -201,53 +202,40 @@ public class DoctorGuidanceTempService extends BaseService {
     * @param type   模板类型
     * @return
     */
    public List<Map<String, Object>> list(String doctor, String type, int pageSize, int pageNo) throws Exception {
    public List<Map<String, Object>> list(String doctor,String filter, String type, int pageSize, int pageNo) throws Exception {
        Page<DoctorGuidanceTemp> temps = null;
        PageRequest pageRequest = new PageRequest(pageNo, pageSize);
        List<Map<String, Object>> listMap = new ArrayList<>();
        if (type.equals("1")) {
            temps = guidanceTempDao.findByOwner("system", pageRequest);
            List<DoctorGuidanceTemp> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorGuidanceTemp dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("code", dgt.getCode());
                tem.put("owner", dgt.getOwner());
                tem.put("sendTimes", dgt.getSendTimes());
                tem.put("lastTime", dgt.getLastTime());
                tem.put("modelName", dgt.getModelName());
                listMap.add(tem);
            }
        } else if (type.equals("2")) {
            temps = guidanceTempDao.findByOwner(doctor, pageRequest);
            List<DoctorGuidanceTemp> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorGuidanceTemp dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("code", dgt.getCode());
                tem.put("owner", dgt.getOwner());
                tem.put("sendTimes", dgt.getSendTimes());
                tem.put("lastTime", dgt.getLastTime());
                tem.put("modelName", dgt.getModelName());
                listMap.add(tem);
        if (StringUtils.isEmpty(filter)){
            if (type.equals("1")) {
                temps = guidanceTempDao.findByOwner("system", pageRequest);
            } else if (type.equals("2")) {
                temps = guidanceTempDao.findByOwner(doctor, pageRequest);
            } else {
                temps = guidanceTempDao.findByOwnerAndSystem(doctor, pageRequest);
            }
        } else {
            temps = guidanceTempDao.findByOwnerAndSystem(doctor, pageRequest);
            List<DoctorGuidanceTemp> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorGuidanceTemp dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("code", dgt.getCode());
                tem.put("owner", dgt.getOwner());
                tem.put("sendTimes", dgt.getSendTimes());
                tem.put("lastTime", dgt.getLastTime());
                tem.put("modelName", dgt.getModelName());
                listMap.add(tem);
        }else {
            if (type.equals("1")) {
                temps = guidanceTempDao.listByTileSystem("%"+filter+"%", pageRequest);
            } else if (type.equals("2")) {
                temps = guidanceTempDao.listOwnerByTile(doctor,"%"+filter+"%", pageRequest);
            } else {
                temps = guidanceTempDao.listByTileAll(doctor,"%"+filter+"%", pageRequest);
            }
        }
        List<DoctorGuidanceTemp> list = temps.getContent();
        for (int i = 0; i < list.size(); i++) {
            DoctorGuidanceTemp dgt = list.get(i);
            Map<String, Object> tem = new HashMap<>();
            tem.put("code", dgt.getCode());
            tem.put("owner", dgt.getOwner());
            tem.put("sendTimes", dgt.getSendTimes());
            tem.put("lastTime", dgt.getLastTime());
            tem.put("modelName", dgt.getModelName());
            listMap.add(tem);
        }
        return listMap;
    }

+ 48 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -260,18 +260,26 @@ public class DoctorTeamGuidanceService extends BaseService {
    /**
     * 根据医生所属的单个团队获取团队模板列表
     *
     * @param doctor
     * @param filter
     * @param teamId
     * @param pageNo
     * @param pageSize
     * @return
     * @throws Exception
     */
    public List getTeamGuidanceList(int teamId, int pageNo, int pageSize) throws Exception {
    public List getTeamGuidanceList(String doctor, String filter, int teamId, int pageNo, int pageSize) throws Exception {
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        PageRequest request = new PageRequest(pageNo, pageSize, sort);
        List<DoctorTeamGuidanceTemplate> listGuidances = doctorTeamGuidanceTemplateDao.findGuidanceByTeamId(teamId, request);
        List list = new ArrayList();
        List<DoctorTeamGuidanceTemplate> listGuidances = null;
        if (StringUtils.isEmpty(filter)){
            listGuidances = doctorTeamGuidanceTemplateDao.findGuidanceByTeamId(teamId, request);
        }else {
            listGuidances = doctorTeamGuidanceTemplateDao.getListByTile(doctor,"%"+filter+"%", request);
        }
        for (DoctorTeamGuidanceTemplate guidance : listGuidances) {
            Map map = new HashMap();
            String title = guidance.getTitle();
@ -282,9 +290,46 @@ public class DoctorTeamGuidanceService extends BaseService {
            map.put("useTimes", useTimes);
            list.add(map);
        }
        return list;
    }
    /**
     * 获取此医生所在的团队列表。
     *
     * @param doctorCode
     * @param filter 搜索关键字
     * @return
     */
    public List getDoctorTeams(String doctorCode,String filter) throws Exception{
        List teamList = null;
        try {
            List<AdminTeam> doctorTeams = memberDao.findDoctorTeams(doctorCode);
            teamList = new ArrayList();
            for (AdminTeam AdminTeam : doctorTeams){
                Map map = new HashMap();
                String teamName = AdminTeam.getName();
                Long teamId = AdminTeam.getId();
                map.put("teamName", teamName);
                map.put("teamId", teamId);
                if (StringUtils.isNotEmpty(filter)){
                    List<DoctorTeamGuidanceTemplate> guidances = doctorTeamGuidanceTemplateDao.countTeamListByTile(doctorCode,Integer.valueOf(teamId.toString()),"%"+filter+"%");
                    map.put("amount", guidances.size());
                }else {
                    List<DoctorTeamGuidanceTemplate> listGuidances = doctorTeamGuidanceTemplateDao.countGuidanceByTeamId(Integer.valueOf(teamId.toString()));
                    map.put("amount", listGuidances.size());
                }
                teamList.add(map);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return teamList;
    }
    /**
     * 根据团队模板编码获取单个 有效的 模板详情
     *

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

@ -109,6 +109,7 @@ public class ThirdJkEduArticleService extends BaseService {
    private String saveArticleQRCode = "JkEdu.ArticleQR.saveArticleQRCode";//添加认证标识
    private String getArticleQRCodeById = "JkEdu.ArticleQR.getArticleQRCodeById";//根据id获取认证标识
    private String saveBehavior = "JkEdu.Behavior.saveBehavior";//根据id获取认证标识
    private String insertArticleStatistic = "JkEdu.Article.insertArticleStatistic";//旧数据文章刷新articleStatistic
    /**
     * 封装入参
     *
@ -997,4 +998,20 @@ public class ThirdJkEduArticleService extends BaseService {
        }
        return false;
    }
    public void insertArticleStatistic() throws Exception{
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(insertArticleStatistic, param.toString(), "1"));
            json = JSON.parseObject(response);
        }catch (Exception e) {
            e.printStackTrace();
        }
        if (!"10000".equals(json.getString("Code"))) {
            throw new Exception(json.getString("Message"));
        }
    }
}

+ 62 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
@ -12,6 +13,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
@ -23,9 +25,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
 * Created by Trick on 2017/11/14.
@ -453,4 +453,63 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
        }
    }
    /**
     * 查询发送给居民的文章列表
     *
     * @param pagesize 分页大小
     * @return 列表
     */
    @RequestMapping(value = "list_by_team", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation(value = "查询发送给居民的文章列表")
    public String listByTeam(@RequestParam @ApiParam(value = "第几页") int page,
                             @RequestParam @ApiParam(value = "页大小") int pagesize,
                             @RequestParam @ApiParam(value = "居民code") String patient,
                             @RequestParam @ApiParam(value = "团队code") Long teamCode) {
        try {
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "请输入需查询的居民");
            }
            if (teamCode == null || teamCode < 1) {
                return error(-1, "请输入需查询的居民的团队");
            }
            page = page > 0 ? page - 1 : 0;
            List<HealthEduArticleES> list = jmJkEduArticleService.findByPatientAndTeam(patient, teamCode, page, pagesize);
            JSONArray jsonArray = new JSONArray();
            if (list != null) {
                for (HealthEduArticleES map : list) {
                    org.json.JSONObject json = new org.json.JSONObject();
                    // 文章标识
                    json.put("doctorCode", map.getDoctorCode());
                    // 文章标识
                    json.put("doctorName", map.getDoctorName());
                    // 文章标识
                    json.put("doctorPhoto", map.getSendPic());
                    // 文章标识
                    json.put("code", map.getArticleId());
                    // 文章标题
                    json.put("title", map.getArticleTitle());
                    // 文章查看URL
//                    json.put("url", map.get("url"));
                    // 文章简介
                    //json.put("content", parsrHtml(map.get("content").toString()));
                    json.put("content", map.getArticleContent());
                    json.put("read", map.getIsRead());
                    json.put("attached_content", map.getLeaveWords());
                    // 发送日期
                    json.put("czrq", DateUtil.dateToStrLong(map.getCzrq()));
                    // 发送团队
                    json.put("adminTeamCode", map.getAdminTeamCode());
                    jsonArray.put(json);
                }
            }
            return write(200, "查询成功", "data", jsonArray);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, "查询失败!");
        }
    }
}

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java

@ -170,14 +170,17 @@ public class DoctorGuidanceTempController extends BaseController {
     */
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ApiOperation(value = "查询指导模板")
    public String list(@RequestParam(required = false, defaultValue = "")
    public String list(
                       @RequestParam(required = false, defaultValue = "")
                       @ApiParam(value = "搜索关键字") String filter,
                       @RequestParam(required = false, defaultValue = "")
                       @ApiParam(value = "模板类型 1:系统 2:自定义 为空:所有") String type,
                       @RequestParam(defaultValue = "10") String pageSize,
                       @RequestParam(defaultValue = "1") @ApiParam(value = "当前页码") String pageNo) {
        try {
            int pagesize = Integer.parseInt(pageSize);
            int pageno = Integer.parseInt(pageNo) - 1;
            List<Map<String, Object>> temps = guidanceTempService.list(getUID(), type, pagesize, pageno);
            List<Map<String, Object>> temps = guidanceTempService.list(getUID(),filter, type, pagesize, pageno);
            if (temps == null || temps.size() < 1) {
                return write(200, "查询成功", "data", new JSONArray());

+ 9 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -4,8 +4,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.template.DoctorTeamGuidanceService;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
@ -31,8 +31,6 @@ import java.util.*;
@Api(description = "医生端&后端团队指导模板")
public class DoctorTeamGuidanceController extends WeixinBaseController {
    @Autowired
    private AdminTeamService adminTeamService;
    @Autowired
    private DoctorTeamGuidanceService doctorTeamGuidanceService;
    @Autowired
@ -48,19 +46,10 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
    @RequestMapping(value = "/getDoctorTeams", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取医生所属的所有团队")
    public String getHealthIndexHistory() {
    public String getHealthIndexHistory(@RequestParam(required = false, defaultValue = "") @ApiParam(value = "搜索关键字") String filter) {
        try {
            String doctorCode = getUID();
            List<AdminTeam> doctorTeams = adminTeamService.getDoctorTeams(doctorCode);
            List teamList = new ArrayList();
            for (AdminTeam AdminTeam : doctorTeams) {
                Map map = new HashMap();
                String teamName = AdminTeam.getName();
                Long teamId = AdminTeam.getId();
                map.put("teamName", teamName);
                map.put("teamId", teamId);
                teamList.add(map);
            }
            List teamList = doctorTeamGuidanceService.getDoctorTeams(doctorCode,filter);
            return write(200, "获取医生所属团队成功!", "teamList", teamList);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
@ -76,11 +65,15 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
    @RequestMapping(value = "/getTeamGuidanceList", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取单个团队模板列表")
    public String getTeamGuidanceList(@RequestParam int teamId,
    public String getTeamGuidanceList(
                                      @RequestParam(required = false, defaultValue = "")
                                      @ApiParam(value = "搜索关键字") String filter,
                                      @RequestParam(required = false, defaultValue = "")
                                      @ApiParam(value = "团队ID") Integer teamId,
                                      @RequestParam int pageNo,
                                      @RequestParam int pageSize) {
        try {
            List list = doctorTeamGuidanceService.getTeamGuidanceList(teamId, pageNo - 1, pageSize);
            List list = doctorTeamGuidanceService.getTeamGuidanceList(getUID(),filter,teamId, pageNo - 1, pageSize);
            return write(200, "获取团队模板列表成功!", "templateList", list);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());

+ 14 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -373,4 +373,18 @@ public class ThirdJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "insertArticleStatistic",method = RequestMethod.POST)
    @ApiOperation("旧数据文章迁移,user_articlestatistics文章统计表也更新一份")
    public String insertArticleStatistic(){
        try {
            thirdJkEduArticleService.insertArticleStatistic();
            return write(200,"更新成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"更新失败!");
        }
    }
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -105,11 +105,11 @@ pushMes:
  redis_prescription_title: redisMessage
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test6
    HealthEduArticlePatient: health_edu_article_patient_test3
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
  type:
    HealthEduArticlePatient: health_edu_article_patient_test6
    HealthEduArticlePatient: health_edu_article_patient_test3
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
  host:  http://172.19.103.68:9200