Browse Source

集成地址

wangzhinan 10 months ago
parent
commit
6f84da70e0

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

@ -6458,6 +6458,55 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return list;
    }
    /**
     * 统计医生首页待接诊和已接诊数据量
     * @param doctor
     * @return
     */
    public com.alibaba.fastjson.JSONObject selectInfoByDoctorId(String doctor){
        String sql = "SELECT\n" +
                "\toutpatient_type as \"outpatientType\",\n" +
                "\tstatus as \"status\",\n" +
                "\tCOUNT(1) AS \"total\"\n" +
                "\n" +
                "FROM\n" +
                "\twlyy_outpatient\n" +
                "WHERE\n" +
                "\tdoctor = '"+doctor+"'\n" +
                "GROUP BY\n" +
                "\toutpatient_type,\n" +
                "\tstatus";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
        int zxzsDjzTotal = 0;//在线诊室待接诊数量
        int zxzsYjzTotal=0;//在线诊室已接诊数量
        int zjzxDjztTotal=0;//在线咨询待接诊数量
        int zjzxYjzTota= 0; //在线咨询已接诊数量
        for (Map<String,Object> map:list){
            String outpatientType= map.get("outpatientType").toString();
            String status = map.get("status").toString();
            if (outpatientType.equalsIgnoreCase("1")) {
                if (status.equalsIgnoreCase("0")) {
                    zxzsDjzTotal += Integer.parseInt(map.get("total").toString());
                } else if (status.equalsIgnoreCase("1") || status.equalsIgnoreCase("2")) {
                    zxzsYjzTotal += Integer.parseInt(map.get("total").toString());
                }
            }else if (outpatientType.equalsIgnoreCase("3")){
                if (status.equalsIgnoreCase("0")){
                    zjzxDjztTotal +=Integer.parseInt(map.get("total").toString());
                }else if (status.equalsIgnoreCase("1")||status.equalsIgnoreCase("2")){
                    zjzxYjzTota  +=Integer.parseInt(map.get("total").toString());
                }
            }
        }
        object.put("zxzsDjzTotal",zxzsDjzTotal);
        object.put("zxzsYjzTotal",zxzsYjzTotal);
        object.put("zjzxDjztTotal",zjzxDjztTotal);
        object.put("zjzxYjzTota",zjzxYjzTota);
        return object;
    }
    public List<Map<String, Object>> findWaitingRoomPatient(String dept, Integer type) {
        String sql = "SELECT " +

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

@ -3916,5 +3916,18 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/selectInfoByDoctorId")
    @ApiOperation(value = "获取医生首页服务信息", notes = "获取医生首页服务信息")
    public Envelop selectInfoByDoctorId(
            @ApiParam(name = "doctorId", value = "唯一id", required = false)
            @RequestParam(value = "doctorId",required = false)String doctorId) {
        try {
            return success("操作成功", prescriptionService.selectInfoByDoctorId(doctorId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}