Bläddra i källkod

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

# Conflicts:
#	patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index.jsp
wangzhinan 7 år sedan
förälder
incheckning
8fd0ce9bc6

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -146,7 +146,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (16,20,22,23) order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where  a.receiver = ?1 and a.state = 1 and a.over = ?2 and a.type in (16,19,20,21,22,23) order by a.czrq desc")
    @Query("select a from Message a where  a.receiver = ?1 and a.state = 1 and a.over = ?2 and a.type in (19,21) order by a.czrq desc")
    List<Message> getSpecialistMessages(String receiver,String over,Pageable pageable);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (17) order by a.czrq desc")
@ -155,6 +155,6 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.code = ?1")
    Message findByCode(String code);
    @Query("select a from Message a where a.read = 1 and a.over = 0 and a.receiver = ?1 and a.state = 1 and a.type in (19,20,21,22,23) order by a.czrq desc")
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (19,20,21,22,23) order by a.czrq desc")
    List<Message> getSpecialistUnRead(String receiver);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -919,7 +919,7 @@ public class MessageService extends BaseService {
    public List<Message> getFamilySign(String receiver,Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        Sort sort = new Sort(Direction.DESC, "createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.selectFamilySign(receiver,pageRequest);

+ 72 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.specialist;/**
 * Created by nature of king on 2018/8/28.
 */
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
@ -13,6 +14,7 @@ import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -110,6 +112,76 @@ public class SpecialistEvaluateSevice extends BaseService {
    }
    /**
     * 医生获取评分
     *
     * @param doctor
     * @return
     */
    public JSONObject selectByDoctor(String doctor){
        String response = null;
        String url ="http://localhost:10051/" + "svr-specialist/selectByDoctor";
        Map<String,String> params = new HashMap<>();
        params.put("doctor",doctor);
        try {
            response = httpClientUtil.httpPost(url,params);
            JSONObject object = JSONObject.parseObject(response);
            if (object.getInteger("status")==200){
                JSONObject jsonObject4 = object.getJSONObject("obj");
                JSONObject jsonObject = jsonObject4.getJSONObject("4");
                JSONObject jsonObject1 = jsonObject4.getJSONObject("5");
                JSONObject jsonObject2 = jsonObject4.getJSONObject("6");
                JSONObject jsonObject3 = jsonObject4.getJSONObject("7");
                JSONArray array = jsonObject.getJSONArray("evaluate");
                JSONArray array1 = jsonObject1.getJSONArray("evaluate");
                JSONArray array2 = jsonObject2.getJSONArray("evaluate");
                JSONArray array3 = jsonObject3.getJSONArray("evaluate");
                //全部
                for (int i=0;i<array.size();i++){
                    JSONObject object1 = array.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
                //好评
                for (int i=0;i<array1.size();i++){
                    JSONObject object1 = array1.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
                //中评
                for (int i=0;i<array2.size();i++){
                    JSONObject object1 = array2.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
                //差评
                for (int i=0;i<array3.size();i++){
                    JSONObject object1 = array3.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
            }
            return object;
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
            return null;
        }
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成 23 服务进展提醒-待完成
     */

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/SpecialistEvaluateController.java

@ -85,4 +85,5 @@ public class SpecialistEvaluateController extends WeixinBaseController {
            return error(-1,e.getMessage());
        }
    }
}