推送信息统计 列表等

main
yanzai 5 months ago
parent 29f83793b1
commit 78c45d496b

@ -0,0 +1,222 @@
<?php
namespace App\Http\Controllers\API\Admin\YeWu;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
class PingTaiPushController extends Controller
{
public function GetList()
{
$searchInfo = request('searchInfo');
$page =request('page');
$pageSize =request('pageSize');
if(empty($searchInfo['dateRange'])){
$searchInfo['dateRange']=[
date('Y-m-d')." 00:00:00",
date('Y-m-d')." 23:59:59"
];
}
$list = DB::table('health_certificate_push');
if (isset($searchInfo['dateRange'])) {
$list = $list->whereBetween('created_at', $searchInfo['dateRange']);
} else {
$list = $list->whereBetween('created_at', [date('Y-m-d'), date('Y-m-d')]);
}
if (isset($searchInfo['orgname'])) {
$list = $list->where('hospitalName', 'like', '%' . $searchInfo['orgname'] . '%');
}
$count = $list->count();
$list = $list->orderBy('created_at', 'desc')->skip(($page-1)*$pageSize)->take($pageSize)->get();
return \Yz::Return(true, "查询完成", ['list' => $list,'count'=>$count]);
}
public function GetDetail()
{
$id = request('id');
// 获取原始信息
$info = DB::table('health_certificate_push')->where('id', $id)->first();
if (!$info) {
return \Yz::Return(false, "未找到对应数据");
}
// 将对象转换为数组以便处理
$infoArray = (array)$info;
// 创建英文字段到中文字段的完整映射表
$fieldMapping = [
'hospitalCode' => '医疗机构编码',
'hospitalName' => '医疗机构名称',
'postTime' => '数据上传时间',
'usci' => '统一社会信用代码',
'healthExaminationId' => '体检登记号',
'examTypeCode' => '从业人员健康检查类别代码',
'examTypeName' => '从业人员健康检查类别名称',
'examTypeText' => '从业人员健康检查类别显示文本',
'examDate' => '体检日期',
'healthCertificateId' => '唯一标识',
'billingStatus' => '收费状态0 免费1 自费',
'name' => '姓名',
'photo' => '照片',
'tel' => '电话',
'gender' => '性别代码',
'genderName' => '性别名称',
'identifierTypeCode' => '身份证件类别代码',
'identifierTypeName' => '身份证件类别名称',
'identifierValue' => '身份证件号码',
'hasBacterialDysentery' => '细菌性痢疾1有 2无',
'bacterialDysenteryNote' => '细菌性痢疾-备注',
'bacterialDysenteryPractitionerNumber' => '细菌性痢疾-检查医师执业证书编号',
'bacterialDysenteryPractitionerLocalId' => '细菌性痢疾-检查医师机构内编码',
'bacterialDysenteryPractitionerName' => '细菌性痢疾-检查医师',
'bacterialDysenteryDate' => '细菌性痢疾-检查日期',
'hasTyphoid' => '伤寒和副伤寒1有 2无',
'typhoidNote' => '伤寒和副伤寒-备注',
'typhoidPractitionerNumber' => '伤寒和副伤寒-检查医师执业证书编号',
'typhoidPractitionerLocalId' => '伤寒和副伤寒-检查医师机构内编码',
'typhoidPractitionerName' => '伤寒和副伤寒-检查医师',
'typhoidDate' => '伤寒和副伤寒-检查日期',
'hasViralHepatitis' => '病毒性肝炎甲型、戊型1有 2无',
'viralHepatitisNote' => '病毒性肝炎-备注',
'viralHepatitisPractitionerNumber' => '病毒性肝炎-检查医师执业证书编号',
'viralHepatitisPractitionerLocalId' => '病毒性肝炎-检查医师机构内编码',
'viralHepatitisPractitionerName' => '病毒性肝炎-检查医师',
'viralHepatitisDate' => '病毒性肝炎-检查日期',
'hasActiveTB' => '活动性肺结核1有 2无',
'activeTBNote' => '活动性肺结核-备注',
'activeTBPractitionerNumber' => '活动性肺结核-检查医师执业证书编号',
'activeTBPractitionerLocalId' => '活动性肺结核-检查医师机构内编码',
'activeTBPractitionerName' => '活动性肺结核-检查医师',
'activeTBDate' => '活动性肺结核-检查日期',
'hasSkinDiseases' => '化脓性或渗出性皮肤病1有 2无',
'skinDiseasesNote' => '化脓性或渗出性皮肤病-备注',
'skinDiseasesPractitionerNumber' => '化脓性或渗出性皮肤病-检查医师执业证书编号',
'skinDiseasesPractitionerLocalId' => '化脓性或渗出性皮肤病-检查医师机构内编码',
'skinDiseasesPractitionerName' => '化脓性或渗出性皮肤病-检查医师',
'skinDiseasesDate' => '化脓性或渗出性皮肤病-检查日期',
'hasHandFungal' => '手部真菌感染性疾病(如手癣、指甲癣等)1有 2无 -1未检查',
'handFungalNote' => '手部真菌感染性疾病-备注',
'handFungalPractitionerNumber' => '手部真菌感染性疾病-检查医师执业证书编号',
'handFungalPractitionerLocalId' => '手部真菌感染性疾病-检查医师机构内编码',
'handFungalPractitionerName' => '手部真菌感染性疾病-检查医师',
'handFungalDate' => '手部真菌感染性疾病-检查日期',
'hasCholera' => '霍乱1有 2无 -1未检查',
'choleraNote' => '霍乱-备注',
'choleraPractitionerNumber' => '霍乱-检查医师执业证书编号',
'choleraPractitionerLocalId' => '霍乱-检查医师机构内编码',
'choleraPractitionerName' => '霍乱-检查医师',
'choleraTestDate' => '霍乱-检查日期',
'hasAmebicDysentery' => '阿米巴性痢疾1有 2无 -1未检查',
'amebicDysenteryNote' => '阿米巴性痢疾-备注',
'amebicDysenteryPractitionerNumber' => '阿米巴性痢疾-检查医师执业证书编号',
'amebicDysenteryPractitionerLocalId' => '阿米巴性痢疾-检查医师机构内编码',
'amebicDysenteryPractitionerName' => '阿米巴性痢疾-检查医师',
'amebicDysenteryDate' => '阿米巴性痢疾-检查日期',
'hasHandEczema' => '手部湿疹1有 2无 -1未检查',
'handEczemaNote' => '手部湿疹-备注',
'handEczemaPractitionerNumber' => '手部湿疹-检查医师执业证书编号',
'handEczemaPractitionerLocalId' => '手部湿疹-检查医师机构内编码',
'handEczemaPractitionerName' => '手部湿疹-检查医师',
'handEczemaDate' => '手部湿疹-检查日期',
'hasHandPsoriasis' => '手部的银屑病或者鳞屑1有 2无 -1未检查',
'handPsoriasisNote' => '手部的银屑病或者鳞屑-备注',
'handPsoriasisPractitionerNumber' => '手部的银屑病或者鳞屑-检查医师执业证书编号',
'handPsoriasisPractitionerLocalId' => '手部的银屑病或者鳞屑-检查医师机构内编码',
'handPsoriasisPractitionerName' => '手部的银屑病或者鳞屑-检查医师',
'handPsoriasisDate' => '手部的银屑病或者鳞屑-检查日期',
'validityDate' => '健康证明生效日期',
'expiryDate' => '健康证明有效截止日期',
'effectiveTime' => '健康证明出具时间',
'updateTime' => '健康证明更新时间',
'healthCertificateUrl' => '从业人员健康证明非结构化文档地址(北京市地址)',
'healthCertificateUrlPt' => '从业人员健康证明非结构化文档地址(区平台地址)',
'isEffective' => '是否有效'
];
// 构建中文键值对
$translatedInfo = [];
foreach ($fieldMapping as $key => $chineseKey) {
if (isset($infoArray[$key])) {
if($key=='photo' and !empty($infoArray[$key])) {
$relativePath = substr($infoArray[$key], strlen('/storage'));
$infoArray[$key]=Storage::disk('public')->url($relativePath);
}
$translatedInfo[$chineseKey] = $infoArray[$key];
}
}
// 返回结果
return \Yz::Return(true, "查询完成", ['info' => $translatedInfo]);
}
//按机构统计
public function CountByOrg(Request $request)
{
$s_group = [1, 8];
$userid = $request->get('userid');//中间件产生的参数
$group = $request->get('role');//中间件产生的参数
$searchInfo = request('searchInfo');
if (!in_array($group, $s_group)) {
return \Yz::echoError1("无权限查看此数据");
}
if(empty($searchInfo['dateRange'])){
$searchInfo['dateRange']=[
date('Y-m-d')." 00:00:00",
date('Y-m-d')." 23:59:59"
];
}
$list = DB::table('health_certificate_push')
->select(
'hospitalCode as org_code',
'hospitalName as org_name',
DB::raw('COUNT(DISTINCT healthCertificateId) as count')
);
if (isset($searchInfo['dateRange'])) {
$list = $list->whereBetween('created_at', $searchInfo['dateRange']);
} else {
$list = $list->whereBetween('created_at', [date('Y-m-d'), date('Y-m-d')]);
}
$list = $list->groupBy('hospitalCode', 'hospitalName')
->get();
return \Yz::Return(true,'查询成功',['list'=>$list,'dateRange'=>$searchInfo['dateRange']]);
}
//按月统计
public function CountByMonth(Request $request)
{
$s_group = [1, 8];
$userid = $request->get('userid');//中间件产生的参数
$group = $request->get('role');//中间件产生的参数
$searchInfo = request('searchInfo');
if (!in_array($group, $s_group)) {
return \Yz::echoError1("无权限查看此数据");
}
if(empty($searchInfo['dateRange'])){
$searchInfo['dateRange']=[
date('Y-m-d')." 00:00:00",
date('Y-m-d')." 23:59:59"
];
}
$list = DB::table('health_certificate_push')
->select(
DB::raw("DATE_FORMAT(created_at, '%Y-%m') as month"),
DB::raw('COUNT(DISTINCT healthCertificateId) as count')
);
if (isset($searchInfo['dateRange'])) {
$list = $list->whereBetween('created_at', $searchInfo['dateRange']);
} else {
$list = $list->whereBetween('created_at', [date('Y-m-d'), date('Y-m-d')]);
};
$list = $list->groupBy(DB::raw("DATE_FORMAT(created_at, '%Y-%m')"))
->orderBy(DB::raw("DATE_FORMAT(created_at, '%Y-%m')"), 'asc')
->get();
return \Yz::Return(true,'查询成功',['list'=>$list,'dateRange'=>$searchInfo['dateRange']]);
}
}

