Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 4 years ago
parent
commit
11d29eaef2

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

@ -4339,6 +4339,62 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        return list;
    }
    public String generalDoctorWaitingNumber(String doctor,String wxId,String outpatientId){
        String condition = "";
        if("xm_ykyy_wx".equals(wxId)){
            condition+= "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss')  AS \"time\",";
            condition+= "to_char(room.reservation_time,'YYYY-MM-DD')  AS \"group_date\",";
        }else{
            condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
            condition += "date_format(room.reservation_time ,'%Y-%m-%d' ) AS \"group_date\",";
        }
        String sql ="SELECT " +
                "room.outpatient_id AS \"id\"," +
                "room.patient_id AS \"patient_id\"," +
                "room.patient_name AS \"name\"," +
                "patient.sex AS \"sex\"," +
                "patient.idcard AS \"idcard\"," +
                "patient.photo AS \"photo\"," +
                "patient.birthday AS \"birthday\"," +
                "patient.mobile AS \"mobile\"," +
                "outpatient.mobile AS \"outpatient_mobile\"," +
                "room.consult_type AS \"consult_type\"," +condition+
                "room.reservation_type AS \"reservation_type\"," +
                "outpatient.disease_img AS \"disease_img\"," +
                "outpatient.description AS \"description\"," +
                "outpatient.origin_con_no AS \"origin_con_no\", " +
                "room.reservation_type AS \"reservation_type\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "base_patient patient," +
                "wlyy_outpatient outpatient " +
                "WHERE " +
                "room.patient_id=patient.id " +
                "AND room.outpatient_id=outpatient.id " +
                "AND outpatient.status = 0 " +
                "AND outpatient.pay_status = 1 " +
                "AND room.doctor='"+doctor+"' " +
                "AND room.reservation_time is not null " +
                "AND room.consult_type= 2 ";/* +
                "AND room.reservation_time >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' order by room.reservation_time ASC ";
//                "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
        if("xm_ykyy_wx".equals(wxId)){
            sql+=" AND room.reservation_time >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
        }else {
            sql +=" AND room.reservation_time >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
        }
        sql+=" order by room.reservation_time ASC ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        Integer waitCount =1;
        for (Map<String,Object> map:list){
            if (!map.get("id").toString().equalsIgnoreCase(outpatientId)){
                waitCount+=1;
            }
        }
        return waitCount.toString();
    }
    
    public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor,String wxId) {
        String condition = "";
@ -5169,7 +5225,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return rs;
    }
    
    /**
     * 查询医生所有可抢单的数量
     * @param doctor

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1094,8 +1094,9 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     */
    public BusinessOrderDO consultRefund(String consult,String wxId) throws Exception {
        String base = hospitalSysDictDao.findByDictName("imData").get(0).getDictCode();
        String sql ="select id as \"id\",reply as \"reply\" from "+base+".topics where id='"+consult+"' AND reply=0";
        String sql ="select id as \"id\",reply as \"reply\" from "+base+".topics where id='"+consult+"' AND (reply=0 OR reply IS NULL OR reply <>'')";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        logger.info("maplist"+mapList);
        if (mapList!=null&&mapList.size()!=0){
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(consult);
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")){

+ 2 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,15 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
/*    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
/*
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -427,9 +427,11 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	@ApiOperation(value = "全科医生等候协同门诊,排队数量", notes = "全科医生等候协同门诊,排队数量")
	public Envelop generalDoctorWaitingNumber(
			@ApiParam(name = "outpatientid", value = "就诊记录CODE")
			@RequestParam(value = "outpatientid",required = true) String outpatientid){
			@RequestParam(value = "outpatientid",required = true) String outpatientid,
			@ApiParam(name = "doctor", value = "医生code")
			@RequestParam(value = "doctor",required = true) String doctor){
		JSONObject result = new JSONObject();
		result.put("waitingNumber",1);
		result.put("waitingNumber",prescriptionService.generalDoctorWaitingNumber(doctor,wxId,outpatientid));
		return success("请求成功",result);
	}