From 13a31edf7f569cdcf15d3c43a476a2c947f47fbf Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 09 十一月 2025 22:33:24 +0800
Subject: [PATCH] feat: 增加hospdata表,同步sqlserver过来
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/HospDataController.java | 85 +
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/HospDataSyncTask.java | 63 +
ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncService.java | 18
ruoyi-ui/src/api/system/hosp.js | 52
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptRegionController.java | 68 +
ruoyi-system/src/main/resources/mapper/system/SysDeptRegionMapper.xml | 99 +
app/components/AttachmentUpload.vue | 9
sql/tb_hosp_data.sql | 40
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDeptRegion.java | 152 ++
ruoyi-system/src/main/resources/mapper/system/TbHospDataMapper.xml | 157 ++
app/pages/task/create-emergency.vue | 129 +-
ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataMapper.java | 28
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptRegionMapper.java | 62 +
ruoyi-ui/src/views/system/hosp/index.vue | 411 ++++++
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbHospDataServiceImpl.java | 105 +
ruoyi-system/src/main/java/com/ruoyi/system/domain/HospDataSyncDTO.java | 185 +++
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java | 5
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java | 6
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncServiceImpl.java | 218 +++
sql/hosp_data_menu.sql | 38
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbHospData.java | 234 +++
app/pages/task/detail.vue | 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbHospDataController.java | 112 +
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SQLHospDataServiceImpl.java | 27
ruoyi-system/src/main/resources/mapper/system/SQLHospDataMapper.xml | 25
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbHospDataMapper.java | 70 +
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncDataServiceImpl.java | 35
ruoyi-system/pom.xml | 5
ruoyi-system/src/test/java/com/ruoyi/system/service/LegacySystemHttpsTest.java | 260 ++++
ruoyi-ui/src/api/system/deptRegion.js | 35
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacySystemSyncServiceImpl.java | 53
ruoyi-ui/src/views/system/dept/index.vue | 190 +++
app/pages/task/index.vue | 17
ruoyi-system/src/main/resources/mapper/system/HospDataSyncMapper.xml | 37
ruoyi-admin/src/main/resources/application.yml | 2
ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncDataService.java | 20
ruoyi-system/src/main/resources/mapper/system/HospDataMapper.xml | 182 +-
sql/sys_dept_region.sql | 64 +
ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataSyncMapper.java | 23
ruoyi-system/src/main/java/com/ruoyi/system/service/ISQLHospDataService.java | 25
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java | 12
ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml | 2
ruoyi-admin/src/main/resources/application-prod.yml | 7
sql/HospData.sql | 17
app/api/hospital.js | 22
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SQLHospDataMapper.java | 24
ruoyi-system/src/main/java/com/ruoyi/system/service/ITbHospDataService.java | 69 +
47 files changed, 3,318 insertions(+), 189 deletions(-)
diff --git a/app/api/hospital.js b/app/api/hospital.js
index 7823405..dc1d7d0 100644
--- a/app/api/hospital.js
+++ b/app/api/hospital.js
@@ -3,15 +3,15 @@
/**
* 鎼滅储鍖婚櫌
* @param {string} keyword 鎼滅储鍏抽敭璇嶏紙鍖婚櫌鍚嶇О銆佸湴鍧�銆佺畝绉般�佺渷甯傚尯锛�
- * @param {string} region 鍦板煙鍏抽敭璇嶏紙鐢ㄤ簬杩囨护鐪佸競鍖猴級
+ * @param {number} deptId 閮ㄩ棬ID锛堢敤浜庢牴鎹儴闂ㄥ尯鍩熼厤缃繃婊ゅ尰闄級
*/
-export function searchHospitals(keyword, region) {
+export function searchHospitals(keyword, deptId) {
return request({
url: '/system/hospital/search',
method: 'get',
params: {
keyword: keyword,
- region: region
+ deptId: deptId
}
})
}
@@ -61,3 +61,19 @@
}
})
}
+
+/**
+ * 鏍规嵁閮ㄩ棬鍖哄煙閰嶇疆鎼滅储鍖婚櫌锛堟敮鎸佸绾у尯鍩燂級
+ * @param {string} keyword 鎼滅储鍏抽敭璇�
+ * @param {number} deptId 閮ㄩ棬ID
+ */
+export function searchHospitalsByDeptRegion(keyword, deptId) {
+ return request({
+ url: '/system/hospital/search/by-dept-region',
+ method: 'get',
+ params: {
+ keyword: keyword,
+ deptId: deptId
+ }
+ })
+}
diff --git a/app/components/AttachmentUpload.vue b/app/components/AttachmentUpload.vue
index 58714cd..ab0bcf5 100644
--- a/app/components/AttachmentUpload.vue
+++ b/app/components/AttachmentUpload.vue
@@ -3,7 +3,7 @@
<view class="detail-section">
<view class="section-title">
{{ title }}
- <button class="upload-btn" @click="showUploadDialog">涓婁紶闄勪欢</button>
+ <button class="upload-btn" @click="showUploadDialog" v-if="!readonly">涓婁紶闄勪欢</button>
</view>
<view v-if="attachmentList && attachmentList.length > 0">
<view class="attachment-item" v-for="(item, index) in attachmentList" :key="item.attachmentId">
@@ -20,7 +20,7 @@
</view>
<view class="attachment-actions">
<button class="action-btn view-btn" @click="viewAttachment(item)">鏌ョ湅</button>
- <button class="action-btn delete-btn" @click="deleteAttachment(item.attachmentId, index)">鍒犻櫎</button>
+ <button class="action-btn delete-btn" @click="deleteAttachment(item.attachmentId, index)" v-if="!readonly">鍒犻櫎</button>
</view>
</view>
</view>
@@ -87,6 +87,11 @@
autoLoad: {
type: Boolean,
default: true
+ },
+ // 鏄惁鍙妯″紡锛堢姝笂浼犲拰鍒犻櫎锛�
+ readonly: {
+ type: Boolean,
+ default: false
}
},
data() {
diff --git a/app/pages/task/create-emergency.vue b/app/pages/task/create-emergency.vue
index 4ad6a63..9621a62 100644
--- a/app/pages/task/create-emergency.vue
+++ b/app/pages/task/create-emergency.vue
@@ -506,7 +506,7 @@
import { addTask } from "@/api/task"
import { listAvailableVehicles, getUserBoundVehicle } from "@/api/vehicle"
import { calculateDistance, baiduDistanceByAddress, baiduPlaceSuggestion } from "@/api/map"
-import { searchHospitals, getFrequentOutHospitals, getFrequentInHospitals } from "@/api/hospital"
+import { searchHospitals, getFrequentOutHospitals, getFrequentInHospitals, searchHospitalsByDeptRegion } from "@/api/hospital"
import { listUser } from "@/api/system/user"
import { searchIcd10 } from "@/api/icd10"
@@ -720,11 +720,14 @@
this.selectedOrganizationServiceOrderClass = selected.serviceOrderClass || '' // 淇濆瓨鏈嶅姟鍗曠紪鐮�
// 浠庡綊灞炴満鏋勪腑鎻愬彇鍦板煙鍏抽敭璇嶏紙鍘婚櫎鈥滃垎鍏徃鈥濆悗缂�锛�
// 渚嬪锛氣�滃箍宸炲垎鍏徃鈥� -> 鈥滃箍宸炩��
- this.selectedRegion = selected.deptName.replace(/鍒嗗叕鍙�$/g, '').trim()
+ //濡傛灉鍑虹幇骞垮窞鎬诲叕鍙革紝涔熻鍘婚櫎鈥滄�诲叕鍙糕�濆悗缂�
+ this.selectedRegion = this.replaceRegion(selected.deptName);
// 閲嶆柊鍔犺浇鍖婚櫌鍒楄〃锛堝甫鍦板煙杩囨护锛�
this.loadDefaultHospitals()
},
-
+ replaceRegion(region){
+ return region.replace(/(鍒嗗叕鍙竱鎬诲叕鍙竱鎬婚儴)$/g, '').trim();
+ },
// 鍔犺浇鍒嗗叕鍙告暟鎹紙parent_id=100鐨勯儴闂級
loadBranchCompanies() {
listBranchCompany().then(response => {
@@ -744,7 +747,7 @@
this.selectedOrganizationId = this.organizationOptions[index].deptId // 淇濆瓨閮ㄩ棬ID
this.selectedOrganizationServiceOrderClass = this.organizationOptions[index].serviceOrderClass || '' // 淇濆瓨鏈嶅姟鍗曠紪鐮�
// 鎻愬彇鍦板煙鍏抽敭璇�
- this.selectedRegion = this.selectedOrganization.replace(/鍒嗗叕鍙�$/g, '').trim()
+ this.selectedRegion =this.replaceRegion(this.selectedOrganization);
console.log('榛樿閫変腑褰掑睘鏈烘瀯:', this.selectedOrganization, '閮ㄩ棬ID:', this.selectedOrganizationId, '鏈嶅姟鍗曠紪鐮�:', this.selectedOrganizationServiceOrderClass, '鍦板煙:', this.selectedRegion)
// 鍔犺浇鍖婚櫌鍒楄〃锛堝甫鍦板煙杩囨护锛�
this.loadDefaultHospitals()
@@ -865,57 +868,17 @@
// 鍔犺浇榛樿鍖婚櫌鍒楄〃锛堝父鐢ㄥ尰闄級
loadDefaultHospitals() {
- // 妫�鏌ユ槸鍚︽湁鏈嶅姟鍗曠紪鐮�
- if (!this.selectedOrganizationServiceOrderClass) {
- console.warn('鏈壘鍒版湇鍔″崟缂栫爜锛屾棤娉曞姞杞藉父鐢ㄥ尰闄�')
- // 濡傛灉娌℃湁鏈嶅姟鍗曠紪鐮侊紝闄嶇骇涓烘櫘閫氭悳绱紙鎸夊湴鍩熻繃婊わ級
- this.loadDefaultHospitalsByRegion()
+ // 妫�鏌ユ槸鍚︽湁褰掑睘鏈烘瀯ID
+ if (!this.selectedOrganizationId) {
+ console.warn('鏈�夋嫨褰掑睘鏈烘瀯锛屾棤娉曞姞杞藉尰闄㈠垪琛�')
return
}
- // 杞嚭鍖婚櫌锛氬姞杞藉綋鍓嶅垎鍏徃鐨勫父鐢ㄨ浆鍑哄尰闄�
- getFrequentOutHospitals(this.selectedOrganizationServiceOrderClass, this.selectedRegion).then(response => {
- this.hospitalOutResults = response.data || []
- console.log('鍔犺浇甯哥敤杞嚭鍖婚櫌锛�', this.selectedOrganizationServiceOrderClass, '鍦板煙:', this.selectedRegion, '鏁伴噺:', this.hospitalOutResults.length)
-
- // 濡傛灉娌℃湁甯哥敤鍖婚櫌锛岄檷绾т负鏅�氭悳绱�
- if (this.hospitalOutResults.length === 0) {
- console.log('鏈壘鍒板父鐢ㄨ浆鍑哄尰闄紝闄嶇骇涓哄湴鍩熸悳绱�')
- searchHospitals('', this.selectedRegion).then(res => {
- this.hospitalOutResults = res.data || []
- })
- }
- }).catch(error => {
- console.error('鍔犺浇甯哥敤杞嚭鍖婚櫌澶辫触:', error)
- // 澶辫触鍚庨檷绾т负鏅�氭悳绱�
- searchHospitals('', this.selectedRegion).then(res => {
- this.hospitalOutResults = res.data || []
- })
- })
+ // 杞嚭鍖婚櫌锛氭牴鎹綊灞炴満鏋勭殑鍖哄煙閰嶇疆鍔犺浇
+ this.loadHospitalsByDeptRegion('out')
- // 杞叆鍖婚櫌锛氬姞杞藉綋鍓嶅垎鍏徃鐨勫父鐢ㄨ浆鍏ュ尰闄紙鏈湴鍖哄煙浼樺厛锛�
- getFrequentInHospitals(this.selectedOrganizationServiceOrderClass, '').then(response => {
- const allHospitals = response.data || []
- // 灏嗗尰闄㈡寜鍦板煙鎺掑簭锛氭湰鍦板尯鍩熶紭鍏�
- this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
- console.log('鍔犺浇甯哥敤杞叆鍖婚櫌锛�', this.selectedOrganizationServiceOrderClass, '鏁伴噺:', this.hospitalInResults.length)
-
- // 濡傛灉娌℃湁甯哥敤鍖婚櫌锛岄檷绾т负鏅�氭悳绱�
- if (this.hospitalInResults.length === 0) {
- console.log('鏈壘鍒板父鐢ㄨ浆鍏ュ尰闄紝闄嶇骇涓哄叏閮ㄥ尰闄�')
- searchHospitals('', '').then(res => {
- const allHospitals = res.data || []
- this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
- })
- }
- }).catch(error => {
- console.error('鍔犺浇甯哥敤杞叆鍖婚櫌澶辫触:', error)
- // 澶辫触鍚庨檷绾т负鏅�氭悳绱�
- searchHospitals('', '').then(res => {
- const allHospitals = res.data || []
- this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
- })
- })
+ // 杞叆鍖婚櫌锛氭牴鎹綊灞炴満鏋勭殑鍖哄煙閰嶇疆鍔犺浇
+ this.loadHospitalsByDeptRegion('in')
},
// 闄嶇骇鍔犺浇鍖婚櫌锛堟寜鍦板煙杩囨护锛�
@@ -938,6 +901,33 @@
}).catch(error => {
console.error('鍔犺浇杞叆鍖婚櫌鍒楄〃澶辫触:', error)
this.hospitalInResults = []
+ })
+ },
+
+ // 鏍规嵁閮ㄩ棬鍖哄煙閰嶇疆鍔犺浇鍖婚櫌
+ loadHospitalsByDeptRegion(type) {
+ const deptId = this.selectedOrganizationId
+ if (!deptId) {
+ console.warn('閮ㄩ棬ID涓嶅瓨鍦�')
+ return
+ }
+
+ // 璋冪敤鍚庣鎺ュ彛锛屾牴鎹儴闂ㄧ殑鍖哄煙閰嶇疆鏌ヨ鍖婚櫌
+ searchHospitalsByDeptRegion('', deptId).then(response => {
+ const hospitals = response.data || []
+
+ if (type === 'out') {
+ this.hospitalOutResults = hospitals
+ console.log('鍔犺浇杞嚭鍖婚櫌锛堝尯鍩熼厤缃級锛氶儴闂�', deptId, '鏁伴噺:', this.hospitalOutResults.length)
+ } else if (type === 'in') {
+ // 杞叆鍖婚櫌鎸夊湴鍩熸帓搴�
+ this.hospitalInResults = this.sortHospitalsByRegion(hospitals)
+ console.log('鍔犺浇杞叆鍖婚櫌锛堝尯鍩熼厤缃級锛氶儴闂�', deptId, '鏁伴噺:', this.hospitalInResults.length)
+ }
+ }).catch(error => {
+ console.error('鍔犺浇鍖婚櫌澶辫触锛堝尯鍩熼厤缃級:', error)
+ // 澶辫触鍚庨檷绾т负鏅�氭悳绱�
+ this.loadDefaultHospitalsByRegion()
})
},
@@ -995,21 +985,21 @@
this.hospitalOutResults = this.sortHospitalsByRegion(hospitals)
// 濡傛灉娌℃湁甯哥敤鍖婚櫌锛岄檷绾т负鏅�氭悳绱�
if (this.hospitalOutResults.length === 0) {
- searchHospitals('', this.selectedRegion).then(res => {
+ searchHospitals('', this.selectedOrganizationId).then(res => {
const hospitals = res.data || []
this.hospitalOutResults = this.sortHospitalsByRegion(hospitals)
})
}
}).catch(error => {
console.error('鍔犺浇甯哥敤杞嚭鍖婚櫌澶辫触:', error)
- searchHospitals('', this.selectedRegion).then(res => {
+ searchHospitals('', this.selectedOrganizationId).then(res => {
const hospitals = res.data || []
this.hospitalOutResults = this.sortHospitalsByRegion(hospitals)
})
})
} else {
// 娌℃湁鏈嶅姟鍗曠紪鐮侊紝浣跨敤鏅�氭悳绱�
- searchHospitals('', this.selectedRegion).then(response => {
+ searchHospitals('', this.selectedOrganizationId).then(response => {
const hospitals = response.data || []
this.hospitalOutResults = this.sortHospitalsByRegion(hospitals)
}).catch(error => {
@@ -1033,7 +1023,7 @@
// 濡傛灉鍏抽敭璇嶄负绌猴紝鏄剧ず褰撳墠鍖哄煙鐨勫尰闄�
if (!keyword || keyword.trim() === '') {
- searchHospitals('', this.selectedRegion).then(response => {
+ searchHospitals('', this.selectedOrganizationId).then(response => {
const hospitals = response.data || []
// 纭繚"瀹朵腑"鍦ㄦ渶鍓嶉潰
this.hospitalOutResults = this.sortHospitalsByRegion(hospitals)
@@ -1053,13 +1043,13 @@
// 鎼滅储杞嚭鍖婚櫌锛堜粎闄愬綋鍓嶅尯鍩燂級
searchHospitalOut(keyword) {
- // 浼犲叆鍏抽敭璇嶅拰鍦板煙杩囨护锛屽彧鎼滅储褰撳墠鍖哄煙鐨勫尰闄�
- searchHospitals(keyword, this.selectedRegion).then(response => {
+ // 浼犲叆鍏抽敭璇嶅拰閮ㄩ棬ID锛屽彧鎼滅储褰撳墠鍖哄煙鐨勫尰闄�
+ searchHospitals(keyword, this.selectedOrganizationId).then(response => {
const hospitals = response.data || []
// 纭繚"瀹朵腑"鍦ㄦ渶鍓嶉潰
this.hospitalOutResults = this.sortHospitalsByRegion(hospitals)
this.showHospitalOutResults = true
- console.log('鎼滅储杞嚭鍖婚櫌:', keyword, '鍖哄煙:', this.selectedRegion, '缁撴灉鏁�:', this.hospitalOutResults.length)
+ console.log('鎼滅储杞嚭鍖婚櫌:', keyword, '閮ㄩ棬ID:', this.selectedOrganizationId, '缁撴灉鏁�:', this.hospitalOutResults.length)
}).catch(error => {
console.error('鎼滅储杞嚭鍖婚櫌澶辫触:', error)
this.hospitalOutResults = []
@@ -1123,21 +1113,21 @@
this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
// 濡傛灉娌℃湁甯哥敤鍖婚櫌锛岄檷绾т负鏅�氭悳绱�
if (this.hospitalInResults.length === 0) {
- searchHospitals('', '').then(res => {
+ searchHospitals('', null).then(res => {
const allHospitals = res.data || []
this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
})
}
}).catch(error => {
console.error('鍔犺浇甯哥敤杞叆鍖婚櫌澶辫触:', error)
- searchHospitals('', '').then(res => {
+ searchHospitals('', null).then(res => {
const allHospitals = res.data || []
this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
})
})
} else {
// 娌℃湁鏈嶅姟鍗曠紪鐮侊紝浣跨敤鏅�氭悳绱�
- searchHospitals('', '').then(response => {
+ searchHospitals('', null).then(response => {
const allHospitals = response.data || []
// 鎸夊湴鍩熸帓搴忥細鏈湴鍖哄煙浼樺厛
this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
@@ -1162,7 +1152,7 @@
// 濡傛灉鍏抽敭璇嶄负绌猴紝鏄剧ず鎵�鏈夊尰闄紙鏈湴鍖哄煙浼樺厛锛�
if (!keyword || keyword.trim() === '') {
- searchHospitals('', '').then(response => {
+ searchHospitals('', null).then(response => {
const allHospitals = response.data || []
// 鎸夊湴鍩熸帓搴忥細"瀹朵腑"鏈�鍓嶏紝鏈湴鍖哄煙浼樺厛
this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
@@ -1182,8 +1172,8 @@
// 鎼滅储杞叆鍖婚櫌锛堜笉闄愬尯鍩燂紝浣嗘湰鍦板尯鍩熶紭鍏堬級
searchHospitalIn(keyword) {
- // 浼犲叆鍏抽敭璇嶏紝涓嶄紶鍦板煙杩囨护锛堟悳绱㈡墍鏈夊尯鍩燂級
- searchHospitals(keyword, '').then(response => {
+ // 浼犲叆鍏抽敭璇嶏紝涓嶄紶閮ㄩ棬ID锛堟悳绱㈡墍鏈夊尯鍩燂級
+ searchHospitals(keyword, null).then(response => {
const allHospitals = response.data || []
// 鎸夊湴鍩熸帓搴忥細"瀹朵腑"鏈�鍓嶏紝鏈湴鍖哄煙浼樺厛
this.hospitalInResults = this.sortHospitalsByRegion(allHospitals)
@@ -1888,11 +1878,18 @@
addTask(submitData).then(response => {
this.loading = false
this.$modal.showToast('浠诲姟鍒涘缓鎴愬姛')
+
+ // 寤惰繜璺宠浆锛岃鐢ㄦ埛鐪嬪埌鎴愬姛鎻愮ず
setTimeout(() => {
+ // 璺宠浆鍒颁换鍔″垪琛ㄥ苟瑙﹀彂鍒锋柊
uni.switchTab({
- url: '/pages/task/index'
+ url: '/pages/task/index',
+ success: () => {
+ // 浣跨敤浜嬩欢鎬荤嚎閫氱煡浠诲姟鍒楄〃椤甸潰鍒锋柊
+ uni.$emit('refreshTaskList')
+ }
})
- }, 1500)
+ }, 1000)
}).catch(error => {
this.loading = false
console.error('浠诲姟鍒涘缓澶辫触:', error)
diff --git a/app/pages/task/detail.vue b/app/pages/task/detail.vue
index 8803e0a..fa10be3 100644
--- a/app/pages/task/detail.vue
+++ b/app/pages/task/detail.vue
@@ -198,6 +198,7 @@
<AttachmentUpload
:taskId="taskId"
title="浠诲姟闄勪欢"
+ :readonly="isTaskFinished"
@uploaded="onAttachmentUploaded"
@deleted="onAttachmentDeleted"
/>
@@ -341,6 +342,13 @@
}
},
computed: {
+ // 鍒ゆ柇浠诲姟鏄惁宸茬粨鏉燂紙宸插畬鎴愭垨宸插彇娑堬級
+ isTaskFinished() {
+ if (!this.taskDetail || !this.taskDetail.taskStatus) {
+ return false
+ }
+ return ['COMPLETED', 'CANCELLED'].includes(this.taskDetail.taskStatus)
+ },
// 鏄剧ず浠诲姟绫诲瀷
displayTaskType() {
if (!this.taskDetail || !this.taskDetail.taskType) {
diff --git a/app/pages/task/index.vue b/app/pages/task/index.vue
index 0044af2..c25c86a 100644
--- a/app/pages/task/index.vue
+++ b/app/pages/task/index.vue
@@ -323,11 +323,28 @@
},
onLoad() {
this.loadTaskList()
+
+ // 鐩戝惉浠诲姟鍒楄〃鍒锋柊浜嬩欢
+ uni.$on('refreshTaskList', this.handleRefreshEvent)
+ },
+ onShow() {
+ // 椤甸潰鏄剧ず鏃跺埛鏂板垪琛紙浠庡叾浠栭〉闈㈣繑鍥炴椂锛�
+ this.loadTaskList()
+ },
+ onUnload() {
+ // 椤甸潰閿�姣佹椂绉婚櫎浜嬩欢鐩戝惉
+ uni.$off('refreshTaskList', this.handleRefreshEvent)
},
onPullDownRefresh() {
this.refreshList()
},
methods: {
+ // 澶勭悊鍒锋柊浜嬩欢
+ handleRefreshEvent() {
+ console.log('鏀跺埌鍒锋柊浠诲姟鍒楄〃浜嬩欢')
+ this.refreshList()
+ },
+
// 鍔犺浇浠诲姟鍒楄〃
loadTaskList() {
this.loading = true
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/HospDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/HospDataController.java
index a83ee32..ca8d171 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/HospDataController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/HospDataController.java
@@ -4,6 +4,7 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.HospData;
import com.ruoyi.system.mapper.HospDataMapper;
+import com.ruoyi.system.service.ISQLHospDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -14,6 +15,8 @@
/**
* 鍖婚櫌鏁版嵁Controller
+ * 浠嶮ySQL鐨則b_hosp_data琛ㄦ煡璇㈠尰闄㈡暟鎹�
+ * hospId瀵瑰簲legacy_hosp_id瀛楁锛堟棫绯荤粺鐨勫尰闄D锛�
*
* @author ruoyi
* @date 2024-01-16
@@ -24,28 +27,49 @@
@Autowired
private HospDataMapper hospDataMapper;
+
+ @Autowired
+ private ISQLHospDataService sqlHospDataService;
/**
- * 鎼滅储鍖婚櫌
+ * 鎼滅储鍖婚櫌锛堜粠MySQL tb_hosp_data琛ㄦ煡璇級
* 鏀寔鏍规嵁鍖婚櫌鍚嶇О銆佸湴鍧�銆佸湴鍩熻繘琛屾ā绯婃悳绱�
* @param keyword 鎼滅储鍏抽敭璇嶏紙鍖婚櫌鍚嶇О銆佸湴鍧�銆佺畝绉般�佺渷甯傚尯锛�
- * @param region 鍦板煙鍏抽敭璇嶏紙鐢ㄤ簬杩囨护鐪佸競鍖猴級
+ * @param deptId 閮ㄩ棬ID锛堢敤浜庢牴鎹儴闂ㄥ尯鍩熼厤缃繃婊ゅ尰闄級
*/
@GetMapping("/search")
public AjaxResult searchHospitals(
@RequestParam(value = "keyword", required = false) String keyword,
- @RequestParam(value = "region", required = false) String region) {
- List<HospData> list = hospDataMapper.searchHospitals(keyword, region);
- Integer homeHospId=hospDataMapper.getHomeHospId();
- if(homeHospId>0 && list.stream().count()>0 && list.stream().filter(hospData -> hospData.getHospId().equals(homeHospId)).count()<=0) {
- HospData hospData= hospDataMapper.selectHospDataById(homeHospId);
- list.add(0,hospData);
+ @RequestParam(value = "deptId", required = false) Long deptId) {
+ List<HospData> list;
+
+ // 濡傛灉keyword涓虹┖锛屼娇鐢ㄩ儴闂ㄥ尯鍩熻繃婊ゆ煡璇�
+ if (keyword == null || keyword.trim().isEmpty()) {
+ if (deptId != null) {
+ list = hospDataMapper.searchHospitalsByDeptRegion(null, deptId);
+ } else {
+ list = hospDataMapper.searchHospitals(null, null);
+ }
+ } else {
+
+ list = hospDataMapper.searchHospitals(keyword, null);
+
+ }
+
+ // 纭繚"瀹朵腑"鍦ㄧ粨鏋滀腑
+ Integer homeHospId = hospDataMapper.getHomeHospId();
+ if(homeHospId > 0 && !list.isEmpty() && list.stream().noneMatch(hospData -> hospData.getHospId().equals(homeHospId))) {
+ HospData hospData = hospDataMapper.selectHospDataById(homeHospId);
+ if (hospData != null) {
+ list.add(0, hospData);
+ }
}
return success(list);
}
/**
- * 鏍规嵁ID鑾峰彇鍖婚櫌璇︽儏
+ * 鏍规嵁ID鑾峰彇鍖婚櫌璇︽儏锛堜粠MySQL tb_hosp_data琛ㄦ煡璇級
+ * @param hospId 鍖婚櫌ID锛堝搴攍egacy_hosp_id锛�
*/
@GetMapping("/detail")
public AjaxResult getHospitalDetail(@RequestParam("hospId") Integer hospId) {
@@ -54,7 +78,7 @@
}
/**
- * 鑾峰彇甯哥敤杞嚭鍖婚櫌鍒楄〃
+ * 鑾峰彇甯哥敤杞嚭鍖婚櫌鍒楄〃锛堜粠MySQL tb_hosp_data琛ㄦ煡璇級
* @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
* @param region 鍦板煙鍏抽敭璇嶏紙鍙�夛級
*/
@@ -63,8 +87,10 @@
@RequestParam("serviceOrdClass") String serviceOrdClass,
@RequestParam(value = "region", required = false) String region) {
// 鏌ヨ甯哥敤杞嚭鍖婚櫌ID鍒楄〃
- List<Integer> hospIds = hospDataMapper.selectFrequentOutHospitalIds(serviceOrdClass);
- if (hospIds == null || hospIds.isEmpty()) {
+ logger.info("getFrequentOutHospitals 浼犲叆鐨� serviceOrdClass :{}",serviceOrdClass);
+ List<Integer> hospIds = sqlHospDataService.selectFrequentOutHospitalIds(serviceOrdClass);
+ logger.info(" getFrequentOutHospitals 鏌ヨ鍑烘潵鐨� hospIds :{}",hospIds.toArray().length);
+ if (hospIds.isEmpty()) {
return success();
}
@@ -75,7 +101,7 @@
}
/**
- * 鑾峰彇甯哥敤杞叆鍖婚櫌鍒楄〃
+ * 鑾峰彇甯哥敤杞叆鍖婚櫌鍒楄〃锛堜粠MySQL tb_hosp_data琛ㄦ煡璇級
* @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
* @param region 鍦板煙鍏抽敭璇嶏紙鍙�夛級
*/
@@ -84,8 +110,10 @@
@RequestParam("serviceOrdClass") String serviceOrdClass,
@RequestParam(value = "region", required = false) String region) {
// 鏌ヨ甯哥敤杞叆鍖婚櫌ID鍒楄〃
- List<Integer> hospIds = hospDataMapper.selectFrequentInHospitalIds(serviceOrdClass);
- if (hospIds == null || hospIds.isEmpty()) {
+ logger.info("getFrequentInHospitals 浼犲叆鐨� serviceOrdClass {}",serviceOrdClass);
+ List<Integer> hospIds = sqlHospDataService.selectFrequentInHospitalIds(serviceOrdClass);
+ logger.info("getFrequentInHospitals 鏌ヨ鍑烘潵鐨� hospIds {}",hospIds.toArray().length);
+ if (hospIds.isEmpty()) {
return success();
}
Integer homeHospId=hospDataMapper.getHomeHospId();
@@ -99,4 +127,31 @@
}
return success(hospitals);
}
+
+ /**
+ * 鏍规嵁閮ㄩ棬鍖哄煙閰嶇疆鎼滅储鍖婚櫌锛堜粠MySQL tb_hosp_data琛ㄦ煡璇紝鏀寔鐪併�佸競銆佸幙/鍖虹瓑澶氱骇鍖哄煙锛�
+ * @param keyword 鎼滅储鍏抽敭璇�
+ * @param deptId 閮ㄩ棬ID
+ */
+ @GetMapping("/search/by-dept-region")
+ public AjaxResult searchHospitalsByDeptRegion(
+ @RequestParam(value = "keyword", required = false) String keyword,
+ @RequestParam("deptId") Long deptId) {
+ logger.info("鏍规嵁閮ㄩ棬鍖哄煙閰嶇疆鎼滅储鍖婚櫌锛歞eptId={}, keyword={}", deptId, keyword);
+
+ // 璋冪敤Mapper鏌ヨ锛岃嚜鍔ㄦ牴鎹儴闂ㄧ殑鍖哄煙閰嶇疆杩囨护鍖婚櫌
+ List<HospData> hospitals = hospDataMapper.searchHospitalsByDeptRegion(keyword, deptId);
+ logger.info("鏌ヨ鍒板尰闄㈡暟閲忥細{}", hospitals.size());
+
+ // 纭繚"瀹朵腑"鍦ㄧ粨鏋滀腑
+ Integer homeHospId = hospDataMapper.getHomeHospId();
+ if (homeHospId > 0 && hospitals.stream().noneMatch(h -> h.getHospId().equals(homeHospId))) {
+ HospData homeHosp = hospDataMapper.selectHospDataById(homeHospId);
+ if (homeHosp != null) {
+ hospitals.add(0, homeHosp);
+ }
+ }
+
+ return success(hospitals);
+ }
}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptRegionController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptRegionController.java
new file mode 100644
index 0000000..7c4f8f9
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptRegionController.java
@@ -0,0 +1,68 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.SysDeptRegion;
+import com.ruoyi.system.mapper.SysDeptRegionMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 閮ㄩ棬鍖哄煙绠$悊Controller
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/dept/region")
+public class SysDeptRegionController extends BaseController
+{
+ @Autowired
+ private SysDeptRegionMapper deptRegionMapper;
+
+ /**
+ * 鏌ヨ閮ㄩ棬鐨勫尯鍩熷垪琛�
+ */
+ @PreAuthorize("@ss.hasPermi('system:dept:query')")
+ @GetMapping("/list/{deptId}")
+ public AjaxResult list(@PathVariable("deptId") Long deptId)
+ {
+ List<SysDeptRegion> list = deptRegionMapper.selectDeptRegionListByDeptId(deptId);
+ return success(list);
+ }
+
+ /**
+ * 鏂板閮ㄩ棬鍖哄煙
+ */
+ @PreAuthorize("@ss.hasPermi('system:dept:edit')")
+ @PostMapping
+ public AjaxResult add(@Validated @RequestBody SysDeptRegion deptRegion)
+ {
+ deptRegion.setCreateBy(getUsername());
+ return toAjax(deptRegionMapper.insertDeptRegion(deptRegion));
+ }
+
+ /**
+ * 淇敼閮ㄩ棬鍖哄煙
+ */
+ @PreAuthorize("@ss.hasPermi('system:dept:edit')")
+ @PutMapping
+ public AjaxResult edit(@Validated @RequestBody SysDeptRegion deptRegion)
+ {
+ deptRegion.setUpdateBy(getUsername());
+ return toAjax(deptRegionMapper.updateDeptRegion(deptRegion));
+ }
+
+ /**
+ * 鍒犻櫎閮ㄩ棬鍖哄煙
+ */
+ @PreAuthorize("@ss.hasPermi('system:dept:edit')")
+ @DeleteMapping("/{regionId}")
+ public AjaxResult remove(@PathVariable Long regionId)
+ {
+ return toAjax(deptRegionMapper.deleteDeptRegionById(regionId));
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbHospDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbHospDataController.java
new file mode 100644
index 0000000..3e6fb92
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbHospDataController.java
@@ -0,0 +1,112 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.TbHospData;
+import com.ruoyi.system.service.IHospDataSyncService;
+import com.ruoyi.system.service.ITbHospDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁Controller
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/hosp")
+public class TbHospDataController extends BaseController
+{
+ @Autowired
+ private ITbHospDataService tbHospDataService;
+
+ @Autowired
+ private IHospDataSyncService hospDataSyncService;
+
+ /**
+ * 鏌ヨ鍖婚櫌鏁版嵁鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(TbHospData tbHospData)
+ {
+ startPage();
+ List<TbHospData> list = tbHospDataService.selectTbHospDataList(tbHospData);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭鍖婚櫌鏁版嵁鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:export')")
+ @Log(title = "鍖婚櫌鏁版嵁", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, TbHospData tbHospData)
+ {
+ List<TbHospData> list = tbHospDataService.selectTbHospDataList(tbHospData);
+ ExcelUtil<TbHospData> util = new ExcelUtil<TbHospData>(TbHospData.class);
+ util.exportExcel(response, list, "鍖婚櫌鏁版嵁");
+ }
+
+ /**
+ * 鑾峰彇鍖婚櫌鏁版嵁璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:query')")
+ @GetMapping(value = "/{hospId}")
+ public AjaxResult getInfo(@PathVariable("hospId") Long hospId)
+ {
+ return success(tbHospDataService.selectTbHospDataById(hospId));
+ }
+
+ /**
+ * 鏂板鍖婚櫌鏁版嵁
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:add')")
+ @Log(title = "鍖婚櫌鏁版嵁", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody TbHospData tbHospData)
+ {
+ return toAjax(tbHospDataService.insertTbHospData(tbHospData));
+ }
+
+ /**
+ * 淇敼鍖婚櫌鏁版嵁
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:edit')")
+ @Log(title = "鍖婚櫌鏁版嵁", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody TbHospData tbHospData)
+ {
+ return toAjax(tbHospDataService.updateTbHospData(tbHospData));
+ }
+
+ /**
+ * 鍒犻櫎鍖婚櫌鏁版嵁
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:remove')")
+ @Log(title = "鍖婚櫌鏁版嵁", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{hospIds}")
+ public AjaxResult remove(@PathVariable Long[] hospIds)
+ {
+ return toAjax(tbHospDataService.deleteTbHospDataByIds(hospIds));
+ }
+
+ /**
+ * 浠嶴QL Server鍚屾鍖婚櫌鏁版嵁
+ */
+ @PreAuthorize("@ss.hasPermi('system:hosp:sync')")
+ @Log(title = "鍖婚櫌鏁版嵁鍚屾", businessType = BusinessType.OTHER)
+ @PostMapping("/sync")
+ public AjaxResult sync()
+ {
+ return hospDataSyncService.syncHospData();
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java
index 39189cc..0480114 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java
@@ -65,7 +65,6 @@
/**
* 鏌ヨ浠诲姟闄勪欢鍒楄〃
*/
- @PreAuthorize("@ss.hasPermi('task:general:query')")
@GetMapping("/list/{taskId}")
public AjaxResult list(@PathVariable("taskId") Long taskId) {
SysTask task = sysTaskService.getTaskDetail(taskId);
@@ -75,7 +74,7 @@
/**
* 涓婁紶浠诲姟闄勪欢
*/
- @PreAuthorize("@ss.hasPermi('task:general:edit')")
+
@Log(title = "浠诲姟闄勪欢", businessType = BusinessType.INSERT)
@PostMapping("/upload/{taskId}")
public AjaxResult upload(@PathVariable("taskId") Long taskId,
@@ -119,7 +118,6 @@
/**
* 鍒犻櫎浠诲姟闄勪欢
*/
- @PreAuthorize("@ss.hasPermi('task:general:edit')")
@Log(title = "浠诲姟闄勪欢", businessType = BusinessType.DELETE)
@DeleteMapping("/{attachmentId}")
public AjaxResult remove(@PathVariable("attachmentId") Long attachmentId) {
@@ -138,7 +136,6 @@
/**
* 浠庡井淇ediaId涓婁紶闄勪欢锛堝井淇″皬绋嬪簭涓撶敤锛�
*/
- @PreAuthorize("@ss.hasPermi('task:general:edit')")
@Log(title = "浠诲姟闄勪欢", businessType = BusinessType.INSERT)
@PostMapping("/uploadFromWechat/{taskId}")
public AjaxResult uploadFromWechat(@PathVariable("taskId") Long taskId,
diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml
index a406505..464c528 100644
--- a/ruoyi-admin/src/main/resources/application-prod.yml
+++ b/ruoyi-admin/src/main/resources/application-prod.yml
@@ -96,7 +96,7 @@
evaluationWechat:
appId: wx70f6a7346ee842c0
appSecret: 2d6c59de85e876b7eadebeba62e5417a
- redirectUri: http://yourdomain.com/evaluation
+ redirectUri: http://gzgj.966120.com.cn/evaluation
# 璋冨害鐢ㄧ殑weixin閰嶇疆
transferConfigWeixin:
appId: wx40692cc44953a8cb
@@ -109,11 +109,16 @@
map:
ak: GX7G1RmAbTEQHor9NKpzRiB2jerqaY1E
# 鏃х郴缁熼厤缃�
+# 鏃х郴缁熼厤缃�
legacy:
system:
# 鏃х郴缁熷熀纭�URL (蹇呴』閰嶇疆)
# 绀轰緥: http://192.168.1.100:8080 鎴� http://legacy.yourdomain.com
base-url: https://sys.966120.com.cn
+ # 鏂囦欢涓婁紶URL
+ fileUploadUrl: https://sys.966120.com.cn/weixin/upload_file.php
+ # 鏂囦欢涓嬭浇URL
+ fileServerUrl: https://sys.966120.com.cn
# 鎬ユ晳杞繍鍒涘缓鎺ュ彛璺緞 (鍙�夛紝榛樿鍊煎涓�)
emergency-create-path: /admin_save_19.gds
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index 2bc8351..a29e877 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -9,7 +9,7 @@
# 瀹炰緥婕旂ず寮�鍏�
demoEnabled: true
# 鏂囦欢璺緞 绀轰緥锛� Windows閰嶇疆D:/ruoyi/uploadPath锛孡inux閰嶇疆 /home/ruoyi/uploadPath锛�
- profile: D:/ruoyi/uploadPath
+ profile: D:/GZGJ/uploadPath
# 鑾峰彇ip鍦板潃寮�鍏�
addressEnabled: false
# 楠岃瘉鐮佺被鍨� math 鏁板瓧璁$畻 char 瀛楃楠岃瘉
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
index 1094430..492b569 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
@@ -344,6 +344,7 @@
/**
* 鍙戦�佹枃浠朵笂浼犺姹傦紙鏀寔鑷畾涔夋枃浠跺悕锛�
+ * 鏀寔HTTP鍜孒TTPS锛孒TTPS浼氳嚜鍔ㄥ拷鐣SL璇佷功楠岃瘉
*
* @param url 璇锋眰URL
* @param params 璇锋眰鍙傛暟锛堝寘鍚枃浠舵祦锛�
@@ -365,7 +366,18 @@
// 鍒涘缓杩炴帴
URL requestUrl = new URL(url);
connection = (HttpURLConnection) requestUrl.openConnection();
+
+ // 濡傛灉鏄疕TTPS璇锋眰锛岄厤缃甋SL淇′换鎵�鏈夎瘉涔�
+ if (connection instanceof HttpsURLConnection) {
+ HttpsURLConnection httpsConnection = (HttpsURLConnection) connection;
+ SSLContext sc = SSLContext.getInstance("TLS");
+ sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
+ httpsConnection.setSSLSocketFactory(sc.getSocketFactory());
+ httpsConnection.setHostnameVerifier(new TrustAnyHostnameVerifier());
+ log.info("閰嶇疆HTTPS杩炴帴锛屽拷鐣SL璇佷功楠岃瘉");
+ }
+
// 璁剧疆璇锋眰灞炴��
connection.setRequestMethod("POST");
connection.setDoOutput(true);
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
index a255812..40b9aaa 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
@@ -51,7 +51,7 @@
{
DynamicDataSourceContextHolder.setDataSourceType(newDataSourceType);
isNewDataSource = true;
- logger.debug("鍒囨崲鏁版嵁婧�: {} -> {}", oldDataSourceType, newDataSourceType);
+ //logger.debug("鍒囨崲鏁版嵁婧�: {} -> {}", oldDataSourceType, newDataSourceType);
}
}
@@ -68,12 +68,12 @@
if (StringUtils.isNotEmpty(oldDataSourceType))
{
DynamicDataSourceContextHolder.setDataSourceType(oldDataSourceType);
- logger.debug("鎭㈠鏁版嵁婧�: {}", oldDataSourceType);
+ //logger.debug("鎭㈠鏁版嵁婧�: {}", oldDataSourceType);
}
else
{
DynamicDataSourceContextHolder.clearDataSourceType();
- logger.debug("娓呴櫎鏁版嵁婧愶紝鎭㈠鍒伴粯璁ゆ暟鎹簮");
+ //logger.debug("娓呴櫎鏁版嵁婧愶紝鎭㈠鍒伴粯璁ゆ暟鎹簮");
}
}
}
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/HospDataSyncTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/HospDataSyncTask.java
new file mode 100644
index 0000000..01fb634
--- /dev/null
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/HospDataSyncTask.java
@@ -0,0 +1,63 @@
+package com.ruoyi.quartz.task;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.service.IHospDataSyncService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾瀹氭椂浠诲姟
+ *
+ * @author ruoyi
+ */
+@Component("hospDataSyncTask")
+public class HospDataSyncTask
+{
+ private static final Logger log = LoggerFactory.getLogger(HospDataSyncTask.class);
+
+ @Autowired
+ private IHospDataSyncService hospDataSyncService;
+
+ /**
+ * 鍚屾鍖婚櫌鏁版嵁
+ */
+ public void syncHospData()
+ {
+ log.info("寮�濮嬫墽琛屽尰闄㈡暟鎹悓姝ュ畾鏃朵换鍔�...");
+
+ try
+ {
+ AjaxResult result = hospDataSyncService.syncHospData();
+
+ if (result.isSuccess())
+ {
+ log.info("鍖婚櫌鏁版嵁鍚屾鎴愬姛: {}", result.get(AjaxResult.MSG_TAG));
+ }
+ else if (result.isWarn())
+ {
+ log.warn("鍖婚櫌鏁版嵁鍚屾璀﹀憡: {}", result.get(AjaxResult.MSG_TAG));
+ }
+ else
+ {
+ log.error("鍖婚櫌鏁版嵁鍚屾澶辫触: {}", result.get(AjaxResult.MSG_TAG));
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("鍖婚櫌鏁版嵁鍚屾寮傚父", e);
+ }
+ }
+
+ /**
+ * 甯﹀弬鏁扮殑鍚屾鏂规硶锛堝彲浠ュ湪绯荤粺绠$悊-瀹氭椂浠诲姟涓厤缃弬鏁帮級
+ *
+ * @param params 鍙傛暟
+ */
+ public void syncHospDataWithParams(String params)
+ {
+ log.info("寮�濮嬫墽琛屽尰闄㈡暟鎹悓姝ュ畾鏃朵换鍔★紙鍙傛暟: {}锛�...", params);
+ syncHospData();
+ }
+}
diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml
index 1b2a373..3fa5ad3 100644
--- a/ruoyi-system/pom.xml
+++ b/ruoyi-system/pom.xml
@@ -39,6 +39,11 @@
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/HospDataSyncDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/HospDataSyncDTO.java
new file mode 100644
index 0000000..61112b7
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/HospDataSyncDTO.java
@@ -0,0 +1,185 @@
+package com.ruoyi.system.domain;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾DTO
+ * 鐢ㄤ簬浠� SQL Server 鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @author ruoyi
+ */
+public class HospDataSyncDTO
+{
+ /** 鍖婚櫌ID */
+ private Integer hospId;
+
+ /** 鍖婚櫌鍚嶇О */
+ private String hospName;
+
+ /** 鍩庡競ID */
+ private Integer hospCityId;
+
+ /** 鍖婚櫌绠�绉� */
+ private String hospShort;
+
+ /** 鐪佷唤 */
+ private String hopsProvince;
+
+ /** 鍩庡競 */
+ private String hopsCity;
+
+ /** 鍖哄煙 */
+ private String hopsArea;
+
+ /** 鍖婚櫌鍦板潃 */
+ private String hospAddress;
+
+ /** 鍖婚櫌鐢佃瘽 */
+ private String hospTel;
+
+ /** 鍗曚綅ID */
+ private Integer hospUnitId;
+
+ /** 鐘舵�� */
+ private Integer hospState;
+
+ /** OA ID */
+ private String hospOaId;
+
+ /** 浠嬬粛浜篒D */
+ private Integer hospIntroducerId;
+
+ /** 浠嬬粛鏃ユ湡 */
+ private String hospIntroducerDate;
+
+ /** 鍖婚櫌绾у埆 */
+ private Integer hospLevel;
+
+ public Integer getHospId() {
+ return hospId;
+ }
+
+ public void setHospId(Integer hospId) {
+ this.hospId = hospId;
+ }
+
+ public String getHospName() {
+ return hospName;
+ }
+
+ public void setHospName(String hospName) {
+ this.hospName = hospName;
+ }
+
+ public Integer getHospCityId() {
+ return hospCityId;
+ }
+
+ public void setHospCityId(Integer hospCityId) {
+ this.hospCityId = hospCityId;
+ }
+
+ public String getHospShort() {
+ return hospShort;
+ }
+
+ public void setHospShort(String hospShort) {
+ this.hospShort = hospShort;
+ }
+
+ public String getHopsProvince() {
+ return hopsProvince;
+ }
+
+ public void setHopsProvince(String hopsProvince) {
+ this.hopsProvince = hopsProvince;
+ }
+
+ public String getHopsCity() {
+ return hopsCity;
+ }
+
+ public void setHopsCity(String hopsCity) {
+ this.hopsCity = hopsCity;
+ }
+
+ public String getHopsArea() {
+ return hopsArea;
+ }
+
+ public void setHopsArea(String hopsArea) {
+ this.hopsArea = hopsArea;
+ }
+
+ public String getHospAddress() {
+ return hospAddress;
+ }
+
+ public void setHospAddress(String hospAddress) {
+ this.hospAddress = hospAddress;
+ }
+
+ public String getHospTel() {
+ return hospTel;
+ }
+
+ public void setHospTel(String hospTel) {
+ this.hospTel = hospTel;
+ }
+
+ public Integer getHospUnitId() {
+ return hospUnitId;
+ }
+
+ public void setHospUnitId(Integer hospUnitId) {
+ this.hospUnitId = hospUnitId;
+ }
+
+ public Integer getHospState() {
+ return hospState;
+ }
+
+ public void setHospState(Integer hospState) {
+ this.hospState = hospState;
+ }
+
+ public String getHospOaId() {
+ return hospOaId;
+ }
+
+ public void setHospOaId(String hospOaId) {
+ this.hospOaId = hospOaId;
+ }
+
+ public Integer getHospIntroducerId() {
+ return hospIntroducerId;
+ }
+
+ public void setHospIntroducerId(Integer hospIntroducerId) {
+ this.hospIntroducerId = hospIntroducerId;
+ }
+
+ public String getHospIntroducerDate() {
+ return hospIntroducerDate;
+ }
+
+ public void setHospIntroducerDate(String hospIntroducerDate) {
+ this.hospIntroducerDate = hospIntroducerDate;
+ }
+
+ public Integer getHospLevel() {
+ return hospLevel;
+ }
+
+ public void setHospLevel(Integer hospLevel) {
+ this.hospLevel = hospLevel;
+ }
+
+ @Override
+ public String toString() {
+ return "HospDataSyncDTO{" +
+ "hospId=" + hospId +
+ ", hospName='" + hospName + '\'' +
+ ", hopsCity='" + hopsCity + '\'' +
+ ", hopsArea='" + hopsArea + '\'' +
+ '}';
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDeptRegion.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDeptRegion.java
new file mode 100644
index 0000000..a9a3a88
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDeptRegion.java
@@ -0,0 +1,152 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 閮ㄩ棬绠$悊鍖哄煙瀵硅薄 sys_dept_region
+ *
+ * @author ruoyi
+ */
+public class SysDeptRegion extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鍖哄煙ID */
+ private Long regionId;
+
+ /** 閮ㄩ棬ID */
+ private Long deptId;
+
+ /** 鐪佷唤 */
+ private String province;
+
+ /** 鍩庡競 */
+ private String city;
+
+ /** 鍘�/鍖� */
+ private String area;
+
+ /** 璇︾粏鍦板潃 */
+ private String address;
+
+ /** 鎸囧畾鍖婚櫌鍚嶇О */
+ private String hospitalName;
+
+ /** 鍖哄煙绫诲瀷锛欰REA-鍦板煙鑼冨洿锛孒OSPITAL-鎸囧畾鍖婚櫌 */
+ private String regionType;
+
+ /** 鐘舵�侊紙0姝e父 1鍋滅敤锛� */
+ private String status;
+
+ public Long getRegionId()
+ {
+ return regionId;
+ }
+
+ public void setRegionId(Long regionId)
+ {
+ this.regionId = regionId;
+ }
+
+ public Long getDeptId()
+ {
+ return deptId;
+ }
+
+ public void setDeptId(Long deptId)
+ {
+ this.deptId = deptId;
+ }
+
+ public String getProvince()
+ {
+ return province;
+ }
+
+ public void setProvince(String province)
+ {
+ this.province = province;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ public String getArea()
+ {
+ return area;
+ }
+
+ public void setArea(String area)
+ {
+ this.area = area;
+ }
+
+ public String getAddress()
+ {
+ return address;
+ }
+
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+
+ public String getHospitalName()
+ {
+ return hospitalName;
+ }
+
+ public void setHospitalName(String hospitalName)
+ {
+ this.hospitalName = hospitalName;
+ }
+
+ public String getRegionType()
+ {
+ return regionType;
+ }
+
+ public void setRegionType(String regionType)
+ {
+ this.regionType = regionType;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("regionId", getRegionId())
+ .append("deptId", getDeptId())
+ .append("province", getProvince())
+ .append("city", getCity())
+ .append("area", getArea())
+ .append("address", getAddress())
+ .append("hospitalName", getHospitalName())
+ .append("regionType", getRegionType())
+ .append("status", getStatus())
+ .append("remark", getRemark())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .toString();
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TbHospData.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TbHospData.java
new file mode 100644
index 0000000..4c11f45
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TbHospData.java
@@ -0,0 +1,234 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+/**
+ * 鍖婚櫌鏁版嵁瀵硅薄 tb_hosp_data
+ *
+ * @author ruoyi
+ */
+public class TbHospData extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鍖婚櫌ID锛堣嚜澧炰富閿級 */
+ private Long hospId;
+
+ /** 鏃х郴缁熷尰闄D锛堝搴擲QL Server涓殑HospID锛� */
+ private Integer legacyHospId;
+
+ /** 鍖婚櫌鍚嶇О */
+ private String hospName;
+
+ /** 鍩庡競ID */
+ private Integer hospCityId;
+
+ /** 鍖婚櫌绠�绉� */
+ private String hospShort;
+
+ /** 鐪佷唤 */
+ private String hopsProvince;
+
+ /** 鍩庡競 */
+ private String hopsCity;
+
+ /** 鍖哄煙 */
+ private String hopsArea;
+
+ /** 鍖婚櫌鍦板潃 */
+ private String hospAddress;
+
+ /** 鍖婚櫌鐢佃瘽 */
+ private String hospTel;
+
+ /** 鍗曚綅ID */
+ private Integer hospUnitId;
+
+ /** 鐘舵�� */
+ private Integer hospState;
+
+ /** OA ID */
+ private String hospOaId;
+
+ /** 浠嬬粛浜篒D */
+ private Integer hospIntroducerId;
+
+ /** 浠嬬粛鏃ユ湡 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date hospIntroducerDate;
+
+ /** 鍖婚櫌绾у埆 */
+ private Integer hospLevel;
+
+ /** 鏁版嵁鐘舵�侊紙0姝e父 1鍋滅敤锛� */
+ private String status;
+
+ public Long getHospId() {
+ return hospId;
+ }
+
+ public void setHospId(Long hospId) {
+ this.hospId = hospId;
+ }
+
+ public Integer getLegacyHospId() {
+ return legacyHospId;
+ }
+
+ public void setLegacyHospId(Integer legacyHospId) {
+ this.legacyHospId = legacyHospId;
+ }
+
+ public String getHospName() {
+ return hospName;
+ }
+
+ public void setHospName(String hospName) {
+ this.hospName = hospName;
+ }
+
+ public Integer getHospCityId() {
+ return hospCityId;
+ }
+
+ public void setHospCityId(Integer hospCityId) {
+ this.hospCityId = hospCityId;
+ }
+
+ public String getHospShort() {
+ return hospShort;
+ }
+
+ public void setHospShort(String hospShort) {
+ this.hospShort = hospShort;
+ }
+
+ public String getHopsProvince() {
+ return hopsProvince;
+ }
+
+ public void setHopsProvince(String hopsProvince) {
+ this.hopsProvince = hopsProvince;
+ }
+
+ public String getHopsCity() {
+ return hopsCity;
+ }
+
+ public void setHopsCity(String hopsCity) {
+ this.hopsCity = hopsCity;
+ }
+
+ public String getHopsArea() {
+ return hopsArea;
+ }
+
+ public void setHopsArea(String hopsArea) {
+ this.hopsArea = hopsArea;
+ }
+
+ public String getHospAddress() {
+ return hospAddress;
+ }
+
+ public void setHospAddress(String hospAddress) {
+ this.hospAddress = hospAddress;
+ }
+
+ public String getHospTel() {
+ return hospTel;
+ }
+
+ public void setHospTel(String hospTel) {
+ this.hospTel = hospTel;
+ }
+
+ public Integer getHospUnitId() {
+ return hospUnitId;
+ }
+
+ public void setHospUnitId(Integer hospUnitId) {
+ this.hospUnitId = hospUnitId;
+ }
+
+ public Integer getHospState() {
+ return hospState;
+ }
+
+ public void setHospState(Integer hospState) {
+ this.hospState = hospState;
+ }
+
+ public String getHospOaId() {
+ return hospOaId;
+ }
+
+ public void setHospOaId(String hospOaId) {
+ this.hospOaId = hospOaId;
+ }
+
+ public Integer getHospIntroducerId() {
+ return hospIntroducerId;
+ }
+
+ public void setHospIntroducerId(Integer hospIntroducerId) {
+ this.hospIntroducerId = hospIntroducerId;
+ }
+
+ public Date getHospIntroducerDate() {
+ return hospIntroducerDate;
+ }
+
+ public void setHospIntroducerDate(Date hospIntroducerDate) {
+ this.hospIntroducerDate = hospIntroducerDate;
+ }
+
+ public Integer getHospLevel() {
+ return hospLevel;
+ }
+
+ public void setHospLevel(Integer hospLevel) {
+ this.hospLevel = hospLevel;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+ .append("hospId", getHospId())
+ .append("legacyHospId", getLegacyHospId())
+ .append("hospName", getHospName())
+ .append("hospCityId", getHospCityId())
+ .append("hospShort", getHospShort())
+ .append("hopsProvince", getHopsProvince())
+ .append("hopsCity", getHopsCity())
+ .append("hopsArea", getHopsArea())
+ .append("hospAddress", getHospAddress())
+ .append("hospTel", getHospTel())
+ .append("hospUnitId", getHospUnitId())
+ .append("hospState", getHospState())
+ .append("hospOaId", getHospOaId())
+ .append("hospIntroducerId", getHospIntroducerId())
+ .append("hospIntroducerDate", getHospIntroducerDate())
+ .append("hospLevel", getHospLevel())
+ .append("status", getStatus())
+ .append("remark", getRemark())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .toString();
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataMapper.java
index 02aeb52..00c494b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataMapper.java
@@ -13,7 +13,7 @@
* @author ruoyi
* @date 2024-01-16
*/
-@DataSource(DataSourceType.SQLSERVER)
+
public interface HospDataMapper {
/**
@@ -33,22 +33,9 @@
*/
HospData selectHospDataById(@Param("hospId") Integer hospId);
- /**
- * 鏌ヨ甯哥敤杞嚭鍖婚櫌ID鍒楄〃
- *
- * @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
- * @return 甯哥敤杞嚭鍖婚櫌ID鍒楄〃
- */
- List<Integer> selectFrequentOutHospitalIds(@Param("serviceOrdClass") String serviceOrdClass);
-
+
Integer getHomeHospId();
- /**
- * 鏌ヨ甯哥敤杞叆鍖婚櫌ID鍒楄〃
- *
- * @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
- * @return 甯哥敤杞叆鍖婚櫌ID鍒楄〃
- */
- List<Integer> selectFrequentInHospitalIds(@Param("serviceOrdClass") String serviceOrdClass);
+
/**
* 鏍规嵁鍖婚櫌ID鍒楄〃鏌ヨ鍖婚櫌淇℃伅
@@ -58,4 +45,13 @@
* @return 鍖婚櫌鍒楄〃
*/
List<HospData> selectHospDataByIds(@Param("hospIds") List<Integer> hospIds, @Param("region") String region);
+
+ /**
+ * 鏍规嵁鍖哄煙閰嶇疆鏌ヨ鍖婚櫌锛堟敮鎸佺渷銆佸競銆佸幙/鍖虹瓑澶氱骇鍖哄煙锛�
+ *
+ * @param keyword 鎼滅储鍏抽敭璇�
+ * @param deptId 閮ㄩ棬ID锛堢敤浜庢煡璇㈣閮ㄩ棬鐨勫尯鍩熼厤缃級
+ * @return 鍖婚櫌鍒楄〃
+ */
+ List<HospData> searchHospitalsByDeptRegion(@Param("keyword") String keyword, @Param("deptId") Long deptId);
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataSyncMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataSyncMapper.java
new file mode 100644
index 0000000..4cf0159
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/HospDataSyncMapper.java
@@ -0,0 +1,23 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.system.domain.HospDataSyncDTO;
+
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾Mapper鎺ュ彛锛堜粠SQL Server鏌ヨ鏁版嵁锛�
+ *
+ * @author ruoyi
+ */
+@DataSource(DataSourceType.SQLSERVER)
+public interface HospDataSyncMapper
+{
+ /**
+ * 浠嶴QL Server鏌ヨ鎵�鏈夊尰闄㈡暟鎹�
+ *
+ * @return 鍖婚櫌鏁版嵁鍒楄〃
+ */
+ List<HospDataSyncDTO> selectAllHospDataFromSqlServer();
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SQLHospDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SQLHospDataMapper.java
new file mode 100644
index 0000000..f540df5
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SQLHospDataMapper.java
@@ -0,0 +1,24 @@
+package com.ruoyi.system.mapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SQLHospDataMapper {
+ /**
+ * 鏌ヨ甯哥敤杞叆鍖婚櫌ID鍒楄〃
+ *
+ * @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
+ * @return 甯哥敤杞叆鍖婚櫌ID鍒楄〃
+ */
+ List<Integer> selectFrequentInHospitalIds(@Param("serviceOrdClass") String serviceOrdClass);
+
+ /**
+ * 鏌ヨ甯哥敤杞嚭鍖婚櫌ID鍒楄〃
+ *
+ * @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
+ * @return 甯哥敤杞嚭鍖婚櫌ID鍒楄〃
+ */
+ List<Integer> selectFrequentOutHospitalIds(@Param("serviceOrdClass") String serviceOrdClass);
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptRegionMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptRegionMapper.java
new file mode 100644
index 0000000..4e6456d
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptRegionMapper.java
@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.SysDeptRegion;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 閮ㄩ棬绠$悊鍖哄煙Mapper鎺ュ彛
+ *
+ * @author ruoyi
+ */
+public interface SysDeptRegionMapper
+{
+ /**
+ * 鏌ヨ閮ㄩ棬绠$悊鍖哄煙鍒楄〃
+ *
+ * @param deptId 閮ㄩ棬ID
+ * @return 閮ㄩ棬绠$悊鍖哄煙闆嗗悎
+ */
+ List<SysDeptRegion> selectDeptRegionListByDeptId(@Param("deptId") Long deptId);
+
+ /**
+ * 鎵归噺鏌ヨ澶氫釜閮ㄩ棬鐨勭鐞嗗尯鍩�
+ *
+ * @param deptIds 閮ㄩ棬ID鍒楄〃
+ * @return 閮ㄩ棬绠$悊鍖哄煙闆嗗悎
+ */
+ List<SysDeptRegion> selectDeptRegionListByDeptIds(@Param("deptIds") List<Long> deptIds);
+
+ /**
+ * 鏂板閮ㄩ棬绠$悊鍖哄煙
+ *
+ * @param deptRegion 閮ㄩ棬绠$悊鍖哄煙
+ * @return 缁撴灉
+ */
+ int insertDeptRegion(SysDeptRegion deptRegion);
+
+ /**
+ * 淇敼閮ㄩ棬绠$悊鍖哄煙
+ *
+ * @param deptRegion 閮ㄩ棬绠$悊鍖哄煙
+ * @return 缁撴灉
+ */
+ int updateDeptRegion(SysDeptRegion deptRegion);
+
+ /**
+ * 鍒犻櫎閮ㄩ棬绠$悊鍖哄煙
+ *
+ * @param regionId 鍖哄煙ID
+ * @return 缁撴灉
+ */
+ int deleteDeptRegionById(@Param("regionId") Long regionId);
+
+ /**
+ * 鍒犻櫎閮ㄩ棬鐨勬墍鏈夌鐞嗗尯鍩�
+ *
+ * @param deptId 閮ㄩ棬ID
+ * @return 缁撴灉
+ */
+ int deleteDeptRegionByDeptId(@Param("deptId") Long deptId);
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbHospDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbHospDataMapper.java
new file mode 100644
index 0000000..91f52c7
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbHospDataMapper.java
@@ -0,0 +1,70 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.TbHospData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁Mapper鎺ュ彛
+ *
+ * @author ruoyi
+ */
+public interface TbHospDataMapper
+{
+ /**
+ * 鏌ヨ鍖婚櫌鏁版嵁鍒楄〃
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 鍖婚櫌鏁版嵁闆嗗悎
+ */
+ List<TbHospData> selectTbHospDataList(TbHospData tbHospData);
+
+ /**
+ * 鏍规嵁鍖婚櫌ID鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @param hospId 鍖婚櫌ID
+ * @return 鍖婚櫌鏁版嵁
+ */
+ TbHospData selectTbHospDataById(@Param("hospId") Long hospId);
+
+ /**
+ * 鏍规嵁鏃х郴缁熷尰闄D鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @param legacyHospId 鏃х郴缁熷尰闄D
+ * @return 鍖婚櫌鏁版嵁
+ */
+ TbHospData selectTbHospDataByLegacyId(@Param("legacyHospId") Integer legacyHospId);
+
+ /**
+ * 鏂板鍖婚櫌鏁版嵁
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 缁撴灉
+ */
+ int insertTbHospData(TbHospData tbHospData);
+
+ /**
+ * 淇敼鍖婚櫌鏁版嵁
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 缁撴灉
+ */
+ int updateTbHospData(TbHospData tbHospData);
+
+ /**
+ * 鍒犻櫎鍖婚櫌鏁版嵁
+ *
+ * @param hospId 鍖婚櫌ID
+ * @return 缁撴灉
+ */
+ int deleteTbHospDataById(@Param("hospId") Long hospId);
+
+ /**
+ * 鎵归噺鍒犻櫎鍖婚櫌鏁版嵁
+ *
+ * @param hospIds 闇�瑕佸垹闄ょ殑鏁版嵁ID
+ * @return 缁撴灉
+ */
+ int deleteTbHospDataByIds(@Param("hospIds") Long[] hospIds);
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncDataService.java
new file mode 100644
index 0000000..25f2639
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncDataService.java
@@ -0,0 +1,20 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.HospDataSyncDTO;
+
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾鏁版嵁鏌ヨService鎺ュ彛锛堜粠SQL Server鏌ヨ锛�
+ *
+ * @author ruoyi
+ */
+public interface IHospDataSyncDataService
+{
+ /**
+ * 浠嶴QL Server鏌ヨ鎵�鏈夊尰闄㈡暟鎹�
+ *
+ * @return 鍖婚櫌鏁版嵁鍒楄〃
+ */
+ List<HospDataSyncDTO> selectAllHospDataFromSqlServer();
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncService.java
new file mode 100644
index 0000000..272f08c
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IHospDataSyncService.java
@@ -0,0 +1,18 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾Service鎺ュ彛
+ *
+ * @author ruoyi
+ */
+public interface IHospDataSyncService
+{
+ /**
+ * 浠嶴QL Server鍚屾鍖婚櫌鏁版嵁鍒癕ySQL
+ *
+ * @return 鍚屾缁撴灉
+ */
+ AjaxResult syncHospData();
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISQLHospDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISQLHospDataService.java
new file mode 100644
index 0000000..9df72b4
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISQLHospDataService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.system.service;
+
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ISQLHospDataService {
+ /**
+ * 鏌ヨ甯哥敤杞叆鍖婚櫌ID鍒楄〃
+ *
+ * @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
+ * @return 甯哥敤杞叆鍖婚櫌ID鍒楄〃
+ */
+ List<Integer> selectFrequentInHospitalIds(@Param("serviceOrdClass") String serviceOrdClass);
+
+ /**
+ * 鏌ヨ甯哥敤杞嚭鍖婚櫌ID鍒楄〃
+ *
+ * @param serviceOrdClass 鍒嗗叕鍙哥紪鐮侊紙service_order_class锛�
+ * @return 甯哥敤杞嚭鍖婚櫌ID鍒楄〃
+ */
+ List<Integer> selectFrequentOutHospitalIds(@Param("serviceOrdClass") String serviceOrdClass);
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITbHospDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITbHospDataService.java
new file mode 100644
index 0000000..79817f9
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITbHospDataService.java
@@ -0,0 +1,69 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.TbHospData;
+
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁Service鎺ュ彛
+ *
+ * @author ruoyi
+ */
+public interface ITbHospDataService
+{
+ /**
+ * 鏌ヨ鍖婚櫌鏁版嵁鍒楄〃
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 鍖婚櫌鏁版嵁闆嗗悎
+ */
+ List<TbHospData> selectTbHospDataList(TbHospData tbHospData);
+
+ /**
+ * 鏍规嵁鍖婚櫌ID鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @param hospId 鍖婚櫌ID
+ * @return 鍖婚櫌鏁版嵁
+ */
+ TbHospData selectTbHospDataById(Long hospId);
+
+ /**
+ * 鏍规嵁鏃х郴缁熷尰闄D鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @param legacyHospId 鏃х郴缁熷尰闄D
+ * @return 鍖婚櫌鏁版嵁
+ */
+ TbHospData selectTbHospDataByLegacyId(Integer legacyHospId);
+
+ /**
+ * 鏂板鍖婚櫌鏁版嵁
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 缁撴灉
+ */
+ int insertTbHospData(TbHospData tbHospData);
+
+ /**
+ * 淇敼鍖婚櫌鏁版嵁
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 缁撴灉
+ */
+ int updateTbHospData(TbHospData tbHospData);
+
+ /**
+ * 鎵归噺鍒犻櫎鍖婚櫌鏁版嵁
+ *
+ * @param hospIds 闇�瑕佸垹闄ょ殑鍖婚櫌鏁版嵁ID
+ * @return 缁撴灉
+ */
+ int deleteTbHospDataByIds(Long[] hospIds);
+
+ /**
+ * 鍒犻櫎鍖婚櫌鏁版嵁淇℃伅
+ *
+ * @param hospId 鍖婚櫌鏁版嵁ID
+ * @return 缁撴灉
+ */
+ int deleteTbHospDataById(Long hospId);
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncDataServiceImpl.java
new file mode 100644
index 0000000..f07ba65
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncDataServiceImpl.java
@@ -0,0 +1,35 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.system.domain.HospDataSyncDTO;
+import com.ruoyi.system.mapper.HospDataSyncMapper;
+import com.ruoyi.system.service.IHospDataSyncDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾鏁版嵁鏌ヨService涓氬姟灞傚鐞嗭紙浠嶴QL Server鏌ヨ锛�
+ *
+ * @author ruoyi
+ */
+@Service
+@DataSource(DataSourceType.SQLSERVER)
+public class HospDataSyncDataServiceImpl implements IHospDataSyncDataService
+{
+ @Autowired
+ private HospDataSyncMapper hospDataSyncMapper;
+
+ /**
+ * 浠嶴QL Server鏌ヨ鎵�鏈夊尰闄㈡暟鎹�
+ *
+ * @return 鍖婚櫌鏁版嵁鍒楄〃
+ */
+ @Override
+ public List<HospDataSyncDTO> selectAllHospDataFromSqlServer()
+ {
+ return hospDataSyncMapper.selectAllHospDataFromSqlServer();
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncServiceImpl.java
new file mode 100644
index 0000000..4c0eb86
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HospDataSyncServiceImpl.java
@@ -0,0 +1,218 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.HospDataSyncDTO;
+import com.ruoyi.system.domain.TbHospData;
+import com.ruoyi.system.service.IHospDataSyncService;
+import com.ruoyi.system.service.IHospDataSyncDataService;
+import com.ruoyi.system.service.ITbHospDataService;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鍖婚櫌鏁版嵁鍚屾Service涓氬姟灞傚鐞�
+ *
+ * @author ruoyi
+ */
+@Service
+public class HospDataSyncServiceImpl implements IHospDataSyncService
+{
+ private static final Logger log = LoggerFactory.getLogger(HospDataSyncServiceImpl.class);
+
+ @Autowired
+ private IHospDataSyncDataService hospDataSyncDataService;
+
+ @Autowired
+ private ITbHospDataService tbHospDataService;
+
+ /**
+ * 浠嶴QL Server鍚屾鍖婚櫌鏁版嵁鍒癕ySQL
+ *
+ * @return 鍚屾缁撴灉
+ */
+ @Override
+ public AjaxResult syncHospData()
+ {
+ try
+ {
+ log.info("寮�濮嬪悓姝ュ尰闄㈡暟鎹�...");
+
+ // 浠嶴QL Server鏌ヨ鎵�鏈夊尰闄㈡暟鎹�
+ List<HospDataSyncDTO> sqlServerHospList = hospDataSyncDataService.selectAllHospDataFromSqlServer();
+
+ if (sqlServerHospList == null || sqlServerHospList.isEmpty())
+ {
+ return AjaxResult.warn("SQL Server涓病鏈夊尰闄㈡暟鎹�");
+ }
+
+ log.info("浠嶴QL Server鏌ヨ鍒� {} 鏉″尰闄㈡暟鎹�", sqlServerHospList.size());
+
+ int insertCount = 0;
+ int updateCount = 0;
+ int skipCount = 0;
+ Map<String, String> errorMessages = new HashMap<>();
+
+ // 閬嶅巻SQL Server鏁版嵁锛屽悓姝ュ埌MySQL
+ for (HospDataSyncDTO dto : sqlServerHospList)
+ {
+ try
+ {
+ // 妫�鏌ュ繀濉瓧娈�
+ if (dto.getHospId() == null || StringUtils.isBlank(dto.getHospName()))
+ {
+ log.warn("鍖婚櫌鏁版嵁涓嶅畬鏁达紝璺宠繃鍚屾: HospID={}, HospName={}",
+ dto.getHospId(), dto.getHospName());
+ skipCount++;
+ continue;
+ }
+
+ // 鏍规嵁鏃х郴缁烮D鏌ヨMySQL涓槸鍚﹀凡瀛樺湪
+ TbHospData existingHosp = tbHospDataService.selectTbHospDataByLegacyId(dto.getHospId());
+
+ if (existingHosp != null)
+ {
+ // 鏇存柊宸叉湁鏁版嵁
+ updateHospData(existingHosp, dto);
+ tbHospDataService.updateTbHospData(existingHosp);
+ updateCount++;
+ log.debug("鏇存柊鍖婚櫌: {} (HospID={})", dto.getHospName(), dto.getHospId());
+ }
+ else
+ {
+ // 鎻掑叆鏂版暟鎹�
+ TbHospData newHosp = convertToTbHospData(dto);
+ tbHospDataService.insertTbHospData(newHosp);
+ insertCount++;
+ log.debug("鏂板鍖婚櫌: {} (HospID={})", dto.getHospName(), dto.getHospId());
+ }
+ }
+ catch (Exception e)
+ {
+ String errorMsg = String.format("鍚屾鍖婚櫌 HospID=%d 澶辫触: %s",
+ dto.getHospId(), e.getMessage());
+ log.error(errorMsg, e);
+ errorMessages.put("HospID_" + dto.getHospId(), errorMsg);
+ }
+ }
+
+ String resultMsg = String.format(
+ "鍖婚櫌鏁版嵁鍚屾瀹屾垚 - 鏂板: %d, 鏇存柊: %d, 璺宠繃: %d, 澶辫触: %d",
+ insertCount, updateCount, skipCount, errorMessages.size());
+
+ log.info(resultMsg);
+
+ Map<String, Object> result = new HashMap<>();
+ result.put("insertCount", insertCount);
+ result.put("updateCount", updateCount);
+ result.put("skipCount", skipCount);
+ result.put("errorCount", errorMessages.size());
+ result.put("errors", errorMessages);
+ result.put("totalProcessed", sqlServerHospList.size());
+
+ if (errorMessages.isEmpty())
+ {
+ return AjaxResult.success(resultMsg, result);
+ }
+ else
+ {
+ return AjaxResult.warn(resultMsg, result);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("鍚屾鍖婚櫌鏁版嵁澶辫触", e);
+ return AjaxResult.error("鍚屾澶辫触: " + e.getMessage());
+ }
+ }
+
+ /**
+ * 灏咲TO杞崲涓哄疄浣撳璞★紙鏂板锛�
+ *
+ * @param dto SQL Server鏁版嵁DTO
+ * @return MySQL瀹炰綋瀵硅薄
+ */
+ private TbHospData convertToTbHospData(HospDataSyncDTO dto)
+ {
+ TbHospData hosp = new TbHospData();
+ hosp.setLegacyHospId(dto.getHospId());
+ hosp.setHospName(dto.getHospName());
+ hosp.setHospCityId(dto.getHospCityId());
+ hosp.setHospShort(dto.getHospShort());
+ hosp.setHopsProvince(dto.getHopsProvince());
+ hosp.setHopsCity(dto.getHopsCity());
+ hosp.setHopsArea(dto.getHopsArea());
+ hosp.setHospAddress(dto.getHospAddress());
+ hosp.setHospTel(dto.getHospTel());
+ hosp.setHospUnitId(dto.getHospUnitId());
+ hosp.setHospState(dto.getHospState());
+ hosp.setHospOaId(dto.getHospOaId());
+ hosp.setHospIntroducerId(dto.getHospIntroducerId());
+ hosp.setHospIntroducerDate(parseDate(dto.getHospIntroducerDate()));
+ hosp.setHospLevel(dto.getHospLevel());
+ hosp.setStatus("0"); // 榛樿姝e父鐘舵��
+ hosp.setCreateBy("sync");
+ hosp.setRemark("浠庢棫绯荤粺鍚屾");
+ return hosp;
+ }
+
+ /**
+ * 鏇存柊鐜版湁鏁版嵁
+ *
+ * @param target MySQL瀹炰綋瀵硅薄
+ * @param source SQL Server鏁版嵁DTO
+ */
+ private void updateHospData(TbHospData target, HospDataSyncDTO source)
+ {
+ target.setHospName(source.getHospName());
+ target.setHospCityId(source.getHospCityId());
+ target.setHospShort(source.getHospShort());
+ target.setHopsProvince(source.getHopsProvince());
+ target.setHopsCity(source.getHopsCity());
+ target.setHopsArea(source.getHopsArea());
+ target.setHospAddress(source.getHospAddress());
+ target.setHospTel(source.getHospTel());
+ target.setHospUnitId(source.getHospUnitId());
+ target.setHospState(source.getHospState());
+ target.setHospOaId(source.getHospOaId());
+ target.setHospIntroducerId(source.getHospIntroducerId());
+ target.setHospIntroducerDate(parseDate(source.getHospIntroducerDate()));
+ target.setHospLevel(source.getHospLevel());
+ target.setUpdateBy("sync");
+ }
+
+ /**
+ * 瑙f瀽鏃ユ湡瀛楃涓�
+ *
+ * @param dateStr 鏃ユ湡瀛楃涓�
+ * @return Date瀵硅薄
+ */
+ private Date parseDate(String dateStr)
+ {
+ if (StringUtils.isBlank(dateStr))
+ {
+ return null;
+ }
+
+ try
+ {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ return sdf.parse(dateStr);
+ }
+ catch (ParseException e)
+ {
+ log.warn("鏃ユ湡瑙f瀽澶辫触: {}", dateStr);
+ return null;
+ }
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacySystemSyncServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacySystemSyncServiceImpl.java
index db1fa94..a58c2c8 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacySystemSyncServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacySystemSyncServiceImpl.java
@@ -11,6 +11,11 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.X509Certificate;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.service.*;
@@ -977,11 +982,20 @@
}
/**
- * 鍙戦�丠TTP POST璇锋眰
+ * 鍙戦�丠TTP/HTTPS POST璇锋眰
+ * 鏀寔HTTPS鑷鍚嶈瘉涔�
*/
private String sendHttpPost(String urlString, Map<String, String> params) throws Exception {
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+
+ // 濡傛灉鏄疕TTPS璇锋眰锛岄厤缃甋SL淇′换鎵�鏈夎瘉涔�
+ if (conn instanceof HttpsURLConnection) {
+ HttpsURLConnection httpsConn = (HttpsURLConnection) conn;
+ httpsConn.setSSLSocketFactory(createTrustAllSSLContext().getSocketFactory());
+ httpsConn.setHostnameVerifier((hostname, session) -> true); // 淇′换鎵�鏈変富鏈哄悕
+ log.debug("閰嶇疆HTTPS杩炴帴锛屼俊浠绘墍鏈塖SL璇佷功锛孶RL: {}", urlString);
+ }
try {
// 璁剧疆杩炴帴灞炴��
@@ -1027,8 +1041,7 @@
}
} else {
log.error("璇锋眰澶辫触锛岃姹俇RL {},鍙傛暟 {}",urlString,postData);
-
- throw new Exception("HTTP璇锋眰澶辫触锛屽搷搴旂爜: " + responseCode);
+ throw new Exception("HTTP/HTTPS璇锋眰澶辫触锛屽搷搴旂爜: " + responseCode);
}
} finally {
@@ -1037,6 +1050,40 @@
}
/**
+ * 鍒涘缓淇′换鎵�鏈塖SL璇佷功鐨凷SLContext
+ * 鐢ㄤ簬鏀寔鑷鍚嶈瘉涔︾殑HTTPS璇锋眰
+ *
+ * 娉ㄦ剰锛氭鏂规硶浼氫俊浠绘墍鏈塖SL璇佷功锛屽寘鎷嚜绛惧悕璇佷功
+ * 浠呯敤浜庝笌鏃х郴缁熺殑鍐呴儴閫氫俊锛岀敓浜х幆澧冨缓璁娇鐢ㄦ瑙凜A璇佷功
+ */
+ private SSLContext createTrustAllSSLContext() throws Exception {
+ // 鍒涘缓淇′换鎵�鏈夎瘉涔︾殑TrustManager
+ TrustManager[] trustAllCerts = new TrustManager[] {
+ new X509TrustManager() {
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ // 淇′换鎵�鏈夊鎴风璇佷功
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ // 淇′换鎵�鏈夋湇鍔″櫒璇佷功
+ }
+ }
+ };
+
+ // 瀹夎淇′换鎵�鏈夎瘉涔︾殑TrustManager
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
+ return sslContext;
+ }
+
+ /**
* 瑙f瀽鏃х郴缁熷搷搴�
* 棰勬湡鏍煎紡: "OK:ServiceOrdID" 鎴栭敊璇俊鎭�
*/
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SQLHospDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SQLHospDataServiceImpl.java
new file mode 100644
index 0000000..67cdec9
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SQLHospDataServiceImpl.java
@@ -0,0 +1,27 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.system.mapper.SQLHospDataMapper;
+import com.ruoyi.system.service.ISQLHospDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+@Service
+@DataSource(DataSourceType.SQLSERVER)
+public class SQLHospDataServiceImpl implements ISQLHospDataService {
+ @Autowired
+ private SQLHospDataMapper sqlHospDataMapper;
+ @Override
+ public List<Integer> selectFrequentInHospitalIds(String serviceOrdClass) {
+ return sqlHospDataMapper.selectFrequentInHospitalIds(serviceOrdClass);
+ }
+
+ @Override
+ public List<Integer> selectFrequentOutHospitalIds(String serviceOrdClass) {
+ return sqlHospDataMapper.selectFrequentOutHospitalIds(serviceOrdClass);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbHospDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbHospDataServiceImpl.java
new file mode 100644
index 0000000..3f19ae7
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbHospDataServiceImpl.java
@@ -0,0 +1,105 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.system.domain.TbHospData;
+import com.ruoyi.system.mapper.TbHospDataMapper;
+import com.ruoyi.system.service.ITbHospDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 鍖婚櫌鏁版嵁Service涓氬姟灞傚鐞�
+ *
+ * @author ruoyi
+ */
+@Service
+public class TbHospDataServiceImpl implements ITbHospDataService
+{
+ @Autowired
+ private TbHospDataMapper tbHospDataMapper;
+
+ /**
+ * 鏌ヨ鍖婚櫌鏁版嵁鍒楄〃
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 鍖婚櫌鏁版嵁
+ */
+ @Override
+ public List<TbHospData> selectTbHospDataList(TbHospData tbHospData)
+ {
+ return tbHospDataMapper.selectTbHospDataList(tbHospData);
+ }
+
+ /**
+ * 鏍规嵁鍖婚櫌ID鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @param hospId 鍖婚櫌ID
+ * @return 鍖婚櫌鏁版嵁
+ */
+ @Override
+ public TbHospData selectTbHospDataById(Long hospId)
+ {
+ return tbHospDataMapper.selectTbHospDataById(hospId);
+ }
+
+ /**
+ * 鏍规嵁鏃х郴缁熷尰闄D鏌ヨ鍖婚櫌鏁版嵁
+ *
+ * @param legacyHospId 鏃х郴缁熷尰闄D
+ * @return 鍖婚櫌鏁版嵁
+ */
+ @Override
+ public TbHospData selectTbHospDataByLegacyId(Integer legacyHospId)
+ {
+ return tbHospDataMapper.selectTbHospDataByLegacyId(legacyHospId);
+ }
+
+ /**
+ * 鏂板鍖婚櫌鏁版嵁
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertTbHospData(TbHospData tbHospData)
+ {
+ return tbHospDataMapper.insertTbHospData(tbHospData);
+ }
+
+ /**
+ * 淇敼鍖婚櫌鏁版嵁
+ *
+ * @param tbHospData 鍖婚櫌鏁版嵁
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateTbHospData(TbHospData tbHospData)
+ {
+ return tbHospDataMapper.updateTbHospData(tbHospData);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎鍖婚櫌鏁版嵁
+ *
+ * @param hospIds 闇�瑕佸垹闄ょ殑鍖婚櫌鏁版嵁ID
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteTbHospDataByIds(Long[] hospIds)
+ {
+ return tbHospDataMapper.deleteTbHospDataByIds(hospIds);
+ }
+
+ /**
+ * 鍒犻櫎鍖婚櫌鏁版嵁淇℃伅
+ *
+ * @param hospId 鍖婚櫌鏁版嵁ID
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteTbHospDataById(Long hospId)
+ {
+ return tbHospDataMapper.deleteTbHospDataById(hospId);
+ }
+}
diff --git a/ruoyi-system/src/main/resources/mapper/system/HospDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/HospDataMapper.xml
index d0de80d..eb79203 100644
--- a/ruoyi-system/src/main/resources/mapper/system/HospDataMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/HospDataMapper.xml
@@ -5,112 +5,146 @@
<mapper namespace="com.ruoyi.system.mapper.HospDataMapper">
<resultMap type="HospData" id="HospDataResult">
- <result property="hospId" column="HospID" />
- <result property="hospName" column="HospName" />
- <result property="hospCityId" column="HospCityID" />
- <result property="hospShort" column="HospShort" />
- <result property="hopsProvince" column="HopsProvince" />
- <result property="hopsCity" column="HopsCity" />
- <result property="hopsArea" column="HopsArea" />
- <result property="hospAddress" column="HospAddress" />
- <result property="hospTel" column="HospTEL" />
- <result property="hospUnitId" column="HospUnitID" />
- <result property="hospState" column="HospState" />
- <result property="hospOaId" column="HospOAID" />
- <result property="hospIntroducerId" column="HospIntroducerID" />
- <result property="hospIntroducerDate" column="HospIntroducerDate" />
- <result property="hospLevel" column="HospLevel" />
+ <result property="hospId" column="legacy_hosp_id" />
+ <result property="hospName" column="hosp_name" />
+ <result property="hospCityId" column="hosp_city_id" />
+ <result property="hospShort" column="hosp_short" />
+ <result property="hopsProvince" column="hops_province" />
+ <result property="hopsCity" column="hops_city" />
+ <result property="hopsArea" column="hops_area" />
+ <result property="hospAddress" column="hosp_address" />
+ <result property="hospTel" column="hosp_tel" />
+ <result property="hospUnitId" column="hosp_unit_id" />
+ <result property="hospState" column="hosp_state" />
+ <result property="hospOaId" column="hosp_oa_id" />
+ <result property="hospIntroducerId" column="hosp_introducer_id" />
+ <result property="hospIntroducerDate" column="hosp_introducer_date" />
+ <result property="hospLevel" column="hosp_level" />
</resultMap>
<select id="searchHospitals" resultMap="HospDataResult">
- SELECT TOP 1000
- HospID, HospName, HospCityID, HospShort,
- HopsProvince, HopsCity, HopsArea, HospAddress,
- HospTEL, HospUnitID, HospState, HospOAID,
- HospIntroducerID, HospIntroducerDate, HospLevel
- FROM HospData
- WHERE 1=1
+ SELECT legacy_hosp_id, hosp_name, hosp_city_id, hosp_short,
+ hops_province, hops_city, hops_area, hosp_address,
+ hosp_tel, hosp_unit_id, hosp_state, hosp_oa_id,
+ hosp_introducer_id, hosp_introducer_date, hosp_level
+ FROM tb_hosp_data
+ WHERE status = '0'
<!-- 鏈� keyword 灏卞彧鐢� keyword锛屼笉鐢� region -->
<if test="keyword != null and keyword != ''">
AND (
- HopsProvince LIKE '%' + #{keyword} + '%'
- OR HopsCity LIKE '%' + #{keyword} + '%'
- OR HopsArea LIKE '%' + #{keyword} + '%'
- OR HospAddress LIKE '%' + #{keyword} + '%'
- OR HospName LIKE '%' + #{keyword} + '%'
- OR HospShort LIKE '%' + #{keyword} + '%'
+ hops_province LIKE CONCAT('%', #{keyword}, '%')
+ OR hops_city LIKE CONCAT('%', #{keyword}, '%')
+ OR hops_area LIKE CONCAT('%', #{keyword}, '%')
+ OR hosp_address LIKE CONCAT('%', #{keyword}, '%')
+ OR hosp_name LIKE CONCAT('%', #{keyword}, '%')
+ OR hosp_short LIKE CONCAT('%', #{keyword}, '%')
)
</if>
<!-- 娌℃湁 keyword 鏃舵墠鐢� region -->
<if test="(keyword == null or keyword == '') and (region != null and region != '')">
AND (
- HopsProvince LIKE '%' + #{region} + '%'
- OR HopsCity LIKE '%' + #{region} + '%'
- OR HopsArea LIKE '%' + #{region} + '%'
- OR HospAddress LIKE '%' + #{region} + '%'
- OR HospName LIKE '%' + #{region} + '%'
- OR HospShort LIKE '%' + #{region} + '%'
+ hops_province LIKE CONCAT('%', #{region}, '%')
+ OR hops_city LIKE CONCAT('%', #{region}, '%')
+ OR hops_area LIKE CONCAT('%', #{region}, '%')
+ OR hosp_address LIKE CONCAT('%', #{region}, '%')
+ OR hosp_name LIKE CONCAT('%', #{region}, '%')
+ OR hosp_short LIKE CONCAT('%', #{region}, '%')
)
</if>
- AND (HospState IS NULL OR HospState = 1)
+ AND (hosp_state IS NULL OR hosp_state = 1)
ORDER BY
- CASE WHEN HospName = '瀹朵腑' THEN 0 ELSE 1 END,
- HospName
+ CASE WHEN hosp_name = '瀹朵腑' THEN 0 ELSE 1 END,
+ hosp_name
</select>
<select id="selectHospDataById" parameterType="Integer" resultMap="HospDataResult">
SELECT
- HospID, HospName, HospCityID, HospShort,
- HopsProvince, HopsCity, HopsArea, HospAddress,
- HospTEL, HospUnitID, HospState, HospOAID,
- HospIntroducerID, HospIntroducerDate, HospLevel
- FROM HospData
- WHERE HospID = #{hospId}
+ legacy_hosp_id, hosp_name, hosp_city_id, hosp_short,
+ hops_province, hops_city, hops_area, hosp_address,
+ hosp_tel, hosp_unit_id, hosp_state, hosp_oa_id,
+ hosp_introducer_id, hosp_introducer_date, hosp_level
+ FROM tb_hosp_data
+ WHERE legacy_hosp_id = #{hospId}
</select>
- <!-- 鏌ヨ甯哥敤杞嚭鍖婚櫌ID鍒楄〃 -->
- <select id="selectFrequentOutHospitalIds" resultType="java.lang.Integer">
- select ServiceOrdPtOutHospID from (
- select ServiceOrdPtOutHospID,count(1) as InCount from ServiceOrder
- where ServiceOrdClass=#{serviceOrdClass} and ServiceOrdPtOutHospID>0
- group by ServiceOrdPtOutHospID
- ) as t
- order by InCount desc
- </select>
+
<select id="getHomeHospId" resultType="java.lang.Integer">
- select HospID from HospData where HospName='瀹朵腑'
+ select legacy_hosp_id from tb_hosp_data where hosp_name='瀹朵腑'
</select>
- <!-- 鏌ヨ甯哥敤杞叆鍖婚櫌ID鍒楄〃 -->
- <select id="selectFrequentInHospitalIds" resultType="java.lang.Integer">
- select ServiceOrdPtInHospID from (
- select ServiceOrdPtInHospID,count(1) as InCount from ServiceOrder
- where ServiceOrdClass=#{serviceOrdClass} and ServiceOrdPtInHospID>0
- group by ServiceOrdPtInHospID
- ) as t
- order by InCount desc
- </select>
-
+
<!-- 鏍规嵁鍖婚櫌ID鍒楄〃鏌ヨ鍖婚櫌淇℃伅 -->
<select id="selectHospDataByIds" resultMap="HospDataResult">
SELECT
- HospID, HospName, HospCityID, HospShort,
- HopsProvince, HopsCity, HopsArea, HospAddress,
- HospTEL, HospUnitID, HospState, HospOAID,
- HospIntroducerID, HospIntroducerDate, HospLevel
- FROM HospData
- WHERE HospID IN
+ legacy_hosp_id, hosp_name, hosp_city_id, hosp_short,
+ hops_province, hops_city, hops_area, hosp_address,
+ hosp_tel, hosp_unit_id, hosp_state, hosp_oa_id,
+ hosp_introducer_id, hosp_introducer_date, hosp_level
+ FROM tb_hosp_data
+ WHERE legacy_hosp_id IN
<foreach collection="hospIds" item="hospId" open="(" separator="," close=")">
#{hospId}
</foreach>
<if test="region != null and region != ''">
AND (
- HopsProvince LIKE '%' + #{region} + '%'
- OR HopsCity LIKE '%' + #{region} + '%'
- OR HopsArea LIKE '%' + #{region} + '%'
+ hops_province LIKE CONCAT('%', #{region}, '%')
+ OR hops_city LIKE CONCAT('%', #{region}, '%')
+ OR hosp_short LIKE CONCAT('%', #{region}, '%')
+ OR hops_area LIKE CONCAT('%', #{region}, '%')
+ OR hosp_address LIKE CONCAT('%', #{region}, '%')
+ OR hosp_name LIKE CONCAT('%', #{region}, '%')
)
</if>
- AND (HospState IS NULL OR HospState = 1)
- ORDER BY HospName
+ AND (hosp_state IS NULL OR hosp_state = 1)
+ ORDER BY hosp_name
+ </select>
+
+ <!-- 鏍规嵁閮ㄩ棬鍖哄煙閰嶇疆鏌ヨ鍖婚櫌锛堟敮鎸佸绾у尯鍩熻繃婊わ級 -->
+ <select id="searchHospitalsByDeptRegion" resultMap="HospDataResult">
+ SELECT DISTINCT
+ h.legacy_hosp_id, h.hosp_name, h.hosp_city_id, h.hosp_short,
+ h.hops_province, h.hops_city, h.hops_area, h.hosp_address,
+ h.hosp_tel, h.hosp_unit_id, h.hosp_state, h.hosp_oa_id,
+ h.hosp_introducer_id, h.hosp_introducer_date, h.hosp_level
+ FROM tb_hosp_data h
+ WHERE (h.hosp_state IS NULL OR h.hosp_state = 1)
+ AND h.status = '0'
+ AND EXISTS (
+ SELECT 1 FROM sys_dept_region r
+ WHERE r.dept_id = #{deptId}
+ AND r.status = '0'
+ AND (
+ -- 鍖哄煙绫诲瀷锛氬湴鍩熻寖鍥村尮閰�
+ (r.region_type = 'AREA' AND (
+ -- 鐪佷唤鍖归厤锛堜负绌哄垯璺宠繃锛�
+ (r.province IS NULL OR r.province = '' OR h.hops_province LIKE CONCAT('%', r.province, '%'))
+ -- 鍩庡競鍖归厤锛堜负绌哄垯璺宠繃锛�
+ AND (r.city IS NULL OR r.city = '' OR h.hops_city LIKE CONCAT('%', r.city, '%'))
+ -- 鍘�/鍖哄尮閰嶏紙涓虹┖鍒欒烦杩囷級
+ AND (r.area IS NULL OR r.area = '' OR h.hops_area LIKE CONCAT('%', r.area, '%'))
+ -- 璇︾粏鍦板潃鍖归厤锛堜负绌哄垯璺宠繃锛�
+ AND (r.address IS NULL OR r.address = '' OR h.hosp_address LIKE CONCAT('%', r.address, '%'))
+ ))
+ -- 鍖哄煙绫诲瀷锛氭寚瀹氬尰闄㈠尮閰�
+ OR (r.region_type = 'HOSPITAL' AND r.hospital_name IS NOT NULL AND r.hospital_name != '' AND (
+ h.hosp_name LIKE CONCAT('%', r.hospital_name, '%')
+ OR h.hosp_short LIKE CONCAT('%', r.hospital_name, '%')
+ ))
+ )
+ )
+ <!-- 鍏抽敭璇嶆悳绱� -->
+ <if test="keyword != null and keyword != ''">
+ AND (
+ h.hops_province LIKE CONCAT('%', #{keyword}, '%')
+ OR h.hops_city LIKE CONCAT('%', #{keyword}, '%')
+ OR h.hops_area LIKE CONCAT('%', #{keyword}, '%')
+ OR h.hosp_address LIKE CONCAT('%', #{keyword}, '%')
+ OR h.hosp_name LIKE CONCAT('%', #{keyword}, '%')
+ OR h.hosp_short LIKE CONCAT('%', #{keyword}, '%')
+ )
+ </if>
+ ORDER BY
+ CASE WHEN h.hosp_name = '瀹朵腑' THEN 0 ELSE 1 END,
+ h.hosp_name
</select>
</mapper>
diff --git a/ruoyi-system/src/main/resources/mapper/system/HospDataSyncMapper.xml b/ruoyi-system/src/main/resources/mapper/system/HospDataSyncMapper.xml
new file mode 100644
index 0000000..6e887fe
--- /dev/null
+++ b/ruoyi-system/src/main/resources/mapper/system/HospDataSyncMapper.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.HospDataSyncMapper">
+
+ <resultMap type="HospDataSyncDTO" id="HospDataSyncResult">
+ <result property="hospId" column="HospID" />
+ <result property="hospName" column="HospName" />
+ <result property="hospCityId" column="HospCityID" />
+ <result property="hospShort" column="HospShort" />
+ <result property="hopsProvince" column="HopsProvince" />
+ <result property="hopsCity" column="HopsCity" />
+ <result property="hopsArea" column="HopsArea" />
+ <result property="hospAddress" column="HospAddress" />
+ <result property="hospTel" column="HospTEL" />
+ <result property="hospUnitId" column="HospUnitID" />
+ <result property="hospState" column="HospState" />
+ <result property="hospOaId" column="HospOAID" />
+ <result property="hospIntroducerId" column="HospIntroducerID" />
+ <result property="hospIntroducerDate" column="HospIntroducerDate" />
+ <result property="hospLevel" column="HospLevel" />
+ </resultMap>
+
+ <!-- 浠嶴QL Server鏌ヨ鎵�鏈夊尰闄㈡暟鎹� -->
+ <select id="selectAllHospDataFromSqlServer" resultMap="HospDataSyncResult">
+ SELECT
+ HospID, HospName, HospCityID, HospShort,
+ HopsProvince, HopsCity, HopsArea, HospAddress,
+ HospTEL, HospUnitID, HospState, HospOAID,
+ HospIntroducerID, HospIntroducerDate, HospLevel
+ FROM HospData
+ WHERE 1=1
+ ORDER BY HospID
+ </select>
+
+</mapper>
diff --git a/ruoyi-system/src/main/resources/mapper/system/SQLHospDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SQLHospDataMapper.xml
new file mode 100644
index 0000000..ec86377
--- /dev/null
+++ b/ruoyi-system/src/main/resources/mapper/system/SQLHospDataMapper.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.SQLHospDataMapper">
+ <!-- 鏌ヨ甯哥敤杞嚭鍖婚櫌ID鍒楄〃 -->
+ <select id="selectFrequentOutHospitalIds" resultType="java.lang.Integer">
+ select ServiceOrdPtOutHospID from (
+ select ServiceOrdPtOutHospID,count(1) as InCount from ServiceOrder
+ where ServiceOrdClass=#{serviceOrdClass} and ServiceOrdPtOutHospID>0
+ group by ServiceOrdPtOutHospID
+ ) as t
+ order by InCount desc
+ </select>
+ <!-- 鏌ヨ甯哥敤杞叆鍖婚櫌ID鍒楄〃 -->
+ <select id="selectFrequentInHospitalIds" resultType="java.lang.Integer">
+ select ServiceOrdPtInHospID from (
+ select ServiceOrdPtInHospID,count(1) as InCount from ServiceOrder
+ where ServiceOrdClass=#{serviceOrdClass} and ServiceOrdPtInHospID>0
+ group by ServiceOrdPtInHospID
+ ) as t
+ order by InCount desc
+ </select>
+
+</mapper>
\ No newline at end of file
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptRegionMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptRegionMapper.xml
new file mode 100644
index 0000000..a6d953e
--- /dev/null
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptRegionMapper.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.SysDeptRegionMapper">
+
+ <resultMap type="SysDeptRegion" id="SysDeptRegionResult">
+ <id property="regionId" column="region_id" />
+ <result property="deptId" column="dept_id" />
+ <result property="province" column="province" />
+ <result property="city" column="city" />
+ <result property="area" column="area" />
+ <result property="address" column="address" />
+ <result property="hospitalName" column="hospital_name" />
+ <result property="regionType" column="region_type" />
+ <result property="status" column="status" />
+ <result property="remark" column="remark" />
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ </resultMap>
+
+ <sql id="selectDeptRegionVo">
+ select region_id, dept_id, province, city, area, address, hospital_name, region_type, status, remark, create_by, create_time, update_by, update_time
+ from sys_dept_region
+ </sql>
+
+ <select id="selectDeptRegionListByDeptId" parameterType="Long" resultMap="SysDeptRegionResult">
+ <include refid="selectDeptRegionVo"/>
+ where dept_id = #{deptId}
+ and status = '0'
+ order by region_id
+ </select>
+
+ <select id="selectDeptRegionListByDeptIds" resultMap="SysDeptRegionResult">
+ <include refid="selectDeptRegionVo"/>
+ where dept_id in
+ <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
+ #{deptId}
+ </foreach>
+ and status = '0'
+ order by dept_id, region_id
+ </select>
+
+ <insert id="insertDeptRegion" parameterType="SysDeptRegion">
+ insert into sys_dept_region(
+ <if test="deptId != null">dept_id,</if>
+ <if test="province != null and province != ''">province,</if>
+ <if test="city != null and city != ''">city,</if>
+ <if test="area != null and area != ''">area,</if>
+ <if test="address != null and address != ''">address,</if>
+ <if test="hospitalName != null and hospitalName != ''">hospital_name,</if>
+ <if test="regionType != null and regionType != ''">region_type,</if>
+ <if test="status != null">status,</if>
+ <if test="remark != null">remark,</if>
+ <if test="createBy != null and createBy != ''">create_by,</if>
+ create_time
+ )values(
+ <if test="deptId != null">#{deptId},</if>
+ <if test="province != null and province != ''">#{province},</if>
+ <if test="city != null and city != ''">#{city},</if>
+ <if test="area != null and area != ''">#{area},</if>
+ <if test="address != null and address != ''">#{address},</if>
+ <if test="hospitalName != null and hospitalName != ''">#{hospitalName},</if>
+ <if test="regionType != null and regionType != ''">#{regionType},</if>
+ <if test="status != null">#{status},</if>
+ <if test="remark != null">#{remark},</if>
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
+ sysdate()
+ )
+ </insert>
+
+ <update id="updateDeptRegion" parameterType="SysDeptRegion">
+ update sys_dept_region
+ <set>
+ <if test="province != null">province = #{province},</if>
+ <if test="city != null">city = #{city},</if>
+ <if test="area != null">area = #{area},</if>
+ <if test="address != null">address = #{address},</if>
+ <if test="hospitalName != null">hospital_name = #{hospitalName},</if>
+ <if test="regionType != null and regionType != ''">region_type = #{regionType},</if>
+ <if test="status != null">status = #{status},</if>
+ <if test="remark != null">remark = #{remark},</if>
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ update_time = sysdate()
+ </set>
+ where region_id = #{regionId}
+ </update>
+
+ <delete id="deleteDeptRegionById" parameterType="Long">
+ delete from sys_dept_region where region_id = #{regionId}
+ </delete>
+
+ <delete id="deleteDeptRegionByDeptId" parameterType="Long">
+ delete from sys_dept_region where dept_id = #{deptId}
+ </delete>
+
+</mapper>
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
index 7db8cae..9a21d7b 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -124,7 +124,7 @@
<select id="selectMaxTaskCodeByDatePrefix" parameterType="String" resultType="String">
select max(task_code)
from sys_task
- where task_code like concat(#{datePrefix}, '%') and del_flag = '0'
+ where task_code like concat(#{datePrefix}, '%')
</select>
<select id="selectOverdueTasks" resultMap="SysTaskResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/TbHospDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TbHospDataMapper.xml
new file mode 100644
index 0000000..050df08
--- /dev/null
+++ b/ruoyi-system/src/main/resources/mapper/system/TbHospDataMapper.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.TbHospDataMapper">
+
+ <resultMap type="TbHospData" id="TbHospDataResult">
+ <id property="hospId" column="hosp_id" />
+ <result property="legacyHospId" column="legacy_hosp_id" />
+ <result property="hospName" column="hosp_name" />
+ <result property="hospCityId" column="hosp_city_id" />
+ <result property="hospShort" column="hosp_short" />
+ <result property="hopsProvince" column="hops_province" />
+ <result property="hopsCity" column="hops_city" />
+ <result property="hopsArea" column="hops_area" />
+ <result property="hospAddress" column="hosp_address" />
+ <result property="hospTel" column="hosp_tel" />
+ <result property="hospUnitId" column="hosp_unit_id" />
+ <result property="hospState" column="hosp_state" />
+ <result property="hospOaId" column="hosp_oa_id" />
+ <result property="hospIntroducerId" column="hosp_introducer_id" />
+ <result property="hospIntroducerDate" column="hosp_introducer_date" />
+ <result property="hospLevel" column="hosp_level" />
+ <result property="status" column="status" />
+ <result property="remark" column="remark" />
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ </resultMap>
+
+ <sql id="selectTbHospDataVo">
+ select hosp_id, legacy_hosp_id, hosp_name, hosp_city_id, hosp_short,
+ hops_province, hops_city, hops_area, hosp_address, hosp_tel,
+ hosp_unit_id, hosp_state, hosp_oa_id, hosp_introducer_id,
+ hosp_introducer_date, hosp_level, status, remark,
+ create_by, create_time, update_by, update_time
+ from tb_hosp_data
+ </sql>
+
+ <select id="selectTbHospDataList" parameterType="TbHospData" resultMap="TbHospDataResult">
+ <include refid="selectTbHospDataVo"/>
+ <where>
+ <if test="legacyHospId != null">
+ and legacy_hosp_id = #{legacyHospId}
+ </if>
+ <if test="hospName != null and hospName != ''">
+ and hosp_name like concat('%', #{hospName}, '%')
+ </if>
+ <if test="hopsProvince != null and hopsProvince != ''">
+ and hops_province like concat('%', #{hopsProvince}, '%')
+ </if>
+ <if test="hopsCity != null and hopsCity != ''">
+ and hops_city like concat('%', #{hopsCity}, '%')
+ </if>
+ <if test="hopsArea != null and hopsArea != ''">
+ and hops_area like concat('%', #{hopsArea}, '%')
+ </if>
+ <if test="status != null and status != ''">
+ and status = #{status}
+ </if>
+ </where>
+ order by hosp_id desc
+ </select>
+
+ <select id="selectTbHospDataById" parameterType="Long" resultMap="TbHospDataResult">
+ <include refid="selectTbHospDataVo"/>
+ where hosp_id = #{hospId}
+ </select>
+
+ <select id="selectTbHospDataByLegacyId" parameterType="Integer" resultMap="TbHospDataResult">
+ <include refid="selectTbHospDataVo"/>
+ where legacy_hosp_id = #{legacyHospId}
+ </select>
+
+ <insert id="insertTbHospData" parameterType="TbHospData" useGeneratedKeys="true" keyProperty="hospId">
+ insert into tb_hosp_data(
+ <if test="legacyHospId != null">legacy_hosp_id,</if>
+ <if test="hospName != null and hospName != ''">hosp_name,</if>
+ <if test="hospCityId != null">hosp_city_id,</if>
+ <if test="hospShort != null">hosp_short,</if>
+ <if test="hopsProvince != null">hops_province,</if>
+ <if test="hopsCity != null">hops_city,</if>
+ <if test="hopsArea != null">hops_area,</if>
+ <if test="hospAddress != null">hosp_address,</if>
+ <if test="hospTel != null">hosp_tel,</if>
+ <if test="hospUnitId != null">hosp_unit_id,</if>
+ <if test="hospState != null">hosp_state,</if>
+ <if test="hospOaId != null">hosp_oa_id,</if>
+ <if test="hospIntroducerId != null">hosp_introducer_id,</if>
+ <if test="hospIntroducerDate != null">hosp_introducer_date,</if>
+ <if test="hospLevel != null">hosp_level,</if>
+ <if test="status != null">status,</if>
+ <if test="remark != null">remark,</if>
+ <if test="createBy != null and createBy != ''">create_by,</if>
+ create_time
+ )values(
+ <if test="legacyHospId != null">#{legacyHospId},</if>
+ <if test="hospName != null and hospName != ''">#{hospName},</if>
+ <if test="hospCityId != null">#{hospCityId},</if>
+ <if test="hospShort != null">#{hospShort},</if>
+ <if test="hopsProvince != null">#{hopsProvince},</if>
+ <if test="hopsCity != null">#{hopsCity},</if>
+ <if test="hopsArea != null">#{hopsArea},</if>
+ <if test="hospAddress != null">#{hospAddress},</if>
+ <if test="hospTel != null">#{hospTel},</if>
+ <if test="hospUnitId != null">#{hospUnitId},</if>
+ <if test="hospState != null">#{hospState},</if>
+ <if test="hospOaId != null">#{hospOaId},</if>
+ <if test="hospIntroducerId != null">#{hospIntroducerId},</if>
+ <if test="hospIntroducerDate != null">#{hospIntroducerDate},</if>
+ <if test="hospLevel != null">#{hospLevel},</if>
+ <if test="status != null">#{status},</if>
+ <if test="remark != null">#{remark},</if>
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
+ sysdate()
+ )
+ </insert>
+
+ <update id="updateTbHospData" parameterType="TbHospData">
+ update tb_hosp_data
+ <set>
+ <if test="legacyHospId != null">legacy_hosp_id = #{legacyHospId},</if>
+ <if test="hospName != null and hospName != ''">hosp_name = #{hospName},</if>
+ <if test="hospCityId != null">hosp_city_id = #{hospCityId},</if>
+ <if test="hospShort != null">hosp_short = #{hospShort},</if>
+ <if test="hopsProvince != null">hops_province = #{hopsProvince},</if>
+ <if test="hopsCity != null">hops_city = #{hopsCity},</if>
+ <if test="hopsArea != null">hops_area = #{hopsArea},</if>
+ <if test="hospAddress != null">hosp_address = #{hospAddress},</if>
+ <if test="hospTel != null">hosp_tel = #{hospTel},</if>
+ <if test="hospUnitId != null">hosp_unit_id = #{hospUnitId},</if>
+ <if test="hospState != null">hosp_state = #{hospState},</if>
+ <if test="hospOaId != null">hosp_oa_id = #{hospOaId},</if>
+ <if test="hospIntroducerId != null">hosp_introducer_id = #{hospIntroducerId},</if>
+ <if test="hospIntroducerDate != null">hosp_introducer_date = #{hospIntroducerDate},</if>
+ <if test="hospLevel != null">hosp_level = #{hospLevel},</if>
+ <if test="status != null">status = #{status},</if>
+ <if test="remark != null">remark = #{remark},</if>
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ update_time = sysdate()
+ </set>
+ where hosp_id = #{hospId}
+ </update>
+
+ <delete id="deleteTbHospDataById" parameterType="Long">
+ delete from tb_hosp_data where hosp_id = #{hospId}
+ </delete>
+
+ <delete id="deleteTbHospDataByIds" parameterType="Long">
+ delete from tb_hosp_data where hosp_id in
+ <foreach collection="array" item="hospId" open="(" separator="," close=")">
+ #{hospId}
+ </foreach>
+ </delete>
+
+</mapper>
diff --git a/ruoyi-system/src/test/java/com/ruoyi/system/service/LegacySystemHttpsTest.java b/ruoyi-system/src/test/java/com/ruoyi/system/service/LegacySystemHttpsTest.java
new file mode 100644
index 0000000..24d0af8
--- /dev/null
+++ b/ruoyi-system/src/test/java/com/ruoyi/system/service/LegacySystemHttpsTest.java
@@ -0,0 +1,260 @@
+package com.ruoyi.system.service;
+
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 鏃х郴缁烪TTPS鎺ュ彛娴嬭瘯
+ * 娴嬭瘯admin_save_19.gds鎺ュ彛璋冪敤
+ *
+ * @author ruoyi
+ * @date 2025-11-09
+ */
+public class LegacySystemHttpsTest {
+
+ private static final Logger log = LoggerFactory.getLogger(LegacySystemHttpsTest.class);
+
+ /**
+ * 娴嬭瘯璋冪敤admin_save_19.gds鎺ュ彛锛堝垱寤烘湇鍔″崟锛�
+ */
+ @Test
+ public void testCreateServiceOrder() {
+ try {
+ String url = "https://sys.966120.com.cn/admin_save_19.gds";
+
+ // 鏋勫缓璇锋眰鍙傛暟
+ Map<String, String> params = buildTestParams();
+
+ // 鍙戦�佽姹�
+ String response = sendHttpsPost(url, params);
+
+ // 杈撳嚭鍝嶅簲
+ log.info("鎺ュ彛鍝嶅簲锛歿}", response);
+ System.out.println("鎺ュ彛鍝嶅簲锛�" + response);
+
+ // 瑙f瀽鍝嶅簲
+ if (response != null && response.startsWith("OK:")) {
+ String serviceOrdId = response.substring(3).trim();
+ log.info("鏈嶅姟鍗曞垱寤烘垚鍔燂紝ServiceOrdID: {}", serviceOrdId);
+ System.out.println("鉁� 鏈嶅姟鍗曞垱寤烘垚鍔燂紝ServiceOrdID: " + serviceOrdId);
+ } else {
+ log.error("鏈嶅姟鍗曞垱寤哄け璐ワ紝鍝嶅簲: {}", response);
+ System.out.println("鉂� 鏈嶅姟鍗曞垱寤哄け璐ワ紝鍝嶅簲: " + response);
+ }
+
+ } catch (Exception e) {
+ log.error("娴嬭瘯寮傚父", e);
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 鏋勫缓娴嬭瘯鍙傛暟
+ */
+ private Map<String, String> buildTestParams() {
+ Map<String, String> params = new HashMap<>();
+
+ // 鍩虹淇℃伅
+ params.put("adminID", "1312");
+ params.put("ServiceOrdClass", "BF");
+ params.put("ServiceOrdAreaType", "1");
+ params.put("ServiceOrdType", "20");
+ params.put("ServiceOrdState", "2");
+ params.put("ServiceOrdStartDate", "2025-11-09");
+
+ // 棰勭害鏃堕棿
+ params.put("ServiceOrdApptDate", "2025-11-09 16:56:31");
+
+ // 鑱旂郴浜轰俊鎭�
+ params.put("ServiceOrdCoName", "鏉庢祴璇�11");
+ params.put("ServiceOrdCoPhone", "13602220102");
+ params.put("ServiceOrdCoTies", "");
+
+ // 鎮h�呬俊鎭�
+ params.put("ServiceOrdPtName", "鏉庢祴璇�21");
+ params.put("ServiceOrdPtAge", "");
+ params.put("ServiceOrdPtKG", "");
+ params.put("ServiceOrdPtSex", "");
+ params.put("ServiceOrdPtNat", "");
+ params.put("ServiceOrdPtIDCard", "");
+
+ // 鍖婚櫌淇℃伅
+ params.put("ServiceOrdPtOutHosp", "骞夸笢鐪佺浜屼汉姘戝尰闄㈠ぉ娌冲尰闄�(骞夸笢鐕曞箔鍖婚櫌)");
+ params.put("ServiceOrdPtOutHospID", "310");
+ params.put("ServiceOrdPtInHosp", "瀹朵腑");
+ params.put("ServiceOrdPtInHospID", "153");
+
+ // 绉戝淇℃伅
+ params.put("ServiceOrdPtServices", "鍏朵粬");
+ params.put("ServiceOrdPtServicesID", "22");
+ params.put("ServiceOrdPtInServices", "鍏朵粬");
+ params.put("ServiceOrdPtInServicesID", "0");
+
+ // 鐥呮儏淇℃伅
+ params.put("ServiceOrdPtDiagnosis", "");
+ params.put("ServiceOrdPtCondition", "");
+ params.put("ServiceOrdTaskRemarks", "");
+ params.put("ServiceOrdPtDoctor", "");
+ params.put("ServiceOrdPtDoctorPhone", "");
+
+ // 鍦板潃淇℃伅
+ params.put("province", "");
+ params.put("city", "");
+ params.put("ServiceOrdTraStreet", "骞夸笢鐪佸箍宸炲競澶╂渤鍖烘瀹夎矾533鍙�");
+ params.put("ServiceOrdTraStreetCoo", "");
+ params.put("ServiceOrdTraEnd", "澶╂渤鍖哄箍宸炲競-澶╂渤鍖�-鏌忓痉璺�101鍙�");
+ params.put("ServiceOrdTraEndCoo", "");
+ params.put("ServiceOrdTraVia", "");
+
+ // 璺濈鍜屼环鏍间俊鎭�
+ params.put("ServiceOrdViaDistance", "0");
+ params.put("ServiceOrdTraDistance", "10.70");
+ params.put("ServiceOrdTraDuration", "");
+ params.put("ServiceOrdTraUnitPrice", "0");
+ params.put("ServiceOrdTraOfferPrice", "154.00");
+ params.put("ServiceOrdTraTxnPrice", "154.00");
+ params.put("ServiceOrdTraPrePayment", "0");
+ params.put("SettlementPrice", "0");
+ params.put("ServiceOrdTraPriceReason", "");
+
+ // 鍏朵粬淇℃伅
+ params.put("Phone", "13602220102");
+ params.put("TEL_Time", "2025-11-09 16:58:21");
+ params.put("TEL_Remarks", "鏂扮郴缁熷悓姝�");
+ params.put("TransferModeID", "");
+ params.put("ServiceOrdVIP", "0");
+ params.put("ServiceOrd_CC_ID", "");
+ params.put("ServiceOrd_Sale_ID", "");
+ params.put("ServiceOrdIntroducer", "");
+ params.put("ServiceOrd_work_ID", "");
+ params.put("ServiceOrd_work_IDs", "");
+ params.put("ServiceOrd_work_is", "0");
+ params.put("CommissionScenarioID", "0");
+ params.put("ServiceOrdOperationRemarks", "鏂扮郴缁熷悓姝ュ垱寤�");
+ params.put("ServiceOrdEstimatedOrderDate", "");
+ params.put("ServiceOrdSource", "10");
+ params.put("OrderLevel", "0");
+ params.put("ServiceOrdDepartureType", "1");
+ params.put("ConditionLevel", "0");
+ params.put("DirectionType", "0");
+ params.put("ServiceOrd_m", "1");
+ params.put("FromHQ2_is", "0");
+ params.put("OrderPrice_Auto", "0");
+
+ return params;
+ }
+
+ /**
+ * 鍙戦�丠TTPS POST璇锋眰锛堝拷鐣SL璇佷功楠岃瘉锛�
+ */
+ private String sendHttpsPost(String urlString, Map<String, String> params) throws Exception {
+ URL url = new URL(urlString);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+
+ // 濡傛灉鏄疕TTPS璇锋眰锛岄厤缃甋SL淇′换鎵�鏈夎瘉涔�
+ if (conn instanceof HttpsURLConnection) {
+ HttpsURLConnection httpsConn = (HttpsURLConnection) conn;
+ httpsConn.setSSLSocketFactory(createTrustAllSSLContext().getSocketFactory());
+ httpsConn.setHostnameVerifier((hostname, session) -> true);
+ log.info("閰嶇疆HTTPS杩炴帴锛屼俊浠绘墍鏈塖SL璇佷功");
+ }
+
+ try {
+ // 璁剧疆杩炴帴灞炴��
+ conn.setRequestMethod("POST");
+ conn.setConnectTimeout(30000);
+ conn.setReadTimeout(60000);
+ conn.setDoOutput(true);
+ conn.setDoInput(true);
+ conn.setUseCaches(false);
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=GBK");
+ conn.setRequestProperty("Accept-Charset", "GBK");
+ conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
+
+ // 鏋勫缓POST鏁版嵁
+ StringBuilder postData = new StringBuilder();
+ for (Map.Entry<String, String> entry : params.entrySet()) {
+ if (postData.length() > 0) {
+ postData.append("&");
+ }
+ postData.append(URLEncoder.encode(entry.getKey(), "GBK"));
+ postData.append("=");
+ postData.append(URLEncoder.encode(entry.getValue(), "GBK"));
+ }
+
+ log.info("璇锋眰URL: {}", urlString);
+ log.info("璇锋眰鍙傛暟闀垮害: {}", postData.length());
+
+ // 鍙戦�丳OST鏁版嵁
+ try (OutputStream os = conn.getOutputStream()) {
+ os.write(postData.toString().getBytes("GBK"));
+ os.flush();
+ }
+
+ // 璇诲彇鍝嶅簲
+ int responseCode = conn.getResponseCode();
+ log.info("鍝嶅簲鐮�: {}", responseCode);
+
+ if (responseCode == HttpURLConnection.HTTP_OK) {
+ try (BufferedReader reader = new BufferedReader(
+ new InputStreamReader(conn.getInputStream(), "GBK"))) {
+ StringBuilder response = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ response.append(line);
+ }
+ return response.toString().trim();
+ }
+ } else {
+ log.error("璇锋眰澶辫触锛屽搷搴旂爜: {}", responseCode);
+ throw new Exception("HTTPS璇锋眰澶辫触锛屽搷搴旂爜: " + responseCode);
+ }
+
+ } finally {
+ conn.disconnect();
+ }
+ }
+
+ /**
+ * 鍒涘缓淇′换鎵�鏈塖SL璇佷功鐨凷SLContext
+ */
+ private SSLContext createTrustAllSSLContext() throws Exception {
+ TrustManager[] trustAllCerts = new TrustManager[] {
+ new X509TrustManager() {
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ // 淇′换鎵�鏈夊鎴风璇佷功
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ // 淇′换鎵�鏈夋湇鍔″櫒璇佷功
+ }
+ }
+ };
+
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
+ return sslContext;
+ }
+}
diff --git a/ruoyi-ui/src/api/system/deptRegion.js b/ruoyi-ui/src/api/system/deptRegion.js
new file mode 100644
index 0000000..7db7c54
--- /dev/null
+++ b/ruoyi-ui/src/api/system/deptRegion.js
@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+// 鏌ヨ閮ㄩ棬鍖哄煙鍒楄〃
+export function listDeptRegion(deptId) {
+ return request({
+ url: '/system/dept/region/list/' + deptId,
+ method: 'get'
+ })
+}
+
+// 鏂板閮ㄩ棬鍖哄煙
+export function addDeptRegion(data) {
+ return request({
+ url: '/system/dept/region',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼閮ㄩ棬鍖哄煙
+export function updateDeptRegion(data) {
+ return request({
+ url: '/system/dept/region',
+ method: 'put',
+ data: data
+ })
+}
+
+// 鍒犻櫎閮ㄩ棬鍖哄煙
+export function delDeptRegion(regionId) {
+ return request({
+ url: '/system/dept/region/' + regionId,
+ method: 'delete'
+ })
+}
diff --git a/ruoyi-ui/src/api/system/hosp.js b/ruoyi-ui/src/api/system/hosp.js
new file mode 100644
index 0000000..4999c83
--- /dev/null
+++ b/ruoyi-ui/src/api/system/hosp.js
@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 鏌ヨ鍖婚櫌鏁版嵁鍒楄〃
+export function listHosp(query) {
+ return request({
+ url: '/system/hosp/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 鏌ヨ鍖婚櫌鏁版嵁璇︾粏
+export function getHosp(hospId) {
+ return request({
+ url: '/system/hosp/' + hospId,
+ method: 'get'
+ })
+}
+
+// 鏂板鍖婚櫌鏁版嵁
+export function addHosp(data) {
+ return request({
+ url: '/system/hosp',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼鍖婚櫌鏁版嵁
+export function updateHosp(data) {
+ return request({
+ url: '/system/hosp',
+ method: 'put',
+ data: data
+ })
+}
+
+// 鍒犻櫎鍖婚櫌鏁版嵁
+export function delHosp(hospId) {
+ return request({
+ url: '/system/hosp/' + hospId,
+ method: 'delete'
+ })
+}
+
+// 鍚屾鍖婚櫌鏁版嵁
+export function syncHosp() {
+ return request({
+ url: '/system/hosp/sync',
+ method: 'post'
+ })
+}
diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue
index 2d72209..e2693e2 100644
--- a/ruoyi-ui/src/views/system/dept/index.vue
+++ b/ruoyi-ui/src/views/system/dept/index.vue
@@ -104,6 +104,13 @@
v-hasPermi="['system:dept:add']"
>鏂板</el-button>
<el-button
+ size="mini"
+ type="text"
+ icon="el-icon-location"
+ @click="handleManageRegion(scope.row)"
+ v-hasPermi="['system:dept:edit']"
+ >绠$悊鍖哄煙</el-button>
+ <el-button
v-if="scope.row.parentId != 0"
size="mini"
type="text"
@@ -114,6 +121,92 @@
</template>
</el-table-column>
</el-table>
+
+ <!-- 绠$悊鍖哄煙瀵硅瘽妗� -->
+ <el-dialog title="绠$悊鍖哄煙" :visible.sync="regionDialogVisible" width="900px" append-to-body>
+ <div style="margin-bottom: 10px;">
+ <el-button type="primary" icon="el-icon-plus" size="small" @click="handleAddRegion">鏂板鍖哄煙</el-button>
+ </div>
+
+ <el-table :data="regionList" border>
+ <el-table-column label="鍖哄煙绫诲瀷" align="center" width="120">
+ <template slot-scope="scope">
+ <el-tag v-if="scope.row.regionType === 'AREA'" type="success">鍦板煙鑼冨洿</el-tag>
+ <el-tag v-else-if="scope.row.regionType === 'HOSPITAL'" type="primary">鎸囧畾鍖婚櫌</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐪佷唤" prop="province" align="center" width="100" />
+ <el-table-column label="鍩庡競" prop="city" align="center" width="100" />
+ <el-table-column label="鍘�/鍖�" prop="area" align="center" width="100" />
+ <el-table-column label="璇︾粏鍦板潃" prop="address" align="center" show-overflow-tooltip />
+ <el-table-column label="鎸囧畾鍖婚櫌" prop="hospitalName" align="center" show-overflow-tooltip />
+ <el-table-column label="鐘舵��" align="center" width="80">
+ <template slot-scope="scope">
+ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" align="center" width="150">
+ <template slot-scope="scope">
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditRegion(scope.row)">缂栬緫</el-button>
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteRegion(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="regionDialogVisible = false">鍏� 闂�</el-button>
+ </div>
+ </el-dialog>
+
+ <!-- 娣诲姞鎴栦慨鏀瑰尯鍩熷璇濇 -->
+ <el-dialog :title="regionFormTitle" :visible.sync="regionFormVisible" width="600px" append-to-body>
+ <el-form ref="regionForm" :model="regionForm" :rules="regionRules" label-width="100px">
+ <el-form-item label="鍖哄煙绫诲瀷" prop="regionType">
+ <el-radio-group v-model="regionForm.regionType" @change="handleRegionTypeChange">
+ <el-radio label="AREA">鍦板煙鑼冨洿</el-radio>
+ <el-radio label="HOSPITAL">鎸囧畾鍖婚櫌</el-radio>
+ </el-radio-group>
+ </el-form-item>
+
+ <!-- 鍦板煙鑼冨洿閰嶇疆 -->
+ <div v-if="regionForm.regionType === 'AREA'">
+ <el-form-item label="鐪佷唤" prop="province">
+ <el-input v-model="regionForm.province" placeholder="璇疯緭鍏ョ渷浠斤紝濡傦細骞夸笢鐪�" />
+ </el-form-item>
+ <el-form-item label="鍩庡競" prop="city">
+ <el-input v-model="regionForm.city" placeholder="璇疯緭鍏ュ煄甯傦紝濡傦細娣卞湷甯�" />
+ </el-form-item>
+ <el-form-item label="鍘�/鍖�" prop="area">
+ <el-input v-model="regionForm.area" placeholder="璇疯緭鍏ュ幙/鍖猴紝濡傦細鍗楀北鍖�" />
+ </el-form-item>
+ <el-form-item label="璇︾粏鍦板潃" prop="address">
+ <el-input v-model="regionForm.address" type="textarea" placeholder="璇疯緭鍏ヨ缁嗗湴鍧�鎴栧叧閿瘝" :rows="3" />
+ </el-form-item>
+ </div>
+
+ <!-- 鎸囧畾鍖婚櫌閰嶇疆 -->
+ <div v-if="regionForm.regionType === 'HOSPITAL'">
+ <el-form-item label="鍖婚櫌鍚嶇О" prop="hospitalName">
+ <el-input v-model="regionForm.hospitalName" placeholder="璇疯緭鍏ュ尰闄㈠悕绉版垨鍏抽敭璇�" />
+ </el-form-item>
+ </div>
+
+ <el-form-item label="鐘舵��" prop="status">
+ <el-radio-group v-model="regionForm.status">
+ <el-radio label="0">姝e父</el-radio>
+ <el-radio label="1">鍋滅敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="regionForm.remark" type="textarea" placeholder="璇疯緭鍏ュ娉�" :rows="2" />
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitRegionForm">纭� 瀹�</el-button>
+ <el-button @click="regionFormVisible = false">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
<!-- 娣诲姞鎴栦慨鏀归儴闂ㄥ璇濇 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
@@ -197,6 +290,7 @@
<script>
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
+import { listDeptRegion, addDeptRegion, updateDeptRegion, delDeptRegion } from "@/api/system/deptRegion";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -231,6 +325,21 @@
},
// 琛ㄥ崟鍙傛暟
form: {},
+ // 鍖哄煙绠$悊鐩稿叧
+ regionDialogVisible: false,
+ currentDept: null,
+ regionList: [],
+ regionFormVisible: false,
+ regionFormTitle: '',
+ regionForm: {},
+ regionRules: {
+ regionType: [
+ { required: true, message: "鍖哄煙绫诲瀷涓嶈兘涓虹┖", trigger: "change" }
+ ],
+ status: [
+ { required: true, message: "鐘舵�佷笉鑳戒负绌�", trigger: "change" }
+ ]
+ },
// 琛ㄥ崟鏍¢獙
rules: {
parentId: [
@@ -397,6 +506,87 @@
this.getList();
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
+ },
+ /** 绠$悊鍖哄煙鎸夐挳鎿嶄綔 */
+ handleManageRegion(row) {
+ this.currentDept = row;
+ this.regionDialogVisible = true;
+ this.loadRegionList();
+ },
+ /** 鍔犺浇鍖哄煙鍒楄〃 */
+ loadRegionList() {
+ if (!this.currentDept) return;
+ listDeptRegion(this.currentDept.deptId).then(response => {
+ this.regionList = response.data;
+ });
+ },
+ /** 鏂板鍖哄煙 */
+ handleAddRegion() {
+ this.resetRegionForm();
+ this.regionFormTitle = "鏂板鍖哄煙";
+ this.regionFormVisible = true;
+ },
+ /** 缂栬緫鍖哄煙 */
+ handleEditRegion(row) {
+ this.regionForm = { ...row };
+ this.regionFormTitle = "缂栬緫鍖哄煙";
+ this.regionFormVisible = true;
+ },
+ /** 鍒犻櫎鍖哄煙 */
+ handleDeleteRegion(row) {
+ this.$modal.confirm('鏄惁纭鍒犻櫎璇ュ尯鍩熼厤缃紵').then(() => {
+ return delDeptRegion(row.regionId);
+ }).then(() => {
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ this.loadRegionList();
+ }).catch(() => {});
+ },
+ /** 閲嶇疆鍖哄煙琛ㄥ崟 */
+ resetRegionForm() {
+ this.regionForm = {
+ regionId: undefined,
+ deptId: this.currentDept.deptId,
+ regionType: 'AREA',
+ province: '',
+ city: '',
+ area: '',
+ address: '',
+ hospitalName: '',
+ status: '0',
+ remark: ''
+ };
+ this.resetForm("regionForm");
+ },
+ /** 鍖哄煙绫诲瀷鍒囨崲 */
+ handleRegionTypeChange(value) {
+ if (value === 'AREA') {
+ this.regionForm.hospitalName = '';
+ } else if (value === 'HOSPITAL') {
+ this.regionForm.province = '';
+ this.regionForm.city = '';
+ this.regionForm.area = '';
+ this.regionForm.address = '';
+ }
+ },
+ /** 鎻愪氦鍖哄煙琛ㄥ崟 */
+ submitRegionForm() {
+ this.$refs["regionForm"].validate(valid => {
+ if (valid) {
+ if (this.regionForm.regionId) {
+ updateDeptRegion(this.regionForm).then(response => {
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ this.regionFormVisible = false;
+ this.loadRegionList();
+ });
+ } else {
+ addDeptRegion(this.regionForm).then(response => {
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ this.regionFormVisible = false;
+ this.loadRegionList();
+ });
+ }
+ }
+ });
}
}
};
diff --git a/ruoyi-ui/src/views/system/hosp/index.vue b/ruoyi-ui/src/views/system/hosp/index.vue
new file mode 100644
index 0000000..a57cda9
--- /dev/null
+++ b/ruoyi-ui/src/views/system/hosp/index.vue
@@ -0,0 +1,411 @@
+<template>
+ <div class="app-container">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
+ <el-form-item label="鍖婚櫌鍚嶇О" prop="hospName">
+ <el-input
+ v-model="queryParams.hospName"
+ placeholder="璇疯緭鍏ュ尰闄㈠悕绉�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鐪佷唤" prop="hopsProvince">
+ <el-input
+ v-model="queryParams.hopsProvince"
+ placeholder="璇疯緭鍏ョ渷浠�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鍩庡競" prop="hopsCity">
+ <el-input
+ v-model="queryParams.hopsCity"
+ placeholder="璇疯緭鍏ュ煄甯�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鍖哄煙" prop="hopsArea">
+ <el-input
+ v-model="queryParams.hopsArea"
+ placeholder="璇疯緭鍏ュ尯鍩�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鐘舵��" prop="status">
+ <el-select v-model="queryParams.status" placeholder="鍖婚櫌鐘舵��" clearable>
+ <el-option
+ v-for="dict in dict.type.sys_normal_disable"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
+
+ <el-row :gutter="10" class="mb8">
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-plus"
+ size="mini"
+ @click="handleAdd"
+ v-hasPermi="['system:hosp:add']"
+ >鏂板</el-button>
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-edit"
+ size="mini"
+ :disabled="single"
+ @click="handleUpdate"
+ v-hasPermi="['system:hosp:edit']"
+ >淇敼</el-button>
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="danger"
+ plain
+ icon="el-icon-delete"
+ size="mini"
+ :disabled="multiple"
+ @click="handleDelete"
+ v-hasPermi="['system:hosp:remove']"
+ >鍒犻櫎</el-button>
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-download"
+ size="mini"
+ @click="handleExport"
+ v-hasPermi="['system:hosp:export']"
+ >瀵煎嚭</el-button>
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-refresh"
+ size="mini"
+ @click="handleSync"
+ v-hasPermi="['system:hosp:sync']"
+ :loading="syncing"
+ >鍚屾鏁版嵁</el-button>
+ </el-col>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+ </el-row>
+
+ <el-table v-loading="loading" :data="hospList" @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column label="鍖婚櫌ID" align="center" prop="hospId" width="80" />
+ <el-table-column label="鏃х郴缁烮D" align="center" prop="legacyHospId" width="100" />
+ <el-table-column label="鍖婚櫌鍚嶇О" align="center" prop="hospName" :show-overflow-tooltip="true" min-width="180" />
+ <el-table-column label="鍖婚櫌绠�绉�" align="center" prop="hospShort" :show-overflow-tooltip="true" width="120" />
+ <el-table-column label="鐪佷唤" align="center" prop="hopsProvince" width="100" />
+ <el-table-column label="鍩庡競" align="center" prop="hopsCity" width="100" />
+ <el-table-column label="鍖哄煙" align="center" prop="hopsArea" width="100" />
+ <el-table-column label="鍖婚櫌鍦板潃" align="center" prop="hospAddress" :show-overflow-tooltip="true" min-width="200" />
+ <el-table-column label="鑱旂郴鐢佃瘽" align="center" prop="hospTel" width="120" />
+ <el-table-column label="鐘舵��" align="center" prop="status" width="80">
+ <template slot-scope="scope">
+ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" width="180">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-edit"
+ @click="handleUpdate(scope.row)"
+ v-hasPermi="['system:hosp:edit']"
+ >淇敼</el-button>
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="handleDelete(scope.row)"
+ v-hasPermi="['system:hosp:remove']"
+ >鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <pagination
+ v-show="total>0"
+ :total="total"
+ :page.sync="queryParams.pageNum"
+ :limit.sync="queryParams.pageSize"
+ @pagination="getList"
+ />
+
+ <!-- 娣诲姞鎴栦慨鏀瑰尰闄㈡暟鎹璇濇 -->
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鍖婚櫌鍚嶇О" prop="hospName">
+ <el-input v-model="form.hospName" placeholder="璇疯緭鍏ュ尰闄㈠悕绉�" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍖婚櫌绠�绉�" prop="hospShort">
+ <el-input v-model="form.hospShort" placeholder="璇疯緭鍏ュ尰闄㈢畝绉�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鐪佷唤" prop="hopsProvince">
+ <el-input v-model="form.hopsProvince" placeholder="璇疯緭鍏ョ渷浠�" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍩庡競" prop="hopsCity">
+ <el-input v-model="form.hopsCity" placeholder="璇疯緭鍏ュ煄甯�" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍖哄煙" prop="hopsArea">
+ <el-input v-model="form.hopsArea" placeholder="璇疯緭鍏ュ尯鍩�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="鍖婚櫌鍦板潃" prop="hospAddress">
+ <el-input v-model="form.hospAddress" placeholder="璇疯緭鍏ュ尰闄㈠湴鍧�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴鐢佃瘽" prop="hospTel">
+ <el-input v-model="form.hospTel" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍖婚櫌绾у埆" prop="hospLevel">
+ <el-input-number v-model="form.hospLevel" :min="0" :max="5" placeholder="璇疯緭鍏ュ尰闄㈢骇鍒�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鏃х郴缁烮D" prop="legacyHospId">
+ <el-input-number v-model="form.legacyHospId" :disabled="form.hospId != undefined" placeholder="鏃х郴缁熷尰闄D" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐘舵��" prop="status">
+ <el-radio-group v-model="form.status">
+ <el-radio
+ v-for="dict in dict.type.sys_normal_disable"
+ :key="dict.value"
+ :label="dict.value"
+ >{{dict.label}}</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+ <el-button @click="cancel">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { listHosp, getHosp, delHosp, addHosp, updateHosp, syncHosp } from "@/api/system/hosp";
+
+export default {
+ name: "Hosp",
+ dicts: ['sys_normal_disable'],
+ data() {
+ return {
+ // 閬僵灞�
+ loading: true,
+ // 鍚屾鍔犺浇鐘舵��
+ syncing: false,
+ // 閫変腑鏁扮粍
+ ids: [],
+ // 闈炲崟涓鐢�
+ single: true,
+ // 闈炲涓鐢�
+ multiple: true,
+ // 鏄剧ず鎼滅储鏉′欢
+ showSearch: true,
+ // 鎬绘潯鏁�
+ total: 0,
+ // 鍖婚櫌鏁版嵁琛ㄦ牸鏁版嵁
+ hospList: [],
+ // 寮瑰嚭灞傛爣棰�
+ title: "",
+ // 鏄惁鏄剧ず寮瑰嚭灞�
+ open: false,
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ hospName: null,
+ hopsProvince: null,
+ hopsCity: null,
+ hopsArea: null,
+ status: null
+ },
+ // 琛ㄥ崟鍙傛暟
+ form: {},
+ // 琛ㄥ崟鏍¢獙
+ rules: {
+ hospName: [
+ { required: true, message: "鍖婚櫌鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
+ ]
+ }
+ };
+ },
+ created() {
+ this.getList();
+ },
+ methods: {
+ /** 鏌ヨ鍖婚櫌鏁版嵁鍒楄〃 */
+ getList() {
+ this.loading = true;
+ listHosp(this.queryParams).then(response => {
+ this.hospList = response.rows;
+ this.total = response.total;
+ this.loading = false;
+ });
+ },
+ // 鍙栨秷鎸夐挳
+ cancel() {
+ this.open = false;
+ this.reset();
+ },
+ // 琛ㄥ崟閲嶇疆
+ reset() {
+ this.form = {
+ hospId: null,
+ legacyHospId: null,
+ hospName: null,
+ hospCityId: null,
+ hospShort: null,
+ hopsProvince: null,
+ hopsCity: null,
+ hopsArea: null,
+ hospAddress: null,
+ hospTel: null,
+ hospUnitId: null,
+ hospState: null,
+ hospOaId: null,
+ hospIntroducerId: null,
+ hospIntroducerDate: null,
+ hospLevel: null,
+ status: "0",
+ remark: null
+ };
+ this.resetForm("form");
+ },
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ handleQuery() {
+ this.queryParams.pageNum = 1;
+ this.getList();
+ },
+ /** 閲嶇疆鎸夐挳鎿嶄綔 */
+ resetQuery() {
+ this.resetForm("queryForm");
+ this.handleQuery();
+ },
+ // 澶氶�夋閫変腑鏁版嵁
+ handleSelectionChange(selection) {
+ this.ids = selection.map(item => item.hospId)
+ this.single = selection.length !== 1
+ this.multiple = !selection.length
+ },
+ /** 鏂板鎸夐挳鎿嶄綔 */
+ handleAdd() {
+ this.reset();
+ this.open = true;
+ this.title = "娣诲姞鍖婚櫌鏁版嵁";
+ },
+ /** 淇敼鎸夐挳鎿嶄綔 */
+ handleUpdate(row) {
+ this.reset();
+ const hospId = row.hospId || this.ids
+ getHosp(hospId).then(response => {
+ this.form = response.data;
+ this.open = true;
+ this.title = "淇敼鍖婚櫌鏁版嵁";
+ });
+ },
+ /** 鎻愪氦鎸夐挳 */
+ submitForm() {
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ if (this.form.hospId != null) {
+ updateHosp(this.form).then(response => {
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ this.open = false;
+ this.getList();
+ });
+ } else {
+ addHosp(this.form).then(response => {
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ this.open = false;
+ this.getList();
+ });
+ }
+ }
+ });
+ },
+ /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+ handleDelete(row) {
+ const hospIds = row.hospId || this.ids;
+ this.$modal.confirm('鏄惁纭鍒犻櫎鍖婚櫌鏁版嵁缂栧彿涓�"' + hospIds + '"鐨勬暟鎹」锛�').then(function() {
+ return delHosp(hospIds);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).catch(() => {});
+ },
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ handleExport() {
+ this.download('system/hosp/export', {
+ ...this.queryParams
+ }, `hosp_${new Date().getTime()}.xlsx`)
+ },
+ /** 鍚屾鏁版嵁鎸夐挳鎿嶄綔 */
+ handleSync() {
+ this.$modal.confirm('鏄惁纭浠嶴QL Server鍚屾鍖婚櫌鏁版嵁锛熸鎿嶄綔鍙兘闇�瑕佽緝闀挎椂闂淬��').then(() => {
+ this.syncing = true;
+ return syncHosp();
+ }).then(response => {
+ this.syncing = false;
+ this.$modal.msgSuccess("鍚屾瀹屾垚锛�" + response.msg);
+ this.getList();
+ }).catch(() => {
+ this.syncing = false;
+ });
+ }
+ }
+};
+</script>
diff --git a/sql/HospData.sql b/sql/HospData.sql
new file mode 100644
index 0000000..8772bb6
--- /dev/null
+++ b/sql/HospData.sql
@@ -0,0 +1,17 @@
+create table HospData(
+HospID int no 4 10 0 no (n/a) (n/a) NULL
+HospName nvarchar no 200 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HospCityID int no 4 10 0 yes (n/a) (n/a) NULL
+HospShort nvarchar no 200 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HopsProvince nvarchar no 100 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HopsCity nvarchar no 100 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HopsArea nvarchar no 100 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HospAddress nvarchar no 200 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HospTEL nvarchar no 100 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HospUnitID int no 4 10 0 yes (n/a) (n/a) NULL
+HospState int no 4 10 0 yes (n/a) (n/a) NULL
+HospOAID nvarchar no 100 yes (n/a) (n/a) Chinese_PRC_CI_AS
+HospIntroducerID int no 4 10 0 yes (n/a) (n/a) NULL
+HospIntroducerDate datetime no 8 yes (n/a) (n/a) NULL
+HospLevel int no 4 10 0 yes (n/a) (n/a) NULL
+)
\ No newline at end of file
diff --git a/sql/hosp_data_menu.sql b/sql/hosp_data_menu.sql
new file mode 100644
index 0000000..1aaeedb
--- /dev/null
+++ b/sql/hosp_data_menu.sql
@@ -0,0 +1,38 @@
+-- 鍖婚櫌鏁版嵁绠$悊鑿滃崟鍜屾潈闄怱QL
+
+-- 鑿滃崟 SQL
+INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+VALUES
+('鍖婚櫌鏁版嵁', 1, 8, 'hosp', 'system/hosp/index', 1, 0, 'C', '0', '0', 'system:hosp:list', 'hospital', 'admin', sysdate(), '', null, '鍖婚櫌鏁版嵁鑿滃崟');
+
+-- 鑾峰彇鍒氭彃鍏ョ殑鐖惰彍鍗旾D锛堥渶瑕佹墜鍔ㄦ墽琛屼笅闈㈢殑SQL锛屾浛鎹parentId锛�
+SET @parentId = LAST_INSERT_ID();
+
+-- 鎸夐挳 SQL
+INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+VALUES
+('鍖婚櫌鏁版嵁鏌ヨ', @parentId, 1, '#', '', 1, 0, 'F', '0', '0', 'system:hosp:query', '#', 'admin', sysdate(), '', null, ''),
+('鍖婚櫌鏁版嵁鏂板', @parentId, 2, '#', '', 1, 0, 'F', '0', '0', 'system:hosp:add', '#', 'admin', sysdate(), '', null, ''),
+('鍖婚櫌鏁版嵁淇敼', @parentId, 3, '#', '', 1, 0, 'F', '0', '0', 'system:hosp:edit', '#', 'admin', sysdate(), '', null, ''),
+('鍖婚櫌鏁版嵁鍒犻櫎', @parentId, 4, '#', '', 1, 0, 'F', '0', '0', 'system:hosp:remove', '#', 'admin', sysdate(), '', null, ''),
+('鍖婚櫌鏁版嵁瀵煎嚭', @parentId, 5, '#', '', 1, 0, 'F', '0', '0', 'system:hosp:export', '#', 'admin', sysdate(), '', null, ''),
+('鍖婚櫌鏁版嵁鍚屾', @parentId, 6, '#', '', 1, 0, 'F', '0', '0', 'system:hosp:sync', '#', 'admin', sysdate(), '', null, '');
+
+
+-- 瀹氭椂浠诲姟閰嶇疆锛堝彲閫夛紝鐢ㄤ簬瀹氭椂鍚屾锛�
+INSERT INTO sys_job (job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark)
+VALUES
+('鍖婚櫌鏁版嵁鍚屾', 'DEFAULT', 'hospDataSyncTask.syncHospData', '0 0 2 * * ?', '3', '1', '1', 'admin', sysdate(), '姣忓ぉ鍑屾櫒2鐐瑰悓姝ヤ竴娆″尰闄㈡暟鎹�');
+
+-- 璇存槑锛�
+-- 1. 鑿滃崟璺緞涓� /system/hosp锛屽搴斿墠绔〉闈㈤渶瑕佸垱寤�
+-- 2. 鏉冮檺鏍囪瘑锛�
+-- - system:hosp:list - 鏌ヨ鍖婚櫌鍒楄〃
+-- - system:hosp:query - 鏌ヨ鍖婚櫌璇︽儏
+-- - system:hosp:add - 鏂板鍖婚櫌
+-- - system:hosp:edit - 缂栬緫鍖婚櫌
+-- - system:hosp:remove - 鍒犻櫎鍖婚櫌
+-- - system:hosp:export - 瀵煎嚭鍖婚櫌鏁版嵁
+-- - system:hosp:sync - 鍚屾鍖婚櫌鏁版嵁锛堜粠SQL Server锛�
+-- 3. 瀹氭椂浠诲姟榛樿鐘舵�佷负鏆傚仠锛坰tatus=1锛夛紝闇�瑕佹墜鍔ㄥ惎鍔�
+-- 4. 瀹氭椂浠诲姟琛ㄨ揪寮� '0 0 2 * * ?' 琛ㄧず姣忓ぉ鍑屾櫒2鐐规墽琛�
diff --git a/sql/sys_dept_region.sql b/sql/sys_dept_region.sql
new file mode 100644
index 0000000..ff93423
--- /dev/null
+++ b/sql/sys_dept_region.sql
@@ -0,0 +1,64 @@
+-- 閮ㄩ棬绠$悊鍖哄煙琛�
+-- 鐢ㄤ簬閰嶇疆姣忎釜鍒嗗叕鍙�/閮ㄩ棬鍙鐞嗙殑鍦板煙鑼冨洿锛屾敮鎸佺渷銆佸競銆佸幙/鍖恒�佽缁嗗湴鍧�绛夊绾у尯鍩�
+
+CREATE TABLE IF NOT EXISTS `sys_dept_region` (
+ `region_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '鍖哄煙ID',
+ `dept_id` bigint(20) NOT NULL COMMENT '閮ㄩ棬ID',
+ `province` varchar(100) DEFAULT NULL COMMENT '鐪佷唤',
+ `city` varchar(100) DEFAULT NULL COMMENT '鍩庡競',
+ `area` varchar(100) DEFAULT NULL COMMENT '鍘�/鍖�',
+ `address` varchar(255) DEFAULT NULL COMMENT '璇︾粏鍦板潃锛堝彲閫夛級',
+ `hospital_name` varchar(255) DEFAULT NULL COMMENT '鎸囧畾鍖婚櫌鍚嶇О锛堝彲閫夛紝鐢ㄤ簬绮剧‘鍖归厤鐗瑰畾鍖婚櫌锛�',
+ `region_type` varchar(20) DEFAULT 'AREA' COMMENT '鍖哄煙绫诲瀷锛欰REA-鍦板煙鑼冨洿锛孒OSPITAL-鎸囧畾鍖婚櫌',
+ `status` char(1) DEFAULT '0' COMMENT '鐘舵�侊紙0姝e父 1鍋滅敤锛�',
+ `remark` varchar(500) DEFAULT NULL COMMENT '澶囨敞',
+ `create_by` varchar(64) DEFAULT '' COMMENT '鍒涘缓鑰�',
+ `create_time` datetime DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
+ `update_by` varchar(64) DEFAULT '' COMMENT '鏇存柊鑰�',
+ `update_time` datetime DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
+ PRIMARY KEY (`region_id`),
+ KEY `idx_dept_id` (`dept_id`),
+ KEY `idx_province` (`province`),
+ KEY `idx_city` (`city`),
+ KEY `idx_area` (`area`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='閮ㄩ棬绠$悊鍖哄煙琛�';
+
+-- 鎻掑叆绀轰緥鏁版嵁
+
+-- 骞垮窞鎬婚儴锛氱鐞嗘暣涓箍宸炲競
+INSERT INTO `sys_dept_region` (`dept_id`, `province`, `city`, `area`, `region_type`, `remark`, `create_time`)
+SELECT dept_id, '骞夸笢鐪�', '骞垮窞甯�', NULL, 'AREA', '骞垮窞鎬婚儴绠$悊鏁翠釜骞垮窞甯�', NOW()
+FROM sys_dept WHERE dept_name LIKE '%骞垮窞鎬�%' AND parent_id = 100 LIMIT 1;
+
+-- 榛勫煍鍒嗗叕鍙革細绠$悊榛勫煍鍖�
+INSERT INTO `sys_dept_region` (`dept_id`, `province`, `city`, `area`, `region_type`, `remark`, `create_time`)
+SELECT dept_id, '骞夸笢鐪�', '骞垮窞甯�', '榛勫煍鍖�', 'AREA', '榛勫煍鍒嗗叕鍙哥鐞嗛粍鍩斿尯', NOW()
+FROM sys_dept WHERE dept_name LIKE '%榛勫煍%' AND parent_id = 100 LIMIT 1;
+
+-- 娣卞湷鍒嗗叕鍙革細绠$悊鏁翠釜娣卞湷甯�
+INSERT INTO `sys_dept_region` (`dept_id`, `province`, `city`, `area`, `region_type`, `remark`, `create_time`)
+SELECT dept_id, '骞夸笢鐪�', '娣卞湷甯�', NULL, 'AREA', '娣卞湷鍒嗗叕鍙哥鐞嗘暣涓繁鍦冲競', NOW()
+FROM sys_dept WHERE dept_name LIKE '%娣卞湷%' AND parent_id = 100 LIMIT 1;
+
+-- 鐪佷簩鍖诲垎鍏徃锛氫粎绠$悊鎸囧畾鍖婚櫌
+INSERT INTO `sys_dept_region` (`dept_id`, `province`, `city`, `hospital_name`, `region_type`, `remark`, `create_time`)
+SELECT dept_id, '骞夸笢鐪�', '骞垮窞甯�', '骞夸笢鐪佺浜屼汉姘戝尰闄�', 'HOSPITAL', '鐪佷簩鍖诲垎鍏徃浠呯鐞嗙渷浜屽尰鍙婄浉鍏冲尰闄�', NOW()
+FROM sys_dept WHERE dept_name LIKE '%鐪佷簩鍖�%' AND parent_id = 100 LIMIT 1;
+
+INSERT INTO `sys_dept_region` (`dept_id`, `province`, `city`, `hospital_name`, `region_type`, `remark`, `create_time`)
+SELECT dept_id, '骞夸笢鐪�', '骞垮窞甯�', '鐪佷簩鍖�', 'HOSPITAL', '鐪佷簩鍖诲垎鍏徃浠呯鐞嗙渷浜屽尰鍙婄浉鍏冲尰闄紙绠�绉板尮閰嶏級', NOW()
+FROM sys_dept WHERE dept_name LIKE '%鐪佷簩鍖�%' AND parent_id = 100 LIMIT 1;
+
+-- 璇存槑锛�
+-- 1. region_type = 'AREA' 琛ㄧず鎸夊湴鍩熻寖鍥寸鐞�
+-- - 鍙互閰嶇疆鐪併�佸競銆佸幙/鍖猴紝鏀寔灞傜骇鍖归厤
+-- - province銆乧ity銆乤rea 閮戒负 NULL 琛ㄧず涓嶉檺鍒�
+-- - 鍙厤缃� province 琛ㄧず绠$悊鏁翠釜鐪�
+-- - 閰嶇疆 province + city 琛ㄧず绠$悊璇ョ渷鐨勬煇涓競
+-- - 閰嶇疆 province + city + area 琛ㄧず绠$悊璇ュ競鐨勬煇涓尯
+--
+-- 2. region_type = 'HOSPITAL' 琛ㄧず鎸夋寚瀹氬尰闄㈢鐞�
+-- - hospital_name 瀛楁鐢ㄤ簬绮剧‘鎴栨ā绯婂尮閰嶅尰闄㈠悕绉�
+-- - 鍙互涓哄悓涓�涓儴闂ㄩ厤缃鏉″尰闄㈣褰�
+--
+-- 3. 涓�涓儴闂ㄥ彲浠ラ厤缃鏉″尯鍩熻褰曪紝琛ㄧず绠$悊澶氫釜鍖哄煙鎴栧涓尰闄�
diff --git a/sql/tb_hosp_data.sql b/sql/tb_hosp_data.sql
new file mode 100644
index 0000000..9108e1a
--- /dev/null
+++ b/sql/tb_hosp_data.sql
@@ -0,0 +1,40 @@
+-- 鍖婚櫌鏁版嵁琛紙MySQL锛�
+-- 鐢ㄤ簬瀛樺偍浠� SQL Server HospData 琛ㄥ悓姝ヨ繃鏉ョ殑鍖婚櫌鏁版嵁
+
+CREATE TABLE IF NOT EXISTS `tb_hosp_data` (
+ `hosp_id` int(11) NOT NULL COMMENT '鍖婚櫌ID锛堣嚜澧炰富閿級',
+ `legacy_hosp_id` int(11) DEFAULT NULL COMMENT '鏃х郴缁熷尰闄D锛堝搴擲QL Server涓殑HospID锛�',
+ `hosp_name` varchar(200) DEFAULT NULL COMMENT '鍖婚櫌鍚嶇О',
+ `hosp_city_id` int(11) DEFAULT NULL COMMENT '鍩庡競ID',
+ `hosp_short` varchar(200) DEFAULT NULL COMMENT '鍖婚櫌绠�绉�',
+ `hops_province` varchar(100) DEFAULT NULL COMMENT '鐪佷唤',
+ `hops_city` varchar(100) DEFAULT NULL COMMENT '鍩庡競',
+ `hops_area` varchar(100) DEFAULT NULL COMMENT '鍖哄煙',
+ `hosp_address` varchar(200) DEFAULT NULL COMMENT '鍖婚櫌鍦板潃',
+ `hosp_tel` varchar(100) DEFAULT NULL COMMENT '鍖婚櫌鐢佃瘽',
+ `hosp_unit_id` int(11) DEFAULT NULL COMMENT '鍗曚綅ID',
+ `hosp_state` int(11) DEFAULT NULL COMMENT '鐘舵��',
+ `hosp_oa_id` varchar(100) DEFAULT NULL COMMENT 'OA ID',
+ `hosp_introducer_id` int(11) DEFAULT NULL COMMENT '浠嬬粛浜篒D',
+ `hosp_introducer_date` datetime DEFAULT NULL COMMENT '浠嬬粛鏃ユ湡',
+ `hosp_level` int(11) DEFAULT NULL COMMENT '鍖婚櫌绾у埆',
+ `status` char(1) DEFAULT '0' COMMENT '鏁版嵁鐘舵�侊紙0姝e父 1鍋滅敤锛�',
+ `remark` varchar(500) DEFAULT NULL COMMENT '澶囨敞',
+ `create_by` varchar(64) DEFAULT '' COMMENT '鍒涘缓鑰�',
+ `create_time` datetime DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
+ `update_by` varchar(64) DEFAULT '' COMMENT '鏇存柊鑰�',
+ `update_time` datetime DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
+ PRIMARY KEY (`hosp_id`),
+ UNIQUE KEY `uk_legacy_hosp_id` (`legacy_hosp_id`),
+ KEY `idx_hosp_name` (`hosp_name`),
+ KEY `idx_province` (`hops_province`),
+ KEY `idx_city` (`hops_city`),
+ KEY `idx_area` (`hops_area`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='鍖婚櫌鏁版嵁琛�';
+
+-- 璇存槑锛�
+-- 1. hosp_id 涓鸿嚜澧炰富閿紝鐢ㄤ簬鍐呴儴鍏宠仈
+-- 2. legacy_hosp_id 瀵瑰簲 SQL Server 涓殑 HospID锛岃缃敮涓�绱㈠紩
+-- 3. 鍏朵粬瀛楁涓� SQL Server HospData 琛ㄤ繚鎸佷竴鑷�
+-- 4. 鏂板 status銆乺emark銆乧reate_by 绛夋爣鍑嗗瓧娈�
+-- 5. 娣诲姞绱㈠紩浠ユ彁楂樻煡璇㈡�ц兘
--
Gitblit v1.9.1