@ -61,8 +61,14 @@ Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1'],function () {
Route::post('admin/SaveConfig','App\Http\Controllers\API\Admin\YeWu\ConfigsController@SaveConfig');//保存设置
Route::post('admin/AppointmentGetPicList','App\Http\Controllers\API\Admin\YeWu\AppointmentController@GetPicList'); //获取预约记录图片
Route::post('admin/CheckUpCount','App\Http\Controllers\API\Admin\YeWu\HealthCheckupController@CheckUpCount');//体检统计
//平台推送相关
Route::post('admin/PingTaiPushGetList','App\Http\Controllers\API\Admin\YeWu\PingTaiPushController@GetList');
Route::post('admin/PingTaiPushCountByOrg','App\Http\Controllers\API\Admin\YeWu\PingTaiPushController@CountByOrg');
Route::post('admin/PingTaiPushCountByMonth','App\Http\Controllers\API\Admin\YeWu\PingTaiPushController@CountByMonth');
Route::post('admin/PingTaiPushGetDetail','App\Http\Controllers\API\Admin\YeWu\PingTaiPushController@GetDetail');
});

@ -1,6 +1,6 @@
ENV = 'production'
VITE_APP_API_66666666 = 'http://192.168.50.123:33583/common/la/public/api/'
VITE_APP_FILE_66666666 = 'http://192.168.50.123:33583/common/la/public'
VITE_APP_API = 'http://192.168.50.123:33583/common/la/public/api/'
VITE_APP_FILE = 'http://192.168.50.123:33583/common/la/public'
VITE_APP_API = 'http://172.31.68.39:33583/common/la/public/api/'
VITE_APP_FILE = 'http://172.31.68.39:33583/common/la/public'
VITE_APP_API_66666666 = 'http://172.31.68.39:33583/common/la/public/api/'
VITE_APP_FILE_66666666 = 'http://172.31.68.39:33583/common/la/public'

