Преглед изворни кода

Merge branch 'dev' of humingfen/wlyy2.0 into dev

humingfen пре 4 година
родитељ
комит
06d5b7f34e

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

@ -72,9 +72,7 @@ import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.IdCardUtil;
@ -11173,4 +11171,102 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    }
    /**
     * 获取核酸检测记录
     * @param realOrder 处方号
     * @param name 居民姓名
     * @param hospitalFlag 机构
     * @param mobile 电话
     * @param idcard 身份证
     * @param payStatus 支付状态
     * @param medicare 社保卡
     * @param createTime 创建时间
     * @param appointmentTime 预约时间
     * @param page
     * @param pageSize
     * @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) {
        String sql = "select t.name as \"name\"," +
                "t.card_no as \"cardNo\"," +
                "t.card_type as \"cardType\"," +
                "t.mobile as \"mobile\"," +
                "t.inspection_name as \"inspectionName\"," +
                "t.real_order as \"realOrder\"," +
                "t.is_success as \"isSuccess\"," +
                "t.create_time as \"createTime\"," +
                "t.pay_status as \"payStatus\"," +
                "t.medicare as \"medicare\"," +
                "t.voucher_no as \"voucherNo\"," +
                "t.dept as \"dept\"," +
                "t.dept_name as \"deptName\"," +
                "t.id as \"id\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.HOSPITAL_FLAG as \"hospitalFlag\"," +
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNotBlank(realOrder)) {
            sql += " and t.real_order = '" + realOrder + "' ";
        }
        if (StringUtils.isNotBlank(name)) {
            sql += " and t.name like '%" + name + "%'";
        }
        if (StringUtils.isNotBlank(mobile)) {
            sql += " and t.mobile like '%" + mobile + "%' ";
        }
        if (StringUtils.isNotBlank(idcard)) {
            sql += " and t.card_no like '%" + idcard + "%' ";
        }
        //支付状态
        if (StringUtils.isNotBlank(payStatus)) {
            sql += " and t.pay_status ='" + payStatus + "' ";
        }
        //社保卡
        if (StringUtils.isNotBlank(medicare)) {
            sql += " and t.medicare like '%" + medicare + "%' ";
        }
        if (StringUtils.isNotBlank(appointmentTime)) {
            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')";
            } else {
                sql += " and t.appointment_time >='" + appointmentTime + " 00:00:00'";
                sql += " and t.appointment_time <='" + appointmentTime + " 23:59:59'";
            }
        }
        if (StringUtils.isNotBlank(createTime)) {
            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')";
            } else {
                sql += " and t.create_time >='" + createTime + " 00:00:00'";
                sql+=" and t.create_time <='"+createTime+" 23:59:59'";
            }
        }
        sql += " order by t.appointment_time desc ";
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, page, pageSize);
        List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sql);
        logger.info("查询数据" + sql);
        if (page != null && pageSize != null) {
            MixEnvelop envelop = new MixEnvelop();
            envelop.setStatus(200);
            envelop.setMessage("获取成功!");
            if (listCount != null && listCount.size() > 0) {
                envelop.setCurrPage(page);
                envelop.setPageSize(pageSize);
                envelop.setTotalCount(listCount.size());
                envelop.setDetailModelList(list);
            }
            return envelop;
        }else {
            ListEnvelop envelop = new ListEnvelop();
            envelop.setStatus(200);
            envelop.setMessage("获取成功!");
            envelop.setDetailModelList(list);
            return envelop;
        }
    }
}
}

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

@ -2634,5 +2634,36 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @RequestMapping(value = "getNatAppointmentList", method = RequestMethod.GET)
    @ApiOperation("获取核酸检测记录")
    public Envelop getNatAppointmentList(
            @ApiParam(name = "realOrder", value = "处方号", required = false)
            @RequestParam(required = false) String realOrder,
            @ApiParam(name = "name", value = "患者姓名", required = false)
            @RequestParam(required = false) String name,
            @ApiParam(name = "hospitalFlag", value = "机构", required = false)
            @RequestParam(required = false) String hospitalFlag,
            @ApiParam(name = "mobile", value = "电话", required = false)
            @RequestParam(required = false) String mobile,
            @ApiParam(name = "idcard", value = "身份证", required = false)
            @RequestParam(required = false) String idcard,
            @ApiParam(name = "payStatus", value = "支付状态", required = false)
            @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 = "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);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}
}