v0.2
4
.gitignore
vendored
@@ -55,4 +55,6 @@
|
||||
/openhis-miniapp/unpackage
|
||||
|
||||
# 忽略设计书
|
||||
PostgreSQL/openHis_DB设计书.xlsx
|
||||
PostgreSQL/openHis_DB设计书.xlsx
|
||||
|
||||
public.sql
|
13908
PostgreSQL/public.sql
@@ -1,16 +0,0 @@
|
||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Author: zhuWanLi
|
||||
* @version: 1.0.0
|
||||
* @Date: 2025-03-04 13:33:32
|
||||
-->
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
@import "@/static/font/iconfont.css";
|
||||
</style>
|
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,22 +0,0 @@
|
||||
import App from './App'
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"name" : "openhis-miniapp",
|
||||
"appid" : "__UNI__FFC6C1D",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx595073ea953abb5c",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"es6" : true,
|
||||
"postcss" : true,
|
||||
"minified" : true
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "3"
|
||||
}
|
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/healthCard/healthCard",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "健康卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/personInfo/personInfo",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "个人中心"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
// "titleNView": true
|
||||
},
|
||||
"uniIdRouter": {},
|
||||
|
||||
"tabBar": {
|
||||
"color": "#282828",
|
||||
"selectedColor": "#00a2f3",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/images/tabbar/shouye.png",
|
||||
"selectedIconPath": "static/images/tabbar/shouye_1.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/healthCard/healthCard",
|
||||
"iconPath": "static/images/tabbar/erweima.png",
|
||||
"selectedIconPath": "static/images/tabbar/erweima_1.png",
|
||||
"text": "健康卡"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/personInfo/personInfo",
|
||||
"iconPath": "static/images/tabbar/wode.png",
|
||||
"selectedIconPath": "static/images/tabbar/wode_1.png",
|
||||
"text": "个人中心"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@@ -1,168 +0,0 @@
|
||||
<template>
|
||||
<view class="service-page">
|
||||
<!-- 顶部功能入口 -->
|
||||
<view class="top-section">
|
||||
<view class="top-item" @click="navigateTo('my-doctor')">
|
||||
<image src="/static/icons/doctor.png" mode="aspectFit"></image>
|
||||
<text>我的医生</text>
|
||||
</view>
|
||||
<view class="top-item" @click="navigateTo('online-consult')">
|
||||
<image src="/static/icons/online.png" mode="aspectFit"></image>
|
||||
<text>一键在线复诊</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 会员中心 -->
|
||||
<view class="vip-section" @click="navigateTo('vip-center')">
|
||||
<image src="/static/icons/vip.png" mode="aspectFit"></image>
|
||||
<text>会员中心 · 精选权益超值享</text>
|
||||
</view>
|
||||
|
||||
<!-- 服务与工具网格 -->
|
||||
<view class="service-grid">
|
||||
<view
|
||||
class="grid-item"
|
||||
v-for="(item, index) in serviceList"
|
||||
:key="index"
|
||||
@click="handleServiceClick(item)"
|
||||
>
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商务合作 -->
|
||||
<view class="cooperation" @click="navigateTo('business')">
|
||||
<text>商务合作</text>
|
||||
<image src="/static/icons/arrow-right.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
// 服务列表数据
|
||||
const serviceList = ref([
|
||||
{ id: 1, title: '收藏', icon: '/static/icons/collect.png', type: 'collect' },
|
||||
{ id: 2, title: '我的医生', icon: '/static/icons/doctor.png', type: 'my-doctor' },
|
||||
{ id: 3, title: '随访计划', icon: '/static/icons/follow-up.png', type: 'follow-plan' },
|
||||
{ id: 4, title: '客服中心', icon: '/static/icons/service.png', type: 'customer-service' }
|
||||
]);
|
||||
|
||||
// 处理服务点击
|
||||
const handleServiceClick = (item) => {
|
||||
switch(item.type) {
|
||||
case 'customer-service':
|
||||
uni.makePhoneCall({ phoneNumber: '400-123-4567' });
|
||||
break;
|
||||
default:
|
||||
navigateTo(item.type);
|
||||
}
|
||||
};
|
||||
|
||||
// 通用跳转方法
|
||||
const navigateTo = (path) => {
|
||||
uni.navigateTo({ url: `/pages/${path}/${path}` });
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.service-page {
|
||||
padding: 20rpx;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.top-section {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 20rpx 0;
|
||||
padding: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.top-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 45%;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.vip-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
margin: 20rpx 0;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #ff9900;
|
||||
}
|
||||
}
|
||||
|
||||
.service-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 20rpx;
|
||||
padding: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.grid-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cooperation {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -1,64 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- <image class="logo" src="/static/logo.png"></image>
|
||||
<view class="text-area">
|
||||
<text class="title">{{title}}</text>
|
||||
</view> -->
|
||||
<view :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
|
||||
<!-- 导航 -->
|
||||
<home-navi @goLogin="openAuto"></home-navi>
|
||||
<!-- 轮播 -->
|
||||
<home-swiper :dataList="dataBanner"></home-swiper>
|
||||
<!-- 菜单 -->
|
||||
<home-menus :dataList="dataMenus" @goLogin="openAuto"></home-menus>
|
||||
<!-- 健康科普 -->
|
||||
<home-article :dataList="dataArticle" @goLogin="openAuto"></home-article>
|
||||
<!-- 视频课堂 -->
|
||||
<home-video :dataList="dataVideo" @goLogin="openAuto"></home-video>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '1111'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 200rpx;
|
||||
width: 200rpx;
|
||||
margin-top: 200rpx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.text-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
color: #8f8f94;
|
||||
}
|
||||
</style>
|
@@ -1,318 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 轮播图 -->
|
||||
<swiper class="swiper-container" autoplay circular indicator-dots>
|
||||
<swiper-item v-for="(item, index) in swiperList" :key="index">
|
||||
<image :src="item.image" mode="aspectFill" class="swiper-image"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 用户信息栏 -->
|
||||
<!-- <view class="user-card">
|
||||
<view class="user-info">
|
||||
<view class="user-info-left">
|
||||
<image class="avatar" src="/static/images/user.png"></image>
|
||||
</view>
|
||||
<text class="name">{{ currentPatient.name }}</text>
|
||||
<text class="switch" @click="switchPatient">切换就诊人 ></text>
|
||||
</view>
|
||||
<text class="patient-id">就诊号:{{ currentPatient.id }}</text>
|
||||
</view> -->
|
||||
<view class="user-card">
|
||||
<view class="user-info-left">
|
||||
<image class="avatar" src="/static/images/user.png"></image>
|
||||
<text class="name">{{ currentPatient.name }}</text>
|
||||
<text class="switch-patient" @click="switchPatient">切换就诊人 ></text>
|
||||
</view>
|
||||
<text class="patient-id">就诊号:{{ currentPatient.id }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 功能宫格区域 -->
|
||||
<scroll-view scroll-y class="main-content">
|
||||
<view class="grid-container">
|
||||
<view class="section-title">医院服务</view>
|
||||
<view class="grid-row">
|
||||
<view v-for="(item, index) in firstRow" :key="index" class="grid-item"
|
||||
@click="handleFunction(item)">
|
||||
<image class="icon" :src="item.icon" mode="aspectFit" />
|
||||
<text class="label">{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-row">
|
||||
<view v-for="(item, index) in secondRow" :key="index" class="grid-item"
|
||||
@click="handleFunction(item)">
|
||||
<image class="icon" :src="item.icon" mode="aspectFit" />
|
||||
<text class="label">{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="service-grid">
|
||||
<view v-for="(item, index) in hospitalServices" :key="index" class="service-item">
|
||||
<text>{{ item }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
} from 'vue';
|
||||
|
||||
// 轮播图数据
|
||||
const swiperList = ref([{
|
||||
image: '/static/shouye/lunbotu1.png'
|
||||
},
|
||||
{
|
||||
image: '/static/shouye/lunbotu2.png'
|
||||
},
|
||||
{
|
||||
image: '/static/shouye/lunbotu1.png'
|
||||
}
|
||||
]);
|
||||
// 当前就诊人信息
|
||||
const currentPatient = reactive({
|
||||
name: '张三',
|
||||
id: '123456'
|
||||
});
|
||||
|
||||
|
||||
// 功能配置(示例数据)
|
||||
const firstRow = ref([{
|
||||
label: '健康码',
|
||||
icon: '/static/icons/health-code.png',
|
||||
path: '/pages/health-code'
|
||||
},
|
||||
{
|
||||
label: '预约挂号',
|
||||
icon: '/static/icons/appointment.png',
|
||||
path: '/pages/appointment'
|
||||
},
|
||||
{
|
||||
label: '当日挂号',
|
||||
icon: '/static/icons/today-reg.png',
|
||||
path: '/pages/today-reg'
|
||||
},
|
||||
{
|
||||
label: '门诊缴费',
|
||||
icon: '/static/icons/payment.png',
|
||||
path: '/pages/payment'
|
||||
}
|
||||
]);
|
||||
|
||||
const secondRow = ref([{
|
||||
label: '查看报告',
|
||||
icon: '/static/icons/report.png',
|
||||
path: '/pages/report'
|
||||
},
|
||||
{
|
||||
label: '就诊记录',
|
||||
icon: '/static/icons/record.png',
|
||||
path: '/pages/records'
|
||||
},
|
||||
{
|
||||
label: '科室查询',
|
||||
icon: '/static/icons/department.png',
|
||||
path: '/pages/department'
|
||||
},
|
||||
{
|
||||
label: '医生查询',
|
||||
icon: '/static/icons/doctor.png',
|
||||
path: '/pages/doctor'
|
||||
}
|
||||
]);
|
||||
|
||||
// 医院服务
|
||||
const hospitalServices = ref([
|
||||
'医院介绍',
|
||||
'国粹中医',
|
||||
'惠民政策',
|
||||
'特色疗法'
|
||||
]);
|
||||
|
||||
// 底部导航
|
||||
const tabItems = ref([{
|
||||
text: '首页',
|
||||
icon: '/static/tabs/home.png',
|
||||
selectedIcon: '/static/tabs/home-active.png'
|
||||
},
|
||||
{
|
||||
text: '健康卡',
|
||||
icon: '/static/tabs/health-card.png',
|
||||
selectedIcon: '/static/tabs/health-card-active.png'
|
||||
},
|
||||
{
|
||||
text: '个人中心',
|
||||
icon: '/static/tabs/profile.png',
|
||||
selectedIcon: '/static/tabs/profile-active.png'
|
||||
}
|
||||
]);
|
||||
|
||||
const activeTab = ref(0);
|
||||
|
||||
// 切换就诊人
|
||||
const switchPatient = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/patient/switch'
|
||||
});
|
||||
};
|
||||
|
||||
// 处理功能点击
|
||||
const handleFunction = (item) => {
|
||||
if (item.path) {
|
||||
uni.navigateTo({
|
||||
url: item.path
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 切换底部导航
|
||||
const switchTab = (index) => {
|
||||
activeTab.value = index;
|
||||
// 实际项目应使用路由跳转
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.swiper-container {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.swiper-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.user-card {
|
||||
/* background: linear-gradient(135deg, #6eb4ff, #007aff); */
|
||||
padding: 30rpx;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.switch {
|
||||
padding-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
/* text-decoration: underline; */
|
||||
}
|
||||
|
||||
.patient-id {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
padding-top: 1vh;
|
||||
}
|
||||
|
||||
.grid-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1vh;
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
width: 23%;
|
||||
background: white;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.section {
|
||||
background: white;
|
||||
margin: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.service-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.service-item {
|
||||
background: #f8f8f8;
|
||||
padding: 30rpx;
|
||||
border-radius: 12rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tabbar {
|
||||
height: 100rpx;
|
||||
background: white;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #007aff;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
</style>
|
@@ -1,43 +0,0 @@
|
||||
<template>
|
||||
<view class="service-item" @click="handleClick">
|
||||
<image :src="icon" class="icon" />
|
||||
<text class="title">{{ title }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('click');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.service-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
.title {
|
||||
margin-top: 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
@@ -1,233 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 用户信息区域 -->
|
||||
<view class="user-info">
|
||||
<view class="avatar-section">
|
||||
<view class="user-info-left">
|
||||
<image class="avatar" src="/static/images/user.png"></image>
|
||||
</view>
|
||||
<view class="user-info-right">
|
||||
<view class="name-section">
|
||||
<view>
|
||||
<text class="name">{{ currentPatient.name }}</text>
|
||||
<text class="switch-patient" @click="switchPatient">切换就诊人></text>
|
||||
</view>
|
||||
<view class="patient-id">
|
||||
<text>就诊号:{{ currentPatient.id }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 顶部功能入口 -->
|
||||
<view class="top-section">
|
||||
<view class="top-item" @click="navigateTo('my-doctor')">
|
||||
<uni-icons custom-prefix="iconfont" type="my-jiaofeijilu" size="30"></uni-icons>
|
||||
<text>缴费记录</text>
|
||||
</view>
|
||||
<view class="top-item" @click="navigateTo('my-doctor')">
|
||||
<uni-icons custom-prefix="iconfont" type="my-guahaojilu" size="30"></uni-icons>
|
||||
<text>挂号记录</text>
|
||||
</view>
|
||||
<view class="top-item" @click="navigateTo('my-doctor')">
|
||||
<uni-icons custom-prefix="iconfont" type="my-jiuzhenjilu" size="30"></uni-icons>
|
||||
<text>就诊记录</text>
|
||||
</view>
|
||||
<view class="top-item" @click="navigateTo('online-consult')">
|
||||
<uni-icons custom-prefix="iconfont" type="my-wodebaogao" size="30"></uni-icons>
|
||||
<text>我的报告</text>
|
||||
</view>
|
||||
<view class="top-item" @click="navigateTo('my-doctor')">
|
||||
<uni-icons custom-prefix="iconfont" type="my-jiuzhenrenguanli" size="30"></uni-icons>
|
||||
<text>就诊人管理</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 功能列表 -->
|
||||
<view class="menu-list">
|
||||
<navigator v-for="(item, index) in menus" :key="index" class="menu-item" :url="item.url">
|
||||
<text>{{ item.label }}</text>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
|
||||
// 用户信息
|
||||
const userInfo = reactive({
|
||||
avatar: ''
|
||||
});
|
||||
|
||||
// 当前就诊人信息
|
||||
const currentPatient = ref({
|
||||
name: '张三',
|
||||
id: '123456'
|
||||
});
|
||||
|
||||
// 菜单配置
|
||||
const menus = ref([{
|
||||
label: '缴费记录',
|
||||
url: '/pages/records/payment'
|
||||
},
|
||||
{
|
||||
label: '挂号记录',
|
||||
url: '/pages/records/registration'
|
||||
},
|
||||
{
|
||||
label: '就诊记录',
|
||||
url: '/pages/records/medical'
|
||||
},
|
||||
{
|
||||
label: '我的报告',
|
||||
url: '/pages/records/report'
|
||||
},
|
||||
{
|
||||
label: '就诊人管理',
|
||||
url: '/pages/patient/manage'
|
||||
}
|
||||
]);
|
||||
|
||||
// 处理头像点击
|
||||
const handleAvatarClick = () => {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
userInfo.avatar = res.tempFilePaths[0];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 切换就诊人
|
||||
const switchPatient = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/patient/select'
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化数据
|
||||
onLoad(() => {
|
||||
// 这里可以添加请求用户数据的逻辑
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.container {
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 设置整个用户信息区域 */
|
||||
.user-info {
|
||||
background-color: #fff;
|
||||
padding-top: 20rpx;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
display: flex;
|
||||
/* 启用Flex布局 */
|
||||
justify-content: space-between;
|
||||
/* 在水平上分配空间 */
|
||||
align-items: center;
|
||||
/* 垂直方向居中对齐 */
|
||||
}
|
||||
|
||||
/* 名字和切换按钮布局 */
|
||||
.name-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 名字布局 */
|
||||
.name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 选择就诊人布局 */
|
||||
.switch-patient {
|
||||
border: #007aff;
|
||||
color: #007aff;
|
||||
padding-left: 10px;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 就诊号 */
|
||||
.patient-id {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.avatar-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
/* 左侧区域 */
|
||||
.user-info-left {
|
||||
display: flex;
|
||||
/* 启用Flex布局 */
|
||||
align-items: center;
|
||||
/* 垂直方向居中 */
|
||||
}
|
||||
|
||||
/* 右侧区域 */
|
||||
.user-info-right {
|
||||
display: flex;
|
||||
/* 启用Flex布局 */
|
||||
align-items: center;
|
||||
/* 垂直方向居中 */
|
||||
}
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.menu-list {
|
||||
margin-top: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* .menu-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
} */
|
||||
.top-section {
|
||||
display: flex;
|
||||
margin: 20rpx 0;
|
||||
padding: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.top-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 45%;
|
||||
font-size: 25 rpx;
|
||||
|
||||
.image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
/* font-size: 20rpx ; */
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -1,69 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "iconfont";
|
||||
src: url('/static/font/iconfont.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-keshi:before {
|
||||
content: "\e624";
|
||||
}
|
||||
|
||||
.icon-yisheng_1:before {
|
||||
content: "\e633";
|
||||
}
|
||||
|
||||
.icon-menzhenjiaofei2:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
|
||||
.icon-erweima:before {
|
||||
content: "\e642";
|
||||
}
|
||||
|
||||
.icon-jinriguahao:before {
|
||||
content: "\e627";
|
||||
}
|
||||
|
||||
.icon-qiandao_:before {
|
||||
content: "\e687";
|
||||
}
|
||||
|
||||
.icon-chakanbaogao:before {
|
||||
content: "\e69d";
|
||||
}
|
||||
|
||||
.icon-homejiuzhenjilu:before {
|
||||
content: "\e6b1";
|
||||
}
|
||||
|
||||
.icon-yuyueguahao:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.my-jiuzhenjilu:before {
|
||||
content: "\e61a";
|
||||
}
|
||||
|
||||
.my-guahaojilu:before {
|
||||
content: "\e718";
|
||||
}
|
||||
|
||||
.my-wodebaogao:before {
|
||||
content: "\e67a";
|
||||
}
|
||||
|
||||
.my-jiaofeijilu:before {
|
||||
content: "\e6ce";
|
||||
}
|
||||
|
||||
.my-jiuzhenrenguanli:before {
|
||||
content: "\e6a9";
|
||||
}
|
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 725 B |
Before Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 601 B |
@@ -1,13 +0,0 @@
|
||||
uni.addInterceptor({
|
||||
returnValue (res) {
|
||||
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
|
||||
return res;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
res.then((res) => {
|
||||
if (!res) return resolve(res)
|
||||
return res[0] ? reject(res[0]) : resolve(res[1])
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
@@ -1,76 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
|
||||
/* 颜色变量 */
|
||||
|
||||
/* 行为相关颜色 */
|
||||
$uni-color-primary: #007aff;
|
||||
$uni-color-success: #4cd964;
|
||||
$uni-color-warning: #f0ad4e;
|
||||
$uni-color-error: #dd524d;
|
||||
|
||||
/* 文字基本颜色 */
|
||||
$uni-text-color:#333;//基本色
|
||||
$uni-text-color-inverse:#fff;//反色
|
||||
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
|
||||
$uni-text-color-placeholder: #808080;
|
||||
$uni-text-color-disable:#c0c0c0;
|
||||
|
||||
/* 背景颜色 */
|
||||
$uni-bg-color:#ffffff;
|
||||
$uni-bg-color-grey:#f8f8f8;
|
||||
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
|
||||
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
|
||||
|
||||
/* 边框颜色 */
|
||||
$uni-border-color:#c8c7cc;
|
||||
|
||||
/* 尺寸变量 */
|
||||
|
||||
/* 文字尺寸 */
|
||||
$uni-font-size-sm:12px;
|
||||
$uni-font-size-base:14px;
|
||||
$uni-font-size-lg:16px;
|
||||
|
||||
/* 图片尺寸 */
|
||||
$uni-img-size-sm:20px;
|
||||
$uni-img-size-base:26px;
|
||||
$uni-img-size-lg:40px;
|
||||
|
||||
/* Border Radius */
|
||||
$uni-border-radius-sm: 2px;
|
||||
$uni-border-radius-base: 3px;
|
||||
$uni-border-radius-lg: 6px;
|
||||
$uni-border-radius-circle: 50%;
|
||||
|
||||
/* 水平间距 */
|
||||
$uni-spacing-row-sm: 5px;
|
||||
$uni-spacing-row-base: 10px;
|
||||
$uni-spacing-row-lg: 15px;
|
||||
|
||||
/* 垂直间距 */
|
||||
$uni-spacing-col-sm: 4px;
|
||||
$uni-spacing-col-base: 8px;
|
||||
$uni-spacing-col-lg: 12px;
|
||||
|
||||
/* 透明度 */
|
||||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
|
||||
|
||||
/* 文章场景相关 */
|
||||
$uni-color-title: #2C405A; // 文章标题颜色
|
||||
$uni-font-size-title:20px;
|
||||
$uni-color-subtitle: #555555; // 二级标题颜色
|
||||
$uni-font-size-subtitle:26px;
|
||||
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
||||
$uni-font-size-paragraph:15px;
|
@@ -1,22 +0,0 @@
|
||||
## 1.3.5(2022-01-24)
|
||||
- 优化 size 属性可以传入不带单位的字符串数值
|
||||
## 1.3.4(2022-01-24)
|
||||
- 优化 size 支持其他单位
|
||||
## 1.3.3(2022-01-17)
|
||||
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
|
||||
## 1.3.2(2021-12-01)
|
||||
- 优化 示例可复制图标名称
|
||||
## 1.3.1(2021-11-23)
|
||||
- 优化 兼容旧组件 type 值
|
||||
## 1.3.0(2021-11-19)
|
||||
- 新增 更多图标
|
||||
- 优化 自定义图标使用方式
|
||||
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
|
||||
## 1.1.7(2021-11-08)
|
||||
## 1.2.0(2021-07-30)
|
||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||
## 1.1.5(2021-05-12)
|
||||
- 新增 组件示例地址
|
||||
## 1.1.4(2021-02-05)
|
||||
- 调整为uni_modules目录规范
|
@@ -1,96 +0,0 @@
|
||||
<template>
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import icons from './icons.js';
|
||||
const getVal = (val) => {
|
||||
const reg = /^[0-9]*$/g
|
||||
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
|
||||
}
|
||||
// #ifdef APP-NVUE
|
||||
var domModule = weex.requireModule('dom');
|
||||
import iconUrl from './uniicons.ttf'
|
||||
domModule.addRule('fontFace', {
|
||||
'fontFamily': "uniicons",
|
||||
'src': "url('"+iconUrl+"')"
|
||||
});
|
||||
// #endif
|
||||
|
||||
/**
|
||||
* Icons 图标
|
||||
* @description 用于展示 icons 图标
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
|
||||
* @property {Number} size 图标大小
|
||||
* @property {String} type 图标图案,参考示例
|
||||
* @property {String} color 图标颜色
|
||||
* @property {String} customPrefix 自定义图标
|
||||
* @event {Function} click 点击 Icon 触发事件
|
||||
*/
|
||||
export default {
|
||||
name: 'UniIcons',
|
||||
emits:['click'],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#333333'
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 16
|
||||
},
|
||||
customPrefix:{
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
icons: icons.glyphs
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
unicode(){
|
||||
let code = this.icons.find(v=>v.font_class === this.type)
|
||||
if(code){
|
||||
return unescape(`%u${code.unicode}`)
|
||||
}
|
||||
return ''
|
||||
},
|
||||
iconSize(){
|
||||
return getVal(this.size)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_onClick() {
|
||||
this.$emit('click')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* #ifndef APP-NVUE */
|
||||
@import './uniicons.css';
|
||||
@font-face {
|
||||
font-family: uniicons;
|
||||
src: url('./uniicons.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.uni-icons {
|
||||
font-family: uniicons;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
@@ -1,663 +0,0 @@
|
||||
.uniui-color:before {
|
||||
content: "\e6cf";
|
||||
}
|
||||
|
||||
.uniui-wallet:before {
|
||||
content: "\e6b1";
|
||||
}
|
||||
|
||||
.uniui-settings-filled:before {
|
||||
content: "\e6ce";
|
||||
}
|
||||
|
||||
.uniui-auth-filled:before {
|
||||
content: "\e6cc";
|
||||
}
|
||||
|
||||
.uniui-shop-filled:before {
|
||||
content: "\e6cd";
|
||||
}
|
||||
|
||||
.uniui-staff-filled:before {
|
||||
content: "\e6cb";
|
||||
}
|
||||
|
||||
.uniui-vip-filled:before {
|
||||
content: "\e6c6";
|
||||
}
|
||||
|
||||
.uniui-plus-filled:before {
|
||||
content: "\e6c7";
|
||||
}
|
||||
|
||||
.uniui-folder-add-filled:before {
|
||||
content: "\e6c8";
|
||||
}
|
||||
|
||||
.uniui-color-filled:before {
|
||||
content: "\e6c9";
|
||||
}
|
||||
|
||||
.uniui-tune-filled:before {
|
||||
content: "\e6ca";
|
||||
}
|
||||
|
||||
.uniui-calendar-filled:before {
|
||||
content: "\e6c0";
|
||||
}
|
||||
|
||||
.uniui-notification-filled:before {
|
||||
content: "\e6c1";
|
||||
}
|
||||
|
||||
.uniui-wallet-filled:before {
|
||||
content: "\e6c2";
|
||||
}
|
||||
|
||||
.uniui-medal-filled:before {
|
||||
content: "\e6c3";
|
||||
}
|
||||
|
||||
.uniui-gift-filled:before {
|
||||
content: "\e6c4";
|
||||
}
|
||||
|
||||
.uniui-fire-filled:before {
|
||||
content: "\e6c5";
|
||||
}
|
||||
|
||||
.uniui-refreshempty:before {
|
||||
content: "\e6bf";
|
||||
}
|
||||
|
||||
.uniui-location-filled:before {
|
||||
content: "\e6af";
|
||||
}
|
||||
|
||||
.uniui-person-filled:before {
|
||||
content: "\e69d";
|
||||
}
|
||||
|
||||
.uniui-personadd-filled:before {
|
||||
content: "\e698";
|
||||
}
|
||||
|
||||
.uniui-back:before {
|
||||
content: "\e6b9";
|
||||
}
|
||||
|
||||
.uniui-forward:before {
|
||||
content: "\e6ba";
|
||||
}
|
||||
|
||||
.uniui-arrow-right:before {
|
||||
content: "\e6bb";
|
||||
}
|
||||
|
||||
.uniui-arrowthinright:before {
|
||||
content: "\e6bb";
|
||||
}
|
||||
|
||||
.uniui-arrow-left:before {
|
||||
content: "\e6bc";
|
||||
}
|
||||
|
||||
.uniui-arrowthinleft:before {
|
||||
content: "\e6bc";
|
||||
}
|
||||
|
||||
.uniui-arrow-up:before {
|
||||
content: "\e6bd";
|
||||
}
|
||||
|
||||
.uniui-arrowthinup:before {
|
||||
content: "\e6bd";
|
||||
}
|
||||
|
||||
.uniui-arrow-down:before {
|
||||
content: "\e6be";
|
||||
}
|
||||
|
||||
.uniui-arrowthindown:before {
|
||||
content: "\e6be";
|
||||
}
|
||||
|
||||
.uniui-bottom:before {
|
||||
content: "\e6b8";
|
||||
}
|
||||
|
||||
.uniui-arrowdown:before {
|
||||
content: "\e6b8";
|
||||
}
|
||||
|
||||
.uniui-right:before {
|
||||
content: "\e6b5";
|
||||
}
|
||||
|
||||
.uniui-arrowright:before {
|
||||
content: "\e6b5";
|
||||
}
|
||||
|
||||
.uniui-top:before {
|
||||
content: "\e6b6";
|
||||
}
|
||||
|
||||
.uniui-arrowup:before {
|
||||
content: "\e6b6";
|
||||
}
|
||||
|
||||
.uniui-left:before {
|
||||
content: "\e6b7";
|
||||
}
|
||||
|
||||
.uniui-arrowleft:before {
|
||||
content: "\e6b7";
|
||||
}
|
||||
|
||||
.uniui-eye:before {
|
||||
content: "\e651";
|
||||
}
|
||||
|
||||
.uniui-eye-filled:before {
|
||||
content: "\e66a";
|
||||
}
|
||||
|
||||
.uniui-eye-slash:before {
|
||||
content: "\e6b3";
|
||||
}
|
||||
|
||||
.uniui-eye-slash-filled:before {
|
||||
content: "\e6b4";
|
||||
}
|
||||
|
||||
.uniui-info-filled:before {
|
||||
content: "\e649";
|
||||
}
|
||||
|
||||
.uniui-reload:before {
|
||||
content: "\e6b2";
|
||||
}
|
||||
|
||||
.uniui-micoff-filled:before {
|
||||
content: "\e6b0";
|
||||
}
|
||||
|
||||
.uniui-map-pin-ellipse:before {
|
||||
content: "\e6ac";
|
||||
}
|
||||
|
||||
.uniui-map-pin:before {
|
||||
content: "\e6ad";
|
||||
}
|
||||
|
||||
.uniui-location:before {
|
||||
content: "\e6ae";
|
||||
}
|
||||
|
||||
.uniui-starhalf:before {
|
||||
content: "\e683";
|
||||
}
|
||||
|
||||
.uniui-star:before {
|
||||
content: "\e688";
|
||||
}
|
||||
|
||||
.uniui-star-filled:before {
|
||||
content: "\e68f";
|
||||
}
|
||||
|
||||
.uniui-calendar:before {
|
||||
content: "\e6a0";
|
||||
}
|
||||
|
||||
.uniui-fire:before {
|
||||
content: "\e6a1";
|
||||
}
|
||||
|
||||
.uniui-medal:before {
|
||||
content: "\e6a2";
|
||||
}
|
||||
|
||||
.uniui-font:before {
|
||||
content: "\e6a3";
|
||||
}
|
||||
|
||||
.uniui-gift:before {
|
||||
content: "\e6a4";
|
||||
}
|
||||
|
||||
.uniui-link:before {
|
||||
content: "\e6a5";
|
||||
}
|
||||
|
||||
.uniui-notification:before {
|
||||
content: "\e6a6";
|
||||
}
|
||||
|
||||
.uniui-staff:before {
|
||||
content: "\e6a7";
|
||||
}
|
||||
|
||||
.uniui-vip:before {
|
||||
content: "\e6a8";
|
||||
}
|
||||
|
||||
.uniui-folder-add:before {
|
||||
content: "\e6a9";
|
||||
}
|
||||
|
||||
.uniui-tune:before {
|
||||
content: "\e6aa";
|
||||
}
|
||||
|
||||
.uniui-auth:before {
|
||||
content: "\e6ab";
|
||||
}
|
||||
|
||||
.uniui-person:before {
|
||||
content: "\e699";
|
||||
}
|
||||
|
||||
.uniui-email-filled:before {
|
||||
content: "\e69a";
|
||||
}
|
||||
|
||||
.uniui-phone-filled:before {
|
||||
content: "\e69b";
|
||||
}
|
||||
|
||||
.uniui-phone:before {
|
||||
content: "\e69c";
|
||||
}
|
||||
|
||||
.uniui-email:before {
|
||||
content: "\e69e";
|
||||
}
|
||||
|
||||
.uniui-personadd:before {
|
||||
content: "\e69f";
|
||||
}
|
||||
|
||||
.uniui-chatboxes-filled:before {
|
||||
content: "\e692";
|
||||
}
|
||||
|
||||
.uniui-contact:before {
|
||||
content: "\e693";
|
||||
}
|
||||
|
||||
.uniui-chatbubble-filled:before {
|
||||
content: "\e694";
|
||||
}
|
||||
|
||||
.uniui-contact-filled:before {
|
||||
content: "\e695";
|
||||
}
|
||||
|
||||
.uniui-chatboxes:before {
|
||||
content: "\e696";
|
||||
}
|
||||
|
||||
.uniui-chatbubble:before {
|
||||
content: "\e697";
|
||||
}
|
||||
|
||||
.uniui-upload-filled:before {
|
||||
content: "\e68e";
|
||||
}
|
||||
|
||||
.uniui-upload:before {
|
||||
content: "\e690";
|
||||
}
|
||||
|
||||
.uniui-weixin:before {
|
||||
content: "\e691";
|
||||
}
|
||||
|
||||
.uniui-compose:before {
|
||||
content: "\e67f";
|
||||
}
|
||||
|
||||
.uniui-qq:before {
|
||||
content: "\e680";
|
||||
}
|
||||
|
||||
.uniui-download-filled:before {
|
||||
content: "\e681";
|
||||
}
|
||||
|
||||
.uniui-pyq:before {
|
||||
content: "\e682";
|
||||
}
|
||||
|
||||
.uniui-sound:before {
|
||||
content: "\e684";
|
||||
}
|
||||
|
||||
.uniui-trash-filled:before {
|
||||
content: "\e685";
|
||||
}
|
||||
|
||||
.uniui-sound-filled:before {
|
||||
content: "\e686";
|
||||
}
|
||||
|
||||
.uniui-trash:before {
|
||||
content: "\e687";
|
||||
}
|
||||
|
||||
.uniui-videocam-filled:before {
|
||||
content: "\e689";
|
||||
}
|
||||
|
||||
.uniui-spinner-cycle:before {
|
||||
content: "\e68a";
|
||||
}
|
||||
|
||||
.uniui-weibo:before {
|
||||
content: "\e68b";
|
||||
}
|
||||
|
||||
.uniui-videocam:before {
|
||||
content: "\e68c";
|
||||
}
|
||||
|
||||
.uniui-download:before {
|
||||
content: "\e68d";
|
||||
}
|
||||
|
||||
.uniui-help:before {
|
||||
content: "\e679";
|
||||
}
|
||||
|
||||
.uniui-navigate-filled:before {
|
||||
content: "\e67a";
|
||||
}
|
||||
|
||||
.uniui-plusempty:before {
|
||||
content: "\e67b";
|
||||
}
|
||||
|
||||
.uniui-smallcircle:before {
|
||||
content: "\e67c";
|
||||
}
|
||||
|
||||
.uniui-minus-filled:before {
|
||||
content: "\e67d";
|
||||
}
|
||||
|
||||
.uniui-micoff:before {
|
||||
content: "\e67e";
|
||||
}
|
||||
|
||||
.uniui-closeempty:before {
|
||||
content: "\e66c";
|
||||
}
|
||||
|
||||
.uniui-clear:before {
|
||||
content: "\e66d";
|
||||
}
|
||||
|
||||
.uniui-navigate:before {
|
||||
content: "\e66e";
|
||||
}
|
||||
|
||||
.uniui-minus:before {
|
||||
content: "\e66f";
|
||||
}
|
||||
|
||||
.uniui-image:before {
|
||||
content: "\e670";
|
||||
}
|
||||
|
||||
.uniui-mic:before {
|
||||
content: "\e671";
|
||||
}
|
||||
|
||||
.uniui-paperplane:before {
|
||||
content: "\e672";
|
||||
}
|
||||
|
||||
.uniui-close:before {
|
||||
content: "\e673";
|
||||
}
|
||||
|
||||
.uniui-help-filled:before {
|
||||
content: "\e674";
|
||||
}
|
||||
|
||||
.uniui-paperplane-filled:before {
|
||||
content: "\e675";
|
||||
}
|
||||
|
||||
.uniui-plus:before {
|
||||
content: "\e676";
|
||||
}
|
||||
|
||||
.uniui-mic-filled:before {
|
||||
content: "\e677";
|
||||
}
|
||||
|
||||
.uniui-image-filled:before {
|
||||
content: "\e678";
|
||||
}
|
||||
|
||||
.uniui-locked-filled:before {
|
||||
content: "\e668";
|
||||
}
|
||||
|
||||
.uniui-info:before {
|
||||
content: "\e669";
|
||||
}
|
||||
|
||||
.uniui-locked:before {
|
||||
content: "\e66b";
|
||||
}
|
||||
|
||||
.uniui-camera-filled:before {
|
||||
content: "\e658";
|
||||
}
|
||||
|
||||
.uniui-chat-filled:before {
|
||||
content: "\e659";
|
||||
}
|
||||
|
||||
.uniui-camera:before {
|
||||
content: "\e65a";
|
||||
}
|
||||
|
||||
.uniui-circle:before {
|
||||
content: "\e65b";
|
||||
}
|
||||
|
||||
.uniui-checkmarkempty:before {
|
||||
content: "\e65c";
|
||||
}
|
||||
|
||||
.uniui-chat:before {
|
||||
content: "\e65d";
|
||||
}
|
||||
|
||||
.uniui-circle-filled:before {
|
||||
content: "\e65e";
|
||||
}
|
||||
|
||||
.uniui-flag:before {
|
||||
content: "\e65f";
|
||||
}
|
||||
|
||||
.uniui-flag-filled:before {
|
||||
content: "\e660";
|
||||
}
|
||||
|
||||
.uniui-gear-filled:before {
|
||||
content: "\e661";
|
||||
}
|
||||
|
||||
.uniui-home:before {
|
||||
content: "\e662";
|
||||
}
|
||||
|
||||
.uniui-home-filled:before {
|
||||
content: "\e663";
|
||||
}
|
||||
|
||||
.uniui-gear:before {
|
||||
content: "\e664";
|
||||
}
|
||||
|
||||
.uniui-smallcircle-filled:before {
|
||||
content: "\e665";
|
||||
}
|
||||
|
||||
.uniui-map-filled:before {
|
||||
content: "\e666";
|
||||
}
|
||||
|
||||
.uniui-map:before {
|
||||
content: "\e667";
|
||||
}
|
||||
|
||||
.uniui-refresh-filled:before {
|
||||
content: "\e656";
|
||||
}
|
||||
|
||||
.uniui-refresh:before {
|
||||
content: "\e657";
|
||||
}
|
||||
|
||||
.uniui-cloud-upload:before {
|
||||
content: "\e645";
|
||||
}
|
||||
|
||||
.uniui-cloud-download-filled:before {
|
||||
content: "\e646";
|
||||
}
|
||||
|
||||
.uniui-cloud-download:before {
|
||||
content: "\e647";
|
||||
}
|
||||
|
||||
.uniui-cloud-upload-filled:before {
|
||||
content: "\e648";
|
||||
}
|
||||
|
||||
.uniui-redo:before {
|
||||
content: "\e64a";
|
||||
}
|
||||
|
||||
.uniui-images-filled:before {
|
||||
content: "\e64b";
|
||||
}
|
||||
|
||||
.uniui-undo-filled:before {
|
||||
content: "\e64c";
|
||||
}
|
||||
|
||||
.uniui-more:before {
|
||||
content: "\e64d";
|
||||
}
|
||||
|
||||
.uniui-more-filled:before {
|
||||
content: "\e64e";
|
||||
}
|
||||
|
||||
.uniui-undo:before {
|
||||
content: "\e64f";
|
||||
}
|
||||
|
||||
.uniui-images:before {
|
||||
content: "\e650";
|
||||
}
|
||||
|
||||
.uniui-paperclip:before {
|
||||
content: "\e652";
|
||||
}
|
||||
|
||||
.uniui-settings:before {
|
||||
content: "\e653";
|
||||
}
|
||||
|
||||
.uniui-search:before {
|
||||
content: "\e654";
|
||||
}
|
||||
|
||||
.uniui-redo-filled:before {
|
||||
content: "\e655";
|
||||
}
|
||||
|
||||
.uniui-list:before {
|
||||
content: "\e644";
|
||||
}
|
||||
|
||||
.uniui-mail-open-filled:before {
|
||||
content: "\e63a";
|
||||
}
|
||||
|
||||
.uniui-hand-down-filled:before {
|
||||
content: "\e63c";
|
||||
}
|
||||
|
||||
.uniui-hand-down:before {
|
||||
content: "\e63d";
|
||||
}
|
||||
|
||||
.uniui-hand-up-filled:before {
|
||||
content: "\e63e";
|
||||
}
|
||||
|
||||
.uniui-hand-up:before {
|
||||
content: "\e63f";
|
||||
}
|
||||
|
||||
.uniui-heart-filled:before {
|
||||
content: "\e641";
|
||||
}
|
||||
|
||||
.uniui-mail-open:before {
|
||||
content: "\e643";
|
||||
}
|
||||
|
||||
.uniui-heart:before {
|
||||
content: "\e639";
|
||||
}
|
||||
|
||||
.uniui-loop:before {
|
||||
content: "\e633";
|
||||
}
|
||||
|
||||
.uniui-pulldown:before {
|
||||
content: "\e632";
|
||||
}
|
||||
|
||||
.uniui-scan:before {
|
||||
content: "\e62a";
|
||||
}
|
||||
|
||||
.uniui-bars:before {
|
||||
content: "\e627";
|
||||
}
|
||||
|
||||
.uniui-cart-filled:before {
|
||||
content: "\e629";
|
||||
}
|
||||
|
||||
.uniui-checkbox:before {
|
||||
content: "\e62b";
|
||||
}
|
||||
|
||||
.uniui-checkbox-filled:before {
|
||||
content: "\e62c";
|
||||
}
|
||||
|
||||
.uniui-shop:before {
|
||||
content: "\e62f";
|
||||
}
|
||||
|
||||
.uniui-headphones:before {
|
||||
content: "\e630";
|
||||
}
|
||||
|
||||
.uniui-cart:before {
|
||||
content: "\e631";
|
||||
}
|
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"id": "uni-icons",
|
||||
"displayName": "uni-icons 图标",
|
||||
"version": "1.3.5",
|
||||
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"icon",
|
||||
"图标"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.2.14"
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-scss"],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
## Icons 图标
|
||||
> **组件名:uni-icons**
|
||||
> 代码块: `uIcons`
|
||||
|
||||
用于展示 icons 图标 。
|
||||
|
||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
|
||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
@@ -51,7 +51,7 @@ public class SysLoginController {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
loginBody.getUuid(), loginBody.getTenantId());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
}
|
||||
@@ -74,6 +74,8 @@ public class SysLoginController {
|
||||
tokenService.refreshToken(loginUser);
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("optionJson", loginUser.getOptionJson());
|
||||
ajax.put("practitionerId", String.valueOf(loginUser.getPractitionerId()));
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
|
@@ -41,6 +41,11 @@ public class CacheConstants {
|
||||
*/
|
||||
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||
|
||||
/**
|
||||
* 登录上次勾选的租户
|
||||
*/
|
||||
public static final String LOGIN_SELECTED_TENANT = "login_selected_tenant:";
|
||||
|
||||
/**
|
||||
* 超出上限,排番失败(时间:{},KEY:{}
|
||||
*/
|
||||
|
@@ -163,7 +163,7 @@ public class Constants {
|
||||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = {"com.core.quartz.task"};
|
||||
public static final String[] JOB_WHITELIST_STR = {"com.openhis.quartz.task"};
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
|
@@ -7,20 +7,24 @@ import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.core.common.annotation.Excel;
|
||||
import com.core.common.annotation.Excel.ColumnType;
|
||||
import com.core.common.annotation.Excel.Type;
|
||||
import com.core.common.annotation.Excels;
|
||||
import com.core.common.core.domain.BaseEntity;
|
||||
import com.core.common.xss.Xss;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@@ -79,18 +83,23 @@ public class SysUser extends BaseEntity {
|
||||
/** 部门对象 */
|
||||
@Excels({@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)})
|
||||
@TableField(exist = false)
|
||||
private SysDept dept;
|
||||
|
||||
/** 角色对象 */
|
||||
@TableField(exist = false)
|
||||
private List<SysRole> roles;
|
||||
|
||||
/** 角色组 */
|
||||
@TableField(exist = false)
|
||||
private Long[] roleIds;
|
||||
|
||||
/** 岗位组 */
|
||||
@TableField(exist = false)
|
||||
private Long[] postIds;
|
||||
|
||||
/** 角色ID */
|
||||
@TableField(exist = false)
|
||||
private Long roleId;
|
||||
|
||||
/** 租户ID */
|
||||
@@ -99,6 +108,18 @@ public class SysUser extends BaseEntity {
|
||||
/** 删除标识 */
|
||||
private String deleteFlag;
|
||||
|
||||
/**
|
||||
* 科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField(exist = false)
|
||||
private Long orgId;
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String orgName;
|
||||
|
||||
public SysUser() {
|
||||
|
||||
}
|
||||
|
@@ -26,6 +26,11 @@ public class LoginBody {
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Integer tenantId;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@@ -57,4 +62,12 @@ public class LoginBody {
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public Integer getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Integer tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import java.util.Set;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.core.common.core.domain.entity.SysUser;
|
||||
|
||||
@@ -78,11 +79,21 @@ public class LoginUser implements UserDetails {
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 所属医院id
|
||||
*/
|
||||
private Long hospitalId;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
private Long practitionerId;
|
||||
|
||||
/**
|
||||
* option JSON串
|
||||
*/
|
||||
private JSONObject optionJson;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
|
@@ -12,6 +12,10 @@ public class LoginUserExtend {
|
||||
* 机构/科室id
|
||||
*/
|
||||
private Long orgId;
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
|
@@ -256,6 +256,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断日期是否为未来时间
|
||||
*
|
||||
* @param date Date 类型的日期
|
||||
* @return 是/否
|
||||
*/
|
||||
public static boolean isFuture(Date date) {
|
||||
// 获取当前时间
|
||||
Date currentDate = Calendar.getInstance().getTime();
|
||||
// 检查传入的日期是否在当前时间之后
|
||||
return date.after(currentDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从身份证号码中提取生日
|
||||
*
|
||||
|
@@ -110,7 +110,7 @@ public class HttpUtils {
|
||||
conn.setRequestProperty("connection", "Keep-Alive");
|
||||
conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
|
||||
conn.setRequestProperty("Accept-Charset", "utf-8");
|
||||
conn.setRequestProperty("contentType", "utf-8");
|
||||
conn.setRequestProperty("contentType", "json");
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
out = new PrintWriter(conn.getOutputStream());
|
||||
|
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.core.common.utils.http;
|
||||
|
||||
/**
|
||||
* 老系统http请求工具类
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2024-12-30
|
||||
*/
|
||||
public class OldHisHttpUtils {
|
||||
public static String oldHisHttpPost() {
|
||||
|
||||
String s1 = HttpUtils.sendPost("http://localhost:8080/myareahisnyb/gfChargeRatio/gfsum", "");
|
||||
|
||||
System.out.println(s1);
|
||||
return s1;
|
||||
}
|
||||
|
||||
}
|
@@ -92,14 +92,14 @@ public class MybatisPlusConfig {
|
||||
"adm_device_definition", "adm_encounter", "adm_encounter_diagnosis", "adm_encounter_location",
|
||||
"adm_encounter_participant", "adm_encounter_reason", "adm_healthcare_service", "adm_invoice",
|
||||
"adm_location", "adm_organization", "adm_organization_location", "adm_patient",
|
||||
"adm_patient_identifier", "sys_user", "adm_practitioner", "adm_practitioner_role", "adm_supplier",
|
||||
"cli_condition", "cli_condition_definition", "cli_diagnosis_belong_binding", "cli_procedure",
|
||||
"cli_procedure_performer", "doc_emr", "doc_emr_template", "doc_emr_detail", "doc_emr_dict", "fin_claim",
|
||||
"fin_claim_response", "fin_contract", "fin_payment_notice", "fin_payment_rec_detail",
|
||||
"fin_payment_reconciliation", "med_medication", "med_medication_definition", "med_medication_dispense",
|
||||
"med_medication_request", "wor_activity_definition", "wor_device_dispense", "wor_device_request",
|
||||
"wor_inventory_item", "wor_service_request", "wor_service_request_detail", "wor_supply_delivery",
|
||||
"wor_supply_request"));
|
||||
"adm_patient_identifier", "adm_practitioner", "adm_practitioner_role", "adm_supplier", "cli_condition",
|
||||
"cli_condition_definition", "cli_diagnosis_belong_binding", "cli_procedure", "cli_procedure_performer",
|
||||
"doc_emr", "doc_emr_template", "doc_emr_detail", "doc_emr_dict", "fin_claim", "fin_claim_response",
|
||||
"fin_contract", "fin_payment_notice", "fin_payment_rec_detail", "fin_payment_reconciliation",
|
||||
"med_medication", "med_medication_definition", "med_medication_dispense", "med_medication_request",
|
||||
"wor_activity_definition", "wor_device_dispense", "wor_device_request", "wor_inventory_item",
|
||||
"wor_service_request", "wor_service_request_detail", "wor_supply_delivery", "wor_supply_request",
|
||||
"sys_operation_record"));
|
||||
|
||||
@Override
|
||||
public boolean ignoreTable(String tableName) {
|
||||
@@ -116,7 +116,23 @@ public class MybatisPlusConfig {
|
||||
* 获取当前租户 ID
|
||||
*/
|
||||
private Integer getCurrentTenantId() {
|
||||
// // 尝试从请求头中获取租户ID
|
||||
|
||||
// 首先尝试从线程局部变量中获取租户ID(适用于定时任务等场景)
|
||||
Integer threadLocalTenantId = TenantContext.getCurrentTenant();
|
||||
if (threadLocalTenantId != null) {
|
||||
return threadLocalTenantId;
|
||||
}
|
||||
|
||||
// 获取当前登录用户的租户ID(优先使用SecurityUtils中储存的LoginUser的租户ID)
|
||||
try {
|
||||
if (SecurityUtils.getAuthentication() != null) {
|
||||
return SecurityUtils.getLoginUser().getTenantId();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return 1; // 默认租户ID
|
||||
}
|
||||
|
||||
// 尝试从请求头中获取租户ID
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (attributes != null) {
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
@@ -130,10 +146,7 @@ public class MybatisPlusConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取当前登录用户的租户 ID
|
||||
if (SecurityUtils.getAuthentication() != null) {
|
||||
return SecurityUtils.getLoginUser().getTenantId();
|
||||
}
|
||||
return 0; // 默认租户ID
|
||||
|
||||
return 1; // 默认租户ID
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,10 @@
|
||||
package com.core.framework.web.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
@@ -9,16 +12,18 @@ import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.core.common.constant.CacheConstants;
|
||||
import com.core.common.constant.Constants;
|
||||
import com.core.common.constant.UserConstants;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysUser;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.core.domain.model.LoginUserExtend;
|
||||
import com.core.common.core.redis.RedisCache;
|
||||
import com.core.common.enums.DeleteFlag;
|
||||
import com.core.common.enums.TenantStatus;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.exception.user.*;
|
||||
import com.core.common.utils.DateUtils;
|
||||
@@ -28,7 +33,9 @@ import com.core.common.utils.ip.IpUtils;
|
||||
import com.core.framework.manager.AsyncManager;
|
||||
import com.core.framework.manager.factory.AsyncFactory;
|
||||
import com.core.framework.security.context.AuthenticationContextHolder;
|
||||
import com.core.system.domain.SysTenant;
|
||||
import com.core.system.service.ISysConfigService;
|
||||
import com.core.system.service.ISysTenantService;
|
||||
import com.core.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
@@ -53,6 +60,9 @@ public class SysLoginService {
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private ISysTenantService sysTenantService;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
@@ -60,11 +70,18 @@ public class SysLoginService {
|
||||
* @param password 密码
|
||||
* @param code 验证码
|
||||
* @param uuid 唯一标识
|
||||
* @param tenantId 租户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public String login(String username, String password, String code, String uuid) {
|
||||
public String login(String username, String password, String code, String uuid, Integer tenantId) {
|
||||
// 验证码校验
|
||||
validateCaptcha(username, code, uuid);
|
||||
// validateCaptcha(username, code, uuid);
|
||||
|
||||
// 租户校验
|
||||
validateTenant(username, tenantId);
|
||||
// 保存本次勾选租户
|
||||
redisCache.setCacheObject(CacheConstants.LOGIN_SELECTED_TENANT + username, tenantId);
|
||||
|
||||
// 登录前置校验
|
||||
loginPreCheck(username, password);
|
||||
// 用户验证
|
||||
@@ -91,29 +108,63 @@ public class SysLoginService {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS,
|
||||
MessageUtils.message("user.login.success")));
|
||||
LoginUser loginUser = (LoginUser)authentication.getPrincipal();
|
||||
|
||||
// -----start-----登录时set租户id
|
||||
Integer tenantId = 0;
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (attributes != null) {
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
// 从请求头获取租户ID,假设header名称为"X-Tenant-ID" ; 登录接口前端把租户id放到请求头里
|
||||
String tenantIdHeader = request.getHeader("X-Tenant-ID");
|
||||
if (tenantIdHeader != null && !tenantIdHeader.isEmpty()) {
|
||||
tenantId = Integer.parseInt(tenantIdHeader);
|
||||
}
|
||||
}
|
||||
loginUser.setTenantId(tenantId);
|
||||
// -----end-----登录时set租户id
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
// 设置 机构id和参与者id
|
||||
LoginUserExtend loginUserExtend = userService.getLoginUserExtend(loginUser.getUserId());
|
||||
loginUser.setOrgId(loginUserExtend.getOrgId());
|
||||
loginUser.setPractitionerId(loginUserExtend.getPractitionerId());
|
||||
// 设置登录用户信息
|
||||
this.setLoginUserInfo(loginUser, tenantId);
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置登录用户信息
|
||||
*
|
||||
* @param loginUser 登录用户
|
||||
* @param tenantId 租户ID
|
||||
*/
|
||||
public void setLoginUserInfo(LoginUser loginUser, Integer tenantId) {
|
||||
// // 登录时set租户id
|
||||
// Integer tenantId = 0;
|
||||
// ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
// if (attributes != null) {
|
||||
// HttpServletRequest request = attributes.getRequest();
|
||||
// // 从请求头获取租户ID,假设header名称为"X-Tenant-ID" ; 登录接口前端把租户id放到请求头里
|
||||
// String tenantIdHeader = request.getHeader("X-Tenant-ID");
|
||||
// if (tenantIdHeader != null && !tenantIdHeader.isEmpty()) {
|
||||
// tenantId = Integer.parseInt(tenantIdHeader);
|
||||
// }
|
||||
// }
|
||||
// // 设置租户id
|
||||
// loginUser.setTenantId(tenantId);
|
||||
// 记录登录信息
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
// 设置登录用户的信息
|
||||
LoginUserExtend loginUserExtend = userService.getLoginUserExtend(loginUser.getUserId());
|
||||
if (loginUserExtend != null) {
|
||||
loginUser.setOrgId(loginUserExtend.getOrgId()); // 科室id
|
||||
loginUser.setPractitionerId(loginUserExtend.getPractitionerId()); // 参与者id
|
||||
loginUser.setHospitalId(userService.getHospitalIdByOrgId(loginUserExtend.getOrgId())); // 所属医院id
|
||||
// user
|
||||
loginUser.getUser().setOrgId(loginUserExtend.getOrgId()); // 科室id
|
||||
loginUser.getUser().setOrgName(loginUserExtend.getOrgName()); // 科室名称
|
||||
}
|
||||
|
||||
// 设置租户ID
|
||||
loginUser.getUser().setTenantId(tenantId);
|
||||
loginUser.setTenantId(tenantId);
|
||||
|
||||
// option集合
|
||||
List<Map<String, String>> optionList = userService.getOptionList(tenantId);
|
||||
if (optionList.isEmpty()) {
|
||||
throw new IllegalArgumentException("未匹配到option信息");
|
||||
}
|
||||
JSONObject optionJson = new JSONObject();
|
||||
for (Map<String, String> map : optionList) {
|
||||
String key = map.get("optionkey");
|
||||
String value = map.get("optionvalue");
|
||||
optionJson.put(key, value);
|
||||
}
|
||||
loginUser.setOptionJson(optionJson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*
|
||||
@@ -189,4 +240,35 @@ public class SysLoginService {
|
||||
sysUser.setLoginDate(DateUtils.getNowDate());
|
||||
userService.updateUserProfile(sysUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验租户
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param tenantId 租户ID
|
||||
*/
|
||||
private void validateTenant(String username, Integer tenantId) {
|
||||
// 租户非空校验
|
||||
if (tenantId == null) {
|
||||
throw new ServiceException("请指定所属医院");
|
||||
}
|
||||
// 查询用户绑定的租户列表
|
||||
R<List<SysTenant>> bindTenantList = sysTenantService.getUserBindTenantList(username);
|
||||
// 租户合法性校验
|
||||
Optional<SysTenant> currentTenantOptional =
|
||||
bindTenantList.getData().stream().filter(e -> tenantId.equals(e.getId())).findFirst();
|
||||
if (currentTenantOptional.isEmpty()) {
|
||||
throw new ServiceException("所属医院非法");
|
||||
}
|
||||
// 租户状态校验
|
||||
SysTenant currentTenant = currentTenantOptional.get();
|
||||
if (TenantStatus.DISABLE.getCode().equals(currentTenant.getStatus())) {
|
||||
throw new ServiceException("所属医院停用");
|
||||
}
|
||||
// 租户删除状态校验
|
||||
if (DeleteFlag.DELETED.getCode().equals(currentTenant.getDeleteFlag())) {
|
||||
throw new ServiceException("所属医院不存在");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -49,6 +49,9 @@ public class GenUtils {
|
||||
case "doc":
|
||||
genTable.setPackageName(GenConfig.getPackageName() + ".document");
|
||||
break;
|
||||
case "yb":
|
||||
genTable.setPackageName(GenConfig.getPackageName() + ".ybcatalog");
|
||||
break;
|
||||
default:
|
||||
genTable.setPackageName(GenConfig.getPackageName() + ".errortable");
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ gen:
|
||||
# 自动去除表前缀,默认是false
|
||||
autoRemovePre: true
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
tablePrefix: cod_,adm_,cli_,dia_,med_,wor_,fin_,def_,doc_
|
||||
tablePrefix: cod_,adm_,cli_,dia_,med_,wor_,fin_,def_,doc_,yb_
|
@@ -1,154 +0,0 @@
|
||||
package com.core.quartz.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.constant.Constants;
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.core.page.TableDataInfo;
|
||||
import com.core.common.enums.BusinessType;
|
||||
import com.core.common.exception.job.TaskException;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.quartz.domain.SysJob;
|
||||
import com.core.quartz.service.ISysJobService;
|
||||
import com.core.quartz.util.CronUtils;
|
||||
import com.core.quartz.util.ScheduleUtils;
|
||||
|
||||
/**
|
||||
* 调度任务信息操作处理
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/job")
|
||||
public class SysJobController extends BaseController {
|
||||
@Autowired
|
||||
private ISysJobService jobService;
|
||||
|
||||
/**
|
||||
* 查询定时任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysJob sysJob) {
|
||||
startPage();
|
||||
List<SysJob> list = jobService.selectJobList(sysJob);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出定时任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:export')")
|
||||
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysJob sysJob) {
|
||||
List<SysJob> list = jobService.selectJobList(sysJob);
|
||||
ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
||||
util.exportExcel(response, list, "定时任务");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取定时任务详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:query')")
|
||||
@GetMapping(value = "/{jobId}")
|
||||
public AjaxResult getInfo(@PathVariable("jobId") Long jobId) {
|
||||
return success(jobService.selectJobById(jobId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增定时任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:add')")
|
||||
@Log(title = "定时任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException {
|
||||
if (!CronUtils.isValid(job.getCronExpression())) {
|
||||
return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确");
|
||||
} else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
|
||||
} else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(),
|
||||
new String[] {Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) {
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
|
||||
} else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(),
|
||||
new String[] {Constants.HTTP, Constants.HTTPS})) {
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
|
||||
} else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) {
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串存在违规");
|
||||
} else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) {
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
|
||||
}
|
||||
job.setCreateBy(getUsername());
|
||||
return toAjax(jobService.insertJob(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改定时任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:edit')")
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException {
|
||||
if (!CronUtils.isValid(job.getCronExpression())) {
|
||||
return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确");
|
||||
} else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
|
||||
} else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(),
|
||||
new String[] {Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) {
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
|
||||
} else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(),
|
||||
new String[] {Constants.HTTP, Constants.HTTPS})) {
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
|
||||
} else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) {
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串存在违规");
|
||||
} else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) {
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
|
||||
}
|
||||
job.setUpdateBy(getUsername());
|
||||
return toAjax(jobService.updateJob(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时任务状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException {
|
||||
SysJob newJob = jobService.selectJobById(job.getJobId());
|
||||
newJob.setStatus(job.getStatus());
|
||||
return toAjax(jobService.changeStatus(newJob));
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时任务立即执行一次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/run")
|
||||
public AjaxResult run(@RequestBody SysJob job) throws SchedulerException {
|
||||
boolean result = jobService.run(job);
|
||||
return result ? success() : error("任务不存在或已过期!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除定时任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
||||
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{jobIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException {
|
||||
jobService.deleteJobByIds(jobIds);
|
||||
return success();
|
||||
}
|
||||
}
|
@@ -1,83 +0,0 @@
|
||||
package com.core.quartz.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.core.page.TableDataInfo;
|
||||
import com.core.common.enums.BusinessType;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.quartz.domain.SysJobLog;
|
||||
import com.core.quartz.service.ISysJobLogService;
|
||||
|
||||
/**
|
||||
* 调度日志操作处理
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/jobLog")
|
||||
public class SysJobLogController extends BaseController {
|
||||
@Autowired
|
||||
private ISysJobLogService jobLogService;
|
||||
|
||||
/**
|
||||
* 查询定时任务调度日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysJobLog sysJobLog) {
|
||||
startPage();
|
||||
List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出定时任务调度日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:export')")
|
||||
@Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysJobLog sysJobLog) {
|
||||
List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
|
||||
ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
|
||||
util.exportExcel(response, list, "调度日志");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据调度编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:query')")
|
||||
@GetMapping(value = "/{jobLogId}")
|
||||
public AjaxResult getInfo(@PathVariable Long jobLogId) {
|
||||
return success(jobLogService.selectJobLogById(jobLogId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除定时任务调度日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
||||
@Log(title = "定时任务调度日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{jobLogIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] jobLogIds) {
|
||||
return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空定时任务调度日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
||||
@Log(title = "调度日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean() {
|
||||
jobLogService.cleanJobLog();
|
||||
return success();
|
||||
}
|
||||
}
|
@@ -1,56 +0,0 @@
|
||||
package com.core.quartz.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.core.quartz.domain.SysJobLog;
|
||||
|
||||
/**
|
||||
* 定时任务调度日志信息信息 服务层
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public interface ISysJobLogService {
|
||||
/**
|
||||
* 获取quartz调度器日志的计划任务
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
* @return 调度任务日志集合
|
||||
*/
|
||||
public List<SysJobLog> selectJobLogList(SysJobLog jobLog);
|
||||
|
||||
/**
|
||||
* 通过调度任务日志ID查询调度信息
|
||||
*
|
||||
* @param jobLogId 调度任务日志ID
|
||||
* @return 调度任务日志对象信息
|
||||
*/
|
||||
public SysJobLog selectJobLogById(Long jobLogId);
|
||||
|
||||
/**
|
||||
* 新增任务日志
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
*/
|
||||
public void addJobLog(SysJobLog jobLog);
|
||||
|
||||
/**
|
||||
* 批量删除调度日志信息
|
||||
*
|
||||
* @param logIds 需要删除的日志ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobLogByIds(Long[] logIds);
|
||||
|
||||
/**
|
||||
* 删除任务日志
|
||||
*
|
||||
* @param jobId 调度日志ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJobLogById(Long jobId);
|
||||
|
||||
/**
|
||||
* 清空任务日志
|
||||
*/
|
||||
public void cleanJobLog();
|
||||
}
|
@@ -1,103 +0,0 @@
|
||||
package com.core.quartz.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.quartz.SchedulerException;
|
||||
|
||||
import com.core.common.exception.job.TaskException;
|
||||
import com.core.quartz.domain.SysJob;
|
||||
|
||||
/**
|
||||
* 定时任务调度信息信息 服务层
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public interface ISysJobService {
|
||||
/**
|
||||
* 获取quartz调度器的计划任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 调度任务集合
|
||||
*/
|
||||
public List<SysJob> selectJobList(SysJob job);
|
||||
|
||||
/**
|
||||
* 通过调度任务ID查询调度信息
|
||||
*
|
||||
* @param jobId 调度任务ID
|
||||
* @return 调度任务对象信息
|
||||
*/
|
||||
public SysJob selectJobById(Long jobId);
|
||||
|
||||
/**
|
||||
* 暂停任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int pauseJob(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 恢复任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int resumeJob(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 删除任务后,所对应的trigger也将被删除
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJob(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 批量删除调度信息
|
||||
*
|
||||
* @param jobIds 需要删除的任务ID
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteJobByIds(Long[] jobIds) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 任务调度状态修改
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int changeStatus(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 立即运行任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean run(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJob(SysJob job) throws SchedulerException, TaskException;
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJob(SysJob job) throws SchedulerException, TaskException;
|
||||
|
||||
/**
|
||||
* 校验cron表达式是否有效
|
||||
*
|
||||
* @param cronExpression 表达式
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkCronExpressionIsValid(String cronExpression);
|
||||
}
|
@@ -1,82 +0,0 @@
|
||||
package com.core.quartz.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.core.quartz.domain.SysJobLog;
|
||||
import com.core.quartz.mapper.SysJobLogMapper;
|
||||
import com.core.quartz.service.ISysJobLogService;
|
||||
|
||||
/**
|
||||
* 定时任务调度日志信息 服务层
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Service
|
||||
public class SysJobLogServiceImpl implements ISysJobLogService {
|
||||
@Autowired
|
||||
private SysJobLogMapper jobLogMapper;
|
||||
|
||||
/**
|
||||
* 获取quartz调度器日志的计划任务
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
* @return 调度任务日志集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysJobLog> selectJobLogList(SysJobLog jobLog) {
|
||||
return jobLogMapper.selectJobLogList(jobLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过调度任务日志ID查询调度信息
|
||||
*
|
||||
* @param jobLogId 调度任务日志ID
|
||||
* @return 调度任务日志对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysJobLog selectJobLogById(Long jobLogId) {
|
||||
return jobLogMapper.selectJobLogById(jobLogId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务日志
|
||||
*
|
||||
* @param jobLog 调度日志信息
|
||||
*/
|
||||
@Override
|
||||
public void addJobLog(SysJobLog jobLog) {
|
||||
jobLogMapper.insertJobLog(jobLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除调度日志信息
|
||||
*
|
||||
* @param logIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteJobLogByIds(Long[] logIds) {
|
||||
return jobLogMapper.deleteJobLogByIds(logIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务日志
|
||||
*
|
||||
* @param jobId 调度日志ID
|
||||
*/
|
||||
@Override
|
||||
public int deleteJobLogById(Long jobId) {
|
||||
return jobLogMapper.deleteJobLogById(jobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空任务日志
|
||||
*/
|
||||
@Override
|
||||
public void cleanJobLog() {
|
||||
jobLogMapper.cleanJobLog();
|
||||
}
|
||||
}
|
@@ -1,238 +0,0 @@
|
||||
package com.core.quartz.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.core.common.constant.ScheduleConstants;
|
||||
import com.core.common.exception.job.TaskException;
|
||||
import com.core.quartz.domain.SysJob;
|
||||
import com.core.quartz.mapper.SysJobMapper;
|
||||
import com.core.quartz.service.ISysJobService;
|
||||
import com.core.quartz.util.CronUtils;
|
||||
import com.core.quartz.util.ScheduleUtils;
|
||||
|
||||
/**
|
||||
* 定时任务调度信息 服务层
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Service
|
||||
public class SysJobServiceImpl implements ISysJobService {
|
||||
@Autowired
|
||||
private Scheduler scheduler;
|
||||
|
||||
@Autowired
|
||||
private SysJobMapper jobMapper;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据)
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() throws SchedulerException, TaskException {
|
||||
scheduler.clear();
|
||||
List<SysJob> jobList = jobMapper.selectJobAll();
|
||||
for (SysJob job : jobList) {
|
||||
ScheduleUtils.createScheduleJob(scheduler, job);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取quartz调度器的计划任务列表
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysJob> selectJobList(SysJob job) {
|
||||
return jobMapper.selectJobList(job);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过调度任务ID查询调度信息
|
||||
*
|
||||
* @param jobId 调度任务ID
|
||||
* @return 调度任务对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysJob selectJobById(Long jobId) {
|
||||
return jobMapper.selectJobById(jobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int pauseJob(SysJob job) throws SchedulerException {
|
||||
Long jobId = job.getJobId();
|
||||
String jobGroup = job.getJobGroup();
|
||||
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
|
||||
int rows = jobMapper.updateJob(job);
|
||||
if (rows > 0) {
|
||||
scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int resumeJob(SysJob job) throws SchedulerException {
|
||||
Long jobId = job.getJobId();
|
||||
String jobGroup = job.getJobGroup();
|
||||
job.setStatus(ScheduleConstants.Status.NORMAL.getValue());
|
||||
int rows = jobMapper.updateJob(job);
|
||||
if (rows > 0) {
|
||||
scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup));
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务后,所对应的trigger也将被删除
|
||||
*
|
||||
* @param job 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteJob(SysJob job) throws SchedulerException {
|
||||
Long jobId = job.getJobId();
|
||||
String jobGroup = job.getJobGroup();
|
||||
int rows = jobMapper.deleteJobById(jobId);
|
||||
if (rows > 0) {
|
||||
scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup));
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除调度信息
|
||||
*
|
||||
* @param jobIds 需要删除的任务ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteJobByIds(Long[] jobIds) throws SchedulerException {
|
||||
for (Long jobId : jobIds) {
|
||||
SysJob job = jobMapper.selectJobById(jobId);
|
||||
deleteJob(job);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务调度状态修改
|
||||
*
|
||||
* @param job 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int changeStatus(SysJob job) throws SchedulerException {
|
||||
int rows = 0;
|
||||
String status = job.getStatus();
|
||||
if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) {
|
||||
rows = resumeJob(job);
|
||||
} else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) {
|
||||
rows = pauseJob(job);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 立即运行任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean run(SysJob job) throws SchedulerException {
|
||||
boolean result = false;
|
||||
Long jobId = job.getJobId();
|
||||
String jobGroup = job.getJobGroup();
|
||||
SysJob properties = selectJobById(job.getJobId());
|
||||
// 参数
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties);
|
||||
JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup);
|
||||
if (scheduler.checkExists(jobKey)) {
|
||||
result = true;
|
||||
scheduler.triggerJob(jobKey, dataMap);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param job 调度信息 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertJob(SysJob job) throws SchedulerException, TaskException {
|
||||
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
|
||||
int rows = jobMapper.insertJob(job);
|
||||
if (rows > 0) {
|
||||
ScheduleUtils.createScheduleJob(scheduler, job);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务的时间表达式
|
||||
*
|
||||
* @param job 调度信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateJob(SysJob job) throws SchedulerException, TaskException {
|
||||
SysJob properties = selectJobById(job.getJobId());
|
||||
int rows = jobMapper.updateJob(job);
|
||||
if (rows > 0) {
|
||||
updateSchedulerJob(job, properties.getJobGroup());
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param job 任务对象
|
||||
* @param jobGroup 任务组名
|
||||
*/
|
||||
public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException {
|
||||
Long jobId = job.getJobId();
|
||||
// 判断是否存在
|
||||
JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup);
|
||||
if (scheduler.checkExists(jobKey)) {
|
||||
// 防止创建时存在数据问题 先移除,然后在执行创建操作
|
||||
scheduler.deleteJob(jobKey);
|
||||
}
|
||||
ScheduleUtils.createScheduleJob(scheduler, job);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验cron表达式是否有效
|
||||
*
|
||||
* @param cronExpression 表达式
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkCronExpressionIsValid(String cronExpression) {
|
||||
return CronUtils.isValid(cronExpression);
|
||||
}
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
package com.core.quartz.task;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.core.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 定时任务调度测试
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Component("ryTask")
|
||||
public class RyTask {
|
||||
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
|
||||
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
|
||||
}
|
||||
|
||||
public void ryParams(String params) {
|
||||
System.out.println("执行有参方法:" + params);
|
||||
}
|
||||
|
||||
public void ryNoParams() {
|
||||
System.out.println("执行无参方法");
|
||||
}
|
||||
}
|
@@ -1,98 +0,0 @@
|
||||
package com.core.quartz.util;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.core.common.constant.Constants;
|
||||
import com.core.common.constant.ScheduleConstants;
|
||||
import com.core.common.utils.ExceptionUtil;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.spring.SpringUtils;
|
||||
import com.core.quartz.domain.SysJob;
|
||||
import com.core.quartz.domain.SysJobLog;
|
||||
import com.core.quartz.service.ISysJobLogService;
|
||||
|
||||
/**
|
||||
* 抽象quartz调用
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public abstract class AbstractQuartzJob implements Job {
|
||||
private static final Logger log = LoggerFactory.getLogger(AbstractQuartzJob.class);
|
||||
|
||||
/**
|
||||
* 线程本地变量
|
||||
*/
|
||||
private static ThreadLocal<Date> threadLocal = new ThreadLocal<>();
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
SysJob sysJob = new SysJob();
|
||||
BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES));
|
||||
try {
|
||||
before(context, sysJob);
|
||||
if (sysJob != null) {
|
||||
doExecute(context, sysJob);
|
||||
}
|
||||
after(context, sysJob, null);
|
||||
} catch (Exception e) {
|
||||
log.error("任务执行异常 - :", e);
|
||||
after(context, sysJob, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行前
|
||||
*
|
||||
* @param context 工作执行上下文对象
|
||||
* @param sysJob 系统计划任务
|
||||
*/
|
||||
protected void before(JobExecutionContext context, SysJob sysJob) {
|
||||
threadLocal.set(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行后
|
||||
*
|
||||
* @param context 工作执行上下文对象
|
||||
* @param sysJob 系统计划任务
|
||||
*/
|
||||
protected void after(JobExecutionContext context, SysJob sysJob, Exception e) {
|
||||
Date startTime = threadLocal.get();
|
||||
threadLocal.remove();
|
||||
|
||||
final SysJobLog sysJobLog = new SysJobLog();
|
||||
sysJobLog.setJobName(sysJob.getJobName());
|
||||
sysJobLog.setJobGroup(sysJob.getJobGroup());
|
||||
sysJobLog.setInvokeTarget(sysJob.getInvokeTarget());
|
||||
sysJobLog.setStartTime(startTime);
|
||||
sysJobLog.setStopTime(new Date());
|
||||
long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime();
|
||||
sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒");
|
||||
if (e != null) {
|
||||
sysJobLog.setStatus(Constants.FAIL);
|
||||
String errorMsg = StringUtils.substring(ExceptionUtil.getExceptionMessage(e), 0, 2000);
|
||||
sysJobLog.setExceptionInfo(errorMsg);
|
||||
} else {
|
||||
sysJobLog.setStatus(Constants.SUCCESS);
|
||||
}
|
||||
|
||||
// 写入数据库当中
|
||||
SpringUtils.getBean(ISysJobLogService.class).addJobLog(sysJobLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行方法,由子类重载
|
||||
*
|
||||
* @param context 工作执行上下文对象
|
||||
* @param sysJob 系统计划任务
|
||||
* @throws Exception 执行过程中的异常
|
||||
*/
|
||||
protected abstract void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception;
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package com.core.quartz.util;
|
||||
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
import com.core.quartz.domain.SysJob;
|
||||
|
||||
/**
|
||||
* 定时任务处理(禁止并发执行)
|
||||
*
|
||||
* @author system
|
||||
*
|
||||
*/
|
||||
@DisallowConcurrentExecution
|
||||
public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob {
|
||||
@Override
|
||||
protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception {
|
||||
JobInvokeUtil.invokeMethod(sysJob);
|
||||
}
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.core.quartz.util;
|
||||
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
import com.core.quartz.domain.SysJob;
|
||||
|
||||
/**
|
||||
* 定时任务处理(允许并发执行)
|
||||
*
|
||||
* @author system
|
||||
*
|
||||
*/
|
||||
public class QuartzJobExecution extends AbstractQuartzJob {
|
||||
@Override
|
||||
protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception {
|
||||
JobInvokeUtil.invokeMethod(sysJob);
|
||||
}
|
||||
}
|
@@ -1,122 +0,0 @@
|
||||
package com.core.quartz.util;
|
||||
|
||||
import org.quartz.*;
|
||||
|
||||
import com.core.common.constant.Constants;
|
||||
import com.core.common.constant.ScheduleConstants;
|
||||
import com.core.common.exception.job.TaskException;
|
||||
import com.core.common.exception.job.TaskException.Code;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.spring.SpringUtils;
|
||||
import com.core.quartz.domain.SysJob;
|
||||
|
||||
/**
|
||||
* 定时任务工具类
|
||||
*
|
||||
* @author system
|
||||
*
|
||||
*/
|
||||
public class ScheduleUtils {
|
||||
/**
|
||||
* 得到quartz任务类
|
||||
*
|
||||
* @param sysJob 执行计划
|
||||
* @return 具体执行任务类
|
||||
*/
|
||||
private static Class<? extends Job> getQuartzJobClass(SysJob sysJob) {
|
||||
boolean isConcurrent = "0".equals(sysJob.getConcurrent());
|
||||
return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建任务触发对象
|
||||
*/
|
||||
public static TriggerKey getTriggerKey(Long jobId, String jobGroup) {
|
||||
return TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建任务键对象
|
||||
*/
|
||||
public static JobKey getJobKey(Long jobId, String jobGroup) {
|
||||
return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建定时任务
|
||||
*/
|
||||
public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException {
|
||||
Class<? extends Job> jobClass = getQuartzJobClass(job);
|
||||
// 构建job信息
|
||||
Long jobId = job.getJobId();
|
||||
String jobGroup = job.getJobGroup();
|
||||
JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(getJobKey(jobId, jobGroup)).build();
|
||||
|
||||
// 表达式调度构建器
|
||||
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression());
|
||||
cronScheduleBuilder = handleCronScheduleMisfirePolicy(job, cronScheduleBuilder);
|
||||
|
||||
// 按新的cronExpression表达式构建一个新的trigger
|
||||
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(jobId, jobGroup))
|
||||
.withSchedule(cronScheduleBuilder).build();
|
||||
|
||||
// 放入参数,运行时的方法可以获取
|
||||
jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job);
|
||||
|
||||
// 判断是否存在
|
||||
if (scheduler.checkExists(getJobKey(jobId, jobGroup))) {
|
||||
// 防止创建时存在数据问题 先移除,然后在执行创建操作
|
||||
scheduler.deleteJob(getJobKey(jobId, jobGroup));
|
||||
}
|
||||
|
||||
// 判断任务是否过期
|
||||
if (StringUtils.isNotNull(CronUtils.getNextExecution(job.getCronExpression()))) {
|
||||
// 执行调度任务
|
||||
scheduler.scheduleJob(jobDetail, trigger);
|
||||
}
|
||||
|
||||
// 暂停任务
|
||||
if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) {
|
||||
scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置定时任务策略
|
||||
*/
|
||||
public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb)
|
||||
throws TaskException {
|
||||
switch (job.getMisfirePolicy()) {
|
||||
case ScheduleConstants.MISFIRE_DEFAULT:
|
||||
return cb;
|
||||
case ScheduleConstants.MISFIRE_IGNORE_MISFIRES:
|
||||
return cb.withMisfireHandlingInstructionIgnoreMisfires();
|
||||
case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED:
|
||||
return cb.withMisfireHandlingInstructionFireAndProceed();
|
||||
case ScheduleConstants.MISFIRE_DO_NOTHING:
|
||||
return cb.withMisfireHandlingInstructionDoNothing();
|
||||
default:
|
||||
throw new TaskException(
|
||||
"The task misfire policy '" + job.getMisfirePolicy() + "' cannot be used in cron schedule tasks",
|
||||
Code.CONFIG_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查包名是否为白名单配置
|
||||
*
|
||||
* @param invokeTarget 目标字符串
|
||||
* @return 结果
|
||||
*/
|
||||
public static boolean whiteList(String invokeTarget) {
|
||||
String packageName = StringUtils.substringBefore(invokeTarget, "(");
|
||||
int count = StringUtils.countMatches(packageName, ".");
|
||||
if (count > 1) {
|
||||
return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR);
|
||||
}
|
||||
Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]);
|
||||
String beanPackageName = obj.getClass().getPackage().getName();
|
||||
return StringUtils.containsAnyIgnoreCase(beanPackageName, Constants.JOB_WHITELIST_STR)
|
||||
&& !StringUtils.containsAnyIgnoreCase(beanPackageName, Constants.JOB_ERROR_STR);
|
||||
}
|
||||
}
|
@@ -38,7 +38,6 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>42.3.1</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
@@ -37,6 +37,16 @@ public interface SysDictDataMapper {
|
||||
*/
|
||||
public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
|
||||
public SysDictData selectDictInfo(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
|
||||
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
*
|
||||
|
@@ -1,21 +1,25 @@
|
||||
package com.core.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.core.common.core.domain.model.LoginUserExtend;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.core.common.core.domain.entity.SysUser;
|
||||
import com.core.common.core.domain.model.LoginUserExtend;
|
||||
|
||||
/**
|
||||
* 用户表 数据层
|
||||
*
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public interface SysUserMapper {
|
||||
@Mapper
|
||||
public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@@ -23,7 +27,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 根据条件分页查询已配用户角色列表
|
||||
*
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@@ -31,7 +35,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 根据条件分页查询未分配用户角色列表
|
||||
*
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@@ -39,7 +43,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
*
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@@ -47,7 +51,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@@ -55,7 +59,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 新增用户信息
|
||||
*
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -63,7 +67,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -71,7 +75,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 修改用户头像
|
||||
*
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
@@ -80,7 +84,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param password 密码
|
||||
* @return 结果
|
||||
@@ -89,7 +93,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 通过用户ID删除用户
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -97,7 +101,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 批量删除用户信息
|
||||
*
|
||||
*
|
||||
* @param userIds 需要删除的用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -105,7 +109,7 @@ public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 校验用户名称是否唯一
|
||||
*
|
||||
*
|
||||
* @param userName 用户名称
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -134,4 +138,21 @@ public interface SysUserMapper {
|
||||
* @return 扩展属性
|
||||
*/
|
||||
LoginUserExtend getLoginUserExtend(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 通过科室id获取医院id
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 医院id
|
||||
*/
|
||||
Long getHospitalIdByOrgId(@Param("orgId") Long orgId);
|
||||
|
||||
/**
|
||||
* 查询 option集合
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return option集合
|
||||
*/
|
||||
List<Map<String, String>> getOptionList(@Param("tenantId") Integer tenantId);
|
||||
|
||||
}
|
||||
|
@@ -27,6 +27,15 @@ public interface ISysDictDataService {
|
||||
*/
|
||||
public String selectDictLabel(String dictType, String dictValue);
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public SysDictData selectDictInfo(String dictType, String dictValue);
|
||||
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
*
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package com.core.system.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.core.common.core.domain.entity.SysUser;
|
||||
import com.core.common.core.domain.model.LoginUserExtend;
|
||||
@@ -212,4 +214,20 @@ public interface ISysUserService {
|
||||
* @return 扩展属性
|
||||
*/
|
||||
LoginUserExtend getLoginUserExtend(Long userId);
|
||||
|
||||
/**
|
||||
* 通过科室id获取医院id
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 医院id
|
||||
*/
|
||||
Long getHospitalIdByOrgId(Long orgId);
|
||||
|
||||
/**
|
||||
* 查询 option集合
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return option集合
|
||||
*/
|
||||
List<Map<String,String>> getOptionList(Integer tenantId);
|
||||
}
|
||||
|
@@ -42,6 +42,17 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
public String selectDictLabel(String dictType, String dictValue) {
|
||||
return dictDataMapper.selectDictLabel(dictType, dictValue);
|
||||
}
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
@Override
|
||||
public SysDictData selectDictInfo(String dictType, String dictValue) {
|
||||
return dictDataMapper.selectDictInfo(dictType, dictValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
|
@@ -1,7 +1,9 @@
|
||||
package com.core.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.validation.Validator;
|
||||
@@ -497,4 +499,26 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
return userMapper.getLoginUserExtend(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过科室id获取医院id
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 医院id
|
||||
*/
|
||||
@Override
|
||||
public Long getHospitalIdByOrgId(Long orgId){
|
||||
return userMapper.getHospitalIdByOrgId(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 option集合
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return option集合
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String,String>> getOptionList(Integer tenantId){
|
||||
return userMapper.getOptionList(tenantId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -64,6 +64,12 @@
|
||||
and dict_value = #{dictValue}
|
||||
</select>
|
||||
|
||||
<select id="selectDictInfo" parameterType="String" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_type = #{dictType}
|
||||
and dict_value = #{dictValue}
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
|
@@ -267,10 +267,40 @@
|
||||
|
||||
<select id="getLoginUserExtend" resultType="com.core.common.core.domain.model.LoginUserExtend">
|
||||
SELECT T1.ID AS practitioner_id,
|
||||
T1.org_id AS org_id
|
||||
T1.org_id AS org_id,
|
||||
T2.NAME AS org_name
|
||||
FROM adm_practitioner AS T1
|
||||
LEFT JOIN adm_organization AS T2 ON T2.ID = T1.org_id
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.user_id = #{userId} LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getHospitalIdByOrgId" resultType="long">
|
||||
SELECT CASE
|
||||
WHEN
|
||||
ao.type_enum = 1 THEN
|
||||
ao.ID
|
||||
ELSE (SELECT parent.ID
|
||||
FROM adm_organization AS parent
|
||||
WHERE parent.bus_no = SUBSTRING(ao.bus_no FROM '^[^.]+') LIMIT 1 )
|
||||
END
|
||||
AS result_id
|
||||
FROM
|
||||
adm_organization AS ao
|
||||
WHERE
|
||||
ao.ID =
|
||||
#{orgId}
|
||||
</select>
|
||||
|
||||
<select id="getOptionList" resultType="map">
|
||||
SELECT
|
||||
option_key AS optionkey,
|
||||
option_value AS optionvalue
|
||||
FROM
|
||||
sys_option
|
||||
WHERE
|
||||
delete_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -16,6 +16,12 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring 配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- 领域-->
|
||||
<dependency>
|
||||
@@ -30,11 +36,23 @@
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>2.12.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- junit-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.43</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -68,8 +86,8 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@@ -3,9 +3,12 @@ package com.openhis;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import com.openhis.web.ybmanage.config.YbServiceConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
@@ -15,6 +18,7 @@ import org.springframework.core.env.Environment;
|
||||
* @author system
|
||||
*/
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"})
|
||||
@EnableConfigurationProperties(YbServiceConfig.class)
|
||||
public class OpenHisApplication {
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
|
@@ -1,8 +1,10 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.LocationQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.LocationAddOrEditDto;
|
||||
import com.openhis.web.basedatamanage.dto.LocationPageParam;
|
||||
|
||||
/**
|
||||
* Location 应该服务类
|
||||
@@ -26,20 +28,47 @@ public interface ILocationAppService {
|
||||
*/
|
||||
R<?> getLocationById(Long locationId);
|
||||
|
||||
/**
|
||||
* 添加/编辑位置信息
|
||||
*
|
||||
* @param locationQueryDto 位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditInventoryReceipt(LocationQueryDto locationQueryDto);
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteLocation(Long locationId);
|
||||
R<?> deleteLocation(String busNo);
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
R<?> getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto);
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto);
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> locationInit();
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
/**
|
||||
* Organization 应该服务类
|
||||
@@ -18,7 +18,7 @@ public interface IOrganizationAppService {
|
||||
* @param request 请求数据
|
||||
* @return 机构树分页列表
|
||||
*/
|
||||
Page<OrganizationQueryDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
@@ -31,10 +31,10 @@ public interface IOrganizationAppService {
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationQueryDto 机构信息
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditOrganization(OrganizationQueryDto organizationQueryDto);
|
||||
R<?> addOrEditOrganization(OrganizationDto organizationDto);
|
||||
|
||||
/**
|
||||
* 机构信息
|
||||
|
@@ -10,6 +10,7 @@ import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
* Organization 应该服务类
|
||||
*/
|
||||
public interface IOrganizationLocationAppService {
|
||||
|
||||
/**
|
||||
* 查询机构位置
|
||||
*
|
||||
@@ -18,16 +19,7 @@ public interface IOrganizationLocationAppService {
|
||||
* @param request 请求数据
|
||||
* @return 机构位置分页列表
|
||||
*/
|
||||
R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 机构位置信息详情
|
||||
*
|
||||
* @param orgLocId 机构位置信息id
|
||||
* @return 机构位置信息详情
|
||||
*/
|
||||
R<?> getOrgLocById(Long orgLocId);
|
||||
R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 添加/编辑机构位置信息
|
||||
@@ -45,4 +37,18 @@ public interface IOrganizationLocationAppService {
|
||||
*/
|
||||
R<?> deleteOrgLoc(Long orgLocId);
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> organizationLocationInit();
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
R<?> getLocationListByForm(Integer locationForm);
|
||||
}
|
||||
|
@@ -2,8 +2,11 @@ package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参与者 应该服务类
|
||||
*/
|
||||
@@ -45,4 +48,19 @@ public interface IPractitionerAppService {
|
||||
*/
|
||||
R<?> delUserPractitioner(Long userId);
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
List<SelectableOrgDto> getSelectableOrgList();
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> switchOrg(Long orgId);
|
||||
|
||||
}
|
||||
|
@@ -4,32 +4,206 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.mapper.LocationMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.LocationBedStatus;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
import com.openhis.common.enums.LocationMode;
|
||||
import com.openhis.common.enums.LocationStatus;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.LocationQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.*;
|
||||
|
||||
@Service
|
||||
public class LocationAppServiceImpl implements ILocationAppService {
|
||||
|
||||
@Resource
|
||||
ILocationService locationService;
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private LocationMapper locationMapper;
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> locationInit() {
|
||||
LocationInitDto initDto = new LocationInitDto();
|
||||
// 位置状态
|
||||
List<LocationInitDto.locationStatusOption> locationStatusOptions = new ArrayList<>();
|
||||
locationStatusOptions.add(new LocationInitDto.locationStatusOption(LocationStatus.ACTIVE.getValue(),
|
||||
LocationStatus.ACTIVE.getInfo()));
|
||||
locationStatusOptions.add(new LocationInitDto.locationStatusOption(LocationStatus.INACTIVE.getValue(),
|
||||
LocationStatus.INACTIVE.getInfo()));
|
||||
initDto.setLocationStatusOptions(locationStatusOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置信息详情
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 位置信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationById(Long locationId) {
|
||||
LocationInfoDto locationInfoDto = new LocationInfoDto();
|
||||
BeanUtils.copyProperties(locationService.getById(locationId), locationInfoDto);
|
||||
// 位置类型
|
||||
locationInfoDto
|
||||
.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, locationInfoDto.getFormEnum()));
|
||||
// 使用状态
|
||||
locationInfoDto.setOperationalEnum_enumText(
|
||||
EnumUtils.getInfoByValue(LocationOperational.class, locationInfoDto.getOperationalEnum()));
|
||||
// 启用停用
|
||||
locationInfoDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, locationInfoDto.getStatusEnum()));
|
||||
return R.ok(locationInfoDto,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteLocation(String busNo) {
|
||||
// 删除位置信息(连同子集)
|
||||
boolean result =
|
||||
locationService.remove(new LambdaQueryWrapper<Location>().likeRight(Location::getBusNo, busNo));
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"位置信息删除"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"位置信息删除"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
//数据初始化,不使用eq条件拼接
|
||||
List<Integer> formList = locationPageParam.getLocationFormList();
|
||||
locationPageParam.setLocationFormList(null);
|
||||
String busNo = locationPageParam.getBusNo();
|
||||
locationPageParam.setBusNo(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<Location> queryWrapper = HisQueryUtils.buildQueryWrapper(locationPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
request);
|
||||
// 根据不同的位置类型查询不同的位置分页信息(前端必传默认值)
|
||||
if (formList != null && !formList.isEmpty()) {
|
||||
queryWrapper.lambda().in(Location::getFormEnum, formList);
|
||||
}
|
||||
// 根据父节点编码查询子项
|
||||
queryWrapper.lambda().likeRight(StringUtils.isNotNull(busNo), Location::getBusNo, busNo);
|
||||
if (locationPageParam.getFormEnum() != null) {
|
||||
queryWrapper.lambda().eq(Location::getFormEnum, locationPageParam.getFormEnum());
|
||||
}
|
||||
|
||||
// 查询位置分页列表
|
||||
Page<LocationInfoDto> locationPage =
|
||||
HisPageUtils.selectPage(locationMapper, queryWrapper, pageNo, pageSize, LocationInfoDto.class);
|
||||
locationPage.getRecords().forEach(e -> {
|
||||
// 位置类型
|
||||
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
||||
// 使用状态
|
||||
e.setOperationalEnum_enumText(EnumUtils.getInfoByValue(LocationOperational.class, e.getOperationalEnum()));
|
||||
// 启用停用
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return R.ok(locationPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum()));
|
||||
// 拼音码
|
||||
location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 五笔码
|
||||
location.setWbStr(ChineseConvertUtils.toWBFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.LOCATION_BUS_NO.getPrefix(), 3);
|
||||
// 如果传了上级 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(location.getBusNo())) {
|
||||
location.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, location.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
location.setBusNo(code);
|
||||
}
|
||||
boolean result = locationService.addLocation(location);
|
||||
if (result) {
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"库房"}));
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
// 拼音码
|
||||
location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 五笔码
|
||||
location.setWbStr(ChineseConvertUtils.toWBFirstLetter(locationAddOrEditDto.getName()));
|
||||
boolean result = locationService.updateLocation(location);
|
||||
if (result) {
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"库房"}));
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表-树型
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationTree(Integer formKey, Integer pageNo, Integer pageSize) {
|
||||
|
||||
@@ -42,8 +216,8 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
Page<Location> page = locationService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
List<Location> locationList = page.getRecords();
|
||||
// 将位置列表转为树结构
|
||||
List<LocationQueryDto> locationTree = buildTree(locationList);
|
||||
Page<LocationQueryDto> locationQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
List<LocationDto> locationTree = buildTree(locationList);
|
||||
Page<LocationDto> locationQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
locationQueryDtoPage.setRecords(locationTree);
|
||||
|
||||
locationQueryDtoPage.getRecords().forEach(e -> {
|
||||
@@ -67,18 +241,18 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
* @param records 位置列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<LocationQueryDto> buildTree(List<Location> records) {
|
||||
private List<LocationDto> buildTree(List<Location> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Location> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, LocationQueryDto> nodeMap = new HashMap<>();
|
||||
List<LocationQueryDto> tree = new ArrayList<>();
|
||||
Map<String, LocationDto> nodeMap = new HashMap<>();
|
||||
List<LocationDto> tree = new ArrayList<>();
|
||||
|
||||
for (Location record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
LocationQueryDto node = new LocationQueryDto();
|
||||
LocationDto node = new LocationDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
@@ -89,7 +263,7 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
LocationQueryDto parent = nodeMap.get(parentBNo);
|
||||
LocationDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
@@ -102,65 +276,4 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置信息详情
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 位置信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationById(Long locationId) {
|
||||
Location location = locationService.getById(locationId);
|
||||
return R.ok(location, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑位置信息
|
||||
*
|
||||
* @param locationQueryDto 位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditInventoryReceipt(LocationQueryDto locationQueryDto) {
|
||||
|
||||
// 初始化位置信息
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationQueryDto, location);
|
||||
|
||||
if (locationQueryDto.getId() != null) {
|
||||
// 更新位置信息
|
||||
locationService.updateById(location);
|
||||
} else {
|
||||
// 插入位置信息
|
||||
location
|
||||
// 状态编码:有效
|
||||
.setStatusEnum(LocationStatus.ACTIVE.getValue())
|
||||
// 操作状态:空闲
|
||||
.setOperationalEnum(LocationBedStatus.U.getValue())
|
||||
// 模式编码:具体
|
||||
.setModeEnum(LocationMode.INSTANCE.getValue())
|
||||
// 模式编码:库房
|
||||
.setFormEnum(LocationForm.CABINET.getValue());
|
||||
locationService.save(location);
|
||||
}
|
||||
// 返回位置信息id
|
||||
return R.ok(location.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息添加编辑"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteLocation(Long locationId) {
|
||||
// 删除位置信息
|
||||
boolean result = locationService.removeById(locationId);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"位置信息删除"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"位置信息删除"}));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -6,34 +6,43 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
@Service
|
||||
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
@Resource
|
||||
IOrganizationService organizationService;
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Override
|
||||
public Page<OrganizationQueryDto> getOrganizationTree(Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 查询机构列表
|
||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
||||
List<Organization> organizationList = page.getRecords();
|
||||
// 将机构列表转为树结构
|
||||
List<OrganizationQueryDto> orgTree = buildTree(organizationList);
|
||||
Page<OrganizationQueryDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
List<OrganizationDto> orgTree = buildTree(organizationList);
|
||||
Page<OrganizationDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
@@ -44,19 +53,22 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<OrganizationQueryDto> buildTree(List<Organization> records) {
|
||||
private List<OrganizationDto> buildTree(List<Organization> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Organization> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, OrganizationQueryDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationQueryDto> tree = new ArrayList<>();
|
||||
Map<String, OrganizationDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationDto> tree = new ArrayList<>();
|
||||
|
||||
for (Organization record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
OrganizationQueryDto node = new OrganizationQueryDto();
|
||||
OrganizationDto node = new OrganizationDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
node.setTypeEnum_dictText(EnumUtils.getInfoByValue(OrganizationType.class, node.getTypeEnum()));
|
||||
node.setClassEnum_dictText(EnumUtils.getInfoByValue(OrganizationClass.class, node.getClassEnum()));
|
||||
node.setActiveFlag_dictText(EnumUtils.getInfoByValue(AccountStatus.class, node.getActiveFlag()));
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
@@ -66,7 +78,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
OrganizationQueryDto parent = nodeMap.get(parentBNo);
|
||||
OrganizationDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
@@ -94,27 +106,37 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
/**
|
||||
* 添加/编辑机构
|
||||
*
|
||||
* @param organizationQueryDto 机构信息
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditOrganization(OrganizationQueryDto organizationQueryDto) {
|
||||
public R<?> addOrEditOrganization(OrganizationDto organizationDto) {
|
||||
|
||||
// 新增organization信息
|
||||
Organization organization = new Organization();
|
||||
BeanUtils.copyProperties(organizationQueryDto, organization);
|
||||
BeanUtils.copyProperties(organizationDto, organization);
|
||||
|
||||
if (organizationQueryDto.getId() != null) {
|
||||
if (organizationDto.getId() != null) {
|
||||
// 更新机构信息
|
||||
organizationService.updateById(organization);
|
||||
} else {
|
||||
// 活动标识:有效
|
||||
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ORGANIZATION_BUS_NO.getPrefix(), 3);
|
||||
// 如果传了上级科室 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(organization.getBusNo())) {
|
||||
organization.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, organization.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
organization.setBusNo(code);
|
||||
}
|
||||
// 生成待发送的机构信息
|
||||
organizationService.save(organization);
|
||||
}
|
||||
// 返回机构id
|
||||
return R.ok(organization.getId(), MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息更新添加"}));
|
||||
return R.ok(organization.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +155,8 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
// 删除机构信息
|
||||
boolean deleteOrgSuccess = organizationService.removeByIds(orgIdList);
|
||||
return deleteOrgSuccess ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"机构信息"}))
|
||||
return deleteOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"机构信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -13,50 +14,104 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.domain.OrganizationLocation;
|
||||
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationLocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationLocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocInitDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
@Service
|
||||
public class OrganizationLocationAppServiceImpl implements IOrganizationLocationAppService {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
|
||||
@Autowired
|
||||
private OrganizationLocationMapper organizationLocationMapper;
|
||||
|
||||
@Autowired
|
||||
private IOrganizationLocationService organizationLocationService;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
public R<?> organizationLocationInit() {
|
||||
OrgLocInitDto initDto = new OrgLocInitDto();
|
||||
// 位置类型
|
||||
List<OrgLocInitDto.locationFormOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions
|
||||
.add(new OrgLocInitDto.locationFormOption(LocationForm.CABINET.getValue(), LocationForm.CABINET.getInfo()));
|
||||
chargeItemStatusOptions.add(
|
||||
new OrgLocInitDto.locationFormOption(LocationForm.PHARMACY.getValue(), LocationForm.PHARMACY.getInfo()));
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<OrganizationLocation> queryWrapper = HisQueryUtils.buildQueryWrapper(orgLocQueryParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), request);
|
||||
|
||||
// 查询机构位置分页列表
|
||||
Page<OrgLocQueryDto> orgLocQueryDtoPage =
|
||||
HisPageUtils.selectPage(organizationLocationMapper, queryWrapper, pageNo, pageSize, OrgLocQueryDto.class);
|
||||
|
||||
return R.ok(orgLocQueryDtoPage);
|
||||
// 获取科室下拉选列表
|
||||
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
||||
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置信息详情
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param orgLocId 机构位置信息id
|
||||
* @return 机构位置信息详情
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgLocById(Long orgLocId) {
|
||||
OrganizationLocation orgLoc = organizationLocationService.getById(orgLocId);
|
||||
return R.ok(orgLoc, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构位置信息查询"}));
|
||||
public R<?> getLocationListByForm(Integer locationForm) {
|
||||
|
||||
OrgLocInitDto orgLocInitDto = new OrgLocInitDto();
|
||||
List<Location> locationList = new ArrayList<>();
|
||||
if (LocationForm.CABINET.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getCabinetList();
|
||||
} else if (LocationForm.PHARMACY.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getPharmacyList();
|
||||
}
|
||||
List<OrgLocInitDto.locationOption> locationOptions = locationList.stream()
|
||||
.map(location -> new OrgLocInitDto.locationOption(location.getId(), location.getName()))
|
||||
.collect(Collectors.toList());
|
||||
orgLocInitDto.setLocationOptions(locationOptions);
|
||||
return R.ok(orgLocInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置关系分页列表
|
||||
*
|
||||
* @param orgLocQueryParam 查询字段
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<OrganizationLocation> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(orgLocQueryParam, null, null, request);
|
||||
// 查询机构位置分页列表
|
||||
Page<OrgLocQueryDto> orgLocQueryDtoPage =
|
||||
HisPageUtils.selectPage(organizationLocationMapper, queryWrapper, pageNo, pageSize, OrgLocQueryDto.class);
|
||||
return R.ok(orgLocQueryDtoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,6 +17,7 @@ import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.system.service.ISysTenantService;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
@@ -32,6 +33,7 @@ import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerOrgAndLocationDto;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRolesDto;
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
import com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper;
|
||||
|
||||
@@ -53,6 +55,9 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
@Resource
|
||||
IPractitionerRoleService iPractitionerRoleService;
|
||||
|
||||
@Resource
|
||||
ISysTenantService sysTenantService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
@@ -64,6 +69,7 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
String userName = userAndPractitionerDto.getUserName();
|
||||
String nickName = userAndPractitionerDto.getNickName();
|
||||
String phonenumber = userAndPractitionerDto.getPhonenumber();
|
||||
String pharPracCertNo = userAndPractitionerDto.getPharPracCertNo(); // 职业证件编号
|
||||
String sex = userAndPractitionerDto.getSex();
|
||||
// 账号唯一性
|
||||
long count = iBizUserService.count(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName));
|
||||
@@ -83,6 +89,10 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
iBizUserService.save(bizUser);
|
||||
Long userId =
|
||||
iBizUserService.getOne(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName)).getUserId(); // 用户id
|
||||
|
||||
// 初始化租户绑定
|
||||
sysTenantService.initTenantBind(userId);
|
||||
|
||||
// 新增 sys_user_role
|
||||
List<PractitionerRolesDto> practitionerRoleDtoList = userAndPractitionerDto.getPractitionerRolesDtoList();
|
||||
BizUserRole bizUserRole;
|
||||
@@ -108,6 +118,7 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
practitioner.setOrgId(responsibilityOrgDtoList.get(0).getOrgId()); // 机构id
|
||||
practitioner.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(nickName)); // 拼音码
|
||||
practitioner.setWbStr(ChineseConvertUtils.toWBFirstLetter(nickName)); // 五笔码
|
||||
practitioner.setPharPracCertNo(pharPracCertNo); // 职业证件编号
|
||||
iPractitionerService.save(practitioner);
|
||||
Long practitionerId = practitioner.getId();// 参与者id
|
||||
// 新增 adm_practitioner_role
|
||||
@@ -138,7 +149,38 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.LOCATION_ADMIN.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageLocationDto.getLocationId()); // 位置id
|
||||
practitionerRole.setOrgId(manageLocationDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 4.管理药房
|
||||
List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList =
|
||||
userAndPractitionerDto.getManageMedicationLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto practitionerOrgAndLocationDto : manageMedicationLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.PHARMACIST.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(practitionerOrgAndLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理科室集合
|
||||
List<PractitionerOrgAndLocationDto> manageOrgDtoList = userAndPractitionerDto.getManageOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageOrgDto : manageOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode());// 角色code
|
||||
practitionerRole.setOrgId(manageOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理病区集合
|
||||
List<PractitionerOrgAndLocationDto> manageWardLocationDtoList =
|
||||
userAndPractitionerDto.getManageWardLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageWardLocationDto : manageWardLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageWardLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
@@ -195,6 +237,26 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
&& PractitionerRoles.LOCATION_ADMIN.getCode().equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setManageLocationDtoList(list4);
|
||||
// 匹配管理药房
|
||||
List<
|
||||
PractitionerOrgAndLocationDto> list5 =
|
||||
orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.PHARMACIST.getCode().equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setManageMedicationLocationDtoList(list5);
|
||||
// 匹配护士-管理科室
|
||||
List<PractitionerOrgAndLocationDto> list6 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.NURSE.getCode().equals(e.getRoleCode()) && e.getOrgId() != null)
|
||||
.collect(Collectors.toList());
|
||||
record.setManageOrgDtoList(list6);
|
||||
// 匹配护士-管理病区
|
||||
List<PractitionerOrgAndLocationDto> list7 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.NURSE.getCode().equals(e.getRoleCode()) && e.getLocationId() != null)
|
||||
.collect(Collectors.toList());
|
||||
record.setManageWardLocationDtoList(list7);
|
||||
}
|
||||
return userPractitionerPage;
|
||||
}
|
||||
@@ -213,6 +275,7 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
String nickName = userAndPractitionerDto.getNickName();
|
||||
String phonenumber = userAndPractitionerDto.getPhonenumber();
|
||||
String sex = userAndPractitionerDto.getSex();
|
||||
String pharPracCertNo = userAndPractitionerDto.getPharPracCertNo(); // 职业证件编号
|
||||
// 编辑 sys_user
|
||||
BizUser bizUser = new BizUser();
|
||||
bizUser.setNickName(nickName); // 昵称
|
||||
@@ -248,6 +311,7 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
practitioner.setOrgId(responsibilityOrgDtoList.get(0).getOrgId()); // 机构id
|
||||
practitioner.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(nickName)); // 拼音码
|
||||
practitioner.setWbStr(ChineseConvertUtils.toWBFirstLetter(nickName)); // 五笔码
|
||||
practitioner.setPharPracCertNo(pharPracCertNo);// 职业证件编号
|
||||
iPractitionerService.updateById(practitioner);
|
||||
// 先删除,再新增 adm_practitioner_role
|
||||
practitionerAppAppMapper.delPractitionerRole(practitionerId);
|
||||
@@ -278,7 +342,38 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.LOCATION_ADMIN.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageLocationDto.getLocationId()); // 位置id
|
||||
practitionerRole.setOrgId(manageLocationDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 4.管理药房
|
||||
List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList =
|
||||
userAndPractitionerDto.getManageMedicationLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto practitionerOrgAndLocationDto : manageMedicationLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.PHARMACIST.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(practitionerOrgAndLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理科室集合
|
||||
List<PractitionerOrgAndLocationDto> manageOrgDtoList = userAndPractitionerDto.getManageOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageOrgDto : manageOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode());// 角色code
|
||||
practitionerRole.setOrgId(manageOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理病区集合
|
||||
List<PractitionerOrgAndLocationDto> manageWardLocationDtoList =
|
||||
userAndPractitionerDto.getManageWardLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageWardLocationDto : manageWardLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageWardLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
@@ -308,4 +403,33 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
@Override
|
||||
public List<SelectableOrgDto> getSelectableOrgList() {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
return practitionerAppAppMapper.getSelectableOrgList(practitionerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> switchOrg(Long orgId) {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setId(practitionerId);
|
||||
practitioner.setOrgId(orgId);
|
||||
iPractitionerService.updateById(practitioner);
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"切换科室"}));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.LocationQueryDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 位置管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/cabinet-location")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CabinetLocationController {
|
||||
|
||||
private final ILocationAppService iLocationAppService;
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@GetMapping(value = "/cabinet-location")
|
||||
public R<?> getLocationPage(@RequestParam(required = false, value = "formKey", defaultValue = "") Integer formKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return iLocationAppService.getLocationTree(formKey, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库房位置需要编辑的信息
|
||||
*
|
||||
* @param locationId 库房位置信息Id
|
||||
*/
|
||||
@GetMapping("/cabinet-location-getById")
|
||||
public R<?> getLocationById(@Validated @RequestParam Long locationId) {
|
||||
return iLocationAppService.getLocationById(locationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑库房位置信息
|
||||
*
|
||||
* @param locationQueryDto 库房位置信息
|
||||
*/
|
||||
@PutMapping("/cabinet-location")
|
||||
public R<?> addOrEditLocation(@Validated @RequestBody LocationQueryDto locationQueryDto) {
|
||||
return iLocationAppService.addOrEditInventoryReceipt(locationQueryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库房位置信息
|
||||
*
|
||||
* @param locationId 库房位置信息Id
|
||||
*/
|
||||
@DeleteMapping("/cabinet-location")
|
||||
public R<?> deleteLocation(@RequestParam Long locationId) {
|
||||
return iLocationAppService.deleteLocation(locationId);
|
||||
}
|
||||
|
||||
}
|
@@ -3,9 +3,6 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -15,10 +12,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationInitDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,13 +35,7 @@ public class OrganizationController {
|
||||
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
|
||||
List<OrganizationInitDto> initDto = new ArrayList<>();
|
||||
|
||||
for (OrganizationType type : OrganizationType.values()) {
|
||||
initDto.add(new OrganizationInitDto(type.getValue(), type.getCode()));
|
||||
}
|
||||
return R.ok(initDto);
|
||||
return R.ok(new OrganizationInitDto());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,9 +47,8 @@ public class OrganizationController {
|
||||
*/
|
||||
@GetMapping(value = "/organization")
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
Page<OrganizationQueryDto> organizationTree =
|
||||
iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
||||
Page<OrganizationDto> organizationTree = iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
||||
return R.ok(organizationTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
||||
}
|
||||
@@ -78,12 +67,12 @@ public class OrganizationController {
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationQueryDto 机构信息
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/organization")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody OrganizationQueryDto organizationQueryDto) {
|
||||
return iOrganizationAppService.addOrEditOrganization(organizationQueryDto);
|
||||
@PostMapping("/organization")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody OrganizationDto organizationDto) {
|
||||
return iOrganizationAppService.addOrEditOrganization(organizationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -9,13 +9,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationLocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocInitDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
@@ -35,34 +30,22 @@ import lombok.extern.slf4j.Slf4j;
|
||||
public class OrganizationLocationController {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
|
||||
@Autowired
|
||||
private IOrganizationLocationAppService iOrganizationLocationAppService;
|
||||
private IOrganizationLocationAppService organizationLocationAppService;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
|
||||
OrgLocInitDto initDto = new OrgLocInitDto();
|
||||
// 设置科室列表
|
||||
initDto.setOrganization(organizationService.list())
|
||||
// 设置药库列表
|
||||
.setLocation(locationService.list(new LambdaQueryWrapper<Location>().in(Location::getFormEnum, 11)));
|
||||
return R.ok(initDto);
|
||||
return organizationLocationAppService.organizationLocationInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置关系分页列表
|
||||
*
|
||||
* @param orgLocQueryParam 查询字段
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
@@ -70,31 +53,30 @@ public class OrganizationLocationController {
|
||||
*/
|
||||
@GetMapping(value = "/org-loc")
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return iOrganizationLocationAppService.getOrgLocPage(orgLocQueryParam, searchKey, pageNo, pageSize, request);
|
||||
|
||||
return organizationLocationAppService.getOrgLocPage(orgLocQueryParam, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构位置关系需要编辑的信息
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param orgLocId 机构位置关系信息
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@GetMapping("/org-loc-getById")
|
||||
public R<?> getOrgLocById(@Validated @RequestParam Long orgLocId) {
|
||||
return iOrganizationLocationAppService.getOrgLocById(orgLocId);
|
||||
@GetMapping(value = "/loc-list")
|
||||
public R<?> getLocationListByForm(@RequestParam Integer locationForm) {
|
||||
return organizationLocationAppService.getLocationListByForm(locationForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑机构位置关系信息
|
||||
* 新增/编辑机构位置关系信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置关系信息
|
||||
*/
|
||||
@PutMapping("/org-loc")
|
||||
@PostMapping("/org-loc")
|
||||
public R<?> addOrEditOrgLoc(@Validated @RequestBody OrgLocQueryDto orgLocQueryDto) {
|
||||
return iOrganizationLocationAppService.addOrEditOrgLoc(orgLocQueryDto);
|
||||
return organizationLocationAppService.addOrEditOrgLoc(orgLocQueryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +86,7 @@ public class OrganizationLocationController {
|
||||
*/
|
||||
@DeleteMapping("/org-loc")
|
||||
public R<?> delOrgLoc(@RequestParam Long orgLocId) {
|
||||
return iOrganizationLocationAppService.deleteOrgLoc(orgLocId);
|
||||
return organizationLocationAppService.deleteOrgLoc(orgLocId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -90,4 +90,24 @@ public class PractitionerController {
|
||||
return practitionerAppService.delUserPractitioner(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
@GetMapping(value = "/get-selectable-org-list")
|
||||
public R<?> getSelectableOrgList() {
|
||||
return R.ok(practitionerAppService.getSelectableOrgList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/switch-org")
|
||||
public R<?> switchOrg(@RequestParam Long orgId) {
|
||||
return practitionerAppService.switchOrg(orgId);
|
||||
}
|
||||
}
|
||||
|
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationQueryDto {
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
@NotBlank(message = "位置编码不能为空")
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
@NotBlank(message = "位置名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 状态编码 */
|
||||
@NotNull(message = "状态编码不能为空")
|
||||
// private LocationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 操作状态 */
|
||||
@NotNull(message = "操作状态不能为空")
|
||||
// private LocationBedStatus operationalEnum;
|
||||
private Integer operationalEnum;
|
||||
private String operationalEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
@NotNull(message = "模式编码不能为空")
|
||||
// private LocationMode modeEnum;
|
||||
private Integer modeEnum;
|
||||
private String modeEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 功能编码 */
|
||||
@NotBlank(message = "功能编码不能为空")
|
||||
private String typeJson;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
@NotNull(message = "物理形式枚举不能为空")
|
||||
// private LocationForm formEnum;
|
||||
private Integer formEnum;
|
||||
private String formEnum_enumText;
|
||||
|
||||
/** 机构编码 */
|
||||
@NotNull(message = "机构编码不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 子集合 */
|
||||
private List<LocationQueryDto> children = new ArrayList<>();
|
||||
|
||||
}
|
@@ -3,11 +3,10 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -20,11 +19,58 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocInitDto implements Serializable {
|
||||
public class OrgLocInitDto {
|
||||
|
||||
/** 机构科室信息 */
|
||||
private List<Organization> organization;
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private List<OrgLocInitDto.locationFormOption> locationFormOptions;
|
||||
|
||||
/** 位置药房信息 */
|
||||
private List<Location> location;
|
||||
/** 科室列表 */
|
||||
private List<OrgLocInitDto.departmentOption> departmentOptions;
|
||||
|
||||
/** 科室列表 */
|
||||
private List<OrgLocInitDto.locationOption> locationOptions;
|
||||
|
||||
/** 位置列表 */
|
||||
@Data
|
||||
public static class locationOption {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public locationOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/** 科室列表 */
|
||||
@Data
|
||||
public static class departmentOption {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public departmentOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
@Data
|
||||
public static class locationFormOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public locationFormOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,10 +3,14 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
import java.util.Timer;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -25,11 +29,9 @@ public class OrgLocQueryDto {
|
||||
|
||||
/** 机构编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
|
||||
/** 位置编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/** 默认药房 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@@ -38,11 +40,26 @@ public class OrgLocQueryDto {
|
||||
/** 发放类别 */
|
||||
private String distributionCategoryCode;
|
||||
|
||||
/**
|
||||
* 诊疗定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/**
|
||||
* 诊疗类型
|
||||
*/
|
||||
@Dict(dictCode = "activity_category_code")
|
||||
private String activityCategoryCode;
|
||||
private String activityCategoryCode_dictText;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
//@JsonFormat(pattern = "HH:mm:ss")
|
||||
private Time startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
//@JsonFormat(pattern = "HH:mm:ss")
|
||||
private Time endTime;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
@@ -18,7 +18,17 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocQueryParam implements Serializable {
|
||||
|
||||
/** 活动标识 */
|
||||
private Integer activeFlag;
|
||||
/**
|
||||
* 科室id
|
||||
*/
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 药房id
|
||||
*/
|
||||
private Long defLocationId;
|
||||
|
||||
/** 发放类别 */
|
||||
private String distributionCategoryCode;
|
||||
|
||||
}
|
||||
|
@@ -3,6 +3,11 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -16,11 +21,49 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class OrganizationInitDto {
|
||||
|
||||
private Integer value;
|
||||
private String code;
|
||||
private List<OrganizationTypeOption> organizationTypeOptions;
|
||||
|
||||
public OrganizationInitDto(Integer value, String code) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
private List<OrganizationClassOption> organizationClassOptions;
|
||||
|
||||
@Data
|
||||
public static class OrganizationTypeOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public OrganizationTypeOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class OrganizationClassOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public OrganizationClassOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
public OrganizationInitDto() {
|
||||
List<OrganizationTypeOption> organizationTypeOptionList = List.of(
|
||||
new OrganizationTypeOption(OrganizationType.HOSPITAL.getValue(), OrganizationType.HOSPITAL.getInfo()),
|
||||
new OrganizationTypeOption(OrganizationType.DEPARTMENT.getValue(), OrganizationType.DEPARTMENT.getInfo()));
|
||||
|
||||
List<OrganizationClassOption> organizationClassOptionList = List.of(
|
||||
new OrganizationClassOption(OrganizationClass.CLINIC.getValue(), OrganizationClass.CLINIC.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.INPATIENT.getValue(), OrganizationClass.INPATIENT.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.PHARMACY.getValue(), OrganizationClass.PHARMACY.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.STORAGE.getValue(), OrganizationClass.STORAGE.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.FIN.getValue(), OrganizationClass.FIN.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.NS.getValue(), OrganizationClass.NS.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.MANAGER.getValue(), OrganizationClass.MANAGER.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.SUPPORT.getValue(), OrganizationClass.SUPPORT.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.OTHER.getValue(), OrganizationClass.OTHER.getInfo()));
|
||||
|
||||
this.organizationTypeOptions = organizationTypeOptionList;
|
||||
this.organizationClassOptions = organizationClassOptionList;
|
||||
}
|
||||
}
|
||||
|
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrganizationQueryDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 活动标识 */
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 机构类型枚举 */
|
||||
private OrganizationType typeEnum;
|
||||
|
||||
/** 机构分类枚举 */
|
||||
private OrganizationClass classEnum;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 医保码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 医保名称 */
|
||||
private String ybName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 子集合 */
|
||||
private List<OrganizationQueryDto> children = new ArrayList<>();
|
||||
}
|
@@ -94,6 +94,11 @@ public class UserAndPractitionerDto {
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/**
|
||||
* 职业证件编号
|
||||
*/
|
||||
private String pharPracCertNo;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@@ -122,4 +127,18 @@ public class UserAndPractitionerDto {
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageLocationDtoList;
|
||||
|
||||
/**
|
||||
* 管理药房集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList;
|
||||
|
||||
/**
|
||||
* 护士-管理科室集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageOrgDtoList;
|
||||
|
||||
/**
|
||||
* 护士-管理病区集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageWardLocationDtoList;
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package com.openhis.web.basedatamanage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -60,4 +61,12 @@ public interface PractitionerAppAppMapper {
|
||||
*/
|
||||
void delPractitionerRole(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
List<SelectableOrgDto> getSelectableOrgList(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.yb.service.YbManager;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,6 +22,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
@@ -29,6 +32,7 @@ import com.openhis.administration.service.IHealthcareServiceService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
@@ -52,6 +56,8 @@ public class HealthcareServiceController {
|
||||
|
||||
private final HealthcareServiceBizMapper healthcareServiceBizMapper;
|
||||
|
||||
private final YbManager ybService;
|
||||
|
||||
/**
|
||||
* 服务管理基础数据初始化
|
||||
*/
|
||||
@@ -89,9 +95,21 @@ public class HealthcareServiceController {
|
||||
HealthcareService healthcareServiceAfterAdd = iHealthcareServiceService.addHealthcareService(healthcareService);
|
||||
// 同时保存费用定价
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinitionFormData.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
BeanUtils.copyProperties(chargeItemDefinitionFormData, chargeItemDefinition);
|
||||
boolean res = iChargeItemDefinitionService.addChargeItemDefinitionByHealthcareService(healthcareServiceAfterAdd,
|
||||
chargeItemDefinition);
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
// 医保开关打开并且,页面传了医保编码
|
||||
String ybNo = healthcareServiceFormData.getYbNo();
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(ybNo)) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE,
|
||||
healthcareServiceAfterAdd.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"服务管理"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
@@ -115,7 +133,8 @@ public class HealthcareServiceController {
|
||||
QueryWrapper<HealthcareServiceDto> queryWrapper = HisQueryUtils.buildQueryWrapper(healthcareServiceDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "charge_name")), request);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper.getHealthcareServicePage(
|
||||
new Page<>(pageNo, pageSize), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, queryWrapper);
|
||||
new Page<>(pageNo, pageSize), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, queryWrapper);
|
||||
healthcareServicePage.getRecords().forEach(e -> {
|
||||
// 活动标记-枚举类回显赋值
|
||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
@@ -139,8 +158,9 @@ public class HealthcareServiceController {
|
||||
// 构建查询条件
|
||||
QueryWrapper<HealthcareServiceDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(healthcareServiceDto, null, null, null);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper
|
||||
.getHealthcareServicePage(new Page<>(1, 1), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, queryWrapper);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper.getHealthcareServicePage(
|
||||
new Page<>(1, 1), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, queryWrapper);
|
||||
HealthcareServiceDto healthcareServiceDtoDetail = healthcareServicePage.getRecords().get(0);
|
||||
// 枚举赋值
|
||||
healthcareServiceDtoDetail
|
||||
@@ -164,6 +184,17 @@ public class HealthcareServiceController {
|
||||
healthcareServiceAddOrUpdateParam.getHealthcareServiceFormData();
|
||||
HealthcareService healthcareService = new HealthcareService();
|
||||
BeanUtils.copyProperties(healthcareServiceFormData, healthcareService);
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
// 医保开关打开并且,页面传了医保编码
|
||||
String ybNo = healthcareServiceFormData.getYbNo();
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(ybNo)) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, healthcareService.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
boolean res = iHealthcareServiceService.updateHealthcareService(healthcareService);
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"服务管理"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
@@ -35,7 +35,7 @@ public class ChargeItemDefinitionFormData {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private PublicationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 机构ID
|
||||
|
@@ -1,13 +1,14 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 服务管理 Dto
|
||||
*/
|
||||
@@ -29,7 +30,7 @@ public class HealthcareServiceDto {
|
||||
/**
|
||||
* 提供部门ID
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization",dictCode = "id",dictText = "name")
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long offeredOrgId;
|
||||
private String offeredOrgId_dictText;
|
||||
@@ -58,7 +59,7 @@ public class HealthcareServiceDto {
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
@Dict(dictTable = "adm_location",dictCode = "id",dictText = "name")
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
@@ -105,4 +106,9 @@ public class HealthcareServiceDto {
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 诊疗费
|
||||
*/
|
||||
private BigDecimal activityPrice;
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务项目管理表单数据
|
||||
*
|
||||
@@ -51,7 +51,7 @@ public class HealthcareServiceFormData {
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
@NotBlank(message = "地点不能为空")
|
||||
// @NotBlank(message = "地点不能为空")
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
@@ -82,5 +82,7 @@ public class HealthcareServiceFormData {
|
||||
@NotBlank(message = "预约要求不能为空")
|
||||
private Integer appointmentRequiredFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
}
|