瀏覽代碼

修改获取核酸记录接口

humingfen 4 年之前
父節點
當前提交
889f8bc82b

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

@ -11182,11 +11182,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param medicare 社保卡
     * @param createTime 创建时间
     * @param appointmentTime 预约时间
     * @param appointmentTimeStart
     * @param appointmentTimeEnd
     * @param page
     * @param pageSize
     * @param size
     * @return
     */
    public Envelop getNatAppointmentList(String realOrder, String name, String hospitalFlag, String mobile, String idcard, String payStatus, String medicare, String createTime, String appointmentTime, Integer page, Integer pageSize) {
    public Envelop getNatAppointmentList(String realOrder, String name, String hospitalFlag, String mobile, String idcard, String payStatus, String medicare, String createTimeStart, String createTimeEnd, String appointmentTimeStart, String appointmentTimeEnd, Integer isSuccess, Integer page, Integer pageSize) {
        String sql = "select t.name as \"name\"," +
                "t.card_no as \"cardNo\"," +
                "t.card_type as \"cardType\"," +
@ -11206,7 +11209,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNotBlank(realOrder)) {
            sql += " and t.real_order = '" + realOrder + "' ";
            sql += " and t.real_order like '%" + realOrder + "%' ";
        }
        if (StringUtils.isNotBlank(name)) {
            sql += " and t.name like '%" + name + "%'";
@ -11225,23 +11228,42 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (StringUtils.isNotBlank(medicare)) {
            sql += " and t.medicare like '%" + medicare + "%' ";
        }
        if (StringUtils.isNotBlank(appointmentTime)) {
        if (StringUtils.isNotBlank(hospitalFlag)) {
            sql += " and t.hospital_flag ='" + hospitalFlag + "' ";
        }
        if(isSuccess != null){
            sql += " and t.is_success = " + isSuccess ;
        }
        if (StringUtils.isNotBlank(appointmentTimeStart)) {
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                sql += " and t.appointment_time >= to_date('" + appointmentTimeStart + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss')";
//                sql += " and t.appointment_time <= to_date('" + appointmentTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
            } else {
                sql += " and t.appointment_time >='" + appointmentTimeStart + " 00:00:00'";
//                sql += " and t.appointment_time <='" + appointmentTime + " 23:59:59'";
            }
        }
        if (StringUtils.isNotBlank(appointmentTimeEnd)) {
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                sql += " and t.appointment_time <= to_date('" + appointmentTimeEnd + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
            } else {
                sql += " and t.appointment_time <='" + appointmentTimeEnd + " 23:59:59' ";
            }
        }
        if (StringUtils.isNotBlank(createTimeStart)) {
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                sql += " and t.appointment_time >= to_date('" + appointmentTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss')";
                sql += " and t.appointment_time <= to_date('" + appointmentTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
                sql += " and t.create_time >= to_date('" + createTimeStart + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss')";
//                sql+=" and t.create_time <= to_date('" + createTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
            } else {
                sql += " and t.appointment_time >='" + appointmentTime + " 00:00:00'";
                sql += " and t.appointment_time <='" + appointmentTime + " 23:59:59'";
                sql += " and t.create_time >='" + createTimeStart + " 00:00:00' ";
//                sql+=" and t.create_time <='"+createTime+" 23:59:59'";
            }
        }
        if (StringUtils.isNotBlank(createTime)) {
        if (StringUtils.isNotBlank(createTimeEnd)) {
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                sql += " and t.create_time >= to_date('" + createTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss')";
                sql+=" and t.create_time <= to_date('" + createTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
                sql+=" and t.create_time <= to_date('" + createTimeEnd + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
            } else {
                sql += " and t.create_time >='" + createTime + " 00:00:00'";
                sql+=" and t.create_time <='"+createTime+" 23:59:59'";
                sql+=" and t.create_time <='"+createTimeEnd+" 23:59:59'";
            }
        }

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

@ -2651,16 +2651,22 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = false) String payStatus,
            @ApiParam(name = "medicare", value = "医保卡号", required = false)
            @RequestParam(required = false) String medicare,
            @ApiParam(name = "createTime", value = "创建时间", required = false)
            @RequestParam(required = false) String createTime,
            @ApiParam(name = "appointmentTime", value = "预约时间", required = false)
            @RequestParam(required = false) String appointmentTime,
            @ApiParam(name = "createTimeStart", value = "创建时间", required = false)
            @RequestParam(required = false) String createTimeStart,
            @ApiParam(name = "createTimeEnd", value = "创建时间", required = false)
            @RequestParam(required = false) String createTimeEnd,
            @ApiParam(name = "appointmentTimeStart", value = "预约时间", required = false)
            @RequestParam(required = false) String appointmentTimeStart,
            @ApiParam(name = "appointmentTimeEnd", value = "预约时间", required = false)
            @RequestParam(required = false) String appointmentTimeEnd,
            @ApiParam(name = "isSuccess", value = "1成功  0失败")
            @RequestParam(value = "isSuccess", required = false) Integer isSuccess,
            @ApiParam(name = "page", value = "页数")
            @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "pageSize", value = "每页大小")
            @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        try {
            return prescriptionService.getNatAppointmentList(realOrder, name, hospitalFlag, mobile, idcard, payStatus, medicare, createTime, appointmentTime, page, pageSize);
            return prescriptionService.getNatAppointmentList(realOrder, name, hospitalFlag, mobile, idcard, payStatus, medicare, createTimeStart, createTimeEnd, appointmentTimeStart,appointmentTimeEnd,isSuccess, page, pageSize);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }