Kaynağa Gözat

专科医生

trick9191 7 yıl önce
ebeveyn
işleme
05d0f4cc4c

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

@ -60,7 +60,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
@ -130,10 +130,10 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 17 order by a.czrq desc")
    List<Message> getFamilyTransfer(String receiver);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 18 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 = 18 order by a.czrq desc")
    List<Message> getFamilySign(String receiver);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 18")
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 18 and a.read = 1")
    List<Message> selectFamilySign(String receiver,Pageable pageableRequest);
    @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 = 17 order by a.czrq desc")

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

@ -234,7 +234,7 @@ public class MessageService extends BaseService {
            JSONObject  familyJson = new JSONObject();
            familyJson.put("title", familyList.get(0).getTitle());
            familyJson.put("type", familyList.get(0).getType());
            familyJson.put("msg", familyList.get(0).getContent());
            familyJson.put("msg", "您有"+familyList.size()+"个居民申请共管服务!");
            familyJson.put("msgTime", DateUtil.dateToStrLong(familyList.get(0).getCreateTime()));
            familyJson.put("relationCode",familyList.get(0).getRelationCode());
            familyJson.put("reason",familyList.get(0).getReason());
@ -827,7 +827,7 @@ public class MessageService extends BaseService {
            JSONObject specialistObject = new JSONObject();
            specialistObject.put("title", specialist.get(0).getTitle());
            specialistObject.put("type", specialist.get(0).getType());
            specialistObject.put("msg", specialist.get(0).getContent());
            specialistObject.put("msg", "您有"+specialist.size()+"个居民申请共管服务");
            specialistObject.put("msgTime", DateUtil.dateToStrLong(specialist.get(0).getCreateTime()));
            specialistObject.put("relationCode",specialist.get(0).getRelationCode());
            specialistJson.put("specialist",specialistObject);
@ -842,7 +842,7 @@ public class MessageService extends BaseService {
            JSONObject familyObject = new JSONObject();
            familyObject.put("title", familyList.get(0).getTitle());
            familyObject.put("type", familyList.get(0).getType());
            familyObject.put("msg", familyList.get(0).getContent());
            familyObject.put("msg", "您有"+familyList.size()+"个居民筛查转诊通知");
            familyObject.put("msgTime", DateUtil.dateToStrLong(familyList.get(0).getCreateTime()));
            familyObject.put("relationCode",familyList.get(0).getRelationCode());
            familyJson.put("familyList",familyObject);

+ 15 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -8,16 +8,13 @@ package com.yihu.wlyy.service.common.account;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorPatient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.ServerLabelTree;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SignFamilyRenew;
import com.yihu.wlyy.entity.patient.vo.PatientVO;
import com.yihu.wlyy.entity.patient.*;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorPatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientRecordLogDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.security.TokenDao;
import com.yihu.wlyy.util.DateUtil;
@ -31,7 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -53,6 +49,8 @@ public class PatientService extends TokenService {
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private PatientRecordLogDao patientRecordLogDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private DoctorPatientDao doctorPatientDao;
@ -1134,6 +1132,17 @@ public class PatientService extends TokenService {
     */
    @Transactional
    public String clearOpenidByOpenid (String openid)  throws Exception{
        List<Patient> patientList = patientDao.findPatientByOpenid(openid);
        for (Patient patient :patientList){
            PatientRecordLog patientRecordLog = new PatientRecordLog();
            patientRecordLog.setCzrq(new Date());
            patientRecordLog.setPatient(patient.getCode());
            patientRecordLog.setIdCard(patient.getIdcard());
            patientRecordLog.setOpenId(patient.getOpenid());
            patientRecordLog.setPatientName(patient.getName());
            patientRecordLog.setSsc(patient.getSsc());
            patientRecordLogDao.save(patientRecordLog);
        }
        patientDao.clearOpenidByOpenid(openid);
        return "";
    }

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -611,12 +611,17 @@ public class SpecialistService extends BaseService {
        return "0";
    }
    public JSONObject findPatientSigninfo(String code) throws Exception {
    public JSONObject findPatientSigninfo(String code,String messageCode) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("code", code);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientSigninfo", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
            if (StringUtils.isNoneBlank(messageCode)){
                Message message = messageDao.findByCode(messageCode);
                message.setRead(0);
                messageDao.save(message);
            }
            JSONObject json = rs.getJSONObject("obj");
            List<PatientDiseaseServer> patientDiseaseServers =  patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(code,"1");
            json.put("diseaseServer",patientDiseaseServers);

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

@ -233,9 +233,12 @@ public class SpecialistController extends WeixinBaseController {
    @RequestMapping(value = "/findPatientSigninfo", method = RequestMethod.GET)
    @ApiOperation(value = "医生审核")
    @ObserverRequired
    public String findPatientSigninfo(@ApiParam(name = "code", value = "专科医生签约code") @RequestParam(required = true) String code) {
    public String findPatientSigninfo(@ApiParam(name = "code", value = "专科医生签约code")
                                      @RequestParam(required = true) String code,
                                      @ApiParam(name = "messageCode", value = "消息code")
                                      @RequestParam(required = false) String messageCode) {
        try {
            return write(200, "获取成功", "data", specialistService.findPatientSigninfo(code));
            return write(200, "获取成功", "data", specialistService.findPatientSigninfo(code,messageCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");