فهرست منبع

医生管理员号别修改

wangjun 4 سال پیش
والد
کامیت
27a7b5ce12

+ 87 - 3
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -140,7 +140,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tn.req_fee as \"spfzFee\",\n" +
                "\tp.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\td.req_fee as \"xtzxFee\"\n" +
                "\td.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\"\n" +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -150,6 +151,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict p ON a.spzx_charge_type = p.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict d ON a.xtfz_charge_type = d.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type\n" +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
@ -204,7 +206,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tn.req_fee as \"spfzFee\",\n" +
                "\tp.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\tq.req_fee as \"xtzxFee\"\n" +
                "\tq.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\"\n" +
                " FROM " +
                " base_doctor a " +
                " LEFT JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -216,6 +219,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict p ON a.spzx_charge_type = p.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict q ON a.xtfz_charge_type = q.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type\n" +
                " WHERE 1=1 ";
        if(StringUtils.isNotBlank(doctorId)){
            sql+=" AND a.id =:id";
@ -285,7 +289,64 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        String outpatientType = jsonObject.get("outpatientType").toString();
        String newSpecialDisease = jsonObject.get("specialDisease").toString();
        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctorId);
        if (doctorDO!=null){
            doctorDO.setIntroduce(introduce);
            doctorDO.setExpertise(expertise);
            doctorDO.setPhoto(photo);
            doctorDO.setOutpatientType(outpatientType);
            if (StringUtils.isNoneBlank(jsonObject.get("TWZXFee")==null?"":jsonObject.get("TWZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("TWZXFee").toString(),doctorDO.getName());
                doctorDO.setTwzxChargeType(chargeType);
            }else {
                if (jsonObject.get("TWZXType")!=null) {
                    doctorDO.setTwzxChargeType(jsonObject.get("TWZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("SPZXFee")==null?"":jsonObject.get("SPZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("SPZXFee").toString(),doctorDO.getName());
                doctorDO.setSpzxChargeType(chargeType);
            }else {
                if (jsonObject.get("SPZXType")!=null) {
                    doctorDO.setSpzxChargeType(jsonObject.get("SPZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("TWFZFee")==null?"":jsonObject.get("TWFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("TWFZFee").toString(),doctorDO.getName());
                doctorDO.setTwfzChargeType(chargeType);
            }else {
                if (jsonObject.get("TWFZType")!=null){
                    doctorDO.setTwfzChargeType(jsonObject.get("TWFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("SPFZFee")==null?"":jsonObject.get("SPFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("SPFZFee").toString(),doctorDO.getName());
                doctorDO.setSpfzChargeType(chargeType);
            }else {
                if (jsonObject.get("SPFZType")!=null){
                    doctorDO.setSpfzChargeType(jsonObject.get("SPFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("JYZXFee")==null?"":jsonObject.get("JYZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("JYZXFee").toString(),doctorDO.getName());
                doctorDO.setJyzxChargeType(chargeType);
            }else {
                if (jsonObject.get("JYZXType")!=null){
                    doctorDO.setJyzxChargeType(jsonObject.get("JYZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("XTFZFee")==null?"":jsonObject.get("XTFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("XTFZFee").toString(),doctorDO.getName());
                doctorDO.setXtfzChargeType(chargeType);
            }else {
                if (jsonObject.get("XTFZType")!=null){
                    doctorDO.setXtfzChargeType(jsonObject.get("XTFZType").toString());
                }
            }
        }
        //baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        baseDoctorDao.save(doctorDO);
        //删除医生旧专病门诊,保存新专病门诊
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
@ -487,4 +548,27 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public String findOrCreateChargeType(String fee,String doctorName){
        if (StringUtils.isNoneBlank(fee)){
            double chargeFee = Double.parseDouble(fee);
            WlyyChargeDictDO wlyyChargeDictDO = wlyyChargeDictDao.findByReqFee(chargeFee);
            if (null!=wlyyChargeDictDO){
                return wlyyChargeDictDO.getChargeType();
            }else {
                wlyyChargeDictDO = new WlyyChargeDictDO();
                wlyyChargeDictDO.setCreateTime(new Date());
                wlyyChargeDictDO.setReqFee(chargeFee);
                wlyyChargeDictDO.setChargeType(fee+"");
                wlyyChargeDictDO.setChargeName(doctorName+"创建的号别");
                wlyyChargeDictDO = wlyyChargeDictDao.save(wlyyChargeDictDO);
                return  wlyyChargeDictDO.getChargeType();
            }
        }else {
            return "";
        }
    }
    public List<WlyyChargeDictDO> findChargeDicts(){
        List<WlyyChargeDictDO> wlyyChargeDictDOS =  wlyyChargeDictDao.findByDeptTypeCode("6");
        return wlyyChargeDictDOS;
    }
}

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

@ -1631,6 +1631,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "\ta.req_fee as \"spfzFee\",\n" +
                        "\tb.req_fee as \"spzxFee\",\n" +
                        "\tv.req_fee as \"twzxFee\",\n" +
                        "\tg.req_fee as \"jyzxFee\",\n" +
                        "\td.req_fee as \"xtzxFee\"\n" +
                        "FROM\n" +
                        "\tbase_doctor t\n" +
@ -1638,7 +1639,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                        " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                        "WHERE t.id = '"+doctor.get("id")+"' ";
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
                /*if (null!=doctor.get("chargeType")){
@ -3577,6 +3578,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -3585,6 +3587,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            rs.put("chargeTypeList",chargeDictDOLists);
@ -3861,6 +3864,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -3869,6 +3873,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            rs.put("chargeTypeList",chargeDictDOLists);
@ -4676,7 +4681,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else {
            sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
        }
        sql += "outpatient.disease_img AS \"disease_img\"," +
        sql += " outpatient.disease_img AS \"disease_img\"," +
                "outpatient.description AS \"description\"," +
                "room.reservation_type AS \"reservation_type\"," +
                "outpatient.origin_con_no AS \"origin_con_no\" " +
@ -4716,7 +4721,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //在线复诊
            sql += " AND room.reservation_type !=3 AND room.consult_type =2";
        } else {
            sql += " AND room.reservation_type !=2";
        }
        if (StringUtils.isNoneBlank(dept)) {
@ -5442,6 +5447,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -5450,6 +5456,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+map.get("id")+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            map.put("chargeTypeList",chargeDictDOLists);
@ -9656,19 +9663,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                }
                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (!doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
                                    if (!doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zjsp");
                                    }
                                }else {
                                    doctorDO.setOutpatientType("zj");
                                    doctorDO.setOutpatientType("zjsp");
                                }
                            }else {
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.getOutpatientType().replace(",zj","");
                                    if (doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.getOutpatientType().replace(",zjsp","");
                                    }
                                }else{
                                    doctorDO.setOutpatientType("zj");
                                    doctorDO.setOutpatientType("zjsp");
                                }
                            }
@ -9754,11 +9761,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (!doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
                            if (!doctorDO.getOutpatientType().contains("zjsp")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zjsp");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                            doctorDO.setOutpatientType("zjsp");
                        }
                    }
                    baseDoctorDao.save(doctorDO);
@ -9776,10 +9783,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "\tt.source as \"source\",\n" +
                "\tt.outpatient_type as \"outpatientType\",\n" +
                "\tt.create_time as \"createTime\",\n" +
                "\th.org_code as \"orgCode\",\n" +
                "\tb.idcard as \"idCard\" \n" +
                "FROM\n" +
                "\twlyy_outpatient t\n" +
                "\tLEFT JOIN base_patient b ON t.patient = b.id where 1=1 ";
                "\tLEFT JOIN base_patient b ON t.patient = b.id " +
                " left join base_doctor_hospital h on t.doctor = h.doctor_code where 1=1 ";
        if (StringUtils.isNoneBlank(startTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
@ -9806,11 +9815,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        for (Map<String,Object> map:list){
            if (map.get("createTime")!=null){
                map.put("createTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(map.get("createTime").toString())));
                map.put("orgCode",wechatId);
            }
        }
        return list;
    }
    public com.alibaba.fastjson.JSONObject getWorkDoctorCount(String nowTime,String orgCode){
        String sql = "select count(*) as \"total\",t.doctor as \"doctor\" from wlyy_doctor_work_time t " +
                " left join base_doctor_hospital b on t.doctor = b.doctor_code where 1=1 ";
        if(StringUtils.isNoneBlank(nowTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
                }else {
                    sql+=" and t.start_time >= to_date('" + nowTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and t.end_time <=to_date('"+nowTime+" 23:59:59', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
            }
        }
        if(StringUtils.isNoneBlank(orgCode)){
            sql+=" and b.org_code ='"+orgCode+"'";
        }
        sql+=" group by t.doctor";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        long count =0;
        if(list!=null){
            count = list.size();
        }
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("workDoctorCount",count);
        return  jsonObject;
    }
}

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -276,6 +276,18 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * 协同复诊号别
     */
    private String xtfzChargeType;
    /**
     * 家医咨询号别
     */
    private String jyzxChargeType;
    @Column(name = "jyzx_charge_type")
    public String getJyzxChargeType() {
        return jyzxChargeType;
    }
    public void setJyzxChargeType(String jyzxChargeType) {
        this.jyzxChargeType = jyzxChargeType;
    }
    @Column(name = "YKT_DOCTOR_ID")
    public String getYktDoctorId() {

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

@ -1415,6 +1415,8 @@ public class BaseHospitalRequestMapping {
        public static final String findHospitalInfo = "/findHospitalInfo";
        public static final String synYktZxPrice = "/synYktZxPrice";
        public static final String findHospitalConsultInfo = "/findHospitalConsultInfo";
        public static final String findDictLists = "/findDictLists";
        public static final String findWorkDoctorCount = "/findWorkDoctorCount";
    }
    /**

+ 17 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -1151,4 +1151,21 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return success(prescriptionService.findOutpatientAndPatient(startTime,endTime));
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictLists)
    @ApiOperation(value = "查询基础号别字典", notes = "查询基础号别字典")
    public ListEnvelop findDictLists() throws Exception{
        return success(baseDoctorService.findChargeDicts());
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findWorkDoctorCount)
    @ApiOperation(value = "查询医生排版数量", notes = "查询医生排版数量")
    public ObjEnvelop<JSONObject> findWorkDoctorCount(
            @ApiParam(name = "nowTime", value = "当前时间 yyyy-MM-dd hh:mm:ss")
            @RequestParam(value = "nowTime", required = false)String nowTime,
            @ApiParam(name = "orgCode", value = "医院code")
            @RequestParam(value = "orgCode", required = false)String orgCode) throws Exception{
        return success(prescriptionService.getWorkDoctorCount(nowTime,orgCode));
    }
}