@ -172,4 +172,18 @@ export const CheckUpCount = (data={}) => {
//获取预约记录图片
export const AppointmentGetPicList = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/AppointmentGetPicList',data:data})
}
//平台推送相关
export const PingTaiPushGetList = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/PingTaiPushGetList',data:data})
}
export const PingTaiPushCountByOrg = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/PingTaiPushCountByOrg',data:data})
}
export const PingTaiPushCountByMonth = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/PingTaiPushCountByMonth',data:data})
}
export const PingTaiPushGetDetail = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/PingTaiPushGetDetail',data:data})
}

@ -103,6 +103,11 @@ const router = createRouter({
meta: {
title: '系统参数设置'
}
}, {
path: '/pushilist',
name: 'pingTaiPushList',
component: () => import('../views/PingTai/PushList.vue'),
meta: { title: '平台推送列表' }
}]
},

@ -51,7 +51,10 @@
onMounted
} from 'vue'
import {
AppointmentCount,AppointmentCountByMonth,GetHealthOrganizationEnableList
AppointmentCount,AppointmentCountByMonth,GetHealthOrganizationEnableList,
PingTaiPushGetList,
PingTaiPushCountByOrg,
PingTaiPushCountByMonth
} from '@/api/api.js'
import * as echarts from 'echarts';
let loading = ref(false)
@ -74,7 +77,7 @@
//
const GetJiGouAppointmentCount=()=>{
loading.value=true
AppointmentCount({searchInfo:searchInfo.value}).then(res => {
PingTaiPushCountByOrg({searchInfo:searchInfo.value}).then(res => {
loading.value=false
if (res.status) {
AppointmentZhuZhuangTu(res.data)
@ -88,7 +91,7 @@
}
//
const GetJiGouAppointmentCountByMonth=()=>{
AppointmentCountByMonth({searchInfo:searchInfo.value}).then(res => {
PingTaiPushCountByMonth({searchInfo:searchInfo.value}).then(res => {
if (res.status) {
AppointmentZheXianTu(res.data)
} else {

@ -0,0 +1,175 @@
<template>
<div>
<div class="head">
<el-row>
<el-form-item>
<el-tag class="ml-2" type="success" style="margin-right: 20px;">机构名称</el-tag>
<el-select filterable v-model="searchInfo.orgId" placeholder="请选择体检机构" clearable>
<el-option v-for="(item, index) in org_list" :key="index" :label="item.org_name"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item>
<el-tag class="ml-2" type="success" style=" margin-left: 20px;margin-right: 20px;">时间段</el-tag>
<div>
<el-date-picker v-model="searchInfo.dateRange" value-format="YYYY-MM-DD" type="daterange"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" style="margin-left: 20px;" @click="GetList"></el-button>
</el-form-item>
</el-row>
</div>
<el-table :data="tableData" style="width: 100%;" row-key="id" v-loading="loading">
<el-table-column prop="healthExaminationId" label="体检号" />
<el-table-column prop="hospitalName" label="体检机构名称" />
<el-table-column prop="name" label="体检人姓名" />
<el-table-column prop="tel" label="电话" />
<el-table-column prop="genderName" label="性别" />
<el-table-column prop="examTypeName" label="体检类型" />
<el-table-column prop="created_at" label="创建时间" />
<!-- <el-table-column label="报告" width="100">
<template #default="scope">
<span v-if="scope.row.report_file">
<a target="_blank" :href="BaseFileUrl+scope.row.report_file">查看报告</a>
</span>
<span v-else style="color: #ccc;">暂无报告</span>
</template>
</el-table-column> -->
<el-table-column label="详情" width="100">
<template #default="scope">
<el-button type="primary" style="margin-left: 20px;" size="small"
@click="GetDetail(scope.row.id)">查看详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="page">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total"
@size-change="PageSizeChange" @current-change="PageCurrentChange" />
</div>
<el-dialog v-model="detailDialogVisible" title="详情" width="60%">
<el-form status-icon class="demo-ruleForm erweima">
<div v-for="(value, label) in Info" :key="label" class="row">
<el-form-item :label="label" v-if="label=='照片'">
<el-image :src="value"></el-image>
</el-form-item>
<el-form-item :label="label" v-else>
<span class="el-form-item__content">{{ value || '——' }}</span>
</el-form-item>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
import {
ElMessage
} from 'element-plus'
import {
GetHealthOrganizationEnableList,
PingTaiPushGetList,
PingTaiPushGetDetail
} from '@/api/api.js'
let BaseFileUrl = import.meta.env.VITE_APP_FILE
let loading = ref(false)
let tableData = ref([])
let currentPage = ref(1) //
let pageSize = ref(5) //
let total = 0 //
let searchInfo = ref({
dateRange: [],
orgId: '',
})
let Info = ref({});
let detailDialogVisible = ref(false)
const PageSizeChange = (e) => { //
pageSize.value = e
}
const PageCurrentChange = (e) => { //
currentPage.value = e
}
//
const GetList = () => {
loading.value = true
PingTaiPushGetList({
page: currentPage.value,
pageSize: pageSize.value,
searchInfo: searchInfo.value,
}).then(res => {
loading.value = false
if (res.status) {
tableData.value = res.data.list
total = res.data.count
} else {
ElMessage.error(res.msg)
}
})
}
const GetDetail = (id) => {
loading.value = true
PingTaiPushGetDetail({
id: id,
}).then(res => {
loading.value = false
if (res.status) {
detailDialogVisible.value = true
Info.value = res.data.info
} else {
ElMessage.error(res.msg)
}
})
}
let org_list = ref([]) //
const getHealthOrganizationEnableList = () => {
GetHealthOrganizationEnableList().then(res => {
if (res.status) {
org_list.value = res.data
if (res.data.length == 1) {
searchInfo.value.orgId = res.data[0].id
}
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => {
getHealthOrganizationEnableList()
GetList()
})
</script>
<style scoped>
.page {
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
.row {
border-bottom: 1px solid #ccc;
padding-top: 20px;
padding-left: 8px;
}
.el-form-item__content {
color: #818181
}
</style>
Loading…
Cancel
Save