Trick před 5 roky
rodič
revize
83cdeca5ab

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

@ -258,6 +258,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //居民详情
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
        rs.put("patientName",basePatientDO.getName());
        rs.put("photo",basePatientDO.getPhoto());
        rs.put("patientId",basePatientDO.getId());
        rs.put("idCard",basePatientDO.getIdcard());
        rs.put("sex", basePatientDO.getSex());
@ -310,6 +311,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("expressageLogs",null);
        }
        //预约记录
        List<WlyyPatientRegisterTimeDO> timeDOs = patientRegisterTimeDao.findByOutpatientId(outpatientId);
        if(timeDOs!=null&&timeDOs.size()>0){
            rs.put("register",timeDOs.get(0));
        }else{
            rs.put("register",null);
        }
        return rs;
    }
@ -1420,4 +1429,96 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public List<WlyyHospitalSysDictDO> findCancelReasonList(){
        return sysDictDao.findByDictName("PatientCancel");
    }
    /**
     * 獲取快速咨詢時間
     * @return
     */
    public List<Map<String,Object>> findFastRegisterDate(){
        int days = 7;
        String AMStartTime ="8:00";
        String AMEndTime ="12:00";
        String PMStartTime ="14:00";
        String PMEndTime ="17:00";
        //设置上午过号时间
        Calendar scTime = Calendar.getInstance();
        scTime.setTime(new Date());
        Calendar ecTime = Calendar.getInstance();
        ecTime.setTime(new Date());
        List<Map<String,Object>> times = new ArrayList<>();
        for(int i=0;i<days;i++){
            //設置上午時段
            Map<String,Object> time = new HashedMap();
            time.put("timeType","1");
            time.put("date",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd"));
            time.put("weekDay",scTime.get(Calendar.DAY_OF_WEEK));
            String ts[] = AMStartTime.split(":");
            scTime.set(scTime.get(Calendar.YEAR),scTime.get(Calendar.MONTH),scTime.get(Calendar.DAY_OF_MONTH),Integer.parseInt(ts[0]),Integer.parseInt(ts[1]),00);
            time.put("startTime",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd HH:mm:ss"));
            String ts2[] = AMEndTime.split(":");
            scTime.set(scTime.get(Calendar.YEAR),scTime.get(Calendar.MONTH),scTime.get(Calendar.DAY_OF_MONTH),Integer.parseInt(ts2[0]),Integer.parseInt(ts2[1]),00);
            time.put("endTime",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd HH:mm:ss"));
            times.add(time);
            //設置下午時段
            Map<String,Object> time2 = new HashedMap();
            time2.put("timeType","2");
            time2.put("date",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd"));
            time2.put("weekDay",scTime.get(Calendar.DAY_OF_WEEK));
            String pts[] = PMStartTime.split(":");
            scTime.set(scTime.get(Calendar.YEAR),scTime.get(Calendar.MONTH),scTime.get(Calendar.DAY_OF_MONTH),Integer.parseInt(pts[0]),Integer.parseInt(pts[1]),00);
            time2.put("startTime",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd HH:mm:ss"));
            String pts2[] = PMEndTime.split(":");
            scTime.set(scTime.get(Calendar.YEAR),scTime.get(Calendar.MONTH),scTime.get(Calendar.DAY_OF_MONTH),Integer.parseInt(pts2[0]),Integer.parseInt(pts2[1]),00);
            time2.put("endTime",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd HH:mm:ss"));
            times.add(time2);
            //生成下一天
            scTime.add(Calendar.DAY_OF_MONTH,1);
        }
        if(DateUtil.strToDate(DateUtil.getTimeShort(),DateUtil.HH_MM).after(DateUtil.strToDate(AMEndTime,DateUtil.HH_MM))) {
            times.remove(0);
        }
        if(DateUtil.strToDate(DateUtil.getTimeShort(),DateUtil.HH_MM).after(DateUtil.strToDate(PMEndTime,DateUtil.HH_MM))) {
            times.remove(0);
        }
        return times;
    }
    /**
     * 获取快速咨询时间分段
     * @param startTime
     * @param endTime
     * @return
     */
    public List<Map<String,Object>> findByTimeSlot(String startTime,String endTime){
        int interval = 30;
        List<Map<String,Object>> times = new ArrayList<>();
        //设置上午过号时间
        Calendar scTime = Calendar.getInstance();
        scTime.setTime(DateUtil.stringToDate(startTime,"yyyy-MM-dd HH:mm:ss"));
        Calendar ecTime = Calendar.getInstance();
        ecTime.setTime(DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss"));
        while (scTime.getTime().before(ecTime.getTime())){
            if(new Date().before(scTime.getTime())){
                Map<String,Object> time = new HashedMap();
                time.put("startTime",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd HH:mm:ss"));
                scTime.add(Calendar.MINUTE,interval);
                time.put("endTime",DateUtil.dateToStr(scTime.getTime(),"yyyy-MM-dd HH:mm:ss"));
                times.add(time);
            }else{
                scTime.add(Calendar.MINUTE,interval);
            }
        }
        return times;
    }
}

+ 14 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java

@ -169,6 +169,11 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
     * 患者取消类型详细说明
     */
    private String patientCancelRemark;
    /**
     * 预约时间
     */
    private Date registerDate;
    /**
	 * -1 取消;0 候诊中 ;1 就诊中 ;2 已诊
	 */
@ -436,4 +441,13 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    public void setPatientCancelRemark(String patientCancelRemark) {
        this.patientCancelRemark = patientCancelRemark;
    }
    @Column(name="register_date")
    public Date getRegisterDate() {
        return registerDate;
    }
    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
}

+ 9 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -153,6 +153,15 @@ public class BaseHospitalRequestMapping {
         * 居民取消原因字典
         */
        public static final String findCancelReasonList="/findCancelReasonList";
        /**
         * 獲取快速咨詢時間
         */
        public static final String findFastRegisterDate="/findFastRegisterDate";
        /**
         * 获取快速咨询时间分段
         */
        public static final String findByTimeSlot="/findByTimeSlot";
        //=================end=======================================
        /**

+ 12 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyOutpatientVO.java

@ -172,6 +172,10 @@ public class WlyyOutpatientVO extends UuidIdentityVO {
    @ApiModelProperty(value = "创建时间", example = "模块1")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @ApiModelProperty(value = "预约时间", example = "模块1")
    private Date registerDate;
    /**
	 * -1 取消;0 候诊中 ;1 就诊中 ;2 已诊
	 */
@ -380,4 +384,12 @@ public class WlyyOutpatientVO extends UuidIdentityVO {
    public void setType(String type) {
        this.type = type;
    }
    public Date getRegisterDate() {
        return registerDate;
    }
    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
}

+ 6 - 5
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java

@ -70,7 +70,7 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
     * 频率
     */
    @ApiModelProperty(value = "频率", example = "模块1")
    private String usage;
    private String usageCode;
    @ApiModelProperty(value = "频率名稱", example = "模块1")
    private String usageName;
@ -167,11 +167,12 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
        this.unit = unit;
    }
    public String getUsage() {
        return usage;
    public String getUsageCode() {
        return usageCode;
    }
    public void setUsage(String usage) {
        this.usage = usage;
    public void setUsageCode(String usageCode) {
        this.usageCode = usageCode;
    }
    public String getSupplyCode() {

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

@ -374,7 +374,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(prescriptionService.findCancelReasonList());
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findFastRegisterDate)
    @ApiOperation(value = "獲取快速咨詢時間", notes = "獲取快速咨詢時間")
    public ListEnvelop findFastRegisterDate(){
        return success(prescriptionService.findFastRegisterDate());
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByTimeSlot)
    @ApiOperation(value = "获取快速咨询时间分段", notes = "获取快速咨询时间分段")
    public ListEnvelop findByTimeSlot(@ApiParam(name = "startTime", value = "开始时间")
                                      @RequestParam(value = "startTime", required = false)String startTime,
                                      @ApiParam(name = "endTime", value = "结束时间")
                                      @RequestParam(value = "endTime", required = false)String endTime) {
        return success(prescriptionService.findByTimeSlot(startTime,endTime));
    }
    //===========