Prechádzať zdrojové kódy

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java
wangzhinan 7 rokov pred
rodič
commit
9132a77fcc

+ 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")

+ 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 "";
    }

+ 7 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -38,9 +38,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import static com.yihu.wlyy.service.common.util.ManageUtilService.page;
/**
 * Created by Trick on 2018/5/31.
@ -564,7 +561,7 @@ public class SpecialistService extends BaseService {
                Message message = new Message();
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setContent("您有一个居民开通共管服务!");
                message.setContent("您有1个居民开通共管服务!");
                message.setRead(1);//设置未读
                message.setReceiver(sign.getDoctor());//设置接受医生的code
                message.setSender(p.getCode());//设置发送的用户
@ -595,12 +592,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 (messageCode != null){
                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 BaseController {
    @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, "请求失败");