Prechádzať zdrojové kódy

医生代预约接口判断医生是否有登陆,且判断居民是否有签约

huangwenjie 7 rokov pred
rodič
commit
147fe756b8

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -1255,6 +1255,12 @@ public class GuahaoXMService extends BaseService implements IGuahaoService {
        if (p == null) {
            throw new Exception("患者信息不存在!");
        }
        
        //判断居民是否有签约
        List<SignFamily> sign = signFamilyDao.findSSandJTByIdcard(p.getIdcard());
        if(sign == null || sign.size()==0){
            throw new Exception("未签约患者不能预约10天号源!");
        }
        Map<String, String> map = objectMapper.readValue(arrangeDate, Map.class);
        if (map.containsKey("sectionType") && map.containsKey("startTime")) {

+ 23 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/BookingController.java

@ -1,10 +1,12 @@
package com.yihu.wlyy.web.third.zysoft;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.SMS;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientReservation;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.logs.BusinessLogs;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.message.SMSDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.app.consult.ConsultService;
@ -80,6 +82,9 @@ public class BookingController extends WeixinBaseController {
    
    @Autowired
    private StringRedisTemplate redisTemplate;
    
    @Autowired
    private DoctorDao doctorDao;
    /**
@ -608,6 +613,24 @@ public class BookingController extends WeixinBaseController {
                                      @ApiParam(name="surveyCode",value = "筛选code",defaultValue = "a")
                                      @RequestParam(value = "surveyCode",required = false)String surveyCode) {
        try {
            
            String currentdoctorid = getUID();
            //获取当前登录的医生CODE,判断接口传递的代预约医生CODE是否一致
            if(StringUtils.isBlank(currentdoctorid) || !currentdoctorid.equals(dcode)){
                return error(-1, "创建挂号单失败10001:当前登录医生和代预约医生不一致!");
            }
    
            //判断接口传入的代预约医生CODE是否为空
            if(StringUtils.isBlank(dcode)){
                return error(-1, "创建挂号单失败10002:代预约医生不能为空!");
            }
    
            //判断接口传入的代预约医生CODE查询代预约医生是否存在
            Doctor doctor = doctorDao.findByCode(dcode);
            if(doctor == null || StringUtils.isBlank(doctor.getCode())){
                return error(-1, "创建挂号单失败:代预约的医生不存在!");
            }
            
            String orderCode = guahaoXM.CreateOrderByDoctor(hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, arrangeDate, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode,surveyCode);
            //获取预约信息查询是否挂号成功
            PatientReservation obj = patientReservationService.findByCode(orderCode);