提交 37f0d270 authored 作者: 杨凯's avatar 杨凯

Merge branch 'test'

...@@ -20,5 +20,6 @@ public interface ScheduleRecordMapper extends BaseMapper<ScheduleRecordEntity> { ...@@ -20,5 +20,6 @@ public interface ScheduleRecordMapper extends BaseMapper<ScheduleRecordEntity> {
@Param("servType") Integer servType, @Param("servType") Integer servType,
@Param("scheduleDate") String scheduleDate, @Param("scheduleDate") String scheduleDate,
@Param("status") Integer status, @Param("status") Integer status,
@Param("endStart") String endStart); @Param("endStart") String endStart,
@Param("doctorId") String doctorId);
} }
...@@ -6,16 +6,19 @@ import com.ebaiyihui.family.doctor.common.dto.NotifyConsultDataDTO; ...@@ -6,16 +6,19 @@ import com.ebaiyihui.family.doctor.common.dto.NotifyConsultDataDTO;
import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO; import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.common.dto.SignedDoctorDTO; import com.ebaiyihui.family.doctor.common.dto.SignedDoctorDTO;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants; import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
import com.ebaiyihui.family.doctor.server.common.enums.ImSignStatus; import com.ebaiyihui.family.doctor.server.common.enums.ImSignStatus;
import com.ebaiyihui.family.doctor.server.common.enums.SignStatus; import com.ebaiyihui.family.doctor.server.common.enums.SignStatus;
import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum; import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum;
import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity; import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity; import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.entity.ScheduleRecordEntity; import com.ebaiyihui.family.doctor.server.entity.ScheduleRecordEntity;
import com.ebaiyihui.family.doctor.server.entity.ServiceConfigEntity;
import com.ebaiyihui.family.doctor.server.exception.BusinessException; import com.ebaiyihui.family.doctor.server.exception.BusinessException;
import com.ebaiyihui.family.doctor.server.mapper.MobileBenefitPackageMapper; import com.ebaiyihui.family.doctor.server.mapper.MobileBenefitPackageMapper;
import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper; import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.mapper.ScheduleRecordMapper; import com.ebaiyihui.family.doctor.server.mapper.ScheduleRecordMapper;
import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper;
import com.ebaiyihui.family.doctor.server.rabbitmq.RabbitProduct; import com.ebaiyihui.family.doctor.server.rabbitmq.RabbitProduct;
import com.ebaiyihui.family.doctor.server.service.GoEasyPushService; import com.ebaiyihui.family.doctor.server.service.GoEasyPushService;
import com.ebaiyihui.family.doctor.server.service.ImChatTemplate; import com.ebaiyihui.family.doctor.server.service.ImChatTemplate;
...@@ -49,6 +52,9 @@ public class PatientServiceImpl implements PatientService { ...@@ -49,6 +52,9 @@ public class PatientServiceImpl implements PatientService {
@Autowired @Autowired
private PatientSignMapper patientSignMapper; private PatientSignMapper patientSignMapper;
@Autowired
private ServiceConfigMapper serviceConfigMapper;
@Autowired @Autowired
private MobileBenefitPackageMapper mobileBenefitPackageMapper; private MobileBenefitPackageMapper mobileBenefitPackageMapper;
...@@ -318,7 +324,7 @@ public class PatientServiceImpl implements PatientService { ...@@ -318,7 +324,7 @@ public class PatientServiceImpl implements PatientService {
throw new BusinessException("已有进行中排班医生沟通,请勿重复点击"); throw new BusinessException("已有进行中排班医生沟通,请勿重复点击");
} }
// 查询排班医生信息 // 查询排班医生信息
List<ScheduleRecordEntity> scheduleRecordEntities = scheduleRecordMapper.selectByDate(String.valueOf(CommonConstants.ORGAN_CODE), 5, date, 1, hourAndSecond); List<ScheduleRecordEntity> scheduleRecordEntities = scheduleRecordMapper.selectByDate(String.valueOf(CommonConstants.ORGAN_CODE), 5, date, 1, hourAndSecond, null);
log.info("当前排班医生:{},传进来过滤的医生id={}", JSON.toJSONString(scheduleRecordEntities), doctorId); log.info("当前排班医生:{},传进来过滤的医生id={}", JSON.toJSONString(scheduleRecordEntities), doctorId);
if (!CollectionUtils.isEmpty(scheduleRecordEntities)) { if (!CollectionUtils.isEmpty(scheduleRecordEntities)) {
...@@ -340,6 +346,24 @@ public class PatientServiceImpl implements PatientService { ...@@ -340,6 +346,24 @@ public class PatientServiceImpl implements PatientService {
} }
scheduleRecordEntity = scheduleRecordEntities.get(i - 1); scheduleRecordEntity = scheduleRecordEntities.get(i - 1);
log.info("查询当前排班医生doctorId={}", scheduleRecordEntity.getDoctorId());
// 查询值班的医生是否在线,如果不在线则强制在线,以排班信息为准
QueryWrapper<ServiceConfigEntity> queryWrapper = new QueryWrapper<>();
ServiceConfigEntity wrapperEntity = new ServiceConfigEntity();
wrapperEntity.setOrganId(String.valueOf(CommonConstants.ORGAN_CODE));
wrapperEntity.setAppCode(CommonConstants.APP_CODE);
wrapperEntity.setDoctorId(scheduleRecordEntity.getDoctorId());
wrapperEntity.setServiceCode(ImConstants.IM_QUERY_ACCOUNT_CODE);
wrapperEntity.setStatus(1);
queryWrapper.setEntity(wrapperEntity);
queryWrapper.last("limit 1");
ServiceConfigEntity serviceConfigEntity = serviceConfigMapper.selectOne(queryWrapper);
log.info("查询当前排班医生信息serviceConfigEntity={}", serviceConfigEntity);
if (Objects.nonNull(serviceConfigEntity) && serviceConfigEntity.getOfficeStatus().equals(-1)) {
serviceConfigEntity.setOfficeStatus(1);
serviceConfigMapper.updateById(serviceConfigEntity);
}
log.info("当前下单的医生:{}", JSON.toJSONString(scheduleRecordEntity)); log.info("当前下单的医生:{}", JSON.toJSONString(scheduleRecordEntity));
return scheduleRecordEntity; return scheduleRecordEntity;
} }
......
...@@ -4,16 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -4,16 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ebaiyihui.family.doctor.common.dto.RequestGetDoctorOfficeStatusDTO; import com.ebaiyihui.family.doctor.common.dto.RequestGetDoctorOfficeStatusDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestServiceConfigDTO; import com.ebaiyihui.family.doctor.common.dto.RequestServiceConfigDTO;
import com.ebaiyihui.family.doctor.common.vo.RequestOnlineOrOfflineVo; import com.ebaiyihui.family.doctor.common.vo.RequestOnlineOrOfflineVo;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.entity.ScheduleRecordEntity;
import com.ebaiyihui.family.doctor.server.entity.ServiceConfigEntity; import com.ebaiyihui.family.doctor.server.entity.ServiceConfigEntity;
import com.ebaiyihui.family.doctor.server.exception.BusinessException; import com.ebaiyihui.family.doctor.server.exception.BusinessException;
import com.ebaiyihui.family.doctor.server.mapper.ScheduleRecordMapper;
import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper; import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper;
import com.ebaiyihui.family.doctor.server.service.ServiceConfigService; import com.ebaiyihui.family.doctor.server.service.ServiceConfigService;
import com.ebaiyihui.family.doctor.server.util.DateUtils;
import com.ebaiyihui.framework.response.BaseResponse; import com.ebaiyihui.framework.response.BaseResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/** /**
* @ClassName: ServiceConfigServiceImpl * @ClassName: ServiceConfigServiceImpl
* @Author:yanliang * @Author:yanliang
...@@ -27,6 +34,9 @@ public class ServiceConfigServiceImpl implements ServiceConfigService { ...@@ -27,6 +34,9 @@ public class ServiceConfigServiceImpl implements ServiceConfigService {
@Autowired @Autowired
private ServiceConfigMapper serviceConfigMapper; private ServiceConfigMapper serviceConfigMapper;
@Autowired
private ScheduleRecordMapper scheduleRecordMapper;
@Override @Override
public RequestOnlineOrOfflineVo getDoctorOfficeStatus(RequestGetDoctorOfficeStatusDTO requestGetDoctorOfficeStatusDTO) { public RequestOnlineOrOfflineVo getDoctorOfficeStatus(RequestGetDoctorOfficeStatusDTO requestGetDoctorOfficeStatusDTO) {
QueryWrapper<ServiceConfigEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<ServiceConfigEntity> queryWrapper = new QueryWrapper<>();
...@@ -78,6 +88,13 @@ public class ServiceConfigServiceImpl implements ServiceConfigService { ...@@ -78,6 +88,13 @@ public class ServiceConfigServiceImpl implements ServiceConfigService {
throw new BusinessException("上线失败"); throw new BusinessException("上线失败");
} }
} }
String date = DateUtils.dateToSimpleString(new Date());
String hourAndSecond = DateUtils.getHourAndSecond();
// 查询排班医生信息
List<ScheduleRecordEntity> scheduleRecordEntities = scheduleRecordMapper.selectByDate(String.valueOf(CommonConstants.ORGAN_CODE), 5, date, 1, hourAndSecond, serviceConfigEntity.getDoctorId());
if (!scheduleRecordEntities.isEmpty()){
throw new BusinessException("不能上下线,您今天有值班!");
}
return requestOnlineOrOfflineVo; return requestOnlineOrOfflineVo;
} }
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
and status =1 and status =1
and start_time <![CDATA[<= ]]> #{endStart} and start_time <![CDATA[<= ]]> #{endStart}
and end_time <![CDATA[>= ]]> #{endStart} and end_time <![CDATA[>= ]]> #{endStart}
<if test="doctorId != null and doctorId != ''">
and doctor_id = #{doctorId}
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论