Browse Source

核酸检测

wangjun 4 năm trước cách đây
mục cha
commit
42ff2e7243

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

@ -10701,27 +10701,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    //患者取消预约
    public String cancelNatAppointment (Integer id,String patientId ){
    public String cancelNatAppointment (Integer id,String patientId ) throws Exception{
        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();
            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);
                if (res.contains("Error")){
                    throw new Exception(res);
                }
                baseNatAppointmentDO.setIsSuccess("-1");
                baseNatAppointmentDO.setCancelReson("患者本人取消");
                baseNatAppointmentDO.setCancelTime(new Date());
                baseNatAppointmentDO.setCancelBy(patientId);
                baseNatAppointmentDao.save(baseNatAppointmentDO);
            }
        }
        return res;
    }

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

@ -2524,8 +2524,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                               @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));
        try {
            return success(prescriptionService.cancelNatAppointment(id,patientId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/saveNatAppointment")
    @ApiOperation(value = "核酸检测预约接口")