wangjun 4 vuotta sitten
vanhempi
commit
29e1d19e9d

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/BaseNatAppointmentDao.java

@ -5,9 +5,11 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface BaseNatAppointmentDao extends PagingAndSortingRepository<BaseNatAppointmentDO, Integer>, JpaSpecificationExecutor<BaseNatAppointmentDO> {
    @Query("from BaseNatAppointmentDO t where t.payStatus = 0 ")
    List<BaseNatAppointmentDO> findByPayStatus();
}

+ 29 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -10446,7 +10446,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        net.sf.json.JSONObject rs = new JSONObject();
        if (map!=null){
            //先进行核算检测预约
            String result = entranceService.BS10144(map.get("deptCode").toString(),map.get("doctorMappingCode").toString(),natTime,mediaCard,name,patientId,mobile,demoFlag);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
            logger.info("核酸检测预约结束"+result);
@ -10475,6 +10474,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            jsondate.put("serialNo",registerDO.getRegisterNo());
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                        }else {
                            returnMap.put("msg","已经挂号的数据有误");
                            returnMap.put("status","-1");
@ -10565,7 +10565,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            returnMap.put("status","-1");
                            return map;
                        }
                        baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                    }
                } catch (Exception e) {
@ -10642,9 +10642,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            baseNatAppointmentDO.setSecondJobName(secondJobName);
            baseNatAppointmentDO.setProvinceName(provinceName);
            baseNatAppointmentDO.setTownName(townName);
            baseNatAppointmentDO.setStreet(streetName);
            baseNatAppointmentDO.setStreetName(streetName);
            baseNatAppointmentDO.setPatientId(patientId);
            baseNatAppointmentDO.setIsSuccess("0");
            baseNatAppointmentDO.setIsSuccess("1");
            baseNatAppointmentDO.setPayStatus("0");
            baseNatAppointmentDO.setCreateTime(new Date());
            baseNatAppointmentDO.setMobile(mobile);
@ -10662,7 +10662,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.mobile as \"mobile\"," +
                "t.inspection_name as \"inspectionName\"," +
                "t.real_order as \"realOrder\"," +
                "t.real_order as \"realOrder\"," +
                "t.is_success as \"isSuccess\"," +
                "t.create_time as \"createTime\"," +
                "t.appointment_time as \"appointmentTime\" " +
@ -10699,5 +10698,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return list;
    }
    //患者取消预约
    public String cancelNatAppointment (Integer id,String patientId ){
        BasePatientDO patientDO = basePatientDao.findById(patientId);
        String res = "";
        if (patientDO!=null){
            String patientCode = null;
            try {
                patientCode = patientMappingService.findHisPatNoByIdCard(patientDO.getIdcard());
                BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
                if (null!=baseNatAppointmentDO){
                    res = entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(),DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),patientCode,baseNatAppointmentDO.getMobile(),demoFlag);
                    baseNatAppointmentDO.setIsSuccess("-1");
                    baseNatAppointmentDO.setCancelReson("患者本人取消");
                    baseNatAppointmentDO.setCancelTime(new Date());
                    baseNatAppointmentDO.setCancelBy(patientId);
                    baseNatAppointmentDao.save(baseNatAppointmentDO);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return res;
    }
}

+ 10 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java

@ -6,6 +6,7 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.BaseNatAppointmentDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
@ -13,6 +14,7 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
@ -88,6 +90,8 @@ public class TimeoutOverDueService {
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private EntranceService entranceService;
    @Autowired
    private PatientMappingDao patientMappingDao;
    /**
     *  取消未结束门诊
     */
@ -229,7 +233,12 @@ public class TimeoutOverDueService {
                }
                //取消预约
                try {
                    entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(), DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getMobile(),false);
                    PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(baseNatAppointmentDO.getPatientId());
                    String userNo = null;
                    if (patientMappingDO != null) {
                        userNo = patientMappingDO.getMappingCode();
                    }
                    entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(), DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),userNo,baseNatAppointmentDO.getMobile(),false);
                    //取消挂号
                } catch (Exception e) {
                    e.printStackTrace();

+ 6 - 15
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2520,21 +2520,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(entranceService.BS10144(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag));
    }
    @GetMapping("/BS10145")
    public Envelop BS10145(@ApiParam(name = "deptCode", value = "deptCode")
                               @RequestParam(value = "deptCode",required = false)String deptCode,
                           @ApiParam(name = "docCode", value = "docCode")
                               @RequestParam(value = "docCode",required = false)String docCode,
                           @ApiParam(name = "startTime", value = "startTime")
                               @RequestParam(value = "startTime",required = false)String startTime,
                           @ApiParam(name = "sSID", value = "sSID")
                               @RequestParam(value = "sSID",required = false)String sSID,
                           @ApiParam(name = "patientName", value = "patientName")
                               @RequestParam(value = "patientName",required = false)String patientName,
                           @ApiParam(name = "patientID", value = "patientID")
                               @RequestParam(value = "patientID",required = false)String patientID,
                           @ApiParam(name = "patientPhone", value = "patientPhone")
                               @RequestParam(value = "patientPhone",required = false)String patientPhone) throws Exception {
        return success(entranceService.BS10145(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag));
    public Envelop BS10145(@ApiParam(name = "id", value = "id")
                               @RequestParam(value = "id",required = false)Integer id,
                           @ApiParam(name = "patientId", value = "patientId")
                               @RequestParam(value = "patientId",required = false)String patientId) throws Exception {
        return success(prescriptionService.cancelNatAppointment(id,patientId));
    }
    @GetMapping("/saveNatAppointment")
    @ApiOperation(value = "核酸检测预约接口")