瀏覽代碼

冲突解决

wangjun 4 年之前
父節點
當前提交
52c6e7157c

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

@ -11222,11 +11222,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\"," +
@ -11246,7 +11249,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 + "%'";
@ -11265,23 +11268,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'";
            }
        }

+ 17 - 9
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -3283,15 +3283,15 @@ public class YkyyEntranceService {
        String jzkhSql = "SELECT brid \"brid\",sfzh \"sfzh\" from portal_his.V_ZKSG_BRCX@xec_link where jzkh = '" + medicare + "' order by JDSJ ";
        JSONArray sfzhArray = getSqlResult(sfzhSql);
        int size = sfzhArray.size();
        if (size == 1) {
        /*if (size == 1) {
            JSONObject json = sfzhArray.getJSONObject(0);
            Object jzkh = json.get("jzkh");//社保卡
            //获取居民信息
            brid = json.getFloat("brid");//病人id
            if (jzkh != null && !jzkh.toString().equals(medicare)) {//判断是否跟当前医保卡号一致
                res.put("status", -1);
                res.put("message", "您输入的卡号和该就诊人在医院预留的卡号不一致,请重新输入。");
                return res;
//                res.put("status", -1);
//                res.put("message", "您输入的卡号和该就诊人在医院预留的卡号不一致,请重新输入。");
//                return res;
            } else if (jzkh == null) {//若为空则更新社保卡
                Map<String, Object> updateParams = new HashedMap();
                updateParams.put("brid", brid);
@ -3309,13 +3309,21 @@ public class YkyyEntranceService {
                    return res;
                }
            }
        } else if (size > 1) {//如果存在多条数据,查看是否有跟当前社保卡号一致的,如果有则跳过,如果社保卡都为空则取其中一条更新,否则就提示与预留卡号不一致
        } else*/ if (size > 1) {//如果存在多条数据,查看是否有跟当前社保卡号一致的,如果有则跳过,如果社保卡都为空则取其中一条更新,否则就提示与预留卡号不一致
            if(size > 6){
                throw new Exception("建档超过6次,请到线下变更。");
            }else {
            String sql = "SELECT brid \"brid\" from portal_his.V_ZKSG_BRCX@xec_link where sfzh = '" + idcard + "' and  jzkh = '" + medicare + "' ";
            JSONArray array = getSqlResult(sql);
            logger.info("查询身份证和社保卡:" + array.toString());
            /*if (array==null||array.size()==0){
                res.put("status", -1);
                res.put("message", "您输入的卡号和该就诊人在医院预留的卡号不一致,请重新输入。");
                return res;
            }*/
            if (array.size() == 1) {
                brid = sfzhArray.getJSONObject(0).getFloat("brid");
            } else { //否则就去最早一条更新
            } }/*else { //否则就去最早一条更新
                String nullSql = "SELECT brid \"brid\" from portal_his.V_ZKSG_BRCX@xec_link where sfzh = '" + idcard + "' and  jzkh is null ";
                Integer count = getSqlResult(nullSql).size();
                if (count == size) {//如果都为空就默认取一条,然后更新社保卡号
@ -3339,14 +3347,14 @@ public class YkyyEntranceService {
                    res.put("status", -1);
                    res.put("message", "您输入的卡号和该就诊人在医院预留的卡号不一致,请重新输入。");
                    return res;
                }
                }*/
            }
        } else { //身份证号没查到信息,就用社保卡号查询
        /*} else { //身份证号没查到信息,就用社保卡号查询
            JSONArray jzkhArray = getSqlResult(jzkhSql);
            if (jzkhArray!=null&&jzkhArray.size()>0){
                brid = jzkhArray.getJSONObject(0).getFloat("brid");
            }
        }
        }*/
        //查询是否有这个病人id 如果有直接返回 如果没有则新建
        if (brid == null)
        {

+ 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());
        }