trick9191 7 vuotta sitten
vanhempi
commit
ce1e09b092

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java

@ -30,7 +30,7 @@ public class Message extends IdEntity {
	/** type
	 *  消息类型(1.是家庭签约信息  2.体征消息  3分配健管师 4.随访提醒 5.咨询回复提醒,6.续方咨询待审核提醒,7.续方消息待取药
	 *  8.续方支付成功后团队长分配健管师,9线下调整完成,10意见反馈 11账号申诉,12.协同服务 13.孕检提醒 14.文章提交审核消息  15、健康文章审核结果
	 *  16.专科医生申请签约消息
	 *  16.专科医生申请签约消息 18.专科医生同意签约发送给全科医生消息
	 *  101患者申请取消签约、102患者同意取消签约、103患者拒绝取消签约、104患者填写了血糖记录、105患者填写了血压记录、106患者填写了体重记录、
	 *  107患者填写了腰围记录、108患者填写了运动记录、109患者填写了用药记录、110患者填写了饮食记录、111患者提交了问卷随访、112请求添加好友消息、
	 *  113入群消息、114群解散消息、115踢出群消息、116新的网络咨询、117网络咨询追问、

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/specialist/PatientDiseaseServerDao.java

@ -13,4 +13,5 @@ public interface PatientDiseaseServerDao extends
        PagingAndSortingRepository<PatientDiseaseServer, Long>,
        JpaSpecificationExecutor<PatientDiseaseServer> {
    List<PatientDiseaseServer> findByPatientAndDel(String patient,String del);
    List<PatientDiseaseServer> findBySpecialistRelationCodeAndDel(String code,String del);
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -20,6 +20,7 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.specialist.SpecialistService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdCardUtil;
import org.apache.commons.collections.map.HashedMap;
@ -81,6 +82,8 @@ public class SignPatientLabelInfoService extends BaseService {
    TrackPatientDao trackPatientDao;
    @Autowired
    PatientHealthIndexService patientHealthIndexService;
    @Autowired
    SpecialistService specialistService;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ -263,6 +266,14 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("isTrack","0");
            }
        }
        //1.4.9  是否专科医生服务
        JSONArray jsonArray =specialistService.findPatientSignSpecialist(patient);
        if(jsonArray!=null&&jsonArray.length()>0){
            json.put("isSpecialist",1);
        }else{
            json.put("isSpecialist",0);
        }
        return json;
    }

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

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.specialist.PatientDiseaseServer;
import com.yihu.wlyy.entity.specialist.SpecialDisease;
import com.yihu.wlyy.entity.specialist.TeamDiseaseRelation;
@ -73,6 +74,8 @@ public class SpecialistService extends BaseService {
    private SpecialDiseaseDao specialDiseaseDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    public String setPatientLabelInfo(List<SignPatientLabelInfo> list) {
        if (list != null && list.size() > 0) {
@ -480,6 +483,17 @@ public class SpecialistService extends BaseService {
                message.setOver("1");//未处理
                message.setRelationCode(rs.getString("obj"));
                message.setDel("1");
                JSONObject dataJson = new JSONObject();
                dataJson.put("doctor",d.getCode());
                dataJson.put("doctorName",d.getName());
                dataJson.put("hospital",d.getHospital());
                dataJson.put("hospitalName",d.getHospitalName());
                dataJson.put("dept",d.getDept());
                dataJson.put("deptName",d.getDeptName());
                message.setReason(dataJson.toString());
                message.setState(1);
                messageDao.save(message);
@ -489,14 +503,20 @@ public class SpecialistService extends BaseService {
                mes.put("data", "");
                return mes;
            } else if ("doctor_exist".equals(rs.getString("message"))) {
                JSONObject obj = rs.getJSONObject("obj");
                mes.put("code", -1);
                mes.put("mes", "医生与患者已经签约");
                mes.put("data", rs.getJSONObject("obj").toString());
                String relationCode =  obj.getString("relationCode");
                obj.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
                mes.put("data", obj.toString());
                return mes;
            } else if ("team_exist".equals(rs.getString("message"))) {
                JSONObject obj = rs.getJSONObject("obj");
                mes.put("code", -2);
                mes.put("mes", "团队与患者已经签约");
                mes.put("data", rs.getJSONObject("obj").toString());
                String relationCode =  obj.getString("relationCode");
                obj.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
                mes.put("data", obj.toString());
                return mes;
            } else {
                logger.info(response.getContent());
@ -523,6 +543,42 @@ public class SpecialistService extends BaseService {
                m.setRead(0);
                messageDao.save(m);
            }
            JSONObject josn =  rs.getJSONObject("obj");
            SignFamily sign =  signFamilyDao.findByPatient(josn.getString("patient"));
            Patient p = patientDao.findByCode(josn.getString("patient"));
            Doctor d = doctorDao.findByCode(josn.getString("doctor"));
            // 添加签约申请消息
            Message message = new Message();
            message.setCzrq(new Date());
            message.setCreateTime(new Date());
            message.setContent("您有一个居民开通共管服务!");
            message.setRead(1);//设置未读
            message.setReceiver(sign.getDoctor());//设置接受医生的code
            message.setSender(p.getCode());//设置发送的用户
            message.setSenderName(p.getName());
            message.setCode(getCode());
            message.setTitle("专科医生共管通知");
            message.setType(18);//家庭签约取消信息
            message.setReadonly(0);//是否只读消息
            message.setSex(p.getSex());
            message.setOver("1");//未处理
            message.setRelationCode(relationCode);
            message.setDel("1");
            message.setState(1);
            JSONObject dataJson = new JSONObject();
            dataJson.put("doctor",d.getCode());
            dataJson.put("doctorName",d.getName());
            dataJson.put("hospital",d.getHospital());
            dataJson.put("hospitalName",d.getHospitalName());
            dataJson.put("dept",d.getDept());
            dataJson.put("deptName",d.getDeptName());
            message.setReason(dataJson.toString());
            messageDao.save(message);
            return "1";
        }
        return "0";
@ -531,10 +587,13 @@ public class SpecialistService extends BaseService {
    public JSONObject findPatientSigninfo(String code) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("code", code);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/agreeSpecialistTeam", param);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientSigninfo", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
            return rs.getJSONObject("obj");
            JSONObject json = rs.getJSONObject("obj");
            List<PatientDiseaseServer> patientDiseaseServers =  patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(code,"1");
            json.put("diseaseServer",patientDiseaseServers);
            return json;
        }
        return null;
    }
@ -545,7 +604,13 @@ public class SpecialistService extends BaseService {
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientTeamList", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
            return rs.getJSONArray("obj");
            JSONArray jr = rs.getJSONArray("obj");
            for(int i=0;i<rs.getJSONArray("obj").length();i++){
                JSONObject j = jr.getJSONObject(i);
                String relationCode =  j.getString("relationCode");
                j.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
            }
            return jr;
        }
        return null;
    }

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

@ -63,7 +63,7 @@ public class PatientSpecialistController extends BaseController{
        }
    }
    @RequestMapping(value = "/signSpecialist", method = RequestMethod.GET)
    @RequestMapping(value = "/signSpecialist", method = RequestMethod.POST)
    @ApiOperation(value = "居民提交专科医生团队签约申请")
    public String signSpecialist(@ApiParam(name = "patient", value = "患者code") @RequestParam(required = true)String patient,
                                 @ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,