From c10b1e130ccbc94e6481a43e8e2d35cfc8fcf83b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期五, 26 十二月 2025 18:05:06 +0800
Subject: [PATCH] feat:显示问题
---
app/utils/request.js | 24 ++
app/pages/index.vue | 46 ++++-
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TaskDispatchSyncUtilService.java | 41 +++-
app/pagesTask/create-emergency.vue | 28 ++-
app/pagesTask/components/DepartmentSelector.vue | 69 +++++++-
app/pagesTask/components/DepartureSelector.vue | 4
app/pages/qylogin.vue | 133 ++++++++++++++--
app/pages/task/index.vue | 33 +++
sql/qy_wechat_config.sql | 8
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java | 15 +
app/pagesTask/edit-emergency.vue | 8
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QyWechatAccessTokenServiceImpl.java | 4
app/pagesTask/components/HospitalSelector.vue | 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/VehicleGpsController.java | 18 +-
app/api/map.js | 4
15 files changed, 355 insertions(+), 88 deletions(-)
diff --git a/app/api/map.js b/app/api/map.js
index bbd122c..e8502b3 100644
--- a/app/api/map.js
+++ b/app/api/map.js
@@ -1,7 +1,7 @@
import request from '@/utils/request'
// 鍦板浘鍦板潃鎼滅储API
-export function searchAddress(keyword, region) {
+export function searchTianDiTuAddress(keyword, region) {
// 鍙傛暟楠岃瘉
if (!keyword) {
return Promise.reject(new Error('鍙傛暟涓嶅畬鏁达紝缂哄皯鍏抽敭璇�'))
@@ -12,7 +12,7 @@
url: '/system/gps/tianditu/place/suggestion',
method: 'get',
params: {
- keyword: keyword,
+ keyWord: keyword,
region: region || '骞垮窞'
}
})
diff --git a/app/pages/index.vue b/app/pages/index.vue
index a98e7e1..ce9d0b4 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -153,7 +153,7 @@
<view class="info-item">
<view class="label">鎵ц浜哄憳:</view>
- <view class="value">{{ task.assignee }}</view>
+ <view class="value">{{ getAssigneesDisplay(task) }}</view>
</view>
</view>
</view>
@@ -607,18 +607,44 @@
// 鑾峰彇鐩殑鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞叆鍖婚櫌鍚嶇О鎴栬缁嗗湴鍧�锛�
getEndLocationDisplay(task) {
// 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+ // console.log("get end location display",task.taskType,task.emergencyInfo.hospitalInAddress,task.showTaskCode);
if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo) {
+ // console.log('杞繍浠诲姟 - 绱ф�ヤ俊鎭�:', task.emergencyInfo)
// 浼樺厛鏄剧ず杞叆鍖婚櫌鍚嶇О
- if (task.emergencyInfo.hospitalInName) {
- if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
- return task.emergencyInfo.destinationAddress;
- }
- return task.emergencyInfo.hospitalInName;
- }
-
+ // console.log("get end local",task.emergencyInfo.hospitalInAddress);
+ return task.emergencyInfo.hospitalInAddress;
+ // if (task.emergencyInfo.hospitalInName) {
+ // if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
+ // return task.emergencyInfo.destinationAddress;
+ // }
+ // return task.emergencyInfo.hospitalInName;
+ // }
+ // // 濡傛灉娌℃湁杞叆鍖婚櫌鍚嶇О锛屼絾鏈夎浆鍏ュ尰闄㈠湴鍧�锛屽垯鏄剧ず鍦板潃
+ // if (task.emergencyInfo.hospitalInAddress) {
+ // return task.emergencyInfo.hospitalInAddress;
+ // }
}
// 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨別ndLocation
return this.formatAddress(task.endLocation || "鏈缃�");
+ },
+
+ // 鑾峰彇鎵ц浜哄憳鏄剧ず锛堜粠 assignees 鏁扮粍涓彁鍙� userName锛�
+ getAssigneesDisplay(task) {
+ // 濡傛灉鏈� assignees 鏁扮粍涓斾笉涓虹┖
+ if (task.assignees && task.assignees.length > 0) {
+ // 鎻愬彇鎵�鏈� userName锛岃繃婊ゆ帀绌哄��
+ const userNames = task.assignees
+ .map(assignee => assignee.userName)
+ .filter(name => name); // 杩囨护鎺� null/undefined/绌哄瓧绗︿覆
+
+ // 濡傛灉鏈夋湁鏁堢殑鐢ㄦ埛鍚嶏紝鐢ㄩ�楀彿杩炴帴
+ if (userNames.length > 0) {
+ return userNames.join('銆�');
+ }
+ }
+
+ // 濡傛灉娌℃湁 assignees 鏁扮粍锛屼娇鐢ㄦ棫鐨� assigneeName 鎴� assignee 瀛楁
+ return task.assigneeName || task.assignee || '鏈垎閰�';
},
// 杞崲鐘舵�佹牸寮忥紙灏嗘暟鎹簱鐘舵�佽浆鎹负UI浣跨敤鐨勭姸鎬侊級
@@ -1394,6 +1420,10 @@
font-size: 26rpx;
flex: 1;
word-break: break-all;
+ overflow-wrap: break-word;
+ line-height: 1.5;
+ max-height: none;
+ overflow: visible;
}
}
}
diff --git a/app/pages/qylogin.vue b/app/pages/qylogin.vue
index 87f219a..2e47b30 100644
--- a/app/pages/qylogin.vue
+++ b/app/pages/qylogin.vue
@@ -38,6 +38,10 @@
try {
// 淇濆瓨椤甸潰鍙傛暟
this.pageOptions = options || {};
+
+ // 鎵撳嵃鐜淇℃伅
+ this.logEnvironmentInfo();
+
// 椤甸潰鍔犺浇鏃舵墽琛屽厤鐧绘祦绋�
this.qyWechatAutoLogin();
} catch (e) {
@@ -49,6 +53,49 @@
},
methods: {
+ /**
+ * 鎵撳嵃鐜淇℃伅锛堣皟璇曠敤锛�
+ */
+ logEnvironmentInfo() {
+ // #ifdef MP-WEIXIN
+ console.log('========== 鐜淇℃伅 ==========');
+ console.log('wx 鏄惁瀛樺湪:', typeof wx !== 'undefined');
+ console.log('wx.qy 鏄惁瀛樺湪:', typeof wx !== 'undefined' && typeof wx.qy !== 'undefined');
+
+ if (typeof wx !== 'undefined') {
+ console.log('wx.login 鏄惁瀛樺湪:', typeof wx.login === 'function');
+
+ if (typeof wx.qy !== 'undefined') {
+ console.log('wx.qy.login 鏄惁瀛樺湪:', typeof wx.qy.login === 'function');
+ console.log('wx.qy 瀵硅薄:', wx.qy);
+ } else {
+ console.warn('鈿狅笍 wx.qy 涓嶅瓨鍦紒');
+ console.warn('鍙兘鍘熷洜锛�');
+ console.warn('1. 褰撳墠鍦ㄥ紑鍙戣�呭伐鍏蜂腑锛寃x.qy API 鍙兘涓嶅彲鐢�');
+ console.warn('2. 闇�瑕佸湪鐪熸満涓婅皟璇�');
+ console.warn('3. appid 閰嶇疆鍙兘涓嶆纭�');
+ }
+
+ // 鑾峰彇绯荤粺淇℃伅
+ try {
+ const systemInfo = wx.getSystemInfoSync();
+ console.log('绯荤粺淇℃伅:', systemInfo);
+ } catch (e) {
+ console.error('鑾峰彇绯荤粺淇℃伅澶辫触:', e);
+ }
+
+ // 鑾峰彇璐﹀彿淇℃伅
+ try {
+ const accountInfo = wx.getAccountInfoSync();
+ console.log('璐﹀彿淇℃伅:', accountInfo);
+ } catch (e) {
+ console.error('鑾峰彇璐﹀彿淇℃伅澶辫触:', e);
+ }
+ }
+ console.log('==============================');
+ // #endif
+ },
+
/**
* 浼佷笟寰俊鍏嶇櫥娴佺▼
*/
@@ -135,26 +182,80 @@
},
/**
+ * 绛夊緟 wx.qy 瀵硅薄鍒濆鍖�
+ */
+ waitForWxQy(timeout = 5000) {
+ return new Promise((resolve, reject) => {
+ const startTime = Date.now();
+ let checkCount = 0;
+
+ const checkWxQy = () => {
+ checkCount++;
+ const elapsed = Date.now() - startTime;
+
+ if (typeof wx !== 'undefined' && typeof wx.qy !== 'undefined' && typeof wx.qy.login === 'function') {
+ console.log(`鉁� wx.qy 宸插垵濮嬪寲 (鑰楁椂: ${elapsed}ms, 妫�鏌ユ鏁�: ${checkCount})`);
+ resolve(true);
+ } else if (elapsed > timeout) {
+ console.error(`鉂� 绛夊緟 wx.qy 鍒濆鍖栬秴鏃� (${timeout}ms)`);
+ console.error('褰撳墠鐘舵��:', {
+ wx瀛樺湪: typeof wx !== 'undefined',
+ 'wx.qy瀛樺湪': typeof wx !== 'undefined' && typeof wx.qy !== 'undefined',
+ 妫�鏌ユ鏁�: checkCount
+ });
+
+ // 鎻愪緵鏇磋缁嗙殑閿欒淇℃伅
+ const errorMsg = '浼佷笟寰俊鐜鍒濆鍖栬秴鏃躲�俓n\n' +
+ '鍙兘鐨勫師鍥狅細\n' +
+ '1. 褰撳墠鍦ㄥ紑鍙戣�呭伐鍏蜂腑锛寃x.qy API 涓嶅彲鐢╘n' +
+ '2. 璇蜂娇鐢ㄧ湡鏈洪瑙堟垨鐪熸満璋冭瘯\n' +
+ '3. 妫�鏌ュ皬绋嬪簭 appid 鏄惁閰嶇疆姝g‘';
+ reject(new Error(errorMsg));
+ } else {
+ if (checkCount % 10 === 1) {
+ console.log(`鈴� 绛夊緟 wx.qy 鍒濆鍖�... (${elapsed}ms, 绗�${checkCount}娆℃鏌�)`);
+ }
+ setTimeout(checkWxQy, 100);
+ }
+ };
+
+ checkWxQy();
+ });
+ },
+
+ /**
* 鑾峰彇浼佷笟寰俊鐧诲綍code
*/
getLoginCode() {
- return new Promise((resolve, reject) => {
+ return new Promise(async (resolve, reject) => {
// #ifdef MP-WEIXIN
- // 浣跨敤浼佷笟寰俊灏忕▼搴廇PI鑾峰彇code
- wx.qy.login({
- success: (res) => {
- if (res.code) {
- console.log("浼佷笟寰俊灏忕▼搴� ---> code锛�", res.code);
- resolve(res.code);
- } else {
- reject(new Error("鑾峰彇code澶辫触锛�" + res.errMsg));
- }
- },
- fail: (err) => {
- console.error("wx.qy.login璋冪敤澶辫触锛�", err);
- reject(new Error("浼佷笟寰俊鐧诲綍鎺ュ彛璋冪敤澶辫触锛�" + err.errMsg));
- },
- });
+ try {
+ // 妫�鏌ユ槸鍚﹀湪浼佷笟寰俊灏忕▼搴忕幆澧�
+ console.log('妫�鏌ヤ紒涓氬井淇$幆澧冿紝wx.qy 鏄惁瀛樺湪:', typeof wx !== 'undefined' && typeof wx.qy !== 'undefined');
+
+ // 绛夊緟 wx.qy 鍒濆鍖栧畬鎴�
+ await this.waitForWxQy();
+
+ // 浣跨敤浼佷笟寰俊灏忕▼搴廇PI鑾峰彇code
+ console.log('浣跨敤 wx.qy.login 鑾峰彇code');
+ wx.qy.login({
+ success: (res) => {
+ if (res.code) {
+ console.log("浼佷笟寰俊灏忕▼搴� ---> code锛�", res.code);
+ resolve(res.code);
+ } else {
+ reject(new Error("鑾峰彇code澶辫触锛�" + (res.errMsg || '鏈煡閿欒')));
+ }
+ },
+ fail: (err) => {
+ console.error("wx.qy.login璋冪敤澶辫触锛�", err);
+ reject(new Error("浼佷笟寰俊鐧诲綍鎺ュ彛璋冪敤澶辫触锛�" + (err.errMsg || '鏈煡閿欒')));
+ },
+ });
+ } catch (error) {
+ console.error('鑾峰彇鐧诲綍code寮傚父:', error);
+ reject(error);
+ }
// #endif
// #ifndef MP-WEIXIN
diff --git a/app/pages/task/index.vue b/app/pages/task/index.vue
index df49429..da47896 100644
--- a/app/pages/task/index.vue
+++ b/app/pages/task/index.vue
@@ -188,7 +188,7 @@
<view class="info-row">
<view class="info-item">
<view class="label">鎵ц浜哄憳:</view>
- <view class="value">{{ task.assignee }}</view>
+ <view class="value">{{ getAssigneesDisplay(task) }}</view>
</view>
</view>
</view>
@@ -663,13 +663,36 @@
// 浼樺厛鏄剧ず杞叆鍖婚櫌鍚嶇О
if (task.emergencyInfo.hospitalInName) {
if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
- return task.emergencyInfo.destinationAddress;
+ return task.emergencyInfo.hospitalInAddress;
}
return task.emergencyInfo.hospitalInName;
- }
+ }
+ // 濡傛灉娌℃湁杞叆鍖婚櫌鍚嶇О锛屼絾鏈夎浆鍏ュ尰闄㈠湴鍧�锛屽垯鏄剧ず鍦板潃
+ if (task.emergencyInfo.hospitalInAddress) {
+ return task.emergencyInfo.hospitalInAddress;
+ }
}
// 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨別ndLocation
return this.formatAddress(task.endLocation || "鏈缃�");
+ },
+
+ // 鑾峰彇鎵ц浜哄憳鏄剧ず锛堜粠 assignees 鏁扮粍涓彁鍙� userName锛�
+ getAssigneesDisplay(task) {
+ // 濡傛灉鏈� assignees 鏁扮粍涓斾笉涓虹┖
+ if (task.assignees && task.assignees.length > 0) {
+ // 鎻愬彇鎵�鏈� userName锛岃繃婊ゆ帀绌哄��
+ const userNames = task.assignees
+ .map(assignee => assignee.userName)
+ .filter(name => name); // 杩囨护鎺� null/undefined/绌哄瓧绗︿覆
+
+ // 濡傛灉鏈夋湁鏁堢殑鐢ㄦ埛鍚嶏紝鐢ㄩ�楀彿杩炴帴
+ if (userNames.length > 0) {
+ return userNames.join('銆�');
+ }
+ }
+
+ // 濡傛灉娌℃湁 assignees 鏁扮粍锛屼娇鐢ㄦ棫鐨� assigneeName 鎴� assignee 瀛楁
+ return task.assigneeName || task.assignee || '鏈垎閰�';
},
// 鍒囨崲鏌ヨ鐣岄潰鏄剧ず/闅愯棌
@@ -1434,6 +1457,10 @@
font-size: 26rpx;
flex: 1;
word-break: break-all;
+ overflow-wrap: break-word;
+ line-height: 1.5;
+ max-height: none;
+ overflow: visible;
}
}
}
diff --git a/app/pagesTask/components/DepartmentSelector.vue b/app/pagesTask/components/DepartmentSelector.vue
index 98b2f1f..76f2c5e 100644
--- a/app/pagesTask/components/DepartmentSelector.vue
+++ b/app/pagesTask/components/DepartmentSelector.vue
@@ -1,26 +1,24 @@
<template>
<view class="form-item">
<view class="form-label" :class="{ required: required }">{{ label }}</view>
+ <!-- 璋冭瘯淇℃伅 -->
+ <view v-if="false" style="font-size: 24rpx; color: #999; margin-bottom: 10rpx;">
+ isHome: {{ isHome }}, options.length: {{ departmentOptions.length }}
+ </view>
<picker
- v-if="!isHome && departmentOptions.length > 0"
+ v-if="!isHome"
mode="selector"
:range="departmentOptions"
range-key="text"
:value="selectedIndex"
@change="onDepartmentChange"
+ :disabled="departmentOptions.length === 0"
>
- <view class="form-input picker-input">
+ <view class="form-input picker-input" :class="{ disabled: departmentOptions.length === 0 }">
{{ displayText }}
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
</view>
</picker>
- <input
- v-else-if="!isHome"
- class="form-input"
- placeholder="璇疯緭鍏ョ瀹�"
- :value="value"
- @input="onDepartmentInput"
- />
<view v-else class="form-input picker-input disabled">
鍏跺畠
</view>
@@ -72,6 +70,9 @@
},
computed: {
displayText() {
+ if (this.departmentOptions.length === 0) {
+ return '鍔犺浇涓�...'
+ }
if (this.selectedIndex >= 0 && this.selectedIndex < this.departmentOptions.length) {
return this.departmentOptions[this.selectedIndex].text
}
@@ -82,6 +83,7 @@
value: {
immediate: true,
handler(newVal) {
+ console.log('DepartmentSelector: value changed:', newVal)
if (newVal) {
this.updateSelectedIndex(newVal)
} else {
@@ -92,6 +94,7 @@
departmentId: {
immediate: true,
handler(newVal) {
+ console.log('DepartmentSelector: departmentId changed:', newVal)
if (newVal) {
this.updateSelectedIndexById(newVal)
}
@@ -100,6 +103,8 @@
departmentOptions: {
immediate: true,
handler() {
+ console.log('DepartmentSelector: departmentOptions changed, length=', this.departmentOptions.length)
+ console.log('DepartmentSelector: 褰撳墠鏄剧ず鏉′欢 - isHome:', this.isHome, 'departmentOptions.length:', this.departmentOptions.length, '鏄剧ずpicker:', !this.isHome && this.departmentOptions.length > 0)
// 浼樺厛浣跨敤绉戝ID杩涜鍖归厤锛屽鏋滄病鏈夌瀹D鍐嶄娇鐢ㄧ瀹ゅ悕绉�
if (this.departmentId) {
this.updateSelectedIndexById(this.departmentId)
@@ -107,23 +112,46 @@
this.updateSelectedIndex(this.value)
}
}
+ },
+ isHome: {
+ immediate: true,
+ handler(newVal) {
+ console.log('DepartmentSelector: isHome changed:', newVal)
+ // 褰撳彉涓�"瀹朵腑"鏃讹紝鑷姩閫夋嫨"鍏跺畠"绉戝
+ if (newVal && this.departmentOptions.length > 0) {
+ this.autoSelectOtherDepartment()
+ }
+ }
}
},
mounted() {
+ console.log('DepartmentSelector: 缁勪欢宸叉寕杞�, isHome=', this.isHome, 'value=', this.value, 'departmentId=', this.departmentId)
this.loadDepartments()
},
methods: {
// 鍔犺浇绉戝鏁版嵁
loadDepartments() {
+ console.log('DepartmentSelector: 寮�濮嬪姞杞界瀹ゆ暟鎹�')
getHospitalDepartments().then(response => {
+ console.log('DepartmentSelector: 绉戝鎺ュ彛鍝嶅簲:', response)
const list = response.data || []
+ console.log('DepartmentSelector: 绉戝鏁版嵁鏉℃暟:', list.length)
+ if (list.length > 0) {
+ console.log('DepartmentSelector: 绉戝鏁版嵁绀轰緥:', list.slice(0, 3))
+ }
this.departmentOptions = list.map(item => ({
id: item.vID,
text: item.vtext,
dictValue: item.vtext
}))
+ console.log('DepartmentSelector: 澶勭悊鍚庣殑绉戝閫夐」:', this.departmentOptions.length)
+
+ // 濡傛灉褰撳墠鏄�"瀹朵腑"锛岃嚜鍔ㄩ�夋嫨"鍏跺畠"
+ if (this.isHome) {
+ this.autoSelectOtherDepartment()
+ }
}).catch(error => {
- console.error('鍔犺浇绉戝鏁版嵁澶辫触:', error)
+ console.error('DepartmentSelector: 鍔犺浇绉戝鏁版嵁澶辫触:', error)
this.departmentOptions = []
})
},
@@ -185,6 +213,27 @@
department: department,
departmentId: null
})
+ },
+
+ // 鑷姩閫夋嫨"鍏跺畠"绉戝锛堝綋isHome涓簍rue鏃讹級
+ autoSelectOtherDepartment() {
+ // 鏌ユ壘"鍏跺畠"绉戝
+ const otherDept = this.departmentOptions.find(d => d.text === '鍏跺畠')
+ if (otherDept) {
+ console.log('DepartmentSelector: 鑷姩閫夋嫨"鍏跺畠"绉戝, ID:', otherDept.id)
+ // 鏇存柊閫変腑绱㈠紩
+ const index = this.departmentOptions.findIndex(d => d.id === otherDept.id)
+ this.selectedIndex = index
+
+ // 瑙﹀彂change浜嬩欢锛屼紶閫抎epartmentId
+ this.$emit('input', otherDept.text)
+ this.$emit('change', {
+ department: otherDept.text,
+ departmentId: otherDept.id
+ })
+ } else {
+ console.warn('DepartmentSelector: 鏈壘鍒�"鍏跺畠"绉戝')
+ }
}
}
}
diff --git a/app/pagesTask/components/DepartureSelector.vue b/app/pagesTask/components/DepartureSelector.vue
index ac00b3c..5302617 100644
--- a/app/pagesTask/components/DepartureSelector.vue
+++ b/app/pagesTask/components/DepartureSelector.vue
@@ -43,7 +43,7 @@
</template>
<script>
-import { baiduPlaceSuggestion, reverseGeocoder } from "@/api/map"
+import { baiduPlaceSuggestion, reverseGeocoder ,searchTianDiTuAddress} from "@/api/map"
export default {
name: 'DepartureSelector',
@@ -153,7 +153,7 @@
// 鎼滅储鍦板潃寤鸿
searchAddress(query) {
- baiduPlaceSuggestion(query, this.region).then(response => {
+ searchTianDiTuAddress(query, this.region).then(response => {
if (response.code === 200 && response.data) {
this.addressSuggestions = response.data
this.showAddressSuggestions = true
diff --git a/app/pagesTask/components/HospitalSelector.vue b/app/pagesTask/components/HospitalSelector.vue
index cd4fd01..6d6443e 100644
--- a/app/pagesTask/components/HospitalSelector.vue
+++ b/app/pagesTask/components/HospitalSelector.vue
@@ -45,7 +45,7 @@
@click="selectAddressSuggestion(item)"
>
<view class="suggestion-name">{{ item.name }}</view>
- <view class="suggestion-address">{{ item.district }}{{ item.address }}</view>
+ <view class="suggestion-address">{{ (item.district || '') + (item.address || '') }}</view>
</view>
</view>
</view>
@@ -58,7 +58,7 @@
<script>
import { searchHospitals } from "@/api/hospital"
-import { baiduPlaceSuggestion } from "@/api/map"
+import { searchTianDiTuAddress } from "@/api/map"
export default {
name: 'HospitalSelector',
@@ -294,7 +294,7 @@
// 鎼滅储鍦板潃寤鸿
searchAddress(query) {
- baiduPlaceSuggestion(query, this.region).then(response => {
+ searchTianDiTuAddress(query, this.region).then(response => {
if (response.code === 200 && response.data) {
this.addressSuggestions = response.data
this.showAddressSuggestions = true
@@ -318,7 +318,7 @@
// 閫夋嫨鍦板潃寤鸿
selectAddressSuggestion(item) {
- const fullAddress = item.district + item.address
+ const fullAddress = (item.district || '') + (item.address || '')
this.$emit('input', {
...this.value,
address: fullAddress
diff --git a/app/pagesTask/create-emergency.vue b/app/pagesTask/create-emergency.vue
index 8d590d5..166e11c 100644
--- a/app/pagesTask/create-emergency.vue
+++ b/app/pagesTask/create-emergency.vue
@@ -567,11 +567,7 @@
console.log('杞嚭鍖婚櫌鍙樺寲:', hospitalData)
// 缁勪欢宸茬粡閫氳繃 v-model 鏇存柊浜� taskForm.hospitalOut
- // 濡傛灉閫夋嫨鐨勬槸"瀹朵腑"锛岃嚜鍔ㄨ缃瀹や负"鍏跺畠"
- if (hospitalData.name === '瀹朵腑') {
- this.taskForm.hospitalOut.department = '鍏跺畠'
- this.taskForm.hospitalOut.departmentId = null
- }
+ // 绉戝鐨勮缃敱 DepartmentSelector 缁勪欢鑷姩澶勭悊锛堥�氳繃 isHome 灞炴�э級
// 濡傛灉杞叆鍦板潃宸插~鍐�,鑷姩璁$畻璺濈
if (this.taskForm.hospitalIn.address) {
@@ -597,11 +593,7 @@
console.log('杞叆鍖婚櫌鍙樺寲:', hospitalData)
// 缁勪欢宸茬粡閫氳繃 v-model 鏇存柊浜� taskForm.hospitalIn
- // 濡傛灉閫夋嫨鐨勬槸"瀹朵腑"锛岃嚜鍔ㄨ缃瀹や负"鍏跺畠"
- if (hospitalData.name === '瀹朵腑') {
- this.taskForm.hospitalIn.department = '鍏跺畠'
- this.taskForm.hospitalIn.departmentId = null
- }
+ // 绉戝鐨勮缃敱 DepartmentSelector 缁勪欢鑷姩澶勭悊锛堥�氳繃 isHome 灞炴�э級
// 濡傛灉杞嚭鍦板潃宸插~鍐�,鑷姩璁$畻璺濈
if (this.taskForm.hospitalOut.address) {
@@ -813,6 +805,18 @@
return false
}
+ // 濡傛灉杞叆鍖婚櫌鏄�滃涓�濓紝蹇呴』濉啓鍦板潃
+ if (this.taskForm.hospitalIn.name === '瀹朵腑' && !this.taskForm.hospitalIn.address) {
+ this.$modal.showToast('璇疯緭鍏ヨ浆鍏ュ湴鍧�锛堝涓級')
+ return false
+ }
+
+ // 濡傛灉杞嚭鍖婚櫌鏄�滃涓�濓紝蹇呴』濉啓鍦板潃
+ if (this.taskForm.hospitalOut.name === '瀹朵腑' && !this.taskForm.hospitalOut.address) {
+ this.$modal.showToast('璇疯緭鍏ヨ浆鍑哄湴鍧�锛堝涓級')
+ return false
+ }
+
if (!this.taskForm.transferDistance) {
this.$modal.showToast('璇疯緭鍏ヨ浆杩愬叕閲屾暟')
return false
@@ -847,6 +851,10 @@
}
}
+ // 璋冭瘯鏃ュ織锛氭鏌ヨ浆鍏ュ尰闄㈠湴鍧�
+ console.log('鏋勫缓鎻愪氦鏁版嵁 - 杞叆鍖婚櫌:', this.taskForm.hospitalIn.name)
+ console.log('鏋勫缓鎻愪氦鏁版嵁 - 杞叆鍖婚櫌鍦板潃:', this.taskForm.hospitalIn.address)
+
const submitData = {
taskType: 'EMERGENCY_TRANSFER',
deptId: this.selectedOrganizationId, // 褰掑睘鏈烘瀯ID锛堥儴闂↖D锛�
diff --git a/app/pagesTask/edit-emergency.vue b/app/pagesTask/edit-emergency.vue
index 7911a84..a0b4397 100644
--- a/app/pagesTask/edit-emergency.vue
+++ b/app/pagesTask/edit-emergency.vue
@@ -998,8 +998,10 @@
return false
}
+ // 杞嚭鍖婚櫌鍦板潃楠岃瘉锛氬鏋滄槸鈥滃涓�濆繀椤诲~鍐欏湴鍧�锛屽叾浠栧尰闄篃蹇呴』鏈夊湴鍧�
if (!this.taskForm.hospitalOut.address) {
- this.$modal.showToast('璇烽�夋嫨杞嚭鍖婚櫌鍦板潃')
+ const msg = this.taskForm.hospitalOut.name === '瀹朵腑' ? '璇疯緭鍏ヨ浆鍑哄湴鍧�锛堝涓級' : '璇烽�夋嫨杞嚭鍖婚櫌鍦板潃'
+ this.$modal.showToast(msg)
return false
}
@@ -1013,8 +1015,10 @@
return false
}
+ // 杞叆鍖婚櫌鍦板潃楠岃瘉锛氬鏋滄槸鈥滃涓�濆繀椤诲~鍐欏湴鍧�锛屽叾浠栧尰闄篃蹇呴』鏈夊湴鍧�
if (!this.taskForm.hospitalIn.address) {
- this.$modal.showToast('璇烽�夋嫨杞叆鍖婚櫌鍦板潃')
+ const msg = this.taskForm.hospitalIn.name === '瀹朵腑' ? '璇疯緭鍏ヨ浆鍏ュ湴鍧�锛堝涓級' : '璇烽�夋嫨杞叆鍖婚櫌鍦板潃'
+ this.$modal.showToast(msg)
return false
}
diff --git a/app/utils/request.js b/app/utils/request.js
index bea5d40..f2fad21 100644
--- a/app/utils/request.js
+++ b/app/utils/request.js
@@ -39,6 +39,10 @@
}
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
+
+ // 鐗规畩澶勭悊锛歝heckDuplicate 鎺ュ彛鍗充娇杩斿洖閿欒鐮佷篃瑕佽繘鍏� then 鍒嗘敮
+ const isCheckDuplicateApi = config.url && config.url.includes('/task/checkDuplicate')
+
if (code === 401) {
showConfirm('鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�?').then(res => {
if (res.confirm) {
@@ -49,10 +53,26 @@
})
reject('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�')
} else if (code === 500) {
- toast(msg)
+ // checkDuplicate 鎺ュ彛涓嶆樉绀� toast锛岃涓氬姟浠g爜鑷繁澶勭悊
+ if (!isCheckDuplicateApi) {
+ toast(msg)
+ }
+ // checkDuplicate 鎺ュ彛杩斿洖瀹屾暣鍝嶅簲锛屼笉 reject
+ if (isCheckDuplicateApi) {
+ resolve(res.data)
+ return
+ }
reject('500')
} else if (code !== 200) {
- toast(msg)
+ // checkDuplicate 鎺ュ彛涓嶆樉绀� toast锛岃涓氬姟浠g爜鑷繁澶勭悊
+ if (!isCheckDuplicateApi) {
+ toast(msg)
+ }
+ // checkDuplicate 鎺ュ彛杩斿洖瀹屾暣鍝嶅簲锛屼笉 reject
+ if (isCheckDuplicateApi) {
+ resolve(res.data)
+ return
+ }
reject(code)
}
resolve(res.data)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/VehicleGpsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/VehicleGpsController.java
index 5d64960..94222e5 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/VehicleGpsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/VehicleGpsController.java
@@ -1304,15 +1304,15 @@
if (count == null) {
count = 10;
}
-
- // 鏋勫缓澶╁湴鍥炬櫘閫氭悳绱PI URL
+ //{"keyWord":"骞垮窞澶╂渤妫犱笅","level":12,"mapBound":"116.02524,39.83833,116.65592,39.99185","queryType":1,"start":0,"count":10}
+ // 鏋勫缓澶╁湴鍥炬櫘閫氭悳绱PI URL http://api.tianditu.gov.cn/v2/search
String url = "http://api.tianditu.gov.cn/v2/search";
StringBuilder paramsBuilder = new StringBuilder();
paramsBuilder.append("postStr={\"keyWord\":\"").append(keyWord).append("\"");
// 纭紪鐮佷腑鍥藉湴鍥捐寖鍥�
paramsBuilder.append(",\"mapBound\":\"").append("73.66,3.86,135.05,53.55").append("\"");
// 榛樿绾у埆涓�18
- paramsBuilder.append(",\"level\":\"").append("18").append("\"");
+ paramsBuilder.append(",\"level\":\"").append("12").append("\"");
// 榛樿鏌ヨ绫诲瀷涓烘櫘閫氭悳绱�
paramsBuilder.append(",\"queryType\":\"").append("1").append("\"");
// 榛樿璧峰浣嶇疆涓�0
@@ -1320,12 +1320,12 @@
paramsBuilder.append(",\"count\":\"").append(count).append("\"");
// 娣诲姞鍙�夊弬鏁�
- if (region != null && !region.trim().isEmpty()) {
- paramsBuilder.append(",\"specify\":\"").append(region).append("\"");
- }
- if (city != null && !city.trim().isEmpty()) {
- paramsBuilder.append(",\"dataTypes\":\"").append(city).append("\"");
- }
+// if (region != null && !region.trim().isEmpty()) {
+// paramsBuilder.append(",\"specify\":\"").append(region).append("\"");
+// }
+// if (city != null && !city.trim().isEmpty()) {
+// paramsBuilder.append(",\"dataTypes\":\"").append(city).append("\"");
+// }
paramsBuilder.append("}");
paramsBuilder.append("&type=query");
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java
index 8aaafd8..6e56c55 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java
@@ -504,11 +504,20 @@
}
}
createTaskVo.setPatient(patientInfo);
- //1000鍏噷锛屾彁鍙栨暟瀛�
+ //1000鍏噷锛屾彁鍙栨暟瀛楋紙鏀寔灏忔暟锛�
String ServiceOrdTraDistance=MapValueUtils.getStringValue(order, "ServiceOrdTraDistance");
if(ServiceOrdTraDistance!=null){
- ServiceOrdTraDistance=ServiceOrdTraDistance.replaceAll("[^0-9]", "");
- createTaskVo.setTransferDistance(new BigDecimal(ServiceOrdTraDistance));
+ // 淇濈暀鏁板瓧鍜屽皬鏁扮偣锛岀Щ闄ゅ叾浠栧瓧绗�
+ ServiceOrdTraDistance=ServiceOrdTraDistance.replaceAll("[^0-9.]", "");
+ // 澶勭悊澶氫釜灏忔暟鐐圭殑鎯呭喌锛屽彧淇濈暀绗竴涓�
+ int firstDotIndex = ServiceOrdTraDistance.indexOf('.');
+ if (firstDotIndex != -1) {
+ ServiceOrdTraDistance = ServiceOrdTraDistance.substring(0, firstDotIndex + 1)
+ + ServiceOrdTraDistance.substring(firstDotIndex + 1).replace(".", "");
+ }
+ if (!ServiceOrdTraDistance.isEmpty() && !ServiceOrdTraDistance.equals(".")) {
+ createTaskVo.setTransferDistance(new BigDecimal(ServiceOrdTraDistance));
+ }
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QyWechatAccessTokenServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QyWechatAccessTokenServiceImpl.java
index ee04163..0872a68 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QyWechatAccessTokenServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QyWechatAccessTokenServiceImpl.java
@@ -152,7 +152,7 @@
// 妫�鏌ユ湇鍔℃槸鍚﹀惎鐢�
if (!isEnabled()) {
- log.info("浼佷笟寰俊鏈嶅姟宸茬鐢紝鏃犳硶鑾峰彇灏忕▼搴廇ccessToken");
+ log.error("浼佷笟寰俊鏈嶅姟宸茬鐢紝鏃犳硶鑾峰彇灏忕▼搴廇ccessToken");
return null;
}
@@ -251,7 +251,7 @@
String enabled = configService.selectConfigByKey("qy_wechat.enable");
return !"false".equals(enabled); // 榛樿鍚敤
} catch (Exception e) {
- log.warn("鑾峰彇浼佷笟寰俊鏈嶅姟鍚敤鐘舵�佸け璐ワ紝浣跨敤榛樿鍊�(true)", e);
+ log.error("鑾峰彇浼佷笟寰俊鏈嶅姟鍚敤鐘舵�佸け璐ワ紝浣跨敤榛樿鍊�(true)", e);
return true;
}
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TaskDispatchSyncUtilService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TaskDispatchSyncUtilService.java
index 46d91b1..9c3c5d5 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TaskDispatchSyncUtilService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TaskDispatchSyncUtilService.java
@@ -15,6 +15,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
@Service
@Slf4j
@@ -322,9 +323,10 @@
// 鑾峰彇浠诲姟鐨勬墽琛屼汉鍛樹俊鎭垪琛紙鍖呭惈瑙掕壊绫诲瀷锛� //TODO 濡傛灉鏈変袱涓徃鏈哄氨瑕� 璁剧疆銆�Entourage_1鍜孍ntourage_2
//涓や釜鎶ゅ+灏辫璁剧疆 Entourage_4鍜孍ntourage_6
//涓や釜鍖荤敓瑕佽缃� Entourage_3鍜孍ntourage_5
- List<TaskCreateVO.AssigneeInfo> assignees = getTaskAssignees(task.getTaskId());
- if (assignees == null || assignees.isEmpty()) {
+ List<TaskCreateVO.AssigneeInfo> assignees = getTaskAssignees(task.getTaskId());
+ log.info("浠诲姟鐨勬墽琛屼汉鍛�:{}",assignees.stream().map(TaskCreateVO.AssigneeInfo::getUserName).collect(Collectors.joining(",")));
+ if (assignees.isEmpty()) {
log.warn("浠诲姟鏃犳墽琛屼汉鍛橈紝浠诲姟ID: {}", task.getTaskId());
// 璁剧疆榛樿绌哄��
params.put("EntourageLeadID", "");
@@ -342,13 +344,16 @@
String driverOaId = ""; // 鍙告満鐨凮A_UserID
String doctorOaId = ""; // 鍖荤敓鐨凮A_UserID
String nurseOaId = ""; // 鎶ゅ+鐨凮A_UserID
+ String driverOaId2="";
+ String nurseOaId2="";
+ String doctorOaId2="";
// 閬嶅巻鎵ц浜哄憳锛屾牴鎹鑹茬被鍨嬪垎閰嶅埌瀵瑰簲鐨凟ntourage鍙傛暟
for (int i = 0; i < assignees.size(); i++) {
TaskCreateVO.AssigneeInfo assignee = assignees.get(i);
Long userId = assignee.getUserId();
String userType = assignee.getUserType(); // 鐩存帴浣跨敤鍓嶇浼犻�掔殑瑙掕壊绫诲瀷
-
+ log.info("浜哄憳鍚屾,鐢ㄦ埛ID:{},绫诲瀷锛歿}",userId,userType);
if (userId == null) {
continue;
}
@@ -361,11 +366,15 @@
}
String oaUserId = user.getOaUserId().toString();
-
+ log.info("浜哄憳鍚屾 22222,鐢ㄦ埛ID:{},绫诲瀷锛歿}",userId,userType);
// 鏍规嵁鐢ㄦ埛绫诲瀷鍒嗛厤鍒板搴旂殑Entourage鍙傛暟
if ("driver".equals(userType)) {
- if (driverOaId.isEmpty()) {
- driverOaId = oaUserId;
+ if(driverOaId.isEmpty()){
+ driverOaId = oaUserId;
+ }
+ if(driverOaId2.isEmpty()){
+ driverOaId2 = oaUserId;
+ }
if(params.get("Entourage_1")==null) {
params.put("Entourage_1", oaUserId);
}else{
@@ -375,10 +384,14 @@
if (i == 0 && leadEntourageId.isEmpty()) {
leadEntourageId = "1"; // 鍙告満瀵瑰簲Entourage_1
}
- }
+
} else if ("doctor".equals(userType)) {
if (doctorOaId.isEmpty()) {
doctorOaId = oaUserId;
+ }
+ if(doctorOaId2.isEmpty()){
+ doctorOaId2 = oaUserId;
+ }
if(params.get("Entourage_3")==null) {
params.put("Entourage_3", oaUserId);
}else{
@@ -388,10 +401,14 @@
if (i == 0 && leadEntourageId.isEmpty()) {
leadEntourageId = "3"; // 鍖荤敓瀵瑰簲Entourage_3
}
- }
+
} else if ("nurse".equals(userType)) {
if (nurseOaId.isEmpty()) {
nurseOaId = oaUserId;
+ }
+ if(nurseOaId2.isEmpty()){
+ nurseOaId2 = oaUserId;
+ }
if(params.get("Entourage_4")==null) {
params.put("Entourage_4", oaUserId);
}else{
@@ -401,7 +418,7 @@
if (i == 0 && leadEntourageId.isEmpty()) {
leadEntourageId = "4"; // 鎶ゅ+瀵瑰簲Entourage_4
}
- }
+
}
}
@@ -410,9 +427,9 @@
// params.put("Entourage_1", driverOaId); // 鍙告満
// params.put("Entourage_3", doctorOaId); // 鍖荤敓
// params.put("Entourage_4", nurseOaId); // 鎶ゅ+
-
-// log.info("浠诲姟鎵ц浜哄憳鍚屾鎴愬姛锛屼换鍔D: {}, 棰嗛槦ID: {}, 鍙告満: {}, 鍖荤敓: {}, 鎶ゅ+: {}",
-// task.getTaskId(), leadEntourageId, driverOaId, doctorOaId, nurseOaId);
+ log.info("鎵ц浜哄憳:{}", params);
+ log.info("浠诲姟鎵ц浜哄憳鍚屾鎴愬姛锛屼换鍔D: {}, 棰嗛槦ID: {}, 鍙告満: {}, 鍖荤敓: {}, 鎶ゅ+: {}",
+ task.getTaskId(), leadEntourageId, driverOaId, doctorOaId, nurseOaId);
} catch (Exception e) {
log.error("鍚屾浠诲姟鎵ц浜哄憳寮傚父锛屼换鍔D: {}", task.getTaskId(), e);
diff --git a/sql/qy_wechat_config.sql b/sql/qy_wechat_config.sql
index e532117..12e148b 100644
--- a/sql/qy_wechat_config.sql
+++ b/sql/qy_wechat_config.sql
@@ -6,14 +6,16 @@
'qy_wechat.enable',
'qy_wechat.corp_id',
'qy_wechat.corp_secret',
- 'qy_wechat.agent_id'
+ 'qy_wechat.agent_id',
+ 'qy_wechat.miniprogram_secret'
);
-- 鎻掑叆浼佷笟寰俊閰嶇疆椤�
INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES
-('浼佷笟寰俊鏈嶅姟鍚敤鐘舵��', 'qy_wechat.enable', 'false', 'Y', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊鏈嶅姟鏄惁鍚敤锛宼rue-鍚敤锛宖alse-绂佺敤'),
+('浼佷笟寰俊鏈嶅姟鍚敤鐘舵��', 'qy_wechat.enable', 'true', 'Y', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊鏈嶅姟鏄惁鍚敤锛宼rue-鍚敤锛宖alse-绂佺敤'),
('浼佷笟寰俊CorpID', 'qy_wechat.corp_id', 'wx248505bfbab6d0c1', 'N', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊浼佷笟ID'),
('浼佷笟寰俊CorpSecret', 'qy_wechat.corp_secret', '2MCilqWYC0FWjOQ894sbb-s7Lb5sVH4HHuJgOsd9l1k', 'N', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊搴旂敤瀵嗛挜'),
-('浼佷笟寰俊AgentId', 'qy_wechat.agent_id', '21', 'N', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊搴旂敤AgentId');
+('浼佷笟寰俊AgentId', 'qy_wechat.agent_id', '21', 'N', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊搴旂敤AgentId'),
+('浼佷笟寰俊灏忕▼搴廠ecret', 'qy_wechat.miniprogram_secret', 'YOUR_MINIPROGRAM_SECRET_HERE', 'N', 'admin', SYSDATE(), '', NULL, '浼佷笟寰俊灏忕▼搴忓瘑閽ワ紝鐢ㄤ簬灏忕▼搴忕櫥褰�');
COMMIT;
\ No newline at end of file
--
Gitblit v1.9.1