Bläddra i källkod

互联网医院

Trick 5 år sedan
förälder
incheckning
29e53ff5e2

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

@ -42,12 +42,15 @@ import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import jxl.write.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -670,7 +673,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param dept
     * @return
     */
    public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate){
    public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate,String key){
        String sql ="SELECT " +
                " d.id, " +
                " d.photo, " +
@ -686,8 +689,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " WHERE  " +
                " h.dept_code = '"+dept+"' " +
                " AND h.org_code = '"+orgCode+"'";
                " 1=1";
        if(StringUtils.isNotBlank(dept)){
            sql+= " AND h.dept_code = '"+dept+"'";
        }
        if(StringUtils.isNotBlank(orgCode)){
            sql+= " AND h.org_code = '"+orgCode+"'";
        }
        if(StringUtils.isNotBlank(chargeType)){
            sql+=" AND d.charge_type ='"+chargeType+"'";
        }
@ -696,6 +704,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else{
            sql+=" AND d.outpatient_type is not null ";
        }
        if(StringUtils.isNotBlank(key)){
            sql+=" AND (h.dept_name like '%"+key+"%' OR d.name like '%"+key+"%' OR d.expertise like '%"+key+"%') ";
        }
        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){
            sql+=" AND EXISTS ( " +
                    " SELECT " +
@ -729,7 +740,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param dept
     * @return
     */
    public MixEnvelop findDoctorWithWork(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate,Integer page,Integer size){
    public MixEnvelop findDoctorWithWork(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate,String key,Integer page,Integer size){
        String totalSql ="SELECT " +
                " count(1) AS total " +
@ -737,16 +748,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " WHERE  " +
                " h.dept_code = '"+dept+"' " +
                " AND h.org_code = '"+orgCode+"'";
                " 1=1 ";
        if(StringUtils.isNotBlank(dept)){
            totalSql+= " AND h.dept_code = '"+dept+"'";
        }
        if(StringUtils.isNotBlank(orgCode)){
            totalSql+= " AND h.org_code = '"+orgCode+"'";
        }
        if(StringUtils.isNotBlank(chargeType)){
            totalSql+=" AND d.charge_type ='"+chargeType+"'";
            totalSql+= " AND d.charge_type ='"+chargeType+"'";
        }
        if(StringUtils.isNotBlank(outpatientType)){
            totalSql+=" AND d.outpatient_type like'%"+outpatientType+"%'";
            totalSql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
        }else{
            totalSql+=" AND d.outpatient_type is not null ";
        }
        if(StringUtils.isNotBlank(key)){
            totalSql+=" AND (h.dept_name like '%"+key+"%' OR d.name like '%"+key+"%' OR d.expertise like '%"+key+"%') ";
        }
        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){
            totalSql+=" AND EXISTS ( " +
                    " SELECT " +
@ -782,16 +801,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " WHERE  " +
                " h.dept_code = '"+dept+"' " +
                " AND h.org_code = '"+orgCode+"'";
                " WHERE " +
                " 1=1" ;
        if(StringUtils.isNotBlank(dept)){
            sql+= " AND h.dept_code = '"+dept+"'";
        }
        if(StringUtils.isNotBlank(orgCode)){
            sql+= " AND h.org_code = '"+orgCode+"'";
        }
        if(StringUtils.isNotBlank(chargeType)){
            sql+=" AND d.charge_type ='"+chargeType+"'";
            sql+= " AND d.charge_type ='"+chargeType+"'";
        }
        if(StringUtils.isNotBlank(outpatientType)){
            sql+=" AND d.outpatient_type like'%"+outpatientType+"%'";
            sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
        }else{
            sql+=" AND d.outpatient_type is not null ";
            sql+= " AND d.outpatient_type is not null ";
        }
        if(StringUtils.isNotBlank(key)){
            sql+=" AND (h.dept_name like '%"+key+"%' OR d.name like '%"+key+"%' OR d.expertise like '%"+key+"%') ";
        }
        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){
            sql+=" AND EXISTS ( " +
@ -1548,7 +1575,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return rs.size();
    }
    public Map<String,Object> findDoctorInfo(String doctor){
    public Map<String,Object> findDoctorInfo(String doctor,String withWork){
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctor);
        Map<String,Object> rs = new HashedMap();
@ -1601,6 +1628,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }else{
                rs.put("outpatientCount",0);
            }
            if(StringUtils.isNotBlank(withWork)&&"1".equals(withWork)){
                List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor);
                rs.put("workTime",times);
            }
        }
        return rs;
@ -2068,4 +2100,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
//    public Map<String,Object> findPatientInfo(String patient){
//
//    }
    @Autowired
    private HttpClientUtil httpClientUtil;
    public String test() {
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("clientId", "ihealth_pa8DIRJasL"));
        params.add(new BasicNameValuePair("clientSecret", "jkzl1h7aj39dnasyi23fnkv92"));
        params.add(new BasicNameValuePair("code", "334e4232777e4edabea4a4334bf1997c"));
        params.add(new BasicNameValuePair("openid","oULM4xIoqe3DwEClan_Rq-bQ4JDE"));
        String res = null;
        res = httpClientUtil.post("http://www.xmtyw.cn/wlyy/iHealth/userInfo", params, "UTF-8");
        return res;
    }
}

+ 0 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictDiseaseService.java

@ -2,7 +2,6 @@ package com.yihu.jw.base.service.dict;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.dao.dict.DictDiseaseDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.enums.SystemDictEnum;
import com.yihu.jw.entity.base.dict.DictDiseaseDO;
import com.yihu.mysql.query.BaseJpaService;

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

@ -7,6 +7,7 @@ import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -192,9 +193,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByHospitalAndDept)
    @ApiOperation(value = "查询部门下医生", notes = "查询部门下医生")
    public ListEnvelop findDoctorByHospitalAndDept(@ApiParam(name = "orgCode", value = "机构code")
                                                   @RequestParam(value = "orgCode", required = true)String orgCode,
                                                   @RequestParam(value = "orgCode", required = false)String orgCode,
                                                   @ApiParam(name = "dept", value = "部门code")
                                                   @RequestParam(value = "dept", required = true)String dept,
                                                   @RequestParam(value = "dept", required = false)String dept,
                                                   @ApiParam(name = "chargeType", value = "号别")
                                                   @RequestParam(value = "chargeType", required = false)String chargeType,
                                                   @ApiParam(name = "doctorCode", value = "需要置顶医生")
@ -204,8 +205,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                   @ApiParam(name = "startDate", value = "开始时间,yyyy-MM-dd HH:mm:ss")
                                                   @RequestParam(value = "startDate", required = false)String startDate,
                                                   @ApiParam(name = "endDate", value = "结束时间,yyyy-MM-dd HH:mm:ss")
                                                   @RequestParam(value = "endDate", required = false)String endDate) {
        return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate));
                                                   @RequestParam(value = "endDate", required = false)String endDate,
                                                   @ApiParam(name = "key", value = "关键字搜索,医生名字/科室名称/专长")
                                                   @RequestParam(value = "key", required = false)String key) {
        return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.appointmentRevisit)
@ -334,9 +337,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithWork)
    @ApiOperation(value = "查询医生带排班", notes = "查询医生带排班")
    public ObjEnvelop findDoctorWithWork(@ApiParam(name = "orgCode", value = "机构code")
                                         @RequestParam(value = "orgCode", required = true)String orgCode,
                                         @RequestParam(value = "orgCode", required = false)String orgCode,
                                         @ApiParam(name = "dept", value = "部门code")
                                         @RequestParam(value = "dept", required = true)String dept,
                                         @RequestParam(value = "dept", required = false)String dept,
                                         @ApiParam(name = "doctorCode", value = "需要置顶医生code")
                                         @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                         @ApiParam(name = "chargeType", value = "号别")
@ -347,12 +350,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "startDate", required = false)String startDate,
                                         @ApiParam(name = "endDate", value = "结束时间,yyyy-MM-dd HH:mm:ss")
                                         @RequestParam(value = "endDate", required = false)String endDate,
                                         @ApiParam(name = "key", value = "关键字搜索,医生名字/科室名称/专长")
                                         @RequestParam(value = "key", required = false)String key,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,page,size));
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,page,size));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithMouthWork)
@ -383,8 +388,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorInfo)
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
    public ObjEnvelop findDoctorInfo(@ApiParam(name = "doctor", value = "医生code")
                                     @RequestParam(value = "doctor", required = false)String doctor){
        return success(prescriptionService.findDoctorInfo(doctor));
                                     @RequestParam(value = "doctor", required = false)String doctor,
                                     @ApiParam(name = "withWork", value = "传1带排班,其他不带")
                                     @RequestParam(value = "withWork", required = false)String withWork){
        return success(prescriptionService.findDoctorInfo(doctor,withWork));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.cancelOutPatient)
@ -458,6 +465,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(prescriptionService.saveDoctorWorkTimeJson(type,codes,workTimeJson));
    }
    @PostMapping(value = "test")
    @ApiOperation(value = "test", notes = "test")
    public Envelop test()throws Exception {
        return success(prescriptionService.test());
    }
//    @PostMapping(value = BaseHospitalRequestMapping.Prescription.findPatientInfo)
//    @ApiOperation(value = "排班批量保存接口", notes = "排班批量保存接口")
//    public ObjEnvelop findPatientInfo(@ApiParam(name = "type", value = "1.全医院,2.科室,3.医生")